Package org.symphonyoss.s2.canon.runtime
Interface IProducer<V>
-
- Type Parameters:
V- The type of objects produced.
- All Known Subinterfaces:
IMonitor<V>,IProducerImpl<V>
- All Known Implementing Classes:
AsynchronousProducer,Monitor,SynchronousProducer
public interface IProducer<V>An interface for an entity which produces objects for which listeners may be registered.- Author:
- Bruce Skingle
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(org.symphonyoss.s2.fugue.pipeline.IConsumer<V> listener)Add a listener which will be notified for each new object created.booleanremoveListener(org.symphonyoss.s2.fugue.pipeline.IConsumer<V> listener)Remove the give listener.
-
-
-
Method Detail
-
addListener
void addListener(org.symphonyoss.s2.fugue.pipeline.IConsumer<V> listener)
Add a listener which will be notified for each new object created.- Parameters:
listener- A listener for new objects.
-
removeListener
boolean removeListener(org.symphonyoss.s2.fugue.pipeline.IConsumer<V> listener)
Remove the give listener.- Parameters:
listener- A listener for new objects.- Returns:
- true if the listener was removed, false if the given listener was not registered.
-
-