public ObjectQueryInfo prepareObjectQuery ( Object obj ) throws MalformedObjectNameException { ObjectQueryInfo result ; // // Extract the mbean info from the object (TBD: cache this information ahead of time) // String onamePattern = MBeanAnnotationUtil . getLocationONamePattern ( obj ) ; if ( onamePattern != null ) { // // Locate the setters and continue only if at least one was found. // Map < String , Method > attributeSetters = MBeanAnnotationUtil . getAttributes ( obj ) ; if ( attributeSetters . size ( ) > 0 ) { String onameString ; if ( obj instanceof MBeanLocationParameterSource ) { onameString = this . parameterReplacer . replaceObjectNameParameters ( onamePattern , ( MBeanLocationParameterSource ) obj ) ; } else { onameString = onamePattern ; } ObjectName oname = new ObjectName ( onameString ) ; result = new ObjectQueryInfo ( obj , oname , attributeSetters ) ; } else { this . logNoAttributeThrottle . warn ( log , "ignoring attempt to prepare to poll an MBean object with no attributes: onamePattern={}" , onamePattern ) ; result = null ; } } else { log . warn ( "ignoring attempt to prepare to poll object that has no MBeanLocation" ) ; result = null ; } return result ; }
Prepare to query the given object .