You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/07/11 06:28:31 UTC

svn commit: r420711 - /incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/TransportLogger.java

Author: chirino
Date: Mon Jul 10 21:28:30 2006
New Revision: 420711

URL: http://svn.apache.org/viewvc?rev=420711&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQ-809

Modified:
    incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/TransportLogger.java

Modified: incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/TransportLogger.java
URL: http://svn.apache.org/viewvc/incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/TransportLogger.java?rev=420711&r1=420710&r2=420711&view=diff
==============================================================================
--- incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/TransportLogger.java (original)
+++ incubator/activemq/branches/activemq-4.0/activemq-core/src/main/java/org/apache/activemq/transport/TransportLogger.java Mon Jul 10 21:28:30 2006
@@ -19,6 +19,7 @@
 import java.io.IOException;
 
 import org.apache.activemq.command.Command;
+import org.apache.activemq.command.Response;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -32,7 +33,7 @@
     private final Log log;
     
     public TransportLogger(Transport next) {
-        this( next, LogFactory.getLog(TransportLogger.class.getName()+":"+getNextId()));
+        this( next, LogFactory.getLog(TransportLogger.class.getName()+".Connection:"+getNextId()));
     }
     
     synchronized private static int getNextId() {
@@ -44,6 +45,26 @@
         this.log = log;
     }
 
+    public Response request(Command command) throws IOException {
+        log.debug("SENDING REQUEST: "+command);
+    	Response rc = super.request(command);
+        log.debug("GOT RESPONSE: "+rc);
+    	return rc;
+    }
+    
+    public Response request(Command command, int timeout) throws IOException {
+        log.debug("SENDING REQUEST: "+command);
+    	Response rc = super.request(command, timeout);
+        log.debug("GOT RESPONSE: "+rc);
+    	return rc;
+    }
+    
+    public FutureResponse asyncRequest(Command command, ResponseCallback responseCallback) throws IOException {
+        log.debug("SENDING ASNYC REQUEST: "+command);
+    	FutureResponse rc = next.asyncRequest(command, responseCallback);
+    	return rc;
+    }
+    
     public void oneway(Command command) throws IOException {
         if( log.isDebugEnabled() ) {
             log.debug("SENDING: "+command);
@@ -53,7 +74,11 @@
     
     public void onCommand(Command command) {
         if( log.isDebugEnabled() ) {
-            log.debug("RECEIVED: from: "+ command.getFrom() + " : " + command);
+        	if( command.getFrom()!=null ) {
+                log.debug("RECEIVED: from: "+ command.getFrom() + " : " + command);
+        	} else {
+                log.debug("RECEIVED: " + command);
+        	}
         }
         getTransportListener().onCommand(command);
     }