public abstract class AbstractProcessingResource extends AbstractResource implements ProcessingResource, ANNIEConstants
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractProcessingResource.InternalStatusListener
A simple status listener used to forward the events upstream.
|
protected class |
AbstractProcessingResource.IntervalProgressListener
A progress listener used to convert a 0..100 interval into a smaller one
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
interrupted |
namefeaturesANNOTATION_COREF_FEATURE_NAME, DATE_ANNOTATION_TYPE, DATE_POSTED_ANNOTATION_TYPE, DEFAULT_FILE, DOCUMENT_COREF_FEATURE_NAME, JOB_ID_ANNOTATION_TYPE, LOCATION_ANNOTATION_TYPE, LOOKUP_ANNOTATION_TYPE, LOOKUP_CLASS_FEATURE_NAME, LOOKUP_INSTANCE_FEATURE_NAME, LOOKUP_LANGUAGE_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, PLUGIN_DIR, 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 and Description |
|---|
AbstractProcessingResource() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected void |
fireProcessFinished()
Notifies all the
ProgressListeners of a progress
finished. |
protected void |
fireProgressChanged(int e)
Notifies all the
ProgressListeners of a progress change
event. |
protected void |
fireStatusChanged(String e)
Notifies all the
StatusListeners of a change of status. |
FeatureMap |
getRuntimeParameterValues()
Get the current values for all this resource's registered
init-time parameters.
|
static FeatureMap |
getRuntimeParameterValues(Resource res)
Get the current values for all of a specified resource's
registered runtime parameters.
|
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 last 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 |
checkParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toStringgetFeatures, setFeaturesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameterValue, setParameterValue, setParameterValuesgetFeatures, setFeaturesgetName, setNamepublic Resource init() throws ResourceInstantiationException
init in interface Resourceinit in class AbstractResourceResourceInstantiationExceptionpublic void execute()
throws ExecutionException
execute in interface ExecutableExecutionExceptionpublic void reInit()
throws ResourceInstantiationException
init(). This
functionality must be overriden by derived classes as necessary.reInit in interface ProcessingResourceResourceInstantiationExceptionpublic void cleanup()
cleanup in interface Resourcecleanup in class AbstractResourcepublic boolean isInterrupted()
execute() method was called.isInterrupted in interface Executablepublic void interrupt()
interrupt in interface Executablepublic void removeStatusListener(StatusListener l)
StatusListener from the list of listeners for
this processing resourcepublic void addStatusListener(StatusListener l)
StatusListener to the list of listeners for
this processing resourceprotected void fireStatusChanged(String e)
StatusListeners of a change of status.e - the message describing the status changepublic void addProgressListener(ProgressListener l)
ProgressListener to the list of listeners for
this processing resource.public void removeProgressListener(ProgressListener l)
ProgressListener from the list of listeners
for this processing resource.protected void fireProgressChanged(int e)
ProgressListeners of a progress change
event.e - the new value of execution completionprotected void fireProcessFinished()
ProgressListeners of a progress
finished.public static FeatureMap getRuntimeParameterValues(Resource res) throws ResourceInstantiationException
ResourceInstantiationExceptionpublic FeatureMap getRuntimeParameterValues() throws ResourceInstantiationException
ResourceInstantiationExceptionCopyright © 2024 GATE. All rights reserved.