@Override public synchronized void start(int svc) throws ChannelException { super.start(svc); running = true; if ( thread == null && useThread) { thread = new PingThread(); thread.setDaemon(true); String channelName = ""; if (getChannel().getName() != null) channelName = "[" + getChannel().getName() + "]"; thread.setName("TcpPingInterceptor.PingThread" + channelName +"-"+cnt.addAndGet(1)); thread.start(); } //acquire the interceptors to invoke on send ping events ChannelInterceptor next = getNext(); while ( next != null ) { if ( next instanceof TcpFailureDetector ) failureDetector = new WeakReference<>((TcpFailureDetector)next); if ( next instanceof StaticMembershipInterceptor ) staticMembers = new WeakReference<>((StaticMembershipInterceptor)next); next = next.getNext(); } }
@Override public synchronized void start(int svc) throws ChannelException { super.start(svc); running = true; if ( thread == null && useThread) { thread = new PingThread(); thread.setDaemon(true); thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1)); thread.start(); } //acquire the interceptors to invoke on send ping events ChannelInterceptor next = getNext(); while ( next != null ) { if ( next instanceof TcpFailureDetector ) failureDetector = new WeakReference<TcpFailureDetector>((TcpFailureDetector)next); if ( next instanceof StaticMembershipInterceptor ) staticMembers = new WeakReference<StaticMembershipInterceptor>((StaticMembershipInterceptor)next); next = next.getNext(); } }
public synchronized void start(int svc) throws ChannelException { super.start(svc); running = true; if ( thread == null ) { thread = new PingThread(); thread.setDaemon(true); thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1)); thread.start(); } //acquire the interceptors to invoke on send ping events ChannelInterceptor next = getNext(); while ( next != null ) { if ( next instanceof TcpFailureDetector ) failureDetector = new WeakReference<TcpFailureDetector>((TcpFailureDetector)next); if ( next instanceof StaticMembershipInterceptor ) staticMembers = new WeakReference<StaticMembershipInterceptor>((StaticMembershipInterceptor)next); next = next.getNext(); } }
@Override public synchronized void start(int svc) throws ChannelException { super.start(svc); running = true; if ( thread == null && useThread) { thread = new PingThread(); thread.setDaemon(true); thread.setName("TcpPingInterceptor.PingThread-"+cnt.addAndGet(1)); thread.start(); } //acquire the interceptors to invoke on send ping events ChannelInterceptor next = getNext(); while ( next != null ) { if ( next instanceof TcpFailureDetector ) failureDetector = new WeakReference<>((TcpFailureDetector)next); if ( next instanceof StaticMembershipInterceptor ) staticMembers = new WeakReference<>((StaticMembershipInterceptor)next); next = next.getNext(); } }
@Override public void run() { while (running) { try { sleep(interval); sendPing(); }catch ( InterruptedException ix ) { // Ignore. Probably triggered by a call to stop(). // In the highly unlikely event it was a different trigger, // simply ignore it and continue. }catch ( Exception x ) { log.warn("Unable to send ping from TCP ping thread.",x); } } } }
@Override public void run() { while (running) { try { sleep(interval); sendPing(); }catch ( InterruptedException ix ) { // Ignore. Probably triggered by a call to stop(). // In the highly unlikely event it was a different trigger, // simply ignore it and continue. }catch ( Exception x ) { log.warn(sm.getString("tcpPingInterceptor.pingFailed.pingThread"),x); } } } }
@Override public void run() { while (running) { try { sleep(interval); sendPing(); }catch ( InterruptedException ix ) { interrupted(); }catch ( Exception x ) { log.warn("Unable to send ping from TCP ping thread.",x); } } } }
public void run() { while (running) { try { sleep(interval); sendPing(); }catch ( InterruptedException ix ) { interrupted(); }catch ( Exception x ) { log.warn("Unable to send ping from TCP ping thread.",x); } } } }
public void stop(int svc) throws ChannelException { running = false; if ( thread != null ) thread.interrupt(); thread = null; super.stop(svc); }
@Override public void stop(int svc) throws ChannelException { running = false; if ( thread != null ) { thread.interrupt(); thread = null; } super.stop(svc); }
@Override public synchronized void stop(int svc) throws ChannelException { running = false; if (thread != null) { thread.interrupt(); thread = null; } super.stop(svc); }
@Override public void stop(int svc) throws ChannelException { running = false; if ( thread != null ) { thread.interrupt(); thread = null; } super.stop(svc); }