public class ExpiryMonitor extends Object implements Runnable, 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.Modifier and Type | Field and Description |
---|---|
protected static Log |
logger
logger used by this class
|
protected ScheduledThreadPoolExecutor |
scheduler |
PHASE_NAME
Constructor and Description |
---|
ExpiryMonitor(MuleContext muleContext,
boolean onPollingNodeOnly) |
ExpiryMonitor(String name,
int monitorFrequency,
ClassLoader contextClassLoader,
MuleContext muleContext,
boolean onPollingNodeOnly) |
ExpiryMonitor(String name,
int monitorFrequency,
MuleContext muleContext,
boolean onPollingNodeOnly) |
ExpiryMonitor(String name,
int monitorFrequency,
ScheduledThreadPoolExecutor scheduler,
MuleContext muleContext,
boolean onPollingNodeOnly) |
ExpiryMonitor(String name,
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()
A lifecycle method where implementor should free up any resources.
|
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.
|
protected static final Log logger
protected ScheduledThreadPoolExecutor scheduler
public ExpiryMonitor(MuleContext muleContext, boolean onPollingNodeOnly)
public ExpiryMonitor(String name, MuleContext muleContext, boolean onPollingNodeOnly)
public ExpiryMonitor(String name, int monitorFrequency, MuleContext muleContext, boolean onPollingNodeOnly)
public ExpiryMonitor(String name, int monitorFrequency, ClassLoader contextClassLoader, MuleContext muleContext, boolean onPollingNodeOnly)
public ExpiryMonitor(String name, int monitorFrequency, ScheduledThreadPoolExecutor scheduler, 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()
Disposable
dispose
in interface Disposable
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.