org.productivity.java.syslog4j.impl.net.tcp
Class TCPNetSyslogWriter
java.lang.Object
org.productivity.java.syslog4j.impl.AbstractSyslogWriter
org.productivity.java.syslog4j.impl.net.tcp.TCPNetSyslogWriter
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Runnable
- Direct Known Subclasses:
- SSLTCPNetSyslogWriter
public class TCPNetSyslogWriter
- extends AbstractSyslogWriter
TCPNetSyslogWriter is an implementation of Runnable that supports sending
TCP-based messages within a separate Thread.
When used in "threaded" mode (see TCPNetSyslogConfig for the option),
a queuing mechanism is used (via LinkedList).
Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy
of the LGPL license is available in the META-INF folder in all
distributions of Syslog4j and in the base directory of the "doc" ZIP.
- Version:
- $Id: TCPNetSyslogWriter.java,v 1.20 2010/11/28 01:38:08 cvs Exp $
- Author:
- <syslog4j@productivity.org>
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tcpNetSyslog
protected TCPNetSyslog tcpNetSyslog
socket
protected java.net.Socket socket
tcpNetSyslogConfig
protected TCPNetSyslogConfigIF tcpNetSyslogConfig
lastSocketCreationTimeMs
protected long lastSocketCreationTimeMs
TCPNetSyslogWriter
public TCPNetSyslogWriter()
initialize
public void initialize(AbstractSyslog abstractSyslog)
- Overrides:
initialize
in class AbstractSyslogWriter
obtainSocketFactory
protected javax.net.SocketFactory obtainSocketFactory()
createSocket
protected java.net.Socket createSocket(java.net.InetAddress hostAddress,
int port,
boolean keepalive)
throws java.io.IOException
- Throws:
java.io.IOException
getSocket
protected java.net.Socket getSocket()
throws SyslogRuntimeException
- Throws:
SyslogRuntimeException
closeSocket
protected void closeSocket(java.net.Socket socketToClose)
write
public void write(byte[] message)
throws SyslogRuntimeException
- Specified by:
write
in class AbstractSyslogWriter
- Throws:
SyslogRuntimeException
flush
public void flush()
throws SyslogRuntimeException
- Specified by:
flush
in class AbstractSyslogWriter
- Throws:
SyslogRuntimeException
shutdown
public void shutdown()
throws SyslogRuntimeException
- Specified by:
shutdown
in class AbstractSyslogWriter
- Throws:
SyslogRuntimeException
runCompleted
protected void runCompleted()
- Specified by:
runCompleted
in class AbstractSyslogWriter