com.sun.sgs.protocol
Interface ProtocolListener


public interface ProtocolListener

The listener for incoming protocol connections.


Method Summary
 void newLogin(Identity identity, SessionProtocol protocol, RequestCompletionHandler<SessionProtocolHandler> completionHandler)
          Handles a new login request for the specified identity and corresponding protocol, and when this listener has completed processing the request, invokes the completed method on the given completionHandler with a Future containing the result of the login request.
 void relocatedSession(BigInteger relocationKey, SessionProtocol protocol, RequestCompletionHandler<SessionProtocolHandler> completionHandler)
          Re-establishes an existing client session corresponding to the specified relocationKey, and when this listener has completed processing this request, invokes the completed method on the given completionHandler with a Future containing the result of this request.
 

Method Detail

newLogin

void newLogin(Identity identity,
              SessionProtocol protocol,
              RequestCompletionHandler<SessionProtocolHandler> completionHandler)
Handles a new login request for the specified identity and corresponding protocol, and when this listener has completed processing the request, invokes the completed method on the given completionHandler with a Future containing the result of the login request.

If the login request is processed successfully, then invoking the get method on the future supplied to the completed method returns the SessionProtocolHandler for processing incoming requests received by the protocol.

If the login was unsuccessful, the get method throws ExecutionException which contains a cause that indicates why the login failed. The getCause method will return one of the following exceptions:

Parameters:
identity - an identity
protocol - a session protocol
completionHandler - a completion handler

relocatedSession

void relocatedSession(BigInteger relocationKey,
                      SessionProtocol protocol,
                      RequestCompletionHandler<SessionProtocolHandler> completionHandler)
Re-establishes an existing client session corresponding to the specified relocationKey, and when this listener has completed processing this request, invokes the completed method on the given completionHandler with a Future containing the result of this request.

If the relocation request is processed successfully, then invoking the get method on the future supplied to the completed method returns the SessionProtocolHandler for processing incoming requests received by the protocol.

If the relocation request was unsuccessful, the get method throws ExecutionException which contains a cause that indicates why the relocation failed. The getCause method will return a RelocateFailureException with one of the following failure reasons:

Parameters:
relocationKey - a relocationKey
protocol - a session protocol
completionHandler - a completion handler

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved