Holger's
Java API

com.antelmann.util.logging
Class LogNetReceiver

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

public class LogNetReceiver
extends Object
implements NetConnectionHandler

can be used to easily listen to a LogNetPropagator; most easily used in conjunction with a MessageDispatcher.

Author:
Holger Antelmann
See Also:
MessageDelegator, LogNetPropagator

Constructor Summary
LogNetReceiver(String server, int port, Logger logger)
           
 
Method Summary
 void connectionLost(NetConnection con)
          connection is closed after logging an entry with Level.END
 SocketConnection getConnection()
           
 void handleMessage(Object msg, NetConnection con)
          if msg is a serialized LogEntry, it will be logged to the logger; everything except a serialized LogEntry is ignored (including exceptions).
 boolean isEnabled()
           
 void setEnabled(boolean flag)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogNetReceiver

public LogNetReceiver(String server,
                      int port,
                      Logger logger)
               throws IOException
Throws:
IOException
Method Detail

getConnection

public SocketConnection getConnection()

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean flag)

connectionLost

public void connectionLost(NetConnection con)
connection is closed after logging an entry with Level.END

Specified by:
connectionLost in interface NetConnectionHandler

handleMessage

public void handleMessage(Object msg,
                          NetConnection con)
if msg is a serialized LogEntry, it will be logged to the logger; everything except a serialized LogEntry is ignored (including exceptions).

Specified by:
handleMessage in interface NetConnectionHandler


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