FileDocCategorySizeDatePackage
NullPrinter.javaAPI DocExample1588Thu Nov 08 00:23:46 GMT 2001com.ora.rmibook.chapter4.printers

NullPrinter

public class NullPrinter extends UnicastRemoteObject implements Printer

Fields Summary
private PrintWriter
_log
Constructors Summary
public NullPrinter(OutputStream log)

        _log = new PrintWriter(log);
    
Methods Summary
public booleanprintDocument(DocumentDescription documentDescription)

        if (null == _log) {
            throw new NoLogException();
        }
        if (null == documentDescription) {
            throw new NoDocumentException();
        }
        _log.println("Printed file");
        _log.flush();
        if (_log.checkError()) {
            throw new CantWriteToLogException();
        }
        return true;
    
public booleanprinterAvailable()

        return true;