|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface RoutingOutputChannel<M>
The RoutingOutputChannel is an OutputChannel that receives messages and publishes them to one or more subscribing outputchannels.
Every subscribing outputchannel is registered with a MessagePredicate that checks if the subscriber wants the message . If there are multiple subscribers for a message, the timeout will decrease after every offer. So if the original timeout was 1000ms, and the first took 300ms, 700 ms remains for the second. If the second took 500ms, 200ms remains for the third. If the third takes 300ms, a timeout will occur (what happens next?) if the third takes 200ms, 0ms remains for the other ones. So if the timeout is reduced to 0ms, all the next subscribers will be called with 0ms.
| Method Summary | |
|---|---|
void |
add(OutRouterEntry<M> entry)
|
java.util.Iterator<OutRouterEntry<M>> |
entries()
Returns all the OutRouterEntries. |
OutputChannel<M> |
getFailOutputChannel()
Returns the OutputChannel that is used if a message could not be send to a receiver. |
boolean |
isStopAfterFirst()
Returns true if this RoutingOutputChannel should stop sending messages to other receivers if one receiver succesfully has received a message. |
void |
subscribe(OutputChannel<M> subscriber)
Adds the subscriber to this RoutingOutputChannel. |
void |
subscribe(org.jph.collections.predicate.Predicate predicate,
OutputChannel<M> subscriber)
Adds a subscriber to this RoutingOutputChannel. |
| Methods inherited from interface org.jph.channels.OutputChannel |
|---|
offer, put |
| Method Detail |
|---|
boolean isStopAfterFirst()
OutputChannel<M> getFailOutputChannel()
java.util.Iterator<OutRouterEntry<M>> entries()
void add(OutRouterEntry<M> entry)
entry -
java.lang.NullPointerException - if entry is null.void subscribe(OutputChannel<M> subscriber)
subscriber - the subscriber to add. If the subscriber already is a subscriber for
this RoutingOutputChannel, it is not added again.
java.lang.NullPointerException - if subscriber is null.
void subscribe(org.jph.collections.predicate.Predicate predicate,
OutputChannel<M> subscriber)
predicate - if the predicate is null, the TrueMessagePredicate is used by default.subscriber -
java.lang.NullPointerException - subscriber is null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||