Package net.officefloor.script
Class ScriptManagedFunction
- java.lang.Object
-
- net.officefloor.frame.api.function.StaticManagedFunction<Indexed,Indexed>
-
- net.officefloor.script.ScriptManagedFunction
-
- All Implemented Interfaces:
ManagedFunction<Indexed,Indexed>
,ManagedFunctionFactory<Indexed,Indexed>
public class ScriptManagedFunction extends StaticManagedFunction<Indexed,Indexed>
ScriptManagedFunction
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ScriptManagedFunction.ScriptEngineDecorator
Decorates theScriptEngine
.
-
Constructor Summary
Constructors Constructor Description ScriptManagedFunction(javax.script.ScriptEngineManager engineManager, java.lang.String engineName, ScriptManagedFunction.ScriptEngineDecorator scriptEngineDecorator, java.lang.String setupScript, java.lang.String script, java.lang.String functionName, ClassDependencyFactory[] parameterFactories, ScriptExceptionTranslator scriptExceptionTranslator)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(ManagedFunctionContext<Indexed,Indexed> context)
Executes the function.-
Methods inherited from class net.officefloor.frame.api.function.StaticManagedFunction
createManagedFunction
-
-
-
-
Constructor Detail
-
ScriptManagedFunction
public ScriptManagedFunction(javax.script.ScriptEngineManager engineManager, java.lang.String engineName, ScriptManagedFunction.ScriptEngineDecorator scriptEngineDecorator, java.lang.String setupScript, java.lang.String script, java.lang.String functionName, ClassDependencyFactory[] parameterFactories, ScriptExceptionTranslator scriptExceptionTranslator)
Instantiate.- Parameters:
engineManager
-ScriptEngineManager
.engineName
-ScriptEngine
name.scriptEngineDecorator
-ScriptManagedFunction.ScriptEngineDecorator
.setupScript
- Setup script.script
- Script.functionName
- Name of the function.parameterFactories
-ClassDependencyFactory
instances.scriptExceptionTranslator
-ScriptExceptionTranslator
.
-
-
Method Detail
-
execute
public void execute(ManagedFunctionContext<Indexed,Indexed> context) throws java.lang.Throwable
Description copied from interface:ManagedFunction
Executes the function.- Parameters:
context
-ManagedFunctionContext
for theManagedFunction
.- Throws:
java.lang.Throwable
- Indicating failure of theManagedFunction
.
-
-