Apache JMeter

org.apache.jmeter.util
Class BSFJavaScriptEngine

java.lang.Object
  extended by BSFEngineImpl
      extended by org.apache.jmeter.util.BSFJavaScriptEngine

public class BSFJavaScriptEngine
extends BSFEngineImpl

This is the interface to Netscape's Rhino (JavaScript) from the Bean Scripting Framework.

The original version of this code was first written by Adam Peller for use in LotusXSL. Sanjiva took his code and adapted it for BSF. Modified for JMeter to fix bug BSF-22.


Constructor Summary
BSFJavaScriptEngine()
           
 
Method Summary
 java.lang.Object call(java.lang.Object object, java.lang.String method, java.lang.Object[] args)
          Return an object from an extension.
 void declareBean(BSFDeclaredBean bean)
           
 java.lang.Object eval(java.lang.String source, int lineNo, int columnNo, java.lang.Object oscript)
          This is used by an application to evaluate a string containing some expression.
 void initialize(BSFManager mgr, java.lang.String lang, java.util.Vector declaredBeans)
          Initialize the engine.
 void undeclareBean(BSFDeclaredBean bean)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BSFJavaScriptEngine

public BSFJavaScriptEngine()
Method Detail

call

public java.lang.Object call(java.lang.Object object,
                             java.lang.String method,
                             java.lang.Object[] args)
                      throws BSFException
Return an object from an extension.

Parameters:
object - Object on which to make the call (ignored).
method - The name of the method to call.
args - an array of arguments to be passed to the extension, which may be either Vectors of Nodes, or Strings.
Throws:
BSFException

declareBean

public void declareBean(BSFDeclaredBean bean)
                 throws BSFException
Throws:
BSFException

eval

public java.lang.Object eval(java.lang.String source,
                             int lineNo,
                             int columnNo,
                             java.lang.Object oscript)
                      throws BSFException
This is used by an application to evaluate a string containing some expression.

Throws:
BSFException

initialize

public void initialize(BSFManager mgr,
                       java.lang.String lang,
                       java.util.Vector declaredBeans)
                throws BSFException
Initialize the engine. Put the manager into the context-manager map hashtable too.

Throws:
BSFException

undeclareBean

public void undeclareBean(BSFDeclaredBean bean)
                   throws BSFException
Throws:
BSFException

Apache JMeter

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.