struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r794116 - in /struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring: ClassReloadingXMLWebApplicationContext.java StrutsSpringObjectFactory.java
Date Tue, 14 Jul 2009 23:44:43 GMT
Author: musachy
Date: Tue Jul 14 23:44:43 2009
New Revision: 794116

URL: http://svn.apache.org/viewvc?rev=794116&view=rev
Log:
Make the class reloading implementation work with convention. (use the reloading class loader
when an instance is requested using the class name)

Modified:
    struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/ClassReloadingXMLWebApplicationContext.java
    struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java

Modified: struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/ClassReloadingXMLWebApplicationContext.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/ClassReloadingXMLWebApplicationContext.java?rev=794116&r1=794115&r2=794116&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/ClassReloadingXMLWebApplicationContext.java
(original)
+++ struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/ClassReloadingXMLWebApplicationContext.java
Tue Jul 14 23:44:43 2009
@@ -209,4 +209,8 @@
 
     public void onStop(FilesystemAlterationObserver filesystemAlterationObserver) {
     }
+
+    public ReloadingClassLoader getReloadingClassLoader() {
+        return classLoader;
+    }
 }

Modified: struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java?rev=794116&r1=794115&r2=794116&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
(original)
+++ struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
Tue Jul 14 23:44:43 2009
@@ -92,10 +92,15 @@
         if ("true".equals(devMode)
                 && StringUtils.isNotBlank(watchList)
                 && appContext instanceof ClassReloadingXMLWebApplicationContext)
{
+            //prevent class caching
+            useClassCache = false;
+
             ClassReloadingXMLWebApplicationContext reloadingContext = (ClassReloadingXMLWebApplicationContext)
appContext;
             reloadingContext.setupReloading(watchList.split(","), acceptClasses, servletContext);
             LOG.info("Class reloading is enabled. Make sure this is not used on a production
environment!", watchList);
 
+            setClassLoader(reloadingContext.getReloadingClassLoader());
+
             //we need to reload the context, so our isntance of the factory is picked up
             reloadingContext.refresh();
         }



Mime
View raw message