Package net.officefloor.javascript
Class JavaScriptProcedureSourceServiceFactory
- java.lang.Object
-
- net.officefloor.script.AbstractScriptProcedureSourceServiceFactory
-
- net.officefloor.javascript.JavaScriptProcedureSourceServiceFactory
-
- All Implemented Interfaces:
ProcedureSourceServiceFactory
,ServiceFactory<ProcedureSource>
public class JavaScriptProcedureSourceServiceFactory extends AbstractScriptProcedureSourceServiceFactory
JavaScript functionProcedureSourceServiceFactory
.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description JavaScriptProcedureSourceServiceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
decorateScriptEngine(javax.script.ScriptEngine engine, SourceContext context)
Enables overriding to decorate theScriptEngine
.protected java.lang.String
getMetaDataScriptPath(SourceContext context)
Obtains the path to the script that extracts the function meta-data.protected java.lang.String
getScriptEngineName(SourceContext context)
Obtains the name of theScriptEngine
.protected ScriptExceptionTranslator
getScriptExceptionTranslator()
Obtains theScriptExceptionTranslator
.protected java.lang.String[]
getScriptFileExtensions(SourceContext context)
Obtains the extensions for the script resource.protected java.lang.String
getSourceName()
Obtains the source name for thisProcedureSource
.-
Methods inherited from class net.officefloor.script.AbstractScriptProcedureSourceServiceFactory
createService, getSetupScriptPath, listProcedures, loadManagedFunction, loadResourceScript, loadScriptEngine, loadSetupScript
-
-
-
-
Method Detail
-
getSourceName
protected java.lang.String getSourceName()
Description copied from class:AbstractScriptProcedureSourceServiceFactory
Obtains the source name for thisProcedureSource
.- Specified by:
getSourceName
in classAbstractScriptProcedureSourceServiceFactory
- Returns:
- Source name for this
ProcedureSource
.
-
getScriptFileExtensions
protected java.lang.String[] getScriptFileExtensions(SourceContext context) throws java.lang.Exception
Description copied from class:AbstractScriptProcedureSourceServiceFactory
Obtains the extensions for the script resource.- Specified by:
getScriptFileExtensions
in classAbstractScriptProcedureSourceServiceFactory
- Parameters:
context
-SourceContext
.- Returns:
- Extensions for the script resource.
- Throws:
java.lang.Exception
- If fails to obtain the file extensions.
-
getScriptEngineName
protected java.lang.String getScriptEngineName(SourceContext context) throws java.lang.Exception
Description copied from class:AbstractScriptProcedureSourceServiceFactory
Obtains the name of theScriptEngine
.- Specified by:
getScriptEngineName
in classAbstractScriptProcedureSourceServiceFactory
- Parameters:
context
-SourceContext
.- Returns:
- Name of the
ScriptEngine
. - Throws:
java.lang.Exception
- If fails to obtain the name of theScriptEngine
.
-
decorateScriptEngine
protected void decorateScriptEngine(javax.script.ScriptEngine engine, SourceContext context) throws java.lang.Exception
Description copied from class:AbstractScriptProcedureSourceServiceFactory
Enables overriding to decorate theScriptEngine
.- Overrides:
decorateScriptEngine
in classAbstractScriptProcedureSourceServiceFactory
- Parameters:
engine
-ScriptEngine
.context
-SourceContext
.- Throws:
java.lang.Exception
- If fails to decorate theScriptEngine
.
-
getMetaDataScriptPath
protected java.lang.String getMetaDataScriptPath(SourceContext context) throws java.lang.Exception
Description copied from class:AbstractScriptProcedureSourceServiceFactory
Obtains the path to the script that extracts the function meta-data.- Specified by:
getMetaDataScriptPath
in classAbstractScriptProcedureSourceServiceFactory
- Parameters:
context
-SourceContext
.- Returns:
- Path to the script that extracts the function meta-data.
- Throws:
java.lang.Exception
- If fails to obtain the path to the function meta-data script.
-
getScriptExceptionTranslator
protected ScriptExceptionTranslator getScriptExceptionTranslator()
Description copied from class:AbstractScriptProcedureSourceServiceFactory
Obtains theScriptExceptionTranslator
.- Overrides:
getScriptExceptionTranslator
in classAbstractScriptProcedureSourceServiceFactory
- Returns:
ScriptExceptionTranslator
.
-
-