use of org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml in project camunda-bpm-platform by camunda.
the class StartManagedThreadPoolStep method performOperationStep.
public void performOperationStep(DeploymentOperation operationContext) {
final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
JobExecutorXml jobExecutorXml = getJobExecutorXml(operationContext);
int queueSize = getQueueSize(jobExecutorXml);
int corePoolSize = getCorePoolSize(jobExecutorXml);
int maxPoolSize = getMaxPoolSize(jobExecutorXml);
long keepAliveTime = getKeepAliveTime(jobExecutorXml);
// initialize Queue & Executor services
BlockingQueue<Runnable> threadPoolQueue = new ArrayBlockingQueue<Runnable>(queueSize);
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(corePoolSize, maxPoolSize, keepAliveTime, TimeUnit.MILLISECONDS, threadPoolQueue);
threadPoolExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
// construct the service for the thread pool
JmxManagedThreadPool managedThreadPool = new JmxManagedThreadPool(threadPoolQueue, threadPoolExecutor);
// install the service into the container
serviceContainer.startService(ServiceTypes.BPM_PLATFORM, RuntimeContainerDelegateImpl.SERVICE_NAME_EXECUTOR, managedThreadPool);
}
use of org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml in project camunda-bpm-platform by camunda.
the class StartManagedThreadPoolStep method getJobExecutorXml.
private JobExecutorXml getJobExecutorXml(DeploymentOperation operationContext) {
BpmPlatformXml bpmPlatformXml = operationContext.getAttachment(Attachments.BPM_PLATFORM_XML);
JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
return jobExecutorXml;
}
use of org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml in project camunda-bpm-platform by camunda.
the class StartJobExecutorStep method getJobExecutorXml.
private JobExecutorXml getJobExecutorXml(DeploymentOperation operationContext) {
BpmPlatformXml bpmPlatformXml = operationContext.getAttachment(Attachments.BPM_PLATFORM_XML);
JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
return jobExecutorXml;
}
use of org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParserTest method testParseBpmPlatformXmlNoEngine.
public void testParseBpmPlatformXmlNoEngine() {
BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_no_engine.xml")).execute().getBpmPlatformXml();
assertNotNull(bpmPlatformXml);
assertNotNull(bpmPlatformXml.getJobExecutor());
assertEquals(0, bpmPlatformXml.getProcessEngines().size());
JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
assertEquals(1, jobExecutorXml.getJobAcquisitions().size());
JobAcquisitionXml jobAcquisitionXml = jobExecutorXml.getJobAcquisitions().get(0);
assertEquals("default", jobAcquisitionXml.getName());
assertEquals("org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor", jobAcquisitionXml.getJobExecutorClassName());
assertEquals(2, jobAcquisitionXml.getProperties().size());
}
use of org.camunda.bpm.container.impl.metadata.spi.JobExecutorXml in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParserTest method testParseBpmPlatformXmlOneEngine.
public void testParseBpmPlatformXmlOneEngine() {
BpmPlatformXml bpmPlatformXml = parser.createParse().sourceUrl(getStreamUrl("bpmplatform_xml_one_engine.xml")).execute().getBpmPlatformXml();
assertNotNull(bpmPlatformXml);
assertNotNull(bpmPlatformXml.getJobExecutor());
assertEquals(1, bpmPlatformXml.getProcessEngines().size());
JobExecutorXml jobExecutorXml = bpmPlatformXml.getJobExecutor();
assertEquals(1, jobExecutorXml.getJobAcquisitions().size());
assertThat(jobExecutorXml.getProperties().size(), is(2));
JobAcquisitionXml jobAcquisitionXml = jobExecutorXml.getJobAcquisitions().get(0);
assertEquals("default", jobAcquisitionXml.getName());
assertEquals("org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor", jobAcquisitionXml.getJobExecutorClassName());
assertEquals(2, jobAcquisitionXml.getProperties().size());
ProcessEngineXml engineXml = bpmPlatformXml.getProcessEngines().get(0);
assertEquals("engine1", engineXml.getName());
assertEquals("default", engineXml.getJobAcquisitionName());
Map<String, String> properties = engineXml.getProperties();
assertNotNull(properties);
assertEquals(0, properties.size());
List<ProcessEnginePluginXml> plugins = engineXml.getPlugins();
assertNotNull(plugins);
assertEquals(0, plugins.size());
}
Aggregations