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
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. |
AbstractProcessingResource
public AbstractProcessingResource()
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