本文整理匯總了Java中com.alibaba.cobar.manager.dao.xml.CobarDAOImple.setXmlFileLoader方法的典型用法代碼示例。如果您正苦於以下問題:Java CobarDAOImple.setXmlFileLoader方法的具體用法?Java CobarDAOImple.setXmlFileLoader怎麽用?Java CobarDAOImple.setXmlFileLoader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.alibaba.cobar.manager.dao.xml.CobarDAOImple
的用法示例。
在下文中一共展示了CobarDAOImple.setXmlFileLoader方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initCobar
import com.alibaba.cobar.manager.dao.xml.CobarDAOImple; //導入方法依賴的package包/類
private void initCobar() {
String path = this.xmlPath + System.getProperty("file.separator") + "cobar.xml";
init(path, "cobars");
CobarDAOImple cobarDAO = new CobarDAOImple();
cobarDAO.setXmlFileLoader(xmlFileLoader);
try {
cobarDAO.afterPropertiesSet();
} catch (Exception e) {
logger.error(e.getMessage(), e);
Assert.fail();
}
CobarDO cobar = new CobarDO();
cobar.setClusterId(1);
cobar.setHost("10.20.10.100");
cobar.setName("cobar");
cobar.setPassword("");
cobar.setPort(9066);
cobar.setStatus("Active");
cobar.setTime_diff("no");
cobar.setUser("test");
cobarDAO.addCobar(cobar);
}
示例2: initData
import com.alibaba.cobar.manager.dao.xml.CobarDAOImple; //導入方法依賴的package包/類
@Before
public void initData() {
Assert.assertNotNull(xmlPath);
xmlFileLoader = new XMLFileLoaderPath();
xmlFileLoader.setXmlPath(xmlPath);
cobarDao = new CobarDAOImple();
cobarDao.setXmlFileLoader(xmlFileLoader);
cobarXmlPath = xmlPath + System.getProperty("file.separator") + "cobar.xml";
XmlFile xmlFile = new XmlFile(cobarXmlPath, "cobars");
try {
xmlFile.init();
} catch (IOException e) {
logger.error(e.getMessage(), e);
Assert.fail();
}
read();
}
示例3: main
import com.alibaba.cobar.manager.dao.xml.CobarDAOImple; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
String xmlpath = "./src/main/resources/";
CobarAccesser accesser = new CobarAccesser();
XmlAccesser xmlAccesser = new XmlAccesser();
XMLFileLoaderPath xmlFileLoader = new XMLFileLoaderPath();
xmlFileLoader.setXmlPath(xmlpath);
ClusterDAOImple cluster = new ClusterDAOImple();
cluster.setXmlFileLoader(xmlFileLoader);
cluster.afterPropertiesSet();
CobarDAOImple cobar = new CobarDAOImple();
cobar.setXmlFileLoader(xmlFileLoader);
cobar.afterPropertiesSet();
xmlAccesser.setClusterDAO(cluster);
xmlAccesser.setCobarDAO(cobar);
accesser.setXmlAccesser(xmlAccesser);
AdapterDelegate res = new AdapterDelegate();
accesser.setCobarAdapterDelegate(res);
CobarAdapterDAO perf = accesser.getAccesser(1L);
String version = perf.getVersion();
System.out.println(version);
ServerStatus ss = perf.getServerStatus();
System.out.println(ss.getMaxMemory());
System.out.println(ss.getStatus());
System.out.println(ss.getTotalMemory());
System.out.println(ss.getUptime());
System.out.println(ss.getUsedMemory());
System.out.println(ss.getReloadTime());
System.out.println(ss.getRollbackTime());
List<String> databases = perf.listDataBases();
for (String s : databases) {
System.out.println(s);
}
// perf.reloadConfig();
// perf.rollbackConfig();
// int num = perf.switchDataNode("circe,cndb,dubbo,napoli", 0);
// System.out.println("num: " + num);
// int num = perf.stopHeartbeat("circe,cndb,dubbo,napoli", -10);
// System.out.println("num: " + num);
}
示例4: main
import com.alibaba.cobar.manager.dao.xml.CobarDAOImple; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
String xmlpath = "./src/main/resources/";
CobarAccesser accesser = new CobarAccesser();
XmlAccesser xmlAccesser = new XmlAccesser();
XMLFileLoaderPath xmlFileLoader = new XMLFileLoaderPath();
xmlFileLoader.setXmlPath(xmlpath);
ClusterDAOImple cluster = new ClusterDAOImple();
cluster.setXmlFileLoader(xmlFileLoader);
cluster.afterPropertiesSet();
CobarDAOImple cobar = new CobarDAOImple();
cobar.setXmlFileLoader(xmlFileLoader);
cobar.afterPropertiesSet();
xmlAccesser.setClusterDAO(cluster);
xmlAccesser.setCobarDAO(cobar);
accesser.setXmlAccesser(xmlAccesser);
AdapterDelegate res = new AdapterDelegate();
accesser.setCobarAdapterDelegate(res);
CobarAdapterDAO perf = accesser.getAccesser(1L);
String version = perf.getVersion();
System.out.println(version);
ServerStatus ss = perf.getServerStatus();
System.out.println(ss.getMaxMemory());
System.out.println(ss.getStatus());
System.out.println(ss.getTotalMemory());
System.out.println(ss.getUptime());
System.out.println(ss.getUsedMemory());
System.out.println(ss.getReloadTime());
System.out.println(ss.getRollbackTime());
List<String> databases = perf.listDataBases();
for (String s : databases) {
System.out.println(s);
}
// perf.reloadConfig();
// perf.rollbackConfig();
// int num = perf.switchDataNode("circe,cndb,dubbo,napoli", 0);
// System.out.println("num: " + num);
// int num = perf.stopHeartbeat("circe,cndb,dubbo,napoli", -10);
// System.out.println("num: " + num);
}