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 2007/07/24 17:01:33 UTC

svn commit: r559071 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java

Author: chirino
Date: Tue Jul 24 08:01:32 2007
New Revision: 559071

URL: http://svn.apache.org/viewvc?view=rev&rev=559071
Log:
Fix for AMQ-1339 - Give the connection dispatcher threads names that are easy to associate with the peer.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?view=diff&rev=559071&r1=559070&r2=559071
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java Tue Jul 24 08:01:32 2007
@@ -110,7 +110,7 @@
     private WireFormatInfo wireFormatInfo;
     // Used to do async dispatch.. this should perhaps be pushed down into the transport layer..
     protected final List <Command>dispatchQueue=Collections.synchronizedList(new LinkedList<Command>());
-    protected final TaskRunner taskRunner;
+    protected TaskRunner taskRunner;
     protected final AtomicReference transportException = new AtomicReference();
     private boolean inServiceException=false;
     private ConnectionStatistics statistics=new ConnectionStatistics();
@@ -137,6 +137,7 @@
     private boolean networkConnection;
     private AtomicInteger protocolVersion=new AtomicInteger(CommandTypes.PROTOCOL_VERSION);
     private DemandForwardingBridge duplexBridge = null;
+	final private TaskRunnerFactory taskRunnerFactory;
     
     static class ConnectionState extends org.apache.activemq.state.ConnectionState{
 
@@ -173,12 +174,7 @@
         if(connector!=null){
             this.statistics.setParent(connector.getStatistics());
         }
-        if(taskRunnerFactory!=null){
-            taskRunner=taskRunnerFactory.createTaskRunner(this,"ActiveMQ Connection Dispatcher: "
-                    +System.identityHashCode(this));
-        }else{
-            taskRunner=null;
-        }
+        this.taskRunnerFactory=taskRunnerFactory;
         connector.setBrokerName(broker.getBrokerName());
         this.transport=transport;
         this.transport.setTransportListener(new DefaultTransportListener(){
@@ -838,7 +834,14 @@
     public synchronized void start() throws Exception{
         starting=true;
         try{
-            transport.start();
+        	transport.start();
+        	
+        	if (taskRunnerFactory != null) {
+				taskRunner = taskRunnerFactory.createTaskRunner(this, "ActiveMQ Connection Dispatcher: " + getRemoteAddress());
+			} else {
+				taskRunner = null;
+			} 
+
             active=true;
             this.processDispatch(connector.getBrokerInfo());
             connector.onStarted(this);