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 and Description |
---|
AbstractReaper() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
void |
enqueue(Collection<O> objectsToReap) |
void |
enqueue(O objectToReap) |
int |
getEnqueuedObjectCount() |
Collection<O> |
getEnqueuedObjects() |
protected abstract com.levigo.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) |
@ManagedOperation(description="Run reaping manually") public final void run()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
protected abstract boolean reapObject(O objectToReap, int attempt)
protected abstract void reapAllObjectsOnShutdown()
public void enqueue(Collection<O> objectsToReap)
public void enqueue(O objectToReap)
public Collection<O> getEnqueuedObjects()
@ManagedAttribute(description="Number of enqueued objects") public int getEnqueuedObjectCount()
@ManagedAttribute(description="Number of reaped objects") public long getReapedObjectCount()
protected abstract String getName()
protected abstract com.levigo.util.log.Logger getLogger()
public ObjectName getObjectName()
getObjectName
in interface org.springframework.jmx.export.naming.SelfNaming
public void setTimeInterval(int timeInterval)
timeInterval
- the timeInterval to set@ManagedAttribute(description="Time interval when the reaper runs (seconds)") public int getTimeInterval()
Copyright © 2017 levigo holding gmbh. All rights reserved.