Class AbstractReaper<O>
- java.lang.Object
-
- com.levigo.jadice.server.core.util.housekeeping.AbstractReaper<O>
-
- All Implemented Interfaces:
SelfRegistering
,Runnable
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.jmx.export.naming.SelfNaming
- Direct Known Subclasses:
ExternalProcessReaper
,TempFileReaper
,ThreadReaper
public abstract class AbstractReaper<O> extends Object implements Runnable, org.springframework.jmx.export.naming.SelfNaming, SelfRegistering, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
-
-
Constructor Summary
Constructors Constructor Description AbstractReaper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
destroy()
void
enqueue(Collection<O> objectsToReap)
void
enqueue(O objectToReap)
int
getEnqueuedObjectCount()
Collection<O>
getEnqueuedObjects()
protected abstract org.jadice.util.log.Logger
getLogger()
protected abstract String
getName()
ObjectName
getObjectName()
long
getReapedObjectCount()
int
getTimeInterval()
protected abstract void
reapAllObjectsOnShutdown()
protected abstract boolean
reapObject(O objectToReap, int attempt)
void
run()
void
setTimeInterval(int timeInterval)
-
-
-
Method Detail
-
run
@ManagedOperation(description="Run reaping manually") public final void run()
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
destroy
public void destroy() throws Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-
reapObject
protected abstract boolean reapObject(O objectToReap, int attempt)
-
reapAllObjectsOnShutdown
protected abstract void reapAllObjectsOnShutdown()
-
enqueue
public void enqueue(Collection<O> objectsToReap)
-
enqueue
public void enqueue(O objectToReap)
-
getEnqueuedObjects
public Collection<O> getEnqueuedObjects()
-
getEnqueuedObjectCount
@ManagedAttribute(description="Number of enqueued objects") public int getEnqueuedObjectCount()
-
getReapedObjectCount
@ManagedAttribute(description="Number of reaped objects") public long getReapedObjectCount()
-
getName
protected abstract String getName()
-
getLogger
protected abstract org.jadice.util.log.Logger getLogger()
-
getObjectName
public ObjectName getObjectName()
- Specified by:
getObjectName
in interfaceorg.springframework.jmx.export.naming.SelfNaming
-
setTimeInterval
public void setTimeInterval(int timeInterval)
- Parameters:
timeInterval
- the timeInterval to set
-
getTimeInterval
@ManagedAttribute(description="Time interval when the reaper runs (seconds)") public int getTimeInterval()
- Returns:
- the timeInterval
-
-