openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r758931 - in /incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: component/ context/creational/ conversation/ jsf/ util/
Date Thu, 26 Mar 2009 23:51:06 GMT
Author: gerdogdu
Date: Thu Mar 26 23:51:05 2009
New Revision: 758931

URL: http://svn.apache.org/viewvc?rev=758931&view=rev
Log:
Update conversation management.

Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextFactory.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JSFUtil.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java?rev=758931&r1=758930&r2=758931&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ComponentImpl.java
Thu Mar 26 23:51:05 2009
@@ -17,6 +17,7 @@
 
 import javax.context.CreationalContext;
 
+import org.apache.webbeans.context.creational.CreationalContextFactory;
 import org.apache.webbeans.exception.WebBeansException;
 import org.apache.webbeans.inject.InjectableConstructor;
 import org.apache.webbeans.intercept.InterceptorType;
@@ -88,6 +89,8 @@
             }
 
         }
+        
+        CreationalContextFactory.getInstance().removeCreationalContext(this);
     }
 
     /**

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextFactory.java?rev=758931&r1=758930&r2=758931&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextFactory.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextFactory.java
Thu Mar 26 23:51:05 2009
@@ -41,6 +41,11 @@
         return impl.getCreationalContextImpl(bean);   
     }
     
+    public void removeCreationalContext(Bean<?> bean)
+    {
+        impl.remove(bean);
+    }
+    
     public void clear()
     {
         impl.clear();

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java?rev=758931&r1=758930&r2=758931&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/creational/CreationalContextImpl.java
Thu Mar 26 23:51:05 2009
@@ -55,6 +55,14 @@
         return incompleteInstancesMap.get(incompleteBean);
     }
     
+    public void remove(Bean<?> bean)
+    {
+        if(this.incompleteInstancesMap.containsKey(bean))
+        {
+            this.incompleteInstancesMap.remove(bean);   
+        }
+    }
+    
     public void clear()
     {
         this.incompleteInstancesMap.clear();

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=758931&r1=758930&r2=758931&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
Thu Mar 26 23:51:05 2009
@@ -64,6 +64,8 @@
     public void end()
     {
         this.longRunning = false;
+        
+        ConversationManager.getInstance().removeConversation(this);
     }
 
     public String getId()

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java?rev=758931&r1=758930&r2=758931&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/jsf/WebBeansPhaseListener.java
Thu Mar 26 23:51:05 2009
@@ -111,11 +111,11 @@
                 context.setActive(false);
             }
 
-            // else destroy cınversation context
+            // else destroy conversation context
             else
             {
                 logger.info("Destroying the conversation context for view id : " + JSFUtil.getViewId());
-                context.destroy();
+                context.destroy();                                    
             }
 
         }
@@ -166,6 +166,19 @@
 
                 viewRoot.getChildren().add(hidden);
             }
+            else
+            {
+                //Remove the hidden component
+                UIViewRoot viewRoot = JSFUtil.getViewRoot();
+
+                HtmlInputHidden hidden = (HtmlInputHidden) viewRoot.findComponent("javax_webbeans_ConversationId");
+
+                if (hidden != null)
+                {
+                    viewRoot.getChildren().remove(hidden);
+                }
+                
+            }
         }
 
     }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JSFUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JSFUtil.java?rev=758931&r1=758930&r2=758931&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JSFUtil.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/JSFUtil.java
Thu Mar 26 23:51:05 2009
@@ -14,6 +14,7 @@
 package org.apache.webbeans.util;
 
 import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UIViewRoot;
 import javax.faces.component.html.HtmlInputHidden;
@@ -62,6 +63,12 @@
     {
         return getCurrentFacesContext().getApplication();
     }
+    
+    public static void addInfoMessage(String message)
+    {
+        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO,message,"");
+        getCurrentFacesContext().addMessage(null, fm);
+    }
 
     public static String getRedirectViewId(String redirectId)
     {



Mime
View raw message