org.apache.bsf.BSFException Java Examples

The following examples show how to use org.apache.bsf.BSFException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavascriptTest.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
public void testUndeclareBean() {
    Double foo = new Double(1);
    Double bar = null;

    try {
        bsfManager.declareBean("foo", foo, Double.class);
        bsfManager.undeclareBean("foo");
        bar = (Double) javascriptEngine.eval("Test.js", 0, 0,
                                             "foo + 1");
    }
    catch (BSFException bsfE) {
        // Do nothing. This is the expected case.
    }
    catch (Exception e) {
        fail(failMessage("undeclareBean() test failed", e));
    }

    assertNull(bar);
}
 
Example #2
Source File: NetrexxTest.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
public void testUndeclareBean() {
    // FIXME: Netrexx is a little chatty about the missing variable...
    Integer foo = new Integer(0);
    Object  bar = null;
    
    try {
        bsfManager.declareBean("foo", foo, Integer.class);
        bsfManager.undeclareBean("foo");
        bar = netrexxEngine.eval("Test.nrx", 0, 0,
                                 "foo + 1");
    }
    catch (BSFException bsfe) {
        // don't do anything .. this is the expected case
    }
    catch (Exception ex) {
        fail(failMessage("undeclareBean() test failed", ex));
    }

    assertNull(bar);
}
 
Example #3
Source File: JEXLEngine.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
/**
 * Evaluates the expression as a JEXL Script.
 *
 * @param fileName The file name, if it is available.
 * @param lineNo The line number, if it is available.
 * @param colNo The column number, if it is available.
 * @param expr The expression to be evaluated.
 *
 * @throws BSFException For any exception that occurs while
 *                      evaluating the expression.
 */
public Object eval(String fileName, int lineNo, int colNo, Object expr)
        throws BSFException {
    if (expr == null) {
        return null;
    }
    try {
        Script jExpr = null;
        if (expr instanceof File) {
            jExpr = ScriptFactory.createScript((File) expr);
        } else if (expr instanceof URL) {
            jExpr = ScriptFactory.createScript((URL) expr);
        } else {
            jExpr = ScriptFactory.createScript((String) expr);
        }
        return jExpr.execute(jc);
    } catch (Exception e) {
        throw new BSFException(BSFException.REASON_EXECUTION_ERROR,
            "Exception from Commons JEXL:\n" + e.getMessage(), e);
    }
}
 
Example #4
Source File: JaclEngine.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
/**
 * This is used by an application to evaluate a string containing
 * some expression.
 */
public Object eval (String source, int lineNo, int columnNo, 
            Object oscript) throws BSFException {
  String script = oscript.toString ();
  try {
    interp.eval (script);
    TclObject result = interp.getResult();
    Object internalRep = result.getInternalRep();

    // if the object has a corresponding Java type, unwrap it
    if (internalRep instanceof ReflectObject)
      return ReflectObject.get(interp,result);
    if (internalRep instanceof TclString)
      return result.toString();
    if (internalRep instanceof TclDouble)
      return new Double(TclDouble.get(interp,result));
    if (internalRep instanceof TclInteger)
      return new Integer(TclInteger.get(interp,result));

    return result;
  } catch (TclException e) { 
    throw new BSFException (BSFException.REASON_EXECUTION_ERROR,
                "error while eval'ing Jacl expression: " + 
                interp.getResult (), e);
  }
}
 
Example #5
Source File: JythonEngine.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
/**
  * Initialize the engine.
  */
 public void initialize (BSFManager mgr, String lang,
					  Vector declaredBeans) throws BSFException {
super.initialize (mgr, lang, declaredBeans);

// create an interpreter
interp = new BSFPythonInterpreter ();

   // ensure that output and error streams are re-directed correctly
   interp.setOut(System.out);
   interp.setErr(System.err);
   
// register the mgr with object name "bsf"
interp.set ("bsf", new BSFFunctions (mgr, this));

   // Declare all declared beans to the interpreter
int size = declaredBeans.size ();
for (int i = 0; i < size; i++) {
  declareBean ((BSFDeclaredBean) declaredBeans.elementAt (i));
}
 }
 
