com.moesol.bindings
Class NativeLeakDetectionThread

java.lang.Object
  extended by java.lang.Thread
      extended by com.moesol.bindings.NativeLeakDetectionThread
All Implemented Interfaces:
Runnable

public class NativeLeakDetectionThread
extends Thread

This singleton thread checks for native resource leaks. Use getQ to get a RefenceQueue suitable for the PhantomReference contructor. Derive a class from PhantomRefernce that implements the NativeResourceChecker interface. When the referent become phantomly reachable NativeResourceChecker.check is called.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Method Summary
 ReferenceQueue getQ()
           
static NativeLeakDetectionThread instance()
           
 void run()
          Thread entry point
 void stopRunning()
          Stop the leak detection thread
 
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
 

Method Detail

instance

public static NativeLeakDetectionThread instance()
Returns:
the leak detection thread.

run

public void run()
Thread entry point

Specified by:
run in interface Runnable
Overrides:
run in class Thread

stopRunning

public void stopRunning()
Stop the leak detection thread


getQ

public ReferenceQueue getQ()
Returns:
get the reference Q


Copyright © 2004 Moebius Solutions, Inc. All Rights Reserved.