Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6177524

MBeanServerInvocationHandler should not forward Object methods to proxied MBean

XMLWordPrintable

    • b23
    • generic, x86
    • generic, windows_xp

      MBeanServerInvocationHandler is specified to forward the methods hashCode(), toString(), and equals(Object) to the proxied MBean. This is basically never what you want, and in particular means that you cannot reasonably use an MBean proxy as a key in a HashMap (for example to look up a cached MBeanInfo for the proxy). MBeanServerInvocationHandler should only forward these methods if they are explicitly mentioned in the MBean interface for which it is a handler. This can be discovered by reflecting on the class of the proxy parameter to MBeanServerInvocationHandler.invoke. Its first superinterface will be the MBean interface, and it can be examined to see whether it contains the method in question.
      ###@###.### 10/12/04 11:07 GMT

            sjiang Shanliang Jiang (Inactive)
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: