public interface ServerSession
ServerSessionobject is an application server object that is used by a server to associate a thread with a JMS session (optional).
ServerSession implements two methods:
getSession- returns the
ServerSession's JMS session.
start- starts the execution of the
ServerSessionthread and results in the execution of the JMS session's
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
ServerSession's JMS session; loading it with the messages;
and then starting the
In most cases the
ServerSession will register some object
it provides as the
ServerSession's thread run object. The
start method will call the
start method, which will start the new thread, and
from it, call the
run method of the
ServerSession's run object. This object will do some
housekeeping and then call the
run returns, the
object can return the
ServerSession to the
ServerSessionPool, and the cycle starts again.
Note that the JMS API does not architect how the
ConnectionConsumer loads the
messages. Since both the
Session are implemented by the same JMS provider, they can
accomplish the load using a private mechanism.
Session getSession() throws JMSException
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
JMSException- if the JMS provider fails to get the associated session for this
ServerSessiondue to some internal error.
Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.