mirror of https://github.com/apache/activemq.git
Added some better logging.
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@376048 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a7ac415557
commit
ef61027ad7
|
@ -36,6 +36,7 @@ import org.apache.activemq.transport.Transport;
|
||||||
import org.apache.activemq.transport.TransportFactory;
|
import org.apache.activemq.transport.TransportFactory;
|
||||||
import org.apache.activemq.transport.TransportListener;
|
import org.apache.activemq.transport.TransportListener;
|
||||||
import org.apache.activemq.util.IOExceptionSupport;
|
import org.apache.activemq.util.IOExceptionSupport;
|
||||||
|
import org.apache.activemq.util.ServiceStopper;
|
||||||
import org.apache.activemq.util.ServiceSupport;
|
import org.apache.activemq.util.ServiceSupport;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
@ -193,6 +194,7 @@ public class FanoutTransport implements CompositeTransport {
|
||||||
|
|
||||||
URI uri = fanoutHandler.uri;
|
URI uri = fanoutHandler.uri;
|
||||||
try {
|
try {
|
||||||
|
log.debug("Stopped: "+this);
|
||||||
log.debug("Attempting connect to: " + uri);
|
log.debug("Attempting connect to: " + uri);
|
||||||
Transport t = TransportFactory.compositeConnect(uri);
|
Transport t = TransportFactory.compositeConnect(uri);
|
||||||
log.debug("Connection established");
|
log.debug("Connection established");
|
||||||
|
@ -273,18 +275,24 @@ public class FanoutTransport implements CompositeTransport {
|
||||||
|
|
||||||
public void stop() throws Exception {
|
public void stop() throws Exception {
|
||||||
synchronized (reconnectMutex) {
|
synchronized (reconnectMutex) {
|
||||||
log.debug("Stopped.");
|
ServiceStopper ss = new ServiceStopper();
|
||||||
|
|
||||||
if (!started)
|
if (!started)
|
||||||
return;
|
return;
|
||||||
started = false;
|
started = false;
|
||||||
disposed = true;
|
disposed = true;
|
||||||
|
|
||||||
|
reconnectTask.shutdown();
|
||||||
|
|
||||||
for (Iterator iter = transports.iterator(); iter.hasNext();) {
|
for (Iterator iter = transports.iterator(); iter.hasNext();) {
|
||||||
FanoutTransportHandler th = (FanoutTransportHandler) iter.next();
|
FanoutTransportHandler th = (FanoutTransportHandler) iter.next();
|
||||||
if( th.transport != null ) {
|
if( th.transport != null ) {
|
||||||
th.transport.stop();
|
ss.stop(th.transport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.debug("Stopped: "+this);
|
||||||
|
ss.throwFirstException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue