An abstract method that Executes the command
if (!validateOptions())
throw new CommandValidationException("Validation failed");
String objectName = getObjectName();
Object[] params = getParamsInfo();
String operationName = getOperationName();
String[] types = getTypesInfo();
MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
getUser(), getPassword());
try {
ArrayList returnValue =(ArrayList) mbsc.invoke(new ObjectName(objectName),
operationName, params, types);
Iterator iterator= returnValue.iterator();
while (iterator.hasNext()){
String resource = (String) iterator.next();
CLILogger.getInstance().printMessage(" =========================");
CLILogger.getInstance().printMessage(resource);
}
CLILogger.getInstance().printDetailMessage(getLocalizedString(
"CommandSuccessful",
new Object[] {name}));
}catch(Exception e){
if (e.getLocalizedMessage() != null)
CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
throw new CommandException(getLocalizedString("CommandUnSuccessful",
new Object[] {name} ), e);
}