felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgil...@apache.org
Subject svn commit: r1189660 - in /felix/trunk/httplite: ./ src/main/java/org/apache/felix/httplite/osgi/ src/main/java/org/apache/felix/httplite/server/
Date Thu, 27 Oct 2011 08:18:14 GMT
Author: kgilmer
Date: Thu Oct 27 08:18:13 2011
New Revision: 1189660

URL: http://svn.apache.org/viewvc?rev=1189660&view=rev
Log:
httplite: fix bug in which service registerations from multiple bundles would cause internal
servlet map to be reset, resulting in all but last client registrations to be inaccessable.

Modified:
    felix/trunk/httplite/build.xml
    felix/trunk/httplite/pom.xml
    felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceFactoryImpl.java
    felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceImpl.java
    felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java

Modified: felix/trunk/httplite/build.xml
URL: http://svn.apache.org/viewvc/felix/trunk/httplite/build.xml?rev=1189660&r1=1189659&r2=1189660&view=diff
==============================================================================
--- felix/trunk/httplite/build.xml (original)
+++ felix/trunk/httplite/build.xml Thu Oct 27 08:18:13 2011
@@ -2,7 +2,7 @@
 <project name="org.apache.felix.httplite" default="jar">
 	<property name="src.dir" location="${basedir}/src" />
 	<property name="project.description" value="Lightweight HTTP Service for Apache Felix"
/>
-	<property name="project.version" value="0.1.0" />
+	<property name="project.version" value="0.1.1" />
 	<property name="external.dir" location="external" />
 	<property name="doc.dir" location="${basedir}/docs" />
 	<property name="build.dir" location="${basedir}/classes" />
@@ -121,19 +121,19 @@
 			<attribute name="Bundle-Vendor" value="The Apache Software Foundation" />
 		</manifest>
 
-		<jar destfile="${dist.dir}/${ant.project.name}-debug-all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
+		<jar destfile="${dist.dir}/${ant.project.name}.debug.all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
 			<fileset dir="${build.dir}-debug" includes="**/*.class,**/*.properties,**/*.dtd,**/*.xsd"
/>
 			<fileset dir="${src.dir}/share" includes="javax/servlet/**/*.properties,javax/servlet/**/*.dtd,javax/servlet/**/*.xsd"
/>
 			<fileset dir="." includes="LICENSE-2.0.txt" />
 		</jar>
 
-		<jar destfile="${dist.dir}/${ant.project.name}-all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
+		<jar destfile="${dist.dir}/${ant.project.name}.all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
 			<fileset dir="${build.dir}" includes="**/*.class,**/*.properties,**/*.dtd,**/*.xsd"
/>
 			<fileset dir="${src.dir}/share" includes="javax/servlet/**/*.properties,javax/servlet/**/*.dtd,javax/servlet/**/*.xsd"
/>
 			<fileset dir="." includes="LICENSE-2.0.txt" />
 		</jar>
 
-		<jar destfile="${dist.dir}/${ant.project.name}-min-${project.version}.jar" manifest="${build.dir}/META-INF-MIN/MANIFEST.MF">
+		<jar destfile="${dist.dir}/${ant.project.name}.min-${project.version}.jar" manifest="${build.dir}/META-INF-MIN/MANIFEST.MF">
 			<fileset dir="${build.dir}" includes="org/apache/felix/httplite/**/*.class" />
 			<fileset dir="." includes="LICENSE-2.0.txt" />
 		</jar>

Modified: felix/trunk/httplite/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/httplite/pom.xml?rev=1189660&r1=1189659&r2=1189660&view=diff
==============================================================================
--- felix/trunk/httplite/pom.xml (original)
+++ felix/trunk/httplite/pom.xml Thu Oct 27 08:18:13 2011
@@ -27,7 +27,7 @@
 	<packaging>bundle</packaging>
 	<name>Apache Felix Lightweight HTTP Server</name>
 	<description>A minimal HTTP Service implementation.</description>
-	<version>0.1.0-SNAPSHOT</version>
+	<version>0.1.1-SNAPSHOT</version>
 	<artifactId>org.apache.felix.httplite</artifactId>
 	<dependencies>
 		<dependency>

Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceFactoryImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceFactoryImpl.java?rev=1189660&r1=1189659&r2=1189660&view=diff
==============================================================================
--- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceFactoryImpl.java
(original)
+++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceFactoryImpl.java
Thu Oct 27 08:18:13 2011
@@ -20,6 +20,7 @@ package org.apache.felix.httplite.osgi;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 
 import org.apache.felix.httplite.server.Server;
@@ -46,6 +47,10 @@ public class HttpServiceFactoryImpl impl
      * List of service registrations, both Resource and Servlet.
      */
     private List m_registrations;
+	/**
+	 * Map to store the servlet and resource registrations.
+	 */
+	private final HashMap m_servletMap;
 
     /**
      * @param logger
@@ -55,6 +60,7 @@ public class HttpServiceFactoryImpl impl
     {
         this.m_logger = logger;
         this.m_server = m_server;
+        this.m_servletMap = new HashMap();
     }
 
     /* (non-Javadoc)
@@ -65,7 +71,7 @@ public class HttpServiceFactoryImpl impl
         HttpServiceImpl httpService = null;
         try
         {
-            httpService = new HttpServiceImpl(bundle, m_server, m_logger);
+            httpService = new HttpServiceImpl(bundle, m_server, m_logger, m_servletMap);
 
             if (m_server.getState() != Server.ACTIVE_STATE)
             {

Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceImpl.java?rev=1189660&r1=1189659&r2=1189660&view=diff
==============================================================================
--- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceImpl.java
(original)
+++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/osgi/HttpServiceImpl.java
Thu Oct 27 08:18:13 2011
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.net.Socket;
 import java.util.Dictionary;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
@@ -73,12 +72,12 @@ public class HttpServiceImpl implements 
      *            instance of Logger
      * @throws IOException
      */
-    public HttpServiceImpl(final Bundle bundle, final Server server, final Logger logger)
throws IOException
+    public HttpServiceImpl(final Bundle bundle, final Server server, final Logger logger,
Map servletMap) throws IOException
     {
         this.m_bundle = bundle;
         this.m_logger = logger;
         this.m_server = server;
-        this.m_servletMap = new HashMap();
+        this.m_servletMap = servletMap;
     }
 
     /*

Modified: felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java
URL: http://svn.apache.org/viewvc/felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java?rev=1189660&r1=1189659&r2=1189660&view=diff
==============================================================================
--- felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java (original)
+++ felix/trunk/httplite/src/main/java/org/apache/felix/httplite/server/Connection.java Thu
Oct 27 08:18:13 2011
@@ -25,7 +25,6 @@ import java.io.OutputStream;
 import java.net.Socket;
 
 import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
 
 import org.apache.felix.httplite.osgi.Logger;
 import org.apache.felix.httplite.osgi.ServiceRegistrationHandler;
@@ -75,7 +74,7 @@ public class Connection
      * @param socket The client socket.
      * @param timeout The inactivity timeout of the connection in milliseconds.
      * @param requestLimit The maximum number of consecutive requests.
-     * @param m_resolver 
+     * @param resolver resolves a request URI to a client or servlet registration via the
HTTP Service.
      * @throws java.io.IOException If any I/O error occurs.
      */
     public Connection(final Socket socket, final int timeout, final int requestLimit, final
ServiceRegistrationResolver resolver, final Logger logger) throws IOException



Mime
View raw message