use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.
the class StopJobExecutorStep method performOperationStep.
public void performOperationStep(DeploymentOperation operationContext) {
final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
Set<String> jobExecutorServiceNames = serviceContainer.getServiceNames(ServiceTypes.JOB_EXECUTOR);
for (String serviceName : jobExecutorServiceNames) {
try {
serviceContainer.stopService(serviceName);
} catch (Exception e) {
LOG.exceptionWhileStopping("Job Executor Service", serviceName, e);
}
}
}
use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.
the class UndeployProcessArchivesStep 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);
Map<String, DeployedProcessArchive> deploymentMap = deployedProcessApplication.getProcessArchiveDeploymentMap();
if (deploymentMap != null) {
List<ProcessesXml> processesXmls = deployedProcessApplication.getProcessesXmls();
for (ProcessesXml processesXml : processesXmls) {
for (ProcessArchiveXml parsedProcessArchive : processesXml.getProcessArchives()) {
DeployedProcessArchive deployedProcessArchive = deploymentMap.get(parsedProcessArchive.getName());
if (deployedProcessArchive != null) {
operationContext.addStep(new UndeployProcessArchiveStep(deployedProcessApplication, parsedProcessArchive, deployedProcessArchive.getProcessEngineName()));
}
}
}
}
}
use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer 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.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.
the class InjectionUtil method getProcessEngines.
public static List<ProcessEngine> getProcessEngines(DeploymentOperation operationContext) {
final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
final ProcessApplicationInfo processApplicationInfo = getProcessApplicationInfo(operationContext);
List<ProcessEngine> processEngines = new ArrayList<ProcessEngine>();
for (ProcessApplicationDeploymentInfo deploymentInfo : processApplicationInfo.getDeploymentInfo()) {
String processEngineName = deploymentInfo.getProcessEngineName();
processEngines.add((ProcessEngine) serviceContainer.getServiceValue(ServiceTypes.PROCESS_ENGINE, processEngineName));
}
return processEngines;
}
use of org.camunda.bpm.container.impl.spi.PlatformServiceContainer in project camunda-bpm-platform by camunda.
the class InjectionUtil method getProcessApplicationInfo.
public static ProcessApplicationInfo getProcessApplicationInfo(DeploymentOperation operationContext) {
final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
JmxManagedProcessApplication managedPa = serviceContainer.getServiceValue(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
return managedPa.getProcessApplicationInfo();
}
Aggregations