public class OfficeFloorEjb extends Object implements EjbOrchestrator, EjbOrchestratorRemote
Stateless SessionBean
along with utility methods for integrating
OfficeFloor
into an Application Server.
The deployment descriptor for using this SessionBean
is as follows
(replacing the contents of the square brackets - [...]):
<ejb-jar> ... <enterprise-beans> ... <session> <ejb-name>[EJB Name]</ejb-name> <ejb-class>net.officefloor.plugin.ejb.OfficeFloorEjb</ejb-class> <env-entry> <env-entry-name>officeFloorJndiName</env-entry-name> <env-entry-value>[JNDI resource path to OfficeFloor configuration]</env-entry-value> </env-entry> <env-entry> <env-entry-name>officeName</env-entry-name> <env-entry-value>[Name of Office]</env-entry-value> </env-entry> <env-entry> <env-entry-name>workName</env-entry-name> <env-entry-value>[Name of Work]</env-entry-value> </env-entry> </session> ... </enterprise-beans> ... </ejb-jar>
The EjbOrchestrator
and EjbOrchestratorRemote
provide a
generic interface for orchestration. It is also possible to extend this class
to provide a typed interface:
Local interface:
@Local public interface TypedEjbOrchestrator { public void typedOrchestration(String parameter) throws NamingException; }
Bean implementation:
@Stateless public class TypedOfficeFloorEjb extends OfficeFloorEjb implements TypedEjbOrchestrator { public void typedOrchestration(String parameter) throws NamingException { this.orchestrate(parameter); } }
Modifier and Type | Field and Description |
---|---|
protected String |
officeFloorJndiName
JDNI name for the
OfficeFloor . |
protected String |
officeName
Name of the
Office within the OfficeFloor . |
protected String |
workName
Name of the
Work to be invoked. |
Constructor and Description |
---|
OfficeFloorEjb() |
Modifier and Type | Method and Description |
---|---|
static void |
doOrchestration(String officeFloorJndiName,
String officeName,
String workName,
Object parameter)
Does the orchestration.
|
void |
ejbCreate()
Validates the dependency injection of configuration available.
|
void |
orchestrate(Object parameter)
Orchestrates the EJBs.
|
<P> P |
orchestrateRemotely(P parameter)
Remotely orchestrates EJBs.
|
protected String officeFloorJndiName
OfficeFloor
.protected String officeName
Office
within the OfficeFloor
.public static void doOrchestration(String officeFloorJndiName, String officeName, String workName, Object parameter) throws NamingException
officeFloorJndiName
- OfficeFloor
JNDI name.officeName
- Name of the Office
within the OfficeFloor
.workName
- Name of Work
within the Office
.parameter
- Parameter for the Work
.NamingException
- If fails to instigate the orchestration.@PostConstruct public void ejbCreate() throws javax.ejb.EJBException
javax.ejb.EJBException
- If configuration is not dependency injected.public <P> P orchestrateRemotely(P parameter) throws NamingException
EjbOrchestratorRemote
orchestrateRemotely
in interface EjbOrchestratorRemote
P
- Parameter type.parameter
- Parameter for the initial Work
of the
OfficeFloor
initiating the orchestration of the EJBs.Remote
invocations pass by value (serialised), the
input parameter is returned to allow changes to the parameter to
be obtained by the caller.NamingException
- On failure of orchestration.public void orchestrate(Object parameter) throws NamingException
EjbOrchestrator
orchestrate
in interface EjbOrchestrator
parameter
- Parameter for the initial Work
of the
OfficeFloor
initiating the orchestration of the EJBs.NamingException
- If failure in orchestration.Copyright © 2005–2016. All rights reserved.