jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanSupport.java
changeset 4156 acaa49a2768a
parent 1322 d038148778cc
child 5506 202f599c92aa
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanSupport.java	Wed Oct 21 16:28:57 2009 +0200
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MXBeanSupport.java	Wed Oct 21 17:33:18 2009 +0200
@@ -35,7 +35,6 @@
 import javax.management.MBeanServer;
 import javax.management.NotCompliantMBeanException;
 import javax.management.ObjectName;
-import javax.management.openmbean.MXBeanMappingFactory;
 
 /**
  * Base class for MXBeans.
@@ -62,16 +61,14 @@
        if it does not implement the class {@code mxbeanInterface} or if
        that class is not a valid MXBean interface.
     */
-    public <T> MXBeanSupport(T resource, Class<T> mxbeanInterface,
-                             MXBeanMappingFactory mappingFactory)
+    public <T> MXBeanSupport(T resource, Class<T> mxbeanInterface)
             throws NotCompliantMBeanException {
-        super(resource, mxbeanInterface, mappingFactory);
+        super(resource, mxbeanInterface);
     }
 
     @Override
-    MBeanIntrospector<ConvertingMethod>
-            getMBeanIntrospector(MXBeanMappingFactory mappingFactory) {
-        return MXBeanIntrospector.getInstance(mappingFactory);
+    MBeanIntrospector<ConvertingMethod> getMBeanIntrospector() {
+        return MXBeanIntrospector.getInstance();
     }
 
     @Override
@@ -159,8 +156,8 @@
         // eventually we could have some logic to supply a default name
 
         synchronized (lock) {
-            this.mxbeanLookup = MXBeanLookup.Plain.lookupFor(server);
-            this.mxbeanLookup.addReference(name, getWrappedObject());
+            this.mxbeanLookup = MXBeanLookup.lookupFor(server);
+            this.mxbeanLookup.addReference(name, getResource());
             this.objectName = name;
         }
     }
@@ -169,19 +166,13 @@
     public void unregister() {
         synchronized (lock) {
             if (mxbeanLookup != null) {
-                if (mxbeanLookup.removeReference(objectName, getWrappedObject()))
+                if (mxbeanLookup.removeReference(objectName, getResource()))
                     objectName = null;
             }
-            // XXX: need to revisit the whole register/unregister logic in
-            // the face of wrapping.  The mxbeanLookup!=null test is a hack.
-            // If you wrap an MXBean in a MyWrapperMBean and register it,
-            // the lookup table should contain the wrapped object.  But that
-            // implies that MyWrapperMBean calls register, which today it
-            // can't within the public API.
         }
     }
     private final Object lock = new Object(); // for mxbeanLookup and objectName
 
-    private MXBeanLookup.Plain mxbeanLookup;
+    private MXBeanLookup mxbeanLookup;
     private ObjectName objectName;
 }