Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » jms » asf » [javadoc | source]
    1   /*
    2    * JBoss, the OpenSource J2EE webOS
    3    *
    4    * Distributable under LGPL license.
    5    * See terms of license at gnu.org.
    6    */
    7   package org.jboss.jms.asf;
    8   
    9   import java.io.Serializable;
   10   import javax.jms.Connection;
   11   import javax.jms.JMSException;
   12   import javax.jms.MessageListener;
   13   
   14   import javax.jms.ServerSessionPool;
   15   import org.jboss.tm.XidFactoryMBean;
   16   
   17   /**
   18    * An implementation of ServerSessionPoolFactory. <p>
   19    *
   20    * Created: Fri Dec 22 09:47:41 2000
   21    *
   22    * @author    <a href="mailto:peter.antman@tim.se">Peter Antman</a> .
   23    * @author    <a href="mailto:hiram.chirino@jboss.org">Hiram Chirino</a> .
   24    * @version   $Revision: 1.8 $
   25    */
   26   public class StdServerSessionPoolFactory
   27          implements ServerSessionPoolFactory, Serializable
   28   {
   29      /**
   30       * The name of this factory.
   31       */
   32      private String name;
   33   
   34      private XidFactoryMBean xidFactory;
   35   
   36      /**
   37       * Construct a <tt>StdServerSessionPoolFactory</tt> .
   38       */
   39      public StdServerSessionPoolFactory()
   40      {
   41         super();
   42      }
   43   
   44      /**
   45       * Set the name of the factory.
   46       *
   47       * @param name  The name of the factory.
   48       */
   49      public void setName(final String name)
   50      {
   51         this.name = name;
   52      }
   53   
   54      /**
   55       * Get the name of the factory.
   56       *
   57       * @return   The name of the factory.
   58       */
   59      public String getName()
   60      {
   61         return name;
   62      }
   63   
   64      /**
   65       * The <code>setXidFactory</code> method supplies the XidFactory that 
   66       * server sessions will use to get Xids to control local transactions.
   67       *
   68       * @param xidFactory a <code>XidFactoryMBean</code> value
   69       */
   70      public void setXidFactory(final XidFactoryMBean xidFactory)
   71      {
   72         this.xidFactory = xidFactory;
   73      }
   74   
   75      /**
   76       * The <code>getXidFactory</code> method returns the XidFactory that 
   77       * server sessions will use to get xids..
   78       *
   79       * @return a <code>XidFactoryMBean</code> value
   80       */
   81      public XidFactoryMBean getXidFactory()
   82      {
   83         return xidFactory;
   84      }
   85   
   86      /**
   87       * Create a new <tt>ServerSessionPool</tt> .
   88       *
   89       * @param con
   90       * @param maxSession
   91       * @param isTransacted
   92       * @param ack
   93       * @param listener
   94       * @param isContainerManaged          Description of Parameter
   95       * @return                            A new pool.
   96       * @throws JMSException
   97       * @exception javax.jms.JMSException  Description of Exception
   98       */
   99      public javax.jms.ServerSessionPool getServerSessionPool(javax.jms.Connection con, int maxSession, boolean isTransacted, int ack, boolean useLocalTX, javax.jms.MessageListener listener) throws javax.jms.JMSException
  100      {
  101         ServerSessionPool pool = (ServerSessionPool)new StdServerSessionPool(con, isTransacted, ack, useLocalTX, listener, maxSession, xidFactory);
  102         return pool;
  103      }
  104   }

Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » jms » asf » [javadoc | source]