public class PepperMapperControllerImpl extends Thread implements PepperMapperController
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.Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
org.slf4j.Logger |
logger |
protected PepperModule |
pepperModule
PepperModule containing this object |
protected Double |
progress
when
getPepperMapper() is set to null, in map(), the
progress value has to be stored here. |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
PepperMapperControllerImpl(ThreadGroup threadGroup,
String threadName)
Initializes this object and sets its
ThreadGroup and the name of
the thread. |
| Modifier and Type | Method and Description |
|---|---|
org.corpus_tools.salt.graph.Identifier |
getIdentifier()
Returns
Identifier object of the SCorpus or
SDocument object, which is contained by containing
PepperMapper. |
DOCUMENT_STATUS |
getMappingResult()
Returns the result of the mapping, when finished.
|
List<MappingSubject> |
getMappingSubjects()
Returns a list of all subjects (
SDocument or SCorpus) to
be merged |
PepperMapper |
getPepperMapper()
Returns the
PepperMapper, controlled by this object. |
PepperModule |
getPepperModule()
Returns
PepperModule object containing this object |
boolean |
getPermissionForProcessDoument(DocumentController controller) |
Double |
getProgress()
This method is invoked by the containing
PepperModule object, to
get the current progress concerning the SDocument or
SCorpus object handled by this object. |
void |
map()
This method starts the
PepperMapper object. |
void |
run()
This method starts the
PepperMapper object in a thread. |
void |
setIdentifier(org.corpus_tools.salt.graph.Identifier sElementId)
Set
Identifier object of the SCorpus or SDocument
object, which is contained by containing PepperMapper. |
void |
setPepperMapper(PepperMapper pepperMapper)
Sets the mapper, controlled by this object.
|
void |
setPepperModule(PepperModule pepperModule)
Sets the
PepperModule object, which contains the
PepperMapperController as a callback reference. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitjoin, setUncaughtExceptionHandler, startpublic org.slf4j.Logger logger
protected volatile Double progress
getPepperMapper() is set to null, in map(), the
progress value has to be stored here.protected PepperModule pepperModule
PepperModule containing this objectpublic PepperMapperControllerImpl(ThreadGroup threadGroup, String threadName)
ThreadGroup and the name of
the thread.threadGroup - threadName - public void setPepperMapper(PepperMapper pepperMapper)
setPepperMapper in interface PepperMapperControllerpepperMapper - public PepperMapper getPepperMapper()
PepperMapper, controlled by this object.getPepperMapper in interface PepperMapperControllerpublic List<MappingSubject> getMappingSubjects()
SDocument or SCorpus) to
be mergedgetMappingSubjects in interface PepperMapperControllerMappingSubjectpublic DOCUMENT_STATUS getMappingResult()
getMappingResult in interface PepperMapperControllerpublic org.corpus_tools.salt.graph.Identifier getIdentifier()
Identifier object of the SCorpus or
SDocument object, which is contained by containing
PepperMapper.getIdentifier in interface PepperMapperControllerpublic void setIdentifier(org.corpus_tools.salt.graph.Identifier sElementId)
Identifier object of the SCorpus or SDocument
object, which is contained by containing PepperMapper.setIdentifier in interface PepperMapperControllerpublic Double getProgress()
PepperModule object, to
get the current progress concerning the SDocument or
SCorpus object handled by this object. A valid value return must
be between 0 and 1 or null if method the PepperModule does not
call the method #setProgress(Double).PepperMapper.getProgress()getProgress in interface PepperMapperControllerpublic void run()
PepperMapper object in a thread. If
#getCorpus() is not null, #mapSCorpus() is called, if
#getDocument() is not null, #mapSDocument() is called.
PepperModuleImpl.uncaughtException(Thread, Throwable).public void map()
PepperMapper object. If
#getCorpus() is not null, #mapSCorpus() is called, if
#getDocument() is not null, #mapSDocument() is called.map in interface PepperMapperControllerpublic void setPepperModule(PepperModule pepperModule)
PepperModule object, which contains the
PepperMapperController as a callback reference. This is
necessary, that the PepperMapperController can notify the
containing object that its job is done via calling
PepperModule.done(PepperMapperController)setPepperModule in interface PepperMapperControllerpepperModule - containing PepperModule objectpublic PepperModule getPepperModule()
PepperModule object containing this objectpublic boolean getPermissionForProcessDoument(DocumentController controller)
getPermissionForProcessDoument in interface PepperMapperControllerCopyright © 2009–2021 Humboldt-Universität zu Berlin, INRIA. All rights reserved.