Class JakartaEjbProcessApplication
- All Implemented Interfaces:
ProcessApplicationInterface
Common base class for writing Jakarta Enterprise Bean 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.
Usage
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 JakartaEjbProcessApplication { @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
Invocation Semantics
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 JakartaEjbProcessApplication's
AbstractEjbProcessApplication.execute(java.util.concurrent.Callable)
Method and from that method invoke
the JavaDelegate
. This makes sure that
- the call is intercepted by the EJB container and "enters" the process application legally.
- the
JavaDelegate
may take advantage of theJakartaEjbProcessApplication
's invocation context and resolve resources from the component's Environment (such as ajava:comp/BeanManager
).
Big pile of EJB interceptors | | +--------------------+ | |Process Application | invoke v | | ProcessEngine ----------------OOOOO--> Java Delegate | | | | | +--------------------+
Process Application Reference
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 JakartaEjbProcessApplication
takes advantage
of the EJB Container's naming context and passes a reference containing the JakartaEjbProcessApplication'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
Fields inherited from class org.camunda.bpm.application.impl.AbstractEjbProcessApplication
EJB_CONTEXT_PATH, JAVA_APP_APP_NAME_PATH, MODULE_NAME_PATH, selfReference
Fields inherited from class org.camunda.bpm.application.AbstractProcessApplication
defaultDeployToEngineName, isDeployed, processApplicationBeanElResolver, processApplicationElResolver, processApplicationScriptEnvironment, variableSerializers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected ProcessApplicationReference
protected ProcessApplicationInterface
lookup a proxy object representing the invoked business view of this component.Methods inherited from class org.camunda.bpm.application.impl.AbstractEjbProcessApplication
autodetectProcessApplicationName, ensureInitialized, execute, getBusinessInterface, getReference, lookupEeApplicationName
Methods inherited from class org.camunda.bpm.application.AbstractProcessApplication
createDeployment, deploy, execute, getBeanElResolver, getDefaultDeployToEngineName, getElResolver, getEnvironmentScripts, getExecutionListener, getName, getProcessApplicationClassloader, getProcessApplicationScriptEnvironment, getProperties, getRawObject, getScriptEngineForName, getTaskListener, getVariableSerializers, initProcessApplicationElResolver, setDefaultDeployToEngineName, setVariableSerializers, undeploy
-
Constructor Details
-
JakartaEjbProcessApplication
public JakartaEjbProcessApplication()
-
-
Method Details
-
lookupSelfReference
Description copied from class:AbstractEjbProcessApplication
lookup a proxy object representing the invoked business view of this component.- Specified by:
lookupSelfReference
in classAbstractEjbProcessApplication
-
ensureEjbProcessApplicationReferenceInitialized
protected void ensureEjbProcessApplicationReferenceInitialized()- Specified by:
ensureEjbProcessApplicationReferenceInitialized
in classAbstractEjbProcessApplication
-
getEjbProcessApplicationReference
- Specified by:
getEjbProcessApplicationReference
in classAbstractEjbProcessApplication
-