1 8 9 package org.jboss.test.cache.perf.basic; 10 11 12 import org.jboss.cache.PropertyConfigurator; 13 import org.jboss.cache.TreeCache; 14 15 import java.io.InputStreamReader ; 16 17 20 public class Server 21 { 22 TreeCache cache_; 23 24 void initCach() throws Exception 25 { 26 cache_ = new TreeCache(); 27 PropertyConfigurator config = new PropertyConfigurator(); 28 config.configure(cache_, "META-INF/replSync-service.xml"); cache_.setTransactionManagerLookupClass("org.jboss.cache.DummyTransactionManagerLookup"); 30 cache_.startService(); 31 } 32 33 void destroyCache() throws Exception 34 { 35 cache_.stopService(); 36 cache_ = null; 37 } 38 39 TreeCache getCache() 40 { 41 return cache_; 42 } 43 44 public static void main(String [] args) throws Exception 45 { 46 Server server = new Server(); 47 server.initCach(); 48 boolean isYes = true; 49 InputStreamReader reader = new InputStreamReader (System.in); 50 while (isYes) { 51 System.out.println("To abort hit cntrl-c"); 52 try { 54 Thread.sleep(10000); 55 } catch (Exception ex) { 56 } 57 ; 58 } 59 server.destroyCache(); 60 } 61 } 62 | Popular Tags |