Package org.apache.bsf

Examples of org.apache.bsf.BSFException


            } else {
                jExpr = ScriptFactory.createScript((String) expr);
            }
            return jExpr.execute(jc);
        } catch (Exception e) {
            throw new BSFException(BSFException.REASON_OTHER_ERROR, e.getMessage(), e);
        }
    }
View Full Code Here


            } else {
                jExpr = ScriptFactory.createScript((String) script);
            }
            jExpr.execute(jc);
        } catch (Exception e) {
            throw new BSFException(BSFException.REASON_OTHER_ERROR, e.getMessage(), e);
        }
    }
View Full Code Here

                types[i] = args[i].getClass();
            }
            Method m = object.getClass().getMethod(name, types);
            return m.invoke(object, args);
        } catch (Exception e) {
            throw new BSFException(BSFException.REASON_OTHER_ERROR, e.getMessage(), e);
        }
    }
View Full Code Here

            //can't cache the script because the context may be different.
            //but don't bother loading parsing the class again
            Script s = InvokerHelper.createScript(scriptClass, context);
            return s.run();
        } catch (Exception e) {
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Groovy: " + e, e);
        }
    }
View Full Code Here

                LOG.fine("exec() - Using cached version of class...");
            }
            InvokerHelper.invokeMethod(scriptClass, "main", EMPTY_ARGS);
        } catch (Exception e) {
            LOG.log(Level.WARNING, "BSF trace", e);
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "exception from Groovy: " + e, e);
        }
    }
View Full Code Here

    public void testHandleException() throws BSFException {
        logger1.info("handleException");
        BSFManager manager = new BSFManager();
        JRubyEngine instance = new JRubyEngine();
        instance.initialize(manager, "jruby", null);
        BSFException bsfExcptn = new BSFException(BSFException.REASON_EXECUTION_ERROR, "test", new NullPointerException());
        instance.handleException(bsfExcptn);
    }
View Full Code Here

    public Object eval(String file, int line, int col, Object expr) throws BSFException {
        try {
            return run(file, line, expr);
        } catch (Exception excptn) {
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "Exception", excptn);
        }
    }
View Full Code Here

    @Override
    public void exec(String file, int line, int col, Object expr) throws BSFException {
        try {
            run(file, line, expr);
        } catch (Exception excptn) {
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "Exception", excptn);
        }
    }
View Full Code Here

                return adapter.callMethod(recv, method, Object.class);
            } else {
                return adapter.callMethod(recv, method, args, Object.class);
            }
        } catch (Exception excptn) {
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, excptn.getMessage(), excptn);
        }
    }
View Full Code Here

    public Object eval(String file, int line, int col, Object expr) throws BSFException {
        try {
            return JavaEmbedUtils.rubyToJava(evaler.parse(runtime, expr.toString(), file, line).run());
        } catch (Exception excptn) {
            throw new BSFException(BSFException.REASON_EXECUTION_ERROR, "Exception", excptn);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.bsf.BSFException

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.