Class SpringProcessApplication
- java.lang.Object
-
- org.camunda.bpm.application.AbstractProcessApplication
-
- org.camunda.bpm.engine.spring.application.SpringProcessApplication
-
- All Implemented Interfaces:
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
SpringServletProcessApplication
The 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.ApplicationContext
applicationContext
protected String
beanName
protected Map<String,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 void
afterPropertiesSet()
protected String
autodetectProcessApplicationName()
Override this method to autodetect an application name in case theProcessApplication
annotation was used but without parameter.void
destroy()
org.springframework.context.ApplicationContext
getApplicationContext()
Map<String,String>
getProperties()
override this method in order to provide a map of properties.ProcessApplicationReference
getReference()
Returns a globally sharable reference to this process application.void
onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setBeanName(String name)
void
setProperties(Map<String,String> properties)
void
start()
void
stop()
-
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 String autodetectProcessApplicationName()
Description copied from class:AbstractProcessApplication
Override this method to autodetect an application name in case theProcessApplication
annotation was used but without parameter.- Specified by:
autodetectProcessApplicationName
in classAbstractProcessApplication
-
getReference
public ProcessApplicationReference getReference()
Description copied from interface:ProcessApplicationInterface
Returns a globally sharable reference to this process application. This reference may be safely passed to the process engine. And other applications.
- Specified by:
getReference
in 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:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
setBeanName
public void setBeanName(String name)
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
getProperties
public Map<String,String> getProperties()
Description copied from interface:ProcessApplicationInterface
override this method in order to provide a map of properties.
The properties are made available globally through the
ProcessApplicationService
- Specified by:
getProperties
in interfaceProcessApplicationInterface
- Overrides:
getProperties
in classAbstractProcessApplication
- See Also:
ProcessApplicationService
,ProcessApplicationInfo.getProperties()
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
-
start
public void start()
-
stop
public void stop()
-
-