FELIX-4888 : ServletHandler's are not sorted by longest matching path. Finish error page registry. Start DTO handling (WiP)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1679990 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/HttpServiceController.java b/http/base/src/main/java/org/apache/felix/http/base/internal/HttpServiceController.java
index aaf9ecd..6b74a77 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/HttpServiceController.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/HttpServiceController.java
@@ -25,8 +25,8 @@
import javax.servlet.http.HttpSessionListener;
import org.apache.felix.http.base.internal.dispatch.Dispatcher;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
import org.apache.felix.http.base.internal.handler.HttpSessionWrapper;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.service.HttpServiceFactory;
import org.apache.felix.http.base.internal.service.listener.ServletContextAttributeListenerManager;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
index d37d7dd..9f54123 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
@@ -52,9 +52,9 @@
import org.apache.felix.http.base.internal.context.ExtServletContext;
import org.apache.felix.http.base.internal.handler.FilterHandler;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
import org.apache.felix.http.base.internal.handler.HttpSessionWrapper;
import org.apache.felix.http.base.internal.handler.ServletHandler;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.registry.PathResolution;
import org.apache.felix.http.base.internal.registry.ServletResolution;
import org.apache.felix.http.base.internal.util.UriUtils;
@@ -94,11 +94,11 @@
try
{
ServletRequestWrapper req = new ServletRequestWrapper((HttpServletRequest) request,
- this.resolution.holder.getContext(),
+ this.resolution.handler.getContext(),
this.requestInfo,
DispatcherType.FORWARD,
- this.resolution.holder.getContextServiceId(),
- this.resolution.holder.getServletInfo().isAsyncSupported());
+ this.resolution.handler.getContextServiceId(),
+ this.resolution.handler.getServletInfo().isAsyncSupported());
Dispatcher.this.forward(this.resolution, req, (HttpServletResponse) response);
}
finally
@@ -117,11 +117,11 @@
public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException
{
ServletRequestWrapper req = new ServletRequestWrapper((HttpServletRequest) request,
- this.resolution.holder.getContext(),
+ this.resolution.handler.getContext(),
this.requestInfo,
DispatcherType.INCLUDE,
- this.resolution.holder.getContextServiceId(),
- this.resolution.holder.getServletInfo().isAsyncSupported());
+ this.resolution.handler.getContextServiceId(),
+ this.resolution.handler.getServletInfo().isAsyncSupported());
Dispatcher.this.include(this.resolution, req, (HttpServletResponse) response);
}
}
@@ -204,7 +204,7 @@
final FilterHandler[] filterHandlers = handlerRegistry.getFilters(errorResolution, DispatcherType.ERROR, request.getRequestURI());
// TODO - is async = false correct?
- invokeChain(errorResolution.holder, filterHandlers, new ServletRequestWrapper(request, errorResolution.holder.getContext(), requestInfo, this.serviceId, false), this);
+ invokeChain(errorResolution.handler, filterHandlers, new ServletRequestWrapper(request, errorResolution.handler.getContext(), requestInfo, this.serviceId, false), this);
invokeSuper = false;
}
@@ -593,7 +593,7 @@
final PathResolution pr = this.handlerRegistry.resolveServlet(requestURI);
final HttpServletResponse wrappedResponse = new ServletResponseWrapper(req, res,
- pr == null ? null : pr.holder);
+ pr == null ? null : pr.handler);
if ( pr == null )
{
wrappedResponse.sendError(404);
@@ -601,12 +601,12 @@
}
- final ExtServletContext servletContext = pr.holder.getContext();
+ final ExtServletContext servletContext = pr.handler.getContext();
final RequestInfo requestInfo = new RequestInfo(pr.servletPath, pr.pathInfo, null);
final HttpServletRequest wrappedRequest = new ServletRequestWrapper(req, servletContext, requestInfo,
- pr.holder.getContextServiceId(),
- pr.holder.getServletInfo().isAsyncSupported());
+ pr.handler.getContextServiceId(),
+ pr.handler.getServletInfo().isAsyncSupported());
final FilterHandler[] filterHandlers = this.handlerRegistry.getFilters(pr, req.getDispatcherType(), pr.requestURI);
try
@@ -615,7 +615,7 @@
{
servletContext.getServletRequestListener().requestInitialized(new ServletRequestEvent(servletContext, wrappedRequest));
}
- invokeChain(pr.holder, filterHandlers, wrappedRequest, wrappedResponse);
+ invokeChain(pr.handler, filterHandlers, wrappedRequest, wrappedResponse);
}
catch ( final Exception e)
{
@@ -683,7 +683,7 @@
String requestURI = getRequestURI(request);
FilterHandler[] filterHandlers = this.handlerRegistry.getFilters(resolution, DispatcherType.FORWARD, requestURI);
- invokeChain(resolution.holder, filterHandlers, request, response);
+ invokeChain(resolution.handler, filterHandlers, request, response);
}
/**
@@ -696,7 +696,7 @@
String requestURI = getRequestURI(request);
FilterHandler[] filterHandlers = this.handlerRegistry.getFilters(resolution, DispatcherType.INCLUDE, requestURI);
- invokeChain(resolution.holder, filterHandlers, request, response);
+ invokeChain(resolution.handler, filterHandlers, request, response);
}
private String getRequestURI(HttpServletRequest req)
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistry.java
index abd1b16..6ad8aa9 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistry.java
@@ -36,6 +36,9 @@
import org.apache.felix.http.base.internal.runtime.dto.ServletRuntime;
import org.osgi.service.http.runtime.dto.DTOConstants;
+/**
+ * TODO - check if add/remove needs syncing
+ */
public final class ErrorPageRegistry
{
private static final String CLIENT_ERROR = "4xx";
@@ -87,7 +90,7 @@
}
private static final class ErrorRegistrationStatus {
- ServletHandler holder;
+ ServletHandler handler;
final Map<Long, Integer> errorCodeMapping = new ConcurrentHashMap<Long, Integer>();
final Map<String, Integer> exceptionMapping = new ConcurrentHashMap<String, Integer>();
}
@@ -112,38 +115,38 @@
/**
* Add the servlet for error handling
- * @param holder The servlet holder.
+ * @param handler The servlet handler.
*/
- public void addServlet(@Nonnull final ServletHandler holder)
+ public void addServlet(@Nonnull final ServletHandler handler)
{
- final ErrorRegistration reg = getErrorRegistration(holder.getServletInfo());
+ final ErrorRegistration reg = getErrorRegistration(handler.getServletInfo());
if ( reg != null )
{
final ErrorRegistrationStatus status = new ErrorRegistrationStatus();
- status.holder = holder;
+ status.handler = handler;
for(final long code : reg.errorCodes)
{
List<ServletHandler> list = errorCodesMap.get(code);
if ( list == null )
{
// activate
- if ( tryToActivate(code, holder, status) )
+ if ( tryToActivate(code, handler, status) )
{
final List<ServletHandler> newList = new ArrayList<ServletHandler>(1);
- newList.add(holder);
+ newList.add(handler);
errorCodesMap.put(code, newList);
}
}
else
{
final List<ServletHandler> newList = new ArrayList<ServletHandler>(list);
- newList.add(holder);
+ newList.add(handler);
Collections.sort(newList);
- if ( newList.get(0) == holder )
+ if ( newList.get(0) == handler )
{
// activate and reactive
- if ( tryToActivate(code, holder, status) )
+ if ( tryToActivate(code, handler, status) )
{
final ServletHandler old = list.get(0);
old.destroy();
@@ -164,23 +167,23 @@
if ( list == null )
{
// activate
- if ( tryToActivate(exception, holder, status) )
+ if ( tryToActivate(exception, handler, status) )
{
final List<ServletHandler> newList = new ArrayList<ServletHandler>(1);
- newList.add(holder);
+ newList.add(handler);
exceptionsMap.put(exception, newList);
}
}
else
{
final List<ServletHandler> newList = new ArrayList<ServletHandler>(list);
- newList.add(holder);
+ newList.add(handler);
Collections.sort(newList);
- if ( newList.get(0) == holder )
+ if ( newList.get(0) == handler )
{
// activate and reactive
- if ( tryToActivate(exception, holder, status) )
+ if ( tryToActivate(exception, handler, status) )
{
final ServletHandler old = list.get(0);
old.destroy();
@@ -195,7 +198,7 @@
}
}
}
- this.statusMapping.put(holder.getServletInfo(), status);
+ this.statusMapping.put(handler.getServletInfo(), status);
}
}
@@ -218,13 +221,13 @@
final Iterator<ServletHandler> i = list.iterator();
while ( i.hasNext() )
{
- final ServletHandler holder = i.next();
- if ( holder.getServletInfo().equals(info) )
+ final ServletHandler handler = i.next();
+ if ( handler.getServletInfo().equals(info) )
{
- holder.destroy();
+ handler.destroy();
final List<ServletHandler> newList = new ArrayList<ServletHandler>(list);
- newList.remove(holder);
+ newList.remove(handler);
if ( index == 0 )
{
@@ -266,13 +269,13 @@
final Iterator<ServletHandler> i = list.iterator();
while ( i.hasNext() )
{
- final ServletHandler holder = i.next();
- if ( holder.getServletInfo().equals(info) )
+ final ServletHandler handler = i.next();
+ if ( handler.getServletInfo().equals(info) )
{
- holder.destroy();
+ handler.destroy();
final List<ServletHandler> newList = new ArrayList<ServletHandler>(list);
- newList.remove(holder);
+ newList.remove(handler);
if ( index == 0 )
{
@@ -364,19 +367,19 @@
return servletHandler;
}
- private boolean tryToActivate(final Long code, final ServletHandler holder, final ErrorRegistrationStatus status)
+ private boolean tryToActivate(final Long code, final ServletHandler handler, final ErrorRegistrationStatus status)
{
// add to active
- final int result = holder.init();
+ final int result = handler.init();
status.errorCodeMapping.put(code, result);
return result == -1;
}
- private boolean tryToActivate(final String exception, final ServletHandler holder, final ErrorRegistrationStatus status)
+ private boolean tryToActivate(final String exception, final ServletHandler handler, final ErrorRegistrationStatus status)
{
// add to active
- final int result = holder.init();
+ final int result = handler.init();
status.exceptionMapping.put(exception, result);
return result == -1;
@@ -418,7 +421,7 @@
}
if ( !activeCodes.isEmpty() || !activeExceptions.isEmpty() )
{
- errorPages.add(new ErrorPageRuntime(status.holder, activeCodes, activeExceptions));
+ errorPages.add(new ErrorPageRuntime(status.handler, activeCodes, activeExceptions));
}
if ( !inactiveCodes.isEmpty() || !inactiveExceptions.isEmpty() )
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/FilterRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/FilterRegistry.java
index f003b35..7d5649a 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/FilterRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/FilterRegistry.java
@@ -35,6 +35,9 @@
import org.apache.felix.http.base.internal.runtime.dto.FailureRuntime;
import org.apache.felix.http.base.internal.runtime.dto.FilterRuntime;
+/**
+ * TODO - check if add/remove needs syncing
+ */
public final class FilterRegistry
{
private volatile HandlerMapping filterMapping = new HandlerMapping();
@@ -44,21 +47,21 @@
private static final class FilterRegistrationStatus
{
public int result;
- public FilterHandler holder;
+ public FilterHandler handler;
}
- public void addFilter(@Nonnull final FilterHandler holder)
+ public void addFilter(@Nonnull final FilterHandler handler)
{
- final int result = holder.init();
+ final int result = handler.init();
if ( result == -1 )
{
- this.filterMapping = this.filterMapping.add(holder);
+ this.filterMapping = this.filterMapping.add(handler);
}
final FilterRegistrationStatus status = new FilterRegistrationStatus();
status.result = result;
- status.holder = holder;
+ status.handler = handler;
- statusMapping.put(holder.getFilterInfo(), status);
+ statusMapping.put(handler.getFilterInfo(), status);
}
public void removeFilter(@Nonnull final FilterInfo filterInfo, final boolean destroy)
@@ -68,16 +71,16 @@
{
if ( status.result == -1 )
{
- this.filterMapping = this.filterMapping.remove(status.holder);
+ this.filterMapping = this.filterMapping.remove(status.handler);
if (destroy)
{
- status.holder.dispose();
+ status.handler.dispose();
}
}
}
}
- public FilterHandler[] getFilterHandlers(@CheckForNull final ServletHandler holder,
+ public FilterHandler[] getFilterHandlers(@CheckForNull final ServletHandler handler,
@CheckForNull DispatcherType dispatcherType,
@Nonnull String requestURI)
{
@@ -95,7 +98,7 @@
}
}
- final String servletName = (holder != null) ? holder.getName() : null;
+ final String servletName = (handler != null) ? handler.getName() : null;
// TODO this is not the most efficient/fastest way of doing this...
for (FilterHandler filterHandler : this.filterMapping.values())
{
@@ -108,13 +111,13 @@
return result.toArray(new FilterHandler[result.size()]);
}
- private boolean referencesDispatcherType(FilterHandler holder, DispatcherType dispatcherType)
+ private boolean referencesDispatcherType(FilterHandler handler, DispatcherType dispatcherType)
{
if (dispatcherType == null)
{
return true;
}
- return Arrays.asList(holder.getFilterInfo().getDispatcher()).contains(dispatcherType);
+ return Arrays.asList(handler.getFilterInfo().getDispatcher()).contains(dispatcherType);
}
private boolean referencesServletByName(FilterHandler handler, String servletName)
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/HandlerRegistry.java
similarity index 85%
rename from http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
rename to http/base/src/main/java/org/apache/felix/http/base/internal/registry/HandlerRegistry.java
index 160d3af..c67ef55 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/HandlerRegistry.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.felix.http.base.internal.handler;
+package org.apache.felix.http.base.internal.registry;
import java.util.ArrayList;
import java.util.Collections;
@@ -24,15 +24,13 @@
import javax.annotation.Nonnull;
import javax.servlet.DispatcherType;
-import org.apache.felix.http.base.internal.registry.PathResolution;
-import org.apache.felix.http.base.internal.registry.PerContextHandlerRegistry;
-import org.apache.felix.http.base.internal.registry.ServletResolution;
+import org.apache.felix.http.base.internal.handler.FilterHandler;
+import org.apache.felix.http.base.internal.handler.ServletHandler;
import org.apache.felix.http.base.internal.runtime.FilterInfo;
import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
import org.apache.felix.http.base.internal.runtime.dto.ContextRuntime;
import org.apache.felix.http.base.internal.runtime.dto.FailureRuntime;
-import org.apache.felix.http.base.internal.runtime.dto.HandlerRegistryRuntime;
/**
* Registry for all services.
@@ -42,7 +40,7 @@
*/
public final class HandlerRegistry
{
- private static FilterHandler[] EMPTY_FILTER_HOLDER = new FilterHandler[0];
+ private static FilterHandler[] EMPTY_FILTER_HANDLER = new FilterHandler[0];
/** Current list of context registrations. */
private volatile List<PerContextHandlerRegistry> registrations = Collections.emptyList();
@@ -126,14 +124,14 @@
}
}
- public void addFilter(@Nonnull final FilterHandler holder)
+ public void addFilter(@Nonnull final FilterHandler handler)
{
- final PerContextHandlerRegistry reg = this.getRegistry(holder.getContextServiceId());
+ final PerContextHandlerRegistry reg = this.getRegistry(handler.getContextServiceId());
// TODO - check whether we need to handle the null case as well
// it shouldn't be required as we only get here if the context exists
if ( reg != null )
{
- reg.addFilter(holder);
+ reg.addFilter(handler);
}
}
@@ -186,11 +184,11 @@
}
if ( reg != null )
{
- final ServletHandler holder = reg.getErrorHandler(code, exception);
- if ( holder != null )
+ final ServletHandler handler = reg.getErrorHandler(code, exception);
+ if ( handler != null )
{
final ServletResolution res = new ServletResolution();
- res.holder = holder;
+ res.handler = handler;
res.handlerRegistry = reg;
return res;
@@ -205,19 +203,19 @@
{
if ( pr != null && pr.handlerRegistry != null )
{
- return pr.handlerRegistry.getFilterHandlers(pr.holder, dispatcherType, requestURI);
+ return pr.handlerRegistry.getFilterHandlers(pr.handler, dispatcherType, requestURI);
}
- return EMPTY_FILTER_HOLDER;
+ return EMPTY_FILTER_HANDLER;
}
- public void addServlet(final ServletHandler holder)
+ public void addServlet(final ServletHandler handler)
{
- final PerContextHandlerRegistry reg = this.getRegistry(holder.getContextServiceId());
+ final PerContextHandlerRegistry reg = this.getRegistry(handler.getContextServiceId());
// TODO - check whether we need to handle the null case as well
// it shouldn't be required as we only get here if the context exists
if ( reg != null )
{
- reg.addServlet(holder);
+ reg.addServlet(handler);
}
}
@@ -256,21 +254,21 @@
}
/**
- * Get the servlet holder for a servlet by name
+ * Get the servlet handler for a servlet by name
* @param contextId The context id or {@code null}
* @param name The servlet name
- * @return The servlet holder or {@code null}
+ * @return The servlet handler or {@code null}
*/
public ServletResolution resolveServletByName(final Long contextId, @Nonnull final String name)
{
final PerContextHandlerRegistry reg = (contextId == null ? null : this.getRegistry(contextId));
if ( reg != null )
{
- final ServletHandler holder = reg.resolveServletByName(name);
- if ( holder != null )
+ final ServletHandler handler = reg.resolveServletByName(name);
+ if ( handler != null )
{
final ServletResolution resolution = new ServletResolution();
- resolution.holder = holder;
+ resolution.handler = handler;
resolution.handlerRegistry = reg;
return resolution;
@@ -279,7 +277,7 @@
return null;
}
- public HandlerRegistryRuntime getRuntime(FailureRuntime.Builder failureRuntimeBuilder)
+ public List<ContextRuntime> getRuntime(FailureRuntime.Builder failureRuntimeBuilder)
{
final List<ContextRuntime> handlerRuntimes = new ArrayList<ContextRuntime>();
@@ -289,6 +287,6 @@
handlerRuntimes.add(contextRegistry.getRuntime(failureRuntimeBuilder));
}
- return new HandlerRegistryRuntime(handlerRuntimes);
+ return handlerRuntimes;
}
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/PerContextHandlerRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/PerContextHandlerRegistry.java
index d02dfaa..26e4e95 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/PerContextHandlerRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/PerContextHandlerRegistry.java
@@ -145,13 +145,12 @@
/**
* Add a servlet
- * @param holder The servlet holder
- * @param info The servlet info
+ * @param handler The servlet handler
*/
- public void addServlet(@Nonnull final ServletHandler holder)
+ public void addServlet(@Nonnull final ServletHandler handler)
{
- this.servletRegistry.addServlet(holder);
- this.errorPageRegistry.addServlet(holder);
+ this.servletRegistry.addServlet(handler);
+ this.errorPageRegistry.addServlet(handler);
}
/**
@@ -164,9 +163,9 @@
this.errorPageRegistry.removeServlet(info, destroy);
}
- public void addFilter(@Nonnull final FilterHandler holder)
+ public void addFilter(@Nonnull final FilterHandler handler)
{
- this.filterRegistry.addFilter(holder);
+ this.filterRegistry.addFilter(handler);
}
public void removeFilter(@Nonnull final FilterInfo info, final boolean destroy)
@@ -185,12 +184,14 @@
return this.errorPageRegistry.get(exception, code);
}
- public synchronized ContextRuntime getRuntime(final FailureRuntime.Builder failureRuntimeBuilder)
+ public ContextRuntime getRuntime(final FailureRuntime.Builder failureRuntimeBuilder)
{
// TODO - add servlets
// TODO - add failures from filters and error pages
return new ContextRuntime(this.filterRegistry.getFilterRuntimes(failureRuntimeBuilder),
this.errorPageRegistry.getErrorPageRuntimes(),
- null, this.serviceId);
+ null,
+ null,
+ this.serviceId);
}
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistration.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistration.java
index 805a487..cec8959 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistration.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistration.java
@@ -25,7 +25,7 @@
import org.apache.felix.http.base.internal.util.UriUtils;
/**
- * Servlet handler is registered with a pattern and a servlet holder
+ * Servlet is registered with a pattern and a servlet handler
*/
public class ServletRegistration
{
@@ -51,7 +51,7 @@
final PathResolution pr = new PathResolution();
pr.servletPath = matcher.groupCount() > 0 ? matcher.group(1) : matcher.group();
pr.pathInfo = UriUtils.compactPath(UriUtils.relativePath(pr.servletPath, requestURI));
- pr.holder = this.handler;
+ pr.handler = this.handler;
return pr;
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistry.java
index 7cba12b..745eae0 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletRegistry.java
@@ -39,6 +39,10 @@
* TODO - servlet name handling
*
* TODO - sort active servlet mappings by pattern length, longest first (avoids looping over all)
+ *
+ * TODO - check if add/remove needs syncing
+ *
+ * TODO - replace patterns with own matchers
*/
public final class ServletRegistry
{
@@ -53,17 +57,17 @@
private static final class ServletNameStatus implements Comparable<ServletNameStatus>
{
public volatile boolean isActive = false;
- public final ServletHandler holder;
+ public final ServletHandler handler;
public ServletNameStatus(final ServletHandler h)
{
- this.holder = h;
+ this.handler = h;
}
@Override
public int compareTo(final ServletNameStatus o)
{
- return holder.compareTo(o.holder);
+ return handler.compareTo(o.handler);
}
}
@@ -91,25 +95,25 @@
/**
* Add a servlet.
*
- * @param holder The servlet holder
+ * @param handler The servlet handler
*/
- public void addServlet(@Nonnull final ServletHandler holder)
+ public void addServlet(@Nonnull final ServletHandler handler)
{
// we have to check for every pattern in the info
// Can be null in case of error-handling servlets...
- if ( holder.getServletInfo().getPatterns() != null )
+ if ( handler.getServletInfo().getPatterns() != null )
{
final ServletRegistrationStatus status = new ServletRegistrationStatus();
- for(final String pattern : holder.getServletInfo().getPatterns())
+ for(final String pattern : handler.getServletInfo().getPatterns())
{
final ServletRegistration regHandler = this.activeServletMappings.get(pattern);
if ( regHandler != null )
{
- if ( regHandler.getServletHandler().getServletInfo().getServiceReference().compareTo(holder.getServletInfo().getServiceReference()) < 0 )
+ if ( regHandler.getServletHandler().getServletInfo().getServiceReference().compareTo(handler.getServletInfo().getServiceReference()) < 0 )
{
// replace if no error with new servlet
- if ( this.tryToActivate(pattern, holder, status) )
+ if ( this.tryToActivate(pattern, handler, status) )
{
// nameStatus.isActive = true;
regHandler.getServletHandler().destroy();
@@ -120,19 +124,19 @@
else
{
// add to inactive
- this.addToInactiveList(pattern, holder, status);
+ this.addToInactiveList(pattern, handler, status);
}
}
else
{
// add to active
- if ( this.tryToActivate(pattern, holder, status) )
+ if ( this.tryToActivate(pattern, handler, status) )
{
// nameStatus.isActive = true;
}
}
}
- this.statusMapping.put(holder.getServletInfo(), status);
+ this.statusMapping.put(handler.getServletInfo(), status);
}
}
@@ -145,7 +149,7 @@
if ( info.getPatterns() != null )
{
this.statusMapping.remove(info);
- ServletHandler cleanupHolder = null;
+ ServletHandler cleanuphandler = null;
for(final String pattern : info.getPatterns())
{
@@ -153,7 +157,7 @@
final ServletRegistration regHandler = this.activeServletMappings.get(pattern);
if ( regHandler != null && regHandler.getServletHandler().getServletInfo().equals(info) )
{
- cleanupHolder = regHandler.getServletHandler();
+ cleanuphandler = regHandler.getServletHandler();
final List<ServletHandler> inactiveList = this.inactiveServletMappings.get(pattern);
if ( inactiveList == null )
{
@@ -189,7 +193,7 @@
if ( h.getServletInfo().equals(info) )
{
i.remove();
- cleanupHolder = h;
+ cleanuphandler = h;
break;
}
}
@@ -201,14 +205,14 @@
}
}
- if ( cleanupHolder != null )
+ if ( cleanuphandler != null )
{
- cleanupHolder.dispose();
+ cleanuphandler.dispose();
}
}
}
- private void addToInactiveList(final String pattern, final ServletHandler holder, final ServletRegistrationStatus status)
+ private void addToInactiveList(final String pattern, final ServletHandler handler, final ServletRegistrationStatus status)
{
List<ServletHandler> inactiveList = this.inactiveServletMappings.get(pattern);
if ( inactiveList == null )
@@ -216,20 +220,20 @@
inactiveList = new ArrayList<ServletHandler>();
this.inactiveServletMappings.put(pattern, inactiveList);
}
- inactiveList.add(holder);
+ inactiveList.add(handler);
Collections.sort(inactiveList);
status.pathToStatus.put(pattern, DTOConstants.FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE);
}
- private boolean tryToActivate(final String pattern, final ServletHandler holder, final ServletRegistrationStatus status)
+ private boolean tryToActivate(final String pattern, final ServletHandler handler, final ServletRegistrationStatus status)
{
// add to active
- final int result = holder.init();
+ final int result = handler.init();
if ( result == -1 )
{
final Pattern p = Pattern.compile(PatternUtil.convertToRegEx(pattern));
- final ServletRegistration handler = new ServletRegistration(holder, p);
- this.activeServletMappings.put(pattern, handler);
+ final ServletRegistration reg = new ServletRegistration(handler, p);
+ this.activeServletMappings.put(pattern, reg);
// add ok
status.pathToStatus.put(pattern, result);
@@ -250,13 +254,13 @@
public ServletHandler resolveByName(@Nonnull String name)
{
- final List<ServletNameStatus> holderList = this.servletsByName.get(name);
- if ( holderList != null )
+ final List<ServletNameStatus> handlerList = this.servletsByName.get(name);
+ if ( handlerList != null )
{
- final ServletNameStatus status = holderList.get(0);
+ final ServletNameStatus status = handlerList.get(0);
if ( status != null && status.isActive )
{
- return status.holder;
+ return status.handler;
}
}
return null;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletResolution.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletResolution.java
index c50cc14..5729a8b 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletResolution.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ServletResolution.java
@@ -20,7 +20,7 @@
public class ServletResolution {
- public ServletHandler holder;
+ public ServletHandler handler;
public PerContextHandlerRegistry handlerRegistry;
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ContextRuntime.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ContextRuntime.java
index 06c9d13..82fe9ef 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ContextRuntime.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ContextRuntime.java
@@ -26,27 +26,42 @@
private final Collection<FilterRuntime> filterRuntimes;
private final Collection<ErrorPageRuntime> errorPageRuntimes;
private final long serviceId;
- private final ServletRegistryRuntime servletRegistryRuntime;
+ private final Collection<ServletRuntime> servletRuntimes;
+ private final Collection<ServletRuntime> resourceRuntimes;
+
public ContextRuntime(Collection<FilterRuntime> filterRuntimes,
Collection<ErrorPageRuntime> errorPageRuntimes,
- final ServletRegistryRuntime servletRegistryRuntime,
+ Collection<ServletRuntime> servletRuntimes,
+ Collection<ServletRuntime> resourceRuntimes,
long serviceId)
{
this.filterRuntimes = filterRuntimes;
this.errorPageRuntimes = errorPageRuntimes;
- this.servletRegistryRuntime = servletRegistryRuntime;
this.serviceId = serviceId;
+ this.servletRuntimes = servletRuntimes;
+ this.resourceRuntimes = resourceRuntimes;
}
public static ContextRuntime empty(long serviceId)
{
return new ContextRuntime(Collections.<FilterRuntime>emptyList(),
Collections.<ErrorPageRuntime> emptyList(),
- null,
+ Collections.<ServletRuntime> emptyList(),
+ Collections.<ServletRuntime> emptyList(),
serviceId);
}
+ Collection<ServletRuntime> getServletRuntimes()
+ {
+ return servletRuntimes;
+ }
+
+ Collection<ServletRuntime> getResourceRuntimes()
+ {
+ return resourceRuntimes;
+ }
+
Collection<FilterRuntime> getFilterRuntimes()
{
return filterRuntimes;
@@ -57,12 +72,7 @@
return errorPageRuntimes;
}
- ServletRegistryRuntime getServletRegistryRuntime()
- {
- return this.servletRegistryRuntime;
- }
-
- long getServiceId()
+ public long getServiceId()
{
return serviceId;
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/HandlerRegistryRuntime.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/HandlerRegistryRuntime.java
deleted file mode 100644
index e552539..0000000
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/HandlerRegistryRuntime.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.felix.http.base.internal.runtime.dto;
-
-import java.util.List;
-
-public final class HandlerRegistryRuntime
-{
- private final List<ContextRuntime> contextRuntimes;
-
- public HandlerRegistryRuntime(List<ContextRuntime> contextRuntimes)
- {
- this.contextRuntimes = contextRuntimes;
- }
-
- public List<ContextRuntime> getContextRuntimes()
- {
- return contextRuntimes;
- }
-}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RequestInfoDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RequestInfoDTOBuilder.java
index 0091e59..92a7fd3 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RequestInfoDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RequestInfoDTOBuilder.java
@@ -19,7 +19,7 @@
import static java.util.Arrays.asList;
import org.apache.felix.http.base.internal.handler.FilterHandler;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.registry.PathResolution;
import org.osgi.service.http.runtime.dto.FilterDTO;
import org.osgi.service.http.runtime.dto.RequestInfoDTO;
@@ -49,21 +49,21 @@
requestInfoDTO.filterDTOs = FILTER_DTO_ARRAY;
return requestInfoDTO;
}
- requestInfoDTO.servletContextId = pr.holder.getContextServiceId();
- if (pr.holder.getServletInfo().isResource())
+ requestInfoDTO.servletContextId = pr.handler.getContextServiceId();
+ if (pr.handler.getServletInfo().isResource())
{
requestInfoDTO.resourceDTO = ResourceDTOBuilder.create()
- .buildDTO(pr.holder, pr.holder.getContextServiceId());
+ .buildDTO(pr.handler, pr.handler.getContextServiceId());
}
else
{
requestInfoDTO.servletDTO = ServletDTOBuilder.create()
- .buildDTO(pr.holder, pr.holder.getContextServiceId());
+ .buildDTO(pr.handler, pr.handler.getContextServiceId());
}
final FilterHandler[] filterHandlers = registry.getFilters(pr, null, path);
requestInfoDTO.filterDTOs = FilterDTOBuilder.create()
- .build(asList(filterHandlers), pr.holder.getContextServiceId())
+ .build(asList(filterHandlers), pr.handler.getContextServiceId())
.toArray(FILTER_DTO_ARRAY);
return requestInfoDTO;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletRegistryRuntime.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletRegistryRuntime.java
deleted file mode 100644
index a63b5a6..0000000
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletRegistryRuntime.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.http.base.internal.runtime.dto;
-
-import java.util.Collection;
-import java.util.Collections;
-
-public final class ServletRegistryRuntime
-{
- private final Collection<ServletRuntime> servletRuntimes;
- private final Collection<ServletRuntime> resourceRuntimes;
-
- public ServletRegistryRuntime(Collection<ServletRuntime> servletRuntimes,
- Collection<ServletRuntime> resourceRuntimes)
- {
- this.servletRuntimes = servletRuntimes;
- this.resourceRuntimes = resourceRuntimes;
- }
-
- public static ServletRegistryRuntime empty()
- {
- return new ServletRegistryRuntime(Collections.<ServletRuntime>emptyList(),
- Collections.<ServletRuntime>emptyList());
- }
-
- Collection<ServletRuntime> getServletRuntimes()
- {
- return servletRuntimes;
- }
-
- Collection<ServletRuntime> getResourceRuntimes()
- {
- return resourceRuntimes;
- }
-}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java b/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java
index 7eee98e..a7f0b61 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java
@@ -23,7 +23,7 @@
import javax.servlet.http.HttpSessionListener;
import org.apache.felix.http.api.ExtHttpService;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.service.listener.HttpSessionAttributeListenerManager;
import org.apache.felix.http.base.internal.service.listener.HttpSessionListenerManager;
import org.apache.felix.http.base.internal.service.listener.ServletContextAttributeListenerManager;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java
index 250f4ab..ab6eca5 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceRuntimeImpl.java
@@ -21,7 +21,7 @@
import java.util.Dictionary;
import java.util.Hashtable;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.runtime.dto.RegistryRuntime;
import org.apache.felix.http.base.internal.runtime.dto.RequestInfoDTOBuilder;
import org.apache.felix.http.base.internal.runtime.dto.RuntimeDTOBuilder;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/service/SharedHttpServiceImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/service/SharedHttpServiceImpl.java
index 95d1842..0d9e7df 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/service/SharedHttpServiceImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/service/SharedHttpServiceImpl.java
@@ -26,9 +26,9 @@
import org.apache.felix.http.base.internal.context.ExtServletContext;
import org.apache.felix.http.base.internal.handler.FilterHandler;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
import org.apache.felix.http.base.internal.handler.HttpServiceServletHandler;
import org.apache.felix.http.base.internal.handler.ServletHandler;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
import org.osgi.service.http.NamespaceException;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java
index 40f25ae..ad473a7 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardHttpService.java
@@ -19,11 +19,11 @@
import javax.annotation.Nonnull;
import org.apache.felix.http.base.internal.handler.FilterHandler;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
import org.apache.felix.http.base.internal.handler.HttpServiceServletHandler;
import org.apache.felix.http.base.internal.handler.ServletHandler;
import org.apache.felix.http.base.internal.handler.WhiteboardFilterHandler;
import org.apache.felix.http.base.internal.handler.WhiteboardServletHandler;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.runtime.FilterInfo;
import org.apache.felix.http.base.internal.runtime.ResourceInfo;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java
index 488f46a..776adba 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardManager.java
@@ -43,9 +43,9 @@
import org.apache.felix.http.base.internal.console.HttpServicePlugin;
import org.apache.felix.http.base.internal.context.ExtServletContext;
-import org.apache.felix.http.base.internal.handler.HandlerRegistry;
import org.apache.felix.http.base.internal.handler.HttpSessionWrapper;
import org.apache.felix.http.base.internal.logger.SystemLogger;
+import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.runtime.AbstractInfo;
import org.apache.felix.http.base.internal.runtime.FilterInfo;
import org.apache.felix.http.base.internal.runtime.HttpSessionAttributeListenerInfo;
@@ -59,8 +59,8 @@
import org.apache.felix.http.base.internal.runtime.ServletRequestAttributeListenerInfo;
import org.apache.felix.http.base.internal.runtime.ServletRequestListenerInfo;
import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo;
+import org.apache.felix.http.base.internal.runtime.dto.ContextRuntime;
import org.apache.felix.http.base.internal.runtime.dto.FailureRuntime;
-import org.apache.felix.http.base.internal.runtime.dto.HandlerRegistryRuntime;
import org.apache.felix.http.base.internal.runtime.dto.InfoServletContextHelperRuntime;
import org.apache.felix.http.base.internal.runtime.dto.RegistryRuntime;
import org.apache.felix.http.base.internal.runtime.dto.ServletContextHelperRuntime;
@@ -747,7 +747,7 @@
public RegistryRuntime getRuntime(HandlerRegistry registry)
{
final Collection<ServletContextHelperRuntime> contextRuntimes = new TreeSet<ServletContextHelperRuntime>(ServletContextHelperRuntime.COMPARATOR);
- HandlerRegistryRuntime handlerRuntimes;
+ List<ContextRuntime> handlerRuntimes;
final Map<Long, Collection<ServiceReference<?>>> listenerRuntimes = new HashMap<Long, Collection<ServiceReference<?>>>();
final FailureRuntime.Builder failureRuntime = FailureRuntime.builder();
synchronized ( this.contextMap )
@@ -772,7 +772,7 @@
}
return new RegistryRuntime(contextRuntimes,
- handlerRuntimes.getContextRuntimes(),
+ handlerRuntimes,
listenerRuntimes,
failureRuntime.build());
}
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/HandlerRegistryTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/HandlerRegistryTest.java
similarity index 90%
rename from http/base/src/test/java/org/apache/felix/http/base/internal/handler/HandlerRegistryTest.java
rename to http/base/src/test/java/org/apache/felix/http/base/internal/registry/HandlerRegistryTest.java
index 52a999a..93450d2 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/HandlerRegistryTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/HandlerRegistryTest.java
@@ -14,11 +14,45 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.felix.http.base.internal.handler;
+package org.apache.felix.http.base.internal.registry;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+
+import org.apache.felix.http.base.internal.runtime.dto.ContextRuntime;
+import org.junit.Test;
public class HandlerRegistryTest
{
+ private final HandlerRegistry registry = new HandlerRegistry();
+
+ @Test public void testInitialSetup()
+ {
+ List<ContextRuntime> runtimes = registry.getRuntime(null);
+ assertNotNull(runtimes);
+ assertTrue(runtimes.isEmpty());
+
+ registry.init();
+
+ runtimes = registry.getRuntime(null);
+ assertNotNull(runtimes);
+ assertFalse(runtimes.isEmpty());
+ assertEquals(1, runtimes.size());
+
+ final ContextRuntime cr = runtimes.get(0);
+
+ assertEquals(0, cr.getServiceId());
+
+ registry.shutdown();
+ runtimes = registry.getRuntime(null);
+ assertNotNull(runtimes);
+ assertTrue(runtimes.isEmpty());
+ }
/*
@Test
public void testAddRemoveServlet() throws Exception
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java
index 652c2f7..b5f22bb 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilderTest.java
@@ -243,13 +243,13 @@
resources.add(createTestServlet("1", context_0, ID_0));
List<FilterRuntime> filters_0 = asList(createTestFilter("1", context_0));
List<ErrorPageRuntime> errorPages_0 = asList(createErrorPage("E_1", context_0, ID_0));
- ContextRuntime contextRuntime_0 = new ContextRuntime(filters_0, errorPages_0, null, ID_0);
+ ContextRuntime contextRuntime_0 = new ContextRuntime(filters_0, errorPages_0, null, null, ID_0);
servlets.add(createTestServlet("A_1", context_A, ID_A));
resources.add(createTestServlet("A_1", context_A, ID_A));
List<FilterRuntime> filters_A = asList(createTestFilter("A_1", context_A));
List<ErrorPageRuntime> errorPages_A = asList(createErrorPage("E_A_1", context_A, ID_A));
- ContextRuntime contextRuntime_A = new ContextRuntime(filters_A, errorPages_A, null, ID_A);
+ ContextRuntime contextRuntime_A = new ContextRuntime(filters_A, errorPages_A, null, null, ID_A);
servlets.addAll(asList(createTestServletWithServiceId("B_1", context_B, ID_B),
createTestServletWithServiceId("B_2", context_B, ID_B)));
@@ -259,7 +259,7 @@
createTestFilterWithServiceId("B_2", context_B));
List<ErrorPageRuntime> errorPages_B = asList(createErrorPageWithServiceId("E_B_1", context_B, ID_B),
createErrorPageWithServiceId("E_B_2", context_B, ID_B));
- ContextRuntime contextRuntime_B = new ContextRuntime(filters_B, errorPages_B, null, ID_B);
+ ContextRuntime contextRuntime_B = new ContextRuntime(filters_B, errorPages_B, null, null, ID_B);
Map<Long, Collection<ServiceReference<?>>> listenerRuntimes = setupListeners();
@@ -610,7 +610,7 @@
ContextRuntime contextRuntime = new ContextRuntime(asList(filterHandler),
Collections.<ErrorPageRuntime>emptyList(),
- null,
+ null, null,
ID_0);
setupRegistry(asList(contextHandler), asList(contextRuntime),
// new ServletRegistryRuntime(asList(resourceHandler), asList(servletHandler)),
@@ -670,7 +670,7 @@
ContextRuntime contextRuntime = new ContextRuntime(Collections.<FilterRuntime>emptyList(),
Collections.<ErrorPageRuntime>emptyList(),
- null,
+ null, null,
ID_0);
setupRegistry(asList(contextHandler), asList(contextRuntime),
// new ServletRegistryRuntime(asList(servletHandler), Collections.<ServletRuntime>emptyList()),