org.geotools.util
Class WeakCollectionCleaner

java.lang.Object
  extended by java.lang.Thread
      extended by org.geotools.util.WeakCollectionCleaner
All Implemented Interfaces:
java.lang.Runnable

public final class WeakCollectionCleaner
extends java.lang.Thread

A thread invoking Reference.clear() on each enqueded reference. This is usefull only if Reference subclasses has overridden their clear() method in order to perform some cleaning. This thread is used by WeakHashSet and WeakValueHashMap, which remove their entry from the collection when Reference.clear() is invoked.

Since:
2.0
Version:
$Id: WeakCollectionCleaner.java 34812 2010-01-18 09:10:00Z aaime $
Author:
Martin Desruisseaux (IRD)

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static WeakCollectionCleaner DEFAULT
          The default thread.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 void exit()
          Stops the cleaner thread.
 java.lang.ref.ReferenceQueue<java.lang.Object> getReferenceQueue()
           
 void run()
          Loop to be run during the virtual machine lifetime.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final WeakCollectionCleaner DEFAULT
The default thread.

Method Detail

getReferenceQueue

public java.lang.ref.ReferenceQueue<java.lang.Object> getReferenceQueue()

run

public void run()
Loop to be run during the virtual machine lifetime.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

exit

public void exit()
Stops the cleaner thread. Calling this method is recommended in all long running applications with custom class loaders (e.g., web applications).



Copyright © 1996-2010 Geotools. All Rights Reserved.