|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.bam.actor.AbstractActorSender
public abstract class AbstractActorSender
ActorSender is a convenience API for sending messages to other Actors, which always using the actor's address as the "from" parameter and manages query ids.
Constructor Summary | |
---|---|
protected |
AbstractActorSender()
|
protected |
AbstractActorSender(java.lang.String id)
|
Method Summary | |
---|---|
void |
close()
Closes the sender. |
abstract Broker |
getBroker()
The underlying broker. |
QueryManager |
getQueryManager()
|
long |
getTimeout()
The default query timeout. |
boolean |
isClosed()
Returns true if the sender is closed |
void |
message(BamActorRef to,
java.io.Serializable payload)
Sends a unidirectional message to an ActorHolder ,
addressed by the Actor's address. |
void |
message(java.lang.String to,
java.io.Serializable payload)
Sends a unidirectional message to an ActorHolder ,
addressed by the Actor's address. |
long |
nextQueryId()
Returns the next query identifier. |
void |
query(BamActorRef to,
java.io.Serializable payload,
QueryCallback callback)
Sends a query information call (get) to an actor, providing a callback to receive the result or error. |
void |
query(BamActorRef to,
java.io.Serializable payload,
QueryCallback callback,
long timeout)
Sends a query information call (get) to an actor, providing a callback to receive the result or error. |
java.io.Serializable |
query(java.lang.String to,
java.io.Serializable payload)
Sends a query information call (get) to an actor, blocking until the actor responds with a result or an error. |
java.io.Serializable |
query(java.lang.String to,
java.io.Serializable payload,
long timeout)
Sends a query information call to an actor, blocking until the actor responds with a result or an error. |
void |
query(java.lang.String to,
java.io.Serializable payload,
QueryCallback callback)
Sends a query information call (get) to an actor, providing a callback to receive the result or error. |
void |
query(java.lang.String to,
java.io.Serializable payload,
QueryCallback callback,
long timeout)
Sends a query information call (get) to an actor, providing a callback to receive the result or error. |
QueryFuture |
queryFuture(java.lang.String to,
java.io.Serializable payload,
long timeout)
Sends a query information call to an actor, blocking until the actor responds with a result or an error. |
void |
setTimeout(long timeout)
The default query timeout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.caucho.bam.query.QuerySender |
---|
getAddress |
Constructor Detail |
---|
protected AbstractActorSender(java.lang.String id)
protected AbstractActorSender()
Method Detail |
---|
public long getTimeout()
public void setTimeout(long timeout)
public boolean isClosed()
isClosed
in interface ActorSender
public void close()
close
in interface ActorSender
public abstract Broker getBroker()
getBroker
in interface ActorSender
getBroker
in interface QuerySender
public QueryManager getQueryManager()
getQueryManager
in interface QuerySender
public void message(java.lang.String to, java.io.Serializable payload)
ActorHolder
,
addressed by the Actor's address.
message
in interface ActorSender
message
in interface QuerySender
to
- the target actor's addresspayload
- the message payloadpublic void message(BamActorRef to, java.io.Serializable payload)
ActorHolder
,
addressed by the Actor's address.
message
in interface ActorSender
to
- the target actor's addresspayload
- the message payloadpublic long nextQueryId()
nextQueryId
in interface ActorSender
public java.io.Serializable query(java.lang.String to, java.io.Serializable payload)
queryGet
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 target actor MUST send a queryResult
or
queryError
to the client using the same id
,
because RPC clients rely on a response.
query
in interface ActorSender
query
in interface QuerySender
to
- the target actor's addresspayload
- the query payloadpublic java.io.Serializable query(java.lang.String to, java.io.Serializable payload, long timeout)
query
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 target actor MUST send a queryResult
or
queryError
to the client using the same id
,
because RPC clients rely on a response.
query
in interface ActorSender
query
in interface QuerySender
to
- the target actor's addresspayload
- the query payloadtimeout
- time spent waiting for the query to returnpublic QueryFuture queryFuture(java.lang.String to, java.io.Serializable payload, long timeout)
query
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 target actor MUST send a queryResult
or
queryError
to the client using the same id
,
because RPC clients rely on a response.
to
- the target actor's addresspayload
- the query payloadtimeout
- time spent waiting for the query to returnpublic void query(java.lang.String to, java.io.Serializable payload, QueryCallback callback)
queryGet
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 target actor MUST send a queryResult
or
queryError
to the client using the same id
,
because RPC clients rely on a response.
query
in interface ActorSender
query
in interface QuerySender
to
- the target actor's addresspayload
- the query payloadcallback
- the application's callback for the resultpublic void query(java.lang.String to, java.io.Serializable payload, QueryCallback callback, long timeout)
queryGet
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 target actor MUST send a queryResult
or
queryError
to the client using the same id
,
because RPC clients rely on a response.
query
in interface ActorSender
query
in interface QuerySender
to
- the target actor's addresspayload
- the query payloadcallback
- the application's callback for the resultpublic void query(BamActorRef to, java.io.Serializable payload, QueryCallback callback)
queryGet
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 target actor MUST send a queryResult
or
queryError
to the client using the same id
,
because RPC clients rely on a response.
query
in interface ActorSender
to
- the target actor's addresspayload
- the query payloadcallback
- the application's callback for the resultpublic void query(BamActorRef to, java.io.Serializable payload, QueryCallback callback, long timeout)
queryGet
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 target actor MUST send a queryResult
or
queryError
to the client using the same id
,
because RPC clients rely on a response.
query
in interface ActorSender
to
- the target actor's addresspayload
- the query payloadcallback
- the application's callback for the result
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |