Search in sources :

Example 16 with PlatformServiceContainer

use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.

the class StopProcessEnginesStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    Set<String> serviceNames = serviceContainer.getServiceNames(ServiceTypes.PROCESS_ENGINE);
    for (String serviceName : serviceNames) {
        stopProcessEngine(serviceName, serviceContainer);
    }
}
Also used : PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer)

Example 17 with PlatformServiceContainer

use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.

the class StartJobAcquisitionStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
    ClassLoader configurationClassloader = null;
    if (processApplication != null) {
        configurationClassloader = processApplication.getProcessApplicationClassloader();
    } else {
        configurationClassloader = ProcessEngineConfiguration.class.getClassLoader();
    }
    String configurationClassName = jobAcquisitionXml.getJobExecutorClassName();
    if (configurationClassName == null || configurationClassName.isEmpty()) {
        configurationClassName = RuntimeContainerJobExecutor.class.getName();
    }
    // create & instantiate the job executor class
    Class<? extends JobExecutor> jobExecutorClass = loadJobExecutorClass(configurationClassloader, configurationClassName);
    JobExecutor jobExecutor = instantiateJobExecutor(jobExecutorClass);
    // apply properties
    Map<String, String> properties = jobAcquisitionXml.getProperties();
    PropertyHelper.applyProperties(jobExecutor, properties);
    // construct service for job executor
    JmxManagedJobExecutor jmxManagedJobExecutor = new JmxManagedJobExecutor(jobExecutor);
    // deploy the job executor service into the container
    serviceContainer.startService(ServiceTypes.JOB_EXECUTOR, jobAcquisitionXml.getName(), jmxManagedJobExecutor);
}
Also used : JmxManagedJobExecutor(org.camunda.bpm.container.impl.jmx.services.JmxManagedJobExecutor) AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) ProcessEngineConfiguration(org.camunda.bpm.engine.ProcessEngineConfiguration) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) JobExecutor(org.camunda.bpm.engine.impl.jobexecutor.JobExecutor) JmxManagedJobExecutor(org.camunda.bpm.container.impl.jmx.services.JmxManagedJobExecutor) RuntimeContainerJobExecutor(org.camunda.bpm.engine.impl.jobexecutor.RuntimeContainerJobExecutor) RuntimeContainerJobExecutor(org.camunda.bpm.engine.impl.jobexecutor.RuntimeContainerJobExecutor)

Example 18 with PlatformServiceContainer

use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.

the class StopManagedThreadPoolStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    serviceContainer.stopService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_EXECUTOR);
}
Also used : PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer)

Example 19 with PlatformServiceContainer

use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.

the class ProcessesXmlStopProcessEnginesStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
    final JmxManagedProcessApplication deployedProcessApplication = serviceContainer.getService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
    ensureNotNull("Cannot find process application with name " + processApplication.getName(), "deployedProcessApplication", deployedProcessApplication);
    List<ProcessesXml> processesXmls = deployedProcessApplication.getProcessesXmls();
    for (ProcessesXml processesXml : processesXmls) {
        stopProcessEngines(processesXml.getProcessEngines(), operationContext);
    }
}
Also used : AbstractProcessApplication(org.camunda.bpm.application.AbstractProcessApplication) ProcessesXml(org.camunda.bpm.application.impl.metadata.spi.ProcessesXml) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) JmxManagedProcessApplication(org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)

Example 20 with PlatformServiceContainer

use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.

the class UndeployProcessArchiveStep method performOperationStep.

public void performOperationStep(DeploymentOperation operationContext) {
    final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
    final Map<String, DeployedProcessArchive> processArchiveDeploymentMap = deployedProcessApplication.getProcessArchiveDeploymentMap();
    final DeployedProcessArchive deployedProcessArchive = processArchiveDeploymentMap.get(processArchive.getName());
    final ProcessEngine processEngine = serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, processEngineName);
    // unregrister with the process engine.
    processEngine.getManagementService().unregisterProcessApplication(deployedProcessArchive.getAllDeploymentIds(), true);
    // delete the deployment if not disabled
    if (PropertyHelper.getBooleanProperty(processArchive.getProperties(), ProcessArchiveXml.PROP_IS_DELETE_UPON_UNDEPLOY, false)) {
        if (processEngine != null) {
            // always cascade & skip custom listeners
            deleteDeployment(deployedProcessArchive.getPrimaryDeploymentId(), processEngine.getRepositoryService());
        }
    }
}
Also used : DeployedProcessArchive(org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive) PlatformServiceContainer(org.camunda.bpm.container.impl.spi.PlatformServiceContainer) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Aggregations

PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)23 AbstractProcessApplication (org.camunda.bpm.application.AbstractProcessApplication)9 JmxManagedProcessApplication (org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessApplication)5 DeployedProcessArchive (org.camunda.bpm.container.impl.deployment.util.DeployedProcessArchive)4 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)4 ProcessesXml (org.camunda.bpm.application.impl.metadata.spi.ProcessesXml)3 JmxManagedBpmPlatformPlugins (org.camunda.bpm.container.impl.jmx.services.JmxManagedBpmPlatformPlugins)2 JobExecutor (org.camunda.bpm.engine.impl.jobexecutor.JobExecutor)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1 ProcessApplicationDeploymentInfo (org.camunda.bpm.application.ProcessApplicationDeploymentInfo)1 ProcessApplicationInfo (org.camunda.bpm.application.ProcessApplicationInfo)1 ProcessApplicationInfoImpl (org.camunda.bpm.application.impl.ProcessApplicationInfoImpl)1 ProcessArchiveXml (org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)1 JmxManagedJobExecutor (org.camunda.bpm.container.impl.jmx.services.JmxManagedJobExecutor)1