You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2013/04/04 20:00:15 UTC

svn commit: r1464661 - /uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_statedump

Author: challngr
Date: Thu Apr  4 18:00:15 2013
New Revision: 1464661

URL: http://svn.apache.org/r1464661
Log:
UIMA-2799
Update ducc_statedump for cleaned up Java state listener.

Modified:
    uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_statedump

Modified: uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_statedump
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_statedump?rev=1464661&r1=1464660&r2=1464661&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_statedump (original)
+++ uima/sandbox/uima-ducc/trunk/src/main/admin/ducc_statedump Thu Apr  4 18:00:15 2013
@@ -31,14 +31,20 @@ from ducc      import Ducc
 class DuccStateListener(DuccUtil):
 
     def run(self):
-        CMD = self.java() + ' com.ibm.ducc.test.tools.DuccListener ' + self.host + ' ' + self.port + ' ' + self.topic + \
-              ' ' + self.agent + \
-              ' ' + self.output + \
-              ' ' + self.timeout
-        #print CMD
+        CMD = self.java() + ' org.apache.uima.ducc.tools.DuccPubListener'
+        CMD = CMD + ' -host '  + self.host
+        CMD = CMD + ' -port '  + self.port
+        CMD = CMD + ' -topic ' + self.topic
+        if ( self.output != None ):
+            CMD = CMD + ' -output ' + self.output
+        if ( self.timeout != None ):
+            CMD = CMD + ' -timeout ' + self.timeout
+        CMD = CMD + ' -agent ' + self.agent
+
         os.system(CMD)
 
-    def usage(self):
+    def usage(self, msg):
+        print msg
         print "Usage:"
         print "   start_sim [options]"
         print "   If no options are given this help screen is shown."
@@ -66,15 +72,15 @@ class DuccStateListener(DuccUtil):
 
         self.host = 'localhost'
         self.port = '61616'
-        self.output = 'none'
-        self.timeout = 'none'
+        self.output = None
+        self.timeout = None
         self.state = 'or'
-        self.agent = "none"
+        self.agent = None
 
         try:
             opts, args = getopt.getopt(argv, 'n:o:p:s:t:?h')
         except:
-            self.invalid('Invalid arguments', ' '.join(argv))
+            self.usage('Invalid arguments ' + ' '.join(argv))
                        
         for ( o, a ) in opts:
             if o in ( '-n' ): 
@@ -112,7 +118,7 @@ class DuccStateListener(DuccUtil):
             self.topic = 'ducc.node.inventory'
             self.agent = toks[1]
         elif (self.state.startswith('metrics') ):
-            toks = self.self.state.split('@')
+            toks = self.state.split('@')
             print 'toks', toks
             if ( len(toks) != 2 ):
                 print "Invalid state, must be 'metrics@node'"
@@ -134,4 +140,8 @@ class DuccStateListener(DuccUtil):
 
 if __name__ == "__main__":
     dsl = DuccStateListener()
+    CLASSPATH = os.environ['CLASSPATH'] + ':' + os.environ['DUCC_HOME'] + '/examples/lib/uima-ducc-examples.jar'
+    for c in CLASSPATH.split(':'):
+        print c
+    os.environ['CLASSPATH'] = CLASSPATH
     dsl.main(sys.argv[1:])