diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-10-02 18:48:03 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2010-10-02 18:48:03 +0000 |
commit | 2498d401eaedee5570c20eff797dee8415eccdf4 (patch) | |
tree | 71092dcc2670df9ff664f444b266380daf31c067 /sca-java-2.x/branches/sca-java-2.0-M5/modules | |
parent | dad485a76cb42460e3c1416d1004e937745d9a34 (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@1003858 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/branches/sca-java-2.0-M5/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java index caf7fc7942..3f14438c1f 100644 --- a/sca-java-2.x/branches/sca-java-2.0-M5/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppServletHost.java +++ b/sca-java-2.x/branches/sca-java-2.0-M5/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; @@ -171,10 +170,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"; |