Holger's
Java API

com.antelmann.util.logging
Class SocketLogListener

java.lang.Object
  extended by com.antelmann.util.logging.SocketLogListener
All Implemented Interfaces:
NetConnectionHandler

public class SocketLogListener
extends Object
implements NetConnectionHandler

used to listen to LogEntry objects send through a NetConnection. The NetConnectionServer must be started before use.

Author:
Holger Antelmann

Constructor Summary
SocketLogListener(int port, Logger logger)
           
SocketLogListener(int port, Logger logger, boolean logInternals)
           
 
Method Summary
 void connectionLost(NetConnection con)
          called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point.
 Logger getLogger()
           
 NetConnectionServer getNetConnectionServer()
           
 void handleMessage(Object message, NetConnection con)
          called when a message is received by the given NetConnection object
 boolean isLoggingInternals()
          if true, all connection related internal messages are logged as well
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketLogListener

public SocketLogListener(int port,
                         Logger logger)
                  throws IOException
Throws:
IOException

SocketLogListener

public SocketLogListener(int port,
                         Logger logger,
                         boolean logInternals)
                  throws IOException
Parameters:
logInternals - if true, all connection related internal messages are logged as well
Throws:
IOException
Method Detail

isLoggingInternals

public boolean isLoggingInternals()
if true, all connection related internal messages are logged as well


getNetConnectionServer

public NetConnectionServer getNetConnectionServer()

getLogger

public Logger getLogger()

start

public void start()

stop

public void stop()

connectionLost

public void connectionLost(NetConnection con)
Description copied from interface: NetConnectionHandler
called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point.
Usually, it is a good idea to close the connection here explicitly.

Specified by:
connectionLost in interface NetConnectionHandler

handleMessage

public void handleMessage(Object message,
                          NetConnection con)
Description copied from interface: NetConnectionHandler
called when a message is received by the given NetConnection object

Specified by:
handleMessage in interface NetConnectionHandler


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads