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);
boolean keepArchive = getBooleanOption(KEEP_ARCHIVE_OPTION);
// Retrieve the operand
String componentName = (String) getOperands().get(0);
// Using the command name, we'll determine how to process the command
if (name.equals(UNINSTALL_COMPONENT)) {
result = ((JBIAdminCommands) mJbiAdminCommands).uninstallComponent(
componentName,
force,
keepArchive,
targetName);
successKey = "JBISuccessUninstallComponent";
}
else if (name.equals(UNINSTALL_SHARED_LIBRARY)) {
result = ((JBIAdminCommands) mJbiAdminCommands).uninstallSharedLibrary(
componentName,
force,
keepArchive,
targetName);
successKey = "JBISuccessUninstallSharedLibrary";
}
else if (name.equals(UNDEPLOY_SERVICE_ASSEMBLY)) {
result = ((JBIAdminCommands) mJbiAdminCommands).undeployServiceAssembly(
componentName,
force,
keepArchive,
targetName);
successKey = "JBISuccessUndeployServiceAssembly";
}
// Display the success message
CLILogger.getInstance().printDetailMessage (
getLocalizedString (successKey,new Object[] {componentName}));
}
}
catch (Exception e) {
processTaskException(e);
}