... | ... | @@ -41,7 +41,7 @@ public final class InitialElementProducer<T> extends AbstractProducerStage<T> { |
|
|
First, we implement ``execute``.
|
|
|
It simply iterates over the given list and sends all elements by calling ``this.outputPort.send(element)``.
|
|
|
|
|
|
Furthermore, we want to check if the field ``elements`` is not empty.
|
|
|
Furthermore, we want to check if the given iterable is not null.
|
|
|
This can be achieved by running a check while starting the stage.
|
|
|
For this, we overwrite the method ``onStarting`` and add a null check to it.
|
|
|
You also need to make sure that the super method is also called. |
|
|
\ No newline at end of file |