Package org.opennms.netmgt.notifd
Class CommandExecutor
- java.lang.Object
-
- org.opennms.netmgt.notifd.CommandExecutor
-
- All Implemented Interfaces:
ExecutorStrategy
public class CommandExecutor extends java.lang.Object implements ExecutorStrategy
This is a class to store and execute a console command- Version:
- $Id: $
- Author:
- David Hustace , Jason Johns , OpenNMS , David Hustace , Jason Johns , OpenNMS , David Hustace , Jason Johns , OpenNMS
-
-
Constructor Summary
Constructors Constructor Description CommandExecutor()
-
Method Summary
All Methods Instance Methods Concrete 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
public 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. This method executes the command using a Process. The method will decide if an input stream needs to be used.- Specified by:
execute
in interfaceExecutorStrategy
- 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
-
-