Package org.apache.ofbiz.service.engine
Class StandardClojureEngine
java.lang.Object
org.apache.ofbiz.service.engine.AbstractEngine
org.apache.ofbiz.service.engine.GenericAsyncEngine
org.apache.ofbiz.service.engine.StandardClojureEngine
- All Implemented Interfaces:
GenericEngine
Clojure service engine. Enables OFBiz services written in Clojure.
-
Field Summary
Fields inherited from interface org.apache.ofbiz.service.engine.GenericEngine
ASYNC_MODE, SYNC_MODE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
callClojure
(String ns, String fn, DispatchContext dctx, Map<String, Object> context) Load Clojure ns and call service function.Run the service synchronously and return the result.void
runSyncIgnore
(String localName, ModelService modelService, Map<String, 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, getDispatcher, getLocation, sendCallbacks, sendCallbacks, sendCallbacks
-
Constructor Details
-
StandardClojureEngine
-
-
Method Details
-
callClojure
public static Object callClojure(String ns, String fn, DispatchContext dctx, Map<String, Object> context) throws ExceptionLoad Clojure ns and call service function.See https://clojure.github.io/clojure/javadoc/clojure/java/api/Clojure.html
- Parameters:
ns
- Clojure namespace to loadfn
- Clojure function to calldctx
- OFBiz dispatch contextcontext
- OFBiz context - input parameters- Returns:
- Throws:
Exception
-
runSyncIgnore
public void runSyncIgnore(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceExceptionDescription 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
-
runSync
public Map<String,Object> runSync(String localName, ModelService modelService, Map<String, Object> context) throws GenericServiceExceptionDescription 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
-