openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r907128 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/container/SerializableBean.java test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
Date Fri, 05 Feb 2010 23:18:14 GMT
Author: struberg
Date: Fri Feb  5 23:18:14 2010
New Revision: 907128

URL: http://svn.apache.org/viewvc?rev=907128&view=rev
Log:
OWB-6 force SerializableBean construction via SerializableBeanVault and add JavaDoc

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBean.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBean.java?rev=907128&r1=907127&r2=907128&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBean.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/SerializableBean.java
Fri Feb  5 23:18:14 2010
@@ -49,19 +49,25 @@
     private Bean<T> bean;
 
     private String id;
-    
+
     /**
-     * @return the deletaged internal Bean. 
+     * @return the delegated internal Bean. 
      */
     public Bean<T> getBean()
     {
         return bean;
     }
 
-    public SerializableBean(Bean<T> bean, String id)
+    /**
+     * This constructor shall not be invoked directly, but only get called
+     * from {@link org.apache.webbeans.container.SerializableBeanVault}
+     * @param bean the PassivationCapable bean which should be made Serializable
+     * @param id the {@link javax.enterprise.inject.spi.PassivationCapable#getId()}
+     */
+    SerializableBean(Bean<T> bean, String id)
     {
         this.bean = bean;
-        this.id  = id;        
+        this.id  = id;
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java?rev=907128&r1=907127&r2=907128&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/contexts/SerializationTest.java
Fri Feb  5 23:18:14 2010
@@ -19,6 +19,7 @@
 */
 
 import org.apache.webbeans.container.SerializableBean;
+import org.apache.webbeans.container.SerializableBeanVault;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.contexts.session.common.PersonalDataBean;
 import org.apache.webbeans.newtests.decorators.multiple.Decorator1;
@@ -97,7 +98,7 @@
             String id = null;
             if((id = WebBeansUtil.isPassivationCapable(bean)) != null)
             {
-                bean = new SerializableBean(bean,id);
+                bean = (Bean<?>) SerializableBeanVault.getInstance().getSerializableBean(bean);
                 
                 byte[] serial = serializeBean(bean);
                 Bean b2 = deSerializeBean(serial);



Mime
View raw message