summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/host-webapp/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-09-17 07:38:23 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-09-17 07:38:23 +0000
commita7213aad6ba160039ba1a810c56c8826f36e11aa (patch)
treecdaf8d5fc8f4ac08ba9d62cc94839044a2b70fa8 /sca-java-2.x/trunk/modules/host-webapp/src
parentd067adfb290360c35d7c8618bb9baf87b4c1308e (diff)
TUSCANY-3667 - Reverting usage of generics and just catching the exception to avoid performance implications on regular environments
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@998008 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/host-webapp/src')
-rw-r--r--sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java b/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
index 3a779c9abb..e6f63681a9 100644
--- a/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
+++ b/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java
@@ -20,6 +20,7 @@
package org.apache.tuscany.sca.host.webapp;
import java.lang.reflect.Method;
+import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
@@ -50,8 +51,6 @@ import org.apache.tuscany.sca.node.Node;
public class WebAppServletHost implements ServletHost {
private static final Logger logger = Logger.getLogger(WebAppServletHost.class.getName());
- private static final String INETADDRESS = "java.net.InetAddress";
-
public static final String SCA_NODE_ATTRIBUTE = Node.class.getName();
private Map<String, Servlet> servlets;
@@ -172,10 +171,7 @@ public class WebAppServletHost implements ServletHost {
if (host == null) {
try {
//TUSCANY-3667 - InetAddress is not allowed in GoogleAppEngine
- //host = InetAddress.getLocalHost().getHostName();
- Class<?> clazz = Class.forName(INETADDRESS);
- Object inetAddress = clazz.getMethod("getLocalHost").invoke(null);
- host = (String) clazz.getMethod("getHostName").invoke(inetAddress);
+ host = InetAddress.getLocalHost().getHostName();
} catch (Throwable t) {
logger.log(Level.WARNING, "Error retrieving host information : " + t.getMessage());
host = "localhost";