Interface ExecutorStrategy

  • All Known Implementing Classes:
    ClassExecutor, CommandExecutor, ServiceRegistryExecutor

    public interface ExecutorStrategy

    ExecutorStrategy interface.

    Version:
    $Id: $
    Author:
    David Hustace , OpenNMS Implement this interface to as a means of executing code be it a Java class or system command. This interface was created to provide a Java Notification plugin interface. The original CommandExecutor class was developed to execute system commands calling its execute method with the command name and a list of command line paramenters. Now the ClassExecutor class implements this interface and the execute method instantiates the Java class specified in the commandLine parameter to the execute method. Now, this interface is implemented by the ClassExecutor class that allows the notification process (NotificationTask) to simply call the execute method and not be concerned if the strategy (binary flag) actually executes a command or instantiates a Java class., David Hustace , OpenNMS Implement this interface to as a means of executing code be it a Java class or system command. This interface was created to provide a Java Notification plugin interface. The original CommandExecutor class was developed to execute system commands calling its execute method with the command name and a list of command line paramenters. Now the ClassExecutor class implements this interface and the execute method instantiates the Java class specified in the commandLine parameter to the execute method. Now, this interface is implemented by the ClassExecutor class that allows the notification process (NotificationTask) to simply call the execute method and not be concerned if the strategy (binary flag) actually executes a command or instantiates a Java class.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int execute​(java.lang.String commandLine, java.util.List<Argument> arguments)
      Implement this method to support execute style commands such as a system command or to instantiate a Java class.
    • Method Detail

      • execute

        int execute​(java.lang.String commandLine,
                    java.util.List<Argument> arguments)
        Implement this method to support execute style commands such as a system command or to instantiate a Java class.
        Parameters:
        commandLine - the command/class to execute/instantiate
        arguments - a list of Argument objects that need to be passed to the command line call or the class execute method
        Returns:
        int, the return code of the command/execute method