info.magnolia.cms.util
Class DelayedExecutor

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

public class DelayedExecutor
extends java.lang.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: DelayedExecutor.java 41137 2011-01-06 18:19:25Z gjoseph $
Author:
philipp

Nested Class Summary
protected  class DelayedExecutor.RunnableWrapper
          Resets the timestamp after starting the execution.
 
Field Summary
protected  java.lang.Runnable command
           
protected  long delay
           
protected  long maxDelay
           
protected  java.lang.Object taskId
          The current taskId.
protected  EDU.oswego.cs.dl.util.concurrent.ClockDaemon timer
           
protected  long timestamp
           
 
Constructor Summary
DelayedExecutor(java.lang.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 java.lang.Runnable command

taskId

protected java.lang.Object taskId
The current taskId.

Constructor Detail

DelayedExecutor

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

trigger

public void trigger()


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