|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.bsf.util.BSFEngineImpl | +--com.ibm.bsf.engines.activescript.ActiveScriptEngine
This is the interface to active scripting engines from the Bean Scripting Framework. This code uses John Ponzo's IBM Active Scripting Toolkit to tie in active scripting engines to BSF. This class implements Runnable to create a thread. This thread is to exclusively access the scripting engine. All methods from this class to the engines is proxied over to the engine thread for execution. Why? Because, MS engines are implemented to only be accessed from ONE thread.
Field Summary | |
protected java.lang.String |
lang
|
Fields inherited from class com.ibm.bsf.util.BSFEngineImpl |
classLoader,
classPath,
debug,
debugStream,
declaredBeans,
lang,
mgr,
tempDir |
Constructor Summary | |
ActiveScriptEngine()
|
Method Summary | |
void |
addEventListener(java.lang.Object bean,
java.lang.String event,
java.lang.String filter,
java.lang.String script)
add an event listener |
int |
bindMember(java.lang.Object target,
java.lang.String name,
short bindType)
Binds a method to an integer so it can be later referenced to invoke the method via callMethod. |
java.lang.Object |
call(java.lang.Object object,
java.lang.String method,
java.lang.Object[] args)
Return an object from an extension. |
java.lang.Object |
callMethod(java.lang.Object bean,
int methodID,
java.lang.Object[] args)
Invokes the method assocaited with methodID on the bean with parameters in the array args. |
java.lang.Object |
createBean(java.lang.Object[] args)
createBean |
static java.lang.Throwable |
createBSFException(int reason,
java.lang.String msg,
java.lang.Throwable t)
|
void |
declareBean(BSFDeclaredBean bean)
Declare a bean after the engine has been started. |
java.lang.Object |
eval(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object oscript)
This is used by an application to evaluate a string containing some expression. |
void |
exec(java.lang.String source,
int lineNo,
int columnNo,
java.lang.Object script)
This is used by an application to execute a string containing a script to execute. |
protected void |
finalize()
|
void |
initialize(BSFManager mgr,
java.lang.String language,
java.util.Vector declaredBeans)
initialize the engine; called right after construction by the manager. |
protected boolean |
isCaseSensitive()
|
protected boolean |
isJScript()
|
protected boolean |
isPerlScript()
|
protected boolean |
isVBScript()
|
java.lang.Object |
lookupBean(java.lang.String name)
lookupBean |
void |
setEvalRet(java.lang.Object ret)
|
void |
terminate()
Graceful termination |
void |
undeclareBean(BSFDeclaredBean bean)
Undeclare a previously declared bean. |
Methods inherited from class com.ibm.bsf.util.BSFEngineImpl |
apply,
compileApply,
compileExpr,
compileScript,
propertyChange,
setDebug |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String lang
Constructor Detail |
public ActiveScriptEngine()
Method Detail |
protected final boolean isVBScript()
protected final boolean isPerlScript()
protected final boolean isJScript()
protected final boolean isCaseSensitive()
public final void setEvalRet(java.lang.Object ret)
public void initialize(BSFManager mgr, java.lang.String language, java.util.Vector declaredBeans) throws BSFException
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.public void exec(java.lang.String source, int lineNo, int columnNo, java.lang.Object script) throws BSFException
source
- (context info) the source of this expression
(e.g., filename)lineNo
- (context info) the line number in source for exprcolumnNo
- (context info) the column number in source for exprscript
- the script to executepublic java.lang.Object eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object oscript) throws BSFException
source
- (context info) the source of this expression
(e.g., filename)lineNo
- (context info) the line number in source for exprcolumnNo
- (context info) the column number in source for exprexpr
- the expression to evaluatepublic java.lang.Object call(java.lang.Object object, java.lang.String method, java.lang.Object[] args) throws BSFException
method
- The name of the method to call.args
- an array of arguments to be
passed to the extension, which may be either
Vectors of Nodes, or Strings.public final java.lang.Object createBean(java.lang.Object[] args) throws BSFException
public void addEventListener(java.lang.Object bean, java.lang.String event, java.lang.String filter, java.lang.String script) throws BSFException
public static final java.lang.Throwable createBSFException(int reason, java.lang.String msg, java.lang.Throwable t)
public final int bindMember(java.lang.Object target, java.lang.String name, short bindType) throws java.lang.Exception
public final java.lang.Object callMethod(java.lang.Object bean, int methodID, java.lang.Object[] args) throws java.lang.Exception
public final java.lang.Object lookupBean(java.lang.String name)
public final void declareBean(BSFDeclaredBean bean) throws BSFException
bean
- the bean to declarepublic void undeclareBean(BSFDeclaredBean bean) throws BSFException
bean
- the bean to undeclarepublic void terminate()
protected void finalize() throws java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |