Class AbstractProcessApplication
- java.lang.Object
- 
- org.camunda.bpm.application.AbstractProcessApplication
 
- 
- All Implemented Interfaces:
- ProcessApplicationInterface
 - Direct Known Subclasses:
- EjbProcessApplication,- EmbeddedProcessApplication,- ServletProcessApplication,- SpringProcessApplication
 
 public abstract class AbstractProcessApplication extends java.lang.Object implements ProcessApplicationInterface - Author:
- Daniel Meyer
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringdefaultDeployToEngineNameprotected booleanisDeployedprotected BeanELResolverprocessApplicationBeanElResolverprotected ELResolverprocessApplicationElResolverprotected ProcessApplicationScriptEnvironmentprocessApplicationScriptEnvironmentprotected VariableSerializersvariableSerializers
 - 
Constructor SummaryConstructors Constructor Description AbstractProcessApplication()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.StringautodetectProcessApplicationName()Override this method to autodetect an application name in case theProcessApplicationannotation was used but without parameter.voidcreateDeployment(java.lang.String processArchiveName, DeploymentBuilder deploymentBuilder)Override this method in order to programmatically add resources to the deployment created by this process application.voiddeploy()Deploy this process application into the runtime container.<T> Texecute(java.util.concurrent.Callable<T> callable)The default implementation simply modifies the ContextClassLoader<T> Texecute(java.util.concurrent.Callable<T> callable, InvocationContext invocationContext)Is invoked instead ofProcessApplicationInterface.execute(Callable)if a context is available.BeanELResolvergetBeanElResolver()Returns an instance ofBeanELResolverthat a process application caches.java.lang.StringgetDefaultDeployToEngineName()Provides the default Process Engine name to deploy to, if no Process Engine was defined inprocesses.xml.ELResolvergetElResolver()This allows the process application to provide a custom ElResolver to the process engine.java.util.Map<java.lang.String,java.util.List<ExecutableScript>>getEnvironmentScripts()ExecutionListenergetExecutionListener()Allows the process application to provide anExecutionListenerwhich is notified about all execution events in all of the process instances deployed by this process application.java.lang.StringgetName()java.lang.ClassLoadergetProcessApplicationClassloader()Override this method to provide an environment-specificClassLoaderto be used by the process engine for loading resources from the process applicationprotected ProcessApplicationScriptEnvironmentgetProcessApplicationScriptEnvironment()java.util.Map<java.lang.String,java.lang.String>getProperties()override this method in order to provide a map of properties.ProcessApplicationInterfacegetRawObject()SinceProcessApplicationInterface.getReference()may return a proxy object, this method returs the actual, unproxied object and is meant to be called from theProcessApplicationInterface.execute(Callable)method.javax.script.ScriptEnginegetScriptEngineForName(java.lang.String name, boolean cache)TaskListenergetTaskListener()Allows the process application to provide aTaskListenerwhich is notified about all Task events in all of the process instances deployed by this process application.VariableSerializersgetVariableSerializers()protected ELResolverinitProcessApplicationElResolver()Initializes the process application provided ElResolver.protected voidsetDefaultDeployToEngineName(java.lang.String defaultDeployToEngineName)Programmatically set the name of the Process Engine to deploy to if no Process Engine is defined inprocesses.xml.voidsetVariableSerializers(VariableSerializers variableSerializers)voidundeploy()Undeploy this process application from the runtime container.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.camunda.bpm.application.ProcessApplicationInterfacegetReference
 
- 
 
- 
- 
- 
Field Detail- 
processApplicationElResolverprotected ELResolver processApplicationElResolver 
 - 
processApplicationBeanElResolverprotected BeanELResolver processApplicationBeanElResolver 
 - 
processApplicationScriptEnvironmentprotected ProcessApplicationScriptEnvironment processApplicationScriptEnvironment 
 - 
variableSerializersprotected VariableSerializers variableSerializers 
 - 
