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 voiddecorateScriptEngine(javax.script.ScriptEngine engine, SourceContext context)Enables overriding to decorate theScriptEngine.protected java.lang.StringgetMetaDataScriptPath(SourceContext context)Obtains the path to the script that extracts the function meta-data.protected java.lang.StringgetScriptEngineName(SourceContext context)Obtains the name of theScriptEngine.protected ScriptExceptionTranslatorgetScriptExceptionTranslator()Obtains theScriptExceptionTranslator.protected java.lang.String[]getScriptFileExtensions(SourceContext context)Obtains the extensions for the script resource.protected java.lang.StringgetSourceName()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:AbstractScriptProcedureSourceServiceFactoryObtains the source name for thisProcedureSource.- Specified by:
getSourceNamein classAbstractScriptProcedureSourceServiceFactory- Returns:
- Source name for this
ProcedureSource.
-
getScriptFileExtensions
protected java.lang.String[] getScriptFileExtensions(SourceContext context) throws java.lang.Exception
Description copied from class:AbstractScriptProcedureSourceServiceFactoryObtains the extensions for the script resource.- Specified by:
getScriptFileExtensionsin 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:AbstractScriptProcedureSourceServiceFactoryObtains the name of theScriptEngine.- Specified by:
getScriptEngineNamein 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.ExceptionDescription copied from class:AbstractScriptProcedureSourceServiceFactoryEnables overriding to decorate theScriptEngine.- Overrides:
decorateScriptEnginein 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:AbstractScriptProcedureSourceServiceFactoryObtains the path to the script that extracts the function meta-data.- Specified by:
getMetaDataScriptPathin 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:AbstractScriptProcedureSourceServiceFactoryObtains theScriptExceptionTranslator.- Overrides:
getScriptExceptionTranslatorin classAbstractScriptProcedureSourceServiceFactory- Returns:
ScriptExceptionTranslator.
-
-