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

The class PepperMapperControllerImpl is a communicator class between a PepperModule and a PepperMapper object. More...

Inherits Thread, and org.corpus_tools.pepper.modules.PepperMapperController.

Public Member Functions

 PepperMapperControllerImpl (ThreadGroup threadGroup, String threadName)
 Initializes this object and sets its ThreadGroup and the name of the thread. More...
 
void setPepperMapper (PepperMapper pepperMapper)
 Sets the mapper, controlled by this object. More...
 
PepperMapper getPepperMapper ()
 Returns the PepperMapper, controlled by this object. More...
 
List< MappingSubjectgetMappingSubjects ()
 Returns a list of all subjects (SDocument or SCorpus) to be merged. More...
 
DOCUMENT_STATUS getMappingResult ()
 {@inheritDoc PepperMapperController::getMappingResult()}
 
Identifier getIdentifier ()
 {@inheritDoc PepperMapperController::getIdentifier()}
 
void setIdentifier (Identifier sElementId)
 {@inheritDoc PepperMapperController::setIdentifier(Identifier)}
 
Double getProgress ()
 {@inheritDoc PepperMapperController::getProgress()}
 
void run ()
 This method starts the PepperMapper object in a thread. More...
 
void map ()
 {@inheritDoc PepperMapper::map()}
 
void setPepperModule (PepperModule pepperModule)
 {@inheritDoc PepperMapperController::setPepperModule(PepperModule)}
 
PepperModule getPepperModule ()
 Returns PepperModule object containing this object. More...
 
boolean getPermissionForProcessDoument (DocumentController controller)
 {@inheritDoc PepperJobImpl::getPermissionForProcessDoument(DocumentController)}
 
- Public Member Functions inherited from org.corpus_tools.pepper.modules.PepperMapperController
void join () throws InterruptedException
 Thread#join() Waits for this thread to die. More...
 
void start ()
 Calls method map. More...
 
void setUncaughtExceptionHandler (Thread.UncaughtExceptionHandler eh)
 Calls method map. More...
 

Public Attributes

Logger logger = LoggerFactory.getLogger("Pepper")
 

Protected Attributes

volatile Double progress = 0d
 when getPepperMapper() is set to null, in map(), the progress value has to be stored here.
 
PepperModule pepperModule = null
 PepperModule containing this object
 

Detailed Description

The class PepperMapperControllerImpl is a communicator class between a PepperModule and a PepperMapper object.

The aim of this class is to provide some fields, which can be set by the PepperMapper and be read by the PepperModule object. The PepperModule object should not contain any static or object references to the PepperMapper object. This mechanism is used, to make sure that in case of a forgotten clean up, the PepperMapper object can be removed by the java garbage collector and does not overfill the main memory.

Author
Florian Zipser

Constructor & Destructor Documentation

◆ PepperMapperControllerImpl()

org.corpus_tools.pepper.impl.PepperMapperControllerImpl.PepperMapperControllerImpl ( ThreadGroup  threadGroup,
String  threadName 
)

Initializes this object and sets its ThreadGroup and the name of the thread.

Parameters
threadGroup
threadName

Member Function Documentation

◆ getMappingSubjects()

List<MappingSubject> org.corpus_tools.pepper.impl.PepperMapperControllerImpl.getMappingSubjects ( )

Returns a list of all subjects (SDocument or SCorpus) to be merged.

Returns
a list of MappingSubject

Implements org.corpus_tools.pepper.modules.PepperMapperController.

◆ getPepperMapper()

PepperMapper org.corpus_tools.pepper.impl.PepperMapperControllerImpl.getPepperMapper ( )

Returns the PepperMapper, controlled by this object.

Returns

Implements org.corpus_tools.pepper.modules.PepperMapperController.

◆ getPepperModule()

PepperModule org.corpus_tools.pepper.impl.PepperMapperControllerImpl.getPepperModule ( )

Returns PepperModule object containing this object.

Returns

◆ run()

void org.corpus_tools.pepper.impl.PepperMapperControllerImpl.run ( )

This method starts the PepperMapper object in a thread.

If getCorpus() is not null, mapSCorpus() is called, if getDocument() is not null, mapSDocument() is called.
If an exception occurs in this method, it will be caught by PepperManipulatorImpl#uncaughtException(Thread, Throwable).

◆ setPepperMapper()

void org.corpus_tools.pepper.impl.PepperMapperControllerImpl.setPepperMapper ( PepperMapper  pepperMapper)

Sets the mapper, controlled by this object.

Parameters
pepperMapper

Implements org.corpus_tools.pepper.modules.PepperMapperController.