public class TCCFenceHandler extends Object
| 限定符和类型 | 类和说明 |
|---|---|
private static class |
TCCFenceHandler.FenceLogCleanRunnable
clean fence log that has the final status runnable.
|
private static class |
TCCFenceHandler.FenceLogIdentity |
| 限定符和类型 | 字段和说明 |
|---|---|
private static DataSource |
dataSource |
private static TCCFenceHandler.FenceLogCleanRunnable |
fenceLogCleanRunnable |
private static LinkedBlockingQueue<TCCFenceHandler.FenceLogIdentity> |
LOG_QUEUE |
private static ExecutorService |
logCleanExecutor |
private static org.slf4j.Logger |
LOGGER |
private static int |
MAX_QUEUE_SIZE |
private static int |
MAX_THREAD_CLEAN |
private static io.seata.rm.tcc.store.TCCFenceStore |
TCC_FENCE_DAO |
| 限定符 | 构造器和说明 |
|---|---|
private |
TCCFenceHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
private static void |
addToLogCleanQueue(String xid,
long branchId) |
static boolean |
commitFence(Method commitMethod,
Object targetTCCBean,
String xid,
Long branchId,
Object[] args)
tcc commit method enhanced
|
static boolean |
deleteFence(String xid,
Long branchId)
Delete TCC Fence
|
private static void |
initLogCleanExecutor() |
private static boolean |
insertTCCFenceLog(Connection conn,
String xid,
Long branchId,
String actionName,
Integer status)
Insert TCC fence log
|
static Object |
prepareFence(String xid,
Long branchId,
String actionName)
tcc prepare method enhanced
|
static boolean |
rollbackFence(Method rollbackMethod,
Object targetTCCBean,
String xid,
Long branchId,
Object[] args,
String actionName)
tcc rollback method enhanced
|
private static boolean |
updateStatusAndInvokeTargetMethod(Connection conn,
Method method,
Object targetTCCBean,
String xid,
Long branchId,
int status,
Object[] args)
Update TCC Fence status and invoke target method
|
private static final org.slf4j.Logger LOGGER
private static final io.seata.rm.tcc.store.TCCFenceStore TCC_FENCE_DAO
private static DataSource dataSource
private static final int MAX_THREAD_CLEAN
private static final int MAX_QUEUE_SIZE
private static final LinkedBlockingQueue<TCCFenceHandler.FenceLogIdentity> LOG_QUEUE
private static TCCFenceHandler.FenceLogCleanRunnable fenceLogCleanRunnable
private static ExecutorService logCleanExecutor
private TCCFenceHandler()
public static Object prepareFence(String xid, Long branchId, String actionName)
xid - the global transaction idbranchId - the branch transaction idactionName - the action namepublic static boolean commitFence(Method commitMethod, Object targetTCCBean, String xid, Long branchId, Object[] args)
commitMethod - commit methodtargetTCCBean - target tcc beanxid - the global transaction idbranchId - the branch transaction idargs - commit method's parameterspublic static boolean rollbackFence(Method rollbackMethod, Object targetTCCBean, String xid, Long branchId, Object[] args, String actionName)
rollbackMethod - rollback methodtargetTCCBean - target tcc beanxid - the global transaction idbranchId - the branch transaction idargs - rollback method's parametersactionName - the action nameprivate static boolean insertTCCFenceLog(Connection conn, String xid, Long branchId, String actionName, Integer status)
conn - the db connectionxid - the xidbranchId - the branchIdstatus - the statusprivate static boolean updateStatusAndInvokeTargetMethod(Connection conn, Method method, Object targetTCCBean, String xid, Long branchId, int status, Object[] args) throws Exception
method - target methodtargetTCCBean - target beanxid - the global transaction idbranchId - the branch transaction idstatus - the tcc fence statusExceptionprivate static void initLogCleanExecutor()
public static boolean deleteFence(String xid, Long branchId)
xid - the global transaction idbranchId - the branch transaction idprivate static void addToLogCleanQueue(String xid, long branchId)
Copyright © 2024. All rights reserved.