A method that Executes the command
String result = "";
String successKey = "";
try {
// Perform the pre run initialization
if (preRunInit())
{
// Retrieve the options
String targetName = getOption(TARGET_OPTION);
boolean force = getBooleanOption(FORCE_OPTION);
// Retrieve the operand "componentName"
String componentName = (String) getOperands().get(0);
// Using the command name, we'll determine how to process the command
if (name.equals(START_COMPONENT)) {
result = ((JBIAdminCommands) mJbiAdminCommands).startComponent(
componentName,
targetName);
successKey = "JBISuccessStartedComponent";
}
else if (name.equals(STOP_COMPONENT)) {
result = ((JBIAdminCommands) mJbiAdminCommands).stopComponent(
componentName,
targetName);
successKey = "JBISuccessStoppedComponent";
}
else if (name.equals(SHUT_DOWN_COMPONENT)) {
result = ((JBIAdminCommands) mJbiAdminCommands).shutdownComponent(
componentName,
force,
targetName);
successKey = "JBISuccessShutDownComponent";
}
else if (name.equals(START_SERVICE_ASSEMBLY)) {
result = ((JBIAdminCommands) mJbiAdminCommands).startServiceAssembly(
componentName,
targetName);
successKey = "JBISuccessStartAssemblyComponent";
}
else if (name.equals(STOP_SERVICE_ASSEMBLY)) {
result = ((JBIAdminCommands) mJbiAdminCommands).stopServiceAssembly(
componentName,
targetName);
successKey = "JBISuccessStoppedAssembly";
}
else if (name.equals(SHUT_DOWN_SERVICE_ASSEMBLY)) {
result = ((JBIAdminCommands) mJbiAdminCommands).shutdownServiceAssembly(
componentName,
force,
targetName);
successKey = "JBISuccessShutDownAssembly";
}
}
processJBIAdminResult (result, successKey);
}
catch (Exception e) {
processTaskException(e);
}