net.sf.jbaobab.expirable
Class ReclaimableExpirer<E>

java.lang.Object
  extended by java.lang.Thread
      extended by net.sf.jbaobab.expirable.Expirer<E>
          extended by net.sf.jbaobab.expirable.ReclaimableExpirer<E>
All Implemented Interfaces:
Runnable

public class ReclaimableExpirer<E>
extends Expirer<E>

An Expirer that provides cancel and reclaim operation, intended to be used for more general purpose.

Author:
Oakyoon Cha

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.jbaobab.expirable.Expirer
Expirer.Expirable<E>
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class net.sf.jbaobab.expirable.Expirer
handler, queue, working
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ReclaimableExpirer()
           
ReclaimableExpirer(ExpirationHandler<E> handler)
           
 
Method Summary
 void cancel(E element)
           
protected  void expire(E element)
           
 Expirer.Expirable<E> reclaim(E element, long timeout)
           
 Expirer.Expirable<E> register(E element, long timeout)
           
 
Methods inherited from class net.sf.jbaobab.expirable.Expirer
getHandler, run, setHandler, shutdown, start
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReclaimableExpirer

public ReclaimableExpirer(ExpirationHandler<E> handler)

ReclaimableExpirer

public ReclaimableExpirer()
Method Detail

register

public Expirer.Expirable<E> register(E element,
                                     long timeout)
Overrides:
register in class Expirer<E>

cancel

public void cancel(E element)

reclaim

public Expirer.Expirable<E> reclaim(E element,
                                    long timeout)

expire

protected void expire(E element)
Overrides:
expire in class Expirer<E>