org.norther.tammi.core.scripter.lang
Interface ScriptEngine

All Superinterfaces:
org.apache.bsf.BSFEngine, EventListener, PropertyChangeListener
All Known Implementing Classes:
AbstractEngine, AbstractInterpreter, DJavaEngine, GroovyEngine

public interface ScriptEngine
extends org.apache.bsf.BSFEngine

An interface to extended script engines.

If a global string array bean "_arguments" has been declared and the script defines a class with a static main(String[] args) method, that method is automatically called.

If the script defines a class with a static execute() or evaluate() method, that method is automatically called.

If the script defines a class with a static apply(List params) method, that method is automatically called.

Note that only the first one of the above methods is called within one script.

Author:
Ilkka Priha

Field Summary
static String APPLY
          The apply method.
static String ARGUMENTS
          The global main arguments bean.
static String EVALUATE
          The evaluate method.
static String EXECUTE
          The execute method.
static String MAIN
          The main method.
 
Method Summary
 String getInitializer()
          Gets an initializer script.
 boolean isInitialized()
          Checks whether initialized.
 void reinitialize(String lang, Vector beans)
          Reinitializes the engine by clearing existing declarations.
 void setInitializer(String script)
          Sets an initializer script.
 
Methods inherited from interface org.apache.bsf.BSFEngine
apply, call, compileApply, compileExpr, compileScript, declareBean, disconnectedDebuggerNotify, eval, exec, getSpecificDebuggingInterface, initialize, placeBreakpointAtLine, placeBreakpointAtOffset, removeBreakpoint, setEntryExit, terminate, undeclareBean
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Field Detail

MAIN

static final String MAIN
The main method.

See Also:
Constant Field Values

EXECUTE

static final String EXECUTE
The execute method.

See Also:
Constant Field Values

EVALUATE

static final String EVALUATE
The evaluate method.

See Also:
Constant Field Values

APPLY

static final String APPLY
The apply method.

See Also:
Constant Field Values

ARGUMENTS

static final String ARGUMENTS
The global main arguments bean.

See Also:
Constant Field Values
Method Detail

getInitializer

String getInitializer()
Gets an initializer script.

Returns:
the initializer.

setInitializer

void setInitializer(String script)
Sets an initializer script. The script is executed after each reset.

Parameters:
script - the initializer.

isInitialized

boolean isInitialized()
Checks whether initialized.

Returns:
true if initialized, false otherwise.

reinitialize

void reinitialize(String lang,
                  Vector beans)
                  throws org.apache.bsf.BSFException
Reinitializes the engine by clearing existing declarations.

Parameters:
lang - the language.
beans - declared beans.
Throws:
org.apache.bsf.BSFException - on errors.


Copyright © 2004 The Norther Organization. All rights reserved.