|
GATE Version 3.1-2270 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgate.util.AbstractFeatureBearer
gate.creole.AbstractResource
gate.creole.AbstractController
public abstract class AbstractController
| Nested Class Summary | |
|---|---|
protected class |
AbstractController.InternalStatusListener
A simple status listener used to forward the events upstream. |
protected class |
AbstractController.IntervalProgressListener
A progress listener used to convert a 0..100 interval into a smaller one |
| Field Summary | |
|---|---|
protected boolean |
interrupted
|
protected String |
name
|
| Fields inherited from class gate.util.AbstractFeatureBearer |
|---|
features |
| Constructor Summary | |
|---|---|
AbstractController()
|
|
| Method Summary | |
|---|---|
void |
addControllerListener(ControllerListener l)
|
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()
Clears the internal data of the resource, when it gets released |
void |
execute()
Starts the execution of this executable |
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 |
fireResourceAdded(ControllerEvent e)
|
protected void |
fireResourceRemoved(ControllerEvent e)
|
protected void |
fireStatusChanged(String e)
Notifies all the StatusListeners of a change of status. |
String |
getName()
Returns the name of this resource |
List |
getOffendingPocessingResources()
Checks whether all the contained PRs have all the required runtime parameters set. |
Resource |
init()
Initialise this resource, and return it. |
void |
interrupt()
Notifies all the PRs in this controller that they should stop their execution as soon as possible. |
boolean |
isInterrupted()
Returns true if this executable has been interrupted via the Executable.interrupt() method since the last time its Executable.execute() method
was called |
void |
removeControllerListener(ControllerListener l)
|
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 |
void |
setName(String name)
Sets the name of this resource |
void |
setPRs(Collection PRs)
Populates this controller from a collection of ProcessingResources
(optional operation). |
| Methods inherited from class gate.creole.AbstractResource |
|---|
checkParameterValues, getBeanInfo, getParameterValue, getParameterValue, removeResourceListeners, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners |
| Methods inherited from class gate.util.AbstractFeatureBearer |
|---|
getFeatures, setFeatures |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gate.Controller |
|---|
getPRs |
| Methods inherited from interface gate.Resource |
|---|
getParameterValue, setParameterValue, setParameterValues |
| Methods inherited from interface gate.util.FeatureBearer |
|---|
getFeatures, setFeatures |
| Field Detail |
|---|
protected String name
protected boolean interrupted
| Constructor Detail |
|---|
public AbstractController()
| Method Detail |
|---|
public void execute()
throws ExecutionException
execute in interface ExecutableExecutionException
public Resource init()
throws ResourceInstantiationException
init in interface Resourceinit in class AbstractResourceResourceInstantiationExceptionpublic void cleanup()
cleanup in interface Resourcecleanup in class AbstractResourcepublic void setPRs(Collection PRs)
ProcessingResources
(optional operation).
Controllers that are serializable must implement this method needed by GATE
to restore their contents.
setPRs in interface ControllerUnsupportedOperationException - if the setPRs method
is not supported by this controller.public void interrupt()
interrupt in interface Executablepublic boolean isInterrupted()
ExecutableExecutable.interrupt() method since the last time its Executable.execute() method
was called
isInterrupted in interface Executablepublic void removeStatusListener(StatusListener l)
StatusListener from the list of listeners for
this processing resource
public void addStatusListener(StatusListener l)
StatusListener to the list of listeners for
this processing resource
protected 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 List getOffendingPocessingResources()
throws ResourceInstantiationException
List of ProcessingResources that have required
parameters with null values if they exist null otherwise.
{@link - ResourceInstantiationException} if problems occur while
inspecting the parameters for one of the resources. These will normally be
introspection problems and are usually caused by the lack of a parameter
or of the read accessor for a parameter.
ResourceInstantiationExceptionpublic void setName(String name)
setName in interface NameBearersetName in class AbstractResourcepublic String getName()
getName in interface NameBearergetName in class AbstractResourcepublic void removeControllerListener(ControllerListener l)
public void addControllerListener(ControllerListener l)
protected void fireResourceAdded(ControllerEvent e)
protected void fireResourceRemoved(ControllerEvent e)
|
GATE Version 3.1-2270 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||