activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r559071 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Date Tue, 24 Jul 2007 15:01:33 GMT
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);



Mime
View raw message