public interface ServerSessionA
ServerSessionobject is an application server object that is used by a server to associate a thread with a Jakarta Messaging session (optional).
ServerSessionimplements two methods:
getSession- returns the
ServerSession's Jakarta Messaging session.
start- starts the execution of the
ServerSessionthread and results in the execution of the JMS session's
ConnectionConsumerimplemented by a Jakarta Messaging provider uses a
ServerSessionto process one or more messages that have arrived. It does this by getting a
ServerSessionPool; getting the
ServerSession's Jakarta Messaging session; loading it with the messages; and then starting the
In most cases the
ServerSessionwill register some object it provides as the
ServerSession's thread run object. The
startmethod will call the thread's
startmethod, which will start the new thread, and from it, call the
runmethod of the
ServerSession's run object. This object will do some housekeeping and then call the
ServerSession's run object can return the
ServerSessionPool, and the cycle starts again.
Note that the Jakarta Messaging API does not architect how the
Sessionwith messages. Since both the
Sessionare implemented by the same Jakarta Messaging provider, they can accomplish the load using a private mechanism.
Session getSession() throws JMSExceptionReturn the
Session. This must be a
Sessioncreated by the same
Connectionthat will be dispatching messages to it. The provider will assign one or more messages to the
Sessionand then call
- the server session's session
JMSException- if the Jakarta Messaging provider fails to get the associated session for this
ServerSessiondue to some internal error.