[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...
Gavin King
gavin.king at jboss.com
Tue Jul 10 04:57:36 EDT 2007
User: gavin
Date: 07/07/10 04:57:36
Modified: src/main/org/jboss/seam/core ResourceBundle.java
Log:
JBSEAM-1606, JBSEAM 1632
Revision Changes Path
1.35 +11 -11 jboss-seam/src/main/org/jboss/seam/core/ResourceBundle.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ResourceBundle.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ResourceBundle.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- ResourceBundle.java 8 Jul 2007 21:13:36 -0000 1.34
+++ ResourceBundle.java 10 Jul 2007 08:57:36 -0000 1.35
@@ -1,6 +1,6 @@
package org.jboss.seam.core;
-import static org.jboss.seam.ScopeType.SESSION;
+import static org.jboss.seam.ScopeType.EVENT;
import static org.jboss.seam.annotations.Install.BUILT_IN;
import java.util.ArrayList;
@@ -39,6 +39,11 @@
public class ResourceBundle
{
+ private static final long serialVersionUID = -3236251335438092538L;
+ private static final LogProvider log = Logging.getLogProvider(ResourceBundle.class);
+
+ private String[] bundleNames = {"messages"};
+
protected java.util.Locale getCurrentLocale()
{
//TODO:
@@ -110,6 +115,8 @@
String viewId = Pages.getCurrentViewId();
if (viewId!=null)
{
+ //we can't cache these bundles, since the viewId
+ //may change in the middle of a request
return Pages.instance().getResourceBundles(viewId);
}
else
@@ -119,11 +126,6 @@
}
}
- private static final long serialVersionUID = -3236251335438092538L;
- private static final LogProvider log = Logging.getLogProvider(ResourceBundle.class);
-
- private String[] bundleNames = {"messages"};
-
/**
* The configurable list of delegate resource bundle names
*
@@ -198,14 +200,12 @@
}
/**
- * Create a ResourceBundle in the session scope. The session scope is used because
- * creating the bundle is somewhat expensive, so it can be cached there because
- * the session Locale changes infrequently. When the Locale is changed, LocaleSelector
- * is responsible for removing the ResourceBundle from the session context.
+ * Create a ResourceBundle in the event scope. When the Locale is changed, LocaleSelector
+ * is responsible for removing the ResourceBundle from the event context.
*
* @return a ResourceBundle that wraps all the delegate bundles
*/
- @Factory(value="org.jboss.seam.core.resourceBundle", autoCreate=true, scope=SESSION)
+ @Factory(value="org.jboss.seam.core.resourceBundle", autoCreate=true, scope=EVENT)
public java.util.ResourceBundle getBundle()
{
return createUberBundle();
More information about the jboss-cvs-commits
mailing list