Package org.cip4.jdflib.util.thread
Class RegularJanitor
java.lang.Object
org.cip4.jdflib.util.thread.RegularJanitor
asynchronous janitor class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSweeper(Sweeper sweeper, boolean singleClass) add a new sweeperstatic voidstatic RegularJanitorget the singleton janitorbooleanhasSweeper(Object sweeper) intvoidsetInterval(int interval) set the interval between sweeps in secondsvoidstartSweep(int firstInterval) toString()
-
Constructor Details
-
RegularJanitor
protected RegularJanitor()
-
-
Method Details
-
setInterval
public void setInterval(int interval) set the interval between sweeps in seconds- Parameters:
interval-
-
toString
-
numSweepers
public int numSweepers()- Returns:
-
addSweeper
add a new sweeper- Parameters:
sweeper-singleClass- if true, make sure we only have one of sweeper of this type running at any given time
-
hasSweeper
- Parameters:
sweeper-- Returns:
-
startSweep
public void startSweep(int firstInterval) - Parameters:
firstInterval- the time in seconds to wait prior to the first sweep, if 0 then don't wait if<0 then use interval
-
feierabend
public static void feierabend() -
getJanitor
get the singleton janitor- Returns:
-