public class SimpleAmpMailbox extends AbstractAmpMailbox
| Constructor and Description |
|---|
SimpleAmpMailbox(AmpActorContext actor) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the mailbox
|
void |
error(AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
AmpError error)
Sends a message error to an
ActorHolder,
addressed by the Actor's address. |
AmpActorContext |
getActorContext() |
AmpStream |
getActorStream()
Returns the delegated actor stream for the actor itself.
|
void |
query(long id,
AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
java.lang.String methodName,
java.lang.Object... args)
Sends a query/RPCinformation call
The receiver of a
query acts as a service and the
caller acts as a client. |
void |
queryError(long id,
AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
AmpError error)
Sends a query error from a failed query.
|
void |
queryResult(long id,
AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
java.lang.Object result)
Sends a query response for a query
|
void |
send(AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
java.lang.String methodName,
java.lang.Object... args)
Sends a unidirectional message to an
ActorHolder,
addressed by the Actor's address. |
java.lang.String |
toString() |
public SimpleAmpMailbox(AmpActorContext actor)
public AmpStream getActorStream()
public AmpActorContext getActorContext()
public void send(AmpActorRef to, AmpActorRef from, AmpEncoder encoder, java.lang.String methodName, java.lang.Object... args)
AmpStreamActorHolder,
addressed by the Actor's address.send in interface AmpStreamsend in class AbstractAmpStreamto - the target actor's addressfrom - the source actor's addresspublic void query(long id,
AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
java.lang.String methodName,
java.lang.Object... args)
AmpStreamquery acts as a service and the
caller acts as a client. Because BAM Actors are symmetrical, all
Actors can act as services and clients for different RPC calls.
The stream MUST send a queryResult or
queryError to the client using the same id,
because RPC clients rely on a response.query in interface AmpStreamquery in class AbstractAmpStreamid - the query identifier used to match requests with responsesto - the service actor's addressfrom - the client actor's addresspublic void queryResult(long id,
AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
java.lang.Object result)
AmpStreamqueryResult in interface AmpStreamqueryResult in class AbstractAmpStreamid - the query identifier used to match requests with responsesto - the client actor's addressfrom - the service actor's addresspublic void queryError(long id,
AmpActorRef to,
AmpActorRef from,
AmpEncoder encoder,
AmpError error)
AmpStreamqueryError in interface AmpStreamqueryError in class AbstractAmpStreamid - the query identifier used to match requests with responsesto - the client actor's addressfrom - the service actor's addresserror - additional error informationpublic void error(AmpActorRef to, AmpActorRef from, AmpEncoder encoder, AmpError error)
AmpStreamActorHolder,
addressed by the Actor's address. Actor protocols may choose to send
error messages if a message fails for some reason.
In general, Actors should not rely on the delivery of error messages.
If an error return is required, use an RPC query instead.error in interface AmpStreamerror in class AbstractAmpStreamto - the target actor's addressfrom - the source actor's addresserror - the message errorpublic void close()
close in interface AmpMailboxclose in class AbstractAmpMailboxpublic java.lang.String toString()
toString in class java.lang.Object