public abstract class AbstractMessageStream extends java.lang.Object implements MessageStream
MessageStream
returns query errors for RPC packets, and ignores unknown packets
for messages and presence announcement.
Most developers will use SkeletonActorFilter
or SimpleActor
because those classes use
introspection with @Message
annotations
to simplify Actor development.Constructor and Description |
---|
AbstractMessageStream() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAddress()
Returns the address at the end of the stream.
|
Broker |
getBroker()
Returns the owning broker
|
boolean |
isClosed()
Tests if the stream is closed.
|
void |
message(java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Receives a unidirectional message.
|
void |
messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Receives a message error.
|
void |
query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Receives a query call, acting as a service for
the query.
|
void |
queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Handles a query error from a service Actor.
|
void |
queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Handles a query response from a service Actor.
|
java.lang.String |
toString() |
public java.lang.String getAddress()
getAddress
in interface MessageStream
public Broker getBroker()
MessageStream
getBroker
in interface MessageStream
public void message(java.lang.String to, java.lang.String from, java.io.Serializable payload)
message
in interface MessageStream
to
- the target actor's addressfrom
- the source actor's addresspayload
- the message payloadpublic void messageError(java.lang.String to, java.lang.String from, java.io.Serializable payload, BamError error)
messageError
in interface MessageStream
to
- the target actor's addressfrom
- the source actor's addresspayload
- the original message payloaderror
- the message errorpublic void query(long id, java.lang.String to, java.lang.String from, java.io.Serializable payload)
query
in interface MessageStream
id
- the query identifier used to match requests with responsesto
- the service actor's addressfrom
- the client actor's addresspayload
- the query payloadpublic void queryResult(long id, java.lang.String to, java.lang.String from, java.io.Serializable payload)
queryResult
in interface MessageStream
id
- the query identifier used to match requests with responsesto
- the client actor's addressfrom
- the service actor's addresspayload
- the result payloadpublic void queryError(long id, java.lang.String to, java.lang.String from, java.io.Serializable payload, BamError error)
queryError
in interface MessageStream
id
- the query identifier used to match requests with responsesto
- the client actor's addressfrom
- the service actor's addresspayload
- the result payloaderror
- additional error informationpublic boolean isClosed()
isClosed
in interface MessageStream
public java.lang.String toString()
toString
in class java.lang.Object