use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class PreUndeployInvocationStep method performOperationStep.
public void performOperationStep(DeploymentOperation operationContext) {
final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
final String paName = processApplication.getName();
Class<? extends AbstractProcessApplication> paClass = processApplication.getClass();
Method preUndeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PreUndeploy.class);
if (preUndeployMethod == null) {
LOG.debugPaLifecycleMethodNotFound(CALLBACK_NAME, paName);
return;
}
LOG.debugFoundPaLifecycleCallbackMethod(CALLBACK_NAME, paName);
// resolve injections
Object[] injections = InjectionUtil.resolveInjections(operationContext, preUndeployMethod);
try {
// perform the actual invocation
preUndeployMethod.invoke(processApplication, injections);
} catch (IllegalArgumentException e) {
throw LOG.exceptionWhileInvokingPaLifecycleCallback(CALLBACK_NAME, paName, e);
} catch (IllegalAccessException e) {
throw LOG.exceptionWhileInvokingPaLifecycleCallback(CALLBACK_NAME, paName, e);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
} else {
throw LOG.exceptionWhileInvokingPaLifecycleCallback(CALLBACK_NAME, paName, e);
}
}
}
use of org.camunda.bpm.application.AbstractProcessApplication 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.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class PostDeployInvocationStep method performOperationStep.
public void performOperationStep(DeploymentOperation operationContext) {
final AbstractProcessApplication processApplication = operationContext.getAttachment(Attachments.PROCESS_APPLICATION);
final String paName = processApplication.getName();
Class<? extends AbstractProcessApplication> paClass = processApplication.getClass();
Method postDeployMethod = InjectionUtil.detectAnnotatedMethod(paClass, PostDeploy.class);
if (postDeployMethod == null) {
LOG.debugPaLifecycleMethodNotFound(CALLBACK_NAME, paName);
return;
}
LOG.debugFoundPaLifecycleCallbackMethod(CALLBACK_NAME, paName);
// resolve injections
Object[] injections = InjectionUtil.resolveInjections(operationContext, postDeployMethod);
try {
// perform the actual invocation
postDeployMethod.invoke(processApplication, injections);
} catch (IllegalArgumentException e) {
throw LOG.exceptionWhileInvokingPaLifecycleCallback(CALLBACK_NAME, paName, e);
} catch (IllegalAccessException e) {
throw LOG.exceptionWhileInvokingPaLifecycleCallback(CALLBACK_NAME, paName, e);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
} else {
throw LOG.exceptionWhileInvokingPaLifecycleCallback(CALLBACK_NAME, paName, e);
}
}
}
use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class ParseProcessesXmlStep method performOperationStep.
public void performOperationStep(DeploymentOperation operationContext) {
final AbstractProcessApplication processApplication = operationContext.getAttachment(PROCESS_APPLICATION);
Map<URL, ProcessesXml> parsedFiles = parseProcessesXmlFiles(processApplication);
// attach parsed metadata
operationContext.addAttachment(PROCESSES_XML_RESOURCES, parsedFiles);
}
use of org.camunda.bpm.application.AbstractProcessApplication in project camunda-bpm-platform by camunda.
the class PaLocalScriptEngineDisabledCacheTest method shouldNotCacheScriptEngine.
@Test
public void shouldNotCacheScriptEngine() {
AbstractProcessApplication processApplication = (AbstractProcessApplication) getProcessApplication();
assertNotEquals(processApplication.getScriptEngineForName(SCRIPT_FORMAT, false), processApplication.getScriptEngineForName(SCRIPT_FORMAT, false));
}
Aggregations