tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1023156 - in /openejb/trunk/openejb3: ./ container/openejb-core/src/test/java/org/apache/openejb/config/ examples/alternate-descriptors/src/main/resources/META-INF/ server/openejb-server/src/main/java/org/apache/openejb/server/
Date Sat, 16 Oct 2010 00:22:28 GMT
Author: dblevins
Date: Sat Oct 16 00:22:28 2010
New Revision: 1023156

URL: http://svn.apache.org/viewvc?rev=1023156&view=rev
Log:
svn merge -r 1021974:1021975 https://svn.apache.org/repos/asf/openejb/branches/openejb-3.1.x

http://svn.apache.org/viewvc?view=revision&revision=1021975
------------------------------------------------------------------------
r1021975 | dblevins | 2010-10-12 19:08:04 -0700 (Tue, 12 Oct 2010) | 2 lines

OPENEJB-1370: Broadcast InetAddress.getLocalHost() when ejbd is bound to 0.0.0.0

------------------------------------------------------------------------

Modified:
    openejb/trunk/openejb3/   (props changed)
    openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java
  (props changed)
    openejb/trunk/openejb3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml
  (props changed)
    openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java

Propchange: openejb/trunk/openejb3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 16 00:22:28 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1:779593
-/openejb/branches/openejb-3.1.x:945409,945448,1004381,1005322,1021880,1021903,1021955,1021961,1021965
+/openejb/branches/openejb-3.1.x:945409,945448,1004381,1005322,1021880,1021903,1021955,1021961,1021965,1021975
 /openejb/branches/openejb-jcdi:984659-985270

Propchange: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 16 00:22:28 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1/container/openejb-core/src/test/java/org/apache/openejb/config/UberInterfaceTest.java:779593
-/openejb/branches/openejb-3.1.x/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965
+/openejb/branches/openejb-3.1.x/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965,1021975
 /openejb/branches/openejb-jcdi/container/openejb-core/src/test/java/org/apache/openejb/config/BusinessInterfacesTest.java:984659-985270

Propchange: openejb/trunk/openejb3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 16 00:22:28 2010
@@ -1,3 +1,3 @@
 /openejb/branches/openejb-3.1.1/examples/alternate-descriptors/src/main/resources/META-INF/ejb-jar.xml:779593
-/openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965
+/openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:945409,945448,1005322,1021880,1021903,1021955,1021961,1021965,1021975
 /openejb/branches/openejb-jcdi/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:984659-985270

Modified: openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java?rev=1023156&r1=1023155&r2=1023156&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java
(original)
+++ openejb/trunk/openejb3/server/openejb-server/src/main/java/org/apache/openejb/server/ServiceDaemon.java
Sat Oct 16 00:22:28 2010
@@ -70,6 +70,7 @@ public class ServiceDaemon implements Se
     private boolean secure;
     private StringTemplate discoveryUriFormat;
     private URI uri;
+    private Properties props;
 
     public ServiceDaemon(ServerService next) {
         this.next = next;
@@ -112,6 +113,8 @@ public class ServiceDaemon implements Se
 
     public void init(Properties props) throws Exception {
 
+        this.props = props;
+        
         String formatString = props.getProperty("discovery");
         if (formatString != null){
             discoveryUriFormat = new StringTemplate(formatString);
@@ -171,9 +174,26 @@ public class ServiceDaemon implements Se
             DiscoveryAgent agent = SystemInstance.get().getComponent(DiscoveryAgent.class);
             if (agent != null && discoveryUriFormat != null) {
                 Map<String,String> map = new HashMap<String,String>();
+
+                // add all the properties that were used to construct this service
+                for (Map.Entry<Object, Object> entry : props.entrySet()) {
+                    map.put(entry.getKey().toString(), entry.getValue().toString());
+                }
+
                 map.put("port", Integer.toString(port));
-                map.put("host", ip);
-                map.put("bind", ip);
+
+                String address = ip;
+
+                if ("0.0.0.0".equals(address)) {
+                    try {
+                        address = InetAddress.getLocalHost().getHostAddress();
+                    } catch (UnknownHostException e) {
+                        log.error("Failed to resolve 0.0.0.0 to a routable address", e);
+                    }
+                }
+
+                map.put("host", address);
+                map.put("bind", address);
                 String uriString = discoveryUriFormat.apply(map);
                 try {
                     uri = new URI(uriString);



Mime
View raw message