Was having some jmx dup id issues.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@392283 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-04-07 13:20:16 +00:00
parent 68779c0aa5
commit 064880b08a
2 changed files with 11 additions and 14 deletions

View File

@ -149,6 +149,12 @@ public class TransportConnector implements Connector {
}
public URI getUri() {
if( uri == null ) {
try {
uri = getConnectUri();
} catch (Throwable e) {
}
}
return uri;
}
@ -265,10 +271,9 @@ public class TransportConnector implements Connector {
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 class TransportConnector implements Connector {
}
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;
}

View File

@ -57,7 +57,7 @@ public class ManagedTransportConnector extends TransportConnector {
}
protected static synchronized long getNextConnectionId() {
return nextConnectionId;
return nextConnectionId++;
}
}