Name

Session

Synopsis

A Session provides a client with the means for creating messages, message producers and message consumers. Subclasses of Session create type-specific versions of these objects (e.g., QueueSenders and TopicPublishers).

Within a Session, messages are sent and received in a serial order. The Session interface also provides facilities for JMS providers that chose to provide transactional support in their Session implementations. A transaction is started when the Session is created. In a messaging context, a transaction consists of a series of message transmissions and receipts. Committing a messaging transaction (by calling commit() on the corresponding Session) causes all of the pending transmissions to be sent and all of the pending receipts to be finalized and acknowledged. If a transaction is aborted (by calling the rollback() method on the Session), then the outgoing messages are destroyed and incoming messages are cancelled. A new transaction is started as soon as the current one is committed or rolled back.

                  Returned By
public interface Session extends Runnable {
// Public Constants
   public static final int AUTO_ACKNOWLEDGE;                     // =1
   public static final int CLIENT_ACKNOWLEDGE;                   // =2
   public static final int DUPS_OK_ACKNOWLEDGE;                  // =3
                  // Public Instance Methods
   public abstract void close() throws JMSException;  
   public abstract void commit() throws JMSException; public abstract ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.