-
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.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 15:08:05 Cette version de la page est en cache (à la date du 21/08/2025 15:08:05) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 14/04/2008, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/jms/ServerSession.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.