javax.jms

Interface ServerSession


  • public interface ServerSession
    A ServerSession 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 the ServerSession's JMS session.
    • start - starts the execution of the ServerSession thread and results in the execution of the JMS session's run method.

    A 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 ConnectionConsumer's ServerSessionPool; getting the ServerSession's JMS session; loading it with the messages; and then starting the ServerSession.

    In most cases the ServerSession will register some object it provides as the ServerSession's thread run object. The ServerSession's start method will call the thread's 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 Session's run method. When run returns, the ServerSession's run 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 Session with messages. Since both the ConnectionConsumer and Session 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 Detail

      • getSession

        Session getSession()
                    throws JMSException
        Return the ServerSession's Session. This must be a Session created by the same Connection that will be dispatching messages to it. The provider will assign one or more messages to the Session and then call start on the ServerSession.
        Returns:
        the server session's session
        Throws:
        JMSException - if the JMS provider fails to get the associated session for this ServerSession due to some internal error.
      • start

        void start()
            throws JMSException
        Cause the Session's run 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.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/jms/serversession.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.

Referenzen

  1. Zeigen Sie - html-Dokument Sprache des Dokuments:fr Manuel PHP : https://docs.oracle.com

Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.