private List < MBeanParameterInfo [ ] > extractMBeanParameterInfos ( MBeanServerConnection pServer , JmxExecRequest pRequest , String pOperation ) throws InstanceNotFoundException , ReflectionException , IOException { try { MBeanInfo mBeanInfo = pServer . getMBeanInfo ( pRequest . getObjectName ( ) ) ; List < MBeanParameterInfo [ ] > paramInfos = new ArrayList < MBeanParameterInfo [ ] > ( ) ; for ( MBeanOperationInfo opInfo : mBeanInfo . getOperations ( ) ) { if ( opInfo . getName ( ) . equals ( pOperation ) ) { paramInfos . add ( opInfo . getSignature ( ) ) ; } } if ( paramInfos . size ( ) == 0 ) { throw new IllegalArgumentException ( "No operation " + pOperation + " found on MBean " + pRequest . getObjectNameAsString ( ) ) ; } return paramInfos ; } catch ( IntrospectionException e ) { throw new IllegalStateException ( "Cannot extract MBeanInfo for " + pRequest . getObjectNameAsString ( ) , e ) ; } }
Extract a list of operation signatures which match a certain operation name . The returned list can contain multiple signature in case of overloaded JMX operations .