User: ejort   
  Date: 02/01/04 23:52:20

  Modified:    src/main/org/jboss/mq/cluster/jms
                        ClusterTopicConnection.java
  Log:
  Guarded debug logging
  
  Revision  Changes    Path
  1.3       +17 -8     
jbossmq/src/main/org/jboss/mq/cluster/jms/ClusterTopicConnection.java
  
  Index: ClusterTopicConnection.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/cluster/jms/ClusterTopicConnection.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClusterTopicConnection.java       2001/08/17 03:04:03     1.2
  +++ ClusterTopicConnection.java       2002/01/05 07:52:20     1.3
  @@ -42,7 +42,7 @@
    *
    * @author     Hiram Chirino ([EMAIL PROTECTED])
    * @created    August 16, 2001
  - * @version    $Revision: 1.2 $
  + * @version    $Revision: 1.3 $
    */
   public class ClusterTopicConnection implements Serializable, TopicConnection, 
TransportListener {
      //Is the connection stopped ?
  @@ -225,7 +225,9 @@
            return;
         }
   
  -      cat.debug( "Closing sessions, ClientID=" + getClientID() );
  +      boolean debug = cat.isDebugEnabled();
  +      if (debug)
  +         cat.debug( "Closing sessions, ClientID=" + getClientID() );
         //notify his sessions
         synchronized ( createdSessions ) {
            Object[] vect = createdSessions.toArray();
  @@ -233,9 +235,11 @@
               ( ( ClusterTopicSession )vect[i] ).close();
            }
         }
  -      cat.debug( "Closed sessions" );
  +      if (debug)
  +         cat.debug( "Closed sessions" );
   
  -      cat.debug( "Disconnecting from the transport" );
  +      if (debug)
  +         cat.debug( "Disconnecting from the transport" );
         //Notify the JMSServer that I am closing
         try {
            transport.stop();
  @@ -244,7 +248,8 @@
            failureHandler( e, "Cannot properly close the transport" );
         }
   
  -      cat.debug( "Disconnected from the transport" );
  +      if (debug)
  +         cat.debug( "Disconnected from the transport" );
   
         // Only set the closed flag after all the objects that depend
         // on this connection have been closed.
  @@ -422,7 +427,8 @@
      //A new Consumer has been created for the Destination dest
      void addConsumer( ClusterTopicSubscriber consumer )
         throws JMSException {
  -      cat.debug( "[" + this + "]: addConsumer(dest=" + consumer.topic + ")" );
  +      if (cat.isDebugEnabled())
  +         cat.debug( "[" + this + "]: addConsumer(dest=" + consumer.topic + ")" );
   
         if ( closed ) {
            throw new IllegalStateException( "The connection is closed" );
  @@ -468,14 +474,17 @@
            return;
         }
   
  +      boolean debug = cat.isDebugEnabled();
         LinkedList ll = ( LinkedList )topicSubscribers.get( 
message.getJMSDestination() );
         if ( ll == null ) {
            // No listeners...
  -         cat.debug( "No subscriptions for message: " + message );
  +         if (debug)
  +            cat.debug( "No subscriptions for message: " + message );
            return;
         }
   
  -      cat.debug( "Dispatching message: " + message );
  +      if (debug)
  +         cat.debug( "Dispatching message: " + message );
         Iterator i = ll.iterator();
         while ( i.hasNext() ) {
            ClusterTopicSubscriber c = ( ClusterTopicSubscriber )i.next();
  
  
  

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

Reply via email to