activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r392283 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: TransportConnector.java jmx/ManagedTransportConnector.java
Date Fri, 07 Apr 2006 13:20:18 GMT
Author: chirino
Date: Fri Apr  7 06:20:16 2006
New Revision: 392283

URL: http://svn.apache.org/viewcvs?rev=392283&view=rev
Log:
Was having some jmx dup id issues.

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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnector.java?rev=392283&r1=392282&r2=392283&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
Fri Apr  7 06:20:16 2006
@@ -149,6 +149,12 @@
     }
 
     public URI getUri() {
+        if( uri == null ) {
+            try {
+                uri = getConnectUri();
+            } catch (Throwable e) {
+            }
+        }
         return uri;
     }
 
@@ -265,10 +271,9 @@
 
     public URI getConnectUri() throws IOException, URISyntaxException {
         if( connectUri==null ) {
-            if( getServer().getConnectURI()==null ) {
-                throw new IllegalStateException("The transportConnector has not been started.");
+            if( server !=null ) {
+                connectUri = server.getConnectURI();
             }
-            connectUri = getServer().getConnectURI();
         }
         return connectUri;
     }
@@ -286,16 +291,8 @@
     }
 
     public String getName(){
-        if(name==null){
-            if(server!=null){
-                if(server.getConnectURI()!=null){
-                    name=server.getConnectURI().toString();
-                }else{
-                    name = server.getClass() + ":Not started";
-                }
-            }else{
-                name = "NOT_SET";
-            }
+        if( name==null ){
+            name = getUri().toString();
         }
         return name;
     }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnector.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnector.java?rev=392283&r1=392282&r2=392283&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagedTransportConnector.java
Fri Apr  7 06:20:16 2006
@@ -57,7 +57,7 @@
     }
 
     protected static synchronized long getNextConnectionId() {
-        return nextConnectionId;
+        return nextConnectionId++;
     }
 
 }



Mime
View raw message