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

svn commit: r1744557 - /uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/helper/DatabaseHelper.java

Author: degenaro
Date: Thu May 19 12:15:45 2016
New Revision: 1744557

URL: http://svn.apache.org/viewvc?rev=1744557&view=rev
Log:
UIMA-4923 DUCC Web Server (WS) should not display nodes that have been removed from service on Machines page

In non-DB case, WS DatabaseHelper should not throw exception during initialization since it can determine that DB is not configured for use

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/helper/DatabaseHelper.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/helper/DatabaseHelper.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/helper/DatabaseHelper.java?rev=1744557&r1=1744556&r2=1744557&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/helper/DatabaseHelper.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/helper/DatabaseHelper.java Thu May 19 12:15:45 2016
@@ -55,26 +55,28 @@ public class DatabaseHelper extends JmxH
 					enabled = true;
 				}
 			}
-			String jmxHost = dpr.getProperty(DuccPropertiesResolver.ducc_database_jmx_host);
-			if(jmxHost != null) {
-				try {
-					setJmxHost(jmxHost);
+			if(enabled) {
+				String jmxHost = dpr.getProperty(DuccPropertiesResolver.ducc_database_jmx_host);
+				if(jmxHost != null) {
+					try {
+						setJmxHost(jmxHost);
+					}
+					catch(Exception e) {
+						logger.error(location, jobid, e);
+					}
 				}
-				catch(Exception e) {
-					logger.error(location, jobid, e);
+				setJmxPort(7199);  // default
+				String jmxPort = dpr.getProperty(DuccPropertiesResolver.ducc_database_jmx_port);
+				if(jmxPort != null) {
+					try {
+						setJmxPort(Integer.parseInt(jmxPort));
+					}
+					catch(Exception e) {
+						logger.error(location, jobid, e);
+					}
 				}
+				jmxConnect();
 			}
-			setJmxPort(7199);  // default
-			String jmxPort = dpr.getProperty(DuccPropertiesResolver.ducc_database_jmx_port);
-			if(jmxPort != null) {
-				try {
-					setJmxPort(Integer.parseInt(jmxPort));
-				}
-				catch(Exception e) {
-					logger.error(location, jobid, e);
-				}
-			}
-			jmxConnect();
 		}
 		catch(Exception e) {
 			logger.error(location, jobid, e);