|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SessionRelocationProtocol
Protocol additions for suspending and resuming messages to a client session and relocating a client session to another node.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.sun.sgs.protocol.SessionProtocol |
|---|
SessionProtocol.DisconnectReason |
| Method Summary | |
|---|---|
void |
relocate(Set<ProtocolDescriptor> descriptors,
ByteBuffer relocationKey,
RequestCompletionHandler<Void> completionHandler)
Notifies the associated client to relocate its session to the node specified by the descriptors using the given relocationKey. |
void |
resume()
Notifies the associated client to resume sending messages to the server. |
void |
suspend(RequestCompletionHandler<Void> completionHandler)
Notifies the associated client to suspend sending messages to the server until resume is invoked. |
| Methods inherited from interface com.sun.sgs.protocol.SessionProtocol |
|---|
channelJoin, channelLeave, channelMessage, disconnect, getDeliveries, getMaxMessageLength, sessionMessage |
| Methods inherited from interface java.nio.channels.Channel |
|---|
close, isOpen |
| Method Detail |
|---|
void suspend(RequestCompletionHandler<Void> completionHandler)
throws IOException
resume is invoked. This method must
notify the completionHandler when messages have been
suspended. Messages received by the SessionProtocolHandler
will be received and processed until the completionHandler's
completed method is
invoked. If messages are not suspended in a timely fashion (i.e,
the completionHandler is not notified), then the server may
disconnect this session.
Only session messages that have their completion handlers notified
before the specified completionHandler is notified are
guaranteed to be processed by the server.
Once this method is invoked, an invocation on a method that sends a
message to the client should throw IllegalStateException
until messages are resumed.
completionHandler - a completion handler
IOException - if an I/O error occurs
void resume()
throws IOException
IOException - if an I/O error occurs
void relocate(Set<ProtocolDescriptor> descriptors,
ByteBuffer relocationKey,
RequestCompletionHandler<Void> completionHandler)
throws IOException
descriptors using the given relocationKey.
The associated client session can be reestablished on the new node
by notifying the ProtocolListener of this protocol's
corresponding ProtocolAcceptor on the new node. The ProtocolListener.relocatedSession
method can be invoked on the new node with the given relocation key
to reestablish the client session without having to log in again.
Once this method is invoked, an invocation on a method that sends a
message to the client should throw IllegalStateException.
Additionally, the client should close any underlying local
connection(s) in a timely fashion.
descriptors - protocol descriptors for newNoderelocationKey - the key to be supplied to the new nodecompletionHandler - a completion handler
IllegalStateException - if the associated session is not
suspended or is already relocating
IOException - if an I/O error occurs
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||