Pepper  3.6.0
A highly extensible plattform for conversion and manipulationoflinguisticdata.
org.corpus_tools.pepper.core.ModuleControllerImpl Class Reference

An object of this types contains a PepperModule and handles as a connector between such an object and the Pepper framework. More...

Inherits org.corpus_tools.pepper.modules.ModuleController.

Public Member Functions

 ModuleControllerImpl (String id)
 Creates an instance of ModuleControllerImpl. More...
 
String getId ()
 Returns the id of this object.
Returns
the stable id

 
PepperModule getPepperModule ()
 Returns the PepperModule object, this controller object is observing.
Returns
observed object

 
void setPepperModule (PepperModule newPepperModule)
 Sets the PepperModule object, this controller object is observing. More...
 
void setPepperModule_basic (PepperModule newPepperModule)
 Sets the PepperModule object, this controller object is observing. More...
 
PepperJobImpl getJob ()
 Returns the PepperJobImpl object reference of this object.
Returns
containing PepperJobImpl object

 
void setJob (PepperJobImpl job)
 Sets the PepperJobImpl object reference of this object.And notifies the reverse method PepperJobImpl, to set the ModuleControllerImpl object to this.
Parameters
jobnew PepperJobImpl object

 
void setJob_basic (PepperJobImpl job)
 Sets the PepperJobImpl object reference of this object.
Parameters
jobnew PepperJobImpl object

 
DocumentBus getInputDocumentBus ()
 The DocumentBus object working as input for this ModuleControllerImpl.All documents on bus will be processed and set to outputDocumentBus
Returns
bus which is input bus

 
void setInputDocumentBus (DocumentBus inputDocumentBus)
 The DocumentBus object working as input for this ModuleControllerImpl.All documents on bus will be processed and set to outputDocumentBus
Parameters
inputDocumentBusbus to be used as input bus

 
DocumentBus getOutputDocumentBus ()
 All documents which were consumed by the PepperModule contained in this object are set to this output bus, regarding the status, the PepperModule returned.
Returns
bus, which is output bus

 
void setOutputDocumentBus (DocumentBus outputDocumentBus)
 All documents which were consumed by the PepperModule contained in this object are set to this output bus, regarding the status, the PepperModule returned.
Parameters
outputDocumentBusbus to be used as input bus

 
SCorpusGraph getCorpusGraph ()
 Returns the SCorpusGraph object, the contained PepperImporter is mapping.This method will only return a non empty object, if the contained PepperModule is an PepperImporter and if importCorpusStructure(SCorpusGraph) was called.
Returns

 
synchronized Future<?> importCorpusStructure (SCorpusGraph sCorpusGraph)
 Starts the import of corpus structure via the set PepperImporter object by calling PepperImporter#importCorpusStructure(SCorpusGraph).The import runs in a separate thread, which is set as child of current thread. Therefore, don::t forget to call method, this method keeps the focus until, the import of the corpus structure has ended. This enables the calling object to wait until the corpus structure was imported. This method can only be invoked once per time.
Parameters
sCorpusGrapha SCorpusGraph object, in which the PepperImporter shall import the corpus structure.

 
synchronized Future<?> processDocumentStructures ()
 Starts the import of document-structure. More...
 
DocumentController next (boolean ignorePermissionForDocument)
 {@inheritDoc ModuleController::next(boolean)}
 
DocumentController next ()
 Returns the next DocumentController waiting in the input document bus to be processed by the contained PepperModule.
Returns
next document controller

 
void complete (DocumentController documentController)
 Adds the given DocumentController to the output document bus to be processed by the next PepperModule objects.
Parameters
documentControllerto be passed to next Pepper module

 
void delete (DocumentController documentController)
 Notifies the Pepper framework, that the SDocument being contained in passed DocumentController shall not be processed any further by following Pepper modules.
Parameters
sElementIdthe id corresponding to the SDocument object, which shall be not further processed

 
Double getProgress (String globalId)
 Returns the progress as a value between 0 and 1 of the contained PepperModule object concerning to the SDocument corresponding to the passed global identifier.
Parameters
globalIdglobal id for SDocument, note, that this is not the SElementId
Returns
progress of process

 
String toString ()
 Returns a String representation of this object. More...
 

Protected Member Functions

ExecutorService getExecutor ()
 Returns an executor service for this object. More...
 
ReentrantLock getBusyLock ()
 A lock determining, whether this object currently is busy with importing corpus structure or importing document structure. More...
 

Protected Attributes

String id = null
 id of this object
 
PepperModule pepperModule
 The PepperModule object, this controller object is observing.
 
volatile SCorpusGraph sCorpusGraph = null
 The SCorpusGraph object to be filled.
 
ExecutorService executor = null
 Executor, to create and manage threads for import of corpus structure and import of document structure.
 
ReentrantLock busyLock = null
 A lock determining, whether this object currently is busy with importing corpus structure or importing document structure.
 

Detailed Description

An object of this types contains a PepperModule and handles as a connector between such an object and the Pepper framework.

Author
Florian Zipser

Constructor & Destructor Documentation

◆ ModuleControllerImpl()

org.corpus_tools.pepper.core.ModuleControllerImpl.ModuleControllerImpl ( String  id)

Creates an instance of ModuleControllerImpl.

Sets the internal id to the passed one. Note: the id is unchangeable.

Parameters
ididentifier of this object. Id can neither be null nor empty.

Member Function Documentation

◆ getBusyLock()

ReentrantLock org.corpus_tools.pepper.core.ModuleControllerImpl.getBusyLock ( )
protected

A lock determining, whether this object currently is busy with importing corpus structure or importing document structure.

Returns

◆ getExecutor()

ExecutorService org.corpus_tools.pepper.core.ModuleControllerImpl.getExecutor ( )
protected

Returns an executor service for this object.

Executor, to create and manage threads for import of corpus structure and import of document structure.

Returns

◆ processDocumentStructures()

synchronized Future<?> org.corpus_tools.pepper.core.ModuleControllerImpl.processDocumentStructures ( )

Starts the import of document-structure.

When calling this method, the ModuleControllerImpl object will request all DocumentController object waiting in the incoming DocumentBus.

◆ setPepperModule()

void org.corpus_tools.pepper.core.ModuleControllerImpl.setPepperModule ( PepperModule  newPepperModule)

Sets the PepperModule object, this controller object is observing.

Also sets the inverse method PepperModule#setPepperModuleController_basic(ModuleControllerImpl)

Parameters
newPepperModulenew object to observe

Implements org.corpus_tools.pepper.modules.ModuleController.

◆ setPepperModule_basic()

void org.corpus_tools.pepper.core.ModuleControllerImpl.setPepperModule_basic ( PepperModule  newPepperModule)

Sets the PepperModule object, this controller object is observing.

Parameters
newPepperModulenew object to observe

Implements org.corpus_tools.pepper.modules.ModuleController.

◆ toString()

String org.corpus_tools.pepper.core.ModuleControllerImpl.toString ( )

Returns a String representation of this object.

Returns
a String representation of this object.