airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1485808 - in /airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils: ServerSettings.java ServiceUtils.java
Date Thu, 23 May 2013 18:25:24 GMT
Author: lahiru
Date: Thu May 23 18:25:24 2013
New Revision: 1485808

URL: http://svn.apache.org/r1485808
Log:
fixing getTomcatPort method to get https, http ports accordingly.

Modified:
    airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
    airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java

Modified: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java?rev=1485808&r1=1485807&r2=1485808&view=diff
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
(original)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServerSettings.java
Thu May 23 18:25:24 2013
@@ -118,7 +118,7 @@ public class ServerSettings extends Appl
         }
     }
 
-    public static String getTomcatPort() throws ApplicationSettingsException {
+    public static String getTomcatPort(String protocol) throws ApplicationSettingsException
{
     	if (tomcatPort==null) {
 			try {
 				//First try to get the port from a tomcat if it is already running
@@ -143,6 +143,7 @@ public class ServerSettings extends Appl
 						for (Service service : findServices) {
 							for (Connector connector : service.findConnectors()) {
 								ProtocolHandler protocolHandler = connector.getProtocolHandler();
+                                if(protocol != null && protocol.equals(connector.getScheme())){
 								if (protocolHandler instanceof Http11Protocol
 										|| protocolHandler instanceof Http11AprProtocol
 										|| protocolHandler instanceof Http11NioProtocol) {
@@ -153,6 +154,7 @@ public class ServerSettings extends Appl
 										tomcatPort = String.valueOf(connector
 												.getPort());
 									}
+                                }
 								}
 							}
 						}

Modified: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java?rev=1485808&r1=1485807&r2=1485808&view=diff
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
(original)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
Thu May 23 18:25:24 2013
@@ -58,16 +58,16 @@ public class ServiceUtils {
 	            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
 	        }
         }
-        
-        try {
-            port = ServerSettings.getSetting(PORT);
-        } catch (ApplicationSettingsException e) {
-			//we will ignore this exception since the properties file will not contain the values
-			//when it is ok to retrieve them from the axis2 context
-		}
         String protocol="http";
         if(ServerSettings.isEnableHttps()){
-        	protocol="https";
+            protocol="https";
+        }
+
+        try {
+            port = ServerSettings.getTomcatPort(protocol);
+        } catch (ApplicationSettingsException e) {
+            //we will ignore this exception since the properties file will not contain the
values
+            //when it is ok to retrieve them from the axis2 context
         }
         if (port == null) {
             TransportInDescription transportInDescription = context



Mime
View raw message