public class SessionHolder extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
SessionHolder.NoArgsFunc |
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
ASYNC_COMMITTING_SESSION_MANAGER_NAME
The constant ASYNC_COMMITTING_SESSION_MANAGER_NAME.
|
protected static io.seata.config.Configuration |
CONFIG
The constant CONFIG.
|
static String |
DEFAULT_SESSION_STORE_FILE_DIR
The default session store dir
|
static String |
RETRY_COMMITTING_SESSION_MANAGER_NAME
The constant RETRY_COMMITTING_SESSION_MANAGER_NAME.
|
static String |
RETRY_ROLLBACKING_SESSION_MANAGER_NAME
The constant RETRY_ROLLBACKING_SESSION_MANAGER_NAME.
|
static String |
ROOT_SESSION_MANAGER_NAME
The constant ROOT_SESSION_MANAGER_NAME.
|
| 构造器和说明 |
|---|
SessionHolder() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
acquireDistributedLock(String lockKey)
acquire lock
|
static void |
destroy() |
static boolean |
distributedLockAndExecute(String key,
SessionHolder.NoArgsFunc func)
Execute the function after get the distribute lock
|
static GlobalSession |
findGlobalSession(String xid)
Find global session.
|
static GlobalSession |
findGlobalSession(String xid,
boolean withBranchSessions)
Find global session.
|
static SessionManager |
getAsyncCommittingSessionManager()
已过时。
|
static SessionManager |
getRetryCommittingSessionManager()
已过时。
|
static SessionManager |
getRetryRollbackingSessionManager()
已过时。
|
static SessionManager |
getRootSessionManager()
Gets root session manager.
|
static void |
init(String mode)
Init.
|
static <T> T |
lockAndExecute(GlobalSession globalSession,
GlobalSession.LockCallable<T> lockCallable)
lock and execute
|
static boolean |
releaseDistributedLock(String lockKey)
release lock
|
protected static void |
reload(StoreMode storeMode)
Reload.
|
protected static final io.seata.config.Configuration CONFIG
public static final String ROOT_SESSION_MANAGER_NAME
public static final String ASYNC_COMMITTING_SESSION_MANAGER_NAME
public static final String RETRY_COMMITTING_SESSION_MANAGER_NAME
public static final String RETRY_ROLLBACKING_SESSION_MANAGER_NAME
public static void init(String mode)
mode - the store mode: file, db, redisIOException - the io exceptionprotected static void reload(StoreMode storeMode)
storeMode - the mode of storepublic static SessionManager getRootSessionManager()
@Deprecated public static SessionManager getAsyncCommittingSessionManager()
@Deprecated public static SessionManager getRetryCommittingSessionManager()
@Deprecated public static SessionManager getRetryRollbackingSessionManager()
public static GlobalSession findGlobalSession(String xid)
xid - the xidpublic static GlobalSession findGlobalSession(String xid, boolean withBranchSessions)
xid - the xidwithBranchSessions - the withBranchSessionspublic static <T> T lockAndExecute(GlobalSession globalSession, GlobalSession.LockCallable<T> lockCallable) throws TransactionException
globalSession - the global sessionlockCallable - the lock CallableTransactionExceptionpublic static boolean acquireDistributedLock(String lockKey)
lockKey - the lock key, should be distinct for each lockpublic static boolean releaseDistributedLock(String lockKey)
public static boolean distributedLockAndExecute(String key, SessionHolder.NoArgsFunc func)
key - the distribute lock keyfunc - the function to be callpublic static void destroy()
Copyright © 2022 Seata. All rights reserved.