|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A ServerSession is an application server object that is used by a server to associate a thread with a JMS session (optional).
A ServerSession implements two methods:
getSession
- returns the ServerSession's JMS session.
start
- starts the execution of the ServerSession
thread and results in the execution of the JMS Session's
run
method.
A ConnectionConsumer implemented by a JMS provider uses a ServerSession to process one or more messages that have arrived. It does this by getting a ServerSession from the ConnectionConsumer's ServerSessionPool; getting the ServerSession's JMS session; loading it with the messages; and then starting the ServerSession.
In most cases the ServerSession will register some object it provides
as the ServerSession's thread runObject. The ServerSession's
start
method will call the Threads start
method
which will start the new thread, and from it, call the run
method of the ServerSession's runObject. This object will do some
housekeeping and then call the Session's run
method. When
run
returns, the ServerSession's runObject can return the
ServerSession to the ServerSessionPool and the cycle starts again.
Note that JMS does not architect how the ConnectionConsumer loads the Session with messages. Since both the ConnectionConsumer and Session are implemented by the same JMS provider, they can accomplish the load using a private mechanism.
ServerSessionPool
,
ConnectionConsumer
Method Summary | |
Session |
getSession()
Return the ServerSession's Session. |
void |
start()
Cause the session's run method to be called to process messages that were just assigned to it. |
Method Detail |
public Session getSession() throws JMSException
public void start() throws JMSException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |