Package org.jruby.runtime.builtin

Examples of org.jruby.runtime.builtin.IRubyObject.toJava()


     * Gets the plugin that owns the container.
     */
    public static RubyPlugin from(Ruby r) {
        IRubyObject v = r.evalScriptlet("Jenkins::Plugin.instance.peer");
        if (v==null)        return null;
        return (RubyPlugin) v.toJava(RubyPlugin.class);
    }
   
    public Klass<RubyModule> klassFor(RubyModule module) {
        return module!=null ? new Klass<RubyModule>(module,navigator) : null;
    }
View Full Code Here


        }

        public Object next() {
            IRubyObject element = elt(index);
            last = index++;
            return element.toJava(Object.class);
        }

        public void remove() {
            if (last == -1) throw new IllegalStateException();
View Full Code Here

    // getComponentConfiguration is executed in the topology creation time, before serialisation.
    // just create tmp bolt instance to call getComponentConfiguration.

    IRubyObject ruby_bolt = initialize_ruby_bolt();
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), ruby_bolt, "get_component_configuration");
    return (Map)ruby_result.toJava(Map.class);
  }

  private IRubyObject initialize_ruby_bolt() {
    __ruby__ = Ruby.getGlobalRuntime();
View Full Code Here

    // getComponentConfiguration is executed in the topology creation time, before serialisation.
    // just create tmp bolt instance to call getComponentConfiguration.

    IRubyObject ruby_bolt = initialize_ruby_bolt();
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), ruby_bolt, "get_component_configuration");
    return (Map)ruby_result.toJava(Map.class);
  }

  protected IRubyObject initialize_ruby_bolt() {
    __ruby__ = Ruby.getGlobalRuntime();
View Full Code Here

    // getComponentConfiguration is executed in the topology creation time, before serialisation.
    // just create tmp bolt instance to call getComponentConfiguration.

    IRubyObject ruby_bolt = initialize_ruby_bolt();
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), ruby_bolt, "get_component_configuration");
    return (Map)ruby_result.toJava(Map.class);
  }

  private IRubyObject initialize_ruby_bolt() {
    __ruby__ = Ruby.getGlobalRuntime();
View Full Code Here

  @Override
  public Fields getOutputFields() {
    IRubyObject ruby_spout = initialize_ruby_spout();
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), ruby_spout, "get_output_fields");
    return (Fields)ruby_result.toJava(Fields.class);
  }

  @Override
  public Map<String, Object> getComponentConfiguration() {
    // getComponentConfiguration is executed in the topology creation time, before serialisation.
View Full Code Here

    // getComponentConfiguration is executed in the topology creation time, before serialisation.
    // just create tmp spout instance to call getComponentConfiguration.

    IRubyObject ruby_spout = initialize_ruby_spout();
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), ruby_spout, "get_component_configuration");
    return (Map)ruby_result.toJava(Map.class);
  }

  private IRubyObject initialize_ruby_spout() {
    __ruby__ = Ruby.getGlobalRuntime();
View Full Code Here

      IRubyObject _ruby_spout = initialize_ruby_spout();
    }
    IRubyObject ruby_conf = JavaUtil.convertJavaToRuby(__ruby__, conf);
    IRubyObject ruby_context = JavaUtil.convertJavaToRuby(__ruby__, context);
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), _ruby_spout, "get_emitter", ruby_conf, ruby_context);
    return (ICommitterTransactionalSpout.Emitter)ruby_result.toJava(ICommitterTransactionalSpout.Emitter.class);
  }
}
View Full Code Here

      IRubyObject _ruby_spout = initialize_ruby_spout();
    }
    IRubyObject ruby_conf = JavaUtil.convertJavaToRuby(__ruby__, conf);
    IRubyObject ruby_context = JavaUtil.convertJavaToRuby(__ruby__, context);
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), _ruby_spout, "get_coordinator", ruby_conf, ruby_context);
    return (ITransactionalSpout.Coordinator)ruby_result.toJava(ITransactionalSpout.Coordinator.class);
  }

  @Override
  public ITransactionalSpout.Emitter getEmitter(Map conf, TopologyContext context) {
    if (_ruby_spout == null) {
View Full Code Here

      IRubyObject _ruby_spout = initialize_ruby_spout();
    }
    IRubyObject ruby_conf = JavaUtil.convertJavaToRuby(__ruby__, conf);
    IRubyObject ruby_context = JavaUtil.convertJavaToRuby(__ruby__, context);
    IRubyObject ruby_result = Helpers.invoke(__ruby__.getCurrentContext(), _ruby_spout, "get_emitter", ruby_conf, ruby_context);
    return (ITransactionalSpout.Emitter)ruby_result.toJava(ITransactionalSpout.Emitter.class);
  }

  @Override
  public void declareOutputFields(OutputFieldsDeclarer declarer) {
    // declareOutputFields is executed in the topology creation time, before serialisation.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.