Example #6
Source File: JavaEngine.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
/**
 * Return an object from an extension.
 * @param object Object on which to make the internal_call (ignored).
 * @param method The name of the method to internal_call.
 * @param args an array of arguments to be
 * passed to the extension, which may be either
 * Vectors of Nodes, or Strings.
 */
Object internalCall (Object object, String method, Object[] args)
throws BSFException
{
    //***** ISSUE: Only static methods are currently supported
    Object retval = null;
    try {
        if(javaclass != null) {
            //***** This should call the lookup used in BML, for typesafety
            Class[] argtypes = new Class[args.length];
            for(int i=0; i<args.length; ++i) {
                argtypes[i]=args[i].getClass();
            }
            Method m = MethodUtils.getMethod(javaclass, method, argtypes);
            retval = m.invoke(null, args);
        }
    }
    catch(Exception e) {
        throw new BSFException (BSFException.REASON_IO_ERROR, e.getMessage ());
    }
    return retval;
}
 
Example #7
Source File: QuestJython.java    From L2jBrasil with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Initialize the engine for scripts of quests, luxury shops and blacksmith
 */
public static void init()
{
	try
	{
		// Initialize the engine for loading Jython scripts
		_bsf = new BSFManager();
		// Execution of all the scripts placed in data/jscript
		// inside the DataPack directory

		String dataPackDirForwardSlashes = Config.DATAPACK_ROOT.getPath().replaceAll("\\\\","/");
		String loadingScript =
		    "import sys;"
		  + "sys.path.insert(0,'" + dataPackDirForwardSlashes + "');"
		  + "import data";

		_bsf.exec("jython", "quest", 0, 0, loadingScript);
	}
	catch (BSFException e)
	{
		e.printStackTrace();
	}
}
 
Example #8
Source File: BeanShellBSFEngine.java    From beanshell with Apache License 2.0 6 votes vote down vote up
public void initialize ( BSFManager mgr, String lang, Vector declaredBeans)
throws BSFException
{
    super.initialize( mgr, lang, declaredBeans );

    interpreter = new Interpreter();

    // declare the bsf manager for callbacks, etc.
    try {
        interpreter.set( "bsf", mgr );
    } catch ( EvalError e ) {
        throw new BSFException(BSFException.REASON_OTHER_ERROR, "bsh internal error: "+e, e);
    }

    for(int i=0; i<declaredBeans.size(); i++)
    {
        BSFDeclaredBean bean = (BSFDeclaredBean)declaredBeans.get(i);
        declareBean( bean );
    }
}
 
Example #9
Source File: JaclEngine.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
/**
 * Initialize the engine.
 */
public void initialize (BSFManager mgr, String lang,
            Vector declaredBeans) throws BSFException {
  super.initialize (mgr, lang, declaredBeans);

  // create interpreter
  interp = new Interp();

  // register the extension that user's can use to get at objects
  // registered by the app
  interp.createCommand ("bsf", new BSFCommand (mgr, this));

  // Make java functions be available to Jacl
      try {
      interp.eval("jaclloadjava");
  } catch (TclException e) {
      throw new BSFException (BSFException.REASON_OTHER_ERROR,
                  "error while loading java package: " +
                  interp.getResult (), e);
  }

  int size = declaredBeans.size ();
  for (int i = 0; i < size; i++) {
    declareBean ((BSFDeclaredBean) declaredBeans.elementAt (i));
  }
}
 
Example #10
Source File: BSFReportPreProcessor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public SubReport performPreProcessing( final SubReport definition, final DefaultFlowController flowController )
  throws ReportProcessingException {
  if ( script == null || language == null ) {
    return definition;
  }

  try {
    final BSFManager interpreter = new BSFManager();
    interpreter.declareBean( "definition", definition, SubReport.class ); //$NON-NLS-1$
    interpreter.declareBean( "flowController", flowController, DefaultFlowController.class ); //$NON-NLS-1$
    final Object o = interpreter.eval( getLanguage(), "expression", 1, 1, script );
    if ( o instanceof SubReport == false ) {
      throw new ReportDataFactoryException( "Not a MasterReport" );
    }
    return (SubReport) o; //$NON-NLS-1$

  } catch ( BSFException e ) {
    throw new ReportDataFactoryException( "Failed to initialize the BSF-Framework", e );
  }
}
 
