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 SummaryFieldsModifier 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 SummaryConstructors
- 
Method SummaryModifier 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
- 
mctxprotected jakarta.ejb.MessageDrivenContext mctx
- 
qFactoryprotected jakarta.jms.QueueConnectionFactory qFactory
- 
connprotected jakarta.jms.QueueConnection conn
- 
replyQueueprotected jakarta.jms.Queue replyQueue
- 
mSenderprotected jakarta.jms.QueueSender mSender
- 
resultprotected boolean result
 
- 
- 
Constructor Details- 
MDBWrapperpublic MDBWrapper()
 
- 
- 
Method Details- 
ejbCreatepublic void ejbCreate()
- 
setMessageDrivenContextpublic void setMessageDrivenContext(jakarta.ejb.MessageDrivenContext mctx) - Specified by:
- setMessageDrivenContextin interface- jakarta.ejb.MessageDrivenBean
 
- 
ejbRemovepublic void ejbRemove()- Specified by:
- ejbRemovein interface- jakarta.ejb.MessageDrivenBean
 
- 
onMessagepublic void onMessage(jakarta.jms.Message msg) - Specified by:
- onMessagein interface- jakarta.jms.MessageListener
 
- 
runTestprotected 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).
- 
getPropertiesConstruct 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
 
- 
cleanupprotected void cleanup(jakarta.jms.QueueConnection conn) Cleanup method designed to be called within a finally block
 
-