org.apache.commons.messenger
Class DefaultServerSession

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.apache.commons.messenger.DefaultServerSession
All Implemented Interfaces:
java.lang.Runnable, javax.jms.ServerSession

public class DefaultServerSession
extends java.lang.Thread
implements javax.jms.ServerSession

DefaultServerSession is a default implementation of the JMS ServerSession interface.

Version:
$Revision: 1.3 $
Author:
James Strachan

Field Summary
private  javax.jms.Session session
          The JMS Session on which this ServerSession is based
private  boolean started
          Indicates whether the session has been started
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DefaultServerSession(javax.jms.Session session)
           
 
Method Summary
 javax.jms.Session getSession()
          Return the ServerSession's Session.
 void run()
           
 void start()
          Cause the session's run method to be called to process messages that were just assigned to it.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

session

private javax.jms.Session session
The JMS Session on which this ServerSession is based


started

private boolean started
Indicates whether the session has been started

Constructor Detail

DefaultServerSession

public DefaultServerSession(javax.jms.Session session)
                     throws javax.jms.JMSException
Method Detail

getSession

public javax.jms.Session getSession()
                             throws javax.jms.JMSException
Return the ServerSession's Session. This must be a Session created by the same Connection which will be dispatching messages to it. The provider will assign one or more messages to the Session and then call start on the ServerSession.

Specified by:
getSession in interface javax.jms.ServerSession
Returns:
the server session's session.
Throws:
javax.jms.JMSException - if a JMS error occurs.

start

public void start()
Cause the session's run method to be called to process messages that were just assigned to it.

Specified by:
start in interface javax.jms.ServerSession

run

public void run()
Specified by:
run in interface java.lang.Runnable