|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.bam.actor.SkeletonActorFilter<T>
public class SkeletonActorFilter<T>
Base ActorStream implementation using introspection and
@Message annotations to simplify
Actor development.
@Message. To send
a response message or query, use getBrokerStream() or
getClient().
Constructor Summary
SkeletonActorFilter(Actor next,
T actor)
Method Summary
protected BamSkeleton<T>
createSkeleton(T actor)
java.lang.String
getAddress()
Returns the Actor's address so the Broker can
register it.
Broker
getBroker()
Returns the stream to the broker for query results or errors, or
low-level messaging.
boolean
isClosed()
Tests if the stream is closed.
void
message(java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Dispatches a unidirectional message to a matching method on
the SimpleActorStream.
void
messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Dispatches a messageError to a matching method on
the SimpleActorStream.
void
query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Dispatches a queryGet to a matching method on
the SimpleActorStream.
void
queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Dispatches a queryError to a matching method on
the SimpleActorStream.
void
queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Dispatches a queryResult to a matching method on
the SimpleActorStream.
java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail
SkeletonActorFilter
public SkeletonActorFilter(Actor next,
T actor)
Method Detail
createSkeleton
protected BamSkeleton<T> createSkeleton(T actor)
getAddress
public java.lang.String getAddress()
- Returns the Actor's address so the
Broker can
register it.
- Specified by:
getAddress in interface MessageStream
isClosed
public boolean isClosed()
- Description copied from interface:
MessageStream
- Tests if the stream is closed.
- Specified by:
isClosed in interface MessageStream
getBroker
public Broker getBroker()
- Returns the stream to the broker for query results or errors, or
low-level messaging.
- Specified by:
getBroker in interface MessageStream
message
public void message(java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
- Dispatches a unidirectional message to a matching method on
the SimpleActorStream.
By default, message invokes a method
annotated by
@Message with
a payload class matching the message payload.
If no method is found, the message is ignored.
- Specified by:
message in interface MessageStream
- Parameters:
to - the SimpleActorStream's addressfrom - the sending actor's addresspayload - the message payload
messageError
public void messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
- Dispatches a messageError to a matching method on
the SimpleActorStream.
By default, messageError invokes a method
annotated by
@MessageError with
a payload class matching the messageError payload.
If no method is found, the messageError is ignored.
- Specified by:
messageError in interface MessageStream
- Parameters:
to - the SimpleActorStream's addressfrom - the sending actor's addresspayload - the message payloaderror - the message error
query
public void query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
- Dispatches a queryGet to a matching method on
the SimpleActorStream.
By default, queryGet invokes a method
annotated by
@QueryGet with
a payload class matching the queryGet payload.
The @QueryGet method MUST
send either a queryResult or queryError as a response.
If no method is found, queryGet sends a queryError response with
a feature-not-implemented error.
- Specified by:
query in interface MessageStream
- Parameters:
id - a correlation id to match the result or errorto - the SimpleActorStream's addressfrom - the client actor's addresspayload - the query payload
queryResult
public void queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
- Dispatches a queryResult to a matching method on
the SimpleActorStream.
By default, queryResult invokes a method
annotated by
@QueryResult with
a payload class matching the queryResult payload.
If no method is found, queryResult ignores the packet.
- Specified by:
queryResult in interface MessageStream
- Parameters:
id - the correlation id from the original queryto - the SimpleActorStream's addressfrom - the client actor's addresspayload - the query payload
queryError
public void queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
- Dispatches a queryError to a matching method on
the SimpleActorStream.
By default, queryError invokes a method
annotated by
@QueryError with
a payload class matching the queryError payload.
If no method is found, queryError ignores the packet.
- Specified by:
queryError in interface MessageStream
- Parameters:
id - the correlation id from the original queryto - the SimpleActorStream's addressfrom - the client actor's addresspayload - the query payloaderror - the error information
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD