@Override public synchronized void run() { if (cancelled || stopPingingAfterOne && !first) { return; } first = false; long now = System.currentTimeMillis(); final RemotingConnection connectionInUse = connection; if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) { if (!connectionInUse.checkDataReceived()) { // We use a different thread to send the fail // but the exception has to be created here to preserve the stack trace final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection()); cancelled = true; threadPool.execute(new Runnable() { // Must be executed on different thread @Override public void run() { connectionInUse.fail(me); } }); return; } else { lastCheck = now; } } send(); }
@Override public synchronized void run() { if (cancelled || stopPingingAfterOne && !first) { return; } first = false; long now = System.currentTimeMillis(); final RemotingConnection connectionInUse = connection; if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) { if (!connectionInUse.checkDataReceived()) { // We use a different thread to send the fail // but the exception has to be created here to preserve the stack trace final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection()); cancelled = true; threadPool.execute(new Runnable() { // Must be executed on different thread @Override public void run() { connectionInUse.fail(me); } }); return; } else { lastCheck = now; } } send(); }
@Override public synchronized void run() { if (cancelled || stopPingingAfterOne && !first) { return; } first = false; long now = System.currentTimeMillis(); final RemotingConnection connectionInUse = connection; if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) { if (!connectionInUse.checkDataReceived()) { // We use a different thread to send the fail // but the exception has to be created here to preserve the stack trace final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection()); cancelled = true; threadPool.execute(new Runnable() { // Must be executed on different thread @Override public void run() { connectionInUse.fail(me); } }); return; } else { lastCheck = now; } } send(); }
@Override public synchronized void run() { if (cancelled || stopPingingAfterOne && !first) { return; } first = false; long now = System.currentTimeMillis(); final RemotingConnection connectionInUse = connection; if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) { if (!connectionInUse.checkDataReceived()) { // We use a different thread to send the fail // but the exception has to be created here to preserve the stack trace final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection()); cancelled = true; threadPool.execute(new Runnable() { // Must be executed on different thread @Override public void run() { connectionInUse.fail(me); } }); return; } else { lastCheck = now; } } send(); }
@Override public synchronized void run() { if (cancelled || stopPingingAfterOne && !first) { return; } first = false; long now = System.currentTimeMillis(); final RemotingConnection connectionInUse = connection; if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) { if (!connectionInUse.checkDataReceived()) { // We use a different thread to send the fail // but the exception has to be created here to preserve the stack trace final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection()); cancelled = true; threadPool.execute(new Runnable() { // Must be executed on different thread @Override public void run() { connectionInUse.fail(me); } }); return; } else { lastCheck = now; } } send(); }
@Override public synchronized void run() { if (cancelled || stopPingingAfterOne && !first) { return; } first = false; long now = System.currentTimeMillis(); final RemotingConnection connectionInUse = connection; if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) { if (!connectionInUse.checkDataReceived()) { // We use a different thread to send the fail // but the exception has to be created here to preserve the stack trace final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection()); cancelled = true; threadPool.execute(new Runnable() { // Must be executed on different thread @Override public void run() { connectionInUse.fail(me); } }); return; } else { lastCheck = now; } } send(); }
@Override public synchronized void run() { if (cancelled || stopPingingAfterOne && !first) { return; } first = false; long now = System.currentTimeMillis(); final RemotingConnection connectionInUse = connection; if (connectionInUse != null && clientFailureCheckPeriod != -1 && connectionTTL != -1 && now >= lastCheck + connectionTTL) { if (!connectionInUse.checkDataReceived()) { // We use a different thread to send the fail // but the exception has to be created here to preserve the stack trace final ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.connectionTimedOut(connection.getTransportConnection()); cancelled = true; threadPool.execute(new Runnable() { // Must be executed on different thread @Override public void run() { connectionInUse.fail(me); } }); return; } else { lastCheck = now; } } send(); }
if (!conn.checkDataReceived()) { if (now >= entry.lastCheck + entry.ttl) { toRemove.add(new Pair<>(conn.getID(), entry.ttl));