0 Replies Latest reply on Dec 6, 2005 10:16 PM by adrian.brock

    JBossASF - ServerSessionPool - Stupid API

      The API itself is ridiculous.
      It looks like something a "c" coder wrote. i.e. not understanding of object orientation
      and encapsulated state.

      ServerSessionPoolFactory

      
       /**
       * Create a new <tt>ServerSessionPool</tt>.
       *
       * @param destination the destination
       * @param con the jms connection
       * @param minSession the minimum number of sessions
       * @param maxSession the maximum number of sessions
       * @param keepAlive the time to keep sessions alive
       * @param isTransacted whether the pool is transacted
       * @param ack the acknowledegement method
       * @param listener the listener
       * @param useLocalTX whether to use local transactions
       * @return A new pool.
       * @throws JMSException for any error
       */
       ServerSessionPool getServerSessionPool(Destination destination, Connection con, int minSession, int maxSession,
       long keepAlive, boolean isTransacted, int ack, boolean useLocalTX, MessageListener listener)
       throws JMSException;
      


      Which just maps "directly" onto implementation details:
      
       /**
       * Construct a <tt>StdServerSessionPool</tt> using the default pool size.
       *
       * @param destination the destination
       * @param con connection to get sessions from
       * @param transacted transaction mode when not XA (
       * @param ack ackmode when not XA
       * @param listener the listener the sessions will call
       * @param minSession minumum number of sessions in the pool
       * @param maxSession maximum number of sessions in the pool
       * @param keepAlive the time to keep sessions alive
       * @param xidFactory the xid factory
       * @param tm the transaction manager
       * @exception JMSException Description of Exception
       */
       public StdServerSessionPool(final Destination destination,
       final Connection con,
       final boolean transacted,
       final int ack,
       final boolean useLocalTX,
       final MessageListener listener,
       final int minSession,
       final int maxSession,
       final long keepAlive,
       final XidFactoryMBean xidFactory,
       final TransactionManager tm)
       throws JMSException
       {
      


      This is what breaks anytime you need to add or expose new behaviour.
      And what makes it impossible to plugin any new behaviour by users.