org.codehaus.groovy.bsf
Class GroovyEngine

java.lang.Object
  |
  +--org.apache.bsf.util.BSFEngineImpl
        |
        +--org.codehaus.groovy.bsf.GroovyEngine
All Implemented Interfaces:
org.apache.bsf.BSFEngine, EventListener, PropertyChangeListener
Direct Known Subclasses:
CachingGroovyEngine

public class GroovyEngine
extends org.apache.bsf.util.BSFEngineImpl

A BSF Engine for the Groovy scripting language. It's derived from the Jython / JPython engine

Author:
James Strachan

Field Summary
protected  groovy.lang.GroovyShell shell
           
 
Fields inherited from class org.apache.bsf.util.BSFEngineImpl
classLoader, classPath, dbgmgr, declaredBeans, lang, mgr, tempDir
 
Constructor Summary
GroovyEngine()
           
 
Method Summary
 Object apply(String source, int lineNo, int columnNo, Object funcBody, Vector paramNames, Vector arguments)
          Allow an anonymous function to be declared and invoked
 Object call(Object object, String method, Object[] args)
          Call the named method of the given object.
 void declareBean(org.apache.bsf.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 initialize(org.apache.bsf.BSFManager mgr, String lang, Vector declaredBeans)
          Initialize the engine.
 void undeclareBean(org.apache.bsf.BSFDeclaredBean bean)
          Undeclare a previously declared bean.
 
Methods inherited from class org.apache.bsf.util.BSFEngineImpl
compileApply, compileExpr, compileScript, disconnectedDebuggerNotify, getSpecificDebuggingInterface, placeBreakpointAtLine, placeBreakpointAtOffset, propertyChange, removeBreakpoint, setEntryExit, terminate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shell

protected groovy.lang.GroovyShell shell
Constructor Detail

GroovyEngine

public GroovyEngine()
Method Detail

apply

public Object apply(String source,
                    int lineNo,
                    int columnNo,
                    Object funcBody,
                    Vector paramNames,
                    Vector arguments)
             throws org.apache.bsf.BSFException
Allow an anonymous function to be declared and invoked

Specified by:
apply in interface org.apache.bsf.BSFEngine
Overrides:
apply in class org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.BSFException

call

public Object call(Object object,
                   String method,
                   Object[] args)
            throws org.apache.bsf.BSFException
Call the named method of the given object.

Specified by:
call in interface org.apache.bsf.BSFEngine
Specified by:
call in class org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.BSFException

declareBean

public void declareBean(org.apache.bsf.BSFDeclaredBean bean)
                 throws org.apache.bsf.BSFException
Declare a bean

Specified by:
declareBean in interface org.apache.bsf.BSFEngine
Overrides:
declareBean in class org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.BSFException

eval

public Object eval(String source,
                   int lineNo,
                   int columnNo,
                   Object script)
            throws org.apache.bsf.BSFException
Evaluate an expression.

Specified by:
eval in interface org.apache.bsf.BSFEngine
Specified by:
eval in class org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.BSFException

exec

public void exec(String source,
                 int lineNo,
                 int columnNo,
                 Object script)
          throws org.apache.bsf.BSFException
Execute a script.

Specified by:
exec in interface org.apache.bsf.BSFEngine
Overrides:
exec in class org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.BSFException

initialize

public void initialize(org.apache.bsf.BSFManager mgr,
                       String lang,
                       Vector declaredBeans)
                throws org.apache.bsf.BSFException
Initialize the engine.

Specified by:
initialize in interface org.apache.bsf.BSFEngine
Overrides:
initialize in class org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.BSFException

undeclareBean

public void undeclareBean(org.apache.bsf.BSFDeclaredBean bean)
                   throws org.apache.bsf.BSFException
Undeclare a previously declared bean.

Specified by:
undeclareBean in interface org.apache.bsf.BSFEngine
Overrides:
undeclareBean in class org.apache.bsf.util.BSFEngineImpl
org.apache.bsf.BSFException


Copyright © 2003 The Codehaus. All Rights Reserved.