A method that Executes the command
String result = "";
try {
// Perform the pre run initialization
if (preRunInit())
{
// Retrieve the options used for this command
String targetName = getOption(TARGET_OPTION);
String libraryName = getOption(LIBRARY_NAME_OPTION);
String assemblyName = getOption(ASSEMBLY_NAME_OPTION);
String lifecycleState = getOption(LIFECYCLE_STATE_OPTION,validStates);
String componentName = getOption(COMPONENT_NAME_OPTION);
// Using the command name, we'll determine how to process the command
if (name.equals(LIST_BINDING_COMPONENTS)) {
result = ((JBIAdminCommands) mJbiAdminCommands).listBindingComponents(
lifecycleState,
libraryName,
assemblyName,
targetName);
processJBIAdminComponentListResult(result);
}
else if (name.equals(LIST_SERVICE_ENGINES)) {
result = ((JBIAdminCommands) mJbiAdminCommands).listServiceEngines(
lifecycleState,
libraryName,
assemblyName,
targetName);
processJBIAdminComponentListResult(result);
}
else if (name.equals(LIST_SHARED_LIBRARIES)) {
result = ((JBIAdminCommands) mJbiAdminCommands).listSharedLibraries(
componentName,
targetName);
processJBIAdminComponentListResult(result);
}
else if (name.equals(LIST_SERVICE_ASSEMBLIES)) {
result = ((JBIAdminCommands) mJbiAdminCommands).listServiceAssemblies(
lifecycleState,
componentName,
targetName);
processJBIAdminAsseblyListResult(result);
}
// Display the default success message
CLILogger.getInstance().printDetailMessage (
getLocalizedString ("CommandSuccessful",new Object[] {name} ) );
}
}
catch (Exception e) {
processTaskException(e);
}