User: ejort   
  Date: 02/04/20 09:30:59

  Modified:    src/main/org/jboss/mx/server MBeanServerImpl.java
                        ServerConstants.java
  Log:
  Allow generic data to be stored with an MBeans registration. Fixed the double 
creation of the MBeanRegistry. Synchronized the long sequence numbers in the MBean 
Registry
  
  Revision  Changes    Path
  1.23      +12 -7     jmx/src/main/org/jboss/mx/server/MBeanServerImpl.java
  
  Index: MBeanServerImpl.java
  ===================================================================
  RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/MBeanServerImpl.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- MBeanServerImpl.java      14 Apr 2002 15:28:07 -0000      1.22
  +++ MBeanServerImpl.java      20 Apr 2002 16:30:59 -0000      1.23
  @@ -95,7 +95,7 @@
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>.
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Trevor Squires</a>.
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Adrian Brock</a>.
  - * @version $Revision: 1.22 $
  + * @version $Revision: 1.23 $
    */
   public class MBeanServerImpl
      implements MBeanServer, ServerConstants
  @@ -148,8 +148,7 @@
       */
      public MBeanServerImpl(String defaultDomain)
      {
  -      // Construct the registry
  -      this.registry = new BasicMBeanRegistry(this, defaultDomain);
  +      // Contruct the MBean Registry
         String registryClass = System.getProperty(
               ServerConstants.MBEAN_REGISTRY_CLASS_PROPERTY,
               ServerConstants.DEFAULT_MBEAN_REGISTRY_CLASS
  @@ -920,17 +919,23 @@
                MBeanRegistrationException, 
                NotCompliantMBeanException
      {
  +      HashMap valueMap = null;
  +      if (cl != null)
  +      {
  +         valueMap = new HashMap();
  +         valueMap.put(CLASSLOADER, cl);
  +      }
  +
         // Dynamic Invocation
         if (registryName != null)
         {
            try
            {
               return (ObjectInstance) invoke(registryName, "registerMBean",
  -                    new Object[] { object, name, cl, null },
  +                    new Object[] { object, name, valueMap },
                       new String[] { Object.class.getName(),
                                      ObjectName.class.getName(),
  -                                   ClassLoader.class.getName(),
  -                                   Object.class.getName() }
  +                                   Map.class.getName() }
               );
            }
            catch (Exception e)
  @@ -947,7 +952,7 @@
         }
         else
            // POJO Registry
  -         return registry.registerMBean(object, name, cl, null);
  +         return registry.registerMBean(object, name, valueMap);
      }
   
      /**
  
  
  
  1.10      +10 -3     jmx/src/main/org/jboss/mx/server/ServerConstants.java
  
  Index: ServerConstants.java
  ===================================================================
  RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/ServerConstants.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ServerConstants.java      15 Apr 2002 02:48:52 -0000      1.9
  +++ ServerConstants.java      20 Apr 2002 16:30:59 -0000      1.10
  @@ -18,7 +18,7 @@
    *
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>.
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Adrian Brock</a>.
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
    *   
    */
   public interface ServerConstants
  @@ -27,7 +27,8 @@
   
      /**
       * The name of the protected implementation domain
  -    * Pass this object to the registry to register in this domain
  +    * Pass this object to the registry in the values map as the key and value
  +    * to register in this domain
       */
      final static String JMI_DOMAIN                         = "JMImplementation";
      
  @@ -90,7 +91,7 @@
      final static String UNIFIED_LOADER_REPOSITORY_CLASS    = 
"org.jboss.mx.loading.UnifiedLoaderRepository";
      
      final static String MBEAN_REGISTRY_CLASS_PROPERTY      = 
"jbossmx.mbean.registry.class";
  -   final static String DEFAULT_MBEAN_REGISTRY_CLASS       = 
"org.jboss.mx.server.registry.BasicMBeanRegistry";
  +   final static String DEFAULT_MBEAN_REGISTRY_CLASS       = 
"org.jboss.mx.server.registry.ManagedMBeanRegistry";
      
      final static String MBEAN_SERVER_CLASS_PROPERTY        = 
"jbossmx.mbean.server.class";
      final static String DEFAULT_MBEAN_SERVER_CLASS         = 
"org.jboss.mx.server.MBeanServerImpl";
  @@ -102,6 +103,12 @@
   
      final static String CLASSLOADER_ADDED = "jboss.mx.classloader.added";
      final static String CLASS_REMOVED = "jboss.mx.class.removed";
  +
  +   /**
  +    * The key for the context classloader for an MBean registration
  +    */
  +   final static String CLASSLOADER                        = 
"org.jboss.mx.classloader";
  +
   }
         
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to