[seam-commits] Seam SVN: r11983 - in branches/community/Seam_2_2/src: main/org/jboss/seam/international and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Jan 22 13:39:43 EST 2010


Author: youngm
Date: 2010-01-22 13:39:43 -0500 (Fri, 22 Jan 2010)
New Revision: 11983

Modified:
   branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
   branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
   branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
Log:
JBSEAM-4525

Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java	2010-01-22 10:58:27 UTC (rev 11982)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java	2010-01-22 18:39:43 UTC (rev 11983)
@@ -17,7 +17,6 @@
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
 import org.jboss.seam.international.StatusMessage;
 import org.jboss.seam.international.StatusMessages;
 import org.jboss.seam.util.Strings;
@@ -347,10 +346,14 @@
    
    public static FacesMessages instance()
    {
-      if ( !Contexts.isConversationContextActive() )
+      Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+      if(component != null)
       {
-         throw new IllegalStateException("No active conversation context");
+         if ( !component.getScope().isContextActive() )
+         {
+            throw new IllegalStateException("No active "+component.getScope().name()+" context");
+         }
       }
-      return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME, ScopeType.CONVERSATION);
+      return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME);
    }
 }

Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java	2010-01-22 10:58:27 UTC (rev 11982)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java	2010-01-22 18:39:43 UTC (rev 11983)
@@ -371,14 +371,16 @@
    
    protected static void runTasks()
    {
-      if ( Contexts.isConversationContextActive() )
+      Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+      if( component != null && !component.getScope().isContextActive() )
       {
-         StatusMessages statusMessages = instance();
-         if (statusMessages != null)
-         {
-            statusMessages.doRunTasks();
-         }
+         return;
       }
+      StatusMessages statusMessages = instance();
+      if ( statusMessages != null )
+      {
+         statusMessages.doRunTasks();
+      }
    }
    
    protected void doRunTasks()
@@ -392,11 +394,15 @@
    
    public static StatusMessages instance()
    {
-      if ( !Contexts.isConversationContextActive() )
+      Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+      if(component != null)
       {
-         throw new IllegalStateException("No active conversation context");
+         if ( !component.getScope().isContextActive() )
+         {
+            throw new IllegalStateException("No active "+component.getScope().name()+" context");
+         }
       }
-      return (StatusMessages) Component.getInstance(COMPONENT_NAME, ScopeType.CONVERSATION);
+      return (StatusMessages) Component.getInstance(COMPONENT_NAME);
    }
 
 }

Modified: branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
===================================================================
--- branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java	2010-01-22 10:58:27 UTC (rev 11982)
+++ branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java	2010-01-22 18:39:43 UTC (rev 11983)
@@ -10,7 +10,6 @@
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
 import org.jboss.seam.international.StatusMessage;
 import org.jboss.seam.international.StatusMessages;
 
@@ -38,11 +37,15 @@
    
    public static WicketStatusMessages instance()
    {
-      if ( !Contexts.isConversationContextActive() )
+      Component component = Component.forName(StatusMessages.COMPONENT_NAME);
+      if(component != null)
       {
-         throw new IllegalStateException("No active conversation context");
+         if ( !component.getScope().isContextActive() )
+         {
+            throw new IllegalStateException("No active "+component.getScope().name()+" context");
+         }
       }
-      return (WicketStatusMessages) Component.getInstance(StatusMessages.COMPONENT_NAME, ScopeType.CONVERSATION);
+      return (WicketStatusMessages) Component.getInstance(StatusMessages.COMPONENT_NAME);
    }
 
 }



More information about the seam-commits mailing list