Package org.apache.bsf

Examples of org.apache.bsf.BSFEngine.exec()


    protected BSFEngine createBSFEngine(String scriptName, String scriptSrc) {
        try {

            String scriptLanguage = BSFManager.getLangFromFilename(scriptName);
            BSFEngine bsfEngine = bsfManager.loadScriptingEngine(scriptLanguage);
            bsfEngine.exec(scriptName, 0, 0, scriptSrc);

            return bsfEngine;

        } catch (BSFException e) {
            throw new SynapseException(e.getTargetException());
View Full Code Here


    protected void processFileOrScript(BSFManager mgr) throws BSFException{
        BSFEngine bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());
        final String scriptFile = getFilename();
        if (scriptFile.length() == 0) {
            bsfEngine.exec("[script]",0,0,getScript());
        } else {// we have a file, read and process it
            try {
                String script=FileUtils.readFileToString(new File(scriptFile));
                bsfEngine.exec(scriptFile,0,0,script);
            } catch (IOException e) {
View Full Code Here

        if (scriptFile.length() == 0) {
            bsfEngine.exec("[script]",0,0,getScript());
        } else {// we have a file, read and process it
            try {
                String script=FileUtils.readFileToString(new File(scriptFile));
                bsfEngine.exec(scriptFile,0,0,script);
            } catch (IOException e) {
                log.warn(e.getLocalizedMessage());
                throw new BSFException(BSFException.REASON_IO_ERROR,"Problem reading script file",e);
            }
        }
View Full Code Here

    protected void processFileOrScript(BSFManager mgr) throws BSFException{
        BSFEngine bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());
    final String scriptFile = getFilename();
        if (scriptFile.length() == 0) {
      bsfEngine.exec("[script]",0,0,getScript());
    }
    bsfEngine.exec(scriptFile,0,0,scriptFile);
    }

    /**
 
View Full Code Here

        BSFEngine bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());
    final String scriptFile = getFilename();
        if (scriptFile.length() == 0) {
      bsfEngine.exec("[script]",0,0,getScript());
    }
    bsfEngine.exec(scriptFile,0,0,scriptFile);
    }

    /**
     * Return the script (TestBean version).
     * Must be overridden for subclasses that don't implement TestBean
View Full Code Here

        try {
            BSFEngine bsfEngine = bsfManager.loadScriptingEngine(scriptingEngine);

            bsfManager.getObjectRegistry().register("out", out);
            bsfEngine.exec("", 0, 0, template);

        }
        catch (BSFException e) {
            throw new XDocletException(e, "Exception when running scriptengine='" + scriptingEngine + "'");
        }
View Full Code Here

            BSFManager bsfManager = new BSFManager();
            bsfManager.setClassLoader(BSFManager.class.getClassLoader());
            bsfManager.declareBean("_AxisService", axisService, AxisService.class);

            BSFEngine bsfEngine = bsfManager.loadScriptingEngine(scriptLanguage);
            bsfEngine.exec(scriptName, 0, 0, scriptSrc);

            ServiceContext serviceContext = mc.getServiceContext();
            serviceContext.setProperty(BSFENGINE_PROP, bsfEngine);

            OMElementConvertor convertor = ConvertorFactory.createOMElementConvertor(axisService, scriptName);
View Full Code Here

      // AxisService.class);

      BSFEngine bsfEngine = bsfManager
          .loadScriptingEngine(scriptLanguage);
      Object scriptSrc = readScript();
      bsfEngine.exec(scriptName, 0, 0, scriptSrc);

    } catch (BSFException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

    protected void processFileOrScript(BSFManager mgr) throws BSFException{
        BSFEngine bsfEngine = mgr.loadScriptingEngine(getScriptLanguage());
        final String scriptFile = getFilename();
        if (scriptFile.length() == 0) {
            bsfEngine.exec("[script]",0,0,getScript());
        } else {// we have a file, read and process it
            try {
                String script=FileUtils.readFileToString(new File(scriptFile));
                bsfEngine.exec(scriptFile,0,0,script);
            } catch (IOException e) {
View Full Code Here

        if (scriptFile.length() == 0) {
            bsfEngine.exec("[script]",0,0,getScript());
        } else {// we have a file, read and process it
            try {
                String script=FileUtils.readFileToString(new File(scriptFile));
                bsfEngine.exec(scriptFile,0,0,script);
            } catch (IOException e) {
                log.warn(e.getLocalizedMessage());
                throw new BSFException(BSFException.REASON_IO_ERROR,"Problem reading script file",e);
            }
        }
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.