cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r657982 - in /cxf/branches/2.0.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/transport/ rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ systests/src/test/java/org/apache/cxf/systest/http/
Date Mon, 19 May 2008 21:13:09 GMT
Author: dkulp
Date: Mon May 19 14:13:09 2008
New Revision: 657982

URL: http://svn.apache.org/viewvc?rev=657982&view=rev
Log:
Merged revisions 657978 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r657978 | dkulp | 2008-05-19 17:07:54 -0400 (Mon, 19 May 2008) | 2 lines
  
  [CXF-1589] Fix problems of calling Endpoint.publish with a busy port not always throwing
an exception back
........

Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
    cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
    cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java?rev=657982&r1=657981&r2=657982&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/AbstractObservable.java
Mon May 19 14:13:09 2008
@@ -44,7 +44,12 @@
             if (observer != null) {
                 getLogger().fine("registering incoming observer: " + observer);
                 if (old == null) {
-                    activate();
+                    try {
+                        activate();
+                    } catch (RuntimeException ex) {
+                        incomingObserver = null;
+                        throw ex;
+                    }
                 }
             } else {
                 if (old != null) {

Modified: cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=657982&r1=657981&r2=657982&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Mon May 19 14:13:09 2008
@@ -309,6 +309,7 @@
                 } catch (Exception ex) {
                     //ignore - probably wasn't fully started anyway
                 }
+                server = null;
                 throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage()),
e);
             }
         }        

Modified: cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java?rev=657982&r1=657981&r2=657982&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
Mon May 19 14:13:09 2008
@@ -21,8 +21,8 @@
 import java.io.IOException;
 import java.security.GeneralSecurityException;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
@@ -39,7 +39,7 @@
     implements DestinationFactory {
 
     private Map<String, JettyHTTPDestination> destinations = 
-        new HashMap<String, JettyHTTPDestination>();
+        new ConcurrentHashMap<String, JettyHTTPDestination>();
     
     public JettyHTTPTransportFactory() {
         super();
@@ -98,7 +98,7 @@
         throws IOException {
         
         String addr = endpointInfo.getAddress();
-        JettyHTTPDestination destination = destinations.get(addr);
+        JettyHTTPDestination destination = addr == null ? null : destinations.get(addr);
         if (destination == null) {
             destination = createDestination(endpointInfo);
         }
@@ -110,8 +110,8 @@
         EndpointInfo endpointInfo
     ) throws IOException {
         
-        JettyHTTPDestination destination = 
-            destinations.get(endpointInfo.getAddress());
+        String addr = endpointInfo.getAddress();
+        JettyHTTPDestination destination = addr == null ? null : destinations.get(addr);
         if (destination == null) {
             destination = 
                 new JettyHTTPDestination(getBus(), this, endpointInfo);

Modified: cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java?rev=657982&r1=657981&r2=657982&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java
(original)
+++ cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java
Mon May 19 14:13:09 2008
@@ -22,6 +22,8 @@
 import java.lang.reflect.UndeclaredThrowableException;
 
 import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
 
 import org.apache.cxf.greeter_control.Greeter;
 import org.apache.cxf.greeter_control.GreeterService;
@@ -94,4 +96,24 @@
         }
     }
     
+    @Test
+    public void testPublishOnBusyPort() {
+        GreeterSessionImpl implementor = new GreeterSessionImpl();
+        String address = "http://localhost:9020/SoapContext/GreeterPort";
+        try {
+            Endpoint.publish(address, implementor);
+            fail("Should have failed to publish as the port is busy");
+        } catch (WebServiceException ex) {
+            //ignore
+        }
+        try {
+            //CXF-1589
+            Endpoint.publish(address, implementor);
+            fail("Should have failed to publish as the port is busy");
+        } catch (WebServiceException ex) {
+            //ignore
+        }
+        
+    }
+    
 }



Mime
View raw message