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 MBeanProxyFactory.java
Date Tue, 11 Nov 2003 20:22:36 GMT
dain        2003/11/11 12:22:36

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/jmx
                        MBeanProxyFactory.java
  Log:
  Set classloader to be used for proxy directly. CGLib sometimes guess wrong.
  
  Revision  Changes    Path
  1.5       +11 -6     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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- MBeanProxyFactory.java	10 Nov 2003 00:22:34 -0000	1.4
  +++ MBeanProxyFactory.java	11 Nov 2003 20:22:36 -0000	1.5
  @@ -69,6 +69,8 @@
   import net.sf.cglib.proxy.Factory;
   import net.sf.cglib.proxy.SimpleCallbacks;
   import net.sf.cglib.proxy.MethodProxy;
  +import net.sf.cglib.proxy.CallbackFilter;
  +import net.sf.cglib.proxy.Callbacks;
   import net.sf.cglib.reflect.FastClass;
   
   /**
  @@ -93,11 +95,14 @@
           assert server != null;
   
           // get the factory
  -        Factory factory = Enhancer.create(
  -                Object.class,
  -                new Class[]{iface},
  -                new InterfaceCallbackFilter(iface),
  -                new SimpleCallbacks());
  +        Enhancer enhancer = new Enhancer();
  +        enhancer.setSuperclass(Object.class);
  +        enhancer.setInterfaces(new Class[]{iface});
  +        enhancer.setCallbackFilter(new InterfaceCallbackFilter(iface));
  +        enhancer.setCallbacks(new SimpleCallbacks());
  +        enhancer.setClassLoader(iface.getClassLoader());
  +
  +        Factory factory = enhancer.create();
   
           // build the method table
           if (objectName.isPattern()) {
  
  
  

Mime
View raw message