Impoved error logging and throw an exception if the transport is being used when it has been disconnected.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@420714 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-07-11 04:32:20 +00:00
parent 87666fa194
commit 40958b688f
2 changed files with 5 additions and 3 deletions

View File

@ -77,6 +77,8 @@ public class VMTransport implements Transport{
}else {
queue.add(command);
}
} else {
throw new IOException("Peer disconnected.");
}
}

View File

@ -143,7 +143,7 @@ public class VMTransportFactory extends TransportFactory{
*/
private TransportServer bind(URI location,boolean dispose) throws IOException{
String host=location.getHost();
log.info("binding to broker: " + host);
log.debug("binding to broker: " + host);
VMTransportServer server=new VMTransportServer(location,dispose);
Object currentBoundValue=servers.get(host);
if(currentBoundValue!=null){
@ -155,10 +155,10 @@ public class VMTransportFactory extends TransportFactory{
public static void stopped(VMTransportServer server){
String host=server.getBindURI().getHost();
log.info("Shutting down VM connectors for broker: " +host);
servers.remove(host);
TransportConnector connector=(TransportConnector) connectors.remove(host);
if(connector!=null){
log.debug("Shutting down VM connectors for broker: " +host);
ServiceSupport.dispose(connector);
BrokerService broker=(BrokerService) brokers.remove(host);
if(broker!=null){
@ -168,10 +168,10 @@ public class VMTransportFactory extends TransportFactory{
}
public static void stopped(String host){
log.info("Shutting down VM connectors for broker: " +host);
servers.remove(host);
TransportConnector connector=(TransportConnector) connectors.remove(host);
if(connector!=null){
log.debug("Shutting down VM connectors for broker: " +host);
ServiceSupport.dispose(connector);
BrokerService broker=(BrokerService) brokers.remove(host);
if(broker!=null){