org.cip4.jdflib.util.thread
Class TimeSweeper

java.lang.Object
  extended by org.cip4.jdflib.util.thread.TimeSweeper
All Implemented Interfaces:
Sweeper

public abstract class TimeSweeper
extends Object
implements Sweeper

class that sweeps at a regular interval - useful in case multiple sweepers with differing timing requirements are run

Author:
rainer prosi

Field Summary
protected  org.apache.commons.logging.Log log
           
protected  long t0
           
 
Constructor Summary
protected TimeSweeper(int interval)
           
 
Method Summary
 boolean needSweep()
          if true we want to sweep
protected  void setInterval(int interval)
           
 boolean sweep()
          default is nop
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log

t0

protected long t0
Constructor Detail

TimeSweeper

protected TimeSweeper(int interval)
Parameters:
interval - the time interval in seconds
Method Detail

setInterval

protected void setInterval(int interval)

needSweep

public boolean needSweep()
if true we want to sweep

Specified by:
needSweep in interface Sweeper
Returns:
See Also:
Sweeper.needSweep()

sweep

public boolean sweep()
default is nop

Specified by:
sweep in interface Sweeper
Returns:
true if all went well
See Also:
Sweeper.sweep()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2013. All Rights Reserved.