@CreoleResource(name="Conditional Pipeline", comment="A simple serial controller for conditionally run PRs.", helpURL="http://gate.ac.uk/userguide/sec:developer:cond") public class ConditionalSerialController extends SerialController implements ConditionalController
AnalyserRunningStrategy
objects as running
strategies and they only work with LanguageAnalyser
s so the PRs that
are not analysers will get a default "run always" strategy.AbstractController.InternalStatusListener, AbstractController.IntervalProgressListener
Modifier and Type | Field and Description |
---|---|
protected List<RunningStrategy> |
strategiesList
The list of running strategies for the member PRs.
|
log, prList, prof, prTimeMap, sListener, timeMap
benchmarkFeatures, benchmarkID, controllerCallbacksEnabled, interrupted
name
features
Constructor and Description |
---|
ConditionalSerialController() |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
ProcessingResource pr)
Set a PR at a specified location.
|
void |
add(ProcessingResource pr)
Add a PR to the end of the execution list.
|
void |
cleanup()
Cleans the internal data and prepares this object to be collected
|
Resource |
duplicate(Factory.DuplicationContext ctx)
Custom duplication method for conditional controllers to handle
duplicating the running strategies.
|
List<RunningStrategy> |
getRunningStrategies()
Gets the collection of running strategies for the contained PRs.
|
ProcessingResource |
remove(int index) |
boolean |
remove(ProcessingResource pr) |
protected void |
runComponent(int componentIndex)
Executes a
ProcessingResource . |
void |
setRunningStrategies(Collection<RunningStrategy> strategies)
Populates this controller with the appropiate running strategies from a
collection of running strategies
(optional operation).
|
void |
setRunningStrategy(int index,
AnalyserRunningStrategy strategy) |
checkParameters, datastoreClosed, datastoreCreated, datastoreOpened, executeImpl, getPRs, getPrTimeMap, resetPrTimeMap, resourceLoaded, resourceRenamed, resourceUnloaded, set, setPRs
addControllerListener, addProgressListener, addStatusListener, execute, fireProcessFinished, fireProgressChanged, fireResourceAdded, fireResourceRemoved, fireStatusChanged, getBenchmarkId, getControllerAwarePRs, getOffendingPocessingResources, init, interrupt, invokeControllerExecutionAborted, invokeControllerExecutionFinished, invokeControllerExecutionStarted, isInterrupted, reInit, removeControllerListener, removeProgressListener, removeStatusListener, setBenchmarkId, setControllerCallbacksEnabled
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
execute, getPRs, setPRs
getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
interrupt, isInterrupted
protected List<RunningStrategy> strategiesList
public List<RunningStrategy> getRunningStrategies()
ConditionalController
Controller
.getRunningStrategies
in interface ConditionalController
public void add(int index, ProcessingResource pr)
add
in class SerialController
index
- the position for the PRpr
- the PR to be set.public void add(ProcessingResource pr)
add
in class SerialController
pr
- the PR to be added.public ProcessingResource remove(int index)
remove
in class SerialController
public boolean remove(ProcessingResource pr)
remove
in class SerialController
public void setRunningStrategy(int index, AnalyserRunningStrategy strategy)
public void setRunningStrategies(Collection<RunningStrategy> strategies)
setRunningStrategies
in interface ConditionalController
UnsupportedOperationException
- if the setPRs method
is not supported by this controller.protected void runComponent(int componentIndex) throws ExecutionException
ProcessingResource
.runComponent
in class SerialController
ExecutionException
public void cleanup()
cleanup
in interface Resource
cleanup
in class SerialController
public Resource duplicate(Factory.DuplicationContext ctx) throws ResourceInstantiationException
duplicate
in interface CustomDuplication
duplicate
in class SerialController
ctx
- the current duplication context
.
If an implementation of this method needs to duplicate any
other resources as part of the custom duplication process
it should pass this context back to the two-argument form of
Factory.duplicate
rather than using the single-argument form.ResourceInstantiationException
Copyright © 2024 GATE. All rights reserved.