Class Executor

java.lang.Object
org.pipservices3.commons.run.Executor

public class Executor extends Object
Helper class that executes components.
See Also:
  • Constructor Details

    • Executor

      public Executor()
  • Method Details

    • executeOne

      public static Object executeOne(String correlationId, Object component, Parameters args) throws ApplicationException
      Executes specific component.

      To be executed components must implement IExecutable interface. If they don't the call to this method has no effect.

      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      component - the component that is to be executed.
      args - execution arguments.
      Returns:
      execution result.
      Throws:
      ApplicationException - when errors occured.
      See Also:
    • execute

      public static List<Object> execute(String correlationId, Iterable<Object> components, Parameters args) throws ApplicationException
      Executes multiple components.

      To be executed components must implement IExecutable interface. If they don't the call to this method has no effect.

      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      components - a list of components that are to be executed.
      args - execution arguments.
      Returns:
      execution result.
      Throws:
      ApplicationException - when errors occured.
      See Also: