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.
org.springframework.scripting.support.ScriptFactoryPostProcessor
,
RhinoScriptUtils
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) |
Modifier and Type | Method and Description |
---|---|
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) |
public RhinoScriptFactory(String scriptSourceLocator)
public RhinoScriptFactory(String scriptSourceLocator, Class[] scriptInterfaces)
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
implementIllegalArgumentException
- 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
elementspublic String getScriptSourceLocator()
getScriptSourceLocator
in interface org.springframework.scripting.ScriptFactory
public Class[] getScriptInterfaces()
getScriptInterfaces
in interface org.springframework.scripting.ScriptFactory
public boolean requiresConfigInterface()
requiresConfigInterface
in interface org.springframework.scripting.ScriptFactory
false
alwayspublic Object getScriptedObject(org.springframework.scripting.ScriptSource actualScriptSource, Class[] actualInterfaces) throws IOException, org.springframework.scripting.ScriptCompilationException
getScriptedObject
in interface org.springframework.scripting.ScriptFactory
IOException
org.springframework.scripting.ScriptCompilationException
public Class getScriptedObjectType(org.springframework.scripting.ScriptSource src) throws IOException, org.springframework.scripting.ScriptCompilationException
getScriptedObjectType
in interface org.springframework.scripting.ScriptFactory
IOException
org.springframework.scripting.ScriptCompilationException
public boolean requiresScriptedObjectRefresh(org.springframework.scripting.ScriptSource src)
requiresScriptedObjectRefresh
in interface org.springframework.scripting.ScriptFactory
Copyright © 2006-2012 The Red5 Project