com.ibm.streams.flow.handlers
Class HandlerCollection<S extends StreamHandler<T>,T>
- java.lang.Object
-
- com.ibm.streams.flow.handlers.HandlerCollection<S,T>
-
- Type Parameters:
S
- Collection element typeT
- Type for the tuples on the stream
- All Implemented Interfaces:
- StreamHandler<T>
public class HandlerCollection<S extends StreamHandler<T>,T> extends java.lang.Object implements StreamHandler<T>
AStreamHandler
that sends tuples and punctuation marks to a collection ofStreamHandler
instances.- Since:
- InfoSphere® Streams Version 3.1
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
IBM_COPYRIGHT
-
Constructor Summary
Constructors Constructor and Description HandlerCollection(java.util.Collection<S> handlers)
Create a HandlerCollection.
-
Method Summary
Methods Modifier and Type Method and Description java.util.Collection<S>
getHandlers()
Get the handler collection.void
mark(StreamingData.Punctuation mark)
Propagate the punctuation mark to each handler in the collection.void
tuple(T tuple)
Propagate the tuple to each handler in the collection.
-
-
-
Field Detail
-
IBM_COPYRIGHT
public static final java.lang.String IBM_COPYRIGHT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HandlerCollection
public HandlerCollection(java.util.Collection<S> handlers)
Create a HandlerCollection.Collections.synchronizedCollection
to ensure is used to wrap the passed in collection, which ensures that all the callers see a consistent view of the collection.- Parameters:
handlers
-
-
-
Method Detail
-
getHandlers
public java.util.Collection<S> getHandlers()
Get the handler collection. The collection can be modified, but modification f the collection while tuples or punctuation marks are being handled can cause an exception.- Returns:
- The handler collection.
-
tuple
public final void tuple(T tuple) throws java.lang.Exception
Propagate the tuple to each handler in the collection.- Specified by:
tuple
in interfaceStreamHandler<T>
- Parameters:
tuple
- The tuple.- Throws:
java.lang.Exception
- Failure to process the tuple.
-
mark
public final void mark(StreamingData.Punctuation mark) throws java.lang.Exception
Propagate the punctuation mark to each handler in the collection.- Specified by:
mark
in interfaceStreamHandler<T>
- Parameters:
mark
- The punctuation mark.- Throws:
java.lang.Exception
- Failure to process the punctuation mark.
-
-