Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.squawk.io.mailboxes
Interface MailboxHandler

All Known Implementing Classes:
  SharedMailboxHandler

    public interface MailboxHandler

deprecated Use the higher-level `Channel` and `ServerChannel` classes instead.

The MailboxHandler is responsible for creating a logical connection to the client. It may modify the MailboxAddress that the client will use for future messages, and it may create and manage custom state for that logical connection.

See Also:
  `Channel`, `ServerChannel`

Method Summary
`AddressClosedException` | `handleClose(MailboxAddress address)` Called after a client closes a logical connection.
`MailboxAddress` | `handleOpen(Mailbox originalMailbox, MailboxAddress originalAddress, MailboxAddress replyAddress)` Called when a client looks up a MailboxAddress.

Method Detail

### handleOpen

    MailboxAddress handleOpen(Mailbox originalMailbox,
                              MailboxAddress originalAddress,
                              MailboxAddress replyAddress)

  Called when a client looks up a MailboxAddress. A handler can decide create a new Mailbox to handle this logical connection, or simply use the current Mailbox. A handler can record other state to manage this logical connection.

  Parameters:
    `originalMailbox` - the original Mailbox connected to.
    `originalAddress` - a new private MailboxAddress created by the system for the client to use communicate with Mailbox.
    `replyAddress` - the address to reply to.
  Returns:
    a MailboxAddress that the client should continue to use for the rest of it's communication. The `originalAddress` is often returned, but a MailboxHandler can create a new new private Mailbox and return a MailboxAddress to this new

### handleClose

    AddressClosedException handleClose(MailboxAddress address)

  Called after a client closes a logical connection. The handler can clean up after a logical connection, and can control if getting a close should cause any Mailbox.receive() calls on this Mailbox to throw a AddressClosedException. Typically registered "server" mail boxes should not throw an exception, but private mail boxes should.

  Parameters:
    `address` - the closed MailboxAddress.
  Returns:
    null, or an exception to be thrown by Mailbox.receive().

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"