Class ReusablePluginWorkUnit
java.lang.Object
chemaxon.marvin.plugin.concurrent.PluginWorkUnit
chemaxon.marvin.plugin.concurrent.ReusablePluginWorkUnit
- All Implemented Interfaces:
chemaxon.util.concurrent.WorkUnit
,Callable
Work unit performing plugin calculation.
The input is a {plugin object, input molecule} array,
the plugin is supposed to be coming from a
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.- Since:
- Marvin 5.0
- See Also:
-
MolInputProducer
ReusableInputProducer
CompositeInputProducer
-
Field Summary
Fields inherited from class chemaxon.marvin.plugin.concurrent.PluginWorkUnit
plugin, target
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncall()
Performs the calculation and returns the result returned bygetResult()
.Returns the plugin object itself.Returns a wrapper exception to be returned.void
Sets the plugin object and the input molecule.Methods inherited from class chemaxon.marvin.plugin.concurrent.PluginWorkUnit
getHeader, setPlugin
-
Constructor Details
-
ReusablePluginWorkUnit
public ReusablePluginWorkUnit()Constructor.
-
-
Method Details
-
setInput
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
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
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
Returns a wrapper exception to be returned.- Overrides:
getWrapperException
in classPluginWorkUnit
- Parameters:
e
- the base exception- Returns:
- the wrapper exception
-