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