geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service GeronimoMBeanInfo.java
Date Sun, 16 Nov 2003 00:44:26 GMT
djencks     2003/11/15 16:44:26

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/service
                        GeronimoMBeanInfo.java
  Log:
  Do fastclass magic on targets whose instance is provided
  
  Revision  Changes    Path
  1.8       +15 -10    incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service/GeronimoMBeanInfo.java
  
  Index: GeronimoMBeanInfo.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service/GeronimoMBeanInfo.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GeronimoMBeanInfo.java	14 Nov 2003 16:15:37 -0000	1.7
  +++ GeronimoMBeanInfo.java	16 Nov 2003 00:44:26 -0000	1.8
  @@ -63,6 +63,7 @@
   import java.util.Iterator;
   import java.util.Map;
   import java.util.Set;
  +
   import javax.management.MBeanAttributeInfo;
   import javax.management.MBeanConstructorInfo;
   import javax.management.MBeanInfo;
  @@ -149,20 +150,20 @@
               for (Iterator i = targetClasses.entrySet().iterator(); i.hasNext();) {
                   Map.Entry entry = (Map.Entry) i.next();
                   Object key = entry.getKey();
  -                if (!targets.containsKey(key)) {
  -                    className = (String) entry.getValue();
  -                    Class clazz = ParserUtil.loadClass(className);
  +                className = (String) entry.getValue();
  +                Class clazz = ParserUtil.loadClass(className);
   
  -                    if (Modifier.isFinal(clazz.getModifiers())) {
  -                        throw new IllegalArgumentException("Target class cannot be final:
" + className);
  -                    }
  +                if (Modifier.isFinal(clazz.getModifiers())) {
  +                    throw new IllegalArgumentException("Target class cannot be final: "
+ className);
  +                }
   
  -                    // Insert Magic Here
  +                // Insert Magic Here
  +                if (!targets.containsKey(key)) {
                       GeronimoMBeanTarget target = createTarget(clazz);
                       targets.put(key, target);
  -                    FastClass fastClass = FastClass.create(clazz);
  -                    targetFastClasses.put(key, fastClass);
                   }
  +                FastClass fastClass = FastClass.create(clazz);
  +                targetFastClasses.put(key, fastClass);
               }
           } catch (ClassNotFoundException e) {
               throw new IllegalArgumentException("Target class could not be loaded: className="
+ className);
  @@ -236,6 +237,10 @@
               throw new IllegalStateException("Data is no longer mutable");
           }
           targets.put(name, target);
  +    }
  +
  +    public void setTarget(Object target) {
  +        setTarget(DEFAULT_TARGET_NAME, target);
       }
   
       FastClass getTargetFastClass() {
  
  
  

Mime
View raw message