Class OutputRequest

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
de.gmxhome.conrad.jpos.jpos_base.posprinter.OutputRequest
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
CutPaper, DrawRuledLine, MarkFeed, OutputPrintRequest, PageModePrint, PrintBarCode, PrintBitmap, PrintMemoryBitmap, RotatePrint, TransactionPrint

public class OutputRequest extends JposOutputRequest
Output request class for printers.
  • Constructor Details

    • OutputRequest

      public OutputRequest(JposCommonProperties props)
      Constructor. Stores given parameters for later use.
      Parameters:
      props - Property set of device service.
  • Method Details

    • createErrorEvent

      public JposErrorEvent createErrorEvent(jpos.JposException ex)
      Description copied from class: JposOutputRequest
      Factory for error events generated from JposExceptions. Must be overwritten whenever a device specific error event shall be created. For example, in case of cash printer methods, this method should return a POSPrinterErrorEvent (which is an object derived from JposErrorEvent) that contains additional values to be stored in printer properties before the event will be fired.
      If a device supports result code properties instead of error events, this method must return null. The result codes should be buffered for a later call of the createIdleEvent method which must create a device specific StatusUpdateEvent which contains the buffered values.
      If null will be returned instead of a JposErrorEvent, it will enforce special request handling instead:
      • Instead of suspending the request, it will be finished.
      • The idle flag will be set.
      Devices handling asynchronous requests this way, must not buffer more than one request at once. They must end with throwing a StatusUpdateEvent with a specific end-of-request status value instead. This event must be returned by the createIdleEvent method of a device specific class derived from JposOutputRequest.
      Overrides:
      createErrorEvent in class JposOutputRequest
      Parameters:
      ex - JposException which is the originator of an error event.
      Returns:
      The resulting error event.
    • createIdleEvent

      public JposStatusUpdateEvent createIdleEvent()
      Description copied from class: JposOutputRequest
      Factory for status update event with FlagWhenIdle status value. Must be overwritten whenever a device specific status update event shall be created.
      If the createErrorEvent method has been overwritten with a method that returns an error event with source = null to enforce special error handling via result properties instead of error events, createIdleEvent must be overwritten as well.
      Overrides:
      createIdleEvent in class JposOutputRequest
      Returns:
      The resulting status update event.