Package org.jruby.runtime

Examples of org.jruby.runtime.CompiledBlockCallback19


                    mv.areturn();

                    mv.visitMaxs(2, 3);
                    c = endCall(cw, mv, mname);
                }
                CompiledBlockCallback19 ic = (CompiledBlockCallback19) c.getConstructor(Object.class).newInstance(scriptObject);
                return ic;
            } catch (IllegalArgumentException e) {
                throw e;
            } catch (Exception e) {
                e.printStackTrace();
View Full Code Here


    @Deprecated
    public CompiledBlockCallback19 getBlockCallback19(String method, final Object scriptObject) {
        try {
            final Method blockMethod = scriptObject.getClass().getMethod(method, new Class[]{ThreadContext.class, IRubyObject.class, IRubyObject[].class, Block.class});
            return new CompiledBlockCallback19() {
                public IRubyObject call(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
                    try {
                        return (IRubyObject)blockMethod.invoke(scriptObject, new Object[]{context, self, args, block});
                    } catch (IllegalAccessException ex) {
                        throw new RuntimeException(ex);
View Full Code Here

    public CompiledBlockCallback19 getBlockCallback19(String method, final String file, final int line, final Object scriptObject) {
        try {
            Class scriptClass = scriptObject.getClass();
            final Method blockMethod = scriptClass.getMethod(method, scriptClass, ThreadContext.class, IRubyObject.class, IRubyObject[].class, Block.class);
            return new CompiledBlockCallback19() {
                public IRubyObject call(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
                    try {
                        return (IRubyObject)blockMethod.invoke(null, scriptObject, context, self, args, block);
                    } catch (IllegalAccessException ex) {
                        throw new RuntimeException(ex);
View Full Code Here

                        }
                    }
                }
            }
               
            CompiledBlockCallback19 ic = (CompiledBlockCallback19) c.getConstructor(Object.class).newInstance(scriptObject);
            return ic;
        } catch (IllegalArgumentException e) {
            throw e;
        } catch (Exception e) {
            throw new IllegalArgumentException(e.getMessage());
View Full Code Here

                        }
                    }
                }
            }
               
            CompiledBlockCallback19 ic = (CompiledBlockCallback19) c.getConstructor(Object.class).newInstance(scriptObject);
            return ic;
        } catch (IllegalArgumentException e) {
            throw e;
        } catch (Exception e) {
            throw new IllegalArgumentException(e.getMessage());
View Full Code Here

    public CompiledBlockCallback19 getBlockCallback19(String method, final String file, final int line, final Object scriptObject) {
        try {
            Class scriptClass = scriptObject.getClass();
            final Method blockMethod = scriptClass.getMethod(method, scriptClass, ThreadContext.class, IRubyObject.class, IRubyObject[].class, Block.class);
            return new CompiledBlockCallback19() {
                public IRubyObject call(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
                    try {
                        return (IRubyObject)blockMethod.invoke(null, scriptObject, context, self, args, block);
                    } catch (IllegalAccessException ex) {
                        throw new RuntimeException(ex);
View Full Code Here

                        }
                    }
                }
            }
               
            CompiledBlockCallback19 ic = (CompiledBlockCallback19) c.getConstructor(Object.class).newInstance(scriptObject);
            return ic;
        } catch (IllegalArgumentException e) {
            throw e;
        } catch (Exception e) {
            throw new IllegalArgumentException(e.getMessage());
View Full Code Here

     *
     */
    @JRubyMethod
    public IRubyObject to_proc(ThreadContext context, Block unusedBlock) {
        Ruby runtime = context.runtime;
        CompiledBlockCallback19 callback = new CompiledBlockCallback19() {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
                return method.call(context, receiver, originModule, originName, args, block);
            }

View Full Code Here

    public CompiledBlockCallback19 getBlockCallback19(String method, final String file, final int line, final Object scriptObject) {
        try {
            Class scriptClass = scriptObject.getClass();
            final Method blockMethod = scriptClass.getMethod(method, scriptClass, ThreadContext.class, IRubyObject.class, IRubyObject[].class, Block.class);
            return new CompiledBlockCallback19() {
                public IRubyObject call(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) {
                    try {
                        return (IRubyObject)blockMethod.invoke(null, scriptObject, context, self, args, block);
                    } catch (IllegalAccessException ex) {
                        throw new RuntimeException(ex);
View Full Code Here

TOP

Related Classes of org.jruby.runtime.CompiledBlockCallback19

Copyright © 2018 www.massapicom. 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.