1 23 24 29 30 package com.sun.cli.jmx.cmd; 31 32 33 import com.sun.cli.jmx.support.ResultsForGetSet; 34 import com.sun.cli.jmx.support.CLISupportMBeanProxy; 35 import com.sun.cli.util.stringifier.*; 36 37 public class GetCmd extends GetSetCmd 38 { 39 final static String GET = "get"; 40 final static String GET_ABBREV = "g"; 41 42 public 43 GetCmd( final CmdEnv env ) 44 { 45 super( env ); 46 } 47 48 public String 49 getUsage() 50 { 51 return( CmdStrings.GET_HELP.toString() ); 52 } 53 54 55 public static String [] 56 getNames( ) 57 { 58 return( new String [] { GET, GET_ABBREV } ); 59 } 60 61 62 void 63 executeInternal() 64 throws Exception 65 { 66 final String cmd = getCmdNameAsInvoked(); 67 68 String attributes = null; 69 String [] targets = null; 70 71 if ( cmd.equalsIgnoreCase( GET ) || cmd.equalsIgnoreCase( GET_ABBREV ) ) 72 { 73 attributes = getAttributes(); 74 targets = getTargets(); 75 } 76 77 println( "Getting attributes: " + attributes ); 78 println( "Against targets: " + ArrayStringifier.stringify( targets, "\n" ) ); 79 80 establishProxy(); 81 final ResultsForGetSet [] results = getProxy().mbeanGet( attributes, targets ); 82 83 println( ArrayStringifier.stringify( results, "\n\n" ) ); 84 } 85 } 86 87 | Popular Tags |