User: ejort   
  Date: 02/01/05 04:08:53

  Modified:    src/main/org/jboss/jms/asf ServerSessionPoolLoader.java
                        StdServerSession.java StdServerSessionPool.java
  Log:
  Guarded debug logging
  
  Revision  Changes    Path
  1.6       +3 -2      jboss/src/main/org/jboss/jms/asf/ServerSessionPoolLoader.java
  
  Index: ServerSessionPoolLoader.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/ServerSessionPoolLoader.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ServerSessionPoolLoader.java      2001/11/12 06:52:16     1.5
  +++ ServerSessionPoolLoader.java      2002/01/05 12:08:53     1.6
  @@ -38,7 +38,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a>.
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class ServerSessionPoolLoader 
      extends ServiceMBeanSupport
  @@ -135,7 +135,8 @@
         poolFactory = (ServerSessionPoolFactory)cls.newInstance();
         poolFactory.setName(name);
   
  -      log.debug("initialized with pool factory: " + poolFactory);
  +      if (log.isDebugEnabled())
  +         log.debug("initialized with pool factory: " + poolFactory);
         InitialContext ctx = new InitialContext();
         String name = poolFactory.getName();
         String jndiname = "java:/" + name;
  
  
  
  1.12      +10 -10    jboss/src/main/org/jboss/jms/asf/StdServerSession.java
  
  Index: StdServerSession.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/StdServerSession.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- StdServerSession.java     2001/12/13 13:32:05     1.11
  +++ StdServerSession.java     2002/01/05 12:08:53     1.12
  @@ -31,7 +31,7 @@
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a> .
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a> .
  - * @version   $Revision: 1.11 $
  + * @version   $Revision: 1.12 $
    */
   public class StdServerSession
      implements Runnable, ServerSession, MessageListener
  @@ -101,9 +101,10 @@
         if( xaSession == null )
            useLocalTX = false;
         this.useLocalTX = useLocalTX;
  -      
  -      log.debug("initializing (pool, session, xaSession, useLocalTX): " +
  -      pool + ", " + session + ", " + xaSession + ", " + useLocalTX);
  +
  +      if (log.isDebugEnabled())
  +         log.debug("initializing (pool, session, xaSession, useLocalTX): " +
  +            pool + ", " + session + ", " + xaSession + ", " + useLocalTX);
         
         // Set out self as message listener
         if (xaSession != null)
  @@ -340,8 +341,7 @@
       */
      public void start() throws JMSException
      {
  -      if( log.isTraceEnabled() )
  -         log.trace("starting invokes on server session");
  +      log.trace("starting invokes on server session");
         
         if (session != null)
         {
  @@ -358,7 +358,7 @@
            throw new JMSException("No listener has been specified");
         }
      }
  -   
  +
      /**
       * Called by the ServerSessionPool when the sessions should be closed.
       */
  @@ -373,10 +373,10 @@
            catch (Exception ignore)
            {
            }
  -         
  +
            session = null;
         }
  -      
  +
         if (xaSession != null)
         {
            try
  @@ -388,7 +388,7 @@
            }
            xaSession = null;
         }
  -      
  +
         log.debug("closed");
      }
      
  
  
  
  1.18      +7 -3      jboss/src/main/org/jboss/jms/asf/StdServerSessionPool.java
  
  Index: StdServerSessionPool.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/jms/asf/StdServerSessionPool.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- StdServerSessionPool.java 2001/12/19 06:22:23     1.17
  +++ StdServerSessionPool.java 2002/01/05 12:08:53     1.18
  @@ -37,7 +37,7 @@
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a> .
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a> .
  - * @version   $Revision: 1.17 $
  + * @version   $Revision: 1.18 $
    */
   public class StdServerSessionPool
          implements ServerSessionPool
  @@ -325,13 +325,16 @@
   
      private void create() throws JMSException
      {
  +      boolean debug = log.isDebugEnabled();
  +
         for (int index = 0; index < poolSize; index++)
         {
            // Here is the meat, that MUST follow the spec
            Session ses = null;
            XASession xaSes = null;
   
  -         log.debug("initializing with connection: " + con);
  +         if (debug)
  +            log.debug("initializing with connection: " + con);
   
            if (con instanceof XATopicConnection)
            {
  @@ -368,7 +371,8 @@
   
            sessionPool.add(serverSession);
            numServerSessions++;
  -         log.debug("added server session to the pool: " + serverSession);
  +         if (debug)
  +            log.debug("added server session to the pool: " + serverSession);
         }
      }
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to