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