Package org.apache.ofbiz.service
Class ServiceXaWrapper
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.ofbiz.entity.transaction.GenericXaResource
-
- org.apache.ofbiz.service.ServiceXaWrapper
-
- All Implemented Interfaces:
java.lang.Runnable
,javax.transaction.xa.XAResource
@Deprecated public class ServiceXaWrapper extends GenericXaResource
Deprecated.- Use ServiceSynchronization instead (via LocalDispatcher)ServiceXaWrapper - XA Resource wrapper for running services on commit() or rollback()
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
commitAsync
Deprecated.protected boolean
commitAsyncPersist
Deprecated.protected java.util.Map<java.lang.String,? extends java.lang.Object>
commitContext
Deprecated.protected java.lang.String
commitService
Deprecated.protected DispatchContext
dctx
Deprecated.static int
MODE_ASYNC
Deprecated.static int
MODE_SYNC
Deprecated.static java.lang.String
module
Deprecated.protected boolean
rollbackAsync
Deprecated.protected boolean
rollbackAsyncPersist
Deprecated.protected java.util.Map<java.lang.String,? extends java.lang.Object>
rollbackContext
Deprecated.protected java.lang.String
rollbackService
Deprecated.protected java.lang.String
runAsUser
Deprecated.static int
TYPE_COMMIT
Deprecated.static int
TYPE_ROLLBACK
Deprecated.-
Fields inherited from class org.apache.ofbiz.entity.transaction.GenericXaResource
active, timeout, trans, xid
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ServiceXaWrapper()
Deprecated.ServiceXaWrapper(DispatchContext dctx)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
commit(javax.transaction.xa.Xid xid, boolean onePhase)
Deprecated.void
enlist()
Deprecated.Enlists this resource in the current transactionjava.util.Map<java.lang.String,? extends java.lang.Object>
getCommitContext()
Deprecated.java.lang.String
getCommitService()
Deprecated.java.util.Map<java.lang.String,? extends java.lang.Object>
getRollbackContext()
Deprecated.java.lang.String
getRollbackService()
Deprecated.int
prepare(javax.transaction.xa.Xid xid)
Deprecated.void
rollback(javax.transaction.xa.Xid xid)
Deprecated.protected void
runService(java.lang.String service, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist, int mode, int type)
Deprecated.void
setCommitService(java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on commit()void
setCommitService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Deprecated.Sets the service to run on commit()void
setCommitService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on commit()void
setRollbackService(java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on rollback()void
setRollbackService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Deprecated.Sets the service to run on rollback()void
setRollbackService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on rollback()-
Methods inherited from class org.apache.ofbiz.entity.transaction.GenericXaResource
end, enlist, forget, getTransaction, getTransactionTimeout, getXid, isSameRM, recover, run, runOnTimeout, setTransaction, setTransactionTimeout, start
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
module
public static final java.lang.String module
Deprecated.
-
TYPE_ROLLBACK
public static final int TYPE_ROLLBACK
Deprecated.- See Also:
- Constant Field Values
-
TYPE_COMMIT
public static final int TYPE_COMMIT
Deprecated.- See Also:
- Constant Field Values
-
MODE_ASYNC
public static final int MODE_ASYNC
Deprecated.- See Also:
- Constant Field Values
-
MODE_SYNC
public static final int MODE_SYNC
Deprecated.- See Also:
- Constant Field Values
-
dctx
protected DispatchContext dctx
Deprecated.
-
rollbackService
protected java.lang.String rollbackService
Deprecated.
-
commitService
protected java.lang.String commitService
Deprecated.
-
runAsUser
protected java.lang.String runAsUser
Deprecated.
-
rollbackContext
protected java.util.Map<java.lang.String,? extends java.lang.Object> rollbackContext
Deprecated.
-
commitContext
protected java.util.Map<java.lang.String,? extends java.lang.Object> commitContext
Deprecated.
-
rollbackAsync
protected boolean rollbackAsync
Deprecated.
-
rollbackAsyncPersist
protected boolean rollbackAsyncPersist
Deprecated.
-
commitAsync
protected boolean commitAsync
Deprecated.
-
commitAsyncPersist
protected boolean commitAsyncPersist
Deprecated.
-
-
Constructor Detail
-
ServiceXaWrapper
protected ServiceXaWrapper()
Deprecated.
-
ServiceXaWrapper
public ServiceXaWrapper(DispatchContext dctx)
Deprecated.
-
-
Method Detail
-
setCommitService
public void setCommitService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Deprecated.Sets the service to run on commit()- Parameters:
serviceName
- Name of service to runcontext
- Context to use when running
-
setCommitService
public void setCommitService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on commit()- Parameters:
serviceName
- Name of service to runcontext
- Context to use when runningasync
- override default async behavior
-
setCommitService
public void setCommitService(java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on commit()- Parameters:
serviceName
- Name of service to runrunAsUser
- UserLoginID to run ascontext
- Context to use when runningasync
- override default async behavior
-
getCommitService
public java.lang.String getCommitService()
Deprecated.- Returns:
- The name of the service to run on commit()
-
getCommitContext
public java.util.Map<java.lang.String,? extends java.lang.Object> getCommitContext()
Deprecated.- Returns:
- The context used when running the commit() service
-
setRollbackService
public void setRollbackService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Deprecated.Sets the service to run on rollback()- Parameters:
serviceName
- Name of service to runcontext
- Context to use when running
-
setRollbackService
public void setRollbackService(java.lang.String serviceName, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on rollback()- Parameters:
serviceName
- Name of service to runcontext
- Context to use when runningasync
- override default async behavior
-
setRollbackService
public void setRollbackService(java.lang.String serviceName, java.lang.String runAsUser, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean async, boolean persist)
Deprecated.Sets the service to run on rollback()- Parameters:
serviceName
- Name of service to runrunAsUser
- userLoginId to run the service ascontext
- Context to use when runningasync
- override default async behavior
-
getRollbackService
public java.lang.String getRollbackService()
Deprecated.- Returns:
- The name of the service to run on rollback()
-
getRollbackContext
public java.util.Map<java.lang.String,? extends java.lang.Object> getRollbackContext()
Deprecated.- Returns:
- The context used when running the rollback() service
-
enlist
public void enlist() throws javax.transaction.xa.XAException
Deprecated.Description copied from class:GenericXaResource
Enlists this resource in the current transaction- Overrides:
enlist
in classGenericXaResource
- Throws:
javax.transaction.xa.XAException
-
commit
public void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
Deprecated.- Specified by:
commit
in interfacejavax.transaction.xa.XAResource
- Specified by:
commit
in classGenericXaResource
- Throws:
javax.transaction.xa.XAException
- See Also:
XAResource.commit(javax.transaction.xa.Xid xid, boolean onePhase)
-
rollback
public void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
Deprecated.- Specified by:
rollback
in interfacejavax.transaction.xa.XAResource
- Specified by:
rollback
in classGenericXaResource
- Throws:
javax.transaction.xa.XAException
- See Also:
XAResource.rollback(javax.transaction.xa.Xid xid)
-
prepare
public int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
Deprecated.- Specified by:
prepare
in interfacejavax.transaction.xa.XAResource
- Overrides:
prepare
in classGenericXaResource
- Throws:
javax.transaction.xa.XAException
- See Also:
XAResource.prepare(javax.transaction.xa.Xid xid)
-
runService
protected final void runService(java.lang.String service, java.util.Map<java.lang.String,? extends java.lang.Object> context, boolean persist, int mode, int type) throws javax.transaction.xa.XAException
Deprecated.- Throws:
javax.transaction.xa.XAException
-
-