allow the transport to be closed before we try and send remove commands to it without generating an exception

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-08 11:47:09 +00:00
parent dba3ea8d0e
commit 534ea690ff
1 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@
package org.apache.activemq.transport;
import org.apache.activemq.command.Command;
import org.apache.activemq.command.RemoveInfo;
import org.apache.activemq.command.ShutdownInfo;
import org.apache.activemq.util.ServiceStopper;
@ -86,7 +87,7 @@ public abstract class TransportThreadSupport extends TransportSupport implements
protected void checkStarted(Command command) throws IOException {
if (!isStarted()) {
// we might try to shut down the transport before it was ever started in some test cases
if (!(command instanceof ShutdownInfo)) {
if (!(command instanceof ShutdownInfo || command instanceof RemoveInfo)) {
throw new IOException("The transport " + this + " of type: " + getClass().getName() + " is not running.");
}
}