Examples of newRuntimeError()


Examples of org.jruby.Ruby.newRuntimeError()

        checkPointer(runtime, pointerArg);

        // If no release method is defined, then memory leaks will result.
        if (!getMetaClass().respondsTo("release")) {
                throw runtime.newRuntimeError("No release method defined");
        }

        setMemoryIO(((Pointer) pointerArg).getMemoryIO());
        this.pointer = (Pointer) pointerArg;
        referenceSet.put(reaper = new Reaper(this, pointer, getMetaClass(), "release"), Boolean.TRUE);
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        ClassData classData = (ClassData) ffiHandle;

        // If no release method is defined, then memory leaks will result.
        DynamicMethod releaseMethod = classData.releaseCallSite.retrieveCache(getMetaClass().getMetaClass(), classData.releaseCallSite.getMethodName()).method;
        if (releaseMethod.isUndefined()) {
            throw runtime.newRuntimeError("release method undefined");

        } else if ((releaseMethod.getArity().isFixed() && releaseMethod.getArity().required() != 1) || releaseMethod.getArity().required() > 1) {
            throw runtime.newRuntimeError("wrong number of arguments to release method ("
                    + 1 + " for " + releaseMethod.getArity().required()  + ")");
        }
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        DynamicMethod releaseMethod = classData.releaseCallSite.retrieveCache(getMetaClass().getMetaClass(), classData.releaseCallSite.getMethodName()).method;
        if (releaseMethod.isUndefined()) {
            throw runtime.newRuntimeError("release method undefined");

        } else if ((releaseMethod.getArity().isFixed() && releaseMethod.getArity().required() != 1) || releaseMethod.getArity().required() > 1) {
            throw runtime.newRuntimeError("wrong number of arguments to release method ("
                    + 1 + " for " + releaseMethod.getArity().required()  + ")");
        }


        setMemoryIO(((Pointer) pointerArg).getMemoryIO());
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

                            }
                        } else {
                            result[0] = selector.select();
                        }
                    } catch (IOException ioe) {
                        throw runtime.newRuntimeError("Error with selector: " + ioe.getMessage());
                    }
                }

                public void wakeup() {
                    selector.wakeup();
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        }

        if (block.isGiven()) {
            Boolean blocking = (Boolean)recv.getInternalVariables().getInternalVariable("group_blocking");
            if (blocking != null && blocking) {
                throw runtime.newRuntimeError("parallel group iteration");
            }
            try {
                recv.getInternalVariables().setInternalVariable("group_blocking", true);

                ThreadContext context = runtime.getCurrentContext();
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

    @JRubyMethod(module = true)
    public static IRubyObject result(ThreadContext context, IRubyObject self) {
        Ruby runtime = context.runtime;
       
        if (!runtime.getCoverageData().isCoverageEnabled()) {
            throw runtime.newRuntimeError("coverage measurement is not enabled");
        }
       
        Map<String, Integer[]> coverage = runtime.getCoverageData().resetCoverage(runtime);
       
        // populate a Ruby Hash with coverage data
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

            RubyClass clazz = (RubyClass)runtime.getClassFromPath("Diametric::Persistence::Object");
            DiametricObject diametric_object = (DiametricObject)clazz.allocate();
            diametric_object.update(result);
            return diametric_object;
        } catch (Throwable t) {
            throw runtime.newRuntimeError(t.getMessage());
        }
    }
}
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        Object query = null;
        if (args[0] instanceof RubyArray) {
            try {
                query = DiametricUtils.fromRubyArray(context, (RubyArray)args[0]);
            } catch (Throwable t) {
                throw runtime.newRuntimeError(t.getMessage());
            }
        } else if (args[0] instanceof RubyString) {
            query = DiametricUtils.rubyStringToJava(args[0]);
        }
        if (query == null) {
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

                    inputs[i] = DiametricUtils.convertRubyToJava(context, args[i+2]);
                }
                results = query_with_args(query, database, inputs);
            }
        } catch (Throwable t) {
            throw runtime.newRuntimeError("Datomic Exception: " + t.getMessage());
        }

        if (results == null) return context.getRuntime().getNil();
        RubyClass clazz = (RubyClass)context.getRuntime().getClassFromPath("Diametric::Persistence::Set");
        DiametricSet diametric_set = (DiametricSet)clazz.allocate();
View Full Code Here

Examples of org.jruby.Ruby.newRuntimeError()

        } else if (arg instanceof RubyFixnum) {
            dbid = ((RubyFixnum)arg).toJava(Long.class);
        } else {
            throw runtime.newArgumentError("Argument should be dbid");
        }
        if (saved_connection == null) throw runtime.newRuntimeError("Connection is not established");
        try {
            Object database = DiametricService.getFn("datomic.api", "db").invoke(saved_connection.toJava());
            Object entity = DiametricService.getFn("datomic.api", "entity").invoke(database, dbid);
            RubyClass clazz = (RubyClass) context.getRuntime().getClassFromPath("Diametric::Persistence::Entity");
            DiametricEntity ruby_entity = (DiametricEntity)clazz.allocate();
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.