Example #11
Source File: BSFReportPreProcessor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public MasterReport performPreProcessing( final MasterReport definition, final DefaultFlowController flowController )
  throws ReportProcessingException {
  if ( script == null || language == null || StringUtils.isEmpty( script, true ) ) {
    return definition;
  }

  try {
    final BSFManager interpreter = new BSFManager();
    interpreter.declareBean( "definition", definition, MasterReport.class ); //$NON-NLS-1$
    interpreter.declareBean( "flowController", flowController, DefaultFlowController.class ); //$NON-NLS-1$
    final Object o = interpreter.eval( getLanguage(), "expression", 1, 1, script );
    if ( o instanceof MasterReport == false ) {
      throw new ReportDataFactoryException( "Not a MasterReport" );
    }
    return (MasterReport) o; //$NON-NLS-1$

  } catch ( BSFException e ) {
    throw new ReportDataFactoryException( "Failed to initialize the BSF-Framework", e );
  }
}
 
Example #12
Source File: FaenorInterface.java    From L2jBrasil with GNU General Public License v3.0 6 votes vote down vote up
public void addPetData(BSFManager context, int petID, int levelStart, int levelEnd, Map<String, String> stats)
throws BSFException
  {
      L2PetData[] petData = new L2PetData[levelEnd - levelStart + 1];
      int value           = 0;
      for (int level = levelStart; level <= levelEnd; level++)
      {
          petData[level - 1]  = new L2PetData();
          petData[level - 1].setPetID(petID);
          petData[level - 1].setPetLevel(level);

       context.declareBean("level", new Double(level), Double.TYPE);
          for (String stat : stats.keySet())
          {
		value = ((Number)Expression.eval(context, "beanshell", stats.get(stat))).intValue();
              petData[level - 1].setStat(stat, value);
          }
       context.undeclareBean("level");
      }

  }
 
Example #13
Source File: Hook.java    From PADListener with GNU General Public License v2.0 6 votes vote down vote up
protected void runScripts() {
        if (_bsfManager == null) return;
        synchronized(_bsfManager) {
            for (int i=0; i<_scripts.size(); i++) {
                Script script = _scripts.get(i);
                if (script.isEnabled()) {
//                    if (_scriptManager != null) _scriptManager.scriptStarted(this, script);
                    try {
                        _bsfManager.exec(script.getLanguage(), _name, 0, 0, script.getScript());
                    } catch (BSFException bsfe) {
                        _logger.warning("Script exception: " + bsfe);
//                        if (_scriptManager != null) _scriptManager.scriptError(this, script, bsfe);
                    }
//                    if (_scriptManager != null) _scriptManager.scriptEnded(this, script);
                }
            }
        }
    }
 
Example #14
Source File: CachingGroovyEngine.java    From groovy with Apache License 2.0 6 votes vote down vote up
/**
 * Initialize the engine.
 */
public void initialize(final BSFManager mgr, String lang, Vector declaredBeans) throws BSFException {
    super.initialize(mgr, lang, declaredBeans);
    ClassLoader parent = mgr.getClassLoader();
    if (parent == null)
        parent = GroovyShell.class.getClassLoader();
    setLoader(mgr, parent);
    execScripts = new HashMap<>();
    evalScripts = new HashMap<>();
    context = shell.getContext();
    // create a shell
    // register the mgr with object name "bsf"
    context.setVariable("bsf", new BSFFunctions(mgr, this));
    int size = declaredBeans.size();
    for (int i = 0; i < size; i++) {
        declareBean((BSFDeclaredBean) declaredBeans.elementAt(i));
    }
}
 
Example #15
Source File: CachingGroovyEngine.java    From groovy with Apache License 2.0 6 votes vote down vote up
/**
 * Execute a script.
 */
