org.objectweb.joram.client.connector
Class InboundSession

java.lang.Object
  extended by org.objectweb.joram.client.connector.InboundSession
All Implemented Interfaces:
java.lang.Runnable, javax.jms.MessageListener, javax.jms.ServerSession, javax.resource.spi.work.Work

 class InboundSession
extends java.lang.Object
implements javax.jms.ServerSession, javax.resource.spi.work.Work, javax.jms.MessageListener

An InboundSession instance is responsible for processing delivered messages within a javax.resource.spi.Work instance, and passing them to a set of application server endpoints.


Field Summary
private  InboundConsumer consumer
          InboundConsumer instance this session belongs to.
private  javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory
          Application's endpoints factory.
private  javax.jms.Session session
          javax.jms.Session instance dedicated to processing the delivered messages.
private  javax.resource.spi.work.WorkManager workManager
          Application server's WorkManager instance.
private  javax.transaction.xa.XAResource xaResource
          XAResource instance, if any.
 
Constructor Summary
InboundSession(InboundConsumer consumer, javax.resource.spi.work.WorkManager workManager, javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory, javax.jms.XAConnection cnx, boolean transacted, int ackMode)
          Constructs an InboundSession instance.
 
Method Summary
 javax.jms.Session getSession()
          Provides the wrapped javax.jms.Session instance for processing delivered messages.
 void onMessage(javax.jms.Message message)
          Forwards a processed message to an endpoint.
 void release()
          javax.resource.spi.Work method, not effective.
 void run()
          Runs the wrapped session for processing the messages.
 void start()
          Notifies that the messages are ready to be processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consumer

private InboundConsumer consumer
InboundConsumer instance this session belongs to.


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.


session

private javax.jms.Session session
javax.jms.Session instance dedicated to processing the delivered messages.


xaResource

private javax.transaction.xa.XAResource xaResource
XAResource instance, if any.

Constructor Detail

InboundSession

InboundSession(InboundConsumer consumer,
               javax.resource.spi.work.WorkManager workManager,
               javax.resource.spi.endpoint.MessageEndpointFactory endpointFactory,
               javax.jms.XAConnection cnx,
               boolean transacted,
               int ackMode)
Constructs an InboundSession instance.

Parameters:
consumer - InboundConsumer creating this session.
workManager - Application server's WorkManager instance.
endpointFactory - Application's endpoints factory.
cnx - Connection to the underlying JORAM server.
transacted - true if deliveries occur within a XA transaction.
Method Detail

getSession

public javax.jms.Session getSession()
                             throws javax.jms.JMSException
Provides the wrapped javax.jms.Session instance for processing delivered messages.

Specified by:
getSession in interface javax.jms.ServerSession
Throws:
javax.jms.JMSException - Never thrown.

start

public void start()
           throws javax.jms.JMSException
Notifies that the messages are ready to be processed.

Specified by:
start in interface javax.jms.ServerSession
Throws:
javax.jms.JMSException - If submitting the processing work fails.

release

public void release()
javax.resource.spi.Work method, not effective.

Specified by:
release in interface javax.resource.spi.work.Work

run

public void run()
Runs the wrapped session for processing the messages.

Specified by:
run in interface java.lang.Runnable

onMessage

public void onMessage(javax.jms.Message message)
Forwards a processed message to an endpoint.

Specified by:
onMessage in interface javax.jms.MessageListener


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