Movatterモバイル変換


[0]ホーム

URL:


         


Interface ServerSession


public interfaceServerSession

AServerSession object is an application server object that is used by a server to associate a thread with a JMS session (optional).

AServerSession implements two methods:

AConnectionConsumer implemented by a JMS provider uses aServerSession to process one or more messages that have arrived. It does this by getting aServerSession from theConnectionConsumer'sServerSessionPool; getting theServerSession's JMS session; loading it with the messages; and then starting theServerSession.

In most cases theServerSession will register some object it provides as theServerSession's thread run object. TheServerSession'sstart method will call the thread'sstart method, which will start the new thread, and from it, call therun method of theServerSession's run object. This object will do some housekeeping and then call theSession'srun method. Whenrun returns, theServerSession's run object can return theServerSession to theServerSessionPool, and the cycle starts again.

Note that the JMS API does not architect how theConnectionConsumer loads theSession with messages. Since both theConnectionConsumer andSession are implemented by the same JMS provider, they can accomplish the load using a private mechanism.

See Also:
ServerSessionPool,ConnectionConsumer

getSession()
          Return theServerSession'sSession.
start()
          Cause theSession'srun method to be called to process messages that were just assigned to it.
 

getSession

publicSessiongetSession()                   throwsJMSException
Return theServerSession'sSession. This must be aSession created by the sameConnection that will be dispatching messages to it. The provider will assign one or more messages to theSession and then callstart on theServerSession.
Returns:
the server session's session
Throws:
JMSException - if the JMS provider fails to get the associated session for thisServerSession due to some internal error.

start

public voidstart()           throwsJMSException
Cause theSession'srun method to be called to process messages that were just assigned to it.
Throws:
JMSException - if the JMS provider fails to start the server session to process messages due to some internal error.

         


[8]ページ先頭

©2009-2025 Movatter.jp