public class ServerGatewayBroker extends AbstractBroker
Constructor and Description |
---|
ServerGatewayBroker(Broker broker,
ClientStubManager clientManager,
MessageStream linkActor) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the Broker
|
java.lang.String |
getAddress()
Returns the broker's address, i.e.
|
java.lang.String |
getClientAddress() |
boolean |
isClosed()
Returns true if the broker has been closed
|
void |
message(java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Sends a message to the link service if 'to' is null, else send it to the broker.
|
void |
messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Handles a message
|
void |
query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Handles a query.
|
void |
queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Handles a query error.
|
void |
queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Handles a query result.
|
java.lang.String |
toString() |
addMailbox, getBroker, getBrokerMailbox, getMailbox, getQueueFullHandler, removeMailbox, setQueueFullHandler
getQueryErrorStream
public ServerGatewayBroker(Broker broker, ClientStubManager clientManager, MessageStream linkActor)
public java.lang.String getAddress()
AbstractBroker
getAddress
in interface MessageStream
getAddress
in class AbstractBroker
public java.lang.String getClientAddress()
public void message(java.lang.String to, java.lang.String from, java.io.Serializable payload)
message
in interface MessageStream
message
in class AbstractBrokerStream
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
messageError
in class AbstractBrokerStream
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
query
in class AbstractBrokerStream
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
queryResult
in class AbstractBrokerStream
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
queryError
in class AbstractBrokerStream
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()
AbstractBroker
isClosed
in interface MessageStream
isClosed
in class AbstractBroker
public void close()
Broker
close
in interface Broker
close
in class AbstractBroker
public java.lang.String toString()
toString
in class AbstractBrokerStream