Class 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 Detail

      • AbstractReaper

        public AbstractReaper()
    • Method Detail

      • run

        @ManagedOperation(description="Run reaping manually")
        public final void run()
        Specified by:
        run in interface Runnable
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • destroy

        public void destroy()
                     throws Exception
        Specified by:
        destroy in interface org.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 interface org.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