Class 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 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
    • Constructor Detail

      • ReusablePluginWorkUnit

        public ReusablePluginWorkUnit()
        Constructor.
    • Method Detail

      • setInput

        public void setInput​(Object obj)
                      throws ExecutionException
        Sets the plugin object and the input molecule.
        Specified by:
        setInput in interface chemaxon.util.concurrent.WorkUnit
        Overrides:
        setInput in class PluginWorkUnit
        Parameters:
        obj - a {plugin object, input molecule} object array
        Throws:
        ExecutionException
      • 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 calling ReusableInputProducer.reuse(java.lang.Object).
        Specified by:
        getResult in class PluginWorkUnit
        Returns:
        the plugin object
        Throws:
        Exception