Package org.apache.sling.scripting.javascript.internal

## Class RhinoJavaScriptEngine

- java.lang.Object
- - javax.script.AbstractScriptEngine
  - - org.apache.sling.scripting.api.AbstractSlingScriptEngine
    - - org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine

All Implemented Interfaces:
  `Compilable`, `ScriptEngine`

    public class RhinoJavaScriptEngine
    extends org.apache.sling.scripting.api.AbstractSlingScriptEngine
    implements Compilable

A ScriptEngine that uses the Rhino interpreter to process Sling requests with server-side javascript.

### Field Summary

### Fields inherited from class javax.script.AbstractScriptEngine

`context`

### Fields inherited from interface javax.script.ScriptEngine

`ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME`

### Constructor Summary

Constructors
`RhinoJavaScriptEngine​(ScriptEngineFactory factory, org.mozilla.javascript.Scriptable rootScope, org.apache.sling.scripting.api.ScriptCache scriptCache)`

### Method Summary

All Methods Instance Methods Concrete Methods
`CompiledScript` `compile​(Reader scriptReader)`
`CompiledScript` `compile​(String script)`
`Object` `eval​(Reader scriptReader, ScriptContext scriptContext)`

### Methods inherited from class org.apache.sling.scripting.api.AbstractSlingScriptEngine

`createBindings, eval, getFactory`

### Methods inherited from class javax.script.AbstractScriptEngine

`eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### RhinoJavaScriptEngine

    public RhinoJavaScriptEngine​(ScriptEngineFactory factory,
                                 org.mozilla.javascript.Scriptable rootScope,
                                 org.apache.sling.scripting.api.ScriptCache scriptCache)

### Method Detail

#### compile

    public CompiledScript compile​(String script)
                           throws ScriptException

Specified by:
  `compile` in interface `Compilable`
Throws:
  `ScriptException`

#### compile

    public CompiledScript compile​(Reader scriptReader)
                           throws ScriptException

Specified by:
  `compile` in interface `Compilable`
Throws:
  `ScriptException`

#### eval

    public Object eval​(Reader scriptReader,
                       ScriptContext scriptContext)
                throws ScriptException

Specified by:
  `eval` in interface `ScriptEngine`
Throws:
  `ScriptException`