method that Executes the command
validateOptions();
try
{
//use http connector
final MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
getUser(), getPassword());
final String instanceName = getOption(TARGET_OPTION);
verifyTargetInstance(mbsc, instanceName);
final String objectName = getObjectName();
final Object[] params = getParamsInfo();
final String operationName = getOperationName();
final String[] types = getTypesInfo();
//if (System.getProperty("Debug") != null) printDebug(mbsc, objectName);
Object returnValue = mbsc.invoke(new ObjectName(objectName),
operationName, params, types);
handleReturnValue(returnValue);
CLILogger.getInstance().printDetailMessage(getLocalizedString(
"CommandSuccessful",
new Object[] {name}));
}
catch(Exception e)
{
displayExceptionMessage(e);
}