dblevins 2004/04/13 23:27:22
Modified: modules/core/src/java/org/openejb/client
CgLibProxyFactory.java
Log:
Setup jndi url handler in container constructor
Fixed part of our serialization problems. More to come....
Revision Changes Path
1.3 +5 -7
openejb/modules/core/src/java/org/openejb/client/CgLibProxyFactory.java
Index: CgLibProxyFactory.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/client/CgLibProxyFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- CgLibProxyFactory.java 10 Mar 2004 09:20:18 -0000 1.2
+++ CgLibProxyFactory.java 14 Apr 2004 03:27:22 -0000 1.3
@@ -44,6 +44,7 @@
*/
package org.openejb.client;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Properties;
@@ -93,16 +94,13 @@
public Object newProxyInstance(Class superClass, Class[] interfaces,
InvocationHandler handler)
throws IllegalArgumentException {
-// System.out.println();
-// try {
-// throw new Exception("[proxy] "+superClass+" "+interfaces[0]);
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
CgLibInvocationHandler interceptor = new CgLibInvocationHandler(handler);
Enhancer enhancer = getEnhancer(superClass,interfaces);
enhancer.setCallbacks(new Callback[]{NoOp.INSTANCE, interceptor});
+
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ enhancer.setClassLoader(cl);
return enhancer.create(new Class[]{CgLibInvocationHandler.class}, new
Object[]{interceptor});
}