FileDocCategorySizeDatePackage
JMSPingCommand.javaAPI DocGlassfish v2 API4507Fri May 04 22:25:12 BST 2007com.sun.enterprise.cli.commands

JMSPingCommand

public class JMSPingCommand extends S1ASCommand
This is to find out if IMQ is alive or not
version
$Revision: 1.4 $

Fields Summary
Constructors Summary
Methods Summary
public voidrunCommand()
Executes the command

throws
CommandException

        if (!validateOptions())
            throw new CommandValidationException("Validation is false");
        String objectName = getObjectName();
        Object[] params = getParamsInfo();
        String operationName = getOperationName();
        String[] types = getTypesInfo();

	MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), 
							      getPort(), 
							      getUser(), 
							      getPassword());

        try
        { 
            String returnValue = (String) mbsc.invoke(new ObjectName(objectName), 
					                 operationName, params, types);
	    CLILogger.getInstance().printMessage(getLocalizedString(
                                                    "JMSPingStatus",
                                                    new Object[] {returnValue}));
            // Ping was successful
	    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);
        }        
    
public booleanvalidateOptions()
A method that validates the options on the specification in the xml properties file This method verifies for the correctness of number of operands and if all the required options are supplied by the client.

return
boolean returns true if success else returns false

    	return super.validateOptions();