public class ConnectionValidator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
ConnectionValidator.ListenerChecker |
Modifier and Type | Field and Description |
---|---|
private ConnectionValidator.ListenerChecker |
checker |
private java.util.concurrent.atomic.AtomicLong |
currentScheduledFrequency |
private static java.util.concurrent.ScheduledExecutorService |
fixedSizedScheduler |
private static int |
MINIMUM_CHECK_DELAY_MILLIS |
private java.util.concurrent.ConcurrentLinkedQueue<Listener> |
queue |
Constructor and Description |
---|
ConnectionValidator() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(Listener listener,
long listenerCheckMillis)
Add listener to validation list.
|
void |
removeListener(Listener listener)
Remove listener to validation list.
|
private static final java.util.concurrent.ScheduledExecutorService fixedSizedScheduler
private static final int MINIMUM_CHECK_DELAY_MILLIS
private final java.util.concurrent.ConcurrentLinkedQueue<Listener> queue
private final java.util.concurrent.atomic.AtomicLong currentScheduledFrequency
private final ConnectionValidator.ListenerChecker checker
public void addListener(Listener listener, long listenerCheckMillis)
listener
- listenerlistenerCheckMillis
- schedule timepublic void removeListener(Listener listener)
listener
- listener