Fixe for AMQ-4977, removed dead code

This commit is contained in:
Kevin Earls 2014-03-19 18:57:57 +01:00
parent e06e23b9f3
commit a3701fcb92
1 changed files with 6 additions and 12 deletions

View File

@ -34,13 +34,15 @@ import org.apache.activemq.transport.ResponseCallback;
import org.apache.activemq.transport.Transport; import org.apache.activemq.transport.Transport;
import org.apache.activemq.transport.TransportDisposedIOException; import org.apache.activemq.transport.TransportDisposedIOException;
import org.apache.activemq.transport.TransportListener; import org.apache.activemq.transport.TransportListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* A Transport implementation that uses direct method invocations. * A Transport implementation that uses direct method invocations.
*/ */
public class VMTransport implements Transport, Task { public class VMTransport implements Transport, Task {
protected static final Logger LOG = LoggerFactory.getLogger(VMTransport.class);
private static final Object DISCONNECT = new Object();
private static final AtomicLong NEXT_ID = new AtomicLong(0); private static final AtomicLong NEXT_ID = new AtomicLong(0);
// Transport Configuration // Transport Configuration
@ -131,13 +133,9 @@ public class VMTransport implements Transport, Task {
} }
public void doDispatch(VMTransport transport, TransportListener transportListener, Object command) { public void doDispatch(VMTransport transport, TransportListener transportListener, Object command) {
if (command == DISCONNECT) {
transportListener.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
} else {
transport.receiveCounter++; transport.receiveCounter++;
transportListener.onCommand(command); transportListener.onCommand(command);
} }
}
public void start() throws Exception { public void start() throws Exception {
@ -241,11 +239,7 @@ public class VMTransport implements Transport, Task {
Object command = mq.poll(); Object command = mq.poll();
if (command != null && !disposed.get()) { if (command != null && !disposed.get()) {
if( command == DISCONNECT ) {
tl.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
} else {
tl.onCommand(command); tl.onCommand(command);
}
return !mq.isEmpty() && !disposed.get(); return !mq.isEmpty() && !disposed.get();
} else { } else {
if(disposed.get()) { if(disposed.get()) {