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.QueueConnection
protected jakarta.ejb.MessageDrivenContext
protected jakarta.jms.QueueSender
protected static final String
protected jakarta.jms.QueueConnectionFactory
protected static final String
protected jakarta.jms.Queue
protected static final String
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanup
(jakarta.jms.QueueConnection conn) Cleanup method designed to be called within a finally blockvoid
void
protected Properties
getProperties
(jakarta.jms.Message msg) Construct a property object needed by TS harness for logging.void
onMessage
(jakarta.jms.Message msg) 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).void
setMessageDrivenContext
(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:
setMessageDrivenContext
in interfacejakarta.ejb.MessageDrivenBean
-
ejbRemove
public void ejbRemove()- Specified by:
ejbRemove
in interfacejakarta.ejb.MessageDrivenBean
-
onMessage
public void onMessage(jakarta.jms.Message msg) - Specified by:
onMessage
in 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
-