|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ControllerAwarePR
This interface should be implemented by processing resources that need to know when any containing controller starts and ends its execution, for example to initialise internal data structures or to do some aggregate processing of data gathered from a whole corpus.
If a controller contains several PRs that implement this interface,
the order in which their controllerExecutionStarted (Finished
or Aborted) methods are called is not specified. In
particular, the "ended" methods may be called in a different order
from the "started" ones. Also, if one PR throws an exception from its
controllerExecutionFinished method, the other finished
methods may not be called at all for this run. PRs should be robust
to this possibility.
The controller should call this PRs started and finished (or aborted) methods at most once per run, even if the controller allows the same PR to be added multiple times.
| Method Summary | |
|---|---|
void |
controllerExecutionAborted(Controller c,
Throwable t)
Called by a controller containing this PR when the controller's execution has been aborted by an exception thrown by one of the contained PR's execute methods, or by the controller
itself. |
void |
controllerExecutionFinished(Controller c)
Called by a controller containing this PR when the controller's execution has completed successfully. |
void |
controllerExecutionStarted(Controller c)
Called by a controller containing this PR when the controller begins executing. |
| Methods inherited from interface gate.ProcessingResource |
|---|
reInit |
| Methods inherited from interface gate.Resource |
|---|
cleanup, getParameterValue, init, setParameterValue, setParameterValues |
| Methods inherited from interface gate.util.FeatureBearer |
|---|
getFeatures, setFeatures |
| Methods inherited from interface gate.util.NameBearer |
|---|
getName, setName |
| Methods inherited from interface gate.Executable |
|---|
execute, interrupt, isInterrupted |
| Method Detail |
|---|
void controllerExecutionStarted(Controller c)
throws ExecutionException
executed on this run.
c - the Controller that is executing.
ExecutionException - if an error occurs that requires the
controller to abort its execution.
void controllerExecutionFinished(Controller c)
throws ExecutionException
execute method of any of this controller's PRs in
this run.
c - the Controller that is executing.
ExecutionException - if an error occurs that requires the
controller to abort its execution.
void controllerExecutionAborted(Controller c,
Throwable t)
throws ExecutionException
execute methods, or by the controller
itself. When this method is called, it is guaranteed that there
will be no more calls to the execute method of any
of this controller's PRs in this run.
c - the Controller that is executing.t - the Throwable that caused the controller to
abort. This will be either an ExecutionException,
a RuntimeException or an Error.
ExecutionException - if an error occurs in this method that
requires the controller to abort its execution. This
method should not rethrow t, as the
controller will do this after informing any other
ControllerAware PRs it contains.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||