Class ThreadReaper
- java.lang.Object
-
- com.levigo.jadice.server.core.util.housekeeping.AbstractReaper<Thread>
-
- com.levigo.jadice.server.core.util.housekeeping.ThreadReaper
-
- All Implemented Interfaces:
SelfRegistering
,Runnable
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.jmx.export.naming.SelfNaming
@ManagedResource("Reaper for Threads") public class ThreadReaper extends AbstractReaper<Thread>
-
-
Constructor Summary
Constructors Constructor Description ThreadReaper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getInterruptAttempts()
protected org.jadice.util.log.Logger
getLogger()
protected String
getName()
protected void
reapAllObjectsOnShutdown()
protected boolean
reapObject(Thread thread, int attempt)
void
setInterruptAttempts(int interruptAttempts)
-
Methods inherited from class com.levigo.jadice.server.core.util.housekeeping.AbstractReaper
afterPropertiesSet, destroy, enqueue, enqueue, getEnqueuedObjectCount, getEnqueuedObjects, getObjectName, getReapedObjectCount, getTimeInterval, run, setTimeInterval
-
-
-
-
Method Detail
-
reapObject
protected boolean reapObject(Thread thread, int attempt)
- Specified by:
reapObject
in classAbstractReaper<Thread>
-
reapAllObjectsOnShutdown
protected void reapAllObjectsOnShutdown()
- Specified by:
reapAllObjectsOnShutdown
in classAbstractReaper<Thread>
-
setInterruptAttempts
@ManagedAttribute(defaultValue="15", description="Number of attempts that will use Thread#interrupt()") public void setInterruptAttempts(int interruptAttempts)
- Parameters:
interruptAttempts
- the interruptAttempts to set
-
getInterruptAttempts
@ManagedAttribute(defaultValue="15", description="Number of attempts that will use Thread#interrupt()") public int getInterruptAttempts()
- Returns:
- the interruptAttempts
-
getName
protected String getName()
- Specified by:
getName
in classAbstractReaper<Thread>
-
getLogger
protected org.jadice.util.log.Logger getLogger()
- Specified by:
getLogger
in classAbstractReaper<Thread>
-
-