@Override public boolean isConnected() { return next.isConnected(); }
@Override public boolean isConnected() { return getNext().isConnected(); }
@Override public void onException(IOException error) { try { synchronized (reconnectMutex) { if (transport == null || !transport.isConnected()) { return; } LOG.debug("Transport failed, starting up reconnect task", error); ServiceSupport.dispose(transport); transport = null; connectedCount--; if (primary == this) { primary = null; } reconnectTask.wakeup(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); if (transportListener != null) { transportListener.onException(new InterruptedIOException()); } } } }
@Override public boolean isConnected() { return next.isConnected(); }
@Override public boolean isConnected() { return next.isConnected(); }
@Override public boolean isConnected() { return next.isConnected(); }
public boolean isConnected() { return next.isConnected(); }
public void removeTransport(MessageDistribution messageDistribution) { Transport transport = transportMap.remove(messageDistribution); if (transport != null) { if (transport.isConnected()) { try { transport.stop(); } catch (Exception ignored) { } } } }
public void removeTransport(MessageDistribution messageDistribution) { Transport transport = transportMap.remove(messageDistribution); if (transport != null) { if (transport.isConnected()) { try { transport.stop(); } catch (Exception ignored) { } } } }
@Override public boolean isConnected() { return getNext().isConnected(); }
@Override public boolean isConnected() { return getNext().isConnected(); }
@Override public boolean isConnected() { return getNext().isConnected(); }
public boolean isConnected() { return getNext().isConnected(); }
public void updateTransport() throws Exception { for (Map.Entry<MessageDistribution, Transport> entry : transportMap.entrySet()) { Transport transport = entry.getValue(); if (transport == null || !transport.isConnected() || transport.isDisposed()) { createTransport(entry.getKey()); } } }
public void updateTransport() throws Exception { for (Map.Entry<MessageDistribution, Transport> entry : transportMap.entrySet()) { Transport transport = entry.getValue(); if (transport == null || !transport.isConnected() || transport.isDisposed()) { createTransport(entry.getKey()); } } }
public Collection<MessageDistribution> detachTransport() { List<MessageDistribution> result = new ArrayList<>(); for (MessageDistribution messageDistribution : transportMap.keySet()) { Transport transport = transportMap.remove(messageDistribution); if (transport != null) { if (transport.isConnected()) { //prevent exceptions being perculated when we stop this thing transport.setTransportListener(new DefaultTransportListener()); try { transport.stop(); } catch (Throwable ignored) { } } } result.add(messageDistribution); } return result; }
@Override public void onException(IOException error) { try { synchronized (reconnectMutex) { if (transport == null || !transport.isConnected()) { return; } LOG.debug("Transport failed, starting up reconnect task", error); ServiceSupport.dispose(transport); transport = null; connectedCount--; if (primary == this) { primary = null; } reconnectTask.wakeup(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); if (transportListener != null) { transportListener.onException(new InterruptedIOException()); } } } }
@Override public void onException(IOException error) { try { synchronized (reconnectMutex) { if (transport == null || !transport.isConnected()) { return; } LOG.debug("Transport failed, starting up reconnect task", error); ServiceSupport.dispose(transport); transport = null; connectedCount--; if (primary == this) { primary = null; } reconnectTask.wakeup(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); if (transportListener != null) { transportListener.onException(new InterruptedIOException()); } } } }
@Override public void onException(IOException error) { try { synchronized (reconnectMutex) { if (transport == null || !transport.isConnected()) { return; } LOG.debug("Transport failed, starting up reconnect task", error); ServiceSupport.dispose(transport); transport = null; connectedCount--; if (primary == this) { primary = null; } reconnectTask.wakeup(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); if (transportListener != null) { transportListener.onException(new InterruptedIOException()); } } } }
@Override public void onException(IOException error) { try { synchronized (reconnectMutex) { if (transport == null || !transport.isConnected()) { return; } LOG.debug("Transport failed, starting up reconnect task", error); ServiceSupport.dispose(transport); transport = null; connectedCount--; if (primary == this) { primary = null; } reconnectTask.wakeup(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); if (transportListener != null) { transportListener.onException(new InterruptedIOException()); } } } }