gate.creole
Class AbstractProcessingResource

java.lang.Object
  |
  +--gate.util.AbstractFeatureBearer
        |
        +--gate.creole.AbstractResource
              |
              +--gate.creole.AbstractProcessingResource
All Implemented Interfaces:
FeatureBearer, ProcessingResource, Resource, Runnable, Serializable
Direct Known Subclasses:
AbstractLanguageAnalyser, DefaultGazetteer, DefaultTokeniser, DumbTokeniser, Namematch, POSTagger, Transducer

public abstract class AbstractProcessingResource
extends AbstractResource
implements ProcessingResource

A convenience implementation of ProcessingResource with some default code.

See Also:
Serialized Form

Field Summary
protected  ExecutionException executionException
          Any exception caught during run() invocations are stored here.
 
Fields inherited from class gate.creole.AbstractResource
serialVersionUID
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Constructor Summary
AbstractProcessingResource()
           
 
Method Summary
 void check()
          Trigger any exception that was caught when run() was invoked.
 Resource init()
          Initialise this resource, and return it.
 void reInit()
          Reinitialises the processing resource.
 void run()
          Run the resource.
 
Methods inherited from class gate.creole.AbstractResource
getName, setName
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, getName, setFeatures, setName
 

Field Detail

executionException

protected ExecutionException executionException
Any exception caught during run() invocations are stored here.
Constructor Detail

AbstractProcessingResource

public AbstractProcessingResource()
Method Detail

init

public Resource init()
              throws ResourceInstantiationException
Initialise this resource, and return it.
Specified by:
init in interface Resource
Overrides:
init in class AbstractResource

run

public void run()
Run the resource. It doesn't make sense not to override this in subclasses so the default implementation signals an exception.
Specified by:
run in interface Runnable

reInit

public void reInit()
            throws ResourceInstantiationException
Reinitialises the processing resource. After calling this method the resource should be in the state it is after calling init. If the resource depends on external resources (such as rules files) then the resource will re-read those resources. If the data used to create the resource has changed since the resource has been created then the resource will change too after calling reInit(). The implementation in this class simply calls init(). This functionality must be overriden by derived classes as necessary.
Specified by:
reInit in interface ProcessingResource

check

public void check()
           throws ExecutionException
Trigger any exception that was caught when run() was invoked. If there is an exception stored it is cleared by this call.
Specified by:
check in interface ProcessingResource