geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx MBeanProxyCallback.java MBeanProxyFactory.java
Date Mon, 10 Nov 2003 00:22:34 GMT
dain        2003/11/09 16:22:34

  Modified:    modules/kernel project.xml
               modules/kernel/src/java/org/apache/geronimo/kernel/jmx
                        MBeanProxyCallback.java MBeanProxyFactory.java
  Log:
  Updated to newest cglib head.
  
  Revision  Changes    Path
  1.8       +2 -2      incubator-geronimo/modules/kernel/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/project.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- project.xml	6 Nov 2003 20:04:07 -0000	1.7
  +++ project.xml	10 Nov 2003 00:22:34 -0000	1.8
  @@ -84,7 +84,7 @@
   
           <dependency>
               <id>cglib</id>
  -            <version>HEAD-20031106</version>
  +            <version>HEAD-20031109</version>
               <url>http://cglib.sf.net/</url>
               <properties>
                   <runtime>true</runtime>
  
  
  
  1.2       +2 -2      incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanProxyCallback.java
  
  Index: MBeanProxyCallback.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanProxyCallback.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MBeanProxyCallback.java	7 Nov 2003 17:32:11 -0000	1.1
  +++ MBeanProxyCallback.java	10 Nov 2003 00:22:34 -0000	1.2
  @@ -79,6 +79,6 @@
       }
   
       public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy)
throws Throwable {
  -        return methodTable[proxy.getIndex()].invoke(server, objectName, args);
  +        return methodTable[proxy.getSuperIndex()].invoke(server, objectName, args);
       }
   }
  
  
  
  1.4       +15 -12    incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanProxyFactory.java
  
  Index: MBeanProxyFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/MBeanProxyFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MBeanProxyFactory.java	9 Nov 2003 19:56:55 -0000	1.3
  +++ MBeanProxyFactory.java	10 Nov 2003 00:22:34 -0000	1.4
  @@ -68,6 +68,7 @@
   import net.sf.cglib.proxy.Enhancer;
   import net.sf.cglib.proxy.Factory;
   import net.sf.cglib.proxy.SimpleCallbacks;
  +import net.sf.cglib.proxy.MethodProxy;
   import net.sf.cglib.reflect.FastClass;
   
   /**
  @@ -99,8 +100,6 @@
                   new SimpleCallbacks());
   
           // build the method table
  -        FastClass fastClass = FastClass.create(iface);
  -
           if (objectName.isPattern()) {
               Set names = server.queryNames(objectName, null);
               if (names.isEmpty()) {
  @@ -130,19 +129,23 @@
               operations.put(new MBeanOperationSignature(operationInfo), operationInfo);
           }
   
  +        FastClass fastClass = FastClass.create(factory.newInstance(new SimpleCallbacks()).getClass());
           InvokeMBean[] methodTable = new InvokeMBean[fastClass.getMaxIndex() + 1];
           Method[] methods = fastClass.getJavaClass().getMethods();
           for (int i = 0; i < methods.length; i++) {
               Method method = methods[i];
  -            int index = fastClass.getIndex(method.getName(), method.getParameterTypes());
  -            if (operations.containsKey(new MBeanOperationSignature(method))) {
  -                methodTable[index] = new InvokeMBean(method, false, false);
  -            } else if (method.getName().startsWith("get") && attributes.containsKey(method.getName().substring(3)))
{
  -                methodTable[index] = new InvokeMBean(method, true, true);
  -            } else if (method.getName().startsWith("is") && attributes.containsKey(method.getName().substring(2)))
{
  -                methodTable[index] = new InvokeMBean(method, true, true);
  -            } else if (method.getName().startsWith("set") && attributes.containsKey(method.getName().substring(3)))
{
  -                methodTable[index] = new InvokeMBean(method, true, false);
  +            String superName = MethodProxy.getSuperName(fastClass.getJavaClass(), method);
  +            if (superName != null) {
  +                int index = fastClass.getIndex(superName, method.getParameterTypes());
  +                if (operations.containsKey(new MBeanOperationSignature(method))) {
  +                    methodTable[index] = new InvokeMBean(method, false, false);
  +                } else if (method.getName().startsWith("get") && attributes.containsKey(method.getName().substring(3)))
{
  +                    methodTable[index] = new InvokeMBean(method, true, true);
  +                } else if (method.getName().startsWith("is") && attributes.containsKey(method.getName().substring(2)))
{
  +                    methodTable[index] = new InvokeMBean(method, true, true);
  +                } else if (method.getName().startsWith("set") && attributes.containsKey(method.getName().substring(3)))
{
  +                    methodTable[index] = new InvokeMBean(method, true, false);
  +                }
               }
           }
           return factory.newInstance(new MBeanProxyCallback(methodTable, server, objectName));
  
  
  

Mime
View raw message