[Mulgara-svn] r1776 - trunk/src/jar/server-rmi/java/org/mulgara/server/rmi

pag at mulgara.org pag at mulgara.org
Thu Aug 13 23:27:32 UTC 2009


Author: pag
Date: 2009-08-13 16:27:31 -0700 (Thu, 13 Aug 2009)
New Revision: 1776

Modified:
   trunk/src/jar/server-rmi/java/org/mulgara/server/rmi/RmiServer.java
Log:
Building the serverURI from a string as this is more forgiving for some hostnames, such as one PLoS test system that has a number for the TLD

Modified: trunk/src/jar/server-rmi/java/org/mulgara/server/rmi/RmiServer.java
===================================================================
--- trunk/src/jar/server-rmi/java/org/mulgara/server/rmi/RmiServer.java	2009-08-13 18:33:16 UTC (rev 1775)
+++ trunk/src/jar/server-rmi/java/org/mulgara/server/rmi/RmiServer.java	2009-08-13 23:27:31 UTC (rev 1776)
@@ -216,8 +216,12 @@
     // Generate new server URI
     try {
       String path = "/" + (name == null ? "" : name);
-      int portValue = getPortNumber() == DEFAULT_PORT ? -1 : getPortNumber();
-      newURI = new URI("rmi", null, hostname, portValue, path, null, null);
+      int portNr = getPortNumber();
+      if (portNr == DEFAULT_PORT || portNr == -1) {
+        newURI = new URI("rmi://" + hostname + path);
+      } else {
+        newURI = new URI("rmi://" + hostname + ":" + portNr + path);
+      }
     } catch (URISyntaxException e) {
       throw new Error("Bad generated URI", e);
     }




More information about the Mulgara-svn mailing list