isDeployedprotected boolean isDeployed 
 - 
defaultDeployToEngineNameprotected java.lang.String defaultDeployToEngineName 
 
- 
 - 
Method Detail- 
deploypublic void deploy() Description copied from interface:ProcessApplicationInterfaceDeploy this process application into the runtime container. NOTE: on some containers (like WildFly) the deployment of the process application is performed asynchronously and via introspection at deployment time. This means that there is no guarantee that the process application is fully deployed after this method returns.If you need a post deployment hook, use the @ PostDeployannotation.- Specified by:
- deployin interface- ProcessApplicationInterface
 
 - 
undeploypublic void undeploy() Description copied from interface:ProcessApplicationInterfaceUndeploy this process application from the runtime container. If your application needs to be notified of the undeployment, add a @ PreUndeploymethod to your subclass.- Specified by:
- undeployin interface- ProcessApplicationInterface
 
 - 
createDeploymentpublic void createDeployment(java.lang.String processArchiveName, DeploymentBuilder deploymentBuilder)Description copied from interface:ProcessApplicationInterfaceOverride this method in order to programmatically add resources to the deployment created by this process application. This method is invoked at deployment time once for each process archive deployed by this process application. NOTE: this method must NOT call the DeploymentBuilder.deploy()method.- Specified by:
- createDeploymentin interface- ProcessApplicationInterface
- Parameters:
- processArchiveName- the name of the processArchive which is currently being deployed.
- deploymentBuilder- the- DeploymentBuilderused to construct the deployment.
 
 - 
getNamepublic java.lang.String getName() - Specified by:
- getNamein interface- ProcessApplicationInterface
- Returns:
- the name of this process application
 
 - 
autodetectProcessApplicationNameprotected abstract java.lang.String autodetectProcessApplicationName() Override this method to autodetect an application name in case theProcessApplicationannotation was used but without parameter.
 - 
executepublic <T> T execute(java.util.concurrent.Callable<T> callable) throws ProcessApplicationExecutionExceptionDescription copied from interface:ProcessApplicationInterfaceThe default implementation simply modifies the ContextClassLoader- Specified by:
- executein interface- ProcessApplicationInterface
- Parameters:
- callable- to be executed "within" the context of this process application.
- Returns:
- the result of the callback
- Throws:
- ProcessApplicationExecutionException
 
 - 
executepublic <T> T execute(java.util.concurrent.Callable<T> callable, InvocationContext invocationContext) throws ProcessApplicationExecutionExceptionDescription copied from interface:ProcessApplicationInterfaceIs invoked instead ofProcessApplicationInterface.execute(Callable)if a context is available. The default implementation simply forward the call toProcessApplicationInterface.execute(Callable). A custom implementation can override the method to hook into the invocation.- Specified by:
- executein interface- ProcessApplicationInterface
- Parameters:
- callable- to be executed "within" the context of this process application.
- invocationContext- of the current invocation, can be- null
- Returns:
- the result of the callback
- Throws:
- ProcessApplicationExecutionException
 
 - 
getProcessApplicationClassloaderpublic java.lang.ClassLoader getProcessApplicationClassloader() Description copied from interface:ProcessApplicationInterfaceOverride this method to provide an environment-specific ClassLoaderto be used by the process engine for loading resources from the process applicationNOTE: the process engine must never cache any references to this ClassLoaderor to classes obtained through thisClassLoader.- Specified by:
- getProcessApplicationClassloaderin interface- ProcessApplicationInterface
- Returns:
- the ClassLoaderthat can be used to load classes and resources from this process application.
 
 - 
getRawObjectpublic ProcessApplicationInterface getRawObject() Description copied from interface:ProcessApplicationInterfaceSinceProcessApplicationInterface.getReference()may return a proxy object, this method returs the actual, unproxied object and is meant to be called from theProcessApplicationInterface.execute(Callable)method. (ie. from a Callable implementation passed to the method.).- Specified by:
- getRawObjectin interface- ProcessApplicationInterface
 
 - 
