public class DualSizeMailbox extends java.lang.Object implements Mailbox
Constructor and Description |
---|
DualSizeMailbox(java.lang.String address,
Broker broker,
Mailbox smallMailbox,
Mailbox largeMailbox) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the mailbox
|
MessageStream |
getActorStream()
Returns the actor stream for the actor itself.
|
java.lang.String |
getAddress()
Returns the actor's address
|
Broker |
getBroker()
Returns the owning broker
|
int |
getLargeQueueSize() |
int |
getSize()
Returns the queue size
|
int |
getSmallQueueSize() |
boolean |
isClosed()
Tests if the stream is closed.
|
void |
message(java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Sends a message
|
void |
messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Sends a message
|
void |
query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Query an entity
|
void |
queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload,
BamError error)
Query an entity
|
void |
queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable payload)
Query an entity
|
java.lang.String |
toString() |
public int getSize()
Mailbox
public int getSmallQueueSize()
public int getLargeQueueSize()
public java.lang.String getAddress()
getAddress
in interface MessageStream
public Broker getBroker()
MessageStream
getBroker
in interface MessageStream
public boolean isClosed()
MessageStream
isClosed
in interface MessageStream
public MessageStream getActorStream()
Mailbox
getActorStream
in interface Mailbox
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 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 query payloaderror
- additional error informationpublic void close()
Mailbox
public java.lang.String toString()
toString
in class java.lang.Object