Package org.apache.ofbiz.service.engine
Class ScriptEngine
- java.lang.Object
-
- org.apache.ofbiz.service.engine.AbstractEngine
-
- org.apache.ofbiz.service.engine.GenericAsyncEngine
-
- org.apache.ofbiz.service.engine.ScriptEngine
-
- All Implemented Interfaces:
GenericEngine
public final class ScriptEngine extends GenericAsyncEngine
Generic Script Service Engine. This service engine uses the javax.script package (JSR-223) to invoke scripts or script functions.The script service engine will put the following artifacts in the script engine's bindings:
parameters
- the service attributesMap
dctx
- aDispatchContext
instancedispatcher
- aLocalDispatcher
instancedelegator
- aDelegator
instance
If the service definition includes an invoke attribute, then the matching script function/method will be called with a single argument - the bindings
Map
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Fields inherited from class org.apache.ofbiz.service.engine.AbstractEngine
dispatcher, locationMap
-
Fields inherited from interface org.apache.ofbiz.service.engine.GenericEngine
ASYNC_MODE, SYNC_MODE
-
-
Constructor Summary
Constructors Constructor Description ScriptEngine(ServiceDispatcher dispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
runSync(java.lang.String localName, ModelService modelService, java.util.Map<java.lang.String,java.lang.Object> context)
Run the service synchronously and return the result.void
runSyncIgnore(java.lang.String localName, ModelService modelService, java.util.Map<java.lang.String,java.lang.Object> context)
Run the service synchronously and IGNORE the result.-
Methods inherited from class org.apache.ofbiz.service.engine.GenericAsyncEngine
allowCallbacks, runAsync, runAsync
-
Methods inherited from class org.apache.ofbiz.service.engine.AbstractEngine
createLocationMap, getLocation, sendCallbacks, sendCallbacks, sendCallbacks
-
-
-
-
Constructor Detail
-
ScriptEngine
public ScriptEngine(ServiceDispatcher dispatcher)
-
-
Method Detail
-
runSync
public java.util.Map<java.lang.String,java.lang.Object> runSync(java.lang.String localName, ModelService modelService, java.util.Map<java.lang.String,java.lang.Object> context) throws GenericServiceException
Description copied from interface:GenericEngine
Run the service synchronously and return the result.- Specified by:
runSync
in interfaceGenericEngine
- Specified by:
runSync
in classGenericAsyncEngine
- Parameters:
localName
- Name of the LocalDispatcher.modelService
- Service model object.context
- Map of name, value pairs composing the context.- Returns:
- Map of name, value pairs composing the result.
- Throws:
GenericServiceException
- See Also:
GenericEngine.runSync(java.lang.String, org.apache.ofbiz.service.ModelService, java.util.Map)
-
runSyncIgnore
public void runSyncIgnore(java.lang.String localName, ModelService modelService, java.util.Map<java.lang.String,java.lang.Object> context) throws GenericServiceException
Description copied from interface:GenericEngine
Run the service synchronously and IGNORE the result.- Specified by:
runSyncIgnore
in interfaceGenericEngine
- Specified by:
runSyncIgnore
in classGenericAsyncEngine
- Parameters:
localName
- Name of the LocalDispatcher.modelService
- Service model object.context
- Map of name, value pairs composing the context.- Throws:
GenericServiceException
- See Also:
GenericEngine.runSyncIgnore(java.lang.String, org.apache.ofbiz.service.ModelService, java.util.Map)
-
-