org.ceryle.xnode.classifier
Class XNodeClassifier

java.lang.Object
  extended by java.lang.Thread
      extended by org.ceryle.xnode.classifier.XNodeClassifier
All Implemented Interfaces:
Runnable

public class XNodeClassifier
extends Thread

A utility class devoted to adding classification information to an XNode. This extends Thread so that it can be interrupted externally.

This writes directly to the supplied MessageWriter since using the MessageHandler would signal activity and halt the process. Only errors are flagged, which will stop the process.

Author:
Murray Altheim

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
 
Constructor Summary
XNodeClassifier(WeakReference classifier, XNodeID xid, MessageWriter messagewriter)
          Constructor provided with the XNodeID of the XNode to process.
 
Method Summary
 void interrupt()
          Halts the classification process, performing any cleanup prior to dying.
 void run()
          Classifies the XNode whose XNodeID was provided during construction.
 
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, 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
 

Constructor Detail

XNodeClassifier

public XNodeClassifier(WeakReference classifier,
                       XNodeID xid,
                       MessageWriter messagewriter)
Constructor provided with the XNodeID of the XNode to process.

Parameters:
classifier - an optional WeakReference to the parent BackgroundClassifier.
xid - the XNodeID of the XNode to process.
messagewriter - the MessageWriter to receive messages and warnings.
Method Detail

interrupt

public void interrupt()
Halts the classification process, performing any cleanup prior to dying.

Overrides:
interrupt in class Thread
Throws:
SecurityException - if the current thread cannot modify this thread.

run

public void run()
Classifies the XNode whose XNodeID was provided during construction.

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


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.