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 Details

  • Constructor Details

  • Method Details

    • setPlugin

      public void setPlugin(CalculatorPlugin plugin)
      Sets the plugin object.
      Parameters:
      plugin - the plugin object
    • setInput

      public void setInput(Object obj) throws ExecutionException
      Sets the input molecule.
      Specified by:
      setInput in interface chemaxon.util.concurrent.WorkUnit
      Parameters:
      obj - the input molecule
      Throws:
      ExecutionException
    • call

      public Object call() throws Exception
      Performs the calculation and returns the result returned by getResult().
      Specified by:
      call in interface Callable
      Returns:
      the calculation result
      Throws:
      Exception
    • getHeader

      protected String getHeader()
      Returns the table header.
      Returns:
      the table header
    • getWrapperException

      public Exception getWrapperException(Exception e)
      Returns a wrapper exception to be returned.
      Parameters:
      e - the base exception
      Returns:
      the wrapper exception
    • getResult

      public abstract Object getResult() throws Exception
      Returns the calculation result after the plugin has been CalculatorPlugin.run(). Subclasses should override this to return a specific calculation result.
      Returns:
      the calculation result
      Throws:
      Exception