org.apache.bsf.engines.jython

Class JythonEngine

Implemented Interfaces:
BSFEngine, PropertyChangeListener

public class JythonEngine
extends BSFEngineImpl

This is the interface to Jython (http://www.jython.org/) from BSF. It's derived from the JPython 1.x engine

Authors:
Sanjiva Weerawarana
Finn Bock
Chuck Murcko

Nested Class Summary

Field Summary

Fields inherited from class org.apache.bsf.util.BSFEngineImpl

classLoader, classPath, declaredBeans, lang, mgr, tempDir

Method Summary

Object
apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments)
Evaluate an anonymous function (differs from eval() in that apply() handles multiple lines).
Object
call(Object object, String method, Object[] args)
call the named method of the given object.
void
declareBean(BSFDeclaredBean bean)
Declare a bean
Object
eval(String source, int lineNo, int columnNo, Object script)
Evaluate an expression.
void
exec(String source, int lineNo, int columnNo, Object script)
Execute a script.
void
iexec(String source, int lineNo, int columnNo, Object script)
Execute script code, emulating console interaction.
void
initialize(BSFManager mgr, String lang, Vector declaredBeans)
Initialize the engine.
void
undeclareBean(BSFDeclaredBean bean)
Undeclare a previously declared bean.
Object
unwrap(PyObject result)

Methods inherited from class org.apache.bsf.util.BSFEngineImpl

apply, compileApply, compileExpr, compileScript, declareBean, exec, iexec, initialize, propertyChange, terminate, undeclareBean

Method Details

apply

public Object apply(String source,
                    int lineNo,
                    int columnNo,
                    Object funcBody,
                    Vector paramNames,
                    Vector arguments)
            throws BSFException
Evaluate an anonymous function (differs from eval() in that apply() handles multiple lines).
Specified by:
apply in interface BSFEngine
Overrides:
apply in interface BSFEngineImpl


call

public Object call(Object object,
                   String method,
                   Object[] args)
            throws BSFException
call the named method of the given object.
Specified by:
call in interface BSFEngine


declareBean

public void declareBean(BSFDeclaredBean bean)
            throws BSFException
Declare a bean
Specified by:
declareBean in interface BSFEngine
Overrides:
declareBean in interface BSFEngineImpl


eval

public Object eval(String source,
                   int lineNo,
                   int columnNo,
                   Object script)
            throws BSFException
Evaluate an expression.
Specified by:
eval in interface BSFEngine


exec

public void exec(String source,
                 int lineNo,
                 int columnNo,
                 Object script)
            throws BSFException
Execute a script.
Specified by:
exec in interface BSFEngine
Overrides:
exec in interface BSFEngineImpl


iexec

public void iexec(String source,
                  int lineNo,
                  int columnNo,
                  Object script)
            throws BSFException
Execute script code, emulating console interaction.
Specified by:
iexec in interface BSFEngine
Overrides:
iexec in interface BSFEngineImpl


initialize

public void initialize(BSFManager mgr,
                       String lang,
                       Vector declaredBeans)
            throws BSFException
Initialize the engine.
Specified by:
initialize in interface BSFEngine
Overrides:
initialize in interface BSFEngineImpl


undeclareBean

public void undeclareBean(BSFDeclaredBean bean)
            throws BSFException
Undeclare a previously declared bean.
Specified by:
undeclareBean in interface BSFEngine
Overrides:
undeclareBean in interface BSFEngineImpl


unwrap

public Object unwrap(PyObject result)