Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.util.monitor
Class ExpiryMonitor

    java.lang.Object
      org.mule.util.monitor.ExpiryMonitor

All Implemented Interfaces:
  Runnable, Disposable

    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.

Field Summary
`protected static Log` | `logger` logger used by this class
`protected edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor` | `scheduler`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`ExpiryMonitor(String name)`
`ExpiryMonitor(String name, int monitorFrequency)`
`ExpiryMonitor(String name, int monitorFrequency, ClassLoader contextClassLoader)`
`ExpiryMonitor(String name, int monitorFrequency, edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor scheduler)`

Method Summary
`void` | `addExpirable(long value, edu.emory.mathcs.backport.java.util.concurrent.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.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected static final Log logger

  logger used by this class

### scheduler

    protected edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor scheduler

Constructor Detail

### ExpiryMonitor

    public ExpiryMonitor(String name)

### ExpiryMonitor

    public ExpiryMonitor(String name,
                         int monitorFrequency)

### ExpiryMonitor

    public ExpiryMonitor(String name,
                         int monitorFrequency,
                         ClassLoader contextClassLoader)

### ExpiryMonitor

    public ExpiryMonitor(String name,
                         int monitorFrequency,
                         edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor scheduler)

Method Detail

### init

    protected void init()

### addExpirable

    public void addExpirable(long value,
                             edu.emory.mathcs.backport.java.util.concurrent.TimeUnit timeUnit,
                             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:
    `value` - the expiry value
    `timeUnit` - The time unit of the Expiry value
    `expirable` - the objec that will expire

### 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 `Runnable`

### dispose

    public void dispose()

  Description copied from interface: `Disposable`
  A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

  Specified by:
    `dispose` in interface `Disposable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.