Skip to content

Commit

Permalink
add all business interfaces explictly
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed May 21, 2010
1 parent 02b5f98 commit 92e8058
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/weld/bean/SessionBean.java
Expand Up @@ -245,7 +245,7 @@ protected void initTypes()

protected void initProxyClass()
{
this.proxyClass = new EnterpriseProxyFactory<T>(getWeldAnnotated().getJavaClass()).getProxyClass();
this.proxyClass = new EnterpriseProxyFactory<T>(getWeldAnnotated().getJavaClass(), getTypes()).getProxyClass();
}

/**
Expand Down
Expand Up @@ -17,13 +17,15 @@

package org.jboss.weld.bean.proxy;

import java.lang.reflect.Type;
import java.util.Set;

import javassist.CtClass;
import javassist.CtConstructor;
import javassist.CtMethod;
import javassist.CtNewConstructor;
import javassist.CtNewMethod;

import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.util.reflection.Reflections;

/**
* This factory produces proxies specific for enterprise beans, in particular
Expand All @@ -41,9 +43,18 @@ public class EnterpriseProxyFactory<T> extends ProxyFactory<T>
*
* @param proxiedBeanType the actual enterprise bean
*/
public EnterpriseProxyFactory(Class<T> proxiedBeanType)
public EnterpriseProxyFactory(Class<T> proxiedBeanType, Set<Type> localBusinessInterfaces)
{
super(proxiedBeanType);
for (Type type : localBusinessInterfaces)
{
Class<?> c = Reflections.getRawType(type);
// Ignore no-interface views, they are dealt with proxiedBeanType (pending redesign)
if (c.isInterface())
{
addInterface(c);
}
}
}

@Override
Expand Down

0 comments on commit 92e8058

Please sign in to comment.