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

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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, getName, setFeatures, setName
 

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