[seam-commits] Seam SVN: r7499 - in trunk/src: main/org/jboss/seam/core and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Mar 3 16:58:24 EST 2008


Author: norman.richards at jboss.com
Date: 2008-03-03 16:58:23 -0500 (Mon, 03 Mar 2008)
New Revision: 7499

Modified:
   trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java
   trunk/src/main/org/jboss/seam/core/Expressions.java
   trunk/src/main/org/jboss/seam/core/ResourceLoader.java
Log:
allow pages to be reloaded from hot deploy filter

Modified: trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java
===================================================================
--- trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java	2008-03-03 16:15:22 UTC (rev 7498)
+++ trunk/src/debug/org/jboss/seam/debug/hot/HotDeployFilter.java	2008-03-03 21:58:23 UTC (rev 7499)
@@ -39,7 +39,6 @@
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
             throws IOException, ServletException
    {
-            
       Init init = (Init) getServletContext().getAttribute( Seam.getComponentName(Init.class) );
       if ( init!=null && init.hasHotDeployableComponents() )
       {
@@ -55,7 +54,13 @@
       }
       
       //TODO: check the timestamp, for a minor optimization
-      getServletContext().removeAttribute( Seam.getComponentName(Pages.class) );
+      
+      // instead 
+      Pages pages = (Pages) getServletContext().getAttribute(Seam.getComponentName(Pages.class));
+      if (pages!= null) {
+          pages.initialize();
+      }
+      
       getServletContext().removeAttribute( Seam.getComponentName(Exceptions.class) );
       
       //TODO: is there anything we should remove from the session scope?

Modified: trunk/src/main/org/jboss/seam/core/Expressions.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/Expressions.java	2008-03-03 16:15:22 UTC (rev 7498)
+++ trunk/src/main/org/jboss/seam/core/Expressions.java	2008-03-03 21:58:23 UTC (rev 7499)
@@ -14,6 +14,7 @@
 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.el.EL;
 import org.jboss.seam.el.SeamExpressionFactory;
 
@@ -248,8 +249,11 @@
    }*/
    
    public static Expressions instance()
-   {
-      return (Expressions) Component.getInstance(Expressions.class, ScopeType.APPLICATION);
+   { 
+       if (!Contexts.isApplicationContextActive()) {
+           return new Expressions();
+       } else {
+           return (Expressions) Component.getInstance(Expressions.class, ScopeType.APPLICATION);
+       }
    }
-   
 }

Modified: trunk/src/main/org/jboss/seam/core/ResourceLoader.java
===================================================================
--- trunk/src/main/org/jboss/seam/core/ResourceLoader.java	2008-03-03 16:15:22 UTC (rev 7498)
+++ trunk/src/main/org/jboss/seam/core/ResourceLoader.java	2008-03-03 21:58:23 UTC (rev 7499)
@@ -12,6 +12,7 @@
 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.contexts.ServletLifecycle;
 import org.jboss.seam.log.LogProvider;
 import org.jboss.seam.log.Logging;
@@ -94,7 +95,11 @@
 
    public static ResourceLoader instance()
    {
-      return (ResourceLoader) Component.getInstance(ResourceLoader.class, ScopeType.STATELESS);
+       if (!Contexts.isApplicationContextActive()) {
+           return new ResourceLoader();
+       } else {
+           return (ResourceLoader) Component.getInstance(ResourceLoader.class, ScopeType.STATELESS);
+       }
    }
    
 }




More information about the seam-commits mailing list