public class DataSourceManager extends AbstractResourceManager implements Initialize
| 构造器和说明 |
|---|
DataSourceManager()
Instantiates a new Data source manager.
|
| 限定符和类型 | 方法和说明 |
|---|---|
BranchStatus |
branchCommit(BranchType branchType,
String xid,
long branchId,
String resourceId,
String applicationData)
Commit a branch transaction.
|
BranchStatus |
branchRollback(BranchType branchType,
String xid,
long branchId,
String resourceId,
String applicationData)
Rollback a branch transaction.
|
DataSourceProxy |
get(String resourceId)
Get data source proxy.
|
BranchType |
getBranchType()
Get the BranchType.
|
Map<String,Resource> |
getManagedResources()
Get all resources managed by this manager.
|
void |
init()
init method
|
void |
initAsyncWorker(ResourceManagerInbound asyncWorker)
Init.
|
boolean |
lockQuery(BranchType branchType,
String resourceId,
String xid,
String lockKeys)
Lock query boolean.
|
void |
registerResource(Resource resource)
Register a Resource to be managed by Resource Manager.
|
void |
setAsyncWorker(ResourceManagerInbound asyncWorker)
Sets async worker.
|
void |
unregisterResource(Resource resource)
Unregister a Resource from the Resource Manager.
|
branchRegister, branchReportpublic void setAsyncWorker(ResourceManagerInbound asyncWorker)
asyncWorker - the async workerpublic boolean lockQuery(BranchType branchType, String resourceId, String xid, String lockKeys) throws TransactionException
ResourceManagerOutboundlockQuery 在接口中 ResourceManagerOutboundlockQuery 在类中 AbstractResourceManagerbranchType - the branch typeresourceId - the resource idxid - the xidlockKeys - the lock keysTransactionException - the transaction exceptionpublic void initAsyncWorker(ResourceManagerInbound asyncWorker)
asyncWorker - the async workerpublic void init()
Initializeinit 在接口中 Initializepublic void registerResource(Resource resource)
ResourceManagerregisterResource 在接口中 ResourceManagerregisterResource 在类中 AbstractResourceManagerresource - The resource to be managed.public void unregisterResource(Resource resource)
ResourceManagerunregisterResource 在接口中 ResourceManagerunregisterResource 在类中 AbstractResourceManagerresource - The resource to be removed.public DataSourceProxy get(String resourceId)
resourceId - the resource idpublic 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 Map<String,Resource> getManagedResources()
ResourceManagergetManagedResources 在接口中 ResourceManagerpublic BranchType getBranchType()
ResourceManagergetBranchType 在接口中 ResourceManagerCopyright © 2020 Seata. All rights reserved.