FileDocCategorySizeDatePackage
ThreadedLogger.javaAPI DocExample1441Thu Nov 08 00:22:34 GMT 2001com.ora.rmibook.chapter12.bank

ThreadedLogger

public class ThreadedLogger extends Object implements Logger

Fields Summary
private SimpleLogger
_actualLogger
private ArrayList
_logQueue
Constructors Summary
public ThreadedLogger(SimpleLogger actualLogger)

        _logQueue = new ArrayList();
        (new BackgroundThread()).start();
    
Methods Summary
private synchronized java.util.CollectiongetAndReplaceQueue()

        ArrayList returnValue = _logQueue;

        _logQueue = new ArrayList();
        return returnValue;
    
public synchronized voidlogString(java.lang.String string)

        _logQueue.add(string);
    
public voidsetOutputStream(java.io.PrintStream outputStream)

        _actualLogger.setOutputStream(outputStream);