Search in sources :

Example 1 with JmxManagedJobExecutor

use of org.camunda.bpm.container.impl.jmx.services.JmxManagedJobExecutor 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)

Aggregations

AbstractProcessApplication (org.camunda.bpm.application.AbstractProcessApplication)1 JmxManagedJobExecutor (org.camunda.bpm.container.impl.jmx.services.JmxManagedJobExecutor)1 PlatformServiceContainer (org.camunda.bpm.container.impl.spi.PlatformServiceContainer)1 ProcessEngineConfiguration (org.camunda.bpm.engine.ProcessEngineConfiguration)1 JobExecutor (org.camunda.bpm.engine.impl.jobexecutor.JobExecutor)1 RuntimeContainerJobExecutor (org.camunda.bpm.engine.impl.jobexecutor.RuntimeContainerJobExecutor)1