|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.util.AbstractFeatureBearer | +--gate.creole.AbstractResource | +--gate.creole.AbstractProcessingResource
A convenience implementation of ProcessingResource with some default code.
Inner Class Summary | |
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 |
Field Summary | |
protected boolean |
interrupted
|
private Vector |
progressListeners
The list of ProgressListener s registered with this
resource |
private Vector |
statusListeners
The list of StatusListener s registered with this
resource |
Fields inherited from class gate.creole.AbstractResource |
name, serialVersionUID |
Fields inherited from class gate.util.AbstractFeatureBearer |
features |
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. |
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. |
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 |
|
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 |
Field Detail |
private transient Vector statusListeners
StatusListener
s registered with this
resourceprivate transient Vector progressListeners
ProgressListener
s registered with this
resourceprotected boolean interrupted
Constructor Detail |
public AbstractProcessingResource()
Method Detail |
public Resource init() throws ResourceInstantiationException
init
in interface Resource
init
in class AbstractResource
public void execute() throws ExecutionException
execute
in interface Executable
public void reInit() throws ResourceInstantiationException
init()
. This
functionality must be overriden by derived classes as necessary.reInit
in interface ProcessingResource
public void cleanup()
cleanup
in interface Resource
cleanup
in class AbstractResource
public boolean isInterrupted()
execute()
method was called.isInterrupted
in interface ProcessingResource
public void interrupt()
interrupt
in interface ProcessingResource
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |