public class ServiceStopper
extends java.lang.Thread
Modifier and Type | Class and Description |
---|---|
(package private) class |
ServiceStopper.Stopper |
Modifier and Type | Field and Description |
---|---|
static int |
PORT
Port for stopping the application.
|
(package private) static ServiceStopper |
singleton |
protected ServiceStopper.Stopper |
stopper
The queue that a single stop thread will stop
|
protected java.util.ArrayList<ServiceStopper.Stopper> |
stoppers
List of Stopable queues the singleton will stop on signal
|
Modifier | Constructor and Description |
---|---|
private |
ServiceStopper() |
private |
ServiceStopper(ServiceStopper.Stopper stopper) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_stop(Stopable stopable) |
protected boolean |
_stopAfter(Stopable stopAfter,
Stopable stopable) |
protected ServiceStopper.Stopper |
find(Stopable stopAfter) |
private static ServiceStopper |
get() |
static void |
main(java.lang.String[] arg)
Stop the service on the default port.
|
void |
run() |
static boolean |
stop(Stopable stopable)
Stop the stopable on exit.
|
static boolean |
stopAfter(Stopable stopAfter,
Stopable stopable)
Stop the stopable on exit.
|
protected void |
stopAll() |
protected void |
stopSingle() |
protected int |
timeToWait() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
static ServiceStopper singleton
public static int PORT
protected java.util.ArrayList<ServiceStopper.Stopper> stoppers
protected ServiceStopper.Stopper stopper
private ServiceStopper()
private ServiceStopper(ServiceStopper.Stopper stopper)
private static ServiceStopper get()
public static boolean stop(Stopable stopable)
public static boolean stopAfter(Stopable stopAfter, Stopable stopable)
protected boolean _stop(Stopable stopable)
protected ServiceStopper.Stopper find(Stopable stopAfter)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected void stopAll()
protected int timeToWait()
protected void stopSingle()
public static void main(java.lang.String[] arg)