public class MultiworkerMailbox extends java.lang.Object implements Mailbox, java.io.Closeable
| Constructor and Description |
|---|
MultiworkerMailbox(MessageStream actorStream,
Broker broker,
int threadMax) |
MultiworkerMailbox(java.lang.String address,
MessageStream actorStream,
Broker broker,
int threadMax) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the mailbox
|
protected ActorProcessor<Packet> |
createProcessor() |
protected MailboxQueue2 |
createWorker() |
protected void |
enqueue(Packet packet) |
MessageStream |
getActorStream()
Returns the actor stream for the actor itself.
|
java.lang.String |
getAddress()
Returns the actor's address
|
Broker |
getBroker()
Returns the stream back to the link for error packets
|
protected long |
getCurrentTimeActual() |
int |
getSize()
Returns the queue size
|
int |
getThreadMax() |
boolean |
isClosed()
Tests if the stream is closed.
|
boolean |
isPacketAvailable()
Returns true if a message is available.
|
void |
message(java.lang.String to,
java.lang.String from,
java.io.Serializable value)
Sends a message
|
void |
messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable value,
BamError error)
Sends a message
|
void |
query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable query)
Query an entity
|
void |
queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable query,
BamError error)
Query an entity
|
void |
queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable value)
Query an entity
|
java.lang.String |
toString() |
public MultiworkerMailbox(MessageStream actorStream, Broker broker, int threadMax)
public MultiworkerMailbox(java.lang.String address,
MessageStream actorStream,
Broker broker,
int threadMax)
protected MailboxQueue2 createWorker()
protected ActorProcessor<Packet> createProcessor()
public int getThreadMax()
public int getSize()
Mailboxpublic java.lang.String getAddress()
getAddress in interface MessageStreampublic boolean isPacketAvailable()
public Broker getBroker()
getBroker in interface MessageStreampublic MessageStream getActorStream()
MailboxgetActorStream in interface Mailboxpublic void message(java.lang.String to,
java.lang.String from,
java.io.Serializable value)
message in interface MessageStreamto - the target actor's addressfrom - the source actor's addressvalue - the message payloadpublic void messageError(java.lang.String to,
java.lang.String from,
java.io.Serializable value,
BamError error)
messageError in interface MessageStreamto - the target actor's addressfrom - the source actor's addressvalue - the message payloaderror - the message errorpublic void query(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable query)
query in interface MessageStreamid - the query identifier used to match requests with responsesto - the service actor's addressfrom - the client actor's addressquery - the query payloadpublic void queryResult(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable value)
queryResult in interface MessageStreamid - the query identifier used to match requests with responsesto - the client actor's addressfrom - the service actor's addressvalue - the result payloadpublic void queryError(long id,
java.lang.String to,
java.lang.String from,
java.io.Serializable query,
BamError error)
queryError in interface MessageStreamid - the query identifier used to match requests with responsesto - the client actor's addressfrom - the service actor's addressquery - the query payloaderror - additional error informationprotected final void enqueue(Packet packet)
public void close()
Mailboxprotected long getCurrentTimeActual()
public boolean isClosed()
MessageStreamisClosed in interface MessageStreampublic java.lang.String toString()
toString in class java.lang.Object