oracle.toplink.remote.jms.mdb
Class ClusteringMDB
java.lang.Object
oracle.toplink.remote.jms.mdb.ClusteringMDB
- All Implemented Interfaces:
- javax.ejb.EnterpriseBean, javax.ejb.MessageDrivenBean, javax.jms.MessageListener, java.io.Serializable
- public class ClusteringMDB
- extends java.lang.Object
- implements javax.ejb.MessageDrivenBean, javax.jms.MessageListener
Purpose: To provide a reference implementation for Message Driven Bean that can listen and process TopLink messages.
Descripton: The Message Driven Bean (MDB) must be deployed along with TopLink application and configured to listener the the same destination that clustering services send their cache sync messages to. User must defined an environment variable for the TopLink session name that is accessible to the MDB at ejbCreate(). The session name is use by TopLink to load the cosresponding session from the sessions.xml access to the environment variable that named with this value ClusteringMDB.TOPLINK_SESSION_NAME and use the con.
- See Also:
CacheSynchronizationManager
, Serialized Form
Field Summary |
java.lang.String |
TOPLINK_SESSION_NAME
This value is the env-entry-name element of the Message Driven Beand configured in the ejb-jar.xml. |
Method Summary |
void |
ejbCreate()
|
void |
ejbRemove()
|
oracle.toplink.publicinterface.Session |
getSession()
PUBLIC: Return the TopLink session that has the session's name configured as an env-entry element in the ejb-jar.xml. |
void |
onMessage(javax.jms.Message message)
|
void |
setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TOPLINK_SESSION_NAME
public final java.lang.String TOPLINK_SESSION_NAME
- This value is the env-entry-name element of the Message Driven Beand configured in the ejb-jar.xml. The value is used to lookup the value of the session's name from the environment variable define in JNDI "java:comp/env".
- See Also:
- Constant Field Values
ClusteringMDB
public ClusteringMDB()
setMessageDrivenContext
public void setMessageDrivenContext(javax.ejb.MessageDrivenContext ctx)
-
- Specified by:
setMessageDrivenContext
in interface javax.ejb.MessageDrivenBean
ejbCreate
public void ejbCreate()
ejbRemove
public void ejbRemove()
-
- Specified by:
ejbRemove
in interface javax.ejb.MessageDrivenBean
getSession
public oracle.toplink.publicinterface.Session getSession()
- PUBLIC: Return the TopLink session that has the session's name configured as an env-entry element in the ejb-jar.xml. User can subclass and overwrite this method to obtain the session differently.
-
- Throws:
JMSProcessingException
- if it is unable to lookup the session's name or the session is null
onMessage
public void onMessage(javax.jms.Message message)
-
- Specified by:
onMessage
in interface javax.jms.MessageListener