org.otfeed.support
Class SimpleConnectionStateListener

java.lang.Object
  extended by org.otfeed.support.SimpleConnectionStateListener
All Implemented Interfaces:
IConnectionStateListener

public class SimpleConnectionStateListener
extends java.lang.Object
implements IConnectionStateListener

Implementation of IConnectionStateListener that prints events to the PrintWriter. Default destination for printing is standard error output stream.


Constructor Summary
SimpleConnectionStateListener()
           
 
Method Summary
 java.io.PrintWriter getPrintWriter()
          Determines the print destination.
 void onConnected()
          Is called when connection enters "Connected" state.
 void onConnecting(OTHost arg0)
          Is called when connection enters "Connecting" state.
 void onError(OTError arg0)
          Is called when connection terminates.
 void onLogin()
          Is called when connection enters "Login" state.
 void onRedirect(OTHost arg0)
          Is called when connection enters "Redirect" state.
 void setPrintWriter(java.io.PrintWriter val)
          Sets the destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleConnectionStateListener

public SimpleConnectionStateListener()
Method Detail

getPrintWriter

public java.io.PrintWriter getPrintWriter()
Determines the print destination. default is System.err.

Returns:
output destination.

setPrintWriter

public void setPrintWriter(java.io.PrintWriter val)
Sets the destination.

Parameters:
val - destination.

onConnected

public void onConnected()
Description copied from interface: IConnectionStateListener
Is called when connection enters "Connected" state.

Specified by:
onConnected in interface IConnectionStateListener

onConnecting

public void onConnecting(OTHost arg0)
Description copied from interface: IConnectionStateListener
Is called when connection enters "Connecting" state.

Specified by:
onConnecting in interface IConnectionStateListener
Parameters:
arg0 - server address.

onError

public void onError(OTError arg0)
Description copied from interface: IConnectionStateListener
Is called when connection terminates.

Specified by:
onError in interface IConnectionStateListener

onLogin

public void onLogin()
Description copied from interface: IConnectionStateListener
Is called when connection enters "Login" state.

Specified by:
onLogin in interface IConnectionStateListener

onRedirect

public void onRedirect(OTHost arg0)
Description copied from interface: IConnectionStateListener
Is called when connection enters "Redirect" state.

Specified by:
onRedirect in interface IConnectionStateListener
Parameters:
arg0 - redirect address.


Copyright © 2007 Mike Kroutikov. All Rights Reserved.