com.judoscript
Class BSFJudoEngine

java.lang.Object
  extended by org.apache.bsf.util.BSFEngineImpl
      extended by com.judoscript.BSFJudoEngine
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, org.apache.bsf.BSFEngine

public class BSFJudoEngine
extends org.apache.bsf.util.BSFEngineImpl

This is the interface for BSF. Need to have IBM's BSF package in the classpath.


Field Summary
 
Fields inherited from class org.apache.bsf.util.BSFEngineImpl
classLoader, classPath, dbgmgr, declaredBeans, lang, mgr, tempDir
 
Constructor Summary
BSFJudoEngine()
           
 
Method Summary
 java.lang.Object call(java.lang.Object object, java.lang.String fxn, java.lang.Object[] args)
          Calls a function.
 void declareBean(org.apache.bsf.BSFDeclaredBean bean)
          Declare a bean.
 java.lang.Object eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object script)
          Evaluates an expression.
 void exec(java.lang.String source, int lineNo, int columnNo, java.lang.Object script)
          Executes a script.
 void initialize(org.apache.bsf.BSFManager mgr, java.lang.String lang, java.util.Vector declaredBeans)
          Initializes the engine.
 void undeclareBean(org.apache.bsf.BSFDeclaredBean bean)
          Undeclare a previously declared bean.
 
Methods inherited from class org.apache.bsf.util.BSFEngineImpl
apply, compileApply, compileExpr, compileScript, disconnectedDebuggerNotify, getSpecificDebuggingInterface, placeBreakpointAtLine, placeBreakpointAtOffset, propertyChange, removeBreakpoint, setEntryExit, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSFJudoEngine

public BSFJudoEngine()
Method Detail

initialize

public void initialize(org.apache.bsf.BSFManager mgr,
                       java.lang.String lang,
                       java.util.Vector declaredBeans)
                throws org.apache.bsf.BSFException
Initializes the engine. Establishes the one and only $$bsf object in JudoScript, and sets all the declared beans as global variables.

Specified by:
initialize in interface org.apache.bsf.BSFEngine
Overrides:
initialize in class org.apache.bsf.util.BSFEngineImpl
Parameters:
mgr - the BSF manager.
lang - always "judoscript".
declaredBeans - objects to set during initialization; elements are instances of com.ibm.bsf.DeclaredBean.
Throws:
org.apache.bsf.BSFException

eval

public java.lang.Object eval(java.lang.String source,
                             int lineNo,
                             int columnNo,
                             java.lang.Object script)
                      throws org.apache.bsf.BSFException
Evaluates an expression.

Parameters:
source - the file name of the expression; not used.
lineNo - the line number in the file; not used.
columnNo - the column number in the file; not used.
script - the expression; should be a String.
Returns:
the result of the expression.
Throws:
org.apache.bsf.BSFException

exec

public void exec(java.lang.String source,
                 int lineNo,
                 int columnNo,
                 java.lang.Object script)
          throws org.apache.bsf.BSFException
Executes a script.

Specified by:
exec in interface org.apache.bsf.BSFEngine
Overrides:
exec in class org.apache.bsf.util.BSFEngineImpl
Parameters:
source - the file name of the expression; not used.
lineNo - the line number in the file; not used.
columnNo - the column number in the file; not used.
script - the script code; should be a String.
Throws:
org.apache.bsf.BSFException

call

public java.lang.Object call(java.lang.Object object,
                             java.lang.String fxn,
                             java.lang.Object[] args)
                      throws org.apache.bsf.BSFException
Calls a function. (Calling object's methods is not supported.)

Parameters:
object - is the name of the object; not used.
fxn - the function name.
args - the arguments.
Returns:
the result.
Throws:
org.apache.bsf.BSFException

declareBean

public void declareBean(org.apache.bsf.BSFDeclaredBean bean)
                 throws org.apache.bsf.BSFException
Declare a bean. Sets the bean as a global variable in JudoScript.

Specified by:
declareBean in interface org.apache.bsf.BSFEngine
Overrides:
declareBean in class org.apache.bsf.util.BSFEngineImpl
Throws:
org.apache.bsf.BSFException

undeclareBean

public void undeclareBean(org.apache.bsf.BSFDeclaredBean bean)
                   throws org.apache.bsf.BSFException
Undeclare a previously declared bean. Removes the named global variable from JudoScript.

Specified by:
undeclareBean in interface org.apache.bsf.BSFEngine
Overrides:
undeclareBean in class org.apache.bsf.util.BSFEngineImpl
Throws:
org.apache.bsf.BSFException