@Override public String getRemoteAddress() { if (primary != null) { if (primary.transport != null) { return primary.transport.getRemoteAddress(); } } return null; }
@Override public String getRemoteAddress() { return next.getRemoteAddress(); }
@Override public String getLocalAddress() { return localBroker.getRemoteAddress(); }
public String getLocalAddress() { return localBroker.getRemoteAddress(); }
@Override public String toString() { return "Transport Connection to: " + transport.getRemoteAddress(); }
@Override public String getRemoteAddress() { return transport.getRemoteAddress(); }
@Override public String getRemoteAddress() { return remoteBroker.getRemoteAddress(); }
public String getRemoteAddress() { return remoteBroker.getRemoteAddress(); }
@Override public int hashCode() { int hash = 17; if (localTransport != null && localTransport.getRemoteAddress() != null) { hash += 31 * hash + localTransport.getRemoteAddress().hashCode(); } if (remoteTransport != null && remoteTransport.getRemoteAddress() != null) { hash = 31 * hash + remoteTransport.hashCode(); } return hash; }
@Override public String getRemoteAddress() { Transport transport = connectedTransport.get(); if (transport != null) { return transport.getRemoteAddress(); } return null; }
@Override public boolean equals(Object arg) { if (arg == null || !(arg instanceof ProxyConnection)) { return false; } else { ProxyConnection other = (ProxyConnection) arg; String otherRemote = ""; String otherLocal = ""; String thisRemote = ""; String thisLocal = ""; if (other.localTransport != null && other.localTransport.getRemoteAddress() != null) { otherLocal = other.localTransport.getRemoteAddress(); } if (other.remoteTransport != null && other.remoteTransport.getRemoteAddress() != null) { otherRemote = other.remoteTransport.getRemoteAddress(); } if (this.remoteTransport != null && this.remoteTransport.getRemoteAddress() != null) { thisRemote = this.remoteTransport.getRemoteAddress(); } if (this.localTransport != null && this.localTransport.getRemoteAddress() != null) { thisLocal = this.localTransport.getRemoteAddress(); } if (otherRemote.equals(thisRemote) && otherLocal.equals(thisLocal)) { return true; } else { return false; } } }
@Override public void run() { try { Thread.sleep(waitTime); stopAsync(); LOG.info("Stopping {} because {}", transport.getRemoteAddress(), reason); } catch (InterruptedException e) { } } });
@Override public void stop() throws Exception { // do not stop task the task runner factories (taskRunnerFactory, stopTaskRunnerFactory) // as their lifecycle is handled elsewhere stopAsync(); while (!stopped.await(5, TimeUnit.SECONDS)) { LOG.info("The connection to '{}' is taking a long time to shutdown.", transport.getRemoteAddress()); } }
@Override public String getRemoteAddress() { return getNext().getRemoteAddress(); }
@Override public void oneway(Object command) throws IOException { String address =(next!=null?next.getRemoteAddress():null); if (address!=null) { String name = Thread.currentThread().getName(); try { String sendname = name + " - SendTo:"+address; Thread.currentThread().setName(sendname); super.oneway(command); }finally { Thread.currentThread().setName(name); } } else { super.oneway(command); } }
@Override public void run() { LOG.debug("Running {}", this); onException(new InactivityIOException("Channel was inactive for too (>" + readCheckTime + ") long: " + next.getRemoteAddress())); }
protected static boolean deRegisterWrite(WriteTimeoutFilter filter, boolean fail, IOException iox) { boolean result = writers.remove(filter); if (result) { if (fail) { String message = "Forced write timeout for:"+filter.getNext().getRemoteAddress(); LOG.warn(message); Socket sock = filter.getSocket(); if (sock==null) { LOG.error("Destination socket is null, unable to close socket.("+message+")"); } else { try { sock.close(); }catch (IOException ignore) { } } } } return result; }
private void doOnewaySend(Object command) throws IOException { if (failed.get()) { throw new InactivityIOException("Cannot send, channel has already failed: " + next.getRemoteAddress()); } if (command.getClass() == WireFormatInfo.class) { synchronized (this) { processOutboundWireFormatInfo((WireFormatInfo) command); } } next.oneway(command); }
@Override public void onAccept(final Transport transport) { try { brokerService.getTaskRunnerFactory().execute(new Runnable() { @Override public void run() { try { if (!brokerService.isStopping()) { Connection connection = createConnection(transport); connection.start(); } else { throw new BrokerStoppedException("Broker " + brokerService + " is being stopped"); } } catch (Exception e) { String remoteHost = transport.getRemoteAddress(); ServiceSupport.dispose(transport); onAcceptError(e, remoteHost); } } }); } catch (Exception e) { String remoteHost = transport.getRemoteAddress(); ServiceSupport.dispose(transport); onAcceptError(e, remoteHost); } }
public ManagedTransportConnection(TransportConnector connector, Transport transport, Broker broker, TaskRunnerFactory factory, TaskRunnerFactory stopFactory, ManagementContext context, ObjectName connectorName) throws IOException { super(connector, transport, broker, factory, stopFactory); this.managementContext = context; this.connectorName = connectorName; this.mbean = new ConnectionView(this, managementContext); this.populateUserName = broker.getBrokerService().isPopulateUserNameInMBeans(); if (managementContext.isAllowRemoteAddressInMBeanNames()) { byAddressName = createObjectName("remoteAddress", transport.getRemoteAddress()); registerMBean(byAddressName); } }