Author: dallen6
Date: 2010-07-29 08:21:41 -0400 (Thu, 29 Jul 2010)
New Revision: 6838
Added:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyMethodHandler.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
core/trunk/tests/src/main/java/org/jboss/weld/test/Utils.java
Log:
Changed proxy classes to no longer directly reference Weld implementation classes
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java 2010-07-29
11:34:15 UTC (rev 6837)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyFactory.java 2010-07-29
12:21:41 UTC (rev 6838)
@@ -23,14 +23,11 @@
import java.util.Collections;
import javassist.CtClass;
-import javassist.CtConstructor;
import javassist.CtMethod;
-import javassist.CtNewConstructor;
import javassist.CtNewMethod;
import javassist.NotFoundException;
-import javax.decorator.Delegate;
-
+import org.jboss.interceptor.util.proxy.TargetInstanceProxy;
import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.ParameterInjectionPoint;
@@ -73,31 +70,25 @@
}
}
- @Override
- protected void addConstructors(CtClass proxyClassType)
+ private void addHandlerInitializerMethod(CtClass proxyClassType) throws Exception
{
- try
- {
- CtClass baseType = getClassPool().get(getBeanType().getName());
- for (CtConstructor constructor : baseType.getConstructors())
- {
- int delegateInjectionPosition = getDelegateInjectionPosition(constructor);
- if (delegateInjectionPosition >= 0)
- {
-
proxyClassType.addConstructor(CtNewConstructor.make(constructor.getParameterTypes(),
constructor.getExceptionTypes(), createDelegateInitializerCode(null,
delegateInjectionPosition), proxyClassType));
- }
- else
- {
- proxyClassType.addConstructor(CtNewConstructor.copy(constructor,
proxyClassType, null));
- }
- }
- }
- catch (Exception e)
- {
- throw new WeldException(e);
- }
+ CtClass objectClass = getClassPool().get(Object.class.getName());
+ proxyClassType.addMethod(CtNewMethod.make(Modifier.PRIVATE, CtClass.voidType,
"_initMH", new CtClass[] { objectClass }, null,
createMethodHandlerInitializerBody(proxyClassType), proxyClassType));
}
+ private String createMethodHandlerInitializerBody(CtClass proxyClassType)
+ {
+ StringBuilder bodyString = new StringBuilder();
+ bodyString.append("{ methodHandler = (javassist.util.proxy.MethodHandler)
methodHandler.invoke($0, ");
+ bodyString.append(proxyClassType.getName());
+ bodyString.append(".class.getDeclaredMethod(\"");
+ bodyString.append("_initMH");
+ bodyString.append("\", new Class[]{Object.class}");
+ bodyString.append("), null, $args); }");
+ log.trace("Created MH initializer body for proxy: " +
bodyString.toString());
+ return bodyString.toString();
+ }
+
@Override
protected void addMethodsFromClass(CtClass proxyClassType)
{
@@ -114,23 +105,27 @@
}
try
{
+ if (delegateParameterPosition >= 0)
+ {
+ addHandlerInitializerMethod(proxyClassType);
+ }
for (CtMethod method : proxyClassType.getMethods())
{
if
(!method.getDeclaringClass().getName().equals("java.lang.Object") ||
method.getName().equals("toString"))
{
- log.trace("Adding method " + method.getLongName());
String methodBody = null;
if ((delegateParameterPosition >= 0) &&
(initializerMethod.equals(method.getName())))
{
methodBody = createDelegateInitializerCode(initializerMethod,
delegateParameterPosition);
}
- else if (Modifier.isAbstract(method.getModifiers()))
+ if (Modifier.isAbstract(method.getModifiers()))
{
methodBody = createAbstractMethodCode(method);
}
if (methodBody != null)
{
+ log.trace("Adding method " + method.getLongName() + "
" + methodBody);
proxyClassType.addMethod(CtNewMethod.make(method.getReturnType(),
method.getName(), method.getParameterTypes(), method.getExceptionTypes(), methodBody,
proxyClassType));
}
}
@@ -177,11 +172,12 @@
}
else
{
- // Use the associated bean instance to invoke the method
- bodyString.append("beanInstance.invoke(");
+ // Use the associated method handler to invoke the method
+ bodyString.append("methodHandler.invoke($0,");
if (Modifier.isPublic(delegateMethod.getModifiers()))
{
-
bodyString.append("beanInstance.getInstanceType().getMethod(\"");
+ bodyString.append(getTargetClass());
+ bodyString.append(".getMethod(\"");
log.trace("Using getMethod in proxy for method " +
method.getLongName());
}
else
@@ -193,12 +189,21 @@
bodyString.append(method.getName());
bodyString.append("\", ");
bodyString.append(getSignatureClasses(method));
- bodyString.append("), $args); }");
+ bodyString.append("), null, $args); }");
}
return bodyString.toString();
}
+ private String getTargetClass()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("((Class)methodHandler.invoke($0,");
+ buffer.append(TargetInstanceProxy.class.getName());
+ buffer.append(".class.getMethod(\"getTargetClass\", null), null,
null))");
+ return buffer.toString();
+ }
+
private String createDelegateInitializerCode(String initializerName, int
delegateParameterPosition)
{
StringBuilder buffer = new StringBuilder();
@@ -209,30 +214,11 @@
buffer.append(initializerName);
}
buffer.append("($$);\n");
- buffer.append("beanInstance = new ");
- buffer.append(TargetBeanInstance.class.getName());
+ buffer.append("_initMH");
buffer.append("($");
buffer.append(delegateParameterPosition + 1);
buffer.append("); }");
return buffer.toString();
}
- private int getDelegateInjectionPosition(CtConstructor constructor)
- {
- int position = -1;
- Object[][] parameterAnnotations = constructor.getAvailableParameterAnnotations();
- for (int i = 0; i < parameterAnnotations.length; i++)
- {
- for (int j = 0; j < parameterAnnotations[i].length; j++)
- {
- if (parameterAnnotations[i][j] instanceof Delegate)
- {
- position = i;
- break;
- }
- }
- }
- return position;
- }
-
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java 2010-07-29
11:34:15 UTC (rev 6837)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java 2010-07-29
12:21:41 UTC (rev 6838)
@@ -41,6 +41,7 @@
import javassist.CtNewConstructor;
import javassist.CtNewMethod;
import javassist.NotFoundException;
+import javassist.util.proxy.ProxyObject;
import org.jboss.interceptor.proxy.LifecycleMixin;
import org.jboss.interceptor.util.proxy.TargetInstanceProxy;
@@ -176,7 +177,7 @@
{
throw new DefinitionException(PROXY_INSTANTIATION_BEAN_ACCESS_FAILED, e, this);
}
- ((Proxy) proxy).proxy_setInstance(beanInstance);
+ ((ProxyObject) proxy).setHandler(new ProxyMethodHandler(beanInstance));
return proxy;
}
@@ -234,7 +235,7 @@
*/
public static boolean isProxy(Object proxySuspect)
{
- return proxySuspect instanceof Proxy;
+ return proxySuspect instanceof ProxyObject;
}
/**
@@ -245,10 +246,10 @@
*/
public static <T> void setBeanInstance(T proxy, BeanInstance beanInstance)
{
- if (proxy instanceof Proxy)
+ if (proxy instanceof ProxyObject)
{
- Proxy proxyView = (Proxy) proxy;
- proxyView.proxy_setInstance(beanInstance);
+ ProxyObject proxyView = (ProxyObject) proxy;
+ proxyView.setHandler(new ProxyMethodHandler(beanInstance));
}
}
@@ -273,9 +274,9 @@
private Class<T> createProxyClass(String proxyClassName) throws Exception
{
ArraySet<Class<?>> specialInterfaces = new
ArraySet<Class<?>>(3);
- specialInterfaces.add(Proxy.class);
specialInterfaces.add(LifecycleMixin.class);
specialInterfaces.add(TargetInstanceProxy.class);
+ specialInterfaces.add(ProxyObject.class);
// Remove special interfaces from main set (deserialization scenario)
additionalInterfaces.removeAll(specialInterfaces);
@@ -347,7 +348,7 @@
{
// The field representing the underlying instance or special method
// handling
- proxyClassType.addField(new
CtField(classPool.get("org.jboss.weld.bean.proxy.BeanInstance"),
"beanInstance", proxyClassType));
+ proxyClassType.addField(new
CtField(classPool.get("javassist.util.proxy.MethodHandler"),
"methodHandler", proxyClassType));
// Special field used during serialization of a proxy
proxyClassType.addField(new CtField(CtClass.booleanType,
"firstSerializationPhaseComplete", proxyClassType), "false");
}
@@ -386,7 +387,7 @@
// replacement object and the subsequent call get the proxy object.
CtClass exception = classPool.get(ObjectStreamException.class.getName());
CtClass objectClass = classPool.get(Object.class.getName());
- String writeReplaceBody = "{ " + " if
(firstSerializationPhaseComplete) {" + " firstSerializationPhaseComplete =
false; " + " return $0; " + " } else {" + "
firstSerializationPhaseComplete = true; " + " return new
org.jboss.weld.bean.proxy.util.SerializableProxy($0);" + " } }";
+ String writeReplaceBody = createWriteReplaceBody(proxyClassType);
proxyClassType.addMethod(CtNewMethod.make(objectClass, "writeReplace",
null, new CtClass[] { exception }, writeReplaceBody, proxyClassType));
// Also add a static method that can be used to deserialize a proxy
@@ -406,6 +407,22 @@
}
+ private String createWriteReplaceBody(CtClass proxyClassType)
+ {
+ StringBuilder bodyString = new StringBuilder();
+ bodyString.append("{\n");
+ bodyString.append(" if (firstSerializationPhaseComplete) {\n");
+ bodyString.append(" firstSerializationPhaseComplete = false;\n");
+ bodyString.append(" return $0;\n");
+ bodyString.append(" } else {\n");
+ bodyString.append(" firstSerializationPhaseComplete = true;\n");
+ bodyString.append(" return methodHandler.invoke($0,");
+ bodyString.append(proxyClassType.getName());
+ bodyString.append(".class.getMethod(\"writeReplace\", null), null,
$args);\n");
+ bodyString.append(" }\n}");
+ return bodyString.toString();
+ }
+
protected void addMethodsFromClass(CtClass proxyClassType)
{
try
@@ -441,7 +458,7 @@
/**
* Creates the given method on the proxy class where the implementation
- * forwards the call directly to the bean instance.
+ * forwards the call directly to the method handler.
*
* @param method any Javassist method
* @return a string containing the method body code to be compiled
@@ -463,7 +480,7 @@
// Assume this is a void method
}
- bodyString.append("beanInstance.invoke(");
+ bodyString.append("methodHandler.invoke($0, ");
bodyString.append(method.getDeclaringClass().getName());
if (Modifier.isPublic(method.getModifiers()))
{
@@ -478,7 +495,7 @@
bodyString.append(method.getName());
bodyString.append("\", ");
bodyString.append(getSignatureClasses(method));
- bodyString.append("), $args); }");
+ bodyString.append("), null, $args); }");
return bodyString.toString();
}
@@ -530,10 +547,6 @@
{
try
{
- // Add public getter/setter pair for the instance locator
- proxyClassType.addMethod(CtNewMethod.make("public
org.jboss.weld.bean.proxy.BeanInstance proxy_getInstance() { return beanInstance; }",
proxyClassType));
- proxyClassType.addMethod(CtNewMethod.make("public void
proxy_setInstance(org.jboss.weld.bean.proxy.BeanInstance beanInstance) { this.beanInstance
= beanInstance; }", proxyClassType));
-
// Add special methods for interceptors
CtClass lifecycleMixinClass = classPool.get(LifecycleMixin.class.getName());
for (CtMethod method : lifecycleMixinClass.getDeclaredMethods())
@@ -544,8 +557,11 @@
CtClass targetInstanceProxyClass =
classPool.get(TargetInstanceProxy.class.getName());
CtMethod getInstanceMethod =
targetInstanceProxyClass.getDeclaredMethod("getTargetInstance");
CtMethod getInstanceClassMethod =
targetInstanceProxyClass.getDeclaredMethod("getTargetClass");
- proxyClassType.addMethod(CtNewMethod.make(getInstanceMethod.getReturnType(),
getInstanceMethod.getName(), getInstanceMethod.getParameterTypes(),
getInstanceMethod.getExceptionTypes(), "{ return beanInstance.getInstance(); }",
proxyClassType));
-
proxyClassType.addMethod(CtNewMethod.make(getInstanceClassMethod.getReturnType(),
getInstanceClassMethod.getName(), getInstanceClassMethod.getParameterTypes(),
getInstanceClassMethod.getExceptionTypes(), "{ return beanInstance.getInstanceType();
}", proxyClassType));
+ proxyClassType.addMethod(CtNewMethod.make(getInstanceMethod.getReturnType(),
getInstanceMethod.getName(), getInstanceMethod.getParameterTypes(),
getInstanceMethod.getExceptionTypes(), createSpecialInterfaceBody(getInstanceMethod,
TargetInstanceProxy.class), proxyClassType));
+
proxyClassType.addMethod(CtNewMethod.make(getInstanceClassMethod.getReturnType(),
getInstanceClassMethod.getName(), getInstanceClassMethod.getParameterTypes(),
getInstanceClassMethod.getExceptionTypes(),
createSpecialInterfaceBody(getInstanceClassMethod, TargetInstanceProxy.class),
proxyClassType));
+ CtClass proxyObjectClass = classPool.get(ProxyObject.class.getName());
+ CtMethod setMethodHandlerMethod =
proxyObjectClass.getDeclaredMethod("setHandler");
+
proxyClassType.addMethod(CtNewMethod.make(setMethodHandlerMethod.getReturnType(),
setMethodHandlerMethod.getName(), setMethodHandlerMethod.getParameterTypes(),
setMethodHandlerMethod.getExceptionTypes(), "{ methodHandler = $1; }",
proxyClassType));
}
catch (Exception e)
{
@@ -565,13 +581,26 @@
protected String createSpecialInterfaceBody(CtMethod method, Class<?>
interfaceClazz) throws NotFoundException
{
StringBuilder bodyString = new StringBuilder();
- bodyString.append("{ beanInstance.invoke(");
+ bodyString.append("{\n");
+ try
+ {
+ if (method.getReturnType() != null)
+ {
+ bodyString.append("return ($r)");
+ }
+ }
+ catch (NotFoundException e)
+ {
+ // Assume this is a void method
+ }
+
+ bodyString.append("methodHandler.invoke($0, ");
bodyString.append(interfaceClazz.getName());
bodyString.append(".class.getDeclaredMethod(\"");
bodyString.append(method.getName());
bodyString.append("\", ");
bodyString.append(getSignatureClasses(method));
- bodyString.append("), $args); }");
+ bodyString.append("), null, $args); }");
return bodyString.toString();
}
Added: core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyMethodHandler.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyMethodHandler.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ProxyMethodHandler.java 2010-07-29
12:21:41 UTC (rev 6838)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.bean.proxy;
+
+import static org.jboss.weld.logging.Category.BEAN;
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+import static
org.jboss.weld.logging.messages.BeanMessage.BEAN_INSTANCE_NOT_SET_ON_PROXY;
+
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import javassist.util.proxy.MethodHandler;
+
+import org.jboss.interceptor.util.proxy.TargetInstanceProxy;
+import org.jboss.weld.exceptions.WeldException;
+import org.jboss.weld.logging.messages.BeanMessage;
+import org.slf4j.cal10n.LocLogger;
+
+/**
+ * A general purpose MethodHandler for all proxies which routes calls to the
+ * {@link BeanInstance} associated with this proxy or handler.
+ *
+ * @author David Allen
+ *
+ */
+public class ProxyMethodHandler implements MethodHandler, Serializable
+{
+ // The log provider
+ protected static final LocLogger log = loggerFactory().getLogger(BEAN);
+
+ // The bean instance to forward calls to
+ private BeanInstance beanInstance;
+
+ public ProxyMethodHandler(BeanInstance beanInstance)
+ {
+ this.beanInstance = beanInstance;
+ }
+
+ /* (non-Javadoc)
+ * @see javassist.util.proxy.MethodHandler#invoke(java.lang.Object,
java.lang.reflect.Method, java.lang.reflect.Method, java.lang.Object[])
+ */
+ public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args)
throws Throwable
+ {
+ log.trace("MethodHandler processing call to " + thisMethod + " for
" + self.getClass());
+ if (thisMethod.getDeclaringClass().equals(TargetInstanceProxy.class))
+ {
+ if (beanInstance == null)
+ {
+ throw new WeldException(BEAN_INSTANCE_NOT_SET_ON_PROXY);
+ }
+ if (thisMethod.getName().equals("getTargetInstance"))
+ {
+ return beanInstance.getInstance();
+ }
+ else if (thisMethod.getName().equals("getTargetClass"))
+ {
+ return beanInstance.getInstanceType();
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else if (thisMethod.getName().equals("writeReplace"))
+ {
+ return new org.jboss.weld.bean.proxy.util.SerializableProxy(self);
+ }
+ else if (thisMethod.getName().equals("_initMH"))
+ {
+ log.trace("Setting new MethodHandler with bean instance for " +
args[0] + " on " + self.getClass());
+ return new ProxyMethodHandler(new TargetBeanInstance(args[0]));
+ }
+ else
+ {
+ if (beanInstance == null)
+ {
+ throw new WeldException(BEAN_INSTANCE_NOT_SET_ON_PROXY);
+ }
+ return beanInstance.invoke(thisMethod, args);
+ }
+ }
+
+}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java 2010-07-29
11:34:15 UTC (rev 6837)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java 2010-07-29
12:21:41 UTC (rev 6838)
@@ -17,12 +17,18 @@
package org.jboss.weld.injection;
+import java.lang.annotation.Annotation;
import java.util.List;
import javax.decorator.Decorator;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.weld.bean.proxy.BeanInstance;
+import org.jboss.weld.bean.proxy.DecoratorProxyFactory;
+import org.jboss.weld.bean.proxy.TargetBeanInstance;
import org.jboss.weld.introspector.WeldConstructor;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* A wrapper on a {@link ConstructorInjectionPoint}, to be used if a proxy subclass is
instantiated instead of the
@@ -38,6 +44,7 @@
public class ProxyClassConstructorInjectionPointWrapper<T> extends
ConstructorInjectionPoint<T>
{
private ConstructorInjectionPoint<T> originalConstructorInjectionPoint;
+ private Object decoratorDelegate = null;
public ProxyClassConstructorInjectionPointWrapper(Bean<T> declaringBean,
WeldConstructor<T> weldConstructor, ConstructorInjectionPoint<T>
originalConstructorInjectionPoint)
{
@@ -50,4 +57,29 @@
{
return originalConstructorInjectionPoint.getWeldParameters();
}
+
+ @Override
+ protected Object[] getParameterValues(List<ParameterInjectionPoint<?, T>>
parameters, Object specialVal, Class<? extends Annotation> specialParam,
BeanManagerImpl manager, CreationalContext<?> creationalContext)
+ {
+ Object[] parameterValues = super.getParameterValues(parameters, specialVal,
specialParam, manager, creationalContext);
+ // Check if any of the injections are for a delegate
+ for (ParameterInjectionPoint<?, T> parameter : getWeldParameters())
+ {
+ if (parameter.isDelegate())
+ {
+ decoratorDelegate = parameterValues[parameter.getPosition()];
+ }
+ }
+ return parameterValues;
+ }
+
+ @Override
+ public T newInstance(BeanManagerImpl manager, CreationalContext<?>
creationalContext)
+ {
+ // Once the instance is created, a method handler is required regardless of
whether
+ // an actual bean instance is known yet.
+ T instance = super.newInstance(manager, creationalContext);
+ DecoratorProxyFactory.setBeanInstance(instance, decoratorDelegate == null ? null :
new TargetBeanInstance(decoratorDelegate));
+ return instance;
+ }
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java 2010-07-29
11:34:15 UTC (rev 6837)
+++
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanMessage.java 2010-07-29
12:21:41 UTC (rev 6838)
@@ -135,6 +135,7 @@
@MessageId("000097")
PRODUCER_METHOD_WITH_TYPE_VARIABLE_RETURN_TYPE_MUST_BE_DEPENDENT,
@MessageId("000098")
PRODUCER_METHOD_WITH_WILDCARD_RETURN_TYPE_MUST_BE_DEPENDENT,
@MessageId("000099") CANNOT_LOAD_CLASS,
- @MessageId("001500") PROXY_DESERIALIZATION_FAILURE;
+ @MessageId("001500") PROXY_DESERIALIZATION_FAILURE,
+ @MessageId("001501") BEAN_INSTANCE_NOT_SET_ON_PROXY;
}
Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties
===================================================================
---
core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2010-07-29
11:34:15 UTC (rev 6837)
+++
core/trunk/impl/src/main/resources/org/jboss/weld/messages/bean_en.properties 2010-07-29
12:21:41 UTC (rev 6838)
@@ -99,3 +99,4 @@
PRODUCER_METHOD_WITH_WILDCARD_RETURN_TYPE_MUST_BE_DEPENDENT=A producer method with a
parameterized return type with a wildcard must be declared @Dependent scoped. Method {0}
CANNOT_LOAD_CLASS=Cannot load class {0} during deserialization of proxy
PROXY_DESERIALIZATION_FAILURE=Failed to deserialize proxy object
+BEAN_INSTANCE_NOT_SET_ON_PROXY=Method call requires a BeanInstance which has not been set
for this proxy
Modified: core/trunk/tests/src/main/java/org/jboss/weld/test/Utils.java
===================================================================
--- core/trunk/tests/src/main/java/org/jboss/weld/test/Utils.java 2010-07-29 11:34:15 UTC
(rev 6837)
+++ core/trunk/tests/src/main/java/org/jboss/weld/test/Utils.java 2010-07-29 12:21:41 UTC
(rev 6838)
@@ -31,11 +31,12 @@
import java.util.List;
import java.util.Set;
+import javassist.util.proxy.ProxyObject;
+
import javax.el.ELContext;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.util.TypeLiteral;
-import org.jboss.weld.bean.proxy.Proxy;
import org.jboss.weld.exceptions.UnsatisfiedResolutionException;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.el.EL;
@@ -172,6 +173,6 @@
public static boolean isProxy(Object proxy)
{
- return proxy instanceof Proxy;
+ return proxy instanceof ProxyObject;
}
}