org.apache.jmeter.util

## Class BSFJavaScriptEngine

- java.lang.Object
- - org.apache.bsf.util.BSFEngineImpl
  - - org.apache.jmeter.util.BSFJavaScriptEngine

- All Implemented Interfaces:
    PropertyChangeListener, EventListener, org.apache.bsf.BSFEngine

      public class BSFJavaScriptEngine
      extends org.apache.bsf.util.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.

- - ### Field Summary

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

      `classLoader, classPath, declaredBeans, lang, mgr, tempDir`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BSFJavaScriptEngine()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `call(Object object, String method, Object[] args)` Return an object from an extension.
    `void` | `declareBean(org.apache.bsf.BSFDeclaredBean bean)`
    `Object` | `eval(String source, int lineNo, int columnNo, Object oscript)` This is used by an application to evaluate a string containing some expression.
    `void` | `initialize(org.apache.bsf.BSFManager mgr, String lang, Vector declaredBeans)` Initialize the engine.
    `void` | `undeclareBean(org.apache.bsf.BSFDeclaredBean bean)`

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

      `apply, compileApply, compileExpr, compileScript, exec, iexec, propertyChange, terminate`

    - ### 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 Object call(Object object,
                             String method,
                             Object[] args)
                      throws org.apache.bsf.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:
        `org.apache.bsf.BSFException`

    - #### declareBean

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

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

    - #### eval

          public Object eval(String source,
                             int lineNo,
                             int columnNo,
                             Object oscript)
                      throws org.apache.bsf.BSFException

      This is used by an application to evaluate a string containing some expression.
      Throws:
        `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. Put the manager into the context-manager map hashtable too.
      Specified by:
        `initialize` in interface `org.apache.bsf.BSFEngine`
      Overrides:
        `initialize` in class `org.apache.bsf.util.BSFEngineImpl`
      Throws:
        `org.apache.bsf.BSFException`

    - #### undeclareBean

          public void undeclareBean(org.apache.bsf.BSFDeclaredBean bean)
                             throws org.apache.bsf.BSFException

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

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