Class MDBWrapper
java.lang.Object
com.sun.ts.tests.common.ejb.wrappers.MDBWrapper
- All Implemented Interfaces:
jakarta.ejb.EnterpriseBean,jakarta.ejb.MessageDrivenBean,jakarta.jms.MessageListener,Serializable
public class MDBWrapper
extends Object
implements jakarta.ejb.MessageDrivenBean, jakarta.jms.MessageListener
Life cyle and test invocation methods for MDB. Actual test methods are defined in subclasses of this class.
WARNING: We assume the MDB is CMT. Do not use this wrapper for a BMT MDB!
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.jms.QueueConnectionprotected jakarta.ejb.MessageDrivenContextprotected jakarta.jms.QueueSenderprotected static final Stringprotected jakarta.jms.QueueConnectionFactoryprotected static final Stringprotected jakarta.jms.Queueprotected static final Stringprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanup(jakarta.jms.QueueConnection conn) Cleanup method designed to be called within a finally blockvoidvoidprotected PropertiesgetProperties(jakarta.jms.Message msg) Construct a property object needed by TS harness for logging.voidonMessage(jakarta.jms.Message msg) protected booleanrunTest(String testName, jakarta.jms.Message msg, jakarta.jms.QueueSession session, Properties props) Run corresponding test by invoking test method on the current instance (also used for cleanup of stateful session beans).voidsetMessageDrivenContext(jakarta.ejb.MessageDrivenContext mctx)
-
Field Details
-
prefix
- See Also:
-
qFactoryLookup
- See Also:
-
replyQueueLookup
- See Also:
-
nctx
-
mctx
protected jakarta.ejb.MessageDrivenContext mctx -
qFactory
protected jakarta.jms.QueueConnectionFactory qFactory -
conn
protected jakarta.jms.QueueConnection conn -
replyQueue
protected jakarta.jms.Queue replyQueue -
mSender
protected jakarta.jms.QueueSender mSender -
result
protected boolean result
-
-
Constructor Details
-
MDBWrapper
public MDBWrapper()
-
-
Method Details
-
ejbCreate
public void ejbCreate() -
setMessageDrivenContext
public void setMessageDrivenContext(jakarta.ejb.MessageDrivenContext mctx) - Specified by:
setMessageDrivenContextin interfacejakarta.ejb.MessageDrivenBean
-
ejbRemove
public void ejbRemove()- Specified by:
ejbRemovein interfacejakarta.ejb.MessageDrivenBean
-
onMessage
public void onMessage(jakarta.jms.Message msg) - Specified by:
onMessagein interfacejakarta.jms.MessageListener
-
runTest
protected boolean runTest(String testName, jakarta.jms.Message msg, jakarta.jms.QueueSession session, Properties props) Run corresponding test by invoking test method on the current instance (also used for cleanup of stateful session beans). -
getProperties
Construct a property object needed by TS harness for logging. We retrieve the properties from the Message object passed into the MDB onMessage() method- Throws:
jakarta.jms.JMSException
-
cleanup
protected void cleanup(jakarta.jms.QueueConnection conn) Cleanup method designed to be called within a finally block
-