public void exec(String source, int lineNo, int columnNo, Object script) throws BSFException {
    try {
        //          shell.run(script.toString(), source, EMPTY_ARGS);

        Class scriptClass = execScripts.get(script);
        if (scriptClass == null) {
            scriptClass = loader.parseClass(script.toString(), source);
            execScripts.put(script, scriptClass);
        } else {
            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);
    }
}
 
Example #16
Source File: JaclTest.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
public void testUnregisterBean() {
    Integer foo = new Integer(1);
    Integer bar = null;

    try {
        bsfManager.registerBean("foo", foo);
        bsfManager.unregisterBean("foo");
        bar = (Integer) jaclEngine.eval("Test.jacl", 0, 0,
                                        "bsf lookupBean \"foo\"");
    }
    catch (BSFException bsfE) {
        // Do nothing. This is the expected case.
    }
    catch (Exception e) {
        fail(failMessage("unregisterBean() test failed", e));
    }

    assertNull(bar);
}
 
Example #17
Source File: JEXLEngine.java    From commons-bsf with Apache License 2.0 6 votes vote down vote up
/**
 * Executes the script as a JEXL {@link Script}.
 *
 * @param fileName The file name, if it is available.
 * @param lineNo The line number, if it is available.
 * @param colNo The column number, if it is available.
 * @param script The script to be executed.
 *
 * @throws BSFException For any exception that occurs while
 *                      executing the script.
 */
public void exec(String fileName, int lineNo, int colNo, Object script)
        throws BSFException {
    if (script == null) {
        return;
    }
    try {
        Script jExpr = null;
        if (script instanceof File) {
            jExpr = ScriptFactory.createScript((File) script);
        } else if (script instanceof URL) {
            jExpr = ScriptFactory.createScript((URL) script);
        } else {
            jExpr = ScriptFactory.createScript((String) script);
        }
        jExpr.execute(jc);
    } catch (Exception e) {
        throw new BSFException(BSFException.REASON_EXECUTION_ERROR,
            "Exception from Commons JEXL:\n" + e.getMessage(), e);
    }
}
 
Example #18
Source File: BSFReportPreProcessor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public MasterReport performPreDataProcessing( final MasterReport definition,
    final DefaultFlowController flowController ) throws ReportProcessingException {
  if ( preDataScript == null || language == null || StringUtils.isEmpty( preDataScript, true ) ) {
    return definition;
  }

  try {
    final BSFManager interpreter = new BSFManager();
    interpreter.declareBean( "definition", definition, MasterReport.class ); //$NON-NLS-1$
    interpreter.declareBean( "flowController", flowController, DefaultFlowController.class ); //$NON-NLS-1$
    final Object o = interpreter.eval( getLanguage(), "expression", 1, 1, preDataScript );
    if ( o instanceof MasterReport == false ) {
      throw new ReportDataFactoryException( "Not a MasterReport" );
    }
    return (MasterReport) o; //$NON-NLS-1$

  } catch ( BSFException e ) {
    throw new ReportDataFactoryException( "Failed to initialize the BSF-Framework", e );
  }
}
 
Example #19
Source File: BSFReportPreProcessor.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public SubReport performPreDataProcessing( final SubReport definition, final DefaultFlowController flowController )
  throws ReportProcessingException {
  if ( script == null || language == null ) {
    return definition;
  }

  try {
    final BSFManager interpreter = new BSFManager();
    interpreter.declareBean( "definition", definition, MasterReport.class ); //$NON-NLS-1$
    interpreter.declareBean( "flowController", flowController, DefaultFlowController.class ); //$NON-NLS-1$
    final Object o = interpreter.eval( getLanguage(), "expression", 1, 1, preDataScript );
    if ( o instanceof SubReport == false ) {
      throw new ReportDataFactoryException( "Not a SubReport" );
    }
    return (SubReport) o; //$NON-NLS-1$

  } catch ( BSFException e ) {
    throw new ReportDataFactoryException( "Failed to initialize the BSF-Framework", e );
  }
}
 
Example #20
Source File: BSFTest.java    From groovy with Apache License 2.0 5 votes vote down vote up
public void testCompileErrorWithEval() throws Exception {
    try {
        manager.eval("groovy", "dummy", 0, 0, "assert assert");
        fail("Should have caught compile exception");
    } catch (BSFException e) {
        assertTrue("e.getMessage() should contain CompilationError: " + e.getMessage(),
                e.getMessage().contains("CompilationError"));
    }
}
 
