public interface MaryModule
The main program calls
startup()
once after module instantiation,process()
many times, from different threads, possibly at the same time, during the lifetime of the servershutdown()
once, at the end of the program.Modifier and Type | Field and Description |
---|---|
static int |
MODULE_OFFLINE |
static int |
MODULE_RUNNING |
Modifier and Type | Method and Description |
---|---|
MaryDataType |
getInputType() |
Locale |
getLocale()
The locale of this module, i.e.
|
MaryDataType |
getOutputType() |
int |
getState()
Inform about the state of this module.
|
MaryDataType |
inputType()
Deprecated.
|
String |
name()
This module's name, as free text, for example "Tokeniser"
|
MaryDataType |
outputType()
Deprecated.
|
void |
powerOnSelfTest()
Perform a power-on self test by processing some example input data.
|
MaryData |
process(MaryData d)
Perform this module's processing on abstract "MaryData" input
d . |
void |
shutdown()
Allow the module to shut down cleanly.
|
void |
startup()
Allow the module to start up, performing whatever is necessary to become operational.
|
static final int MODULE_OFFLINE
static final int MODULE_RUNNING
String name()
@Deprecated MaryDataType inputType()
MaryDataType getInputType()
@Deprecated MaryDataType outputType()
MaryDataType getOutputType()
Locale getLocale()
void startup() throws Exception
Exception
- Exceptionint getState()
void powerOnSelfTest() throws Error
Error
- if the module does not work properly.void shutdown()
MaryData process(MaryData d) throws Exception
d
. Classes implementing this interface need to
make the process()
method thread-safe, because in server-mode, it will be called from different threads at the
same time.
The result is returned encapsulated in a MaryData object of type outputType()
.
This method should never return null
; in case of a failure, an exception should be thrown.
d
- dException
- ExceptionCopyright © 2000–2016 DFKI GmbH. All rights reserved.