| java.lang.Object org.jboss.jms.asf.StdServerSession
Field Summary | |
static Logger | log Instance logger. |
Constructor Summary | |
| StdServerSession(StdServerSessionPool pool, Session session, XASession xaSession, MessageListener delegateListener, boolean useLocalTX, XidFactoryMBean xidFactory, TransactionManager tm) Create a StdServerSession . |
Method Summary | |
void | close() Called by the ServerSessionPool when the sessions should be closed. | public Session | getSession() Returns the session. | public TransactionManager | getTransactionManager() | public void | onMessage(Message msg) Will get called from session for each message stuffed into it.
Starts a transaction with the TransactionManager
and enlists the XAResource of the JMS XASession if a XASession was
available. | void | recycle() | public void | run() Runs in an own thread, basically calls the session.run(), it is up to the
session to have been filled with messages and it will run against the
listener set in StdServerSessionPool. | public void | setTransactionManager(TransactionManager transactionManager) | public void | start() Start the session and begin consuming messages. |
log | static Logger log(Code) | | Instance logger.
|
StdServerSession | StdServerSession(StdServerSessionPool pool, Session session, XASession xaSession, MessageListener delegateListener, boolean useLocalTX, XidFactoryMBean xidFactory, TransactionManager tm) throws JMSException(Code) | | Create a StdServerSession .
Parameters: pool - The server session pool which we belong to. Parameters: session - Our session resource. Parameters: xaSession - Our XA session resource. Parameters: delegateListener - Listener to call when messages arrives. Parameters: useLocalTX - Will this session be used in a global TX (we can optimize with 1 phase commit) throws: JMSException - Transation manager was not found. |
close | void close()(Code) | | Called by the ServerSessionPool when the sessions should be closed.
|
getSession | public Session getSession() throws JMSException(Code) | | Returns the session.
This simply returns what it has fetched from the connection. It is up to
the jms provider to typecast it and have a private API to stuff messages
into it.
The session. throws: JMSException - Description of Exception |
getTransactionManager | public TransactionManager getTransactionManager()(Code) | | |
onMessage | public void onMessage(Message msg)(Code) | | Will get called from session for each message stuffed into it.
Starts a transaction with the TransactionManager
and enlists the XAResource of the JMS XASession if a XASession was
available. A good JMS implementation should provide the XASession for use
in the ASF. So we optimize for the case where we have an XASession. So,
for the case where we do not have an XASession and the bean is not
transacted, we have the unneeded overhead of creating a Transaction. I'm
leaving it this way since it keeps the code simpler and that case should
not be too common (JBossMQ provides XASessions).
|
recycle | void recycle()(Code) | | This method is called by the ServerSessionPool when it is ready to be
recycled intot the pool
|
run | public void run()(Code) | | Runs in an own thread, basically calls the session.run(), it is up to the
session to have been filled with messages and it will run against the
listener set in StdServerSessionPool. When it has send all its messages it
returns.
|
setTransactionManager | public void setTransactionManager(TransactionManager transactionManager)(Code) | | |
start | public void start() throws JMSException(Code) | | Start the session and begin consuming messages.
throws: JMSException - No listener has been specified. |
|
|