com.antelmann.util.logging
Class LogNetPropagator
java.lang.Object
com.antelmann.util.logging.AbstractLogWriter<byte[]>
com.antelmann.util.logging.LogNetPropagator
- All Implemented Interfaces:
- NetConnectionHandler, Filter<LogEntry>, LogWriter
public class LogNetPropagator
- extends AbstractLogWriter<byte[]>
- implements NetConnectionHandler
can be registered to listen logging events and then propagates them as serialized
byte arrays over its NetConnectionServer.
- Author:
- Holger Antelmann
- See Also:
LogNetReceiver,
NetConnectionServer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
handshake
public static final SimpleHandshake handshake
LogNetPropagator
public LogNetPropagator(int port)
throws IOException
- Throws:
IOException
LogNetPropagator
public LogNetPropagator(int port,
Logger logger)
throws IOException
- the server is not started through the constructor
- Throws:
IOException- See Also:
getServer()
writeLogPattern
public void writeLogPattern(byte[] msg)
- Description copied from class:
AbstractLogWriter
- writes the pattern to the log entity.
If the LogEntryFormatter is null, the pattern is the LogEntry object
itself; otherwise, the pattern is the result of formatting the LogEntry
with the given LogEntryFormatter.
- Specified by:
writeLogPattern in class AbstractLogWriter<byte[]>
getServer
public NetConnectionServer getServer()
connectionLost
public void connectionLost(NetConnection con)
- simply removes inactive connections from its server's list
- Specified by:
connectionLost in interface NetConnectionHandler
handleMessage
public void handleMessage(Object msg,
NetConnection con)
- simply responds with a 'message received' object to enable connection verification
and closes the connection on IOException
- 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