You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2016/05/13 19:36:22 UTC

svn commit: r1743733 - /uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/launcher/DuccCommandExecutor.java

Author: cwiklik
Date: Fri May 13 19:36:22 2016
New Revision: 1743733

URL: http://svn.apache.org/viewvc?rev=1743733&view=rev
Log:
UIMA-4931 fix ConcurrentModificationExcetpion and ClassCastException due to wrong typecasting for APs 

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/launcher/DuccCommandExecutor.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/launcher/DuccCommandExecutor.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/launcher/DuccCommandExecutor.java?rev=1743733&r1=1743732&r2=1743733&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/launcher/DuccCommandExecutor.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-agent/src/main/java/org/apache/uima/ducc/agent/launcher/DuccCommandExecutor.java Fri May 13 19:36:22 2016
@@ -21,6 +21,7 @@ package org.apache.uima.ducc.agent.launc
 import java.io.File;
 import java.io.PrintWriter;
 import java.io.StringWriter;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -671,6 +672,23 @@ public class DuccCommandExecutor extends
 					// is an arbitrary process
 					processType = "-POP-";
 					if (cmdLine instanceof JavaCommandLine) {
+						int size = ((JavaCommandLine) cmdLine).getOptions().size();
+						String[] options = ((JavaCommandLine) cmdLine).getOptions().toArray(new String[size]);
+						for( String option : options ) {
+							// Both services and JD have processType=POP.
+							// However, only the JD
+							// will have -Dducc.deploy.components option set.
+							if (option.startsWith("-Dducc.deploy.components=")) {
+								processType = "-JD-";
+								((ManagedProcess) super.managedProcess)
+										.setIsJD(); // mark this process as JD
+								break;
+							}
+						}
+
+						
+						
+/*						
 						List<String> options = Collections.synchronizedList(((JavaCommandLine) cmdLine)
 								.getOptions());
 
@@ -690,6 +708,7 @@ public class DuccCommandExecutor extends
 
 							}
 						}
+*/
 /*						
 						for (String option : options) {
 							// Both services and JD have processType=POP.
@@ -711,6 +730,22 @@ public class DuccCommandExecutor extends
 					break;
 				case Job_Uima_AS_Process:
 					processType = "-UIMA-";
+					int size = ((JavaCommandLine) cmdLine).getOptions().size();
+					String[] options = ((JavaCommandLine) cmdLine).getOptions().toArray(new String[size]);
+					boolean isDucc20JpProcess = false;
+					boolean isDucc20ServiceProcess = false;
+					for( String option : options ) {
+						if (option.indexOf(FlagsHelper.Name.JpType.pname()) > -1) {
+							isDucc20JpProcess = true;
+						}
+						if (option.indexOf("ducc.deploy.components=service") > -1) {
+							isDucc20ServiceProcess = true;
+						}
+					}
+					
+					
+					
+/*					
 					List<String> options = Collections.synchronizedList(((JavaCommandLine) cmdLine)
 							.getOptions());
 					boolean isDucc20JpProcess = false;
@@ -727,6 +762,7 @@ public class DuccCommandExecutor extends
 							}
 						}
 					}
+*/					
 					// determine if we are launching Ducc2.0 or Ducc1.+ JP
 /*
 					for (String option : options) {
@@ -793,6 +829,7 @@ public class DuccCommandExecutor extends
 					executable = System.getProperty("java.home")
 							+ File.separator + "bin" + File.separator + "java";
 				}
+
 				//List<String> operationalProperties = new ArrayList<String>();
 				List<String> options = Collections.synchronizedList(((JavaCommandLine) cmdLine)
 						.getOptions());