Class GenericEJBMediationHandlerBean
- java.lang.Object
-
- com.ibm.websphere.sib.mediation.handler.ejb.GenericEJBMediationHandlerBean
-
- All Implemented Interfaces:
- java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean
public class GenericEJBMediationHandlerBean extends java.lang.Object implements javax.ejb.SessionBean
Implementation of a generic Stateless Session EJB which queries its deployment descriptor. The values retrieved from the deployment are:
- The fully qualified MediationHandler class which it is intended to wrap and invoke.
- Any properties which should be set on that class.
This EJB dynamically instantiates an instance of the MediationHandler class specified in the deployment descriptor. If any properties which exist on the MediationHandler instance are specified in the deployment descriptor then those properties are set using the value(s) specified.
For instance, if the DD has:
<env-entry> <description>foo property </description> <env-entry-name>foo</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>"aValue"</env-entry-value> </env-entry>
then the property foo will be set by invoking setFoo(String) on the MediationHandler instance.
Security related checks are performed based on information defined in the EJBs deployment descriptor. This information is specified in the tooling and can be modified at application installation time.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description GenericEJBMediationHandlerBean()
-
Method Summary
Methods Modifier and Type Method and Description void
ejbActivate()
Activate this instance of the session beanvoid
ejbCreate()
Called on creation of an EJB instance.void
ejbPassivate()
Passivate this instance of the session beanvoid
ejbRemove()
Remove this instance of the session beanjavax.ejb.SessionContext
getSessionContext()
Return the session context for this instance of the session beanboolean
handle(javax.xml.rpc.handler.MessageContext messageContext)
Handle a message context (by passing it to the mediation handler).void
setSessionContext(javax.ejb.SessionContext ctx)
Set the session context for this instance of the session bean
-
-
-
Method Detail
-
ejbCreate
public void ejbCreate() throws javax.ejb.CreateException
Called on creation of an EJB instance. This will instantiate the MediationHandler specified in this EJB's deployment descriptor and set any properties as specified in the DD.- Throws:
javax.ejb.CreateException
- if the MediationHandler instance could not be created or its properties could not be set.
-
handle
public boolean handle(javax.xml.rpc.handler.MessageContext messageContext) throws MessageContextException
Handle a message context (by passing it to the mediation handler).- Parameters:
messageContext
- The message context to be handled- Returns:
- boolean The result of the mediation handler
- Throws:
MessageContextException
- is thrown if the mediation handler throws it- See Also:
MediationHandler.handle(MessageContext)
-
getSessionContext
public javax.ejb.SessionContext getSessionContext()
Return the session context for this instance of the session bean- Returns:
- javax.ejb.SessionContext The session context
-
setSessionContext
public void setSessionContext(javax.ejb.SessionContext ctx)
Set the session context for this instance of the session bean- Specified by:
setSessionContext
in interfacejavax.ejb.SessionBean
- Parameters:
ctx
- The session context
-
ejbActivate
public void ejbActivate()
Activate this instance of the session bean- Specified by:
ejbActivate
in interfacejavax.ejb.SessionBean
-
ejbPassivate
public void ejbPassivate()
Passivate this instance of the session bean- Specified by:
ejbPassivate
in interfacejavax.ejb.SessionBean
-
ejbRemove
public void ejbRemove()
Remove this instance of the session bean- Specified by:
ejbRemove
in interfacejavax.ejb.SessionBean
-
-