wyvern.world
Class Scripting

java.lang.Object
  extended bywyvern.world.Scripting

public final class Scripting
extends java.lang.Object

Wrapper interface for Jakarta's BSF (Bean Scripting Framework). Provides a common interface for Jython, JRuby, BeanShell, and other scripting languages supported by Wyvern.

Version:
1.0, Nov 30, 2003
Author:
Steve Yegge

Method Summary
static org.apache.bsf.BSFManager getBSF()
          Returns a shared BSFManager object.
static java.lang.Object rubyEval(java.lang.String expr)
          Calls the shared BSFManager instance to evaluate a Ruby expression.
static void rubyExec(java.lang.Object script)
          Calls the shared BSFManager instance to execute a Ruby script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBSF

public static org.apache.bsf.BSFManager getBSF()
Returns a shared BSFManager object. Nothing stopping you from making your own, I guess, although it can be slow and hog memory if you make a bunch of them.


rubyEval

public static java.lang.Object rubyEval(java.lang.String expr)
                                 throws java.lang.Exception
Calls the shared BSFManager instance to evaluate a Ruby expression.

Throws:
java.lang.Exception

rubyExec

public static void rubyExec(java.lang.Object script)
                     throws java.lang.Exception
Calls the shared BSFManager instance to execute a Ruby script.

Throws:
java.lang.Exception