org.red5.server.script.rhino

## Class RhinoScriptFactory

- java.lang.Object
- - org.red5.server.script.rhino.RhinoScriptFactory

All Implemented Interfaces:
  org.springframework.scripting.ScriptFactory

    public class RhinoScriptFactory
    extends Object
    implements org.springframework.scripting.ScriptFactory

`ScriptFactory` implementation for a Rhino / Javascript script.

Typically used in combination with a `org.springframework.scripting.support.ScriptFactoryPostProcessor`; see the latter's `Javadoc` for a configuration example.

Since:
  0.6
Author:
  Paul Gregoire
See Also:
  `org.springframework.scripting.support.ScriptFactoryPostProcessor`, `RhinoScriptUtils`

### Constructor Summary

Constructors
Constructor and Description
`RhinoScriptFactory(String scriptSourceLocator)`
`RhinoScriptFactory(String scriptSourceLocator, Class scriptInterface)`
`RhinoScriptFactory(String scriptSourceLocator, Class[] scriptInterfaces)` Create a new RhinoScriptFactory for the given script source.
`RhinoScriptFactory(String scriptSourceLocator, Class[] scriptInterfaces, Class extendedClass)`

### Method Summary

Methods
`Object` `getScriptedObject(org.springframework.scripting.ScriptSource actualScriptSource, Class[] actualInterfaces)` Load and parse the Rhino script via RhinoScriptUtils.
`Class` `getScriptedObjectType(org.springframework.scripting.ScriptSource src)`
`Class[]` `getScriptInterfaces()`
`String` `getScriptSourceLocator()`
`boolean` `requiresConfigInterface()` Rhino scripts do not require a config interface.
`boolean` `requiresScriptedObjectRefresh(org.springframework.scripting.ScriptSource src)`

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

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

### Constructor Detail

#### RhinoScriptFactory

    public RhinoScriptFactory(String scriptSourceLocator)

#### RhinoScriptFactory

    public RhinoScriptFactory(String scriptSourceLocator,
                      Class scriptInterface)

#### RhinoScriptFactory

    public RhinoScriptFactory(String scriptSourceLocator,
                      Class[] scriptInterfaces)

Create a new RhinoScriptFactory for the given script source.

Parameters:
  `scriptSourceLocator` - a locator that points to the source of the script. Interpreted by the post-processor that actually creates the script.
  `scriptInterfaces` - the Java interfaces that the scripted object is supposed to implement
Throws:
  `IllegalArgumentException` - if either of the supplied arguments is `null`; or the supplied `scriptSourceLocator` argument is composed wholly of whitespace; or if the supplied `scriptInterfaces` argument array has no elements

#### RhinoScriptFactory

    public RhinoScriptFactory(String scriptSourceLocator,
                      Class[] scriptInterfaces,
                      Class extendedClass)

### Method Detail

#### getScriptSourceLocator

    public String getScriptSourceLocator()

Specified by:
  `getScriptSourceLocator` in interface `org.springframework.scripting.ScriptFactory`

#### getScriptInterfaces

    public Class[] getScriptInterfaces()

Specified by:
  `getScriptInterfaces` in interface `org.springframework.scripting.ScriptFactory`

#### requiresConfigInterface

    public boolean requiresConfigInterface()

Rhino scripts do not require a config interface.

Specified by:
  `requiresConfigInterface` in interface `org.springframework.scripting.ScriptFactory`
Returns:
  `false` always

#### getScriptedObject

    public Object getScriptedObject(org.springframework.scripting.ScriptSource actualScriptSource,
                           Class[] actualInterfaces)
                             throws IOException,
                                    org.springframework.scripting.ScriptCompilationException

Load and parse the Rhino script via RhinoScriptUtils.

Specified by:
  `getScriptedObject` in interface `org.springframework.scripting.ScriptFactory`
Throws:
  `IOException`
  `org.springframework.scripting.ScriptCompilationException`

#### getScriptedObjectType

    public Class getScriptedObjectType(org.springframework.scripting.ScriptSource src)
                                throws IOException,
                                       org.springframework.scripting.ScriptCompilationException

Specified by:
  `getScriptedObjectType` in interface `org.springframework.scripting.ScriptFactory`
Throws:
  `IOException`
  `org.springframework.scripting.ScriptCompilationException`

#### requiresScriptedObjectRefresh

    public boolean requiresScriptedObjectRefresh(org.springframework.scripting.ScriptSource src)

Specified by:
  `requiresScriptedObjectRefresh` in interface `org.springframework.scripting.ScriptFactory`