org.codehaus.groovy.bsf
Class GroovyEngine

java.lang.Object
  extended byorg.apache.bsf.util.BSFEngineImpl
      extended byorg.codehaus.groovy.bsf.GroovyEngine
All Implemented Interfaces:
org.apache.bsf.BSFEngine, java.util.EventListener, java.beans.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  GroovyShell shell
           
 
Fields inherited from class org.apache.bsf.util.BSFEngineImpl
classLoader, classPath, dbgmgr, declaredBeans, lang, mgr, tempDir
 
Constructor Summary
GroovyEngine()
           
 
Method Summary
 java.lang.Object apply(java.lang.String source, int lineNo, int columnNo, java.lang.Object funcBody, java.util.Vector paramNames, java.util.Vector arguments)
          Allow an anonymous function to be declared and invoked
 java.lang.Object call(java.lang.Object object, java.lang.String method, java.lang.Object[] args)
          Call the named method of the given object.
 void declareBean(org.apache.bsf.BSFDeclaredBean bean)
          Declare a bean
 java.lang.Object eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object script)
          Evaluate an expression.
 void exec(java.lang.String source, int lineNo, int columnNo, java.lang.Object script)
          Execute a script.
protected  GroovyShell getEvalShell()
           
 void initialize(org.apache.bsf.BSFManager mgr, java.lang.String lang, java.util.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 GroovyShell shell
Constructor Detail

GroovyEngine

public GroovyEngine()
Method Detail

apply

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

Throws:
org.apache.bsf.BSFException

call

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

Throws:
org.apache.bsf.BSFException

declareBean

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

Throws:
org.apache.bsf.BSFException

eval

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

Throws:
org.apache.bsf.BSFException

exec

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

Throws:
org.apache.bsf.BSFException

initialize

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

Throws:
org.apache.bsf.BSFException

undeclareBean

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

Throws:
org.apache.bsf.BSFException

getEvalShell

protected GroovyShell getEvalShell()
Returns:
a newly created GroovyShell using the same variable scope but a new class loader


Copyright © 2003-2004 The Codehaus. All Rights Reserved.