IExecutable

Interface that allows you to create a component that can be called to execute work.

Description

The IExecutable interface allows you to create a component that can be called to execute work.

Instance methods

execute

Executes a component with arguments and receives the execution result.

Object execute(IContext context, Parameters args) throws ApplicationException

  • context: IContext - (optional) execution context to trace execution through call chain.
  • args: Parameters - execution arguments.
  • returns: Object - execution result.

Examples

{
  class EchoComponent implements IExecutable {
    ...
    public void execute(IContext context, Parameters args) {
      Object result = args.getAsObject("message");
    }
  }
 
  EchoComponent echo = new EchoComponent();
  String message = "Test";
  echo.execute("123", Parameters.fromTuples("message", message));
  }

See also