public final class MemorySweeper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
MemorySweeper.Sweeper
Do the cleaning in its own thread
|
Modifier and Type | Field and Description |
---|---|
private static ThreadedSimpleTask<java.lang.Integer> |
EXIT_ACTION
Exiting action
|
private static boolean |
launched
Indicates if memory sweeper already launched
|
private static java.util.concurrent.locks.ReentrantLock |
REENTRANT_LOCK
For synchronized the launch status
|
private static ThreadedVerySimpleTask |
STOP_ACTION
Stop action
|
private static int |
threadID
Thread link ID
|
Modifier | Constructor and Description |
---|---|
private |
MemorySweeper()
To avoid someone instantiate it
|
Modifier and Type | Method and Description |
---|---|
static void |
automaticExitIn(int status,
long millsecond)
Program an automatic exit
|
static void |
automaticStopIn(long millsecond)
Program an automatic stop
|
static void |
exit(int status)
Exit an application
|
static void |
launch()
Launch, if need, the sweeper
|
(package private) static void |
realExit(int status)
Exit for real
|
static void |
stop()
Stop sweeping, can be restart with
launch() |
private static final ThreadedSimpleTask<java.lang.Integer> EXIT_ACTION
private static boolean launched
private static final java.util.concurrent.locks.ReentrantLock REENTRANT_LOCK
private static final ThreadedVerySimpleTask STOP_ACTION
private static int threadID
static void realExit(int status)
status
- Exit statuspublic static void automaticExitIn(int status, long millsecond)
status
- Exit statusmillsecond
- Time before exit in millisecondpublic static void automaticStopIn(long millsecond)
millsecond
- Time before stop in millisecondpublic static void exit(int status)
status
- Status to give, usually 0public static void launch()
public static void stop()
launch()