Pepper 3.7.0
A highly extensible plattform for conversion and
|
TODO make docu. More...
Inherits org.corpus_tools.pepper.core.DocumentBus.
Public Member Functions | |
TerminalDocumentBus (String inputModuleControllerId) | |
Creates an object of this type and sets the passes the given input controller and output controller. | |
TerminalDocumentBus (List< String > inputModuleControllerIds) | |
Creates an object of this type and sets all passed in- and output ModuleControllerImpl objects. | |
DocumentController | pop (String outputControllerId, boolean ignorePermissionForDocument) |
Returns a DocumentController object, which is on first place of the internal queue (regarding the FIFO principle). | |
DocumentController | pop (String outputControllerId) |
Returns a DocumentController object, which is on first place of the internal queue (regarding the FIFO principle). | |
![]() | |
DocumentBus (String inputModuleControllerId, String outputModuleControllerId) | |
Creates an object of this type and sets the passes the given input controller and output controller. | |
DocumentBus (String inputModuleControllerId, List< String > outputModuleControllerIds) | |
Creates an object of this type and sets the passes the given input controller and output controller. | |
DocumentBus (List< String > inputModuleControllerIds, String outputModuleControllerId) | |
Creates an object of this type and sets the passes the given input controller and output controller. | |
DocumentBus (List< String > inputModuleControllerIds, List< String > outputModuleControllerIds) | |
Creates an object of this type and sets all passed in- and output ModuleController objects. | |
List< String > | getOutputControllerIds () |
Returns a list of Ids belonging to ModuleController objects, which are on the output side of this queue. | |
List< String > | getInputControllerIds () |
Returns a list of Ids belonging to ModuleController objects on the input side. | |
String | getId () |
Creates an id for this object. | |
PepperJobImpl | getPepperJob () |
Returns the PepperJob object containing this object. | |
void | setPepperJob (PepperJobImpl pepperJob) |
Sets the PepperJob object containing this object. | |
Hashtable< String, ConcurrentLinkedQueue< DocumentController > > | getDocumentBus () |
Returns the table, which is the central management object of the DocumentBus . | |
MEMORY_POLICY | getMemPolicy () |
Returns the set memory policy. | |
void | setMemPolicy (MEMORY_POLICY memPolicy) |
Sets the memory policy. | |
void | finish (String inputControllerId) |
Sets the entry corresponding to given id to status finished, which means, that when all listed ModuleController objects on input side, are set to status finish, this queue is finished and no further documents are passed to ModuleController objects on output side. | |
boolean | isFinished () |
Returns true, whether all input ModuleController objects called the finish(String) method and set this object to status finish. | |
void | put (DocumentController documentController) |
Adds the given DocumentController object to the queue. | |
String | toString () |
returns a String representation of this object. | |
Static Protected Attributes | |
static final String | ID_TERMINAL = "terminal" |
id for the terminal document bus, which is output for exporters | |
Additional Inherited Members | |
![]() | |
void | init (List< String > inputModuleControllerIds, List< String > outputModuleControllerIds) |
Creates an object of this type and passes all output ModuleController objects. | |
void | initDocumentBus (List< String > outputModuleControllerIds) |
Initializes the table, which is the central management object of the DocumentBus . | |
![]() | |
List< String > | outputModuleControllerIds = null |
A list of Ids belonging to ModuleController objects, which are on the output side of this queue. | |
List< String > | inputModuleControllerIds = null |
A list of Ids belonging to ModuleController objects on the input side. | |
String | id = null |
Id of this object. | |
volatile Hashtable< String, ConcurrentLinkedQueue< DocumentController > > | documentBus = null |
This table is the central management object of the DocumentBus . | |
volatile MEMORY_POLICY | memPolicy = MEMORY_POLICY.MODERATE |
ReentrantLock | lock = new ReentrantLock(true) |
This lock is used for creating the condition waitUntilAllDocumentsArePut to let the pop(String) method wait until all documents have been put. | |
Condition | waitUntilAllDocumentsArePut = lock.newCondition() |
Used to let the pop(String) method wait until all documents have been put. | |
TODO make docu.
org.corpus_tools.pepper.core.TerminalDocumentBus.TerminalDocumentBus | ( | String | inputModuleControllerId | ) |
Creates an object of this type and sets the passes the given input controller and output controller.
inputModuleControllerId | identifier of controller, which produces documents for this bus |
org.corpus_tools.pepper.core.TerminalDocumentBus.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.
inputModuleControllerIds | list of identifier of controller, which produces documents for this bus |
DocumentController org.corpus_tools.pepper.core.TerminalDocumentBus.pop | ( | String | outputControllerId | ) |
Returns a DocumentController
object, which is on first place of the internal queue (regarding the FIFO principle).
When all registered ModuleControllerImpl
objects popped the DocumentController
object, it will be removed from internal queue.
moduleController | object requesting the DocumentController object |
Reimplemented from org.corpus_tools.pepper.core.DocumentBus.
DocumentController org.corpus_tools.pepper.core.TerminalDocumentBus.pop | ( | String | outputControllerId, |
boolean | ignorePermissionForDocument | ||
) |
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:
PepperModule
has not finished all documents PepperJobImpl
) gives the permission to wake up the document, if it was in sleep mode In contrast to 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 SDocument
s to sleep.
outputControllerId | object requesting the DocumentController object |
ignorePermissionForDocument | if set, a document will be returned even if the Pepper job gives no permission |
Reimplemented from org.corpus_tools.pepper.core.DocumentBus.