geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service GeronimoMBeanInfo.java
Date Tue, 18 Nov 2003 02:23:35 GMT
jboynes     2003/11/17 18:23:35

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/service
                        GeronimoMBeanInfo.java
  Log:
  Needs review - target class should be available
  
  Revision  Changes    Path
  1.11      +19 -15    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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- GeronimoMBeanInfo.java	17 Nov 2003 00:47:17 -0000	1.10
  +++ GeronimoMBeanInfo.java	18 Nov 2003 02:23:35 -0000	1.11
  @@ -152,14 +152,18 @@
                   Map.Entry entry = (Map.Entry) i.next();
                   Object key = entry.getKey();
                   className = (String) entry.getValue();
  -                Class clazz = ParserUtil.loadClass(className);
  -
  -                if (Modifier.isFinal(clazz.getModifiers())) {
  -                    throw new IllegalArgumentException("Target class cannot be final: "
+ className);
  -                }
   
                   // Insert Magic Here
  -                if (!targets.containsKey(key)) {
  +                Class clazz;
  +                if (targets.containsKey(key)) {
  +                    clazz = targets.get(key).getClass();
  +                } else {
  +                    clazz = ParserUtil.loadClass(className);
  +
  +                    if (Modifier.isFinal(clazz.getModifiers())) {
  +                        throw new IllegalArgumentException("Target class cannot be final:
" + className);
  +                    }
  +
                       GeronimoMBeanTarget target = createTarget(clazz);
                       targets.put(key, target);
                   }
  @@ -204,9 +208,9 @@
       }
   
       public void setTargetClass(Class clazz) {
  -       setTargetClass(clazz.getName());
  +        setTargetClass(clazz.getName());
       }
  -    
  +
       public void setTargetClass(String className) {
           if (immutable) {
               throw new IllegalStateException("Data is no longer mutable");
  @@ -229,7 +233,7 @@
           }
       }
   
  -    Object getTarget() {
  +    public Object getTarget() {
           return targets.get(DEFAULT_TARGET_NAME);
       }
   
  @@ -319,7 +323,7 @@
       public void addOperationsDeclaredIn(Class clazz) {
           if (immutable) {
               throw new IllegalStateException("Data is no longer mutable");
  -        }        
  +        }
           Method[] methods = clazz.getDeclaredMethods();
           for (int i = 0; i < methods.length; i++) {
               addOperationFor(methods[i]);
  @@ -329,18 +333,18 @@
       public void addOperationFor(Method method) {
           if (immutable) {
               throw new IllegalStateException("Data is no longer mutable");
  -        }        
  +        }
           ArrayList l = new ArrayList();
           Class[] classes = method.getParameterTypes();
           for (int j = 0; j < classes.length; j++) {
               Class class1 = classes[j];
  -            l.add(new GeronimoParameterInfo("arg"+(j+1), class1, ""));
  +            l.add(new GeronimoParameterInfo("arg" + (j + 1), class1, ""));
           }
           GeronimoParameterInfo params[] = new GeronimoParameterInfo[l.size()];
  -        l.toArray(params);            
  +        l.toArray(params);
           addOperationInfo(new GeronimoOperationInfo(method.getName(), params, MBeanOperationInfo.ACTION,
""));
       }
  -    
  +
       public Set getNotificationsSet() {
           return Collections.unmodifiableSet(notifications);
       }
  
  
  

Mime
View raw message