org.opennms.netmgt.notifd
Interface ExecutorStrategy
- All Known Implementing Classes:
- ClassExecutor, CommandExecutor
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 |
int |
execute(String commandLine,
List<Argument> arguments)
Implement this method to support execute style commands such as a system
command or to instantiate a Java class. |
execute
int execute(String commandLine,
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/instantiatearguments - 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
Copyright © 2011. All Rights Reserved.