| | |
| | | */ |
| | | package org.opends.server.loggers; |
| | | |
| | | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.concurrent.LinkedBlockingQueue; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | import org.opends.server.api.ServerShutdownListener; |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | | |
| | | |
| | | /** |
| | | * A Text Writer which writes log records asynchronously to |
| | | * character-based stream. |
| | |
| | | { |
| | | super(name); |
| | | } |
| | | |
| | | /** |
| | | * the run method of the writerThread. Run until queue is empty |
| | | * AND we've been asked to terminate |
| | | */ |
| | | @Override |
| | | public void run() |
| | | { |
| | | ArrayList<String> drainList = new ArrayList<String>(capacity); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Write the log record asyncronously. |
| | | * Write the log record asynchronously. |
| | | * |
| | | * @param record the log record to write. |
| | | */ |
| | | @Override |
| | | public void writeRecord(String record) |
| | | { |
| | | // No writer? Off to the bit bucket. |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void flush() |
| | | { |
| | | writer.flush(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public long getBytesWritten() |
| | | { |
| | | return writer.getBytesWritten(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getShutdownListenerName() |
| | | { |
| | | return "AsynchronousTextWriter Thread " + name; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void processServerShutdown(Message reason) |
| | | { |
| | | // Don't shutdown the wrapped writer on server shutdown as it |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void shutdown() |
| | | { |
| | | shutdown(true); |