/** * Constructor. * * @param maximumTimeBetweenPings * The maximum time allowed between pings before determining the * client has died and interrupting its sockets */ protected ClientHealthMonitorThread(int maximumTimeBetweenPings) { super(LogWriterImpl.createThreadGroup("ClientHealthMonitor Thread Group", getLogger()), "ClientHealthMonitor Thread"); setDaemon(true); // Set the client connection timeout this._maximumTimeBetweenPings = maximumTimeBetweenPings; if (getLogger().configEnabled()) { getLogger().config( LocalizedStrings.ClientHealthMonitor_CLIENTHEALTHMONITORTHREAD_MAXIMUM_ALLOWED_TIME_BETWEEN_PINGS_0, this._maximumTimeBetweenPings); } if (maximumTimeBetweenPings == 0) { if (getLogger().fineEnabled()) { getLogger().fine("zero ping interval detected", new Exception(LocalizedStrings.ClientHealthMonitor_STACK_TRACE_0.toLocalizedString())); } } }
ServerConnection serverConnection = (ServerConnection) it.next(); if (serverConnection.hasBeenTimedOutOnClient()) { if (getLogger().warningEnabled()) { getLogger().warning( LocalizedStrings.ClientHealtMonitor_0_IS_BEING_TERMINATED_BECAUSE_ITS_CLIENT_TIMEOUT_OF_1_HAS_EXPIRED, new Object[] {serverConnection, Integer.valueOf(serverConnection.getClientReadTimeout())});
try { Thread.sleep(CLIENT_MONITOR_INTERVAL); if (getLogger().finerEnabled()) { getLogger().finer( "Monitoring " + getClientHeartbeats().size() + " client(s)"); if (getLogger().finerEnabled()) { getLogger().finer( ClientHealthMonitor.this.toString() + " starting sweep at " + currentTime); if (getLogger().finerEnabled()) { getLogger() .finer( (currentTime - latestHeartbeat) if (getLogger().fineEnabled()) { getLogger().fine("Monitoring client with member id " + entry.getKey() + ". It has been " + (currentTime - latestHeartbeat) + " ms since the latest heartbeat. This client would have been terminated but at least one of its threads is processing a message."); if (getLogger().warningEnabled()) { getLogger().warning(LocalizedStrings.ClientHealthMonitor_MONITORING_CLIENT_WITH_MEMBER_ID_0_IT_HAD_BEEN_1_MS_SINCE_THE_LATEST_HEARTBEAT_MAX_INTERVAL_IS_2_TERMINATED_CLIENT, new Object[] {entry.getKey(), currentTime - latestHeartbeat, this._maximumTimeBetweenPings}); if (getLogger().finerEnabled()) { getLogger() .finer( "Monitoring client with member id "