Author: fhanik Date: Wed Jun 14 19:03:20 2006 New Revision: 414438 URL: http://svn.apache.org/viewvc?rev=414438&view=rev Log: Fixed startup
Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/CoordinationDemo.java Modified: tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/CoordinationDemo.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/CoordinationDemo.java?rev=414438&r1=414437&r2=414438&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/CoordinationDemo.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/test/java/org/apache/catalina/tribes/demos/CoordinationDemo.java Wed Jun 14 19:03:20 2006 @@ -31,6 +31,9 @@ * Construct and show the application. */ public CoordinationDemo() { + } + + public void init() { reader = new BufferedReader(new InputStreamReader(System.in)); status = new Status[CHANNEL_COUNT]; } @@ -176,17 +179,10 @@ } } - public static void main(String[] args) throws Exception { - System.out.println("Usage:"); - System.out.println("\tjava org.apache.catalina.tribes.demos.CoordinationDemo -c channel-count(int) -t multi-thread(true|false) -s sleep-time(ms) -sc clear-screen(int) -p view_events_csv(1,2,5,7)"); - System.out.println("Example:"); - System.out.println("\tjava o.a.c.t.d.CoordinationDemo -> starts demo single threaded start/stop with 5 channels"); - System.out.println("\tjava o.a.c.t.d.CoordinationDemo -c 10 -> starts demo single threaded start/stop with 10 channels"); - System.out.println("\tjava o.a.c.t.d.CoordinationDemo -c 7 -t true -s 1000 -sc 50-> starts demo multi threaded start/stop with 7 channels and 1 second sleep time between events and 50 lines to clear screen"); - System.out.println("\tjava o.a.c.t.d.CoordinationDemo -t true -p 12 -> starts demo multi threaded start/stop with 5 channels and only prints the EVT_CONF_RX event"); - System.out.println(); + public static void run(String[] args,CoordinationDemo demo) throws Exception { + usage(); java.util.Arrays.fill(VIEW_EVENTS,true); - + for (int i=0; i<args.length; i++ ) { if ( "-c".equals(args[i]) ) CHANNEL_COUNT = Integer.parseInt(args[++i]); @@ -200,8 +196,23 @@ setEvents(args[++i]); else if ( "-h".equals(args[i]) ) System.exit(0); } - CoordinationDemo demo = new CoordinationDemo(); + demo.init(); demo.waitForInput(); + } + + private static void usage() { + System.out.println("Usage:"); + System.out.println("\tjava org.apache.catalina.tribes.demos.CoordinationDemo -c channel-count(int) -t multi-thread(true|false) -s sleep-time(ms) -sc clear-screen(int) -p view_events_csv(1,2,5,7)"); + System.out.println("Example:"); + System.out.println("\tjava o.a.c.t.d.CoordinationDemo -> starts demo single threaded start/stop with 5 channels"); + System.out.println("\tjava o.a.c.t.d.CoordinationDemo -c 10 -> starts demo single threaded start/stop with 10 channels"); + System.out.println("\tjava o.a.c.t.d.CoordinationDemo -c 7 -t true -s 1000 -sc 50-> starts demo multi threaded start/stop with 7 channels and 1 second sleep time between events and 50 lines to clear screen"); + System.out.println("\tjava o.a.c.t.d.CoordinationDemo -t true -p 12 -> starts demo multi threaded start/stop with 5 channels and only prints the EVT_CONF_RX event"); + System.out.println(); + } + public static void main(String[] args) throws Exception { + CoordinationDemo demo = new CoordinationDemo(); + run(args,demo); } public static String leftfill(String value, int length, String ch) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]