Examples of declareBean()


Examples of org.apache.bsf.BSFManager.declareBean()

                log.error("Problem creating BSF manager");
                return;
            }
            mgr.declareBean("sampleEvent", event, SampleEvent.class);
            SampleResult result = event.getResult();
            mgr.declareBean("sampleResult", result, SampleResult.class);
            processFileOrScript(mgr);
            mgr.terminate();
        } catch (BSFException e) {
            log.warn("Problem in BSF script "+e);
        }
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

    public List<?> runGroovy(String script, Object... args) throws Exception {
        List<?> answer;
        BSFManager manager = new BSFManager();

        for (int x = 0; x < args.length; x++) {
            manager.declareBean("arg" + x, args[x], String.class);
        }
        answer = (List) manager.eval("groovy", "script.groovy", 0, 0, script);

        return answer;
    }
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

        try
        {
            IPage page = cycle.getPage();

            bsf.declareBean("component", _component, _component.getClass());
            bsf.declareBean("page", page, page.getClass());
            bsf.declareBean("cycle", cycle, cycle.getClass());

            bsf.exec(
                _language,
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

        try
        {
            IPage page = cycle.getPage();

            bsf.declareBean("component", _component, _component.getClass());
            bsf.declareBean("page", page, page.getClass());
            bsf.declareBean("cycle", cycle, cycle.getClass());

            bsf.exec(
                _language,
                location.getResourceLocation().toString(),
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

        {
            IPage page = cycle.getPage();

            bsf.declareBean("component", _component, _component.getClass());
            bsf.declareBean("page", page, page.getClass());
            bsf.declareBean("cycle", cycle, cycle.getClass());

            bsf.exec(
                _language,
                location.getResourceLocation().toString(),
                location.getLineNumber(),
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

    public XLoper execute(IFunctionContext context, XLoper[] args) throws RequestException {
        try {
            Object[] a = converter.convert(args, createArgHints(args));
            BSFManager manager = new BSFManager();
            manager.declareBean("context", a, IFunctionContext.class);
            manager.declareBean("args", a, Object[].class);
            Object res = manager.eval(lang, name, 1, 1, source);
            return converter.createFrom(res);
        } catch (Throwable e) {
            throw new RequestException(e);
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

    public XLoper execute(IFunctionContext context, XLoper[] args) throws RequestException {
        try {
            Object[] a = converter.convert(args, createArgHints(args));
            BSFManager manager = new BSFManager();
            manager.declareBean("context", a, IFunctionContext.class);
            manager.declareBean("args", a, Object[].class);
            Object res = manager.eval(lang, name, 1, 1, source);
            return converter.createFrom(res);
        } catch (Throwable e) {
            throw new RequestException(e);
        }
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

        HttpSession session = request.getSession();
        ServletContext application = getServlet().getServletContext();

        Script script = loadScript(scriptName, application);

        bsfManager.declareBean("request", request,
                HttpServletRequest.class);

        bsfManager.declareBean("response", response,
                HttpServletResponse.class);
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

        Script script = loadScript(scriptName, application);

        bsfManager.declareBean("request", request,
                HttpServletRequest.class);

        bsfManager.declareBean("response", response,
                HttpServletResponse.class);

        if (session == null) {
            LOG.debug("HTTP session is null");
        } else {
View Full Code Here

Examples of org.apache.bsf.BSFManager.declareBean()

                HttpServletResponse.class);

        if (session == null) {
            LOG.debug("HTTP session is null");
        } else {
            bsfManager.declareBean("session", session, HttpSession.class);
        }

        bsfManager.declareBean("application", application,
                ServletContext.class);
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.