org.objectweb.joram.client.connector
Class InboundConsumer

java.lang.Object
  extended by org.objectweb.joram.client.connector.InboundConsumer
All Implemented Interfaces:
javax.jms.ServerSessionPool

 class InboundConsumer
extends java.lang.Object
implements javax.jms.ServerSessionPool

An InboundConsumer instance is responsible for consuming messages from a given JORAM destination and through a given JORAM connection.


Field Summary
private  int ackMode
           
private  boolean closeDurSub
          for closing durable subscription
private  javax.jms.XAConnection cnx
          The provided connection to the underlying JORAM server.
private  javax.jms.ConnectionConsumer cnxConsumer
          Wrapped ConnectionConsumer instance.
private  javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory
          Application's endpoints factory.
private  int maxWorks
          Maximum number of Work instances to be submitted (0 for infinite).
private  java.util.Vector pool
          Pool of server sessions.
private  int serverSessions
          Number of created server sessions.
private  java.lang.String subName
          The durable subscription name, if provided.
private  boolean transacted
          true if message consumption occurs in a transaction.
private  javax.resource.spi.work.WorkManager workManager
          Application server's WorkManager instance.
 
Constructor Summary
InboundConsumer(javax.resource.spi.work.WorkManager workManager, javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, javax.jms.XAConnection cnx, javax.jms.Destination dest, java.lang.String selector, boolean durable, java.lang.String subName, boolean transacted, int maxWorks, int maxMessages, int ackMode, boolean closeDurSub)
          Constructs an InboundConsumer instance.
 
Method Summary
(package private)  void close()
          Closes the consumer.
 javax.jms.ServerSession getServerSession()
          Provides a new InboundSession instance for processing incoming messages.
private  InboundSession newSession()
           
(package private)  void releaseSession(InboundSession session)
          Releases an InboundSession instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workManager

private javax.resource.spi.work.WorkManager workManager
Application server's WorkManager instance.


endpointFactory

private javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory
Application's endpoints factory.


cnx

private javax.jms.XAConnection cnx
The provided connection to the underlying JORAM server.


subName

private java.lang.String subName
The durable subscription name, if provided.


transacted

private boolean transacted
true if message consumption occurs in a transaction.


maxWorks

private int maxWorks
Maximum number of Work instances to be submitted (0 for infinite).


ackMode

private int ackMode

closeDurSub

private boolean closeDurSub
for closing durable subscription


cnxConsumer

private javax.jms.ConnectionConsumer cnxConsumer
Wrapped ConnectionConsumer instance.


serverSessions

private int serverSessions
Number of created server sessions.


pool

private java.util.Vector pool
Pool of server sessions.

Constructor Detail

InboundConsumer

InboundConsumer(javax.resource.spi.work.WorkManager workManager,
                javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
                javax.jms.XAConnection cnx,
                javax.jms.Destination dest,
                java.lang.String selector,
                boolean durable,
                java.lang.String subName,
                boolean transacted,
                int maxWorks,
                int maxMessages,
                int ackMode,
                boolean closeDurSub)
          throws javax.resource.ResourceException
Constructs an InboundConsumer instance.

Parameters:
workManager - Application server's WorkManager instance.
endpointFactory - Application's endpoints factory.
cnx - Connection to the JORAM server.
dest - Destination to get messages from.
selector - Selector for filtering messages.
durable - true for durably subscribing.
subName - Durable subscription name.
transacted - true if deliveries will occur in a XA transaction.
maxWorks - Max number of Work instances to be submitted.
Throws:
javax.resource.NotSupportedException - If the activation parameters are invalid.
javax.resource.spi.SecurityException - If the target destination is not readable.
javax.resource.spi.CommException - If the connection with the JORAM server is lost.
javax.resource.ResourceException - Generic exception.
Method Detail

getServerSession

public javax.jms.ServerSession getServerSession()
                                         throws javax.jms.JMSException
Provides a new InboundSession instance for processing incoming messages.

Specified by:
getServerSession in interface javax.jms.ServerSessionPool
Throws:
javax.jms.JMSException - Never thrown.

newSession

private InboundSession newSession()

releaseSession

void releaseSession(InboundSession session)
Releases an InboundSession instance.


close

void close()
Closes the consumer.



Copyright © 2010 ScalAgent D.T.. All Rights Reserved.