@CreoleResource(name="Pipeline", comment="A simple serial controller for PR pipelines.", helpURL="http://gate.ac.uk/userguide/sec:developer:apps") public class SerialController extends AbstractController implements CreoleListener, CustomDuplication
AbstractController.InternalStatusListener, AbstractController.IntervalProgressListener| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
log |
protected List<ProcessingResource> |
prList
The list of contained PRs
|
protected Profiler |
prof
Profiler to track PR execute time
|
protected Map<String,Long> |
prTimeMap |
protected StatusListener |
sListener
A proxy for status events
|
protected Map<String,Long> |
timeMap |
benchmarkFeatures, benchmarkID, controllerCallbacksEnabled, interruptednamefeatures| Constructor and Description |
|---|
SerialController() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
ProcessingResource pr) |
void |
add(ProcessingResource pr) |
protected void |
checkParameters()
Verifies that all PRs have all their required rutime parameters set.
|
void |
cleanup()
Cleans the internal data and prepares this object to be collected
|
void |
datastoreClosed(CreoleEvent e)
Called when a
DataStore has been closed |
void |
datastoreCreated(CreoleEvent e)
Called when a
DataStore has been created |
void |
datastoreOpened(CreoleEvent e)
Called when a
DataStore has been opened |
Resource |
duplicate(Factory.DuplicationContext ctx)
Duplicate this controller.
|
protected void |
executeImpl()
Run the Processing Resources in sequence.
|
List<ProcessingResource> |
getPRs()
Returns all the
ProcessingResources contained by thisFeature
controller as an unmodifiable list. |
Map<String,Long> |
getPrTimeMap()
Returns the HashMap that lists the total time taken by each PR
|
ProcessingResource |
remove(int index) |
boolean |
remove(ProcessingResource pr) |
void |
resetPrTimeMap()
Resets the Time taken by various PRs
|
void |
resourceLoaded(CreoleEvent e)
Called when a new
Resource has been loaded into the system |
void |
resourceRenamed(Resource resource,
String oldName,
String newName)
Called when the creole register has renamed a resource.1
|
void |
resourceUnloaded(CreoleEvent e)
Called when a
Resource has been removed from the system |
protected void |
runComponent(int componentIndex)
Executes a
ProcessingResource. |
ProcessingResource |
set(int index,
ProcessingResource pr) |
void |
setPRs(Collection<? extends ProcessingResource> prs)
Populates this controller from a collection of
ProcessingResources
(optional operation). |
addControllerListener, addProgressListener, addStatusListener, execute, fireProcessFinished, fireProgressChanged, fireResourceAdded, fireResourceRemoved, fireStatusChanged, getBenchmarkId, getControllerAwarePRs, getOffendingPocessingResources, init, interrupt, invokeControllerExecutionAborted, invokeControllerExecutionFinished, invokeControllerExecutionStarted, isInterrupted, reInit, removeControllerListener, removeProgressListener, removeStatusListener, setBenchmarkId, setControllerCallbacksEnabledcheckParameterValues, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toStringgetFeatures, setFeaturesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParameterValue, setParameterValue, setParameterValuesprotected static final org.slf4j.Logger log
protected Profiler prof
protected List<ProcessingResource> prList
protected StatusListener sListener
public List<ProcessingResource> getPRs()
ProcessingResources contained by thisFeature
controller as an unmodifiable list.getPRs in interface Controllerpublic void setPRs(Collection<? extends ProcessingResource> prs)
ProcessingResources
(optional operation).
Controllers that are serializable must implement this method needed by GATE
to restore the contents of the controllers.setPRs in interface ControllersetPRs in class AbstractControllerUnsupportedOperationException - if the setPRs method is not supported by this
controller.public void add(int index,
ProcessingResource pr)
public void add(ProcessingResource pr)
public ProcessingResource remove(int index)
public boolean remove(ProcessingResource pr)
public ProcessingResource set(int index, ProcessingResource pr)
protected void checkParameters()
throws ExecutionException
ExecutionExceptionprotected void executeImpl()
throws ExecutionException
executeImpl in class AbstractControllerExecutionExceptionpublic void resetPrTimeMap()
public Map<String,Long> getPrTimeMap()
protected void runComponent(int componentIndex)
throws ExecutionException
ProcessingResource.ExecutionExceptionpublic void cleanup()
cleanup in interface Resourcecleanup in class AbstractControllerpublic Resource duplicate(Factory.DuplicationContext ctx) throws ResourceInstantiationException
duplicate in interface CustomDuplicationctx - 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.ResourceInstantiationExceptionpublic void resourceLoaded(CreoleEvent e)
CreoleListenerResource has been loaded into the systemresourceLoaded in interface CreoleListenerpublic void resourceUnloaded(CreoleEvent e)
CreoleListenerResource has been removed from the systemresourceUnloaded in interface CreoleListenerpublic void resourceRenamed(Resource resource, String oldName, String newName)
CreoleListenerresourceRenamed in interface CreoleListenerpublic void datastoreOpened(CreoleEvent e)
CreoleListenerDataStore has been openeddatastoreOpened in interface CreoleListenerpublic void datastoreCreated(CreoleEvent e)
CreoleListenerDataStore has been createddatastoreCreated in interface CreoleListenerpublic void datastoreClosed(CreoleEvent e)
CreoleListenerDataStore has been closeddatastoreClosed in interface CreoleListenerCopyright © 2024 GATE. All rights reserved.