|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.camunda.bpm.application.AbstractProcessApplication
org.camunda.bpm.application.impl.EjbProcessApplication
public class EjbProcessApplication
Common base class for writing EJB process applications.
An EJB Process Application exposes itself as a Session Bean Component inside the EJB container.
This determines the invocation semantics when invoking code from the process application and the
nature of the ProcessApplicationReference held by the process engine.
In order to add a custom EJB process application to your application, extend this class and configure it as follows:
@ProcessApplication("my process application")
@Singleton
@Startup
@ConcurrencyManagement(ConcurrencyManagementType.BEAN)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class DefaultEjbProcessApplication extends EjbProcessApplication {
@PostConstruct
public void deploy() {
super.deploy();
}
@PreDestroy
public void undeploy() {
super.undeploy();
}
}
(the same Metadata can of course be provided using an XML-based ejb-jar.xml
deployment descriptor
This allows the process engine as well as other applications to invoke this EJB Process
Application and get EJB invocation semantics for the invocation. For example, if your
process application provides a JavaDelegate implementation, the process engine
will call the EjbProcessApplication's
execute(java.util.concurrent.Callable) Method and from that method invoke
the JavaDelegate. This makes sure that
JavaDelegate may take advantage of the EjbProcessApplication's invocation context
and resolve resources from the component's Environment (such as a java:comp/BeanManager).
Big pile of EJB interceptors
|
| +--------------------+
| |Process Application |
invoke v | |
ProcessEngine ----------------OOOOO--> Java Delegate |
| |
| |
+--------------------+
When the process application registers with a process engine
(see ManagementService.registerProcessApplication(String, ProcessApplicationReference),
the process application passes a reference to itself to the process engine. This reference allows the
process engine to reference the process application. The EjbProcessApplication takes advantage
of the Ejb Containers naming context and passes a reference containing the EJBProcessApplication's
Component Name to the process engine. Whenever the process engine needs access to process application,
the actual component instance is looked up and invoked.
| Field Summary | |
|---|---|
protected static String |
EJB_CONTEXT_PATH
|
protected static String |
JAVA_APP_APP_NAME_PATH
|
protected static String |
MODULE_NAME_PATH
|
| Fields inherited from class org.camunda.bpm.application.AbstractProcessApplication |
|---|
isDeployed, processApplicationBeanElResolver, processApplicationElResolver |
| Constructor Summary | |
|---|---|
EjbProcessApplication()
|
|
| Method Summary | ||
|---|---|---|
protected String |
autodetectProcessApplicationName()
Override this method to autodetect an application name in case the ProcessApplication annotation was used but without parameter. |
|
protected void |
ensureInitialized()
|
|
|
execute(Callable<T> callable)
The default implementation simply modifies the Context ClassLoader |
|
protected Class<? extends ProcessApplicationInterface> |
getBusinessInterface()
allows subclasses to provide a custom business interface |
|
ProcessApplicationReference |
getReference()
Returns a globally sharable reference to this process application. |
|
protected String |
lookupEeApplicationName()
determine the ee application name based on information obtained from JNDI. |
|
protected ProcessApplicationInterface |
lookupSelfReference()
lookup a proxy object representing the invoked business view of this component. |
|
| Methods inherited from class org.camunda.bpm.application.AbstractProcessApplication |
|---|
createDeployment, deploy, getBeanElResolver, getElResolver, getExecutionListener, getName, getProcessApplicationClassloader, getProperties, getRawObject, getTaskListener, initProcessApplicationElResolver, undeploy |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static String MODULE_NAME_PATH
protected static String JAVA_APP_APP_NAME_PATH
protected static String EJB_CONTEXT_PATH
| Constructor Detail |
|---|
public EjbProcessApplication()
| Method Detail |
|---|
public ProcessApplicationReference getReference()
ProcessApplicationInterfaceReturns a globally sharable reference to this process application. This reference may be safely passed to the process engine. And other applications.
protected String autodetectProcessApplicationName()
AbstractProcessApplicationProcessApplication annotation was used but without parameter.
autodetectProcessApplicationName in class AbstractProcessApplicationprotected Class<? extends ProcessApplicationInterface> getBusinessInterface()
public <T> T execute(Callable<T> callable)
throws ProcessApplicationExecutionException
ProcessApplicationInterfaceClassLoader
execute in interface ProcessApplicationInterfaceexecute in class AbstractProcessApplicationcallable - the callable to be executed "within" the context of this process application.
ProcessApplicationExecutionExceptionprotected void ensureInitialized()
protected ProcessApplicationInterface lookupSelfReference()
protected String lookupEeApplicationName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||