gate.creole
Class AbstractProcessingResource

java.lang.Object
  |
  +--gate.util.AbstractFeatureBearer
        |
        +--gate.creole.AbstractResource
              |
              +--gate.creole.AbstractProcessingResource
All Implemented Interfaces:
ANNIEConstants, Executable, FeatureBearer, NameBearer, ProcessingResource, Resource, Serializable
Direct Known Subclasses:
AbstractLanguageAnalyser, SearchPR

public abstract class AbstractProcessingResource
extends AbstractResource
implements ProcessingResource, ANNIEConstants

A convenience implementation of ProcessingResource with some default code.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gate.creole.ANNIEConstants
ANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DOCUMENT_COREF_FEATURE_NAME, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_MAJOR_TYPE_FEATURE_NAME, LOOKUP_MINOR_TYPE_FEATURE_NAME, LOOKUP_ONTOLOGY_FEATURE_NAME, MONEY_ANNOTATION_TYPE, ORGANIZATION_ANNOTATION_TYPE, PERSON_ANNOTATION_TYPE, PERSON_GENDER_FEATURE_NAME, PR_NAMES, SENTENCE_ANNOTATION_TYPE, SPACE_TOKEN_ANNOTATION_TYPE, TOKEN_ANNOTATION_TYPE, TOKEN_CATEGORY_FEATURE_NAME, TOKEN_KIND_FEATURE_NAME, TOKEN_LENGTH_FEATURE_NAME, TOKEN_ORTH_FEATURE_NAME, TOKEN_STRING_FEATURE_NAME
 
Constructor Summary
AbstractProcessingResource()
           
 
Method Summary
 void addProgressListener(ProgressListener l)
          Adds a ProgressListener to the list of listeners for this processing resource.
 void addStatusListener(StatusListener l)
          Adds a StatusListener to the list of listeners for this processing resource
 void cleanup()
          should clear all internal data of the resource.
 void execute()
          Run the resource.
 Resource init()
          Initialise this resource, and return it.
 void interrupt()
          Notifies this PR that it should stop its execution as soon as possible.
 boolean isInterrupted()
          Checks whether this PR has been interrupted since the lsat time its execute() method was called.
 void reInit()
          Reinitialises the processing resource.
 void removeProgressListener(ProgressListener l)
          Removes a ProgressListener from the list of listeners for this processing resource.
 void removeStatusListener(StatusListener l)
          Removes a StatusListener from the list of listeners for this processing resource
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
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.Resource
getParameterValue, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, 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
ResourceInstantiationException

execute

public void execute()
             throws ExecutionException
Run the resource. It doesn't make sense not to override this in subclasses so the default implementation signals an exception.

Specified by:
execute in interface Executable
ExecutionException

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
ResourceInstantiationException

cleanup

public void cleanup()
should clear all internal data of the resource. Does nothing now

Specified by:
cleanup in interface Resource
Overrides:
cleanup in class AbstractResource

isInterrupted

public boolean isInterrupted()
Checks whether this PR has been interrupted since the lsat time its execute() method was called.

Specified by:
isInterrupted in interface Executable

interrupt

public void interrupt()
Notifies this PR that it should stop its execution as soon as possible.

Specified by:
interrupt in interface Executable

removeStatusListener

public void removeStatusListener(StatusListener l)
Removes a StatusListener from the list of listeners for this processing resource


addStatusListener

public void addStatusListener(StatusListener l)
Adds a StatusListener to the list of listeners for this processing resource


addProgressListener

public void addProgressListener(ProgressListener l)
Adds a ProgressListener to the list of listeners for this processing resource.


removeProgressListener

public void removeProgressListener(ProgressListener l)
Removes a ProgressListener from the list of listeners for this processing resource.