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

InspectCmd

public class InspectCmd extends JMXCmd

Fields Summary
private static final String
OPTIONS_INFO
Constructors Summary
public InspectCmd(CmdEnv env)

		super( env );
		
		mStringifier	= new SmartStringifier( "\n\n", false );
	
Methods Summary
voidexecuteInternal()

		final String	cmd	= getCmdNameAsInvoked();
		final String []	targets	= getTargets();
		
		if ( targets == null )
		{
			printError( "No targets have been specified" );
			return;
		}
		
		establishProxy();
		if ( cmd.equalsIgnoreCase( "inspect" ) )
		{
			handle_inspect( targets );
		}
		else if ( cmd.equalsIgnoreCase( "ops" ) )
		{
			handle_ops( targets );
		}
		else if ( cmd.equalsIgnoreCase( "attrs" ) )
		{
			handle_attrs( targets );
		}
	
public static java.lang.String[]getNames()

		return( new String [] { "inspect", "i", "ops", "attrs" } );
	
intgetNumRequiredOperands()

		// require 1, by default
		return( 0 );
	
ArgHelper.OptionsInfogetOptionInfo()

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

		return( CmdStrings.INSPECT_HELP.toString() );
	
voidhandle_attrs(java.lang.String[] targets)

		final InspectRequest	request	= new InspectRequest( false );
		request.attrs	= "*";
		
		handle_inspect( targets, request );
	
voidhandle_inspect(java.lang.String[] targets, com.sun.cli.jmx.support.InspectRequest request)

		final InspectResult []	results	= getProxy().mbeanInspect( request, targets );
		
		if ( results.length == 0 )
		{
			println( "<nothing inspected>" );
		}
		else
		{
			final String	msg	= ArrayStringifier.stringify( results, "\n\n");
			println( msg );
		}
	
voidhandle_inspect(java.lang.String[] targets)

		final InspectRequest	request	= new InspectRequest( true );
		
		request.includeDescription	= ! getBoolean( "noDescription", Boolean.TRUE ).booleanValue();
			
		if ( getBoolean( "all", Boolean.FALSE ).booleanValue() )
		{
			// should already be setup to get everything
		}
		else
		{
			request.includeSummary		= getBoolean( "summary", Boolean.TRUE ).booleanValue();
			request.constructors		= getBoolean( "constructors", Boolean.FALSE ).booleanValue();
		
			request.attrs			= getString( "attributes", null );
			request.operations		= getString( "operations", null );
			request.notifications	= getString( "notifications", null );
		}
		
		handle_inspect( targets, request );
	
voidhandle_ops(java.lang.String[] targets)

		final InspectRequest	request	= new InspectRequest( false );
		request.operations	= "*";
		
		handle_inspect( targets, request );