admin@glassfish.java.net

code review: fix for 3792 "NPE in DynamicInterceptor.checkForIllegalMBean()"

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Mon, 29 Oct 2007 16:16:21 -0700

This will go into the trunk once our SCCS system is transitioned.

Meanwhile, this has been approved for UR1.

The code in question is no longer needed, it existed to preclude some
unnecessary MBeans from being registered.


Index: admin/src/java/com/sun/enterprise/interceptor/
DynamicInterceptor.java
===================================================================
RCS file: /cvs/glassfish/admin-core/admin/src/java/com/sun/enterprise/
interceptor/DynamicInterceptor.java,v
retrieving revision 1.4
diff -u -w -r1.4 DynamicInterceptor.java
--- admin/src/java/com/sun/enterprise/interceptor/
DynamicInterceptor.java 5 May 2007 05:25:39 -0000 1.4
+++ admin/src/java/com/sun/enterprise/interceptor/
DynamicInterceptor.java 29 Oct 2007 23:15:39 -0000
@@ -255,38 +255,10 @@
      }

- private static final boolean SPECIAL_CHECKS = true;
- private void
- checkForIllegalMBean( final ObjectName objectName )
- {
- if ( SPECIAL_CHECKS )
- {
- final String jmxDomain = objectName.getDomain();
- if ( jmxDomain.equals( "ias" ) )
- {
- final String msg = "JMX domain 'ias' may not be
used: " + JMXUtil.toString(objectName);
- final IllegalArgumentException e = new
IllegalArgumentException( msg );
- debug( msg, "\n", e );
- throw e;
- }
-
- /*
- if ( "server-instance".equals( objectName.getKeyProperty
( "type" ) ) )
- {
- final String msg = "MBean " + JMXUtil.toString
(objectName) + " is used, why?";
- final IllegalArgumentException e = new
IllegalArgumentException( msg );
- debug( msg, "\n", e );
- throw e;
- }
- */
- }
- }

      public final ObjectInstance registerMBean(final Object obj,
final ObjectName objectName)
          throws NotCompliantMBeanException,
MBeanRegistrationException, InstanceAlreadyExistsException
      {
- checkForIllegalMBean( objectName );
-
          debug( "DynamicInterceptor.registerMBean: ", objectName,
obj.getClass().getName() );
          return getDelegateMBeanServer().registerMBean( obj,
objectName );
      }



---
Lloyd L Chambers
lloyd.chambers_at_sun.com
Sun Microsystems, Inc