Package org.apache.ofbiz.service
Class ServiceSynchronization
- java.lang.Object
-
- org.apache.ofbiz.service.ServiceSynchronization
-
- All Implemented Interfaces:
javax.transaction.Synchronization
public class ServiceSynchronization extends java.lang.Object implements javax.transaction.Synchronization
This class is used to execute services when a transaction is either committed or rolled back. It should generally be accessed via LocalDispatcher's addCommitService and addRollbackService methods or by using the service ECA event attribute values global-commit, global-rollback or global-commit-post-run
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Constructor Summary
Constructors Constructor Description ServiceSynchronization()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCompletion(int status)
void
beforeCompletion()
protected static ServiceSynchronization
getInstance()
static void
registerCommitService(DispatchContext dctx, java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
static void
registerRollbackService(DispatchContext dctx, java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
-
-
-
Method Detail
-
registerCommitService
public static void registerCommitService(DispatchContext dctx, java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist) throws GenericServiceException
- Throws:
GenericServiceException
-
registerRollbackService
public static void registerRollbackService(DispatchContext dctx, java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist) throws GenericServiceException
- Throws:
GenericServiceException
-
getInstance
protected static ServiceSynchronization getInstance() throws GenericServiceException
- Throws:
GenericServiceException
-
afterCompletion
public void afterCompletion(int status)
- Specified by:
afterCompletion
in interfacejavax.transaction.Synchronization
-
beforeCompletion
public void beforeCompletion()
- Specified by:
beforeCompletion
in interfacejavax.transaction.Synchronization
-
-