Class SpringProcessApplication
- java.lang.Object
-
- org.camunda.bpm.application.AbstractProcessApplication
-
- org.camunda.bpm.engine.spring.application.SpringProcessApplication
-
- All Implemented Interfaces:
java.util.EventListener,ProcessApplicationInterface,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
- Direct Known Subclasses:
SpringBootProcessApplication,SpringServletProcessApplication
public class SpringProcessApplication extends AbstractProcessApplication implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
Process Application implementation to be used in a Spring Application.
This implementation is meant to be bootstrapped by a Spring Application Context. You can either reference the bean in a Spring application-context XML file or use spring annotation-based bootstrapping from a subclass.
HINT: If your application is a Web Application, consider using the
SpringServletProcessApplicationThe SpringProcessApplication will use the Bean Name assigned to the bean in the spring application context (see
BeanNameAware). You should always assign a unique bean name to a process application bean. That is, the bean name must be unique accross all applications deployed to the Camunda Platform.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.context.ApplicationContextapplicationContextprotected java.lang.StringbeanNameprotected java.util.Map<java.lang.String,java.lang.String>properties-
Fields inherited from class org.camunda.bpm.application.AbstractProcessApplication
defaultDeployToEngineName, isDeployed, processApplicationBeanElResolver, processApplicationElResolver, processApplicationScriptEnvironment, variableSerializers
-
-
Constructor Summary
Constructors Constructor Description SpringProcessApplication()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected java.lang.StringautodetectProcessApplicationName()Override this method to autodetect an application name in case theProcessApplicationannotation was used but without parameter.voiddestroy()org.springframework.context.ApplicationContextgetApplicationContext()java.util.Map<java.lang.String,java.lang.String>getProperties()override this method in order to provide a map of properties.ProcessApplicationReferencegetReference()Returns a globally sharable reference to this process application.voidonApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetBeanName(java.lang.String name)voidsetProperties(java.util.Map<java.lang.String,java.lang.String> properties)voidstart()voidstop()-
Methods inherited from class org.camunda.bpm.application.AbstractProcessApplication
createDeployment, deploy, execute, execute, getBeanElResolver, getDefaultDeployToEngineName, getElResolver, getEnvironmentScripts, getExecutionListener, getName, getProcessApplicationClassloader, getProcessApplicationScriptEnvironment, getRawObject, getScriptEngineForName, getTaskListener, getVariableSerializers, initProcessApplicationElResolver, setDefaultDeployToEngineName, setVariableSerializers, undeploy
-
-
-
-
Method Detail
-
autodetectProcessApplicationName
protected java.lang.String autodetectProcessApplicationName()
Description copied from class:AbstractProcessApplicationOverride this method to autodetect an application name in case theProcessApplicationannotation was used but without parameter.- Specified by:
autodetectProcessApplicationNamein classAbstractProcessApplication
-
getReference
public ProcessApplicationReference getReference()
Description copied from interface:ProcessApplicationInterfaceReturns a globally sharable reference to this process application. This reference may be safely passed to the process engine. And other applications.
- Specified by:
getReferencein interfaceProcessApplicationInterface- Returns:
- a globally sharable reference to this process application.
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
setBeanName
public void setBeanName(java.lang.String name)
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
getProperties
public 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 interfaceProcessApplicationInterface- Overrides:
getPropertiesin classAbstractProcessApplication- See Also:
ProcessApplicationService,ProcessApplicationInfo.getProperties()
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
-
start
public void start()
-
stop
public void stop()
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Throws:
java.lang.Exception
-
destroy
public void destroy() throws java.lang.Exception- Throws:
java.lang.Exception
-
-