Class ReusablePluginWorkUnit
- java.lang.Object
-
- chemaxon.marvin.plugin.concurrent.PluginWorkUnit
-
- chemaxon.marvin.plugin.concurrent.ReusablePluginWorkUnit
-
- All Implemented Interfaces:
chemaxon.util.concurrent.WorkUnit
,Callable
@PublicAPI public class ReusablePluginWorkUnit extends PluginWorkUnit
Work unit performing plugin calculation. The input is a {plugin object, input molecule} array, the plugin is supposed to be coming from aReusableInputProducer
and returned bygetResult()
. The calculation result should be fetched from the plugin later in the application and returned to the input producer by callingReusableInputProducer.reuse(java.lang.Object)
. You can use aCompositeInputProducer
composed of aReusableInputProducer
and aMolInputProducer
to provide the input for this work unit.- Since:
- Marvin 5.0
- See Also:
MolInputProducer
,ReusableInputProducer
,CompositeInputProducer
-
-
Field Summary
-
Fields inherited from class chemaxon.marvin.plugin.concurrent.PluginWorkUnit
plugin, target
-
-
Constructor Summary
Constructors Constructor Description ReusablePluginWorkUnit()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
call()
Performs the calculation and returns the result returned bygetResult()
.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.-
Methods inherited from class chemaxon.marvin.plugin.concurrent.PluginWorkUnit
getHeader, setPlugin
-
-
-
-
Method Detail
-
setInput
public void setInput(Object obj) throws ExecutionException
Sets the plugin object and the input molecule.- Specified by:
setInput
in interfacechemaxon.util.concurrent.WorkUnit
- Overrides:
setInput
in classPluginWorkUnit
- Parameters:
obj
- a {plugin object, input molecule} object array- Throws:
ExecutionException
-
call
public Object call() throws Exception
Performs the calculation and returns the result returned bygetResult()
.- Specified by:
call
in interfaceCallable
- Overrides:
call
in classPluginWorkUnit
- Returns:
- the calculation result or exception object on error
- Throws:
Exception
-
getResult
public Object getResult() throws Exception
Returns the plugin object itself. The calculation result should be fetched from the plugin later in the application and returned to the input producer by callingReusableInputProducer.reuse(java.lang.Object)
.- Specified by:
getResult
in classPluginWorkUnit
- Returns:
- the plugin object
- Throws:
Exception
-
getWrapperException
public Exception getWrapperException(Exception e)
Returns a wrapper exception to be returned.- Overrides:
getWrapperException
in classPluginWorkUnit
- Parameters:
e
- the base exception- Returns:
- the wrapper exception
-
-