com.levigo.jadice.printer.event
Class PrintErrorBroadcaster

java.lang.Object
  extended by com.levigo.jadice.printer.event.PrintErrorBroadcaster

public final class PrintErrorBroadcaster
extends Object

This class forwards print errors of all jadice print processes to registered print error handlers.

Customized realizations of PrintErrorHandler should be attached to this broadcaster to retrieve informations about occurred PrinterException of running printer jobs processed by jadice printing API.

The print error monitoring may be invoked on the thread processing the print job, or a service created notification thread. In either case developers are strongly encouraged not perform time consuming processes in the callback method of the attached print error handlers.

See also
PrinterException,
PrintErrorHandler.


Method Summary
static void addPrintErrorHandler(PrintErrorHandler handler)
          Add the given PrintErrorHandler to the registered print error handlers.
static void firePrinterError(PrinterException printerException, AbstractPrinter printer, PrinterJob job)
          Forwards the print event to all registered error handlers.
static int getPrintErrorHandlerCount()
          Returns the total number of registered print error handlers
static List<PrintErrorHandler> getPrintErrorHandlers()
          Returns a snapshot copy as list of all registered print error handlers.
static void removeErrorHandler(PrintErrorHandler handler)
          Removes given PrintErrorHandler from its list of registered print error handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addPrintErrorHandler

public static void addPrintErrorHandler(PrintErrorHandler handler)
Add the given PrintErrorHandler to the registered print error handlers.
If given handler is null or is not already registered nothing will happen.

Parameters:
handler - the print error handler to add

getPrintErrorHandlerCount

public static int getPrintErrorHandlerCount()
Returns the total number of registered print error handlers

Returns:
number of registered handlers

getPrintErrorHandlers

public static List<PrintErrorHandler> getPrintErrorHandlers()
Returns a snapshot copy as list of all registered print error handlers.

Returns:
a copy all registered print error handlers

removeErrorHandler

public static void removeErrorHandler(PrintErrorHandler handler)
Removes given PrintErrorHandler from its list of registered print error handlers.
If given handler is null or is not registered to this class nothing will happen.

Parameters:
handler - the print error handler to remove

firePrinterError

public static void firePrinterError(PrinterException printerException,
                                    AbstractPrinter printer,
                                    PrinterJob job)
Forwards the print event to all registered error handlers.

Parameters:
printerException -
printer -
job -


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.