use of io.seata.rm.datasource.xa.ResourceManagerXA in project seata by seata.
the class XAModeTest2 method initRM.
private void initRM() throws Throwable {
// init RM
DefaultResourceManager.get();
// mock the RM of XA
DefaultResourceManager.mockResourceManager(BranchType.XA, new ResourceManagerXA() {
@Override
public void registerResource(Resource resource) {
dataSourceCache.put(resource.getResourceId(), resource);
}
@Override
public Long branchRegister(BranchType branchType, String resourceId, String clientId, String xid, String applicationData, String lockKeys) throws TransactionException {
return mockBranchId;
}
@Override
public void branchReport(BranchType branchType, String xid, long branchId, BranchStatus status, String applicationData) throws TransactionException {
}
});
}
Aggregations