org.apache.bsf
public interface BSFEngine extends PropertyChangeListener
When a scripting engine is first fired up, the initialize() method is called right after construction.
A scripting engine must provide two access points for applications to call into them: via function calls and via expression evaluation. It must also support loading scripts.
A scripting engine is a property change listener and will be notified when any of the relevant properties of the manager change. (See BSFManager to see which of its properties are bound.)
Method Summary | |
---|---|
Object | apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments)
This is used by an application to invoke an anonymous function. |
Object | call(Object object, String name, Object[] args)
This is used by an application to call into the scripting engine
to make a function/method call. |
void | compileApply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments, CodeBuffer cb)
This is used by an application to compile an anonymous function. |
void | compileExpr(String source, int lineNo, int columnNo, Object expr, CodeBuffer cb)
This is used by an application to compile a value-returning expression.
|
void | compileScript(String source, int lineNo, int columnNo, Object script, CodeBuffer cb)
This is used by an application to compile some script. |
void | declareBean(BSFDeclaredBean bean)
Declare a bean after the engine has been started. |
Object | eval(String source, int lineNo, int columnNo, Object expr)
This is used by an application to evaluate an expression. |
void | exec(String source, int lineNo, int columnNo, Object script)
This is used by an application to execute some script. |
void | iexec(String source, int lineNo, int columnNo, Object script)
This is used by an application to execute some script, as though
one were interacting with the language in an interactive session.
|
void | initialize(BSFManager mgr, String lang, Vector declaredBeans)
This method is used to initialize the engine right after construction.
|
void | terminate()
Graceful termination |
void | undeclareBean(BSFDeclaredBean bean)
Undeclare a previously declared bean.
|
Parameters: source (context info) the source of this expression (e.g., filename) lineNo (context info) the line number in source for expr columnNo (context info) the column number in source for expr funcBody the multi-line, value returning script to evaluate paramNames the names of the parameters above assumes arguments values of the above parameters
Throws: BSFException if anything goes wrong while doin' it.
Parameters: object object on which to make the call name name of the method / procedure to call args the arguments to be given to the procedure
Throws: BSFException if anything goes wrong while eval'ing a BSFException is thrown. The reason indicates the problem.
Parameters: source (context info) the source of this expression (e.g., filename) lineNo (context info) the line number in source for expr columnNo (context info) the column number in source for expr funcBody the multi-line, value returning script to evaluate paramNames the names of the parameters above assumes arguments values of the above parameters cb the CodeBuffer to compile into
Throws: BSFException if anything goes wrong while doin' it.
Parameters: source (context info) the source of this expression (e.g., filename) lineNo (context info) the line number in source for expr columnNo (context info) the column number in source for expr expr the expression to compile cb the CodeBuffer to compile into
Throws: BSFException if anything goes wrong while compiling a BSFException is thrown. The reason indicates the problem.
Parameters: source (context info) the source of this script (e.g., filename) lineNo (context info) the line number in source for script columnNo (context info) the column number in source for script script the script to compile cb the CodeBuffer to compile into
Throws: BSFException if anything goes wrong while compiling a BSFException is thrown. The reason indicates the problem.
Parameters: bean the bean to declare
Throws: BSFException if the engine cannot do this operation
Parameters: source (context info) the source of this expression (e.g., filename) lineNo (context info) the line number in source for expr columnNo (context info) the column number in source for expr expr the expression to evaluate
Throws: BSFException if anything goes wrong while eval'ing a BSFException is thrown. The reason indicates the problem.
Parameters: source (context info) the source of this expression (e.g., filename) lineNo (context info) the line number in source for expr columnNo (context info) the column number in source for expr script the script to execute
Throws: BSFException if anything goes wrong while exec'ing a BSFException is thrown. The reason indicates the problem.
Parameters: source (context info) the source of this expression (e.g., filename) lineNo (context info) the line number in source for expr columnNo (context info) the column number in source for expr script the script to execute
Throws: BSFException if anything goes wrong while exec'ing a BSFException is thrown. The reason indicates the problem.
Parameters: mgr The BSFManager that's hosting this engine. lang Language string which this engine is handling. declaredBeans Vector of BSFDeclaredObject containing beans that should be declared into the language runtime at init time as best as possible.
Throws: BSFException if anything goes wrong while init'ing a BSFException is thrown. The reason indicates the problem.
Parameters: bean the bean to undeclare
Throws: BSFException if the engine cannot do this operation