org.jruby.Ruby.newInstance()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.jruby.Ruby.newInstance方法的一些代码示例,展示了Ruby.newInstance的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newInstance方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newInstance

Ruby.newInstance介绍

[英]Returns a new instance of the JRuby runtime configured with defaults.
[中]返回用默认值配置的JRuby运行时的新实例。

代码示例

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * @deprecated use #newInstance()
  3. */
  4. public static Ruby getDefaultInstance() {
  5. return newInstance();
  6. }

代码示例来源:origin: org.jruby/jruby-complete

  1. /**
  2. * Get the global runtime.
  3. *
  4. * @return the global runtime
  5. */
  6. public static synchronized Ruby getGlobalRuntime() {
  7. if (globalRuntime == null) {
  8. newInstance();
  9. }
  10. return globalRuntime;
  11. }

代码示例来源:origin: org.jruby/jruby-complete

  1. /**
  2. * @deprecated use #newInstance()
  3. */
  4. public static Ruby getDefaultInstance() {
  5. return newInstance();
  6. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. public Ruby getThreadSafeRuntime() {
  2. if (runtime == null) {
  3. // stopped loading java library (runtime.getLoadService().require("java");)
  4. // during the intialization process.
  5. runtime = Ruby.newInstance(config);
  6. initialized = true;
  7. }
  8. return runtime;
  9. }

代码示例来源:origin: org.jruby/jruby-complete

  1. Ruby getRuntime() {
  2. if (runtime == null) {
  3. synchronized(this) {
  4. if (runtime == null) {
  5. runtime = Ruby.newInstance(config);
  6. }
  7. }
  8. }
  9. return runtime;
  10. }

代码示例来源:origin: org.jruby/jruby-core

  1. Ruby getRuntime() {
  2. if (runtime == null) {
  3. synchronized(this) {
  4. if (runtime == null) {
  5. runtime = Ruby.newInstance(config);
  6. }
  7. }
  8. }
  9. return runtime;
  10. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * Get the global runtime.
  3. *
  4. * @return the global runtime
  5. */
  6. public static synchronized Ruby getGlobalRuntime() {
  7. if (globalRuntime == null) {
  8. newInstance();
  9. }
  10. return globalRuntime;
  11. }

代码示例来源:origin: org.jruby/jruby-complete

  1. /**
  2. * Returns a new instance of the JRuby runtime configured with defaults.
  3. *
  4. * @return the JRuby runtime
  5. * @see org.jruby.RubyInstanceConfig
  6. */
  7. public static Ruby newInstance() {
  8. return newInstance(new RubyInstanceConfig());
  9. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * Returns a new instance of the JRuby runtime configured with defaults.
  3. *
  4. * @return the JRuby runtime
  5. * @see org.jruby.RubyInstanceConfig
  6. */
  7. public static Ruby newInstance() {
  8. return newInstance(new RubyInstanceConfig());
  9. }

代码示例来源:origin: org.jruby/jruby-core

  1. /**
  2. * Returns a new instance of the JRuby runtime configured with defaults.
  3. *
  4. * @return the JRuby runtime
  5. * @see org.jruby.RubyInstanceConfig
  6. */
  7. public static Ruby newInstance() {
  8. return newInstance(new RubyInstanceConfig());
  9. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. public Ruby getRuntime() {
  2. initializeLocalContext();
  3. if (localContext.runtime == null) {
  4. // stopped loading java library (runtime.getLoadService().require("java");)
  5. // during the intialization process.
  6. localContext.runtime = Ruby.newInstance(config);
  7. localContext.initialized = true;
  8. }
  9. return localContext.runtime;
  10. }

代码示例来源:origin: org.jruby/jruby-complete

  1. Ruby getGlobalRuntime(AbstractLocalContextProvider provider) {
  2. if ( isGlobalRuntimeReady() ) {
  3. return Ruby.getGlobalRuntime();
  4. }
  5. return Ruby.newInstance(provider.config);
  6. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. public Ruby getRuntime() {
  2. if (!Ruby.isGlobalRuntimeReady()) {
  3. return Ruby.newInstance(config);
  4. }
  5. return Ruby.getGlobalRuntime();
  6. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. public Ruby getRuntime() {
  2. if (!Ruby.isGlobalRuntimeReady()) {
  3. return Ruby.newInstance(config);
  4. }
  5. return Ruby.getGlobalRuntime();
  6. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. public Ruby getRuntime() {
  2. if (!Ruby.isGlobalRuntimeReady()) {
  3. return Ruby.newInstance(config);
  4. }
  5. return Ruby.getGlobalRuntime();
  6. }

代码示例来源:origin: org.zkoss.zk/zk

  1. public void init(Page owner, String zslang) {
  2. super.init(owner, zslang);
  3. _runtime = Ruby.newInstance();
  4. _runtime.setGlobalVariables(new Variables(_runtime));
  5. }

代码示例来源:origin: org.jruby/jruby-core

  1. /**
  2. * Get an instance of a JRuby runtime.
  3. * @param loadPaths additional load paths you wish to add
  4. * @param config a runtime configuration instance
  5. * @return an instance
  6. */
  7. public static Ruby initialize(List<String> loadPaths, RubyInstanceConfig config) {
  8. Ruby runtime = Ruby.newInstance(config);
  9. runtime.getLoadService().addPaths(loadPaths);
  10. runtime.getLoadService().require("java");
  11. return runtime;
  12. }

代码示例来源:origin: org.jruby/jruby-complete

  1. /**
  2. * Get an instance of a JRuby runtime.
  3. * @param loadPaths additional load paths you wish to add
  4. * @param config a runtime configuration instance
  5. * @return an instance
  6. */
  7. public static Ruby initialize(List<String> loadPaths, RubyInstanceConfig config) {
  8. Ruby runtime = Ruby.newInstance(config);
  9. runtime.getLoadService().addPaths(loadPaths);
  10. runtime.getLoadService().require("java");
  11. return runtime;
  12. }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * Get an instance of a JRuby runtime.
  3. * @param loadPaths additional load paths you wish to add
  4. * @param config a runtime configuration instance
  5. * @return an instance
  6. */
  7. public static Ruby initialize(List loadPaths, RubyInstanceConfig config) {
  8. Ruby runtime = Ruby.newInstance(config);
  9. runtime.getLoadService().addPaths((List<String>)loadPaths);
  10. runtime.getLoadService().require("java");
  11. return runtime;
  12. }

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

  1. /**
  2. * Get an instance of a JRuby runtime.
  3. * @param loadPaths additional load paths you wish to add
  4. * @param config a runtime configuration instance
  5. * @return an instance
  6. */
  7. public static Ruby initialize(List loadPaths, RubyInstanceConfig config) {
  8. Ruby runtime = Ruby.newInstance(config);
  9. runtime.getLoadService().addPaths((List<String>)loadPaths);
  10. runtime.getLoadService().require("java");
  11. return runtime;
  12. }

相关文章

Ruby类方法