commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms ReceiveTag.java
Date Wed, 26 Jun 2002 11:46:45 GMT
jstrachan    2002/06/26 04:46:45

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/jms
                        ReceiveTag.java
  Log:
  added some debug logging
  
  Revision  Changes    Path
  1.4       +17 -0     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/ReceiveTag.java
  
  Index: ReceiveTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/jms/ReceiveTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ReceiveTag.java	26 Jun 2002 09:24:35 -0000	1.3
  +++ ReceiveTag.java	26 Jun 2002 11:46:45 -0000	1.4
  @@ -67,6 +67,9 @@
   import org.apache.commons.jelly.JellyException;
   import org.apache.commons.jelly.XMLOutput;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +
   /** Receives a JMS message.
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -74,6 +77,9 @@
     */
   public class ReceiveTag extends MessageOperationTag {
   
  +    /** The Log to which logging calls will be made. */
  +    private static final Log log = LogFactory.getLog(ReceiveTag.class);
  +
       private String var;
       private long timeout = -1L;
       
  @@ -92,12 +98,23 @@
           }
           Message message = null;
           if ( timeout > 0 ) {
  +            if ( log.isDebugEnabled() ) {
  +                log.debug( "Receiving message on destination: " + destination + " with
timeout: " + timeout );
  +            }
  +            
               message = getConnection().receive( destination, timeout );
           }
           else if ( timeout == 0 ) {
  +            if ( log.isDebugEnabled() ) {
  +                log.debug( "Receiving message on destination: " + destination + " with
No Wait" );
  +            }
  +            
               message = getConnection().receiveNoWait( destination );
           }
           else {
  +            if ( log.isDebugEnabled() ) {
  +                log.debug( "Receiving message on destination: " + destination );
  +            }
               message = getConnection().receive( destination );
           }
           onMessage( message );
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message