public void onCommand(Object o) { final Command command = (Command)o; // redirect to the endpoint that the last response came from Endpoint from = command.getFrom(); transport.setTargetEndpoint(from); super.onCommand(command); } }
protected void processInboundConnection(Command command) { DatagramEndpoint endpoint = (DatagramEndpoint)command.getFrom(); if (LOG.isDebugEnabled()) { LOG.debug("Received command on: " + this + " from address: " + endpoint + " command: " + command); } Transport transport = null; synchronized (transports) { transport = transports.get(endpoint); if (transport == null) { if (usingWireFormatNegotiation && !command.isWireFormatInfo()) { LOG.error("Received inbound server communication from: " + command.getFrom() + " expecting WireFormatInfo but was command: " + command); } else { if (LOG.isDebugEnabled()) { LOG.debug("Creating a new UDP server connection"); } try { transport = createTransport(command, endpoint); transport = configureTransport(transport); transports.put(endpoint, transport); } catch (IOException e) { LOG.error("Caught: " + e, e); getAcceptListener().onAcceptError(e); } } } else { LOG.warn("Discarding duplicate command to server from: " + endpoint + " command: " + command); } } }
/** * Returns the broker ID that the command came from */ protected BrokerId getFromBrokerId(Command command) throws IOException { BrokerId answer = null; Endpoint from = command.getFrom(); if (from == null) { LOG.warn("Incoming command does not have a from endpoint: " + command); } else { answer = from.getBrokerId(); } if (answer != null) { return answer; } else { throw new IOException("No broker ID is available for endpoint: " + from + " from command: " + command); } }
public void onCommand(Object o) { final Command command = (Command)o; // redirect to the endpoint that the last response came from Endpoint from = command.getFrom(); transport.setTargetEndpoint(from); super.onCommand(command); } }
public void onCommand(Object o) { final Command command = (Command)o; // redirect to the endpoint that the last response came from Endpoint from = command.getFrom(); transport.setTargetEndpoint(from); super.onCommand(command); } }
public void onCommand(Object o) { final Command command = (Command)o; // redirect to the endpoint that the last response came from Endpoint from = command.getFrom(); transport.setTargetEndpoint(from); super.onCommand(command); } }
public void onCommand(Object o) { final Command command = (Command)o; // redirect to the endpoint that the last response came from Endpoint from = command.getFrom(); transport.setTargetEndpoint(from); super.onCommand(command); } }
protected void processInboundConnection(Command command) { DatagramEndpoint endpoint = (DatagramEndpoint)command.getFrom(); if (LOG.isDebugEnabled()) { LOG.debug("Received command on: " + this + " from address: " + endpoint + " command: " + command); } Transport transport = null; synchronized (transports) { transport = transports.get(endpoint); if (transport == null) { if (usingWireFormatNegotiation && !command.isWireFormatInfo()) { LOG.error("Received inbound server communication from: " + command.getFrom() + " expecting WireFormatInfo but was command: " + command); } else { if (LOG.isDebugEnabled()) { LOG.debug("Creating a new UDP server connection"); } try { transport = createTransport(command, endpoint); transport = configureTransport(transport); transports.put(endpoint, transport); } catch (IOException e) { LOG.error("Caught: " + e, e); getAcceptListener().onAcceptError(e); } } } else { LOG.warn("Discarding duplicate command to server from: " + endpoint + " command: " + command); } } }
protected void processInboundConnection(Command command) { DatagramEndpoint endpoint = (DatagramEndpoint)command.getFrom(); if (LOG.isDebugEnabled()) { LOG.debug("Received command on: " + this + " from address: " + endpoint + " command: " + command); } Transport transport = null; synchronized (transports) { transport = transports.get(endpoint); if (transport == null) { if (usingWireFormatNegotiation && !command.isWireFormatInfo()) { LOG.error("Received inbound server communication from: " + command.getFrom() + " expecting WireFormatInfo but was command: " + command); } else { if (LOG.isDebugEnabled()) { LOG.debug("Creating a new UDP server connection"); } try { transport = createTransport(command, endpoint); transport = configureTransport(transport); transports.put(endpoint, transport); } catch (IOException e) { LOG.error("Caught: " + e, e); getAcceptListener().onAcceptError(e); } } } else { LOG.warn("Discarding duplicate command to server from: " + endpoint + " command: " + command); } } }
protected void processInboundConnection(Command command) { DatagramEndpoint endpoint = (DatagramEndpoint)command.getFrom(); if (LOG.isDebugEnabled()) { LOG.debug("Received command on: " + this + " from address: " + endpoint + " command: " + command); } Transport transport = null; synchronized (transports) { transport = transports.get(endpoint); if (transport == null) { if (usingWireFormatNegotiation && !command.isWireFormatInfo()) { LOG.error("Received inbound server communication from: " + command.getFrom() + " expecting WireFormatInfo but was command: " + command); } else { if (LOG.isDebugEnabled()) { LOG.debug("Creating a new UDP server connection"); } try { transport = createTransport(command, endpoint); transport = configureTransport(transport); transports.put(endpoint, transport); } catch (IOException e) { LOG.error("Caught: " + e, e); getAcceptListener().onAcceptError(e); } } } else { LOG.warn("Discarding duplicate command to server from: " + endpoint + " command: " + command); } } }
protected void processInboundConnection(Command command) { DatagramEndpoint endpoint = (DatagramEndpoint)command.getFrom(); if (LOG.isDebugEnabled()) { LOG.debug("Received command on: " + this + " from address: " + endpoint + " command: " + command); } Transport transport = null; synchronized (transports) { transport = transports.get(endpoint); if (transport == null) { if (usingWireFormatNegotiation && !command.isWireFormatInfo()) { LOG.error("Received inbound server communication from: " + command.getFrom() + " expecting WireFormatInfo but was command: " + command); } else { if (LOG.isDebugEnabled()) { LOG.debug("Creating a new UDP server connection"); } try { transport = createTransport(command, endpoint); transport = configureTransport(transport); transports.put(endpoint, transport); } catch (IOException e) { LOG.error("Caught: " + e, e); getAcceptListener().onAcceptError(e); } } } else { LOG.warn("Discarding duplicate command to server from: " + endpoint + " command: " + command); } } }
protected void serviceRemoteBrokerInfo(Command command) throws IOException { synchronized (brokerInfoMutex) { BrokerInfo remoteBrokerInfo = (BrokerInfo)command; BrokerId remoteBrokerId = remoteBrokerInfo.getBrokerId(); // lets associate the incoming endpoint with a broker ID so we can // refer to it later Endpoint from = command.getFrom(); if (from == null) { LOG.warn("Incoming command does not have a from endpoint: " + command); } else { from.setBrokerInfo(remoteBrokerInfo); } if (localBrokerId != null) { if (localBrokerId.equals(remoteBrokerId)) { LOG.info("Disconnecting loop back connection."); // waitStarted(); ServiceSupport.dispose(this); } } if (!disposed.get()) { triggerLocalStartBridge(); } } }