improvement for https://issues.apache.org/activemq/browse/AMQ-1936 - improve vm transport stopping performances

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@803907 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2009-08-13 14:47:48 +00:00
parent 453860fb47
commit a5ac040531
1 changed files with 7 additions and 6 deletions

View File

@ -32,6 +32,8 @@ import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportDisposedIOException;
import org.apache.activemq.transport.TransportListener;
import org.apache.activemq.util.IOExceptionSupport;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
@ -144,12 +146,6 @@ public class VMTransport implements Transport, Task {
// If stop() is called while being start()ed.. then we can't stop until we return to the start() method.
if( enqueueValve.isOn() ) {
// let the peer know that we are disconnecting..
try {
oneway(DISCONNECT);
} catch (Exception ignore) {
}
TaskRunner tr = null;
try {
enqueueValve.turnOff();
@ -168,6 +164,11 @@ public class VMTransport implements Transport, Task {
if (tr != null) {
tr.shutdown(1000);
}
// let the peer know that we are disconnecting..
try {
oneway(DISCONNECT);
} catch (Exception ignore) {
}
}
}