info.magnolia.cms.util
Class DelayedExecutor

java.lang.Object
  extended by info.magnolia.cms.util.DelayedExecutor

public class DelayedExecutor
extends Object

There are many places where we like to delay an execution (in case of a serie of fired events). But we want to ensure the the task is executed after a certain maximum delay.

Version:
$Id$
Author:
philipp

Nested Class Summary
protected  class DelayedExecutor.RunnableWrapper
          Resets the timestamp after starting the execution.
 
Field Summary
protected  Runnable command
           
protected  long delay
           
protected  long maxDelay
           
protected  Object taskId
          The current taskId.
protected  EDU.oswego.cs.dl.util.concurrent.ClockDaemon timer
           
protected  long timestamp
           
 
Constructor Summary
DelayedExecutor(Runnable command, long delay, long maxDelay)
           
 
Method Summary
 void trigger()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timer

protected EDU.oswego.cs.dl.util.concurrent.ClockDaemon timer

delay

protected long delay

maxDelay

protected long maxDelay

timestamp

protected long timestamp

command

protected Runnable command

taskId

protected Object taskId
The current taskId.

Constructor Detail

DelayedExecutor

public DelayedExecutor(Runnable command,
                       long delay,
                       long maxDelay)
Parameters:
delay - milliseconds
maxDelay - milliseconds
Method Detail

trigger

public void trigger()


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.