org.mule.util.monitor
Class ExpiryMonitor

java.lang.Object
  extended byjava.util.TimerTask
      extended byorg.mule.util.monitor.ExpiryMonitor
All Implemented Interfaces:
Disposable, java.lang.Runnable

public class ExpiryMonitor
extends java.util.TimerTask
implements Disposable

ExpiryMonitor can monitor objects beased on an expiry time and can invoke a callback method once the object time has expired. If the object does expire it is removed from this monitor

Version:
$Revision: 1.2 $
Author:
Ross Mason

Field Summary
protected static Log logger
          logger used by this class
 
Constructor Summary
ExpiryMonitor()
           
ExpiryMonitor(long monitorFrequency)
           
 
Method Summary
 void addExpirable(long milliseconds, Expirable expirable)
          Adds an expirable object to monitor.
 void dispose()
           
 boolean isRegistered(Expirable expirable)
           
 void removeExpirable(Expirable expirable)
           
 void resetExpirable(Expirable expirable)
           
 void run()
          The action to be performed by this timer task.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static transient Log logger
logger used by this class

Constructor Detail

ExpiryMonitor

public ExpiryMonitor()

ExpiryMonitor

public ExpiryMonitor(long monitorFrequency)
Method Detail

addExpirable

public void addExpirable(long milliseconds,
                         Expirable expirable)
Adds an expirable object to monitor. If the Object is already being monitored it will be reset and the millisecond timeout will be ignored

Parameters:
milliseconds -
expirable -

isRegistered

public boolean isRegistered(Expirable expirable)

removeExpirable

public void removeExpirable(Expirable expirable)

resetExpirable

public void resetExpirable(Expirable expirable)

run

public void run()
The action to be performed by this timer task.

Specified by:
run in interface java.lang.Runnable

dispose

public void dispose()
Specified by:
dispose in interface Disposable


Copyright © 2003-2005 SymphonySoft Limited. All Rights Reserved.