org.otfeed.event
Interface IConnectionStateListener

All Known Implementing Classes:
ConnectionStateListener, SimpleConnectionStateListener

public interface IConnectionStateListener

Listener to monitor connection progress. Connection process goes thru the following states:

  1. Connecting: a host/port has been picked from the pool and system is trying to connect. Next state could be either Error (if a fatal error occurs), Connected (if connectred successfully), or Connecting (if could not connect, but there are other hosts to try).
  2. Connected: successfully connected and received login response. Next state could be Error (if login failed), Redirect (if we were asked to redirect to another host), or Login (if login succeeded). Note that login errors are fatal: system will not attempt to use another host in the pool.
  3. Redirect: We were asked to re-direct to the different host. Next state would be Connecting.
  4. Login: login was successfull. Next state is Error (when connection breaks due to communication error or user request to close/shutdown it).
  5. Error: Final state. Always reached.


Method Summary
 void onConnected()
          Is called when connection enters "Connected" state.
 void onConnecting(OTHost addr)
          Is called when connection enters "Connecting" state.
 void onError(OTError error)
          Is called when connection terminates.
 void onLogin()
          Is called when connection enters "Login" state.
 void onRedirect(OTHost addr)
          Is called when connection enters "Redirect" state.
 

Method Detail

onConnecting

void onConnecting(OTHost addr)
Is called when connection enters "Connecting" state.

Parameters:
addr - server address.

onConnected

void onConnected()
Is called when connection enters "Connected" state.


onRedirect

void onRedirect(OTHost addr)
Is called when connection enters "Redirect" state.

Parameters:
addr - redirect address.

onLogin

void onLogin()
Is called when connection enters "Login" state.


onError

void onError(OTError error)
Is called when connection terminates.



Copyright © 2007 Mike Kroutikov. All Rights Reserved.