getPropertiespublic java.util.Map<java.lang.String,java.lang.String> getProperties() Description copied from interface:ProcessApplicationInterfaceoverride this method in order to provide a map of properties. The properties are made available globally through the ProcessApplicationService- Specified by:
- getPropertiesin interface- ProcessApplicationInterface
- See Also:
- ProcessApplicationService,- ProcessApplicationInfo.getProperties()
 
 - 
getElResolverpublic ELResolver getElResolver() Description copied from interface:ProcessApplicationInterfaceThis allows the process application to provide a custom ElResolver to the process engine. The process engine will use this ElResolver whenever it is executing a process in the context of this process application. The process engine must only call this method from Callable implementations passed to ProcessApplicationInterface.execute(Callable)- Specified by:
- getElResolverin interface- ProcessApplicationInterface
 
 - 
getBeanElResolverpublic BeanELResolver getBeanElResolver() Description copied from interface:ProcessApplicationInterfaceReturns an instance of BeanELResolverthat a process application caches.Has to be managed by the process application since BeanELResolverkeeps hard references to classes in a cache.- Specified by:
- getBeanElResolverin interface- ProcessApplicationInterface
 
 - 
initProcessApplicationElResolverprotected ELResolver initProcessApplicationElResolver() Initializes the process application provided ElResolver. This implementation uses the Java SE ServiceLoaderfacilities for resolving implementations ofProcessApplicationElResolver.If you want to provide a custom implementation in your application, place a file named META-INF/org.camunda.bpm.application.ProcessApplicationElResolverinside your application which contains the fully qualified classname of your implementation. Or simply override this method.- Returns:
- the process application ElResolver.
 
 - 
getExecutionListenerpublic ExecutionListener getExecutionListener() Description copied from interface:ProcessApplicationInterfaceAllows the process application to provide an ExecutionListenerwhich is notified about all execution events in all of the process instances deployed by this process application.If this method returns 'null', the process application is not notified about execution events. - Specified by:
- getExecutionListenerin interface- ProcessApplicationInterface
- Returns:
- an ExecutionListeneror null.
 
 - 
getTaskListenerpublic TaskListener getTaskListener() Description copied from interface:ProcessApplicationInterfaceAllows the process application to provide a TaskListenerwhich is notified about all Task events in all of the process instances deployed by this process application.If this method returns 'null', the process application is not notified about Task events. - Specified by:
- getTaskListenerin interface- ProcessApplicationInterface
- Returns:
- a TaskListeneror null.
 
 - 
getScriptEngineForNamepublic javax.script.ScriptEngine getScriptEngineForName(java.lang.String name, boolean cache)
 - 
getEnvironmentScriptspublic java.util.Map<java.lang.String,java.util.List<ExecutableScript>> getEnvironmentScripts() 
 - 
getProcessApplicationScriptEnvironmentprotected ProcessApplicationScriptEnvironment getProcessApplicationScriptEnvironment() 
 - 
getVariableSerializerspublic VariableSerializers getVariableSerializers() 
 - 
setVariableSerializerspublic void setVariableSerializers(VariableSerializers variableSerializers) 
 - 
getDefaultDeployToEngineNamepublic java.lang.String getDefaultDeployToEngineName() Provides the default Process Engine name to deploy to, if no Process Engine was defined in processes.xml.- Returns:
- the default deploy-to Process Engine name. The default value is "default".
 
 - 
setDefaultDeployToEngineNameprotected void setDefaultDeployToEngineName(java.lang.String defaultDeployToEngineName) Programmatically set the name of the Process Engine to deploy to if no Process Engine is defined in processes.xml. This allows to circumvent the "default" Process Engine name and set a custom one.- Parameters:
- defaultDeployToEngineName-
 
 
- 
 
-