geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx JMXSetAttributeInvoker.java JMXGetAttributeInvoker.java VMMethodInterceptor.java CGLibMethodInterceptor.java
Date Tue, 27 Jul 2004 02:14:15 GMT
gdamour     2004/07/26 19:14:15

  Modified:    modules/kernel/src/java/org/apache/geronimo/gbean/jmx
                        JMXSetAttributeInvoker.java
                        JMXGetAttributeInvoker.java
                        VMMethodInterceptor.java
                        CGLibMethodInterceptor.java
  Log:
  JMX GBeanInvokers implement the same attribute naming conventions than the Raw ones.
  
  Previously the JMX GBeanInvokers were following the JMX standards. As pointed out by Dain,
  this was an issue as remote MBean proxies were using the JMX GBeanInvokers. Hence, remote
MBean
  proxies of GBeanMBeans were not working properly.
  
  Revision  Changes    Path
  1.4       +3 -3      incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXSetAttributeInvoker.java
  
  Index: JMXSetAttributeInvoker.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXSetAttributeInvoker.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JMXSetAttributeInvoker.java	14 Jul 2004 00:27:42 -0000	1.3
  +++ JMXSetAttributeInvoker.java	27 Jul 2004 02:14:13 -0000	1.4
  @@ -35,9 +35,9 @@
       private final String name;
       private final Class[] declaredExceptions;
   
  -    public JMXSetAttributeInvoker(MBeanServerConnection server, Method method) {
  +    public JMXSetAttributeInvoker(MBeanServerConnection server, Method method, String name)
{
           this.server = server;
  -        name = method.getName().substring(3);
  +        this.name = name;
   
           declaredExceptions = method.getExceptionTypes();
       }
  
  
  
  1.4       +3 -8      incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXGetAttributeInvoker.java
  
  Index: JMXGetAttributeInvoker.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/JMXGetAttributeInvoker.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JMXGetAttributeInvoker.java	14 Jul 2004 00:27:42 -0000	1.3
  +++ JMXGetAttributeInvoker.java	27 Jul 2004 02:14:13 -0000	1.4
  @@ -34,14 +34,9 @@
       private final String name;
       private final Class[] declaredExceptions;
   
  -    public JMXGetAttributeInvoker(MBeanServerConnection server, Method method) {
  +    public JMXGetAttributeInvoker(MBeanServerConnection server, Method method, String name)
{
           this.server = server;
  -
  -        if (method.getName().startsWith("is")) {
  -            name = method.getName().substring(2);
  -        } else {
  -            name = method.getName().substring(3);
  -        }
  +        this.name = name;
           
           declaredExceptions = method.getExceptionTypes();
       }
  
  
  
  1.2       +23 -7     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/VMMethodInterceptor.java
  
  Index: VMMethodInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/VMMethodInterceptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VMMethodInterceptor.java	2 Jun 2004 06:49:23 -0000	1.1
  +++ VMMethodInterceptor.java	27 Jul 2004 02:14:14 -0000	1.2
  @@ -16,6 +16,7 @@
    */
   package org.apache.geronimo.gbean.jmx;
   
  +import java.beans.Introspector;
   import java.lang.reflect.InvocationHandler;
   import java.lang.reflect.Method;
   import java.util.HashMap;
  @@ -146,16 +147,31 @@
   
           String name = method.getName();
           if (name.startsWith("get")) {
  -            if (attributes.containsKey(name.substring(3))) {
  -                return new JMXGetAttributeInvoker(server, method);
  +            String attrName = method.getName().substring(3);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
  +            }
  +            attrName = Introspector.decapitalize(attrName);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
               }
           } else if (name.startsWith("is")) {
  -            if (attributes.containsKey(name.substring(2))) {
  -                return new JMXGetAttributeInvoker(server, method);
  +            String attrName = method.getName().substring(2);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
  +            }
  +            attrName = Introspector.decapitalize(attrName);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
               }
           } else if (name.startsWith("set")) {
  -            if (attributes.containsKey(name.substring(3))) {
  -                return new JMXSetAttributeInvoker(server, method);
  +            String attrName = method.getName().substring(3);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXSetAttributeInvoker(server, method, attrName);
  +            }
  +            attrName = Introspector.decapitalize(attrName);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXSetAttributeInvoker(server, method, attrName);
               }
           }
           return null;
  
  
  
  1.5       +22 -7     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/CGLibMethodInterceptor.java
  
  Index: CGLibMethodInterceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/CGLibMethodInterceptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CGLibMethodInterceptor.java	14 Jul 2004 00:34:47 -0000	1.4
  +++ CGLibMethodInterceptor.java	27 Jul 2004 02:14:14 -0000	1.5
  @@ -245,16 +245,31 @@
   
           String name = method.getName();
           if (name.startsWith("get")) {
  -            if (attributes.containsKey(method.getName().substring(3))) {
  -                return new JMXGetAttributeInvoker(server, method);
  +            String attrName = method.getName().substring(3);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
  +            }
  +            attrName = Introspector.decapitalize(attrName);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
               }
           } else if (name.startsWith("is")) {
  -            if (attributes.containsKey(method.getName().substring(2))) {
  -                return new JMXGetAttributeInvoker(server, method);
  +            String attrName = method.getName().substring(2);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
  +            }
  +            attrName = Introspector.decapitalize(attrName);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXGetAttributeInvoker(server, method, attrName);
               }
           } else if (name.startsWith("set")) {
  -            if (attributes.containsKey(method.getName().substring(3))) {
  -                return new JMXSetAttributeInvoker(server, method);
  +            String attrName = method.getName().substring(3);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXSetAttributeInvoker(server, method, attrName);
  +            }
  +            attrName = Introspector.decapitalize(attrName);
  +            if (attributes.containsKey(attrName)) {
  +                return new JMXSetAttributeInvoker(server, method, attrName);
               }
           }
           return null;
  
  
  

Mime
View raw message