T - type of items upon which this stage operates@ThreadSafe public class PipelineDemultiplexerStage<T> extends BaseStage<T>
Pipeline and Predicate pairs, sends the
collection of item copies selected by the predicate to the associated pipeline. This stage is similar to
SplitMergeStage but a given item, or more precisely a copy of it, may end up going to more than one pipeline
(or no pipeline).
This stage requires the following properties be set prior to initialization:
PipelineAndSelectionStrategies
If no executorService is provided, one will be created using Executors.newFixedThreadPool(int) with
6 threads.
If no collectionFactory is given, then SimpleItemCollectionFactory is used.
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Supplier<Collection<Item<T>>> |
collectionFactory
Factory used to create the Item collection that is then given to the pipelines.
|
private ExecutorService |
executorService
Service used to execute the selected and/or non-selected item pipelines.
|
private List<net.shibboleth.utilities.java.support.collection.Pair<Pipeline<T>,com.google.common.base.Predicate<Item<T>>>> |
pipelineAndStrategies
The pipelines through which items are sent and the selection strategy used for that pipeline.
|
private boolean |
waitingForPipelines
Whether this child waits for all the invoked pipelines to complete before proceeding.
|
| Constructor and Description |
|---|
PipelineDemultiplexerStage() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDestroy() |
protected void |
doExecute(Collection<Item<T>> itemCollection)
Performs the stage processing on the given Item collection.
|
protected void |
doInitialize() |
com.google.common.base.Supplier<Collection<Item<T>>> |
getCollectionFactory()
Gets the factory used to create the Item collection that is then given to the pipelines.
|
ExecutorService |
getExecutorService()
Gets the executor service used to run the selected and non-selected item pipelines.
|
List<net.shibboleth.utilities.java.support.collection.Pair<Pipeline<T>,com.google.common.base.Predicate<Item<T>>>> |
getPipelineAndSelectionStrategies()
Gets the pipeline and item selection strategies used to demultiplex item collections within this stage.
|
boolean |
isWaitingForPipelines()
Gets whether this child waits for all the invoked pipelines to complete before proceeding.
|
void |
setCollectionFactory(com.google.common.base.Supplier<Collection<Item<T>>> factory)
Sets the factory used to create the Item collection that is then given to the pipelines.
|
void |
setExecutorService(ExecutorService service)
Sets the executor service used to run the selected and non-selected item pipelines.
|
void |
setPipelineAndSelectionStrategies(List<net.shibboleth.utilities.java.support.collection.Pair<Pipeline<T>,com.google.common.base.Predicate<Item<T>>>> passes)
Sets the pipeline and item selection strategies used to demultiplex item collections within this stage.
|
void |
setWaitingForPipelines(boolean isWaiting)
Sets whether this child waits for all the invoked pipelines to complete before proceeding.
|
execute, getCollectionPredicate, setCollectionPredicatesetIdgetIddestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isDestroyedprivate ExecutorService executorService
private boolean waitingForPipelines
private com.google.common.base.Supplier<Collection<Item<T>>> collectionFactory
@Nonnull public ExecutorService getExecutorService()
public void setExecutorService(@Nonnull ExecutorService service)
service - executor service used to run the selected and non-selected item pipelinespublic boolean isWaitingForPipelines()
public void setWaitingForPipelines(boolean isWaiting)
isWaiting - whether this child waits for all the invoked pipelines to complete before proceeding@Nonnull public com.google.common.base.Supplier<Collection<Item<T>>> getCollectionFactory()
public void setCollectionFactory(@Nonnull com.google.common.base.Supplier<Collection<Item<T>>> factory)
factory - factory used to create the Item collection that is then given to the pipelines@Nonnull @NonnullElements @Unmodifiable public List<net.shibboleth.utilities.java.support.collection.Pair<Pipeline<T>,com.google.common.base.Predicate<Item<T>>>> getPipelineAndSelectionStrategies()
public void setPipelineAndSelectionStrategies(@Nonnull@NonnullElements List<net.shibboleth.utilities.java.support.collection.Pair<Pipeline<T>,com.google.common.base.Predicate<Item<T>>>> passes)
passes - pipeline and item selection strategies used to demultiplex item collections within this stageprotected void doExecute(@Nonnull@NonnullElements Collection<Item<T>> itemCollection) throws StageProcessingException
The stage is guaranteed to be have been initialized and not destroyed when this is invoked.
doExecute in class BaseStage<T>itemCollection - collection to be processedStageProcessingException - thrown if there is an unrecoverable problem when processing the stageprotected void doDestroy()
doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponentprotected void doInitialize()
throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponentnet.shibboleth.utilities.java.support.component.ComponentInitializationExceptionCopyright © 1999–2016. All rights reserved.