|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.io.mailboxes.MailboxAddress
public final class MailboxAddress
deprecated Use the higher-level Channel
and ServerChannel
classes instead.
In the context of Channels, MailboxAddresses are the way a local Channel refers to a remote Channel. Envelopes
are tagged with the address of the sender and the receiver. The receiver can use getReplyAddress()
The MailboxAddress class is likely to become a private imeplementation-only class.
A MailboxAddress is a private reference to a remote Mailbox. It is a logical connection between a sender and a Mailbox.
MailboxAddress are created by lookupMailbox(), which creates a new MailboxAddress each time called, or by receiving a reference to a MailboxAddress in an envelope.
If several isolates want to send messages to the same Mailbox in another isolate, each will use a different MailboxAddress. Even within an isolate, it may be simpler to use different MailboxAddresses to the same Mailbox.
Any attempt to call send() on a MailboxAddress to a Mailbox that is closed throws a MailboxClosedException.
Channel
,
ServerChannel
Method Summary | |
---|---|
void |
close()
Sends a close message to the corresponding Mailbox, explaining that no more messages will be sent via this MailboxAddress. |
MailboxAddress |
getReplyAddress()
Get the reply address that was associated with this address during lookup. |
boolean |
isOpen()
Returns true if close() was called, or a MailboxClosedException was thrown by send(). |
boolean |
isOwner(Isolate anIsolate)
Returns true if anIsolate is the owner of this address. |
static MailboxAddress |
lookupMailbox(String name,
Mailbox replyMailbox)
This method looks up a MailboxAddress that has been registered with the system, and implicitly opens the connection to the remote Mailbox. |
void |
send(Envelope env)
Sends a message to the Mailbox. |
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void close()
public boolean isOpen()
public boolean isOwner(Isolate anIsolate)
public static MailboxAddress lookupMailbox(String name, Mailbox replyMailbox) throws NoSuchMailboxException
name
- the name of the Mailbox to lookup.replyMailbox
- the address of a local mailbox that the remote isolate can send replies to.
name
.
NoSuchMailboxException
- if there is no mailbox named name
.public void send(Envelope env) throws AddressClosedException
env
- the message to send
IllegateStateException
- if the address is not in the open state, or if the caller is not the
"owner" of this MailboxAddress.
AddressClosedException
public MailboxAddress getReplyAddress()
IllegalStateException
- if this address is not openpublic String toString()
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class Object
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |