public < R extends JmxRequest > Object handleRequest ( JsonRequestHandler < R > pRequestHandler , R pJmxReq ) throws MBeanException , ReflectionException , AttributeNotFoundException , InstanceNotFoundException , NotChangedException { AttributeNotFoundException attrException = null ; InstanceNotFoundException objNotFoundException = null ; for ( MBeanServerConnection conn : getMBeanServers ( ) ) { try { return pRequestHandler . handleRequest ( conn , pJmxReq ) ; } catch ( InstanceNotFoundException exp ) { // Remember exceptions for later use objNotFoundException = exp ; } catch ( AttributeNotFoundException exp ) { attrException = exp ; } catch ( IOException exp ) { throw new IllegalStateException ( "I/O Error while dispatching" , exp ) ; } } if ( attrException != null ) { throw attrException ; } // Must be there, otherwise we would not have left the loop throw objNotFoundException ; }
Handle a single request