com.phoenixst.collections

Class RunnableReaper

public class RunnableReaper extends Object implements Runnable, Reaper

A Runnable which reaps Reapables.

Since: 1.0

Version: $Revision: 1.1 $

Author: Ray A. Conner

Field Summary
static ReaperDEFAULT_INSTANCE
A single default Reaper which to be used when a structure doesn't mind sharing the reaping thread with other things.
Constructor Summary
RunnableReaper()
Creates a new RunnableReaper which sleeps for 0.1 seconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables.
RunnableReaper(long sleepTime)
Creates a new RunnableReaper which sleeps for the specified number of milliseconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables.
Method Summary
ReferencecreateReference(Reapable reapable, Object referent)
static ReapergetInstance(String name)
Creates a new RunnableReaper which sleeps for 0.1 seconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables.
static ReapergetInstance(String name, long sleepTime, int threadPriority)
Creates a new RunnableReaper which sleeps for the specified number of milliseconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables.
voidrun()

Field Detail

DEFAULT_INSTANCE

public static final Reaper DEFAULT_INSTANCE
A single default Reaper which to be used when a structure doesn't mind sharing the reaping thread with other things.

Constructor Detail

RunnableReaper

public RunnableReaper()
Creates a new RunnableReaper which sleeps for 0.1 seconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables. It is up to the user to create a thread to run this Reaper; alternatively, one of the static factory methods can be used.

RunnableReaper

public RunnableReaper(long sleepTime)
Creates a new RunnableReaper which sleeps for the specified number of milliseconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables. It is up to the user to create a thread to run this Reaper; alternatively, one of the static factory methods can be used.

Method Detail

createReference

public Reference createReference(Reapable reapable, Object referent)

getInstance

public static Reaper getInstance(String name)
Creates a new RunnableReaper which sleeps for 0.1 seconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables. A new thread of minimum priority to run the RunnableReaper is also created and started by this method.

getInstance

public static Reaper getInstance(String name, long sleepTime, int threadPriority)
Creates a new RunnableReaper which sleeps for the specified number of milliseconds after emptying its internal ReferenceQueue of waiting References and notifying the corresponding Reapables. A new thread of the specified priority to run the RunnableReaper is also created and started by this method.

run

public void run()
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.