tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r630538 - in /openejb/trunk/openejb3/server: openejb-http/src/main/java/org/apache/openejb/server/httpd/ openejb-webservices/src/main/java/org/apache/openejb/server/webservices/
Date Sat, 23 Feb 2008 22:36:16 GMT
Author: dain
Date: Sat Feb 23 14:36:13 2008
New Revision: 630538

URL: http://svn.apache.org/viewvc?rev=630538&view=rev
Log:
Quick fix for HTTP server and webservices

Modified:
    openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/OpenEJBHttpServer.java
    openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/OpenEJBHttpWsRegistry.java
    openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/WsService.java

Modified: openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/OpenEJBHttpServer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/OpenEJBHttpServer.java?rev=630538&r1=630537&r2=630538&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/OpenEJBHttpServer.java
(original)
+++ openejb/trunk/openejb3/server/openejb-http/src/main/java/org/apache/openejb/server/httpd/OpenEJBHttpServer.java
Sat Feb 23 14:36:13 2008
@@ -24,6 +24,7 @@
 import java.util.Properties;
 
 import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.server.ServiceException;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
@@ -40,6 +41,17 @@
     private HttpListener listener;
 
     public OpenEJBHttpServer() {
+        this(getHttpListenerRegistry());
+    }
+
+    private static HttpListenerRegistry getHttpListenerRegistry() {
+        SystemInstance systemInstance = SystemInstance.get();
+        HttpListenerRegistry registry = systemInstance.getComponent(HttpListenerRegistry.class);
+        if (registry == null){
+            registry = new HttpListenerRegistry();
+            systemInstance.setComponent(HttpListenerRegistry.class, registry);
+        }
+        return registry;
     }
 
     public OpenEJBHttpServer(HttpListener listener) {

Modified: openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/OpenEJBHttpWsRegistry.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/OpenEJBHttpWsRegistry.java?rev=630538&r1=630537&r2=630538&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/OpenEJBHttpWsRegistry.java
(original)
+++ openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/OpenEJBHttpWsRegistry.java
Sat Feb 23 14:36:13 2008
@@ -25,11 +25,11 @@
 import org.apache.openejb.assembler.classic.OpenEjbConfiguration;
 import org.apache.openejb.assembler.classic.ServiceInfo;
 import org.apache.openejb.loader.SystemInstance;
-import org.apache.openejb.server.httpd.HttpEjbServer;
 import org.apache.openejb.server.httpd.HttpListener;
 import org.apache.openejb.server.httpd.HttpListenerRegistry;
 import org.apache.openejb.server.httpd.HttpRequest;
 import org.apache.openejb.server.httpd.HttpResponse;
+import org.apache.openejb.server.httpd.HttpServerFactory;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
 
@@ -42,7 +42,7 @@
         try {
             OpenEjbConfiguration configuration = SystemInstance.get().getComponent(OpenEjbConfiguration.class);
             for (ServiceInfo service : configuration.facilities.services) {
-                if (service.className.equals(HttpEjbServer.class.getName())) {
+                if (service.className.equals(HttpServerFactory.class.getName())) {
                     int port = Integer.parseInt(service.properties.getProperty("port"));
                     String ip = service.properties.getProperty("bind");
                     if ("0.0.0.0".equals(ip)) {

Modified: openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/WsService.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/WsService.java?rev=630538&r1=630537&r2=630538&view=diff
==============================================================================
--- openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/WsService.java
(original)
+++ openejb/trunk/openejb3/server/openejb-webservices/src/main/java/org/apache/openejb/server/webservices/WsService.java
Sat Feb 23 14:36:13 2008
@@ -243,10 +243,12 @@
                                 // one of the registered addresses to be the connonical address
                                 String address = selectSingleAddress(addresses);
 
-                                // register wsdl location
-                                portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService,
portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
-                                logger.info("Webservice(wsdl=" + address + ", qname=" + port.getWsdlService()
+ ") --> Ejb(id=" + portInfo.portId + ")");
-                                ejbAddresses.put(bean.ejbDeploymentId, address);
+                                if (address != null) {
+                                    // register wsdl location
+                                    portAddressRegistry.addPort(portInfo.serviceId, portInfo.wsdlService,
portInfo.portId, portInfo.wsdlPort, portInfo.seiInterfaceName, address);
+                                    logger.info("Webservice(wsdl=" + address + ", qname="
+ port.getWsdlService() + ") --> Ejb(id=" + portInfo.portId + ")");
+                                    ejbAddresses.put(bean.ejbDeploymentId, address);
+                                }
                             }
                         } catch (Throwable e) {
                             logger.error("Error deploying CXF webservice for ejb " + deploymentInfo.getDeploymentID(),
e);
@@ -365,6 +367,8 @@
     }
 
     private String selectSingleAddress(List<String> addresses) {
+        if (addresses == null || addresses.isEmpty()) return null;
+
         // return the first http address
         for (String address : addresses) {
             if (address.startsWith("http:")) {



Mime
View raw message