public class ManagedBrokerAdapter extends AbstractManagedBroker
Constructor and Description |
---|
ManagedBrokerAdapter(Broker broker) |
Modifier and Type | Method and Description |
---|---|
void |
addMailbox(java.lang.String address,
Mailbox mailbox)
Adds a mailbox.
|
void |
close()
Close the Broker
|
static ManagedBroker |
create(Broker broker) |
java.lang.String |
getAddress()
Returns the broker's address, i.e.
|
Broker |
getBroker()
The broker returns itself for the broker.
|
Mailbox |
getBrokerMailbox()
Returns a mailbox to the broker itself
|
Mailbox |
getMailbox(java.lang.String address)
Returns the actor stream for the given address.
|
boolean |
isClosed()
Returns true if the broker has been 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.
|
void |
removeMailbox(Mailbox mailbox)
Removes a mailbox.
|
createAgent, createAgent, createClient, createMailbox, createMailbox
getQueueFullHandler, setQueueFullHandler
getQueryErrorStream, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getQueueFullHandler
public ManagedBrokerAdapter(Broker broker)
public static ManagedBroker create(Broker broker)
public java.lang.String getAddress()
AbstractBroker
getAddress
in interface MessageStream
getAddress
in class AbstractBroker
public boolean isClosed()
AbstractManagedBroker
isClosed
in interface MessageStream
isClosed
in class AbstractManagedBroker
public Broker getBroker()
AbstractBroker
getBroker
in interface MessageStream
getBroker
in class AbstractBroker
public void message(java.lang.String to, java.lang.String from, java.io.Serializable payload)
AbstractBrokerStream
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)
AbstractBrokerStream
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)
AbstractBrokerStream
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)
AbstractBrokerStream
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)
AbstractBrokerStream
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 Mailbox getBrokerMailbox()
AbstractBroker
getBrokerMailbox
in interface Broker
getBrokerMailbox
in class AbstractBroker
public Mailbox getMailbox(java.lang.String address)
AbstractBrokerStream
getMailbox
in interface Broker
getMailbox
in class AbstractBroker
address
- the address of the mailboxpublic void addMailbox(java.lang.String address, Mailbox mailbox)
AbstractManagedBroker
addMailbox
in interface Broker
addMailbox
in interface ManagedBroker
addMailbox
in class AbstractManagedBroker
public void removeMailbox(Mailbox mailbox)
AbstractManagedBroker
removeMailbox
in interface Broker
removeMailbox
in interface ManagedBroker
removeMailbox
in class AbstractManagedBroker
public void close()
Broker
close
in interface Broker
close
in class AbstractBroker