git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@739950 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2009-02-02 09:28:28 +00:00
parent 564a9c2ca0
commit 59643ef23e
1 changed files with 3 additions and 0 deletions

View File

@ -175,6 +175,9 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
public void onCommand(Object o) { public void onCommand(Object o) {
serviceLock.readLock().lock(); serviceLock.readLock().lock();
try { try {
if (!(o instanceof Command)) {
throw new RuntimeException("Protocol violation - Command corrupted");
}
Command command = (Command)o; Command command = (Command)o;
Response response = service(command); Response response = service(command);
if (response != null) { if (response != null) {