@Override public void onCommand(Object o) { Command command = (Command) o; if (command.isResponse()) { Integer id = new Integer(((Response) command).getCorrelationId()); RequestCounter rc = requestMap.get(id); if (rc != null) { if (rc.ackCount.decrementAndGet() <= 0) { requestMap.remove(id); transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } }
public void onCommand(Object o) { Command command = null; if (o instanceof Command) { command = (Command)o; } else { throw new ClassCastException("Object cannot be converted to a Command, Object: " + o); } if (command.isResponse()) { Response response = (Response)command; FutureResponse future = null; synchronized (requestMap) { future = requestMap.remove(Integer.valueOf(response.getCorrelationId())); } if (future != null) { future.set(response); } else { if (debug) { LOG.debug("Received unexpected response: {" + command + "}for command id: " + response.getCorrelationId()); } } } else { getTransportListener().onCommand(command); } }
private void processCommand(Object incoming) { Command command = (Command) incoming; if (command == null) { return; } if (command.isResponse()) { Object object = null; synchronized (requestMap) { object = requestMap.remove(Integer.valueOf(((Response) command).getCorrelationId())); } if (object != null && object.getClass() == Tracked.class) { ((Tracked) object).onResponses(command); } } if (command.isConnectionControl()) { handleConnectionControl((ConnectionControl) command); } else if (command.isConsumerControl()) { ConsumerControl consumerControl = (ConsumerControl)command; if (consumerControl.isClose()) { stateTracker.processRemoveConsumer(consumerControl.getConsumerId(), RemoveInfo.LAST_DELIVERED_UNKNOWN); } } if (transportListener != null) { transportListener.onCommand(command); } }
@Override public void onCommand(Object o) { Command command = (Command) o; if (command.isResponse()) { Integer id = new Integer(((Response) command).getCorrelationId()); RequestCounter rc = requestMap.get(id); if (rc != null) { if (rc.ackCount.decrementAndGet() <= 0) { requestMap.remove(id); transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } }
@Override public void onCommand(Object o) { Command command = (Command) o; if (command.isResponse()) { Integer id = new Integer(((Response) command).getCorrelationId()); RequestCounter rc = requestMap.get(id); if (rc != null) { if (rc.ackCount.decrementAndGet() <= 0) { requestMap.remove(id); transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } }
public void onActiveMQCommand(Command command) throws Exception { if (command.isResponse()) { Response response = (Response)command; Handler<Response> handler = responseHandlers.remove(new Integer(response.getCorrelationId())); if (handler != null) { handler.handle(response); } else { LOG.warn("No handler for response: " + response); } } else if (command.isMessageDispatch()) { MessageDispatch md = (MessageDispatch)command; Handler<MessageDispatch> handler = subscriptionsByConsumerId.get(md.getConsumerId()); if (handler != null) { handler.handle(md); } else { LOG.warn("No handler for message: " + md); } } }
@Override public void onCommand(Object o) { Command command = (Command) o; if (command.isResponse()) { Integer id = new Integer(((Response) command).getCorrelationId()); RequestCounter rc = requestMap.get(id); if (rc != null) { if (rc.ackCount.decrementAndGet() <= 0) { requestMap.remove(id); transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } }
@Override public void onCommand(Object o) { Command command = (Command)o; if (command.isResponse()) { Integer id = new Integer(((Response)command).getCorrelationId()); RequestCounter rc = requestMap.get(id); if (rc != null) { if (rc.ackCount.decrementAndGet() <= 0) { requestMap.remove(id); transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } } else { transportListenerOnCommand(command); } }
public void onCommand(Object o) { Command command = null; if (o instanceof Command) { command = (Command)o; } else { throw new ClassCastException("Object cannot be converted to a Command, Object: " + o); } if (command.isResponse()) { Response response = (Response)command; FutureResponse future = null; synchronized (requestMap) { future = requestMap.remove(Integer.valueOf(response.getCorrelationId())); } if (future != null) { future.set(response); } else { if (debug) { LOG.debug("Received unexpected response: {" + command + "}for command id: " + response.getCorrelationId()); } } } else { getTransportListener().onCommand(command); } }
public void onCommand(Object o) { Command command = null; if (o instanceof Command) { command = (Command)o; } else { throw new ClassCastException("Object cannot be converted to a Command, Object: " + o); } if (command.isResponse()) { Response response = (Response)command; FutureResponse future = null; synchronized (requestMap) { future = requestMap.remove(Integer.valueOf(response.getCorrelationId())); } if (future != null) { future.set(response); } else { if (debug) { LOG.debug("Received unexpected response: {" + command + "}for command id: " + response.getCorrelationId()); } } } else { getTransportListener().onCommand(command); } }
public void onCommand(Object o) { Command command = null; if (o instanceof Command) { command = (Command)o; } else { throw new ClassCastException("Object cannot be converted to a Command, Object: " + o); } if (command.isResponse()) { Response response = (Response)command; FutureResponse future = null; synchronized (requestMap) { future = requestMap.remove(Integer.valueOf(response.getCorrelationId())); } if (future != null) { future.set(response); } else { if (debug) { LOG.debug("Received unexpected response: {" + command + "}for command id: " + response.getCorrelationId()); } } } else { getTransportListener().onCommand(command); } }
public void onCommand(Object o) { Command command = null; if (o instanceof Command) { command = (Command)o; } else { throw new ClassCastException("Object cannot be converted to a Command, Object: " + o); } if (command.isResponse()) { Response response = (Response)command; FutureResponse future = null; synchronized (requestMap) { future = requestMap.remove(Integer.valueOf(response.getCorrelationId())); } if (future != null) { future.set(response); } else { if (debug) { LOG.debug("Received unexpected response: {" + command + "}for command id: " + response.getCorrelationId()); } } } else { getTransportListener().onCommand(command); } }
public void onCommand(Object o) { Command command = (Command) o; if (command == null) { return; } if (command.isResponse()) { Object object = null; synchronized (requestMap) { object = requestMap.remove(Integer.valueOf(((Response) command).getCorrelationId())); } if (object != null && object.getClass() == Tracked.class) { ((Tracked) object).onResponses(command); } } if (!initialized) { initialized = true; } if(command.isConnectionControl()) { handleConnectionControl((ConnectionControl) command); } if (transportListener != null) { transportListener.onCommand(command); } }
protected void processCommand(Object o) throws Exception { Command command = (Command) o; if (command.isResponse()) { LOG.error("Unexpected response " + command); } else if (command.isMessageDispatch()) { MessageDispatch messageDispatch = (MessageDispatch) command; ConsumerId consumerId = messageDispatch.getConsumerId(); MultiplexerInput input = consumerIdMultiplexerInputMap.get(consumerId); if (input != null) { input.oneway(messageDispatch); } else { LOG.debug("Couldn't find MultiplexerInput for consumerId:" + consumerId); } } else if (command.isBrokerInfo() || command.isWireFormatInfo()) { //not a lot to do with this } else if (command.getClass() == ConnectionError.class) { ConnectionError ce = (ConnectionError) command; onFailure(ce.getException()); } else { switch (command.getDataStructureType()) { case KeepAliveInfo.DATA_STRUCTURE_TYPE: case ShutdownInfo.DATA_STRUCTURE_TYPE: case ConnectionControl.DATA_STRUCTURE_TYPE: break; default: LOG.warn("Unexpected remote command: {}", command); } } }
protected void processCommand(Object o) throws Exception { Command command = (Command) o; if (command.isResponse()) { LOG.error("Unexpected response " + command); } else if (command.isMessageDispatch()) { MessageDispatch messageDispatch = (MessageDispatch) command; ConsumerId consumerId = messageDispatch.getConsumerId(); MultiplexerInput input = consumerIdMultiplexerInputMap.get(consumerId); if (input != null) { input.oneway(messageDispatch); } else { LOG.debug("Couldn't find MultiplexerInput for consumerId:" + consumerId); } } else if (command.isBrokerInfo() || command.isWireFormatInfo()) { //not a lot to do with this } else if (command.getClass() == ConnectionError.class) { ConnectionError ce = (ConnectionError) command; onFailure(ce.getException()); } else { switch (command.getDataStructureType()) { case KeepAliveInfo.DATA_STRUCTURE_TYPE: case ShutdownInfo.DATA_STRUCTURE_TYPE: case ConnectionControl.DATA_STRUCTURE_TYPE: break; default: LOG.warn("Unexpected remote command: {}", command); } } }
private void processCommand(Object incoming) { Command command = (Command) incoming; if (command == null) { return; } if (command.isResponse()) { Object object = null; synchronized (requestMap) { object = requestMap.remove(Integer.valueOf(((Response) command).getCorrelationId())); } if (object != null && object.getClass() == Tracked.class) { ((Tracked) object).onResponses(command); } } if (command.isConnectionControl()) { handleConnectionControl((ConnectionControl) command); } else if (command.isConsumerControl()) { ConsumerControl consumerControl = (ConsumerControl)command; if (consumerControl.isClose()) { stateTracker.processRemoveConsumer(consumerControl.getConsumerId(), RemoveInfo.LAST_DELIVERED_UNKNOWN); } } if (transportListener != null) { transportListener.onCommand(command); } }
private void processCommand(Object incoming) { Command command = (Command) incoming; if (command == null) { return; } if (command.isResponse()) { Object object = null; synchronized (requestMap) { object = requestMap.remove(Integer.valueOf(((Response) command).getCorrelationId())); } if (object != null && object.getClass() == Tracked.class) { ((Tracked) object).onResponses(command); } } if (command.isConnectionControl()) { handleConnectionControl((ConnectionControl) command); } else if (command.isConsumerControl()) { ConsumerControl consumerControl = (ConsumerControl)command; if (consumerControl.isClose()) { stateTracker.processRemoveConsumer(consumerControl.getConsumerId(), RemoveInfo.LAST_DELIVERED_UNKNOWN); } } if (transportListener != null) { transportListener.onCommand(command); } }
private void processCommand(Object incoming) { Command command = (Command) incoming; if (command == null) { return; } if (command.isResponse()) { Object object = null; synchronized (requestMap) { object = requestMap.remove(Integer.valueOf(((Response) command).getCorrelationId())); } if (object != null && object.getClass() == Tracked.class) { ((Tracked) object).onResponses(command); } } if (command.isConnectionControl()) { handleConnectionControl((ConnectionControl) command); } else if (command.isConsumerControl()) { ConsumerControl consumerControl = (ConsumerControl)command; if (consumerControl.isClose()) { stateTracker.processRemoveConsumer(consumerControl.getConsumerId(), RemoveInfo.LAST_DELIVERED_UNKNOWN); } } if (transportListener != null) { transportListener.onCommand(command); } }
if (command.isResponse()) {
if (command.isResponse()) { Response response = (Response)command; ResponseHandler rh = resposeHandlers.remove(Integer.valueOf(response.getCorrelationId()));