Author: struberg
Date: Fri Apr 13 19:50:00 2018
New Revision: 1829097

URL: http://svn.apache.org/viewvc?rev=1829097&view=rev
Log:
update to MyFaces-2.3.0 which is EE8 level

Modified:
    openwebbeans/trunk/pom.xml
    
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
    
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
    
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
    
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
    
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationStorageBean.java

Modified: openwebbeans/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/pom.xml?rev=1829097&r1=1829096&r2=1829097&view=diff
==============================================================================
--- openwebbeans/trunk/pom.xml (original)
+++ openwebbeans/trunk/pom.xml Fri Apr 13 19:50:00 2018
@@ -70,7 +70,7 @@
         <geronimo_interceptor.version>1.0</geronimo_interceptor.version>
         <geronimo_validation.version>1.1</geronimo_validation.version>
         <tomcat7.version>7.0.73</tomcat7.version>
-        <myfaces.version>2.2.12</myfaces.version>
+        <myfaces.version>2.3.0</myfaces.version>
         <xbean.version>4.7</xbean.version>
         <arquillian.version>1.1.13.Final</arquillian.version>
         <cdi.tck.version>2.0.3.Final</cdi.tck.version>

Modified: 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java?rev=1829097&r1=1829096&r2=1829097&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
 (original)
+++ 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/AbstractContext.java
 Fri Apr 13 19:50:00 2018
@@ -274,6 +274,7 @@ public abstract class AbstractContext im
     throws IOException
     {
         s.writeObject(scopeType);
+        s.writeBoolean(active);
 
         // we need to repack the Contextual<T> from the componentInstanceMap 
into Serializable ones
         if (componentInstanceMap != null)
@@ -305,6 +306,7 @@ public abstract class AbstractContext im
     throws IOException, ClassNotFoundException
     {
         scopeType = (Class<? extends Annotation>) s.readObject();
+        active = s.readBoolean();
 
         HashMap<Contextual<?>, BeanInstanceBag<?>> serializableInstanceMap =
                 (HashMap<Contextual<?>, BeanInstanceBag<?>>) s.readObject();

Modified: 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java?rev=1829097&r1=1829096&r2=1829097&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
 (original)
+++ 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
 Fri Apr 13 19:50:00 2018
@@ -18,6 +18,9 @@
  */
 package org.apache.webbeans.context;
 
+import java.io.IOException;
+import java.io.ObjectInput;
+import java.io.ObjectOutput;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.enterprise.context.ConversationScoped;
@@ -63,4 +66,18 @@ public class ConversationContext extends
         return conversation;
     }
 
+
+    @Override
+    public void readExternal(ObjectInput in) throws IOException, 
ClassNotFoundException
+    {
+        this.conversation = (ConversationImpl) in.readObject();
+        super.readExternal(in);
+    }
+
+    @Override
+    public void writeExternal(ObjectOutput out) throws IOException
+    {
+        out.writeObject(conversation);
+        super.writeExternal(out);
+    }
 }

Modified: 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=1829097&r1=1829096&r2=1829097&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
 (original)
+++ 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
 Fri Apr 13 19:50:00 2018
@@ -70,9 +70,10 @@ public class ConversationImpl implements
     private transient RuntimeException problemDuringCreation;
 
     /**
-     * This instance is under used and by which threads, Atomicinteger would 
be great but then contract of ContextsService but be enhanced to
+     * This instance is in use and by which threads.
+     * Atomicinteger would be great but then contract of ContextsService would 
need to be enhanced to
      * be compatible wih WBPhaseListeners. Using thread allow to call iUseIt() 
multiple times.
-     * String to be serializable.
+     * Long to be serializable.
      * TODO: serialization should be done manually to use the manager 
otherwise all is broken
      */
     private transient Set<Long> threadsUsingIt = new HashSet<>();

Modified: 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java?rev=1829097&r1=1829096&r2=1829097&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
 (original)
+++ 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
 Fri Apr 13 19:50:00 2018
@@ -36,6 +36,7 @@ import org.apache.webbeans.annotation.De
 import org.apache.webbeans.annotation.DestroyedLiteral;
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.config.WebBeansContext;
+import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.context.ConversationContext;
 import org.apache.webbeans.context.RequestContext;
 import org.apache.webbeans.context.creational.CreationalContextImpl;
@@ -57,7 +58,7 @@ public class ConversationManager
 
 
     private final WebBeansContext webBeansContext;
-    private final ConversationStorageBean conversationStorageBean;
+    private final Bean<Set<ConversationContext>> conversationStorageBean;
 
     /**
      * Creates new conversation manager
@@ -66,8 +67,15 @@ public class ConversationManager
     {
         this.webBeansContext = webBeansContext;
 
-        conversationStorageBean = new ConversationStorageBean(webBeansContext);
-        
webBeansContext.getBeanManagerImpl().addInternalBean(conversationStorageBean);
+        // We cannot use this directly since it will change after passivation
+        ConversationStorageBean convBean = new 
ConversationStorageBean(webBeansContext);
+
+        BeanManagerImpl bm = webBeansContext.getBeanManagerImpl();
+        bm.addInternalBean(convBean);
+
+        // this will returned the internally wrapped ThirdPartyBean. 
+        conversationStorageBean = (Bean<Set<ConversationContext>>)
+                
bm.resolve(bm.getBeans(ConversationStorageBean.OWB_INTERNAL_CONVERSATION_STORAGE_BEAN_PASSIVATION_ID));
     }
 
 
@@ -100,6 +108,7 @@ public class ConversationManager
                             
conversationContext.getConversation().setProblemDuringCreation(problem);
                         }
 
+                        conversationContext.setActive(true);
                         return conversationContext;
                     }
                 }

Modified: 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationStorageBean.java
URL: 
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationStorageBean.java?rev=1829097&r1=1829096&r2=1829097&view=diff
==============================================================================
--- 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationStorageBean.java
 (original)
+++ 
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationStorageBean.java
 Fri Apr 13 19:50:00 2018
@@ -28,7 +28,6 @@ import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
 import java.util.Collections;
-import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -41,7 +40,7 @@ import org.apache.webbeans.context.Conve
  */
 public class ConversationStorageBean implements 
Bean<Set<ConversationContext>>, PassivationCapable, Serializable
 {
-    private static final String 
OWB_INTERNAL_CONVERSATION_STORAGE_BEAN_PASSIVATION_ID = 
"OwbInternalConversationStorageBean";
+    public static final String 
OWB_INTERNAL_CONVERSATION_STORAGE_BEAN_PASSIVATION_ID = 
"apache.openwebbeans.OwbInternalConversationStorageBean";
     private final transient WebBeansContext webBeansContext;
 
     public ConversationStorageBean()
@@ -84,7 +83,7 @@ public class ConversationStorageBean imp
     @Override
     public Class<?> getBeanClass()
     {
-        return Map.class;
+        return Set.class;
     }
 
     @Override
@@ -114,7 +113,7 @@ public class ConversationStorageBean imp
     @Override
     public String getName()
     {
-        return null;
+        return OWB_INTERNAL_CONVERSATION_STORAGE_BEAN_PASSIVATION_ID;
     }
 
     @Override
@@ -157,4 +156,6 @@ public class ConversationStorageBean imp
     {
         return getId().hashCode();
     }
+
+
 }


Reply via email to