activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r429984 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
Date Wed, 09 Aug 2006 07:18:00 GMT
Author: rajdavies
Date: Wed Aug  9 00:17:59 2006
New Revision: 429984

URL: http://svn.apache.org/viewvc?rev=429984&view=rev
Log:
fix for http://issues.apache.org/activemq/browse/AMQ-872

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java?rev=429984&r1=429983&r2=429984&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
Wed Aug  9 00:17:59 2006
@@ -66,6 +66,7 @@
     private URI connectUri;
     private String name;
     private boolean disableAsyncDispatch=false;
+    private boolean enableStatusMonitor = true;
 
 
     /**
@@ -75,14 +76,21 @@
         return connections;
     }
 
-    public TransportConnector() {
-        this.statusDector = new TransportStatusDetector(this);
+    public TransportConnector(){
     }
+    
 
-    public TransportConnector(Broker broker, TransportServer server) {
+    public TransportConnector(Broker broker,TransportServer server){
         this();
         setBroker(broker);
         setServer(server);
+        if (server!=null&&server.getConnectURI()!=null){
+            URI uri = server.getConnectURI();
+            if (uri != null && uri.getScheme().equals("vm")){
+                setEnableStatusMonitor(false);
+            }
+        }
+        
     }
 
     /**
@@ -207,7 +215,11 @@
             da.registerService(getConnectUri().toString());
             da.start();
         }
-        this.statusDector.start();
+        if (enableStatusMonitor){
+            this.statusDector = new TransportStatusDetector(this);
+            this.statusDector.start();
+        }
+        
         log.info("Connector "+getName()+" Started");
     }
 
@@ -219,7 +231,10 @@
         if (server != null) {
             ss.stop(server);
         }
-        this.statusDector.stop();
+        if (this.statusDector != null){
+            this.statusDector.stop();
+        }
+        
         for (Iterator iter = connections.iterator(); iter.hasNext();) {
             TransportConnection c = (TransportConnection) iter.next();
             ss.stop(c);
@@ -314,4 +329,18 @@
 	public void setDisableAsyncDispatch(boolean disableAsyncDispatch) {
 		this.disableAsyncDispatch = disableAsyncDispatch;
 	}
+
+    /**
+     * @return the enableStatusMonitor
+     */
+    public boolean isEnableStatusMonitor(){
+        return enableStatusMonitor;
+    }
+
+    /**
+     * @param enableStatusMonitor the enableStatusMonitor to set
+     */
+    public void setEnableStatusMonitor(boolean enableStatusMonitor){
+        this.enableStatusMonitor=enableStatusMonitor;
+    }
 }



Mime
View raw message