/**
   * Loads the management interface info for the configured MBean into the caches. This information
   * is used by the proxy when determining whether an invocation matches a valid operation or
   * attribute on the management interface of the managed resource.
   */
  private void retrieveMBeanInfo()
      throws MBeanServerNotFoundException, MBeanInfoRetrievalException {
    try {
      MBeanInfo info = this.server.getMBeanInfo(this.objectName);

      // get attributes
      MBeanAttributeInfo[] attributeInfo = info.getAttributes();
      this.allowedAttributes = new HashMap(attributeInfo.length);

      for (int x = 0; x < attributeInfo.length; x++) {
        this.allowedAttributes.put(attributeInfo[x].getName(), attributeInfo[x]);
      }

      // get operations
      MBeanOperationInfo[] operationInfo = info.getOperations();
      this.allowedOperations = new HashMap(operationInfo.length);

      for (int x = 0; x < operationInfo.length; x++) {
        MBeanOperationInfo opInfo = operationInfo[x];
        this.allowedOperations.put(
            new MethodCacheKey(
                opInfo.getName(), JmxUtils.parameterInfoToTypes(opInfo.getSignature())),
            opInfo);
      }
    } catch (ClassNotFoundException ex) {
      throw new MBeanInfoRetrievalException(
          "Unable to locate class specified in method signature", ex);
    } catch (IntrospectionException ex) {
      throw new MBeanInfoRetrievalException(
          "Unable to obtain MBean info for bean [" + this.objectName + "]", ex);
    } catch (InstanceNotFoundException ex) {
      // if we are this far this shouldn't happen, but...
      throw new MBeanInfoRetrievalException(
          "Unable to obtain MBean info for bean ["
              + this.objectName
              + "]: it is likely that this bean was unregistered during the proxy creation process",
          ex);
    } catch (ReflectionException ex) {
      throw new MBeanInfoRetrievalException(
          "Unable to read MBean info for bean [ " + this.objectName + "]", ex);
    } catch (IOException ex) {
      throw new MBeanInfoRetrievalException(
          "An IOException occurred when communicating with the MBeanServer. "
              + "It is likely that you are communicating with a remote MBeanServer. "
              + "Check the inner exception for exact details.",
          ex);
    }
  }