1 23 24 29 30 31 package com.sun.cli.util.stringifier; 32 33 import java.lang.reflect.Array ; 34 import javax.management.*; 35 36 public class MBeanOperationInfoStringifier 37 extends MBeanFeatureInfoStringifier implements Stringifier 38 { 39 public static MBeanOperationInfoStringifier DEFAULT = new MBeanOperationInfoStringifier( ); 40 41 public 42 MBeanOperationInfoStringifier( ) 43 { 44 super( ); 45 } 46 47 public 48 MBeanOperationInfoStringifier( MBeanFeatureInfoStringifierOptions options ) 49 { 50 super( options ); 51 } 52 53 public String 54 stringify( Object o ) 55 { 56 assert( o != null ); 57 58 final MBeanOperationInfo op = (MBeanOperationInfo)o; 59 60 String result = getPresentationTypeString( op.getReturnType() ) + " " + op.getName() + "("; 61 62 result = result + ParamsToString( op.getSignature(), mOptions) + ")"; 64 65 String impactStr = ""; 66 switch( op.getImpact() ) 67 { 68 default: impactStr = "unknown"; break; 69 case MBeanOperationInfo.INFO: impactStr = "info"; break; 70 case MBeanOperationInfo.ACTION: impactStr = "action"; break; 71 case MBeanOperationInfo.ACTION_INFO: impactStr = "action-info";break; 72 } 73 74 result = result + sOperationDelimiter + "impact=" +impactStr; 75 76 if ( mOptions.mIncludeDescription ) 77 { 78 result = result + sOperationDelimiter + "\"" + op.getDescription() + "\""; 79 } 80 81 return( result ); 82 } 83 } | Popular Tags |