Improve Jetty integration in order to support consistent HTTP sessions.
[lgpl/argeo-commons.git] / org.argeo.cms.lib.equinox / src / org / argeo / cms / equinox / http / jetty / EquinoxJettyServer.java
index d73bdfd1b327e525d57dbe3a151023fa77d889d1..e6595a05e9d8379f9f2a25d46a85fd83dbcb3272 100644 (file)
@@ -21,22 +21,21 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 import org.osgi.framework.Constants;
 
+/** A {@link CmsJettyServer} integrating with Equinox HTTP framework. */
 public class EquinoxJettyServer extends CmsJettyServer {
        private static final String INTERNAL_CONTEXT_CLASSLOADER = "org.eclipse.equinox.http.jetty.internal.ContextClassLoader";
 
        @Override
-       protected void addServlets(ServletContextHandler servletContextHandler) throws ServletException {
+       protected void addServlets(ServletContextHandler rootContextHandler) throws ServletException {
                ServletHolder holder = new ServletHolder(new InternalHttpServiceServlet());
                holder.setInitOrder(0);
                holder.setInitParameter(Constants.SERVICE_VENDOR, "Eclipse.org"); //$NON-NLS-1$
                holder.setInitParameter(Constants.SERVICE_DESCRIPTION, "Equinox Jetty-based Http Service"); //$NON-NLS-1$
 
-               // holder.setInitParameter(JettyConstants.CONTEXT_PATH,
-               // httpContext.getContextPath());
-               servletContextHandler.addServlet(holder, "/*");
+               rootContextHandler.addServlet(holder, "/*");
 
                // post-start
-               SessionHandler sessionManager = servletContextHandler.getSessionHandler();
+               SessionHandler sessionManager = rootContextHandler.getSessionHandler();
                sessionManager.addEventListener((HttpSessionIdListener) holder.getServlet());
        }