use of cn.mycat.vertx.xa.impl.LocalXaMemoryRepositoryImpl in project Mycat2 by MyCATApache.
the class MycatRouterConfigOps method getXaLog.
@NotNull
private Resource<XaLog> getXaLog(ServerConfig serverConfig, Resource<MySQLManager> mycatMySQLManagerResource) {
if (MetaClusterCurrent.exist(XaLog.class) && mycatMySQLManagerResource.isBorrow()) {
return Resource.of(MetaClusterCurrent.wrapper(XaLog.class), true);
}
MySQLManager mycatMySQLManager = mycatMySQLManagerResource.get();
LocalXaMemoryRepositoryImpl localXaMemoryRepository = LocalXaMemoryRepositoryImpl.createLocalXaMemoryRepository(() -> mycatMySQLManager);
XaLog xaLog = new XaLogImpl(localXaMemoryRepository, serverConfig.getMycatId(), Objects.requireNonNull(mycatMySQLManager));
return Resource.of(xaLog, false);
}
Aggregations