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 |
name
features
ANNOTATION_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
ProgressListener s of a progress
finished. |
protected void |
fireProgressChanged(int e)
Notifies all the
ProgressListener s of a progress change
event. |
protected void |
fireStatusChanged(String e)
Notifies all the
StatusListener s 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, toString
getFeatures, setFeatures
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getParameterValue, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
public Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractResource
ResourceInstantiationException
public void execute() throws ExecutionException
execute
in interface Executable
ExecutionException
public void reInit() throws ResourceInstantiationException
init()
. This
functionality must be overriden by derived classes as necessary.reInit
in interface ProcessingResource
ResourceInstantiationException
public void cleanup()
cleanup
in interface Resource
cleanup
in class AbstractResource
public boolean isInterrupted()
execute()
method was called.isInterrupted
in interface Executable
public void interrupt()
interrupt
in interface Executable
public 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)
StatusListener
s 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)
ProgressListener
s of a progress change
event.e
- the new value of execution completionprotected void fireProcessFinished()
ProgressListener
s of a progress
finished.public static FeatureMap getRuntimeParameterValues(Resource res) throws ResourceInstantiationException
ResourceInstantiationException
public FeatureMap getRuntimeParameterValues() throws ResourceInstantiationException
ResourceInstantiationException
Copyright © 2024 GATE. All rights reserved.