org.ceryle.wiki.plugin.assertion
Class AssertionHarvester

java.lang.Object
  extended by java.lang.Thread
      extended by org.ceryle.wiki.plugin.assertion.AssertionHarvester
All Implemented Interfaces:
Runnable

public class AssertionHarvester
extends Thread

Extends Thread to harvest a Set of Assertions, building from them a TM4J TopicMap. This is meant to occur as one burst of activity (hence it being implemented as a Thread); subsequent maintenance is then handled by the parent WikiMapManager (a subclass of AssertionHandler).

Version:
$Id: AssertionHarvester.java,v 1.2 2007-06-15 12:10:13 altheim Exp $
Author:
Murray Altheim

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String PROPERTY_HARVEST_ENABLED
          The System property name for the property enabling the harvesting of assertions by the AssertionHarvester.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected AssertionHarvester(WikiMapManager manager, Collection assertions, ActionListener listener)
          Constructor provided the Set of Assertions to process, and an optional ActionListener to fire off an event upon completion.
 
Method Summary
 TopicMapBuilder getTopicMapBuilder()
          Returns the TopicMapBuilder, null if not available.
protected  TopicMapObject harvestAssertion(Assertion assertion)
          Harvests the Assertion, returning either its Association within the TopicMap, or in the case of property assignment Assertions, the subject Topic that contains the Occurrence.
 void run()
           
 
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

PROPERTY_HARVEST_ENABLED

public static final String PROPERTY_HARVEST_ENABLED
The System property name for the property enabling the harvesting of assertions by the AssertionHarvester. The value is "ceryle.assertionharvester.enabled".

See Also:
Constant Field Values
Constructor Detail

AssertionHarvester

protected AssertionHarvester(WikiMapManager manager,
                             Collection assertions,
                             ActionListener listener)
                      throws TopicMapException
Constructor provided the Set of Assertions to process, and an optional ActionListener to fire off an event upon completion. The Set of Assertions is immediately copied into an array.

Parameters:
manager - the WikiMapManager that requested a harvest
assertions - the collection of Assertions to harvest
listener - the optional listener that will receive an ActionEvent upon harvest completion
Throws:
TopicMapException - if any fatal error occurs during harvest
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

getTopicMapBuilder

public TopicMapBuilder getTopicMapBuilder()
                                   throws TopicMapException
Returns the TopicMapBuilder, null if not available. If the TopicMap is available, the builder is lazily-created.

Throws:
TopicMapException

harvestAssertion

protected TopicMapObject harvestAssertion(Assertion assertion)
Harvests the Assertion, returning either its Association within the TopicMap, or in the case of property assignment Assertions, the subject Topic that contains the Occurrence. Any Topics necessary to create the Association are automatically created.



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