org.productivity.java.syslog4j.impl
Class AbstractSyslogWriter

java.lang.Object
  extended by org.productivity.java.syslog4j.impl.AbstractSyslogWriter
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable
Direct Known Subclasses:
TCPNetSyslogWriter

public abstract class AbstractSyslogWriter
extends java.lang.Object
implements java.lang.Runnable, java.io.Serializable

AbstractSyslogWriter is an implementation of Runnable that supports sending syslog messages within a separate Thread or an object pool.

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: AbstractSyslogWriter.java,v 1.9 2010/10/25 03:50:25 cvs Exp $
Author:
<syslog4j@productivity.org>
See Also:
Serialized Form

Field Summary
protected  java.util.List queuedMessages
           
protected  boolean shutdown
           
protected  AbstractSyslog syslog
           
protected  AbstractSyslogConfigIF syslogConfig
           
protected  java.lang.Thread thread
           
 
Constructor Summary
AbstractSyslogWriter()
           
 
Method Summary
abstract  void flush()
           
 boolean hasThread()
           
 void initialize(AbstractSyslog abstractSyslog)
           
 void queue(int level, byte[] message)
           
 void run()
           
protected abstract  void runCompleted()
           
 void setThread(java.lang.Thread thread)
           
abstract  void shutdown()
           
abstract  void write(byte[] message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

syslog

protected AbstractSyslog syslog

queuedMessages

protected java.util.List queuedMessages

thread

protected java.lang.Thread thread

syslogConfig

protected AbstractSyslogConfigIF syslogConfig

shutdown

protected boolean shutdown
Constructor Detail

AbstractSyslogWriter

public AbstractSyslogWriter()
Method Detail

initialize

public void initialize(AbstractSyslog abstractSyslog)

queue

public void queue(int level,
                  byte[] message)

setThread

public void setThread(java.lang.Thread thread)

hasThread

public boolean hasThread()

write

public abstract void write(byte[] message)

flush

public abstract void flush()

shutdown

public abstract void shutdown()

runCompleted

protected abstract void runCompleted()

run

public void run()
Specified by:
run in interface java.lang.Runnable