Search in sources :

Example 16 with DeploymentCache

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);
}
Also used : DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)

Example 17 with DeploymentCache

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);
    }
}
Also used : ArrayList(java.util.ArrayList) DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) Deployer(org.camunda.bpm.engine.impl.persistence.deploy.Deployer) CmmnDeployer(org.camunda.bpm.engine.impl.cmmn.deployer.CmmnDeployer) DecisionDefinitionDeployer(org.camunda.bpm.engine.impl.dmn.deployer.DecisionDefinitionDeployer) DecisionRequirementsDefinitionDeployer(org.camunda.bpm.engine.impl.dmn.deployer.DecisionRequirementsDefinitionDeployer) BpmnDeployer(org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer)

Example 18 with DeploymentCache

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;
}
Also used : DatabasePurgeReport(org.camunda.bpm.engine.impl.management.DatabasePurgeReport) DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) CachePurgeReport(org.camunda.bpm.engine.impl.persistence.deploy.cache.CachePurgeReport) CachePurgeReport(org.camunda.bpm.engine.impl.persistence.deploy.cache.CachePurgeReport) DatabasePurgeReport(org.camunda.bpm.engine.impl.management.DatabasePurgeReport) PurgeReport(org.camunda.bpm.engine.impl.management.PurgeReport)

Example 19 with DeploymentCache

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);
    }
}
Also used : DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Example 20 with DeploymentCache

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;
}
Also used : HashMap(java.util.HashMap) DeploymentCache(org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity) EventSubscriptionEntity(org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity)

Aggregations

DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)41 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)18 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)15 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)10 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)8 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)5 Test (org.junit.Test)5 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)4 RepositoryService (org.camunda.bpm.engine.RepositoryService)4 Command (org.camunda.bpm.engine.impl.interceptor.Command)4 ArrayList (java.util.ArrayList)3 CaseDefinitionEntity (org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity)3 DecisionDefinitionEntity (org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity)3 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)3 DecisionRequirementsDefinitionEntity (org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionRequirementsDefinitionEntity)2 StartFormHandler (org.camunda.bpm.engine.impl.form.handler.StartFormHandler)2 EventSubscriptionEntity (org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity)2 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)2 ProcessDefinitionImpl (org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)2 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)2