public class DefaultResourceManager extends Object implements ResourceManager
| 限定符和类型 | 字段和说明 |
|---|---|
protected static Map<BranchType,ResourceManager> |
resourceManagers
all resource managers
|
| 限定符和类型 | 方法和说明 |
|---|---|
BranchStatus |
branchCommit(BranchType branchType,
String xid,
long branchId,
String resourceId,
String applicationData) |
Long |
branchRegister(BranchType branchType,
String resourceId,
String clientId,
String xid,
String applicationData,
String lockKeys) |
void |
branchReport(BranchType branchType,
String xid,
long branchId,
BranchStatus status,
String applicationData) |
BranchStatus |
branchRollback(BranchType branchType,
String xid,
long branchId,
String resourceId,
String applicationData) |
static DefaultResourceManager |
get()
Get resource manager.
|
BranchType |
getBranchType() |
Map<String,Resource> |
getManagedResources() |
ResourceManager |
getResourceManager(BranchType branchType)
get ResourceManager by Resource Type
|
protected void |
initResourceManagers() |
boolean |
lockQuery(BranchType branchType,
String resourceId,
String xid,
String lockKeys) |
static void |
mockResourceManager(BranchType branchType,
ResourceManager rm)
only for mock
|
void |
registerResource(Resource resource) |
void |
unregisterResource(Resource resource) |
protected static Map<BranchType,ResourceManager> resourceManagers
public static DefaultResourceManager get()
public static void mockResourceManager(BranchType branchType, ResourceManager rm)
branchType - rm - protected void initResourceManagers()
public BranchStatus branchCommit(BranchType branchType, String xid, long branchId, String resourceId, String applicationData) throws TransactionException
branchCommit 在接口中 ResourceManagerInboundTransactionExceptionpublic BranchStatus branchRollback(BranchType branchType, String xid, long branchId, String resourceId, String applicationData) throws TransactionException
branchRollback 在接口中 ResourceManagerInboundTransactionExceptionpublic Long branchRegister(BranchType branchType, String resourceId, String clientId, String xid, String applicationData, String lockKeys) throws TransactionException
branchRegister 在接口中 ResourceManagerOutboundTransactionExceptionpublic void branchReport(BranchType branchType, String xid, long branchId, BranchStatus status, String applicationData) throws TransactionException
branchReport 在接口中 ResourceManagerOutboundTransactionExceptionpublic boolean lockQuery(BranchType branchType, String resourceId, String xid, String lockKeys) throws TransactionException
lockQuery 在接口中 ResourceManagerOutboundTransactionExceptionpublic void registerResource(Resource resource)
registerResource 在接口中 ResourceManagerpublic void unregisterResource(Resource resource)
unregisterResource 在接口中 ResourceManagerpublic Map<String,Resource> getManagedResources()
getManagedResources 在接口中 ResourceManagerpublic ResourceManager getResourceManager(BranchType branchType)
branchType - public BranchType getBranchType()
getBranchType 在接口中 ResourceManagerCopyright © 2019 Seata. All rights reserved.