FileDocCategorySizeDatePackage
CreateCmd.javaAPI DocGlassfish v2 API3688Fri May 04 22:24:50 BST 2007com.sun.cli.jmx.cmd

CreateCmd

public class CreateCmd extends JMXCmd

Fields Summary
private static final String
OPTIONS_INFO
static final String
NAME
static final String
NAME_ABBREV
Constructors Summary
public CreateCmd(CmdEnv env)

		super( env );
	
Methods Summary
voidexecuteInternal()

		final String [] operands	= getOperands();
		
		if ( operands.length != 1 )
		{
			final String	msg	= "Exactly one name must be specified";
			printError( msg  );
			throw new IllegalArgumentException( msg );
		}
		final String name	= operands[ operands.length - 1 ];
		
		final String theClass	= getString( "class", null );
		if ( theClass == null || theClass.length() == 0 )
		{
			final String	msg	= "Illegal classname";
			printError( msg  );
			throw new IllegalArgumentException( msg );
		}
		
		final String args	= getString( "args", null );
		
		try
		{
			establishProxy();
			getProxy().mbeanCreate( name, theClass, args );
		}
		catch( Exception e )
		{	
			dm( e.getMessage() );
			e.printStackTrace();
		}
	
public static java.lang.String[]getNames()

	
		   
	 
	
		return( new String [] { NAME, NAME_ABBREV } );
	
intgetNumRequiredOperands()

		return( 1 );
	
ArgHelper.OptionsInfogetOptionInfo()

	
		
	
		 
	
		return( new ArgHelperOptionsInfo( OPTIONS_INFO ) );
	
public java.lang.StringgetUsage()

		return( CmdStrings.CREATE_HELP.toString() );