xbserversession.java

来自「java开源的企业总线.xmlBlaster」· Java 代码 · 共 49 行

JAVA
49
字号
/*------------------------------------------------------------------------------Name:      XBServerSession.javaProject:   xmlBlaster.orgCopyright: xmlBlaster.org, see xmlBlaster-LICENSE file------------------------------------------------------------------------------*/package org.xmlBlaster.jms;import javax.jms.JMSException;import javax.jms.ServerSession;import javax.jms.Session;/** * XBServerSession * @author <a href="mailto:michele@laghi.eu">Michele Laghi</a> */public class XBServerSession implements ServerSession {    private Session session;   private XBConnection connection;   private boolean started;      public XBServerSession(XBConnection connection) {      this.connection = connection;   }      /**    * @see javax.jms.ServerSession#getSession()    */   public synchronized Session getSession() throws JMSException {      if (!this.started)         throw new IllegalStateException("This server session has not been started yet, can not get the session");      if (this.session == null) {         boolean transacted = false;         int ackMode = Session.AUTO_ACKNOWLEDGE;         this.session = new XBSession(this.connection, ackMode, transacted);      }      return this.session;   }   /**    * @see javax.jms.ServerSession#start()    */   public synchronized void start() throws JMSException {      this.started = true;   }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?