use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class AbstractDefinitionDeployer method registerDefinition.
protected void registerDefinition(DeploymentEntity deployment, DefinitionEntity definition, Properties properties) {
DeploymentCache deploymentCache = getDeploymentCache();
// Add to cache
addDefinitionToDeploymentCache(deploymentCache, definition);
definitionAddedToDeploymentCache(deployment, definition, properties);
// Add to deployment for further usage
deployment.addDeployedArtifact(definition);
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class ProcessEngineConfigurationImpl method initDeployers.
// deployers ////////////////////////////////////////////////////////////////
protected void initDeployers() {
if (this.deployers == null) {
this.deployers = new ArrayList<Deployer>();
if (customPreDeployers != null) {
this.deployers.addAll(customPreDeployers);
}
this.deployers.addAll(getDefaultDeployers());
if (customPostDeployers != null) {
this.deployers.addAll(customPostDeployers);
}
}
if (deploymentCache == null) {
List<Deployer> deployers = new ArrayList<Deployer>();
if (customPreDeployers != null) {
deployers.addAll(customPreDeployers);
}
deployers.addAll(getDefaultDeployers());
if (customPostDeployers != null) {
deployers.addAll(customPostDeployers);
}
initCacheFactory();
deploymentCache = new DeploymentCache(cacheFactory, cacheCapacity);
deploymentCache.setDeployers(deployers);
}
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class PurgeDatabaseAndCacheCmd method execute.
@Override
public PurgeReport execute(CommandContext commandContext) {
PurgeReport purgeReport = new PurgeReport();
// purge the database
DatabasePurgeReport databasePurgeReport = purgeDatabase(commandContext);
purgeReport.setDatabasePurgeReport(databasePurgeReport);
// purge the deployment cache
DeploymentCache deploymentCache = commandContext.getProcessEngineConfiguration().getDeploymentCache();
CachePurgeReport cachePurgeReport = deploymentCache.purgeCache();
purgeReport.setCachePurgeReport(cachePurgeReport);
return purgeReport;
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class GetDeployedStartFormCmd method checkAuthorization.
@Override
protected void checkAuthorization(CommandContext commandContext) {
ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
DeploymentCache deploymentCache = processEngineConfiguration.getDeploymentCache();
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadProcessDefinition(processDefinition);
}
}
use of org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache in project camunda-bpm-platform by camunda.
the class SignalEventReceivedCmd method getProcessDefinitionsOfSubscriptions.
protected Map<String, ProcessDefinitionEntity> getProcessDefinitionsOfSubscriptions(List<EventSubscriptionEntity> startSignalEventSubscriptions) {
DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache();
Map<String, ProcessDefinitionEntity> processDefinitions = new HashMap<String, ProcessDefinitionEntity>();
for (EventSubscriptionEntity eventSubscription : startSignalEventSubscriptions) {
String processDefinitionId = eventSubscription.getConfiguration();
ensureNotNull("Configuration of signal start event subscription '" + eventSubscription.getId() + "' contains no process definition id.", processDefinitionId);
ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId);
if (processDefinition != null && !processDefinition.isSuspended()) {
processDefinitions.put(eventSubscription.getId(), processDefinition);
}
}
return processDefinitions;
}
Aggregations