com.sun.enterprise.connectors.inbound
Class ConnectorMessageBeanClient

java.lang.Object
  extended by com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient
All Implemented Interfaces:
MessageEndpointFactory, MessageBeanClient

public final class ConnectorMessageBeanClient
extends java.lang.Object
implements MessageBeanClient, MessageEndpointFactory

Main helper implementation for message-beans associated with a queue. Uses connection consumer for concurrent message delivery.

Author:
Qingqing Ouyang

Constructor Summary
ConnectorMessageBeanClient(EjbMessageBeanDescriptor descriptor)
          Creates an instance of ConnectorMessageBeanClient
 
Method Summary
 void close()
          Does endpoint deactivation with the resource adapter.
 MessageEndpoint createEndpoint(XAResource xa)
          Creates a MessageEndpoint.
 MessageEndpoint createEndpoint(XAResource xaResource, long timeout)
          
 boolean isDeliveryTransacted(java.lang.reflect.Method method)
          Checks whether the message delivery is transacted for the method.
 void setup(MessageBeanProtocolManager messageBeanPM)
          Gets executed as part of message bean deployment.
 void start()
          Marks the completion of MDB deployment.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 java.lang.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:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
Marks the completion of MDB deployment. Unblocks the createEndPoint method call.

Specified by:
start in interface MessageBeanClient
Throws:
java.lang.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 MessageEndpoint createEndpoint(XAResource xa)
                               throws 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 MessageEndpointFactory
Returns:
MessageEndpoint object.
Throws:
UnavailableException - In case of any failure. This should change.
UnavailableException

isDeliveryTransacted

public boolean isDeliveryTransacted(java.lang.reflect.Method method)
Checks whether the message delivery is transacted for the method.

Specified by:
isDeliveryTransacted in interface MessageEndpointFactory
Returns:
true or false.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
beanID of the message bean client

createEndpoint

public MessageEndpoint createEndpoint(XAResource xaResource,
                                      long timeout)
                               throws UnavailableException

Specified by:
createEndpoint in interface MessageEndpointFactory
Throws:
UnavailableException


Copyright © 2012 GlassFish Community. All Rights Reserved.