Title: [912] trunk/rails-integration: Merge in shared class cache changes
Revision
912
Author
nicksieger
Date
2008-02-18 19:38:16 -0500 (Mon, 18 Feb 2008)

Log Message

Merge in shared class cache changes

Modified Paths


Diff

Modified: trunk/rails-integration/pom.xml (911 => 912)


--- trunk/rails-integration/pom.xml	2008-02-17 21:06:37 UTC (rev 911)
+++ trunk/rails-integration/pom.xml	2008-02-19 00:38:16 UTC (rev 912)
@@ -260,5 +260,4 @@
       </snapshots>
     </pluginRepository>
   </pluginRepositories>
-
 </project>

Modified: trunk/rails-integration/src/main/java/org/jruby/webapp/RailsFactory.java (911 => 912)


--- trunk/rails-integration/src/main/java/org/jruby/webapp/RailsFactory.java	2008-02-17 21:06:37 UTC (rev 911)
+++ trunk/rails-integration/src/main/java/org/jruby/webapp/RailsFactory.java	2008-02-19 00:38:16 UTC (rev 912)
@@ -7,6 +7,8 @@
 import org.jruby.RubyHash;
 import org.jruby.exceptions.RaiseException;
 import org.jruby.javasupport.JavaEmbedUtils;
+import org.jruby.util.ClassCache;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -15,6 +17,7 @@
 import java.util.concurrent.atomic.AtomicInteger;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
+
 /**
  * Creates instance of the JRuby runtime and loads Rails.
  *
@@ -28,10 +31,12 @@
     private Map environment;
     private Map environmentOverrides;
     private AtomicInteger objectCount;
-
+    private ClassCache classCache;
+    
     public RailsFactory() {
         objectCount = new AtomicInteger();
         environmentOverrides = new HashMap();
+        classCache = JavaEmbedUtils.createClassCache(Thread.currentThread().getContextClassLoader());
     }
 
     public void setRailsRoot(String railsRoot) {
@@ -79,11 +84,6 @@
         loadPaths.add(railsRoot);
         loadPaths.add("META-INF/jruby.home/lib/ruby/site_ruby/1.8");
 
-        // Currently the context classloader at JRuby initialization time must be
-		// one that's not likely to be disposed of, or we'll get classloader errors
-		// See JRUBY-905 for more details
-        Thread.currentThread().setContextClassLoader(RailsFactory.class.getClassLoader());
-
         // start JRuby
         Ruby runtime;
         try {
@@ -167,7 +167,7 @@
     }
 
     protected Ruby createRubyRuntime(List loadPaths) {
-        return JavaEmbedUtils.initialize(loadPaths);
+        return JavaEmbedUtils.initialize(loadPaths, classCache);
     }
 
     public boolean validateObject(Object object) {
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to