Class PluginWorkUnit
java.lang.Object
chemaxon.marvin.plugin.concurrent.PluginWorkUnit
- All Implemented Interfaces:
chemaxon.util.concurrent.WorkUnit
,Callable
- Direct Known Subclasses:
DefaultPluginWorkUnit
,ReusablePluginWorkUnit
@PublicApi
public abstract class PluginWorkUnit
extends Object
implements chemaxon.util.concurrent.WorkUnit
Work unit performing plugin calculation.
The input is the input molecule.
- Since:
- Marvin 5.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected CalculatorPlugin
The plugin object.protected Molecule
The target molecule. -
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor.protected
PluginWorkUnit
(CalculatorPlugin plugin) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncall()
Performs the calculation and returns the result returned bygetResult()
.protected String
Returns the table header.abstract Object
Returns the calculation result after the plugin has beenCalculatorPlugin.run()
.Returns a wrapper exception to be returned.void
Sets the input molecule.void
setPlugin
(CalculatorPlugin plugin) Sets the plugin object.
-
Field Details
-
plugin
The plugin object. -
target
The target molecule.
-
-
Constructor Details
-
PluginWorkUnit
protected PluginWorkUnit()Constructor. The plugin should be set bysetPlugin(chemaxon.marvin.plugin.CalculatorPlugin)
. -
PluginWorkUnit
Constructor. Sets the plugin object.- Parameters:
plugin
- the plugin object
-
-
Method Details
-
setPlugin
Sets the plugin object.- Parameters:
plugin
- the plugin object
-
setInput
Sets the input molecule.- Specified by:
setInput
in interfacechemaxon.util.concurrent.WorkUnit
- Parameters:
obj
- the input molecule- Throws:
ExecutionException
-
call
Performs the calculation and returns the result returned bygetResult()
. -
getHeader
Returns the table header.- Returns:
- the table header
-
getWrapperException
Returns a wrapper exception to be returned.- Parameters:
e
- the base exception- Returns:
- the wrapper exception
-
getResult
Returns the calculation result after the plugin has beenCalculatorPlugin.run()
. Subclasses should override this to return a specific calculation result.- Returns:
- the calculation result
- Throws:
Exception
-