本文整理了Java中org.jruby.Ruby.newInstance
方法的一些代码示例,展示了Ruby.newInstance
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newInstance
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newInstance
[英]Returns a new instance of the JRuby runtime configured with defaults.
[中]返回用默认值配置的JRuby运行时的新实例。
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/**
* @deprecated use #newInstance()
*/
public static Ruby getDefaultInstance() {
return newInstance();
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* Get the global runtime.
*
* @return the global runtime
*/
public static synchronized Ruby getGlobalRuntime() {
if (globalRuntime == null) {
newInstance();
}
return globalRuntime;
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* @deprecated use #newInstance()
*/
public static Ruby getDefaultInstance() {
return newInstance();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public Ruby getThreadSafeRuntime() {
if (runtime == null) {
// stopped loading java library (runtime.getLoadService().require("java");)
// during the intialization process.
runtime = Ruby.newInstance(config);
initialized = true;
}
return runtime;
}
代码示例来源:origin: org.jruby/jruby-complete
Ruby getRuntime() {
if (runtime == null) {
synchronized(this) {
if (runtime == null) {
runtime = Ruby.newInstance(config);
}
}
}
return runtime;
}
代码示例来源:origin: org.jruby/jruby-core
Ruby getRuntime() {
if (runtime == null) {
synchronized(this) {
if (runtime == null) {
runtime = Ruby.newInstance(config);
}
}
}
return runtime;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/**
* Get the global runtime.
*
* @return the global runtime
*/
public static synchronized Ruby getGlobalRuntime() {
if (globalRuntime == null) {
newInstance();
}
return globalRuntime;
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* Returns a new instance of the JRuby runtime configured with defaults.
*
* @return the JRuby runtime
* @see org.jruby.RubyInstanceConfig
*/
public static Ruby newInstance() {
return newInstance(new RubyInstanceConfig());
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/**
* Returns a new instance of the JRuby runtime configured with defaults.
*
* @return the JRuby runtime
* @see org.jruby.RubyInstanceConfig
*/
public static Ruby newInstance() {
return newInstance(new RubyInstanceConfig());
}
代码示例来源:origin: org.jruby/jruby-core
/**
* Returns a new instance of the JRuby runtime configured with defaults.
*
* @return the JRuby runtime
* @see org.jruby.RubyInstanceConfig
*/
public static Ruby newInstance() {
return newInstance(new RubyInstanceConfig());
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public Ruby getRuntime() {
initializeLocalContext();
if (localContext.runtime == null) {
// stopped loading java library (runtime.getLoadService().require("java");)
// during the intialization process.
localContext.runtime = Ruby.newInstance(config);
localContext.initialized = true;
}
return localContext.runtime;
}
代码示例来源:origin: org.jruby/jruby-complete
Ruby getGlobalRuntime(AbstractLocalContextProvider provider) {
if ( isGlobalRuntimeReady() ) {
return Ruby.getGlobalRuntime();
}
return Ruby.newInstance(provider.config);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public Ruby getRuntime() {
if (!Ruby.isGlobalRuntimeReady()) {
return Ruby.newInstance(config);
}
return Ruby.getGlobalRuntime();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public Ruby getRuntime() {
if (!Ruby.isGlobalRuntimeReady()) {
return Ruby.newInstance(config);
}
return Ruby.getGlobalRuntime();
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public Ruby getRuntime() {
if (!Ruby.isGlobalRuntimeReady()) {
return Ruby.newInstance(config);
}
return Ruby.getGlobalRuntime();
}
代码示例来源:origin: org.zkoss.zk/zk
public void init(Page owner, String zslang) {
super.init(owner, zslang);
_runtime = Ruby.newInstance();
_runtime.setGlobalVariables(new Variables(_runtime));
}
代码示例来源:origin: org.jruby/jruby-core
/**
* Get an instance of a JRuby runtime.
* @param loadPaths additional load paths you wish to add
* @param config a runtime configuration instance
* @return an instance
*/
public static Ruby initialize(List<String> loadPaths, RubyInstanceConfig config) {
Ruby runtime = Ruby.newInstance(config);
runtime.getLoadService().addPaths(loadPaths);
runtime.getLoadService().require("java");
return runtime;
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* Get an instance of a JRuby runtime.
* @param loadPaths additional load paths you wish to add
* @param config a runtime configuration instance
* @return an instance
*/
public static Ruby initialize(List<String> loadPaths, RubyInstanceConfig config) {
Ruby runtime = Ruby.newInstance(config);
runtime.getLoadService().addPaths(loadPaths);
runtime.getLoadService().require("java");
return runtime;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/**
* Get an instance of a JRuby runtime.
* @param loadPaths additional load paths you wish to add
* @param config a runtime configuration instance
* @return an instance
*/
public static Ruby initialize(List loadPaths, RubyInstanceConfig config) {
Ruby runtime = Ruby.newInstance(config);
runtime.getLoadService().addPaths((List<String>)loadPaths);
runtime.getLoadService().require("java");
return runtime;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/**
* Get an instance of a JRuby runtime.
* @param loadPaths additional load paths you wish to add
* @param config a runtime configuration instance
* @return an instance
*/
public static Ruby initialize(List loadPaths, RubyInstanceConfig config) {
Ruby runtime = Ruby.newInstance(config);
runtime.getLoadService().addPaths((List<String>)loadPaths);
runtime.getLoadService().require("java");
return runtime;
}
内容来源于网络,如有侵权,请联系作者删除!