public class ExpiryMonitor extends Object implements Runnable, org.mule.runtime.api.lifecycle.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.| Constructor and Description |
|---|
ExpiryMonitor(MuleContext muleContext,
boolean onPollingNodeOnly) |
ExpiryMonitor(String name,
long monitorFrequency,
MuleContext muleContext,
boolean onPollingNodeOnly) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExpirable(long value,
TimeUnit timeUnit,
Expirable expirable)
Adds an expirable object to monitor.
|
void |
dispose() |
protected void |
init() |
boolean |
isRegistered(Expirable expirable) |
void |
removeExpirable(Expirable expirable) |
void |
resetExpirable(Expirable expirable) |
void |
run()
The action to be performed by this timer task.
|
String |
toString() |
public ExpiryMonitor(MuleContext muleContext, boolean onPollingNodeOnly)
public ExpiryMonitor(String name, long monitorFrequency, MuleContext muleContext, boolean onPollingNodeOnly)
protected void init()
public void addExpirable(long value,
TimeUnit timeUnit,
Expirable expirable)
value - the expiry valuetimeUnit - The time unit of the Expiry valueexpirable - the objec that will expirepublic boolean isRegistered(Expirable expirable)
public void removeExpirable(Expirable expirable)
public void resetExpirable(Expirable expirable)
public void run()
public void dispose()
dispose in interface org.mule.runtime.api.lifecycle.DisposableCopyright © 2003–2017 MuleSoft, Inc.. All rights reserved.