From: Dave H. <hel...@us...> - 2014-05-16 23:22:13
|
Update of /cvsroot/sblim/jsr48-client/smpl/org/sblim/cimclient/samples In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8070/smpl/org/sblim/cimclient/samples Modified Files: Tag: Experimental Jsr48IndicationTester.java Log Message: 2735 Add configurable --wait time option Index: Jsr48IndicationTester.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/smpl/org/sblim/cimclient/samples/Jsr48IndicationTester.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -d -r1.1.2.4 -r1.1.2.5 --- Jsr48IndicationTester.java 16 May 2014 22:08:08 -0000 1.1.2.4 +++ Jsr48IndicationTester.java 16 May 2014 23:22:10 -0000 1.1.2.5 @@ -15,6 +15,7 @@ * ------------------------------------------------------------------------------- * 3529066 2012-07-06 hellerda Add Jsr48IndicationTester (initial version) * 2734 2014-05-16 hellerda Support file:// URL in destination handler + * 2735 2014-05-16 hellerda Add configurable --wait time option */ package org.sblim.cimclient.samples; @@ -382,10 +383,10 @@ */ private static void printHelp() { System.out.println("\nOptions:"); - System.out.println(" -h, Show this help message and exit."); - System.out.println(" -p, Print received indications to stdout."); - System.out.println(" -v, Print additional debug info."); - System.out.println(" -t, Trigger mode: send a request to the CIMOM"); + System.out.println(" -h Show this help message and exit."); + System.out.println(" -p Print received indications to stdout."); + System.out.println(" -v Print additional debug info."); + System.out.println(" -t Trigger mode: send a request to the CIMOM"); System.out.println(" to trigger an indication and exit."); System.out.println(" --cimomUrl CIMOMURL URL of CIMOM to connect to (host:port)"); System.out.println(" (default: http://localhost:5988)"); @@ -397,6 +398,9 @@ .println(" --indNS INDICATIONNS Namespace in which the register the indication"); System.out .println(" (default is the same value as the interop namespace)"); + System.out.println(" --wait WAIT Time to wait before shutting down and deleting the"); + System.out.println(" subscription. A value of 0 means wait indefinitely"); + System.out.println(" (register mode only. default: 0s)"); } /** @@ -597,6 +601,12 @@ } } + int wait = doubleDashOpts.containsKey("--wait") ? Integer.parseInt(doubleDashOpts + .get("--wait")) : 0; + + if (wait == 0) wait = Integer.MAX_VALUE; + else wait *= 1000; + try { // make the subscription. Since this is the first WBEM operation // called, the client will connect to the CIMOM now. If we've @@ -609,7 +619,7 @@ System.err.println("Subscription failed."); return; } - Thread.sleep(300 * 1000); + Thread.sleep(wait); } finally { // should never get here as we have ShutdownHook to catch exit |