Author: pete.muir(a)jboss.org
Date: 2009-01-05 14:20:31 -0500 (Mon, 05 Jan 2009)
New Revision: 779
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
Log:
Needed for EJBs
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java 2009-01-05
19:19:46 UTC (rev 778)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/SimpleBeanProxyMethodHandler.java 2009-01-05
19:20:31 UTC (rev 779)
@@ -28,6 +28,7 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.Reflections;
/**
* A Javassist MethodHandler that delegates method calls to a proxied bean. If
@@ -81,8 +82,7 @@
}
Context context = CurrentManager.rootManager().getContext(bean.getScopeType());
Object proxiedInstance = context.get(bean, true);
- proxiedMethod.setAccessible(true);
- Object returnValue = proxiedMethod.invoke(proxiedInstance, args);
+ Object returnValue = Reflections.lookupMethod(proxiedMethod,
proxiedInstance).invoke(proxiedInstance, args);
log.trace("Executed method " + proxiedMethod + " on " +
proxiedInstance + " with parameters " + args + " and got return value
" + returnValue);
return returnValue;
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-01-05
19:19:46 UTC (rev 778)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-01-05
19:20:31 UTC (rev 779)
@@ -553,7 +553,7 @@
*/
public static Method lookupMethod(Method method, Object instance)
{
- for (Class<? extends Object> clazz = instance.getClass(); clazz !=
Object.class; clazz = clazz.getSuperclass())
+ for (Class<? extends Object> clazz = instance.getClass(); clazz != null;
clazz = clazz.getSuperclass())
{
try
{
Show replies by date