@PublicAPI 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 |
---|---|
java.lang.Object |
call()
Performs the calculation and returns the result
returned by
getResult() . |
java.lang.Object |
getResult()
Returns the plugin object itself.
|
java.lang.Exception |
getWrapperException(java.lang.Exception e)
Returns a wrapper exception to be returned.
|
void |
setInput(java.lang.Object obj)
Sets the plugin object and the input molecule.
|
getHeader, setPlugin
public void setInput(java.lang.Object obj) throws java.util.concurrent.ExecutionException
setInput
in interface WorkUnit
setInput
in class PluginWorkUnit
obj
- a {plugin object, input molecule} object arrayjava.util.concurrent.ExecutionException
public java.lang.Object call() throws java.lang.Exception
getResult()
.call
in interface java.util.concurrent.Callable
call
in class PluginWorkUnit
java.lang.Exception
public java.lang.Object getResult() throws java.lang.Exception
ReusableInputProducer.reuse(java.lang.Object)
.getResult
in class PluginWorkUnit
java.lang.Exception
public java.lang.Exception getWrapperException(java.lang.Exception e)
getWrapperException
in class PluginWorkUnit
e
- the base exception