felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1760611 - in /felix/sandbox/http-jetty-r7/src: main/java/org/apache/felix/http/jetty/internal/JettyService.java test/java/org/apache/felix/http/jetty/internal/JettyServiceTest.java
Date Wed, 14 Sep 2016 01:19:04 GMT
Author: cziegeler
Date: Wed Sep 14 01:19:03 2016
New Revision: 1760611

URL: http://svn.apache.org/viewvc?rev=1760611&view=rev
Log:
Merge in changes from FELIX-5344

Modified:
    felix/sandbox/http-jetty-r7/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
    felix/sandbox/http-jetty-r7/src/test/java/org/apache/felix/http/jetty/internal/JettyServiceTest.java

Modified: felix/sandbox/http-jetty-r7/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
URL: http://svn.apache.org/viewvc/felix/sandbox/http-jetty-r7/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java?rev=1760611&r1=1760610&r2=1760611&view=diff
==============================================================================
--- felix/sandbox/http-jetty-r7/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
(original)
+++ felix/sandbox/http-jetty-r7/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java
Wed Sep 14 01:19:03 2016
@@ -176,7 +176,7 @@ public final class JettyService extends
         }
     }
 
-    private void publishServiceProperties()
+    private Hashtable<String, Object> getServiceProperties()
     {
         Hashtable<String, Object> props = new Hashtable<String, Object>();
         // Add some important configuration properties...
@@ -184,7 +184,7 @@ public final class JettyService extends
         addEndpointProperties(props, null);
 
         // propagate the new service properties to the actual HTTP service...
-        this.controller.setProperties(props);
+        return props;
     }
 
     public void updated(Dictionary props)
@@ -219,13 +219,13 @@ public final class JettyService extends
                 this.connectorTracker.close();
                 this.connectorTracker = null;
             }
-            
+
             if (this.loadBalancerCustomizerTracker != null)
             {
                 this.loadBalancerCustomizerTracker.close();
                 this.loadBalancerCustomizerTracker = null;
-            } 
-            
+            }
+
             try
             {
                 this.server.stop();
@@ -284,13 +284,13 @@ public final class JettyService extends
             this.server.setHandler(this.parent);
             this.server.start();
 
-            if (this.config.isProxyLoadBalancerConnection()) 
+            if (this.config.isProxyLoadBalancerConnection())
             {
                 customizerWrapper = new CustomizerWrapper();
                 this.loadBalancerCustomizerTracker = new LoadBalancerCustomizerFactoryTracker(this.context,
customizerWrapper);
                 this.loadBalancerCustomizerTracker.open();
             }
-            
+
             final StringBuilder message = new StringBuilder("Started Jetty ").append(version).append("
at port(s)");
             if (this.config.isUseHttp() && initializeHttp())
             {
@@ -304,7 +304,7 @@ public final class JettyService extends
 
             this.connectorTracker = new ConnectorFactoryTracker(this.context, this.server);
             this.connectorTracker.open();
-            
+
             if (this.server.getConnectors() != null && this.server.getConnectors().length
> 0)
             {
                 message.append(" on context path ").append(this.config.getContextPath());
@@ -325,10 +325,11 @@ public final class JettyService extends
                 message.append("]");
 
                 SystemLogger.info(message.toString());
-                publishServiceProperties();
+                this.controller.register(context.getServletContext(), getServiceProperties());
             }
             else
             {
+                this.controller.unregister();
                 this.stopJetty();
                 SystemLogger.error("Jetty stopped (no connectors available)", null);
             }
@@ -369,7 +370,7 @@ public final class JettyService extends
 
         configureConnector(connector, this.config.getHttpPort());
 
-        if (this.config.isProxyLoadBalancerConnection()) 
+        if (this.config.isProxyLoadBalancerConnection())
         {
             connFactory.getHttpConfiguration().addCustomizer(customizerWrapper);
         }
@@ -395,11 +396,11 @@ public final class JettyService extends
         HttpConfiguration httpConfiguration = connFactory.getHttpConfiguration();
         httpConfiguration.addCustomizer(new SecureRequestCustomizer());
 
-        if (this.config.isProxyLoadBalancerConnection()) 
+        if (this.config.isProxyLoadBalancerConnection())
         {
             httpConfiguration.addCustomizer(customizerWrapper);
         }
-        
+
         configureConnector(connector, this.config.getHttpsPort());
         return startConnector(connector);
     }

Modified: felix/sandbox/http-jetty-r7/src/test/java/org/apache/felix/http/jetty/internal/JettyServiceTest.java
URL: http://svn.apache.org/viewvc/felix/sandbox/http-jetty-r7/src/test/java/org/apache/felix/http/jetty/internal/JettyServiceTest.java?rev=1760611&r1=1760610&r2=1760611&view=diff
==============================================================================
--- felix/sandbox/http-jetty-r7/src/test/java/org/apache/felix/http/jetty/internal/JettyServiceTest.java
(original)
+++ felix/sandbox/http-jetty-r7/src/test/java/org/apache/felix/http/jetty/internal/JettyServiceTest.java
Wed Sep 14 01:19:03 2016
@@ -110,7 +110,7 @@ public class JettyServiceTest
                 Matchers.any(Dictionary.class))).thenReturn(reg);
 
         httpServiceController = new HttpServiceController(mockBundleContext);
-        dispatcherServlet = new DispatcherServlet(httpServiceController);
+        dispatcherServlet = new DispatcherServlet(httpServiceController.getDispatcher());
         jettyService = new JettyService(mockBundleContext, dispatcherServlet, mockEventDispatcher,
httpServiceController);
 
         jettyService.start();



Mime
View raw message