public class Counter<T> extends AbstractFilter<T> implements ITaskFarmDuplicable<T,T>
outputPortinputPortlogger| Constructor and Description |
|---|
Counter() |
| Modifier and Type | Method and Description |
|---|---|
ITaskFarmDuplicable<T,T> |
duplicate()
Creates a new instance of the enclosed stage.
|
protected void |
execute(T element)
Contains the logic of this stage and is invoked (possibly multiple times) by the framework.
|
int |
getNumElementsPassed() |
void |
onTerminating()
Event that is triggered, if all of the following conditions hold:
while executing the P&F configuration and
after receiving the termination signal.
|
getOutputPortcreateInputPort, execute, getInputPortabort, addInputPortRemovedListener, addOutputPortRemovedListener, compareAndSetBeingExecuted, createInputPort, createInputPort, createInputPort, createOutputPort, createOutputPort, createOutputPort, createOutputPort, declareActive, declarePassive, executeByFramework, getCurrentState, getId, getInputPorts, getOutputPorts, getOwningThread, getTerminationStrategy, isActive, isBeingExecuted, isPaused, isProducer, isStateless, onSignal, onStarting, onValidating, removeDynamicPort, removeDynamicPort, setPaused, setStateless, shouldBeTerminated, signalAlreadyReceived, terminateStage, toString, workCompletedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInputPort, getOutputPortprotected void execute(T element)
AbstractConsumerStageexecute in class AbstractConsumerStage<T>element - the next non-null element from the (only) input port of this stagepublic void onTerminating()
AbstractStageIf stage developers want to override this method, they must always call the super implementation last:
@Override
protected void onTerminating() {
// insert your code here
super.onTerminating();
}
To throw a checked exception, wrap it to an unchecked exception, e.g. to an IllegalArgumentException.IllegalArgumentException(String, Throwable).
Always pass the original exception to the new unchecked exception to allow easy debugging.
onTerminating in class AbstractStagepublic int getNumElementsPassed()
public ITaskFarmDuplicable<T,T> duplicate()
ITaskFarmDuplicableduplicate in interface ITaskFarmDuplicable<T,T>Copyright © 2015–2020. All rights reserved.