|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object juglr.Actor juglr.DelegatingActor
public class DelegatingActor
Asynchronously forward messages to a delegate according to
a given strategy. The DelegatingActor will always forward a message to
exactly one delegate. If you need to forward the same message to multiple
delegates use a MulticastActor
.
MulticastActor
Nested Class Summary | |
---|---|
static interface |
DelegatingActor.Strategy
|
Constructor Summary | |
---|---|
DelegatingActor(Actor... delegates)
|
|
DelegatingActor(Address... delegates)
Create a new DelegatingActor forwarding messages to delegates
using a round-robin strategy |
|
DelegatingActor(DelegatingActor.Strategy strategy)
Create a new DelegatingActor forwarding messages to delegates
selected using the given DelegatingActor.Strategy . |
|
DelegatingActor(java.lang.Iterable<Address> delegates)
Create a new DelegatingActor forwarding messages to delegates
using a round-robin strategy |
Method Summary | |
---|---|
static DelegatingActor |
newForActors(Actor... delegates)
|
static DelegatingActor |
newForActors(java.lang.Iterable<Actor> delegates)
|
void |
react(Message msg)
Asynchronously relay the incoming message to the address determined by calling DelegatingActor.Strategy.recipient(Message) |
void |
start()
Invoke DelegatingActor.Strategy.start() |
Methods inherited from class juglr.Actor |
---|
await, awaitMessage, awaitTimeout, getAddress, getBus, send, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DelegatingActor(Address... delegates)
delegates
using a round-robin strategy
delegates
- the collection of delegates to forward messages topublic DelegatingActor(java.lang.Iterable<Address> delegates)
delegates
using a round-robin strategy
delegates
- the collection of delegates to forward messages topublic DelegatingActor(Actor... delegates)
public DelegatingActor(DelegatingActor.Strategy strategy)
delegates
selected using the given DelegatingActor.Strategy
.
strategy
- the Strategy used for selecting the next address to
forward an incoming message toMethod Detail |
---|
public static DelegatingActor newForActors(java.lang.Iterable<Actor> delegates)
public static DelegatingActor newForActors(Actor... delegates)
public void react(Message msg)
DelegatingActor.Strategy.recipient(Message)
react
in class Actor
msg
- the incoming messagepublic void start()
DelegatingActor.Strategy.start()
start
in class Actor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |