protected void transportListenerOnCommand(Command command) { if (transportListener != null) { transportListener.onCommand(command); } }
public void doDispatch(VMTransport transport, TransportListener transportListener, Object command) { transport.receiveCounter++; transportListener.onCommand(command); }
@Override public void onCommand(Object command) { transportListener.onCommand(command); }
/** * Process the inbound command */ public void doConsume(Object command) { if (command != null) { if (transportListener != null) { transportListener.onCommand(command); } else { LOG.error("No transportListener available to process inbound command: " + command); } } }
@Override public void onCommand(Object command) { getTransportListener().onCommand(command); }
public void onCommand(Object command) { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if( logging && log.isDebugEnabled() ) { logWriter.logReceivedCommand(log, command); } getTransportListener().onCommand(command); }
public void onCommand(Object o) { Command command = (Command)o; if (command.isWireFormatInfo()) { WireFormatInfo info = (WireFormatInfo)command; negociate(info); } getTransportListener().onCommand(command); }
transportListener.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); } }
/** * @see org.apache.activemq.thread.Task#iterate() */ @Override public boolean iterate() { final TransportListener tl = transportListener; LinkedBlockingQueue<Object> mq; try { mq = getMessageQueue(); } catch (TransportDisposedIOException e) { return false; } Object command = mq.poll(); if (command != null && !disposed.get()) { try { tl.onCommand(command); } catch (Exception e) { try { peer.transportListener.onException(IOExceptionSupport.create(e)); } catch (Exception ignore) { } } return !mq.isEmpty() && !disposed.get(); } else { if(disposed.get()) { mq.clear(); } return false; } }
listener.onCommand(command);
public void onCommand(Object command) { try { getTransportListener().onCommand((Command)localWireFormat.unmarshal(remoteWireFormat.marshal(command))); } catch (IOException e) { getTransportListener().onException(e); } }
public void onCommand(Object o) { Command command = (Command)o; byte type = command.getDataStructureType(); if (type == PartialCommand.DATA_STRUCTURE_TYPE || type == LastPartialCommand.DATA_STRUCTURE_TYPE) { PartialCommand header = (PartialCommand)command; byte[] partialData = header.getData(); try { out.write(partialData); } catch (IOException e) { getTransportListener().onException(e); } if (type == LastPartialCommand.DATA_STRUCTURE_TYPE) { try { byte[] fullData = out.toByteArray(); out.reset(); DataInputStream dataIn = new DataInputStream(new ByteArrayInputStream(fullData)); Command completeCommand = (Command)wireFormat.unmarshal(dataIn); LastPartialCommand lastCommand = (LastPartialCommand)command; lastCommand.configure(completeCommand); getTransportListener().onCommand(completeCommand); } catch (IOException e) { LOG.warn("Failed to unmarshal partial command: " + command); getTransportListener().onException(e); } } } 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); } }
response.setException(new TransactionRolledBackException("Transaction completion in doubt due to failover. Forcing rollback of " + command.getTransactionId())); response.setCorrelationId(command.getCommandId()); transport.getTransportListener().onCommand(response);
peer.transportListener.onCommand(new ShutdownInfo()); } catch (Exception ignore) {
protected void transportListenerOnCommand(Command command) { if (transportListener != null) { transportListener.onCommand(command); } }
public void onCommand(Object command) { // Changed this method to use a LogWriter object to actually // print the messages to the log, and only in case of logging // being active, instead of logging the message directly. if( logging && log.isDebugEnabled() ) { logWriter.logReceivedCommand(log, command); } getTransportListener().onCommand(command); }
public void onCommand(Object command) { try { getTransportListener().onCommand((Command)localWireFormat.unmarshal(remoteWireFormat.marshal(command))); } catch (IOException e) { getTransportListener().onException(e); } }