added NPE check

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@550793 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-06-26 12:56:08 +00:00
parent 8068c5e155
commit f6e1ac7f97
1 changed files with 11 additions and 4 deletions

View File

@ -115,13 +115,13 @@ public class FanoutTransport implements CompositeTransport {
if( rc != null ) {
if( rc.ackCount.decrementAndGet() <= 0 ) {
requestMap.remove(id);
transportListener.onCommand(command);
transportListenerOnCommand(command);
}
} else {
transportListener.onCommand(command);
transportListenerOnCommand(command);
}
} else {
transportListener.onCommand(command);
transportListenerOnCommand(command);
}
}
@ -144,10 +144,12 @@ public class FanoutTransport implements CompositeTransport {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
if (transportListener != null) {
transportListener.onException(new InterruptedIOException());
}
}
}
}
public FanoutTransport() throws InterruptedIOException {
// Setup a task that is used to reconnect the a connection async.
@ -532,4 +534,9 @@ public class FanoutTransport implements CompositeTransport {
return null;
}
protected void transportListenerOnCommand(Command command) {
if (transportListener != null) {
transportListener.onCommand(command);
}
}
}