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 22:04:44 UTC

svn commit: r1743764 - /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 22:04:44 2016
New Revision: 1743764

URL: http://svn.apache.org/viewvc?rev=1743764&view=rev
Log:
UIMA-4931 fixed typecast problem

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=1743764&r1=1743763&r2=1743764&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 22:04:44 2016
@@ -685,44 +685,6 @@ public class DuccCommandExecutor extends
 								break;
 							}
 						}
-
-						
-						
-/*						
-						List<String> options = Collections.synchronizedList(((JavaCommandLine) cmdLine)
-								.getOptions());
-
-						synchronized(options) {
-							Iterator<String> it = options.iterator();
-							while( it.hasNext() ) {
-								String option = it.next();
-								// 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;
-								}
-
-							}
-						}
-*/
-/*						
-						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;
-							}
-	
-						}
-*/						
 					}
 					break;
 				case Service:
@@ -743,37 +705,6 @@ public class DuccCommandExecutor extends
 						}
 					}
 					
-					
-					
-/*					
-					List<String> options = Collections.synchronizedList(((JavaCommandLine) cmdLine)
-							.getOptions());
-					boolean isDucc20JpProcess = false;
-					boolean isDucc20ServiceProcess = false;
-					synchronized(options) {
-						Iterator<String> it = options.iterator();
-						while( it.hasNext() ) {
-							String option = it.next();
-							if (option.indexOf(FlagsHelper.Name.JpType.pname()) > -1) {
-								isDucc20JpProcess = true;
-							}
-							if (option.indexOf("ducc.deploy.components=service") > -1) {
-								isDucc20ServiceProcess = true;
-							}
-						}
-					}
-*/					
-					// determine if we are launching Ducc2.0 or Ducc1.+ JP
-/*
-					for (String option : options) {
-						if (option.indexOf(FlagsHelper.Name.JpType.pname()) > -1) {
-							isDucc20JpProcess = true;
-						}
-						if (option.indexOf("ducc.deploy.components=service") > -1) {
-							isDucc20ServiceProcess = true;
-						}
-					}
-*/					
 					// Add main class and component type to the command line
 					if (isDucc20JpProcess) {
 						if (!isDucc20ServiceProcess) {
@@ -795,11 +726,6 @@ public class DuccCommandExecutor extends
 					}
 					break;
 				}
-				// if (
-				// ((ManagedProcess)super.managedProcess).getDuccProcess().getProcessType().equals(ProcessType.Pop))
-				// {
-				// processType = "-JD-";
-				// }
 				String processLogDir = ((ManagedProcess) super.managedProcess)
 						.getProcessInfo().getLogDirectory()
 						+ (((ManagedProcess) super.managedProcess)
@@ -830,44 +756,38 @@ public class DuccCommandExecutor extends
 							+ File.separator + "bin" + File.separator + "java";
 				}
 
-				//List<String> operationalProperties = new ArrayList<String>();
-				List<String> options = Collections.synchronizedList(((JavaCommandLine) cmdLine)
-						.getOptions());
-				
 				if (cmdLine instanceof JavaCommandLine) {
+					List<String> options = Collections.synchronizedList(((JavaCommandLine) cmdLine)
+							.getOptions());
 					JavaCommandLine jcl = ((JavaCommandLine) cmdLine);
 					String duccHomePath = Utils.findDuccHome();
 					synchronized(options) {
 						jcl.addOption("-DDUCC_HOME=" + duccHomePath);
 						jcl.addOption("-Dducc.deploy.configuration="
 								+ System.getProperty("ducc.deploy.configuration"));
-					}
-					if (System
-							.getProperties()
-							.containsKey(
-									"ducc.agent.managed.process.state.update.endpoint.type")) {
-						String type = System
-								.getProperty("ducc.agent.managed.process.state.update.endpoint.type");
-						if (type != null && type.equalsIgnoreCase("socket")) {
-							synchronized(options) {
-								jcl.addOption("-D"
-											+ NodeAgent.ProcessStateUpdatePort
-											+ "="
-											+ System.getProperty(NodeAgent.ProcessStateUpdatePort));
+						if (System
+								.getProperties()
+								.containsKey(
+										"ducc.agent.managed.process.state.update.endpoint.type")) {
+							String type = System
+									.getProperty("ducc.agent.managed.process.state.update.endpoint.type");
+							if (type != null && type.equalsIgnoreCase("socket")) {
+									jcl.addOption("-D"
+												+ NodeAgent.ProcessStateUpdatePort
+												+ "="
+												+ System.getProperty(NodeAgent.ProcessStateUpdatePort));
 							}
 						}
-					}
-					// NOTE - These are redundant since the information is also
-					// in the environment for both Java and non-Java processes
-					synchronized(options) {
+						// NOTE - These are redundant since the information is also
+						// in the environment for both Java and non-Java processes
 						jcl.addOption("-Dducc.process.log.dir="
-								+ processLogDir);
+									+ processLogDir);
 						jcl.addOption("-Dducc.process.log.basename="
-								+ processLogFile); // ((ManagedProcess)super.managedProcess).getWorkDuccId()+
-													// processType+host);
+									+ processLogFile); // ((ManagedProcess)super.managedProcess).getWorkDuccId()+
+														// processType+host);
 						jcl.addOption("-Dducc.job.id="
-								+ ((ManagedProcess) super.managedProcess)
-										.getWorkDuccId());
+									+ ((ManagedProcess) super.managedProcess)
+											.getWorkDuccId());
 					}
 				}