public class ReusablePluginWorkUnit extends PluginWorkUnit
ReusableInputProducer
and returned by getResult()
.
The calculation result should be fetched from the plugin later in the application
and returned to the input producer by calling
ReusableInputProducer.reuse(java.lang.Object)
.
You can use a CompositeInputProducer
composed of a
ReusableInputProducer
and a
MolInputProducer
to provide the input for this work unit.MolInputProducer
,
ReusableInputProducer
,
CompositeInputProducer
plugin, target
Constructor and Description |
---|
ReusablePluginWorkUnit()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Object |
call()
Performs the calculation and returns the result
returned by
getResult() . |
Object |
getResult()
Returns the plugin object itself.
|
Exception |
getWrapperException(Exception e)
Returns a wrapper exception to be returned.
|
void |
setInput(Object obj)
Sets the plugin object and the input molecule.
|
getHeader, setPlugin
public void setInput(Object obj) throws ExecutionException
setInput
in interface WorkUnit
setInput
in class PluginWorkUnit
obj
- a {plugin object, input molecule} object arrayExecutionException
public Object call() throws Exception
getResult()
.call
in interface Callable
call
in class PluginWorkUnit
Exception
public Object getResult() throws Exception
ReusableInputProducer.reuse(java.lang.Object)
.getResult
in class PluginWorkUnit
Exception
public Exception getWrapperException(Exception e)
getWrapperException
in class PluginWorkUnit
e
- the base exception