Example #21
Source File: ScriptManager.java    From PADListener with GNU General Public License v2.0 5 votes vote down vote up
/** Creates a new instance of ScriptManager */
public ScriptManager(Framework framework) {
    try {
        _bsfManager = new BSFManager();
        _bsfManager.declareBean("framework", framework, framework.getClass());
        _bsfManager.declareBean("out", System.out, System.out.getClass());
        _bsfManager.declareBean("err", System.err, System.out.getClass());
    } catch (BSFException bsfe) {
        _logger.severe("Declaring a bean should not throw an exception! " + bsfe);
    }
}
 
Example #22
Source File: ScriptManager.java    From PADListener with GNU General Public License v2.0 5 votes vote down vote up
public void addScript(String plugin, Hook hook, Script script, int position) throws BSFException {
    String language = BSFManager.getLangFromFilename(script.getFile().getName());
    if (language != null) {
        script.setLanguage(language);
        script.setEnabled(true);
        hook.addScript(script, position);
        fireScriptAdded(plugin, hook, script);
    }
}
 
Example #23
Source File: JaclEngine.java    From commons-bsf with Apache License 2.0 5 votes vote down vote up
/**
 * 
 * @param method The name of the method to call.
 * @param args an array of arguments to be
 * passed to the extension, which may be either
 * Vectors of Nodes, or Strings.
 */
public Object call (Object obj, String method, Object[] args) 
                                                      throws BSFException {
  StringBuffer tclScript = new StringBuffer (method);
  if (args != null) {
    for( int i = 0 ; i < args.length ; i++ ) {
  tclScript.append (" ");
  tclScript.append (args[i].toString ());
    }
  }
  return eval ("<function call>", 0, 0, tclScript.toString ());
}
 
Example #24
Source File: BSFTest.java    From groovy with Apache License 2.0 5 votes vote down vote up
public void testCompileErrorWithExec() throws Exception {
    try {
        manager.exec("groovy", "dummy", 0, 0, "assert assert");
        fail("Should have caught compile exception");
    } catch (BSFException e) {
        assertTrue("e.getMessage() should contain CompilationError: " + e.getMessage(),
                e.getMessage().contains("CompilationError"));
    }
}
 
Example #25
Source File: NetRexxEngine.java    From commons-bsf with Apache License 2.0 5 votes vote down vote up
/**
 * Invoke a static method.
 * @param rexxclass Class to invoke the method against
 * @param method The name of the method to call.
 * @param args an array of arguments to be
 * passed to the extension, which may be either
 * Vectors of Nodes, or Strings.
 */
Object callStatic(Class rexxclass, String method, Object[] args)
throws BSFException
{
    //***** ISSUE: Currently supports only static methods
    Object retval = null;
    try
    {
        if (rexxclass != null)
        {
            //***** This should call the lookup used in BML, for typesafety
            Class[] argtypes=new Class[args.length];
            for(int i=0;i<args.length;++i)
                argtypes[i]=args[i].getClass();

            Method m=MethodUtils.getMethod(rexxclass, method, argtypes);
            retval=m.invoke(null,args);
        }
        else
        {
            logger.error("NetRexxEngine: ERROR: rexxclass==null!");
        }
    }
    catch(Exception e)
    {
        e.printStackTrace ();
        if (e instanceof InvocationTargetException)
        {
            Throwable t = ((InvocationTargetException)e).getTargetException ();
            t.printStackTrace ();
        }
        throw new BSFException (BSFException.REASON_IO_ERROR,
                                e.getMessage (),
                                e);
    }
    return retval;
}
 
Example #26
Source File: BSFEngineImpl.java    From commons-bsf with Apache License 2.0 5 votes vote down vote up
/**
 * Default impl of compileExpr - generates code that'll create a new
 * manager, evaluate the expression, and return the value.
 */
