Class UserAction<R>

All Implemented Interfaces:
ICoreAction<R>, Callable<R>
Direct Known Subclasses:
CustomJavaAction, LoginAction

public abstract class UserAction<R> extends CoreAction<R>
Abstract class for user actions.
Usage:
- extend this class (define R!)
- implement the method executeAction()

Example:
public class ExampleAction extends UserAction {
private String param;

public ExampleAction(String param) {
super();
this.param = param;
}

public String executeAction() throws Exception {
return "Hello world! ("+this.param+")";
}

public String toString() {
return "ExampleAction:: param="+this.param;
}
}
  • Constructor Details

    • UserAction

      public UserAction(IContext context)
      Creates a user action.
      Parameters:
      context - the context in which the action executes
  • Method Details

    • context

      public IContext context()
      Returns the context in which this action executes.
      Returns:
      the execution context
    • execute

      public R execute() throws Exception
      This, already implemented, method calls executeAction on execution of this Action.
      Specified by:
      execute in class InternalCoreAction<R>
      Returns:
      returns the result of the execution
      Throws:
      Exception - when executing the action failed
    • executeAction

      public abstract R executeAction() throws Exception
      Implement this method, this method will be called when this action is executed.
      Returns:
      returns the result of the execution
      Throws:
      Exception