-
public interface ServerSession
AServerSession
object 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 theServerSession
's JMS session.start
- starts the execution of theServerSession
thread and results in the execution of the JMS session'srun
method.
A
ConnectionConsumer
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 the
ServerSession
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 the
ConnectionConsumer
loads theSession
with messages. Since both theConnectionConsumer
andSession
are implemented by the same JMS provider, they can accomplish the load using a private mechanism.- Since:
- JMS 1.0
- Version:
- JMS 2.0
- See Also:
ServerSessionPool
,ConnectionConsumer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Session
getSession()
Return theServerSession
'sSession
.void
start()
Cause theSession
'srun
method to be called to process messages that were just assigned to it.
-
-
-
Method Detail
-
getSession
Session getSession() throws JMSException
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
void start() throws JMSException
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.
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/jms/serversession.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.