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 Details

    • prefix

      protected static final String prefix
      See Also:
    • qFactoryLookup

      protected static final String qFactoryLookup
      See Also:
    • replyQueueLookup

      protected static final String replyQueueLookup
      See Also:
    • nctx

      public TSNamingContext 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 interface jakarta.ejb.MessageDrivenBean
    • ejbRemove

      public void ejbRemove()
      Specified by:
      ejbRemove in interface jakarta.ejb.MessageDrivenBean
    • onMessage

      public void onMessage(jakarta.jms.Message msg)
      Specified by:
      onMessage in interface jakarta.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

      protected Properties getProperties(jakarta.jms.Message msg) throws jakarta.jms.JMSException
      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