Class TerminalDocumentBus


  • public class TerminalDocumentBus
    extends DocumentBus
    TODO make docu
    Author:
    Florian Zipser
    • Field Detail

      • ID_TERMINAL

        protected static final String ID_TERMINAL
        id for the terminal document bus, which is output for exporters
        See Also:
        Constant Field Values
    • Constructor Detail

      • TerminalDocumentBus

        public TerminalDocumentBus​(String inputModuleControllerId)
        Creates an object of this type and sets the passes the given input controller and output controller.
        Parameters:
        inputModuleControllerId - identifier of controller, which produces documents for this bus
      • TerminalDocumentBus

        public TerminalDocumentBus​(List<String> inputModuleControllerIds)
        Creates an object of this type and sets all passed in- and output ModuleControllerImpl objects. This is important, because an DocumentController can only be removed from queue, when all output ModuleControllerImpl objects requested the DocumentController object.
        Parameters:
        inputModuleControllerIds - list of identifier of controller, which produces documents for this bus
    • Method Detail

      • pop

        public DocumentController pop​(String outputControllerId,
                                      boolean ignorePermissionForDocument)
        Description copied from class: DocumentBus
        Returns a DocumentController object, which is on first place of the internal queue (regarding the FIFO principle). When all registered ModuleController objects popped the DocumentController object, it will be removed from internal queue.
        If the document, which is the one to be taken in queue is in sleep mode, it will be woken up, if the PepperJobImpl gives the permission. Otherwise, this method waits for the permission.
        Caution, call this method can take some time, since it waits for two conditions:
        1. a document is waiting in the queue, and the preceding PepperModule has not finished all documents
        2. the Pepper framework (more precisely the PepperJobImpl) gives the permission to wake up the document, if it was in sleep mode
        In contrast to DocumentBus.pop(String), if ignorePermissionForDocument is set to true this method returns a DocumentController object even if the PepperJob permission does not allow to process a further document. This mechanism can be used, if a PepperModule has an own control mechanism of sending SDocuments to sleep.
        Overrides:
        pop in class DocumentBus
        Parameters:
        outputControllerId - object requesting the DocumentController object
        ignorePermissionForDocument - if set, a document will be returned even if the Pepper job gives no permission
        Returns:
        head of the queue.