[webbeans-commits] Webbeans SVN: r1206 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean and 2 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Fri Jan 23 12:13:43 EST 2009
Author: pete.muir at jboss.org
Date: 2009-01-23 12:13:42 -0500 (Fri, 23 Jan 2009)
New Revision: 1206
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpiseBeanInstance.java
Modified:
examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/SentenceParser.java
examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/TextTranslator.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Proxies.java
Log:
Proxy classloading ordering, make enterprise bean destruction actually work
Modified: examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/SentenceParser.java
===================================================================
--- examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/SentenceParser.java 2009-01-23 15:09:48 UTC (rev 1205)
+++ examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/SentenceParser.java 2009-01-23 17:13:42 UTC (rev 1206)
@@ -3,7 +3,7 @@
import java.util.Arrays;
import java.util.List;
-public class SentenceParser
+public class SentenceParser
{
public List<String> parse(String text)
Modified: examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/TextTranslator.java
===================================================================
--- examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/TextTranslator.java 2009-01-23 15:09:48 UTC (rev 1205)
+++ examples/trunk/translator/webbeans-translator-ejb/src/main/java/org/jboss/webbeans/examples/translator/TextTranslator.java 2009-01-23 17:13:42 UTC (rev 1206)
@@ -1,8 +1,10 @@
package org.jboss.webbeans.examples.translator;
+import java.io.Serializable;
+
import javax.webbeans.Initializer;
-public class TextTranslator
+public class TextTranslator implements Serializable
{
private SentenceParser sentenceParser;
private Translator sentenceTranslator;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-01-23 15:09:48 UTC (rev 1205)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-01-23 17:13:42 UTC (rev 1206)
@@ -249,6 +249,7 @@
protected boolean injectionPointsAreSerializable()
{
+ // TODO CACHE THIS!!!
// TODO: a bit crude, don't check *all* injectionpoints, only those listed
// in the spec for passivation checks
for (AnnotatedItem<?, ?> injectionPoint : getAnnotatedInjectionPoints())
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-01-23 15:09:48 UTC (rev 1205)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-01-23 17:13:42 UTC (rev 1206)
@@ -18,7 +18,8 @@
package org.jboss.webbeans.bean;
import java.lang.reflect.Type;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.Set;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
@@ -31,6 +32,7 @@
import javax.webbeans.Interceptor;
import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.bean.proxy.EnterpiseBeanInstance;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanProxyMethodHandler;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.ejb.InternalEjbDescriptor;
@@ -133,17 +135,19 @@
protected void initTypes()
{
- types = new HashSet<Type>();
+ types = new LinkedHashSet<Type>();
+ types.add(Object.class);
for (BusinessInterfaceDescriptor<?> businessInterfaceDescriptor : ejbDescriptor.getLocalBusinessInterfaces())
{
types.add(businessInterfaceDescriptor.getInterface());
}
- types.add(Object.class);
}
protected void initProxyClass()
{
- ProxyFactory proxyFactory = Proxies.getProxyFactory(getTypes());
+ Set<Type> types = new LinkedHashSet<Type>(getTypes());
+ types.add(EnterpiseBeanInstance.class);
+ ProxyFactory proxyFactory = Proxies.getProxyFactory(types);
@SuppressWarnings("unchecked")
Class<T> proxyClass = proxyFactory.createClass();
@@ -241,6 +245,7 @@
@Override
public void destroy(T instance)
{
+ EnterpiseBeanInstance enterpiseBeanInstance = (EnterpiseBeanInstance) instance;
Boolean isDestroyed = (Boolean) Reflections.invokeAndWrap("isDestroyed", null, instance, null);
if (isDestroyed.booleanValue())
{
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpiseBeanInstance.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpiseBeanInstance.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpiseBeanInstance.java 2009-01-23 17:13:42 UTC (rev 1206)
@@ -0,0 +1,8 @@
+package org.jboss.webbeans.bean.proxy;
+
+public interface EnterpiseBeanInstance
+{
+
+ public boolean isDestroyed();
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/EnterpiseBeanInstance.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2009-01-23 15:09:48 UTC (rev 1205)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/proxy/ProxyPool.java 2009-01-23 17:13:42 UTC (rev 1206)
@@ -19,7 +19,7 @@
import java.io.Serializable;
import java.lang.reflect.Type;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.Callable;
@@ -77,7 +77,7 @@
try
{
ClientProxyMethodHandler proxyMethodHandler = new ClientProxyMethodHandler(bean, beanIndex);
- Set<Type> classes = new HashSet<Type>(bean.getTypes());
+ Set<Type> classes = new LinkedHashSet<Type>(bean.getTypes());
classes.add(Serializable.class);
ProxyFactory proxyFactory = Proxies.getProxyFactory(classes);
proxyFactory.setHandler(proxyMethodHandler);
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Proxies.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-01-23 15:09:48 UTC (rev 1205)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-01-23 17:13:42 UTC (rev 1206)
@@ -17,8 +17,8 @@
package org.jboss.webbeans.util;
import java.lang.reflect.Type;
-import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.Set;
import javassist.util.proxy.ProxyFactory;
@@ -46,8 +46,8 @@
private TypeInfo()
{
super();
- this.interfaces = new HashSet<Class<?>>();
- this.classes = new HashSet<Class<?>>();
+ this.interfaces = new LinkedHashSet<Class<?>>();
+ this.classes = new LinkedHashSet<Class<?>>();
}
public Class<?> getSuperClass()
More information about the weld-commits
mailing list