use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class TypedValueField method getCurrentPaSerializers.
protected static VariableSerializers getCurrentPaSerializers() {
if (Context.getCurrentProcessApplication() != null) {
ProcessApplicationReference processApplicationReference = Context.getCurrentProcessApplication();
try {
ProcessApplicationInterface processApplicationInterface = processApplicationReference.getProcessApplication();
ProcessApplicationInterface rawPa = processApplicationInterface.getRawObject();
if (rawPa instanceof AbstractProcessApplication) {
return ((AbstractProcessApplication) rawPa).getVariableSerializers();
} else {
return null;
}
} catch (ProcessApplicationUnavailableException e) {
throw LOG.cannotDeterminePaDataformats(e);
}
} else {
return null;
}
}
use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class PaLocalScriptEngineEnabledCacheTest method shouldCacheScriptEngine.
@Test
public void shouldCacheScriptEngine() {
AbstractProcessApplication processApplication = (AbstractProcessApplication) getProcessApplication();
assertEquals(processApplication.getScriptEngineForName(SCRIPT_FORMAT, true), processApplication.getScriptEngineForName(SCRIPT_FORMAT, true));
}
use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class StartProcessApplicationServiceStep method performOperationStep.
public void performOperationStep(DeploymentOperation operationContext) {
final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
final Map<URL, ProcessesXml> processesXmls = operationContext.getAttachment(PROCESSES_XML_RESOURCES);
final Map<String, DeployedProcessArchive> processArchiveDeploymentMap = operationContext.getAttachment(PROCESS_ARCHIVE_DEPLOYMENT_MAP);
final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
ProcessApplicationInfoImpl processApplicationInfo = createProcessApplicationInfo(processApplication, processArchiveDeploymentMap);
// create service
JmxManagedProcessApplication mbean = new JmxManagedProcessApplication(processApplicationInfo, processApplication.getReference());
mbean.setProcessesXmls(new ArrayList<ProcessesXml>(processesXmls.values()));
mbean.setDeploymentMap(processArchiveDeploymentMap);
// start service
serviceContainer.startService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName(), mbean);
notifyBpmPlatformPlugins(serviceContainer, processApplication);
}
use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class StopProcessApplicationServiceStep method performOperationStep.
public void performOperationStep(DeploymentOperation operationContext) {
final PlatformServiceContainer serviceContainer = operationContext.getServiceContainer();
final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
// remove the service
serviceContainer.stopService(ServiceTypes.PROCESS_APPLICATION, processApplication.getName());
}
use of org.camunda.bpm.application.AbstractProcessApplication 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