public void compileExpr(String source, int lineNo, int columnNo,
                        Object expr, CodeBuffer cb) throws BSFException {
    ObjInfo bsfInfo = cb.getSymbol("bsf");
    
    if (bsfInfo == null) {
        bsfInfo = new ObjInfo(BSFManager.class, "bsf");
        cb.addFieldDeclaration("org.apache.bsf.BSFManager bsf = " + 
                               "new org.apache.bsf.BSFManager();");
        cb.putSymbol("bsf", bsfInfo);
    }

    String evalString = bsfInfo.objName + ".eval(\"" + lang + "\", ";
    evalString += "request.getRequestURI(), " + lineNo + ", " + columnNo;
    evalString += "," + StringUtils.lineSeparator;
    evalString += StringUtils.getSafeString(expr.toString()) + ")";

    ObjInfo oldRet = cb.getFinalServiceMethodStatement();

    if (oldRet != null && oldRet.isExecutable()) {
        cb.addServiceMethodStatement(oldRet.objName + ";");
    }

    cb.setFinalServiceMethodStatement(new ObjInfo(Object.class, 
                                                  evalString));
    
    cb.addServiceMethodException("org.apache.bsf.BSFException");
}
 
Example #27
Source File: BSFEngineImpl.java    From commons-bsf with Apache License 2.0 5 votes vote down vote up
/**
 * initialize the engine; called right after construction by 
 * the manager. Declared beans are simply kept in a vector and
 * that's it. Subclasses must do whatever they want with it.
 */
public void initialize(BSFManager mgr, String lang, Vector declaredBeans)
    throws BSFException {
    
    this.mgr = mgr;
    this.lang = lang;
    this.declaredBeans = declaredBeans;

    // initialize my properties from those of the manager. It'll send
    // propagate change events to me
    this.classPath = mgr.getClassPath();
    this.tempDir = mgr.getTempDir();
    this.classLoader = mgr.getClassLoader();
}
 
Example #28
Source File: XSLTEngine.java    From commons-bsf with Apache License 2.0 5 votes vote down vote up
/**
 * Undeclare a bean by setting he parameter represeting it to null
 */
public void undeclareBean (BSFDeclaredBean bean) throws BSFException {
    // Cannot clear only one parameter in Xalan 2, so we set it to null
    if ((transformer.getParameter (bean.name)) != null) {
        transformer.setParameter (bean.name, null);
    }
}
 
Example #29
Source File: JavaEngine.java    From commons-bsf with Apache License 2.0 5 votes vote down vote up
public void compileScript (String source, int lineNo, int columnNo,
        Object script, CodeBuffer cb) throws BSFException {
    ObjInfo oldRet = cb.getFinalServiceMethodStatement ();

    if (oldRet != null && oldRet.isExecutable ()) {
        cb.addServiceMethodStatement (oldRet.objName + ";");
    }

    cb.addServiceMethodStatement (script.toString ());
    cb.setFinalServiceMethodStatement (null);
}
 
Example #30
Source File: ScriptableDataFactory.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Initializes the Bean-Scripting Framework manager.
 *
 * @param interpreter
 *          the BSF-Manager that should be initialized.
 * @throws BSFException
 *           if an error occurred.
 */
protected void initializeInterpreter( final BSFManager interpreter ) throws BSFException {
  dataRowWrapper = new LegacyDataRowWrapper();
  interpreter.declareBean( "dataRow", dataRowWrapper, DataRow.class ); //$NON-NLS-1$
  interpreter.declareBean( "configuration", getConfiguration(), Configuration.class ); //$NON-NLS-1$
  interpreter.declareBean( "contextKey", getContextKey(), ResourceKey.class ); //$NON-NLS-1$
  interpreter.declareBean( "resourceManager", getResourceManager(), ResourceManager.class ); //$NON-NLS-1$
  interpreter.declareBean( "resourceBundleFactory", getResourceBundleFactory(), ResourceBundleFactory.class ); //$NON-NLS-1$
  interpreter.declareBean( "dataFactoryContext", getDataFactoryContext(), ResourceBundleFactory.class ); //$NON-NLS-1$
  if ( script != null ) {
    interpreter.exec( getLanguage(), "startup-script", 1, 1, getScript() ); //$NON-NLS-1$
  }
}