org.norther.tammi.core.scripter.lang
Class AbstractEngine

java.lang.Object
  extended by org.norther.tammi.core.scripter.lang.AbstractEngine
All Implemented Interfaces:
PropertyChangeListener, EventListener, org.apache.bsf.BSFEngine, ScriptEngine
Direct Known Subclasses:
AbstractInterpreter

public abstract class AbstractEngine
extends Object
implements ScriptEngine

An abstract BSF engine implementation.

Author:
Ilkka Priha

Field Summary
protected static String CLASS_PATH_SEPARATOR_EXPR
          The class path separator expression.
 
Fields inherited from interface org.norther.tammi.core.scripter.lang.ScriptEngine
APPLY, ARGUMENTS, EVALUATE, EXECUTE, MAIN
 
Constructor Summary
AbstractEngine()
          Constructs a new engine.
 
Method Summary
 void compileApply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments, org.apache.bsf.util.CodeBuffer cb)
           
 void compileExpr(String source, int lineNo, int columnNo, Object expr, org.apache.bsf.util.CodeBuffer cb)
           
 void compileScript(String source, int lineNo, int columnNo, Object script, org.apache.bsf.util.CodeBuffer cb)
           
 void disconnectedDebuggerNotify()
           
protected  ClassLoader getClassLoader()
          Gets the class loader.
protected  String getClassPath()
          Gets the class path.
protected  org.apache.bsf.debug.BSFDebugManager getDebugManager()
          Gets the debug manager.
protected  Vector getDeclaredBeans()
          Gets the declared beans.
 String getInitializer()
          Gets an initializer script.
protected  String getLanguage()
          Gets the language.
 Object getSpecificDebuggingInterface()
           
protected  String getTempDirectory()
          Gets the temp directory.
 void initialize(org.apache.bsf.BSFManager mgr, String lang, Vector beans)
           
 boolean isInitialized()
          Checks whether initialized.
 void placeBreakpointAtLine(int brkptid, String docname, int lineno)
           
 void placeBreakpointAtOffset(int brkptid, String docname, int offset)
           
 void propertyChange(PropertyChangeEvent event)
           
 void reinitialize(String lang, Vector beans)
          Reinitializes the engine by clearing existing declarations.
 void removeBreakpoint(String docname, int brkptid)
           
protected  void setClassLoader(ClassLoader loader)
          Sets the class loader.
protected  void setClassPath(String path)
          Sets the class path.
 void setEntryExit(String docname, boolean on)
           
 void setInitializer(String script)
          Sets an initializer script.
protected  void setTempDirectory(String temp)
          Sets the temp directory.
 void terminate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.bsf.BSFEngine
apply, call, declareBean, eval, exec, undeclareBean
 

Field Detail

CLASS_PATH_SEPARATOR_EXPR

protected static final String CLASS_PATH_SEPARATOR_EXPR
The class path separator expression.

Constructor Detail

AbstractEngine

public AbstractEngine()
Constructs a new engine.

Method Detail

initialize

public void initialize(org.apache.bsf.BSFManager mgr,
                       String lang,
                       Vector beans)
                throws org.apache.bsf.BSFException
Specified by:
initialize in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

getInitializer

public String getInitializer()
Description copied from interface: ScriptEngine
Gets an initializer script.

Specified by:
getInitializer in interface ScriptEngine
Returns:
the initializer.

setInitializer

public void setInitializer(String script)
Description copied from interface: ScriptEngine
Sets an initializer script. The script is executed after each reset.

Specified by:
setInitializer in interface ScriptEngine
Parameters:
script - the initializer.

isInitialized

public boolean isInitialized()
Description copied from interface: ScriptEngine
Checks whether initialized.

Specified by:
isInitialized in interface ScriptEngine
Returns:
true if initialized, false otherwise.

reinitialize

public void reinitialize(String lang,
                         Vector beans)
                  throws org.apache.bsf.BSFException
Description copied from interface: ScriptEngine
Reinitializes the engine by clearing existing declarations.

Specified by:
reinitialize in interface ScriptEngine
Parameters:
lang - the language.
beans - declared beans.
Throws:
org.apache.bsf.BSFException - on errors.

compileApply

public void compileApply(String source,
                         int lineNo,
                         int columnNo,
                         Object funcBody,
                         Vector paramNames,
                         Vector arguments,
                         org.apache.bsf.util.CodeBuffer cb)
                  throws org.apache.bsf.BSFException
Specified by:
compileApply in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

compileExpr

public void compileExpr(String source,
                        int lineNo,
                        int columnNo,
                        Object expr,
                        org.apache.bsf.util.CodeBuffer cb)
                 throws org.apache.bsf.BSFException
Specified by:
compileExpr in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

compileScript

public void compileScript(String source,
                          int lineNo,
                          int columnNo,
                          Object script,
                          org.apache.bsf.util.CodeBuffer cb)
                   throws org.apache.bsf.BSFException
Specified by:
compileScript in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

terminate

public void terminate()
Specified by:
terminate in interface org.apache.bsf.BSFEngine

getSpecificDebuggingInterface

public Object getSpecificDebuggingInterface()
Specified by:
getSpecificDebuggingInterface in interface org.apache.bsf.BSFEngine

disconnectedDebuggerNotify

public void disconnectedDebuggerNotify()
Specified by:
disconnectedDebuggerNotify in interface org.apache.bsf.BSFEngine

placeBreakpointAtLine

public void placeBreakpointAtLine(int brkptid,
                                  String docname,
                                  int lineno)
                           throws org.apache.bsf.BSFException
Specified by:
placeBreakpointAtLine in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

placeBreakpointAtOffset

public void placeBreakpointAtOffset(int brkptid,
                                    String docname,
                                    int offset)
                             throws org.apache.bsf.BSFException
Specified by:
placeBreakpointAtOffset in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

removeBreakpoint

public void removeBreakpoint(String docname,
                             int brkptid)
                      throws org.apache.bsf.BSFException
Specified by:
removeBreakpoint in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

setEntryExit

public void setEntryExit(String docname,
                         boolean on)
                  throws org.apache.bsf.BSFException
Specified by:
setEntryExit in interface org.apache.bsf.BSFEngine
Throws:
org.apache.bsf.BSFException

propertyChange

public void propertyChange(PropertyChangeEvent event)
Specified by:
propertyChange in interface PropertyChangeListener

getLanguage

protected String getLanguage()
Gets the language.

Returns:
the language.

getDeclaredBeans

protected Vector getDeclaredBeans()
Gets the declared beans.

Returns:
the declared beans.

getClassPath

protected String getClassPath()
Gets the class path.

Returns:
the class path.

setClassPath

protected void setClassPath(String path)
Sets the class path.

Parameters:
path - the class path.

getTempDirectory

protected String getTempDirectory()
Gets the temp directory.

Returns:
the directory.

setTempDirectory

protected void setTempDirectory(String temp)
Sets the temp directory.

Parameters:
temp - the directory.

getClassLoader

protected ClassLoader getClassLoader()
Gets the class loader.

Returns:
the class loader.

setClassLoader

protected void setClassLoader(ClassLoader loader)
Sets the class loader.

Parameters:
loader - the class loader.

getDebugManager

protected org.apache.bsf.debug.BSFDebugManager getDebugManager()
Gets the debug manager.

Returns:
the debug manager.


Copyright © 2004 The Norther Organization. All rights reserved.