Package org.corpus_tools.pepper.modules
Interface PepperMapperController
-
- All Superinterfaces:
Runnable
- All Known Implementing Classes:
PepperMapperControllerImpl
public interface PepperMapperController extends Runnable
The interfacePepperMapperControlleris a communicator class between aPepperModuleand aPepperMapperobject. The aim of this class is to provide some fields, which can be set by thePepperMapperand be read by thePepperModuleobject. It does not contain any reference to thePepperMapperobject. This mechanism is used, to make sure that in case of a forgotten clean up, thePepperMapperobject can be removed by the java garbage collector and does not overfill the main memory.- Author:
- Florian Zipser
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.corpus_tools.salt.graph.IdentifiergetIdentifier()ReturnsIdentifierobject of theSCorpusorSDocumentobject, which is contained by containingPepperMapper.DOCUMENT_STATUSgetMappingResult()Returns the result of the mapping, when finished.List<MappingSubject>getMappingSubjects()Returns a list of all subjects (SDocumentorSCorpus) to be mergedPepperMappergetPepperMapper()Returns thePepperMapper, controlled by this object.booleangetPermissionForProcessDoument(DocumentController controller){@inheritDoc PepperJobImpl#getPermissionForProcessDoument(DocumentController)}DoublegetProgress()This method is invoked by the containingPepperModuleobject, to get the current progress concerning theSDocumentorSCorpusobject handled by this object.voidjoin()Thread.join()Waits for this thread to die.voidmap()This method starts thePepperMapperobject.voidsetIdentifier(org.corpus_tools.salt.graph.Identifier sElementId)SetIdentifierobject of theSCorpusorSDocumentobject, which is contained by containingPepperMapper.voidsetPepperMapper(PepperMapper pepperMapper)Sets thePepperMapper, controlled by this object.voidsetPepperModule(PepperModule pepperModule)Sets thePepperModuleobject, which contains thePepperMapperControlleras a callback reference.voidsetUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)Calls method map.voidstart()Calls method map.
-
-
-
Method Detail
-
join
void join() throws InterruptedException
Thread.join()Waits for this thread to die. An invocation of this method behaves in exactly the same way as the invocation join(0)- Throws:
InterruptedException- - if any thread has interrupted the current thread. The interrupted status of the current thread is cleared when this exception is thrown.
-
start
void start()
Calls method map. Delegation ofThread.start(). Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread. The result is that two threads are running concurrently: the current thread (which returns from the call to the start method) and the other thread (which executes its run method). It is never legal to start a thread more than once. In particular, a thread may not be restarted once it has completed execution.- Throws:
IllegalThreadStateException- - if the thread was already started.
-
setUncaughtExceptionHandler
void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
Calls method map. Delegation ofThread.start(). {@inheritDoc Thread#setUncaughtExceptionHandler(java.lang.Thread. UncaughtExceptionHandler)}
-
getMappingResult
DOCUMENT_STATUS getMappingResult()
Returns the result of the mapping, when finished.- Returns:
- mapping result
-
getMappingSubjects
List<MappingSubject> getMappingSubjects()
Returns a list of all subjects (SDocumentorSCorpus) to be merged- Returns:
- a list of
MappingSubject
-
getIdentifier
org.corpus_tools.salt.graph.Identifier getIdentifier()
ReturnsIdentifierobject of theSCorpusorSDocumentobject, which is contained by containingPepperMapper.- Returns:
-
setIdentifier
void setIdentifier(org.corpus_tools.salt.graph.Identifier sElementId)
SetIdentifierobject of theSCorpusorSDocumentobject, which is contained by containingPepperMapper.- Parameters:
sElementId-
-
getProgress
Double getProgress()
This method is invoked by the containingPepperModuleobject, to get the current progress concerning theSDocumentorSCorpusobject handled by this object. A valid value return must be between 0 and 1 or null if method thePepperModuledoes not call the method#setProgress(Double).
The call is just delegated toPepperMapper.getProgress()- Parameters:
sDocumentId- identifier of the requestedSDocumentobject.
-
map
void map()
This method starts thePepperMapperobject. If#getCorpus()is not null,#mapSCorpus()is called, if#getDocument()is not null,#mapSDocument()is called.
-
setPepperMapper
void setPepperMapper(PepperMapper pepperMapper)
Sets thePepperMapper, controlled by this object.- Parameters:
pepperMapper-
-
getPepperMapper
PepperMapper getPepperMapper()
Returns thePepperMapper, controlled by this object.- Returns:
-
setPepperModule
void setPepperModule(PepperModule pepperModule)
Sets thePepperModuleobject, which contains thePepperMapperControlleras a callback reference. This is necessary, that thePepperMapperControllercan notify the containing object that its job is done via callingPepperModule.done(PepperMapperController)- Parameters:
pepperModule- containingPepperModuleobject
-
getPermissionForProcessDoument
boolean getPermissionForProcessDoument(DocumentController controller)
{@inheritDoc PepperJobImpl#getPermissionForProcessDoument(DocumentController)}
-
-