public abstract class AbstractConsumerStage<I> extends AbstractStage
Modifier and Type | Field and Description |
---|---|
protected InputPort<I> |
inputPort |
logger
Constructor and Description |
---|
AbstractConsumerStage() |
AbstractConsumerStage(org.slf4j.Logger logger) |
Modifier and Type | Method and Description |
---|---|
protected <T> InputPort<T> |
createInputPort(Class<T> type,
String name)
Creates and adds an InputPort to the stage
|
protected void |
execute()
Contains the logic of this stage and is invoked (possibly multiple times) by the framework.
|
protected abstract void |
execute(I element)
Contains the logic of this stage and is invoked (possibly multiple times) by the framework.
|
InputPort<I> |
getInputPort() |
abort, 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, onTerminating, onValidating, removeDynamicPort, removeDynamicPort, setPaused, setStateless, shouldBeTerminated, signalAlreadyReceived, terminateStage, toString, workCompleted
public AbstractConsumerStage()
public AbstractConsumerStage(org.slf4j.Logger logger)
logger
- a custom logger (potentially shared by multiple stage instances)protected final void execute() throws Exception
AbstractStage
execute
in class AbstractStage
Exception
- arbitrary exception triggered by the logic of this stageprotected abstract void execute(I element) throws Exception
element
- the next non-null element from the (only) input port of this stageException
- arbitrary exception triggered by the logic of this stageprotected <T> InputPort<T> createInputPort(Class<T> type, String name)
AbstractStage
createInputPort
in class AbstractStage
T
- the type of elements to be receivedtype
- class of elements to be receivedname
- a specific name for the new portCopyright © 2015–2020. All rights reserved.