@Deprecated public void setClassCache(ClassCache classCache) { if (config != null) { config.setClassCache(classCache); } }
@Deprecated public void setClassCache(ClassCache classCache) { if (config != null) { config.setClassCache(classCache); } }
/** * Changes a ClassCache object to a given one. * Call this method before you use put/get, runScriptlet, and parse methods so that * the given class cache will be used. * * @since JRuby 1.5.0. * * @param cache a new ClassCache object to be set. */ public void setClassCache(ClassCache cache) { provider.getRubyInstanceConfig().setClassCache(cache); }
/** * Changes a ClassCache object to a given one. * Call this method before you use put/get, runScriptlet, and parse methods so that * the given class cache will be used. * * @since JRuby 1.5.0. * * @param cache a new ClassCache object to be set. */ public void setClassCache(ClassCache cache) { provider.getRubyInstanceConfig().setClassCache(cache); }
/** * Get an instance of a JRuby runtime. Provide any loadpaths you want used at startup. * * @param loadPaths to specify where to look for Ruby modules. * @param classCache to use as a common repository for cached classes * @return an instance */ public static Ruby initialize(List loadPaths, ClassCache classCache) { RubyInstanceConfig config = new RubyInstanceConfig(); if (classCache != null) { config.setClassCache(classCache); } return initialize(loadPaths, config); }
private RubyInstanceConfig createRuntimeConfig() { RubyInstanceConfig config = new RubyInstanceConfig(); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (classLoader == null) { classLoader = ClassLoader.getSystemClassLoader(); } config.setClassCache(JavaEmbedUtils.createClassCache(classLoader)); URL resource = RubyInstanceConfig.class.getResource("/META-INF/jruby.home"); if (resource != null && resource.getProtocol().equals("jar")) { try { // http://weblogs.java.net/blog/2007/04/25/how-convert-javaneturl-javaiofile config.setJRubyHome(resource.toURI().getSchemeSpecificPart()); } catch (URISyntaxException e) { config.setJRubyHome(resource.getPath()); } } return config; }
private RubyInstanceConfig createRuntimeConfig() { RubyInstanceConfig config = new RubyInstanceConfig(); config.setCompatVersion(CompatVersion.RUBY1_8); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (classLoader == null) { classLoader = ClassLoader.getSystemClassLoader(); } config.setClassCache(JavaEmbedUtils.createClassCache(classLoader)); URL resource = RubyInstanceConfig.class.getResource("/META-INF/jruby.home"); if (resource != null && resource.getProtocol().equals("jar")) { try { // http://weblogs.java.net/blog/2007/04/25/how-convert-javaneturl-javaiofile config.setJRubyHome(resource.toURI().getSchemeSpecificPart()); } catch (URISyntaxException e) { config.setJRubyHome(resource.getPath()); } } return config; }
private RubyInstanceConfig createRuntimeConfig() { RubyInstanceConfig config = new RubyInstanceConfig(); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (classLoader == null) { classLoader = ClassLoader.getSystemClassLoader(); } config.setClassCache(JavaEmbedUtils.createClassCache(classLoader)); URL resource = RubyInstanceConfig.class.getResource("/META-INF/jruby.home"); if (resource != null && resource.getProtocol().equals("jar")) { try { // http://weblogs.java.net/blog/2007/04/25/how-convert-javaneturl-javaiofile config.setJRubyHome(resource.toURI().getSchemeSpecificPart()); } catch (URISyntaxException e) { config.setJRubyHome(resource.getPath()); } } return config; }
private RubyInstanceConfig createRuntimeConfig() { RubyInstanceConfig config = new RubyInstanceConfig(); config.setCompatVersion(CompatVersion.RUBY1_8); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (classLoader == null) { classLoader = ClassLoader.getSystemClassLoader(); } config.setClassCache(JavaEmbedUtils.createClassCache(classLoader)); URL resource = RubyInstanceConfig.class.getResource("/META-INF/jruby.home"); if (resource != null && resource.getProtocol().equals("jar")) { try { // http://weblogs.java.net/blog/2007/04/25/how-convert-javaneturl-javaiofile config.setJRubyHome(resource.toURI().getSchemeSpecificPart()); } catch (URISyntaxException e) { config.setJRubyHome(resource.getPath()); } } return config; }
/** * Get an instance of a JRuby runtime. Provide any loadpaths you want used at startup. * * @param loadPaths to specify where to look for Ruby modules. * @param classCache to use as a common repository for cached classes * @return an instance */ public static Ruby initialize(List loadPaths, ClassCache classCache) { RubyInstanceConfig config = new RubyInstanceConfig(); if (classCache != null) { config.setClassCache(classCache); } return initialize(loadPaths, config); }
public int run(NGContext context) { context.assertLoopbackClient(); RubyInstanceConfig config = new RubyInstanceConfig(); Main main = new Main(config); config.setCurrentDirectory(context.getWorkingDirectory()); config.setEnvironment(context.getEnv()); // reuse one cache of compiled bodies config.setClassCache(classCache); return main.run(context.getArgs()).getStatus(); } }
public int run(NGContext context) { context.assertLoopbackClient(); RubyInstanceConfig config = new RubyInstanceConfig(); Main main = new Main(config); config.setCurrentDirectory(context.getWorkingDirectory()); config.setEnvironment(context.getEnv()); // reuse one cache of compiled bodies config.setClassCache(classCache); return main.run(context.getArgs()).getStatus(); } }