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)
Commit a branch transaction.
|
Long |
branchRegister(BranchType branchType,
String resourceId,
String clientId,
String xid,
String applicationData,
String lockKeys)
Branch register long.
|
void |
branchReport(BranchType branchType,
String xid,
long branchId,
BranchStatus status,
String applicationData)
Branch report.
|
BranchStatus |
branchRollback(BranchType branchType,
String xid,
long branchId,
String resourceId,
String applicationData)
Rollback a branch transaction.
|
static DefaultResourceManager |
get()
Get resource manager.
|
BranchType |
getBranchType()
Get the BranchType.
|
Map<String,Resource> |
getManagedResources()
Get all resources managed by this manager.
|
ResourceManager |
getResourceManager(BranchType branchType)
get ResourceManager by Resource Type
|
protected void |
initResourceManagers() |
boolean |
lockQuery(BranchType branchType,
String resourceId,
String xid,
String lockKeys)
Lock query boolean.
|
static void |
mockResourceManager(BranchType branchType,
ResourceManager rm)
only for mock
|
void |
registerResource(Resource resource)
Register a Resource to be managed by Resource Manager.
|
void |
unregisterResource(Resource resource)
Unregister a Resource from the Resource Manager.
|
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
ResourceManagerInboundbranchCommit 在接口中 ResourceManagerInboundbranchType - the branch typexid - Transaction id.branchId - Branch id.resourceId - Resource id.applicationData - Application data bind with this branch.TransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public BranchStatus branchRollback(BranchType branchType, String xid, long branchId, String resourceId, String applicationData) throws TransactionException
ResourceManagerInboundbranchRollback 在接口中 ResourceManagerInboundbranchType - the branch typexid - Transaction id.branchId - Branch id.resourceId - Resource id.applicationData - Application data bind with this branch.TransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public Long branchRegister(BranchType branchType, String resourceId, String clientId, String xid, String applicationData, String lockKeys) throws TransactionException
ResourceManagerOutboundbranchRegister 在接口中 ResourceManagerOutboundbranchType - the branch typeresourceId - the resource idclientId - the client idxid - the xidapplicationData - the contextlockKeys - the lock keysTransactionException - the transaction exceptionpublic void branchReport(BranchType branchType, String xid, long branchId, BranchStatus status, String applicationData) throws TransactionException
ResourceManagerOutboundbranchReport 在接口中 ResourceManagerOutboundbranchType - the branch typexid - the xidbranchId - the branch idstatus - the statusapplicationData - the application dataTransactionException - the transaction exceptionpublic boolean lockQuery(BranchType branchType, String resourceId, String xid, String lockKeys) throws TransactionException
ResourceManagerOutboundlockQuery 在接口中 ResourceManagerOutboundbranchType - the branch typeresourceId - the resource idxid - the xidlockKeys - the lock keysTransactionException - the transaction exceptionpublic void registerResource(Resource resource)
ResourceManagerregisterResource 在接口中 ResourceManagerresource - The resource to be managed.public void unregisterResource(Resource resource)
ResourceManagerunregisterResource 在接口中 ResourceManagerresource - The resource to be removed.public Map<String,Resource> getManagedResources()
ResourceManagergetManagedResources 在接口中 ResourceManagerpublic ResourceManager getResourceManager(BranchType branchType)
branchType - public BranchType getBranchType()
ResourceManagergetBranchType 在接口中 ResourceManagerCopyright © 2020 Seata. All rights reserved.