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);
}
Aggregations