Class ConnectorMessageBeanClient

  • All Implemented Interfaces:
    jakarta.resource.spi.endpoint.MessageEndpointFactory, MessageBeanClient

    public final class ConnectorMessageBeanClient
    extends Object
    implements MessageBeanClient, jakarta.resource.spi.endpoint.MessageEndpointFactory
    Main helper implementation for message-beans associated with a queue. Uses connection consumer for concurrent message delivery.
    Author:
    Qingqing Ouyang
    • Constructor Detail

      • ConnectorMessageBeanClient

        public ConnectorMessageBeanClient​(EjbMessageBeanDescriptor descriptor)
        Creates an instance of ConnectorMessageBeanClient
        Parameters:
        descriptor - EjbMessageBeanDescriptor object.
    • Method Detail

      • setup

        public void setup​(MessageBeanProtocolManager messageBeanPM)
                   throws Exception
        Gets executed as part of message bean deployment. Creates the ActivationSpec javabean and does endpointfactory activation with the resource adapter. This code also converts all J2EE 1.3 MDB properties to MQ resource adapter activation spec properties, if user doesnt specifies resource adapter module name in sun-ejb-jar.xml of the MDB. This is done using com.sun.enterprise.connector.system.ActiveJmsResourceAdapter
        Specified by:
        setup in interface MessageBeanClient
        Parameters:
        messageBeanPM - MessageBeanProtocolManager object.
        Throws:
        Exception
      • close

        public void close()
        Does endpoint deactivation with the resource adapter. Also remove sthe MessageEndpointFactoryInfo from house keeping.
        Specified by:
        close in interface MessageBeanClient
      • createEndpoint

        public jakarta.resource.spi.endpoint.MessageEndpoint createEndpoint​(XAResource xa)
                                                                     throws jakarta.resource.spi.UnavailableException
        Creates a MessageEndpoint. This method gets blocked either until start() is called or until one minute. This is the time for completion of MDB deployment.

        Internally this method creates a message bean listener from the MDB container and a proxy object fo delivering messages.

        Specified by:
        createEndpoint in interface jakarta.resource.spi.endpoint.MessageEndpointFactory
        Returns:
        MessageEndpoint object.
        Throws:
        jakarta.resource.spi.UnavailableException
      • isDeliveryTransacted

        public boolean isDeliveryTransacted​(Method method)
        Checks whether the message delivery is transacted for the method.
        Specified by:
        isDeliveryTransacted in interface jakarta.resource.spi.endpoint.MessageEndpointFactory
        Returns:
        true or false.
      • toString

        public String toString()
        Overrides:
        toString in class Object
        Returns:
        beanID of the message bean client
      • createEndpoint

        public jakarta.resource.spi.endpoint.MessageEndpoint createEndpoint​(XAResource xaResource,
                                                                            long timeout)
                                                                     throws jakarta.resource.spi.UnavailableException
        Specified by:
        createEndpoint in interface jakarta.resource.spi.endpoint.MessageEndpointFactory
        Throws:
        jakarta.resource.spi.UnavailableException
      • getActivationName

        public String getActivationName()
        Specified by:
        getActivationName in interface jakarta.resource.spi.endpoint.MessageEndpointFactory
      • getEndpointClass

        public Class<?> getEndpointClass()
        Specified by:
        getEndpointClass in interface jakarta.resource.spi.endpoint.MessageEndpointFactory