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
FieldsModifier and TypeFieldDescriptionprotected CalculatorPluginThe plugin object.protected MoleculeThe target molecule. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedPluginWorkUnit(CalculatorPlugin plugin) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncall()Performs the calculation and returns the result returned bygetResult().protected StringReturns the table header.abstract ObjectReturns the calculation result after the plugin has beenCalculatorPlugin.run().Returns a wrapper exception to be returned.voidSets the input molecule.voidsetPlugin(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:
setInputin 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
-