You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2022/02/20 13:11:47 UTC
[felix-dev] branch http/jakarta updated: Update to whiteboard api from design/381
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch http/jakarta
in repository https://gitbox.apache.org/repos/asf/felix-dev.git
The following commit(s) were added to refs/heads/http/jakarta by this push:
new b20e7e3 Update to whiteboard api from design/381
b20e7e3 is described below
commit b20e7e3b4560103cd5dca707821b0f30f409d9ad
Author: Carsten Ziegeler <cz...@adobe.com>
AuthorDate: Sun Feb 20 14:11:05 2022 +0100
Update to whiteboard api from design/381
---
http/base/README | 5 +
http/base/pom.xml | 1 +
.../base/internal/console/HttpServicePlugin.java | 32 +-
.../http/base/internal/dispatch/Dispatcher.java | 2 +-
.../internal/dispatch/ServletRequestWrapper.java | 5 -
.../http/base/internal/handler/FilterHandler.java | 2 +-
.../base/internal/handler/ListenerHandler.java | 2 +-
.../base/internal/handler/PreprocessorHandler.java | 4 +-
.../http/base/internal/handler/ServletHandler.java | 2 +-
.../internal/handler/WhiteboardServletHandler.java | 2 +-
.../jakartawrappers/PreprocessorWrapper.java | 2 +-
.../ServletContextHelperWrapper.java | 2 +-
.../javaxwrappers/RuntimeServiceWrapper.java | 371 +++++++++++++
.../base/internal/registry/ErrorPageRegistry.java | 8 +-
.../internal/registry/EventListenerRegistry.java | 6 +-
.../base/internal/registry/FilterRegistry.java | 6 +-
.../base/internal/registry/HandlerRegistry.java | 2 +-
.../http/base/internal/registry/ListenerMap.java | 4 +-
.../registry/PerContextHandlerRegistry.java | 2 +-
.../base/internal/registry/ServletRegistry.java | 12 +-
.../http/base/internal/runtime/AbstractInfo.java | 2 +-
.../http/base/internal/runtime/FilterInfo.java | 4 +-
.../http/base/internal/runtime/ListenerInfo.java | 2 +-
.../base/internal/runtime/PreprocessorInfo.java | 4 +-
.../http/base/internal/runtime/ResourceInfo.java | 2 +-
.../internal/runtime/ServletContextHelperInfo.java | 4 +-
.../http/base/internal/runtime/ServletInfo.java | 4 +-
.../internal/runtime/WhiteboardServiceInfo.java | 2 +-
.../runtime/dto/BaseServletDTOBuilder.java | 2 +-
.../internal/runtime/dto/BuilderConstants.java | 24 +-
.../internal/runtime/dto/ErrorPageDTOBuilder.java | 4 +-
.../base/internal/runtime/dto/FailedDTOHolder.java | 14 +-
.../internal/runtime/dto/FilterDTOBuilder.java | 4 +-
.../internal/runtime/dto/ListenerDTOBuilder.java | 4 +-
.../runtime/dto/PreprocessorDTOBuilder.java | 4 +-
.../base/internal/runtime/dto/RegistryRuntime.java | 4 +-
.../runtime/dto/RequestInfoDTOBuilder.java | 4 +-
.../internal/runtime/dto/ResourceDTOBuilder.java | 4 +-
.../internal/runtime/dto/RuntimeDTOBuilder.java | 20 +-
.../runtime/dto/ServletContextDTOBuilder.java | 4 +-
.../internal/runtime/dto/ServletDTOBuilder.java | 4 +-
.../base/internal/service/HttpServiceFactory.java | 2 +-
.../internal/service/HttpServiceRuntimeImpl.java | 76 ++-
.../internal/whiteboard/FailureStateHandler.java | 12 +-
.../whiteboard/PerBundleServletContextImpl.java | 2 +-
.../whiteboard/WhiteboardContextHandler.java | 2 +-
.../internal/whiteboard/WhiteboardManager.java | 22 +-
.../internal/whiteboard/tracker/FilterTracker.java | 2 +-
.../tracker/JavaxPreprocessorTracker.java | 2 +-
.../tracker/JavaxServletContextHelperTracker.java | 2 +-
.../whiteboard/tracker/ListenersTracker.java | 2 +-
.../whiteboard/tracker/PreprocessorTracker.java | 2 +-
.../whiteboard/tracker/ResourceTracker.java | 2 +-
.../tracker/ServletContextHelperTracker.java | 2 +-
.../whiteboard/tracker/ServletTracker.java | 2 +-
.../http/base/osgi/whiteboard/Preprocessor.java | 31 --
.../base/osgi/whiteboard/ServletContextHelper.java | 97 ----
.../whiteboard/HttpWhiteboardConstants.java | 597 +++++++++++++++++++++
.../service/servlet/whiteboard/Preprocessor.java | 57 ++
.../servlet/whiteboard/ServletContextHelper.java | 331 ++++++++++++
.../service/servlet/whiteboard/package-info.java | 42 ++
.../whiteboard/runtime/HttpServiceRuntime.java | 58 ++
.../runtime/HttpServiceRuntimeConstants.java | 68 +++
.../whiteboard/runtime/dto/BaseServletDTO.java | 76 +++
.../whiteboard/runtime/dto/DTOConstants.java | 115 ++++
.../whiteboard/runtime/dto/ErrorPageDTO.java | 40 ++
.../whiteboard/runtime/dto/FailedErrorPageDTO.java | 46 ++
.../whiteboard/runtime/dto/FailedFilterDTO.java | 46 ++
.../whiteboard/runtime/dto/FailedListenerDTO.java | 46 ++
.../runtime/dto/FailedPreprocessorDTO.java | 40 ++
.../whiteboard/runtime/dto/FailedResourceDTO.java | 46 ++
.../runtime/dto/FailedServletContextDTO.java | 53 ++
.../whiteboard/runtime/dto/FailedServletDTO.java | 48 ++
.../servlet/whiteboard/runtime/dto/FilterDTO.java | 102 ++++
.../whiteboard/runtime/dto/ListenerDTO.java | 51 ++
.../whiteboard/runtime/dto/PreprocessorDTO.java | 53 ++
.../whiteboard/runtime/dto/RequestInfoDTO.java | 62 +++
.../whiteboard/runtime/dto/ResourceDTO.java | 59 ++
.../servlet/whiteboard/runtime/dto/RuntimeDTO.java | 109 ++++
.../whiteboard/runtime/dto/ServletContextDTO.java | 133 +++++
.../servlet/whiteboard/runtime/dto/ServletDTO.java | 81 +++
.../whiteboard/runtime/dto/package-info.java | 44 ++
.../servlet/whiteboard/runtime/package-info.java | 44 ++
.../base/internal/handler/FilterHandlerTest.java | 19 +-
.../internal/registry/ErrorPageRegistryTest.java | 6 +-
.../registry/EventListenerRegistryTest.java | 2 +-
.../base/internal/registry/FilterRegistryTest.java | 4 +-
.../internal/registry/HandlerRegistryTest.java | 4 +-
.../internal/registry/ServletRegistryTest.java | 6 +-
.../base/internal/runtime/ListenerInfoTest.java | 6 +-
.../whiteboard/FailureStateHandlerTest.java | 4 +-
http/jetty/pom.xml | 2 +
92 files changed, 3030 insertions(+), 322 deletions(-)
diff --git a/http/base/README b/http/base/README
new file mode 100644
index 0000000..8976376
--- /dev/null
+++ b/http/base/README
@@ -0,0 +1,5 @@
+This directory contains a proof of concept for a new version of the Apache Felix Http Service.
+
+It is based on Servlet API 5.
+
+This module contains code below the package org.osgi.service.servlet.whiteboard. The API in these packages is NOT official OSGi API, it is work in progress for a new OSGi specifications being worked in the [Eclipse OSGi working group](https://www.osgi.org/). The source is copied from the [design 381 branch](https://github.com/osgi/osgi/tree/design/381). This API might change in any way at any time.
diff --git a/http/base/pom.xml b/http/base/pom.xml
index e119077..486ceaf 100644
--- a/http/base/pom.xml
+++ b/http/base/pom.xml
@@ -57,6 +57,7 @@
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
+ <version>8.0.0</version>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java b/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
index 63235fc..992dce2 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/console/HttpServicePlugin.java
@@ -43,22 +43,22 @@ import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.dto.ServiceReferenceDTO;
-import org.osgi.service.http.runtime.HttpServiceRuntime;
-import org.osgi.service.http.runtime.dto.DTOConstants;
-import org.osgi.service.http.runtime.dto.ErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedFilterDTO;
-import org.osgi.service.http.runtime.dto.FailedListenerDTO;
-import org.osgi.service.http.runtime.dto.FailedResourceDTO;
-import org.osgi.service.http.runtime.dto.FailedServletContextDTO;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
-import org.osgi.service.http.runtime.dto.FilterDTO;
-import org.osgi.service.http.runtime.dto.ListenerDTO;
-import org.osgi.service.http.runtime.dto.RequestInfoDTO;
-import org.osgi.service.http.runtime.dto.ResourceDTO;
-import org.osgi.service.http.runtime.dto.RuntimeDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.runtime.dto.ServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.HttpServiceRuntime;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedFilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RequestInfoDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RuntimeDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletDTO;
/**
* This is a web console plugin.
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 71e4bd3..cdbb027e 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
@@ -28,8 +28,8 @@ 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.PerContextHandlerRegistry;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
-import org.apache.felix.http.base.osgi.whiteboard.Preprocessor;
import org.jetbrains.annotations.Nullable;
+import org.osgi.service.servlet.whiteboard.Preprocessor;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletRequestWrapper.java b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletRequestWrapper.java
index 3b006e5..493ce08 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletRequestWrapper.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletRequestWrapper.java
@@ -80,11 +80,6 @@ final class ServletRequestWrapper extends HttpServletRequestWrapper
*/
private static final String POST_METHOD = "POST";
- /**
- * Constant for HTTP POST method.
- */
- private static final String POST_METHOD = "POST";
-
private final DispatcherType type;
private final RequestInfo requestInfo;
private final ExtServletContext servletContext;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
index 99eeb86..31dcfef 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterHandler.java
@@ -23,7 +23,7 @@ import org.apache.felix.http.base.internal.logger.SystemLogger;
import org.apache.felix.http.base.internal.runtime.FilterInfo;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.BundleContext;
-import org.osgi.service.http.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ListenerHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ListenerHandler.java
index 11b3f9f..c141f3b 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ListenerHandler.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ListenerHandler.java
@@ -21,7 +21,7 @@ import java.util.EventListener;
import org.apache.felix.http.base.internal.context.ExtServletContext;
import org.apache.felix.http.base.internal.runtime.ListenerInfo;
import org.osgi.framework.BundleContext;
-import org.osgi.service.http.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
/**
* The listener handler handles the initialization and destruction of listener
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/PreprocessorHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/PreprocessorHandler.java
index c7c05c0..fb076cf 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/PreprocessorHandler.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/PreprocessorHandler.java
@@ -20,11 +20,11 @@ import java.io.IOException;
import org.apache.felix.http.base.internal.logger.SystemLogger;
import org.apache.felix.http.base.internal.runtime.PreprocessorInfo;
-import org.apache.felix.http.base.osgi.whiteboard.Preprocessor;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.Preprocessor;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletContext;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandler.java
index 940920c..e75f9fc 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandler.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandler.java
@@ -25,7 +25,7 @@ import org.apache.felix.http.base.internal.jakartawrappers.ServletWrapper;
import org.apache.felix.http.base.internal.logger.SystemLogger;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
import org.osgi.framework.Bundle;
-import org.osgi.service.http.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
import jakarta.servlet.Servlet;
import jakarta.servlet.ServletException;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/WhiteboardServletHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/WhiteboardServletHandler.java
index 095a0ef..3cbf2a3 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/WhiteboardServletHandler.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/WhiteboardServletHandler.java
@@ -22,7 +22,7 @@ import org.apache.felix.http.base.internal.context.ExtServletContext;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
-import org.osgi.service.http.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
import jakarta.servlet.Servlet;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/PreprocessorWrapper.java b/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/PreprocessorWrapper.java
index 7c6cb2b..84c1a83 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/PreprocessorWrapper.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/PreprocessorWrapper.java
@@ -16,8 +16,8 @@
*/
package org.apache.felix.http.base.internal.jakartawrappers;
-import org.apache.felix.http.base.osgi.whiteboard.Preprocessor;
import org.jetbrains.annotations.NotNull;
+import org.osgi.service.servlet.whiteboard.Preprocessor;
/**
* Preprocessor wrapper
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/ServletContextHelperWrapper.java b/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/ServletContextHelperWrapper.java
index c2a2450..9a87ba0 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/ServletContextHelperWrapper.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/jakartawrappers/ServletContextHelperWrapper.java
@@ -22,8 +22,8 @@ import java.util.Set;
import org.apache.felix.http.base.internal.javaxwrappers.ServletRequestWrapper;
import org.apache.felix.http.base.internal.javaxwrappers.ServletResponseWrapper;
-import org.apache.felix.http.base.osgi.whiteboard.ServletContextHelper;
import org.jetbrains.annotations.NotNull;
+import org.osgi.service.servlet.whiteboard.ServletContextHelper;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/javaxwrappers/RuntimeServiceWrapper.java b/http/base/src/main/java/org/apache/felix/http/base/internal/javaxwrappers/RuntimeServiceWrapper.java
new file mode 100644
index 0000000..53c2344
--- /dev/null
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/javaxwrappers/RuntimeServiceWrapper.java
@@ -0,0 +1,371 @@
+/*
+ * 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.javaxwrappers;
+
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.dto.ServiceReferenceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.HttpServiceRuntime;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedFilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedPreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.PreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RequestInfoDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RuntimeDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletDTO;
+
+/**
+ * Wrapper for the service runtime
+ */
+public class RuntimeServiceWrapper implements org.osgi.service.http.runtime.HttpServiceRuntime {
+
+ private final HttpServiceRuntime runtime;
+
+ private volatile ServiceReference<org.osgi.service.http.runtime.HttpServiceRuntime> reference;
+
+ /**
+ * Create a new wrapper
+ * @param runtime The original runtime service
+ */
+ public RuntimeServiceWrapper(final HttpServiceRuntime runtime) {
+ this.runtime = runtime;
+ }
+
+ /**
+ * Set the service reference
+ * @param reference The reference
+ */
+ public void setServiceReference(final ServiceReference<org.osgi.service.http.runtime.HttpServiceRuntime> reference) {
+ this.reference = reference;
+ }
+
+ @Override
+ public org.osgi.service.http.runtime.dto.RuntimeDTO getRuntimeDTO() {
+ final RuntimeDTO orig = this.runtime.getRuntimeDTO();
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.RuntimeDTO dto = new org.osgi.service.http.runtime.dto.RuntimeDTO();
+ dto.failedErrorPageDTOs = copy(orig.failedErrorPageDTOs);
+ dto.failedFilterDTOs = copy(orig.failedFilterDTOs);
+ dto.failedListenerDTOs = copy(orig.failedListenerDTOs);
+ dto.failedPreprocessorDTOs = copy(orig.failedPreprocessorDTOs);
+ dto.failedResourceDTOs = copy(orig.failedResourceDTOs);
+ dto.failedServletContextDTOs = copy(orig.failedServletContextDTOs);
+ dto.failedServletDTOs = copy(orig.failedServletDTOs);
+ dto.preprocessorDTOs = copy(orig.preprocessorDTOs);
+ dto.serviceDTO = this.reference.adapt(ServiceReferenceDTO.class);
+ dto.servletContextDTOs = copy(orig.servletContextDTOs);
+ return dto;
+ }
+ return null;
+ }
+
+ @Override
+ public org.osgi.service.http.runtime.dto.RequestInfoDTO calculateRequestInfoDTO(final String path) {
+ final RequestInfoDTO result = this.runtime.calculateRequestInfoDTO(path);
+ if ( result != null ) {
+ final org.osgi.service.http.runtime.dto.RequestInfoDTO dto = new org.osgi.service.http.runtime.dto.RequestInfoDTO();
+ dto.path = result.path;
+ dto.servletContextId = result.servletContextId;
+ dto.filterDTOs = copy(result.filterDTOs);
+ dto.resourceDTO = copy(result.resourceDTO);
+ dto.servletDTO = copy(result.servletDTO);
+ return dto;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FailedErrorPageDTO[] copy(final FailedErrorPageDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FailedErrorPageDTO[] dtos = new org.osgi.service.http.runtime.dto.FailedErrorPageDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FailedErrorPageDTO();
+ dtos[i].asyncSupported = orig[i].asyncSupported;
+ dtos[i].errorCodes = orig[i].errorCodes;
+ dtos[i].exceptions = orig[i].exceptions;
+ dtos[i].failureReason = orig[i].failureReason;
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].name = orig[i].name;
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ dtos[i].servletInfo = orig[i].servletInfo;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FailedFilterDTO[] copy(final FailedFilterDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FailedFilterDTO[] dtos = new org.osgi.service.http.runtime.dto.FailedFilterDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FailedFilterDTO();
+ dtos[i].asyncSupported = orig[i].asyncSupported;
+ dtos[i].dispatcher = orig[i].dispatcher;
+ dtos[i].failureReason = orig[i].failureReason;
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].name = orig[i].name;
+ dtos[i].patterns = orig[i].patterns;
+ dtos[i].regexs = orig[i].regexs;
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ dtos[i].servletNames = orig[i].servletNames;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FailedListenerDTO[] copy(final FailedListenerDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FailedListenerDTO[] dtos = new org.osgi.service.http.runtime.dto.FailedListenerDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FailedListenerDTO();
+ dtos[i].failureReason = orig[i].failureReason;
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ dtos[i].types = orig[i].types;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FailedPreprocessorDTO[] copy(final FailedPreprocessorDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FailedPreprocessorDTO[] dtos = new org.osgi.service.http.runtime.dto.FailedPreprocessorDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FailedPreprocessorDTO();
+ dtos[i].failureReason = orig[i].failureReason;
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].serviceId = orig[i].serviceId;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FailedResourceDTO[] copy(final FailedResourceDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FailedResourceDTO[] dtos = new org.osgi.service.http.runtime.dto.FailedResourceDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FailedResourceDTO();
+ dtos[i].failureReason = orig[i].failureReason;
+ dtos[i].patterns = orig[i].patterns;
+ dtos[i].prefix = orig[i].prefix;
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FailedServletContextDTO[] copy(final FailedServletContextDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FailedServletContextDTO[] dtos = new org.osgi.service.http.runtime.dto.FailedServletContextDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FailedServletContextDTO();
+ dtos[i].attributes = orig[i].attributes;
+ dtos[i].contextPath = orig[i].contextPath;
+ dtos[i].errorPageDTOs = copy(orig[i].errorPageDTOs);
+ dtos[i].failureReason = orig[i].failureReason;
+ dtos[i].filterDTOs = copy(orig[i].filterDTOs);
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].listenerDTOs = copy(orig[i].listenerDTOs);
+ dtos[i].name = orig[i].name;
+ dtos[i].resourceDTOs = copy(orig[i].resourceDTOs);
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletDTOs = copy(orig[i].servletDTOs);
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FailedServletDTO[] copy(final FailedServletDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FailedServletDTO[] dtos = new org.osgi.service.http.runtime.dto.FailedServletDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FailedServletDTO();
+ dtos[i].asyncSupported = orig[i].asyncSupported;
+ dtos[i].failureReason = orig[i].failureReason;
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].multipartEnabled = orig[i].multipartEnabled;
+ dtos[i].multipartFileSizeThreshold = orig[i].multipartFileSizeThreshold;
+ dtos[i].multipartLocation = orig[i].multipartLocation;
+ dtos[i].multipartMaxFileSize = orig[i].multipartMaxFileSize;
+ dtos[i].multipartMaxRequestSize = orig[i].multipartMaxRequestSize;
+ dtos[i].name = orig[i].name;
+ dtos[i].patterns = orig[i].patterns;
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ dtos[i].servletInfo = orig[i].servletInfo;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.ErrorPageDTO[] copy(final ErrorPageDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.ErrorPageDTO[] dtos = new org.osgi.service.http.runtime.dto.ErrorPageDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.ErrorPageDTO();
+ dtos[i].asyncSupported = orig[i].asyncSupported;
+ dtos[i].errorCodes = orig[i].errorCodes;
+ dtos[i].exceptions = orig[i].exceptions;
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].name = orig[i].name;
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ dtos[i].servletInfo = orig[i].servletInfo;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.FilterDTO[] copy(final FilterDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.FilterDTO[] dtos = new org.osgi.service.http.runtime.dto.FilterDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.FilterDTO();
+ dtos[i].asyncSupported = orig[i].asyncSupported;
+ dtos[i].dispatcher = orig[i].dispatcher;
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].name = orig[i].name;
+ dtos[i].patterns = orig[i].patterns;
+ dtos[i].regexs = orig[i].regexs;
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ dtos[i].servletNames = orig[i].servletNames;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.ListenerDTO[] copy(final ListenerDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.ListenerDTO[] dtos = new org.osgi.service.http.runtime.dto.ListenerDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.ListenerDTO();
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletContextId = orig[i].servletContextId;
+ dtos[i].types = orig[i].types;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.PreprocessorDTO[] copy(final PreprocessorDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.PreprocessorDTO[] dtos = new org.osgi.service.http.runtime.dto.PreprocessorDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.PreprocessorDTO();
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].serviceId = orig[i].serviceId;
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.ResourceDTO[] copy(final ResourceDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.ResourceDTO[] dtos = new org.osgi.service.http.runtime.dto.ResourceDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = copy(orig[i]);
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.ResourceDTO copy(final ResourceDTO orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.ResourceDTO dto = new org.osgi.service.http.runtime.dto.ResourceDTO();
+ dto.patterns = orig.patterns;
+ dto.prefix = orig.prefix;
+ dto.serviceId = orig.serviceId;
+ dto.servletContextId = orig.servletContextId;
+ return dto;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.ServletContextDTO[] copy(final ServletContextDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.ServletContextDTO[] dtos = new org.osgi.service.http.runtime.dto.ServletContextDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = new org.osgi.service.http.runtime.dto.ServletContextDTO();
+ dtos[i].attributes = orig[i].attributes;
+ dtos[i].contextPath = orig[i].contextPath;
+ dtos[i].errorPageDTOs = copy(orig[i].errorPageDTOs);
+ dtos[i].filterDTOs = copy(orig[i].filterDTOs);
+ dtos[i].initParams = orig[i].initParams;
+ dtos[i].listenerDTOs = copy(orig[i].listenerDTOs);
+ dtos[i].name = orig[i].name;
+ dtos[i].resourceDTOs = copy(orig[i].resourceDTOs);
+ dtos[i].serviceId = orig[i].serviceId;
+ dtos[i].servletDTOs = copy(orig[i].servletDTOs);
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.ServletDTO[] copy(final ServletDTO[] orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.ServletDTO[] dtos = new org.osgi.service.http.runtime.dto.ServletDTO[orig.length];
+ for(int i=0;i<orig.length;i++) {
+ dtos[i] = copy(orig[i]);
+ }
+ return dtos;
+ }
+ return null;
+ }
+
+ private org.osgi.service.http.runtime.dto.ServletDTO copy(final ServletDTO orig) {
+ if ( orig != null ) {
+ final org.osgi.service.http.runtime.dto.ServletDTO dto = new org.osgi.service.http.runtime.dto.ServletDTO();
+ dto.asyncSupported = orig.asyncSupported;
+ dto.initParams = orig.initParams;
+ dto.multipartEnabled = orig.multipartEnabled;
+ dto.multipartFileSizeThreshold = orig.multipartFileSizeThreshold;
+ dto.multipartLocation = orig.multipartLocation;
+ dto.multipartMaxFileSize = orig.multipartMaxFileSize;
+ dto.multipartMaxRequestSize = orig.multipartMaxRequestSize;
+ dto.name = orig.name;
+ dto.patterns = orig.patterns;
+ dto.serviceId = orig.serviceId;
+ dto.servletContextId = orig.servletContextId;
+ dto.servletInfo = orig.servletInfo;
+ return dto;
+ }
+ return null;
+ }
+}
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 9357f61..5d1191a 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,10 +36,10 @@ import org.apache.felix.http.base.internal.handler.ServletHandler;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
import org.apache.felix.http.base.internal.runtime.dto.BuilderConstants;
import org.apache.felix.http.base.internal.runtime.dto.ErrorPageDTOBuilder;
-import org.osgi.service.http.runtime.dto.DTOConstants;
-import org.osgi.service.http.runtime.dto.ErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedErrorPageDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
/**
* The error page registry keeps tracks of the active/inactive servlets handling
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/EventListenerRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/EventListenerRegistry.java
index 623c99c..38cae1a 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/EventListenerRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/EventListenerRegistry.java
@@ -38,9 +38,9 @@ import jakarta.servlet.http.HttpSessionListener;
import org.apache.felix.http.base.internal.handler.ListenerHandler;
import org.apache.felix.http.base.internal.logger.SystemLogger;
import org.apache.felix.http.base.internal.runtime.ListenerInfo;
-import org.osgi.service.http.runtime.dto.FailedListenerDTO;
-import org.osgi.service.http.runtime.dto.ListenerDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
/**
* Per context event listener registry.
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 13db6a8..34c4e1b 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
@@ -30,9 +30,9 @@ 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.dto.FilterDTOBuilder;
-import org.osgi.service.http.runtime.dto.FailedFilterDTO;
-import org.osgi.service.http.runtime.dto.FilterDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedFilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
/**
* The filter registry keeps track of all filter mappings for a single servlet context.
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/HandlerRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/HandlerRegistry.java
index 2230d43..77fdf91 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/HandlerRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/HandlerRegistry.java
@@ -30,7 +30,7 @@ import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
import org.apache.felix.http.base.internal.runtime.dto.FailedDTOHolder;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
/**
* Registry for all services.
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ListenerMap.java b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ListenerMap.java
index 3370b47..028c4f0 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ListenerMap.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/registry/ListenerMap.java
@@ -28,8 +28,8 @@ import org.jetbrains.annotations.NotNull;
import org.apache.felix.http.base.internal.handler.ListenerHandler;
import org.apache.felix.http.base.internal.runtime.ListenerInfo;
import org.apache.felix.http.base.internal.runtime.dto.ListenerDTOBuilder;
-import org.osgi.service.http.runtime.dto.FailedListenerDTO;
-import org.osgi.service.http.runtime.dto.ListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ListenerDTO;
public class ListenerMap<T extends EventListener> {
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 04cc9c6..038dbe4 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
@@ -30,7 +30,7 @@ import org.apache.felix.http.base.internal.runtime.dto.FailedDTOHolder;
import org.apache.felix.http.base.internal.service.HttpServiceFactory;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
/**
* This registry keeps track of all processing components per context:
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 ef40fa6..f03c135 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
@@ -35,12 +35,12 @@ import org.apache.felix.http.base.internal.runtime.dto.BuilderConstants;
import org.apache.felix.http.base.internal.runtime.dto.ResourceDTOBuilder;
import org.apache.felix.http.base.internal.runtime.dto.ServletDTOBuilder;
import org.jetbrains.annotations.NotNull;
-import org.osgi.service.http.runtime.dto.DTOConstants;
-import org.osgi.service.http.runtime.dto.FailedResourceDTO;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
-import org.osgi.service.http.runtime.dto.ResourceDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.runtime.dto.ServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletDTO;
/**
* The servlet registry keeps the mappings for all servlets (by using their pattern)
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java
index 95c2cb3..6292afb 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/AbstractInfo.java
@@ -28,7 +28,7 @@ import org.jetbrains.annotations.NotNull;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
/**
* Base class for all info objects.
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/FilterInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/FilterInfo.java
index 961c3eb..64930d0 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/FilterInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/FilterInfo.java
@@ -27,8 +27,8 @@ import org.apache.felix.http.base.internal.util.PatternUtil;
import org.jetbrains.annotations.NotNull;
import org.osgi.dto.DTO;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.runtime.dto.FilterDTO;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FilterDTO;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.Filter;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java
index 851e611..61c1bb7 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ListenerInfo.java
@@ -25,7 +25,7 @@ import java.util.Set;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.ServletContextAttributeListener;
import jakarta.servlet.ServletContextListener;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/PreprocessorInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/PreprocessorInfo.java
index 345d9ef..51b7e8f 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/PreprocessorInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/PreprocessorInfo.java
@@ -21,10 +21,10 @@ package org.apache.felix.http.base.internal.runtime;
import java.util.Map;
import org.apache.felix.http.base.internal.jakartawrappers.PreprocessorWrapper;
-import org.apache.felix.http.base.osgi.whiteboard.Preprocessor;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.Preprocessor;
/**
* Provides registration information for a {@link Preprocessor}.
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java
index 4522daa..ade8589 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ResourceInfo.java
@@ -21,7 +21,7 @@ package org.apache.felix.http.base.internal.runtime;
import org.apache.felix.http.base.internal.util.PatternUtil;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
/**
* Info object for a resource registration
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextHelperInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextHelperInfo.java
index 17d74de..46917fb 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextHelperInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletContextHelperInfo.java
@@ -23,10 +23,10 @@ import java.util.Map;
import org.apache.felix.http.base.internal.service.HttpServiceFactory;
import org.apache.felix.http.base.internal.util.PatternUtil;
-import org.apache.felix.http.base.osgi.whiteboard.ServletContextHelper;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.ServletContextHelper;
/**
* Provides registration information for a {@link ServletContextHelper}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletInfo.java
index f830ccd..1495016 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/ServletInfo.java
@@ -27,8 +27,8 @@ import org.apache.felix.http.base.internal.util.PatternUtil;
import org.jetbrains.annotations.NotNull;
import org.osgi.dto.DTO;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.runtime.dto.ServletDTO;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletDTO;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.Servlet;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/WhiteboardServiceInfo.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/WhiteboardServiceInfo.java
index 990b8dd..aff18d3 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/WhiteboardServiceInfo.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/WhiteboardServiceInfo.java
@@ -24,7 +24,7 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
/**
* Base class for all info objects.
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BaseServletDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BaseServletDTOBuilder.java
index e107b5c..717cadd 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BaseServletDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BaseServletDTOBuilder.java
@@ -20,7 +20,7 @@ package org.apache.felix.http.base.internal.runtime.dto;
import org.apache.felix.http.base.internal.handler.ServletHandler;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
-import org.osgi.service.http.runtime.dto.BaseServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.BaseServletDTO;
abstract class BaseServletDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BuilderConstants.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BuilderConstants.java
index 708477e..336061d 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BuilderConstants.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/BuilderConstants.java
@@ -20,18 +20,18 @@ package org.apache.felix.http.base.internal.runtime.dto;
import static java.util.Arrays.copyOf;
-import org.osgi.service.http.runtime.dto.ErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedFilterDTO;
-import org.osgi.service.http.runtime.dto.FailedListenerDTO;
-import org.osgi.service.http.runtime.dto.FailedResourceDTO;
-import org.osgi.service.http.runtime.dto.FailedServletContextDTO;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
-import org.osgi.service.http.runtime.dto.FilterDTO;
-import org.osgi.service.http.runtime.dto.ListenerDTO;
-import org.osgi.service.http.runtime.dto.ResourceDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.runtime.dto.ServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedFilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletDTO;
public abstract class BuilderConstants
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ErrorPageDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ErrorPageDTOBuilder.java
index c3578e7..d09bf92 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ErrorPageDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ErrorPageDTOBuilder.java
@@ -20,8 +20,8 @@ package org.apache.felix.http.base.internal.runtime.dto;
import org.apache.felix.http.base.internal.handler.ServletHandler;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
-import org.osgi.service.http.runtime.dto.ErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedErrorPageDTO;
public final class ErrorPageDTOBuilder extends BaseServletDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FailedDTOHolder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FailedDTOHolder.java
index 14ce4c5..a61fe93 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FailedDTOHolder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FailedDTOHolder.java
@@ -30,13 +30,13 @@ import org.apache.felix.http.base.internal.runtime.PreprocessorInfo;
import org.apache.felix.http.base.internal.runtime.ResourceInfo;
import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
-import org.osgi.service.http.runtime.dto.FailedErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedFilterDTO;
-import org.osgi.service.http.runtime.dto.FailedListenerDTO;
-import org.osgi.service.http.runtime.dto.FailedPreprocessorDTO;
-import org.osgi.service.http.runtime.dto.FailedResourceDTO;
-import org.osgi.service.http.runtime.dto.FailedServletContextDTO;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedFilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedPreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
public final class FailedDTOHolder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FilterDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FilterDTOBuilder.java
index 4b378e8..995d73c 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FilterDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/FilterDTOBuilder.java
@@ -23,8 +23,8 @@ import jakarta.servlet.DispatcherType;
import org.apache.felix.http.base.internal.handler.FilterHandler;
import org.apache.felix.http.base.internal.runtime.FilterInfo;
-import org.osgi.service.http.runtime.dto.FailedFilterDTO;
-import org.osgi.service.http.runtime.dto.FilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedFilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FilterDTO;
public final class FilterDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ListenerDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ListenerDTOBuilder.java
index bf6118c..2e38ca6 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ListenerDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ListenerDTOBuilder.java
@@ -22,8 +22,8 @@ import java.util.Arrays;
import org.apache.felix.http.base.internal.handler.ListenerHandler;
import org.apache.felix.http.base.internal.runtime.ListenerInfo;
-import org.osgi.service.http.runtime.dto.FailedListenerDTO;
-import org.osgi.service.http.runtime.dto.ListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ListenerDTO;
public final class ListenerDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/PreprocessorDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/PreprocessorDTOBuilder.java
index 97a2f67..20eaa25 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/PreprocessorDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/PreprocessorDTOBuilder.java
@@ -21,8 +21,8 @@ package org.apache.felix.http.base.internal.runtime.dto;
import org.jetbrains.annotations.NotNull;
import org.apache.felix.http.base.internal.runtime.PreprocessorInfo;
-import org.osgi.service.http.runtime.dto.FailedPreprocessorDTO;
-import org.osgi.service.http.runtime.dto.PreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedPreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.PreprocessorDTO;
public final class PreprocessorDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RegistryRuntime.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RegistryRuntime.java
index 91537ee..6ced2f7 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RegistryRuntime.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RegistryRuntime.java
@@ -20,8 +20,8 @@ package org.apache.felix.http.base.internal.runtime.dto;
import java.util.Collection;
-import org.osgi.service.http.runtime.dto.PreprocessorDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.PreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
public final class RegistryRuntime
{
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 a4b12c4..88ef766 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
@@ -21,8 +21,8 @@ import jakarta.servlet.DispatcherType;
import org.apache.felix.http.base.internal.handler.FilterHandler;
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;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RequestInfoDTO;
public final class RequestInfoDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ResourceDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ResourceDTOBuilder.java
index 5f53cc9..a2ff313 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ResourceDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ResourceDTOBuilder.java
@@ -21,8 +21,8 @@ package org.apache.felix.http.base.internal.runtime.dto;
import org.apache.felix.http.base.internal.handler.ServletHandler;
import org.apache.felix.http.base.internal.runtime.ResourceInfo;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
-import org.osgi.service.http.runtime.dto.FailedResourceDTO;
-import org.osgi.service.http.runtime.dto.ResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ResourceDTO;
public final class ResourceDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilder.java
index d99e3ac..c173715 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/RuntimeDTOBuilder.java
@@ -21,16 +21,16 @@ package org.apache.felix.http.base.internal.runtime.dto;
import java.util.Collection;
import org.osgi.framework.dto.ServiceReferenceDTO;
-import org.osgi.service.http.runtime.dto.FailedErrorPageDTO;
-import org.osgi.service.http.runtime.dto.FailedFilterDTO;
-import org.osgi.service.http.runtime.dto.FailedListenerDTO;
-import org.osgi.service.http.runtime.dto.FailedPreprocessorDTO;
-import org.osgi.service.http.runtime.dto.FailedResourceDTO;
-import org.osgi.service.http.runtime.dto.FailedServletContextDTO;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
-import org.osgi.service.http.runtime.dto.PreprocessorDTO;
-import org.osgi.service.http.runtime.dto.RuntimeDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedErrorPageDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedFilterDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedListenerDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedPreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedResourceDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.PreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RuntimeDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
public final class RuntimeDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java
index c10ed5e..8a14d32 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletContextDTOBuilder.java
@@ -28,8 +28,8 @@ import jakarta.servlet.ServletContext;
import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
import org.osgi.dto.DTO;
-import org.osgi.service.http.runtime.dto.FailedServletContextDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
public final class ServletContextDTOBuilder
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletDTOBuilder.java b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletDTOBuilder.java
index b9575d4..6811739 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletDTOBuilder.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/runtime/dto/ServletDTOBuilder.java
@@ -21,8 +21,8 @@ package org.apache.felix.http.base.internal.runtime.dto;
import org.apache.felix.http.base.internal.dispatch.MultipartConfig;
import org.apache.felix.http.base.internal.handler.ServletHandler;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
-import org.osgi.service.http.runtime.dto.ServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletDTO;
public final class ServletDTOBuilder extends BaseServletDTOBuilder
{
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 c7ae1a5..1178d12 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
@@ -26,7 +26,7 @@ import org.osgi.framework.Constants;
import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.http.HttpService;
-import org.osgi.service.http.runtime.HttpServiceRuntimeConstants;
+import org.osgi.service.servlet.whiteboard.runtime.HttpServiceRuntimeConstants;
import jakarta.servlet.ServletContext;
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 bc822f5..d794f73 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
@@ -24,18 +24,18 @@ import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicLong;
+import org.apache.felix.http.base.internal.javaxwrappers.RuntimeServiceWrapper;
import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.runtime.dto.RequestInfoDTOBuilder;
import org.apache.felix.http.base.internal.runtime.dto.RuntimeDTOBuilder;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.dto.ServiceReferenceDTO;
-import org.osgi.service.http.runtime.HttpServiceRuntime;
-import org.osgi.service.http.runtime.dto.RequestInfoDTO;
-import org.osgi.service.http.runtime.dto.RuntimeDTO;
+import org.osgi.service.servlet.whiteboard.runtime.HttpServiceRuntime;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RequestInfoDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RuntimeDTO;
public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
{
@@ -55,7 +55,7 @@ public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
private volatile ServiceRegistration<HttpServiceRuntime> serviceReg;
- private volatile ServiceReferenceDTO serviceRefDTO;
+ private volatile ServiceRegistration<org.osgi.service.http.runtime.HttpServiceRuntime> javaxServiceReg;
private final AtomicLong changeCount = new AtomicLong();
@@ -94,31 +94,11 @@ public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
@Override
public RuntimeDTO getRuntimeDTO()
{
- if ( this.serviceRefDTO == null )
- {
- // it might happen that this code is executed in several threads
- // but that's very unlikely and even if, fetching the service
- // reference several times is not a big deal
- final ServiceRegistration<HttpServiceRuntime> reg = this.serviceReg;
- if ( reg != null )
- {
- final long id = (long) reg.getReference().getProperty(Constants.SERVICE_ID);
- final ServiceReferenceDTO[] dtos = reg.getReference().getBundle().adapt(ServiceReferenceDTO[].class);
- for(final ServiceReferenceDTO dto : dtos)
- {
- if ( dto.id == id)
- {
- this.serviceRefDTO = dto;
- break;
- }
- }
-
- }
- }
- if ( this.serviceRefDTO != null )
+ final ServiceRegistration<HttpServiceRuntime> reg = this.serviceReg;
+ if ( reg != null )
{
final RuntimeDTOBuilder runtimeDTOBuilder = new RuntimeDTOBuilder(contextManager.getRuntimeInfo(),
- this.serviceRefDTO);
+ reg.getReference().adapt(ServiceReferenceDTO.class));
return runtimeDTOBuilder.build();
}
throw new IllegalStateException("Service is already unregistered");
@@ -153,6 +133,10 @@ public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
this.serviceReg = bundleContext.registerService(HttpServiceRuntime.class,
this,
attributes);
+ final RuntimeServiceWrapper wrapper = new RuntimeServiceWrapper(this);
+ this.javaxServiceReg = bundleContext.registerService(org.osgi.service.http.runtime.HttpServiceRuntime.class,
+ wrapper, attributes);
+ wrapper.setServiceReference(this.javaxServiceReg.getReference());
}
public void unregister()
@@ -169,7 +153,18 @@ public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
}
this.serviceReg = null;
}
- this.serviceRefDTO = null;
+ if ( this.javaxServiceReg != null )
+ {
+ try
+ {
+ this.javaxServiceReg.unregister();
+ }
+ catch ( final IllegalStateException ise)
+ {
+ // we just ignore it
+ }
+ this.javaxServiceReg = null;
+ }
}
public ServiceReference<HttpServiceRuntime> getServiceReference()
@@ -185,6 +180,7 @@ public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
public void updateChangeCount()
{
final ServiceRegistration<HttpServiceRuntime> reg = this.serviceReg;
+ final ServiceRegistration<org.osgi.service.http.runtime.HttpServiceRuntime> javaxReg = this.javaxServiceReg;
if ( reg != null )
{
final long count = this.changeCount.incrementAndGet();
@@ -200,6 +196,17 @@ public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
{
// we ignore this as this might happen on shutdown
}
+ if ( javaxReg != null )
+ {
+ try
+ {
+ javaxReg.setProperties(attributes);
+ }
+ catch ( final IllegalStateException ise)
+ {
+ // we ignore this as this might happen on shutdown
+ }
+ }
}
else
{
@@ -236,6 +243,17 @@ public final class HttpServiceRuntimeImpl implements HttpServiceRuntime
changeCountTimer = null;
}
}
+ if ( javaxReg != null )
+ {
+ try
+ {
+ javaxReg.setProperties(attributes);
+ }
+ catch ( final IllegalStateException ise)
+ {
+ // we ignore this as this might happen on shutdown
+ }
+ }
}
}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandler.java
index b3c306f..3456767 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandler.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandler.java
@@ -16,12 +16,12 @@
*/
package org.apache.felix.http.base.internal.whiteboard;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_SERVICE_NOT_GETTABLE;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_SERVLET_CONTEXT_FAILURE;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_UNKNOWN;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_VALIDATION_FAILED;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_SERVICE_NOT_GETTABLE;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_SERVLET_CONTEXT_FAILURE;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_UNKNOWN;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_VALIDATION_FAILED;
import java.util.HashSet;
import java.util.Iterator;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
index de76249..c9545d5 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
@@ -28,9 +28,9 @@ import org.apache.felix.http.base.internal.HttpConfig;
import org.apache.felix.http.base.internal.context.ExtServletContext;
import org.apache.felix.http.base.internal.registry.PerContextHandlerRegistry;
import org.apache.felix.http.base.internal.util.MimeTypes;
-import org.apache.felix.http.base.osgi.whiteboard.ServletContextHelper;
import org.osgi.framework.Bundle;
import org.osgi.framework.wiring.BundleWiring;
+import org.osgi.service.servlet.whiteboard.ServletContextHelper;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterRegistration;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardContextHandler.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardContextHandler.java
index 1502ab0..4938678 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardContextHandler.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/WhiteboardContextHandler.java
@@ -23,11 +23,11 @@ import org.apache.felix.http.base.internal.context.ExtServletContext;
import org.apache.felix.http.base.internal.registry.HandlerRegistry;
import org.apache.felix.http.base.internal.registry.PerContextHandlerRegistry;
import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
-import org.apache.felix.http.base.osgi.whiteboard.ServletContextHelper;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
+import org.osgi.service.servlet.whiteboard.ServletContextHelper;
import jakarta.servlet.ServletContext;
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 75d6771..f565870 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
@@ -16,10 +16,10 @@
*/
package org.apache.felix.http.base.internal.whiteboard;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_UNKNOWN;
-import static org.osgi.service.http.runtime.dto.DTOConstants.FAILURE_REASON_VALIDATION_FAILED;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_UNKNOWN;
+import static org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants.FAILURE_REASON_VALIDATION_FAILED;
import java.io.IOException;
import java.util.ArrayList;
@@ -66,8 +66,6 @@ import org.apache.felix.http.base.internal.whiteboard.tracker.JavaxServletContex
import org.apache.felix.http.base.internal.whiteboard.tracker.JavaxServletTracker;
import org.apache.felix.http.base.internal.whiteboard.tracker.ResourceTracker;
import org.apache.felix.http.base.internal.whiteboard.tracker.ServletContextHelperTracker;
-import org.apache.felix.http.base.osgi.whiteboard.Preprocessor;
-import org.apache.felix.http.base.osgi.whiteboard.ServletContextHelper;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -77,11 +75,13 @@ import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceFactory;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.http.runtime.HttpServiceRuntimeConstants;
-import org.osgi.service.http.runtime.dto.DTOConstants;
-import org.osgi.service.http.runtime.dto.PreprocessorDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.runtime.HttpServiceRuntimeConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.PreprocessorDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.Preprocessor;
+import org.osgi.service.servlet.whiteboard.ServletContextHelper;
import org.osgi.util.tracker.ServiceTracker;
import jakarta.servlet.FilterChain;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/FilterTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/FilterTracker.java
index 0b73c8b..3ecb2a7 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/FilterTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/FilterTracker.java
@@ -21,7 +21,7 @@ import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.Filter;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxPreprocessorTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxPreprocessorTracker.java
index 293241d..1f3f7ec 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxPreprocessorTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxPreprocessorTracker.java
@@ -21,9 +21,9 @@ import org.apache.felix.http.base.internal.runtime.PreprocessorInfo;
import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo;
import org.apache.felix.http.base.internal.util.ServiceUtils;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
-import org.apache.felix.http.base.osgi.whiteboard.Preprocessor;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.osgi.service.servlet.whiteboard.Preprocessor;
public final class JavaxPreprocessorTracker extends WhiteboardServiceTracker<Preprocessor>
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxServletContextHelperTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxServletContextHelperTracker.java
index ffd5da3..c5f7c7d 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxServletContextHelperTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/JavaxServletContextHelperTracker.java
@@ -23,12 +23,12 @@ import org.apache.felix.http.base.internal.jakartawrappers.ServletContextHelperW
import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
import org.apache.felix.http.base.internal.util.ServiceUtils;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
-import org.apache.felix.http.base.osgi.whiteboard.ServletContextHelper;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
+import org.osgi.service.servlet.whiteboard.ServletContextHelper;
import org.osgi.util.tracker.ServiceTracker;
/**
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ListenersTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ListenersTracker.java
index 6ac04ee..153f466 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ListenersTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ListenersTracker.java
@@ -23,7 +23,7 @@ import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.ServletContextAttributeListener;
import jakarta.servlet.ServletContextListener;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/PreprocessorTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/PreprocessorTracker.java
index ddbd094..3f63153 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/PreprocessorTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/PreprocessorTracker.java
@@ -19,9 +19,9 @@ package org.apache.felix.http.base.internal.whiteboard.tracker;
import org.apache.felix.http.base.internal.runtime.PreprocessorInfo;
import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
-import org.apache.felix.http.base.osgi.whiteboard.Preprocessor;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
+import org.osgi.service.servlet.whiteboard.Preprocessor;
public final class PreprocessorTracker extends WhiteboardServiceTracker<Preprocessor>
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ResourceTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ResourceTracker.java
index e902d06..95950b9 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ResourceTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ResourceTracker.java
@@ -21,7 +21,7 @@ import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
public final class ResourceTracker extends WhiteboardServiceTracker<Object>
{
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletContextHelperTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletContextHelperTracker.java
index 93f7665..339ac46 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletContextHelperTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletContextHelperTracker.java
@@ -21,12 +21,12 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.felix.http.base.internal.runtime.ServletContextHelperInfo;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
-import org.apache.felix.http.base.osgi.whiteboard.ServletContextHelper;
import org.jetbrains.annotations.NotNull;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
+import org.osgi.service.servlet.whiteboard.ServletContextHelper;
import org.osgi.util.tracker.ServiceTracker;
/**
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletTracker.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletTracker.java
index 0dccd55..d3c5b2b 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletTracker.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/tracker/ServletTracker.java
@@ -21,7 +21,7 @@ import org.apache.felix.http.base.internal.runtime.WhiteboardServiceInfo;
import org.apache.felix.http.base.internal.whiteboard.WhiteboardManager;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.Servlet;
diff --git a/http/base/src/main/java/org/apache/felix/http/base/osgi/whiteboard/Preprocessor.java b/http/base/src/main/java/org/apache/felix/http/base/osgi/whiteboard/Preprocessor.java
deleted file mode 100644
index 1a74c22..0000000
--- a/http/base/src/main/java/org/apache/felix/http/base/osgi/whiteboard/Preprocessor.java
+++ /dev/null
@@ -1,31 +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.osgi.whiteboard;
-
-import org.osgi.annotation.versioning.ConsumerType;
-
-import jakarta.servlet.Filter;
-
-/**
- * THIS IS NOT AN OFFICIAL OSGi API - IT HAS BEEN CREATED TO EVALUATE
- * DIFFERENT APPROACHES FOR A FUTURE OSGI SPECIFICATION
- */
-@ConsumerType
-public interface Preprocessor extends Filter {
-
- // this interface is a marker interface
-}
diff --git a/http/base/src/main/java/org/apache/felix/http/base/osgi/whiteboard/ServletContextHelper.java b/http/base/src/main/java/org/apache/felix/http/base/osgi/whiteboard/ServletContextHelper.java
deleted file mode 100644
index 86c8386..0000000
--- a/http/base/src/main/java/org/apache/felix/http/base/osgi/whiteboard/ServletContextHelper.java
+++ /dev/null
@@ -1,97 +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.osgi.whiteboard;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.osgi.annotation.versioning.ConsumerType;
-import org.osgi.framework.Bundle;
-
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
-/**
- * THIS IS NOT AN OFFICIAL OSGi API - IT HAS BEEN CREATED TO EVALUATE
- * DIFFERENT APPROACHES FOR A FUTURE OSGI SPECIFICATION
- */
-@ConsumerType
-public abstract class ServletContextHelper {
-
- public static final String REMOTE_USER = "org.osgi.service.http.authentication.remote.user";
-
- public static final String AUTHENTICATION_TYPE = "org.osgi.service.http.authentication.type";
-
- public static final String AUTHORIZATION = "org.osgi.service.useradmin.authorization";
-
- private final Bundle bundle;
-
- public ServletContextHelper() {
- this(null);
- }
-
- public ServletContextHelper(final Bundle bundle) {
- this.bundle = bundle;
- }
-
- public boolean handleSecurity(final HttpServletRequest request,
- final HttpServletResponse response)
- throws IOException {
- return true;
- }
-
- public void finishSecurity(final HttpServletRequest request,
- final HttpServletResponse response) {
- // do nothing
- }
-
- public URL getResource(String name) {
- if ((name != null) && (bundle != null)) {
- if (name.startsWith("/")) {
- name = name.substring(1);
- }
-
- return bundle.getEntry(name);
- }
- return null;
- }
-
- public String getMimeType(final String name) {
- return null;
- }
-
- public Set<String> getResourcePaths(final String path) {
- if ((path != null) && (bundle != null)) {
- final Enumeration<URL> e = bundle.findEntries(path, null, false);
- if (e != null) {
- final Set<String> result = new LinkedHashSet<String>();
- while (e.hasMoreElements()) {
- result.add(e.nextElement().getPath());
- }
- return result;
- }
- }
- return null;
- }
-
- public String getRealPath(final String path) {
- return null;
- }
-}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/HttpWhiteboardConstants.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/HttpWhiteboardConstants.java
new file mode 100644
index 0000000..9f99b40
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/HttpWhiteboardConstants.java
@@ -0,0 +1,597 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard;
+
+import jakarta.servlet.Servlet;
+
+import org.osgi.framework.Filter;
+
+/**
+ * Defines standard constants for the Http Whiteboard services.
+ *
+ * @author $Id: 42ca5b7dedd1df3b0c97199d1ee35b89a546e5a8 $
+ */
+public final class HttpWhiteboardConstants {
+ private HttpWhiteboardConstants() {
+ // non-instantiable
+ }
+
+ /**
+ * Service property specifying the name of an {@link ServletContextHelper}
+ * service.
+ *
+ * <p>
+ * For {@link ServletContextHelper} services, this service property must be
+ * specified. Context services without this service property are ignored.
+ *
+ * <p>
+ * Servlet, listener, servlet filter, and resource services might refer to a
+ * specific {@link ServletContextHelper} service referencing the name with
+ * the {@link #HTTP_WHITEBOARD_CONTEXT_SELECT} property.
+ *
+ * <p>
+ * For {@link ServletContextHelper} services, the value of this service
+ * property must be of type {@code String}. The value must follow the
+ * "symbolic-name" specification from Section 1.3.2 of the OSGi Core
+ * Specification.
+ *
+ * @see #HTTP_WHITEBOARD_CONTEXT_PATH
+ * @see #HTTP_WHITEBOARD_CONTEXT_SELECT
+ * @see #HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME
+ */
+ public static final String HTTP_WHITEBOARD_CONTEXT_NAME = "osgi.http.whiteboard.context.name";
+
+ /**
+ * The name of the default {@link ServletContextHelper}. If a service is
+ * registered with this property, it is overriding the default context with
+ * a custom provided context.
+ *
+ * @see #HTTP_WHITEBOARD_CONTEXT_NAME
+ */
+ public static final String HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME = "default";
+
+ /**
+ * Service property specifying the path of an {@link ServletContextHelper}
+ * service.
+ *
+ * <p>
+ * For {@link ServletContextHelper} services this service property is
+ * required. Context services without this service property are ignored.
+ *
+ * <p>
+ * This property defines a context path under which all whiteboard services
+ * associated with this context are registered. Having different contexts
+ * with different paths allows to separate the URL space.
+ *
+ * <p>
+ * For {@link ServletContextHelper} services, the value of this service
+ * property must be of type {@code String}. The value is either a slash for
+ * the root or it must start with a slash but not end with a slash. Valid
+ * characters are defined in rfc3986#section-3.3. Contexts with an invalid
+ * path are ignored.
+ *
+ * @see #HTTP_WHITEBOARD_CONTEXT_NAME
+ * @see #HTTP_WHITEBOARD_CONTEXT_SELECT
+ */
+ public static final String HTTP_WHITEBOARD_CONTEXT_PATH = "osgi.http.whiteboard.context.path";
+
+ /**
+ * Service property prefix referencing a {@link ServletContextHelper}
+ * service.
+ *
+ * <p>
+ * For {@link ServletContextHelper} services this prefix can be used for
+ * service properties to mark them as initialization parameters which can be
+ * retrieved from the associated servlet context. The prefix is removed from
+ * the service property name to build the initialization parameter name.
+ *
+ * <p>
+ * For {@link ServletContextHelper} services, the value of each
+ * initialization parameter service property must be of type {@code String}.
+ *
+ */
+ public static final String HTTP_WHITEBOARD_CONTEXT_INIT_PARAM_PREFIX = "context.init.";
+
+ /**
+ * Service property referencing a {@link ServletContextHelper} service.
+ *
+ * <p>
+ * For servlet, listener, servlet filter, or resource services, this service
+ * property refers to the associated {@code ServletContextHelper} service.
+ * The value of this property is a filter expression which is matched
+ * against the service registration properties of the
+ * {@code ServletContextHelper} service. If this service property is not
+ * specified, the default context is used. If there is no context service
+ * matching, the servlet, listener, servlet filter, or resource service is
+ * ignored.
+ * <p>
+ * For example, if a whiteboard service wants to select a servlet context
+ * helper with the name "Admin" the expression would be
+ * "(osgi.http.whiteboard.context.name=Admin)". Selecting all
+ * contexts could be done with
+ * "(osgi.http.whiteboard.context.name=*)".
+ * <p>
+ * For servlet, listener, servlet filter, or resource services, the value of
+ * this service property must be of type {@code String}.
+ *
+ * @see #HTTP_WHITEBOARD_CONTEXT_NAME
+ * @see #HTTP_WHITEBOARD_CONTEXT_PATH
+ */
+ public static final String HTTP_WHITEBOARD_CONTEXT_SELECT = "osgi.http.whiteboard.context.select";
+
+ /**
+ * Service property specifying the servlet name of a {@code Servlet}
+ * service.
+ * <p>
+ * The servlet is registered with this name and the name can be used as a
+ * reference to the servlet for filtering or request dispatching.
+ * <p>
+ * This name is in addition used as the value for the
+ * {@code ServletConfig.getServletName()} method. If this service property
+ * is not specified, the fully qualified name of the service object's class
+ * is used as the servlet name. Filter services may refer to servlets by
+ * this name in their {@link #HTTP_WHITEBOARD_FILTER_SERVLET} service
+ * property to apply the filter to the servlet.
+ * <p>
+ * Servlet names should be unique among all servlet services associated with
+ * a single {@link ServletContextHelper}.
+ * <p>
+ * The value of this service property must be of type {@code String}.
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_NAME = "osgi.http.whiteboard.servlet.name";
+
+ /**
+ * Service property specifying the request mappings for a {@code Servlet}
+ * service.
+ * <p>
+ * The specified patterns are used to determine whether a request should be
+ * mapped to the servlet. Servlet services without this service property,
+ * {@link #HTTP_WHITEBOARD_SERVLET_ERROR_PAGE} or
+ * {@link #HTTP_WHITEBOARD_SERVLET_NAME} are ignored.
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings"
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_PATTERN = "osgi.http.whiteboard.servlet.pattern";
+
+ /**
+ * Service property specifying whether a {@code Servlet} service acts as an
+ * error page.
+ *
+ * <p>
+ * The service property values may be the name of a fully qualified
+ * exception class, a three digit HTTP status code, the value "4xx" for all
+ * error codes in the 400 range, or the value "5xx" for all error codes in
+ * the 500 range. Any value that is not a three digit number, or one of the
+ * two special values is considered to be the name of a fully qualified
+ * exception class.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_ERROR_PAGE = "osgi.http.whiteboard.servlet.errorPage";
+
+ /**
+ * Service property specifying whether a {@code Servlet} service supports
+ * asynchronous processing.
+ *
+ * <p>
+ * By default servlet services do not support asynchronous processing.
+ *
+ * <p>
+ * The value of this service property must be of type {@code Boolean}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 2.3.3.3 Asynchronous Processing"
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_ASYNC_SUPPORTED = "osgi.http.whiteboard.servlet.asyncSupported";
+
+ /**
+ * Service property prefix referencing a {@link Servlet} service.
+ *
+ * <p>
+ * For {@link Servlet} services this prefix can be used for service
+ * properties to mark them as initialization parameters which can be
+ * retrieved from the associated servlet config. The prefix is removed from
+ * the service property name to build the initialization parameter name.
+ *
+ * <p>
+ * For {@link Servlet} services, the value of each initialization parameter
+ * service property must be of type {@code String}.
+ *
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX = "servlet.init.";
+
+ /**
+ * Service property specifying whether a {@code Servlet} service has enabled
+ * multipart request processing.
+ * <p>
+ * By default servlet services do not have multipart request processing
+ * enabled.
+ * <p>
+ * The value of this service property must be of type {@code Boolean}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 8.1.5 @MultipartConfig"
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED = "osgi.http.whiteboard.servlet.multipart.enabled";
+
+ /**
+ * Service property specifying the size threshold after which the file will
+ * be written to disk.
+ * <p>
+ * When not set or when the value is not valid, the default threshold is
+ * determined by the implementation. This property is only evaluated if
+ * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true}
+ * .
+ * <p>
+ * The value of this service property must be of type {@code Integer}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram"
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_FILESIZETHRESHOLD = "osgi.http.whiteboard.servlet.multipart.fileSizeThreshold";
+
+ /**
+ * Service property specifying the location where the files can be stored on
+ * disk.
+ * <p>
+ * When not set the default location is defined by the value of the system
+ * property "java.io.tmpdir". This property is only evaluated if
+ * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true}
+ * .
+ * <p>
+ * The value of this service property must be of type {@code String}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram"
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_LOCATION = "osgi.http.whiteboard.servlet.multipart.location";
+
+ /**
+ * Service property specifying the maximum size of a file being uploaded.
+ * <p>
+ * When not set or when the value is not valid, the default maximum size is
+ * [@code -1} (no maximum size). This property is only evaluated if
+ * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true}
+ * .
+ * <p>
+ * The value of this service property must be of type {@code Long}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram"
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_MAXFILESIZE = "osgi.http.whiteboard.servlet.multipart.maxFileSize";
+
+ /**
+ * Service property specifying the maximum request size.
+ * <p>
+ * When not set or when the value is not valid, the default maximum request
+ * size is {@code -1} (no maximum size). This property is only evaluated if
+ * {@link #HTTP_WHITEBOARD_SERVLET_MULTIPART_ENABLED} is set to {@code true}
+ * .
+ * <p>
+ * The value of this service property must be of type {@code Long}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 14.4 Deployment Descriptor Diagram"
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_SERVLET_MULTIPART_MAXREQUESTSIZE = "osgi.http.whiteboard.servlet.multipart.maxRequestSize";
+
+ /**
+ * Service property specifying the servlet filter name of a {@code Filter}
+ * service.
+ *
+ * <p>
+ * This name is used as the value for the
+ * {@code FilterConfig.getFilterName()} method. If this service property is
+ * not specified, the fully qualified name of the service object's class is
+ * used as the servlet filter name.
+ *
+ * <p>
+ * Servlet filter names should be unique among all servlet filter services
+ * associated with a single {@link ServletContextHelper}.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String}.
+ */
+ public static final String HTTP_WHITEBOARD_FILTER_NAME = "osgi.http.whiteboard.filter.name";
+
+ /**
+ * Service property specifying the request mappings for a {@code Filter}
+ * service.
+ *
+ * <p>
+ * The specified patterns are used to determine whether a request should be
+ * mapped to the servlet filter. Filter services without this service
+ * property or the {@link #HTTP_WHITEBOARD_FILTER_SERVLET} or the
+ * {@link #HTTP_WHITEBOARD_FILTER_REGEX} service property are ignored.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings"
+ */
+ public static final String HTTP_WHITEBOARD_FILTER_PATTERN = "osgi.http.whiteboard.filter.pattern";
+
+ /**
+ * Service property specifying the {@link #HTTP_WHITEBOARD_SERVLET_NAME
+ * servlet names} for a servlet {@code Filter} service.
+ *
+ * <p>
+ * The specified names are used to determine the servlets whose requests
+ * should be mapped to the servlet filter. Servlet filter services without
+ * this service property or the {@link #HTTP_WHITEBOARD_FILTER_PATTERN} or
+ * the {@link #HTTP_WHITEBOARD_FILTER_REGEX} service property are ignored.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ */
+ public static final String HTTP_WHITEBOARD_FILTER_SERVLET = "osgi.http.whiteboard.filter.servlet";
+
+ /**
+ * Service property specifying the request mappings for a servlet
+ * {@code Filter} service.
+ *
+ * <p>
+ * The specified regular expressions are used to determine whether a request
+ * should be mapped to the servlet filter. The regular expressions must
+ * follow the syntax defined in {@code java.util.regex.Pattern}. Servlet
+ * filter services without this service property or the
+ * {@link #HTTP_WHITEBOARD_FILTER_SERVLET} or the
+ * {@link #HTTP_WHITEBOARD_FILTER_PATTERN} service property are ignored.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ *
+ * @see "java.util.regex.Pattern"
+ */
+ public static final String HTTP_WHITEBOARD_FILTER_REGEX = "osgi.http.whiteboard.filter.regex";
+
+ /**
+ * Service property specifying whether a servlet {@code Filter} service
+ * supports asynchronous processing.
+ *
+ * <p>
+ * By default servlet filters services do not support asynchronous
+ * processing.
+ *
+ * <p>
+ * The value of this service property must be of type {@code Boolean}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 2.3.3.3 Asynchronous Processing"
+ */
+ public static final String HTTP_WHITEBOARD_FILTER_ASYNC_SUPPORTED = "osgi.http.whiteboard.filter.asyncSupported";
+
+ /**
+ * Service property specifying the dispatcher handling of a servlet
+ * {@code Filter}.
+ *
+ * <p>
+ * By default servlet filter services are associated with client requests
+ * only (see value {@link #DISPATCHER_REQUEST}).
+ *
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}. Allowed values are
+ * {@link #DISPATCHER_ASYNC}, {@link #DISPATCHER_ERROR},
+ * {@link #DISPATCHER_FORWARD}, {@link #DISPATCHER_INCLUDE},
+ * {@link #DISPATCHER_REQUEST}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
+ */
+ public static final String HTTP_WHITEBOARD_FILTER_DISPATCHER = "osgi.http.whiteboard.filter.dispatcher";
+
+ /**
+ * Service property prefix referencing a {@link Filter} service.
+ *
+ * <p>
+ * For {@link Filter} services this prefix can be used for service
+ * properties to mark them as initialization parameters which can be
+ * retrieved from the associated filter config. The prefix is removed from
+ * the service property name to build the initialization parameter name.
+ *
+ * <p>
+ * For {@link Filter} services, the value of each initialization parameter
+ * service property must be of type {@code String}.
+ *
+ */
+ public static final String HTTP_WHITEBOARD_FILTER_INIT_PARAM_PREFIX = "filter.init.";
+
+ /**
+ * Service property prefix referencing a {@link Preprocessor} service.
+ * <p>
+ * For {@link Preprocessor} services this prefix can be used for service
+ * properties to mark them as initialization parameters which can be
+ * retrieved from the associated filter configuration. The prefix is removed
+ * from the service property name to build the initialization parameter
+ * name.
+ * <p>
+ * For {@link Preprocessor} services, the value of each initialization
+ * parameter service property must be of type {@code String}.
+ *
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_PREPROCESSOR_INIT_PARAM_PREFIX = "preprocessor.init.";
+
+ /**
+ * Service property to mark a Listener service as a Whiteboard service.
+ * Listener services with this property set to the string value "true" will
+ * be treated as Whiteboard services opting in to being handled by the Http
+ * Whiteboard implementation. If the value "false" is specified, the service
+ * is opting out and this case is treated exactly the same as if this
+ * property is missing. If an invalid value is specified this is treated as
+ * a failure.
+ * <p>
+ * The value of this service property must be of type {@code String}. Valid
+ * values are "true" and "false" ignoring case.
+ */
+ public static final String HTTP_WHITEBOARD_LISTENER = "osgi.http.whiteboard.listener";
+
+ /**
+ * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
+ * property indicating the servlet filter is applied to client requests.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
+ */
+ public static final String DISPATCHER_REQUEST = "REQUEST";
+
+ /**
+ * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
+ * property indicating the servlet filter is applied to include calls to the
+ * dispatcher.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
+ */
+ public static final String DISPATCHER_INCLUDE = "INCLUDE";
+
+ /**
+ * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
+ * property indicating the servlet filter is applied to forward calls to the
+ * dispatcher.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
+ */
+ public static final String DISPATCHER_FORWARD = "FORWARD";
+
+ /**
+ * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
+ * property indicating the servlet filter is applied in the asynchronous
+ * context.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
+ */
+ public static final String DISPATCHER_ASYNC = "ASYNC";
+
+ /**
+ * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
+ * property indicating the servlet filter is applied when an error page is
+ * called.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
+ */
+ public static final String DISPATCHER_ERROR = "ERROR";
+
+ /**
+ * Service property specifying the request mappings for resources.
+ *
+ * <p>
+ * The specified patterns are used to determine whether a request should be
+ * mapped to resources. Resource services without this service property are
+ * ignored.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ *
+ * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings"
+ * @see #HTTP_WHITEBOARD_RESOURCE_PREFIX
+ */
+ public static final String HTTP_WHITEBOARD_RESOURCE_PATTERN = "osgi.http.whiteboard.resource.pattern";
+
+ /**
+ * Service property specifying the resource entry prefix for a resource
+ * service.
+ *
+ * <p>
+ * If a resource service is registered with this property, requests are
+ * served with bundle resources.
+ *
+ * <p>
+ * This prefix is used to map a requested resource to the bundle's entries.
+ * The value must not end with slash ("/") with the exception that
+ * a name of the form "/" is used to denote the root of the
+ * bundle. See the specification text for details on how HTTP requests are
+ * mapped.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String}.
+ *
+ * @see #HTTP_WHITEBOARD_RESOURCE_PATTERN
+ */
+ public static final String HTTP_WHITEBOARD_RESOURCE_PREFIX = "osgi.http.whiteboard.resource.prefix";
+
+ /**
+ * Service property specifying the target filter to select the Http
+ * Whiteboard implementation to process the service.
+ *
+ * <p>
+ * An Http Whiteboard implementation can define any number of service
+ * properties which can be referenced by the target filter. The service
+ * properties should always include the
+ * {@link org.osgi.service.servlet.whiteboard.runtime.HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT
+ * osgi.http.endpoint} service property if the endpoint information is
+ * known.
+ *
+ * <p>
+ * If this service property is not specified, then all Http Whiteboard
+ * implementations can process the service.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String} and be
+ * a valid {@link Filter filter string}.
+ */
+ public static final String HTTP_WHITEBOARD_TARGET = "osgi.http.whiteboard.target";
+
+ /**
+ * If a servlet filter, error page or listener wants to be registered with
+ * the Http Context(s) managed by the Http Service, they can select the
+ * contexts having this property.
+ * <p>
+ * Servlets or resources registered using this property are treated as an
+ * invalid registration.
+ *
+ * @see #HTTP_SERVICE_CONTEXT_FILTER
+ * @since 1.1
+ */
+ public static final String HTTP_SERVICE_CONTEXT_PROPERTY = "osgi.http.whiteboard.context.httpservice";
+
+ /**
+ * If a servlet filter, error page or listener wants to be registered with
+ * the Http Context(s) managed by the Http Service, they can select the
+ * contexts having the {@link #HTTP_SERVICE_CONTEXT_PROPERTY} property using
+ * this filter.
+ *
+ * @see #HTTP_SERVICE_CONTEXT_PROPERTY
+ * @since 1.1
+ */
+ public static final String HTTP_SERVICE_CONTEXT_FILTER = "("
+ + HTTP_SERVICE_CONTEXT_PROPERTY + "=*)";
+
+ /**
+ * The name of the implementation capability for the Http Whiteboard
+ * specification
+ *
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_IMPLEMENTATION = "osgi.http";
+
+ /**
+ * The version of the implementation capability for the Http Whiteboard
+ * specification
+ *
+ * @since 1.1
+ */
+ public static final String HTTP_WHITEBOARD_SPECIFICATION_VERSION = "2";
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/Preprocessor.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/Preprocessor.java
new file mode 100644
index 0000000..e2b309c
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/Preprocessor.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard;
+
+import jakarta.servlet.Filter;
+
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Services registered as a {@code Preprocessor} using a whiteboard pattern are
+ * executed for every request before the dispatching is performed.
+ * <p>
+ * If there are several services of this type, they are run in
+ * {@link org.osgi.framework.ServiceReference#compareTo(Object) ranking order},
+ * the one with the highest ranking is used first.
+ * <p>
+ * The preprocessor is handled in the same way as filters. When a preprocessor
+ * is put into service {@link Filter#init(jakarta.servlet.FilterConfig)} is
+ * called, when it is not used anymore {@link Filter#destroy()} is called. As
+ * these preprocessors are run before dispatching and therefore the targeted
+ * servlet context is not known yet,
+ * {@link jakarta.servlet.FilterConfig#getServletContext()} returns the servlet
+ * context of the backing implementation. The same context is returned by the
+ * request object. The context path is the context path of this underlying
+ * servlet context. The passed in chain can be used to invoke the next
+ * preprocessor in the chain, or if the end of that chain is reached to start
+ * dispatching of the request. A preprocessor might decide to terminate the
+ * processing and directly generate a response.
+ * <p>
+ * Service properties with the prefix
+ * {@code HttpWhiteboardConstants#HTTP_WHITEBOARD_PREPROCESSOR_INIT_PARAM_PREFIX}
+ * are passed as init parameters to this service.
+ *
+ * @ThreadSafe
+ * @author $Id: 2e23a38f538d8f19740c6819a346d0fef70c2128 $
+ */
+@ConsumerType
+public interface Preprocessor extends Filter {
+
+ // this interface is a marker interface
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/ServletContextHelper.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/ServletContextHelper.java
new file mode 100644
index 0000000..2dc95b0
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/ServletContextHelper.java
@@ -0,0 +1,331 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
+import org.osgi.annotation.versioning.ConsumerType;
+import org.osgi.framework.Bundle;
+
+/**
+ * Helper service for a servlet context used by a Http Whiteboard implementation
+ * to serve HTTP requests.
+ * <p>
+ * This service defines methods that the Http Whiteboard implementation may call
+ * to get information for a request when dealing with whiteboard services.
+ * <p>
+ * Each {@code ServletContextHelper} is registered with a
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME
+ * "osgi.http.whiteboard.context.name"} service property containing a name to
+ * reference by servlets, servlet filters, resources, and listeners. If there is
+ * more than one {@code ServletContextHelper} registered with the same context
+ * name, the one that is first in the
+ * {@link org.osgi.framework.ServiceReference#compareTo(Object) ranking order}
+ * is active, the others are inactive.
+ * <p>
+ * A context is registered with the
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH
+ * "osgi.http.whiteboard.context.path"} service property to define a path under
+ * which all services registered with this context are reachable. If there is
+ * more than one {@code ServletContextHelper} registered with the same path,
+ * each duplicate context path is searched in
+ * {@link org.osgi.framework.ServiceReference#compareTo(Object) ranking order}
+ * until a matching servlet or resource is found.
+ * <p>
+ * Servlets, servlet filters, resources, and listeners services may be
+ * associated with a {@code ServletContextHelper} service with the
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT
+ * "osgi.http.whiteboard.context.select"} service property. If the referenced
+ * {@code ServletContextHelper} service does not exist or is currently not
+ * active, the whiteboard services for that {@code ServletContextHelper} are not
+ * active either.
+ * <p>
+ * If no {@code ServletContextHelper} service is associated, that is no
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT
+ * "osgi.http.whiteboard.context.select"} service property is configured for a
+ * whiteboard service, a default {@code ServletContextHelper} is used.
+ * <p>
+ * Those whiteboard services that are associated with the same
+ * {@code ServletContextHelper} object will share the same
+ * {@code ServletContext} object.
+ * <p>
+ * The behavior of the methods on the default {@code ServletContextHelper} is
+ * defined as follows:
+ * <ul>
+ * <li>{@link #getMimeType(String) getMimeType} - Always returns
+ * {@code null}.</li>
+ * <li>{@link #handleSecurity(HttpServletRequest, HttpServletResponse)
+ * handleSecurity} - Always returns {@code true}.</li>
+ * <li>{@link #getResource(String) getResource} - Assumes the named resource is
+ * in the bundle of the whiteboard service, addressed from the root. This method
+ * calls the whiteboard service bundle's {@code Bundle.getEntry} method, and
+ * returns the appropriate URL to access the resource. On a Java runtime
+ * environment that supports permissions, the Http Whiteboard implementation
+ * needs to be granted
+ * {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.</li>
+ * <li>{@link #getResourcePaths(String) getResourcePaths} - Assumes that the
+ * resources are in the bundle of the whiteboard service. This method calls
+ * {@code Bundle.findEntries} method, and returns the found entries. On a Java
+ * runtime environment that supports permissions, the Http Whiteboard
+ * implementation needs to be granted
+ * {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.</li>
+ * <li>{@link #getRealPath(String) getRealPath} - Always returns
+ * {@code null}.</li>
+ * </ul>
+ *
+ * @ThreadSafe
+ * @author $Id: b1080e8c428484d4f1e95c0a510099fa7ced3dc4 $
+ * @see HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME
+ * @see HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH
+ */
+@ConsumerType
+public abstract class ServletContextHelper {
+ /**
+ * {@code HttpServletRequest} attribute specifying the name of the
+ * authenticated user. The value of the attribute can be retrieved by
+ * {@code HttpServletRequest.getRemoteUser}.
+ */
+ public static final String REMOTE_USER = "org.osgi.service.http.authentication.remote.user";
+ /**
+ * {@code HttpServletRequest} attribute specifying the scheme used in
+ * authentication. The value of the attribute can be retrieved by
+ * {@code HttpServletRequest.getAuthType}.
+ */
+ public static final String AUTHENTICATION_TYPE = "org.osgi.service.http.authentication.type";
+ /**
+ * {@code HttpServletRequest} attribute specifying the {@code Authorization}
+ * object obtained from the {@code org.osgi.service.useradmin.UserAdmin}
+ * service. The value of the attribute can be retrieved by
+ * {@code HttpServletRequest.getAttribute(ServletContextHelper.AUTHORIZATION)}
+ * .
+ */
+ public static final String AUTHORIZATION = "org.osgi.service.useradmin.authorization";
+
+ /** Bundle associated with this context. */
+ private final Bundle bundle;
+
+ /**
+ * Construct a new context helper.
+ *
+ * <p>
+ * If needed, the subclass will have to handle the association with a
+ * specific bundle.
+ */
+ public ServletContextHelper() {
+ this(null);
+ }
+
+ /**
+ * Construct a new context helper associated with the specified bundle.
+ *
+ * @param bundle The bundle to be associated with this context helper.
+ */
+ public ServletContextHelper(final Bundle bundle) {
+ this.bundle = bundle;
+ }
+
+ /**
+ * Handles security for the specified request.
+ * <p>
+ * The Http Whiteboard implementation calls this method prior to servicing
+ * the specified request. This method controls whether the request is
+ * processed in the normal manner or an error is returned.
+ * <p>
+ * If the request requires authentication and the {@code Authorization}
+ * header in the request is missing or not acceptable, then this method
+ * should set the {@code WWW-Authenticate} header in the response object,
+ * set the status in the response object to Unauthorized(401) and return
+ * {@code false}. See also <a href="http://www.ietf.org/rfc/rfc2617.txt">RFC
+ * 2617: HTTP Authentication: Basic and Digest Access Authentication</a>.
+ * <p>
+ * If the request requires a secure connection and the {@code getScheme}
+ * method in the request does not return 'https' or some other acceptable
+ * secure protocol, then this method should set the status in the response
+ * object to Forbidden(403) and return {@code false}.
+ * <p>
+ * When this method returns {@code false}, the Http Whiteboard
+ * implementation will send the response back to the client, thereby
+ * completing the request. When this method returns {@code true}, the Http
+ * Whiteboard implementation will proceed with servicing the request.
+ * <p>
+ * If the specified request has been authenticated, this method must set the
+ * {@link #AUTHENTICATION_TYPE} request attribute to the type of
+ * authentication used, and the {@link #REMOTE_USER} request attribute to
+ * the remote user (request attributes are set using the
+ * {@code setAttribute} method on the request). If this method does not
+ * perform any authentication, it must not set these attributes.
+ * <p>
+ * If the authenticated user is also authorized to access certain resources,
+ * this method must set the {@link #AUTHORIZATION} request attribute to the
+ * {@code Authorization} object obtained from the
+ * {@code org.osgi.service.useradmin.UserAdmin} service.
+ * <p>
+ * The servlet responsible for servicing the specified request determines
+ * the authentication type and remote user by calling the
+ * {@code getAuthType} and {@code getRemoteUser} methods, respectively, on
+ * the request.
+ * <p>
+ * If there is the need to clean up resources at the end of the request, the
+ * method {@link #finishSecurity(HttpServletRequest, HttpServletResponse)}
+ * can be implemented. That method is only called if this method returns {@code true}.
+ *
+ * @param request The HTTP request.
+ * @param response The HTTP response.
+ * @return {@code true} if the request should be serviced, {@code false} if
+ * the request should not be serviced and Http Whiteboard
+ * implementation will send the response back to the client.
+ * @throws java.io.IOException May be thrown by this method. If this occurs,
+ * the Http Whiteboard implementation will terminate the request
+ * and close the socket.
+ * @see #finishSecurity(HttpServletRequest, HttpServletResponse)
+ */
+ public boolean handleSecurity(final HttpServletRequest request,
+ final HttpServletResponse response)
+ throws IOException {
+ return true;
+ }
+
+ /**
+ * Finishes the security context for the specified request.
+ * <p>
+ * Implementations of this service can implement this method to clean up
+ * resources which have been setup in
+ * {@link #handleSecurity(HttpServletRequest, HttpServletResponse)}.
+ * <p>
+ * This method is only called if
+ * {@link #handleSecurity(HttpServletRequest, HttpServletResponse)} returned
+ * {@code true} for the specified request. This method is called once the
+ * pipeline finishes processing or if an exception is thrown from within the
+ * pipeline execution.
+ * <p>
+ * The default implementation of this method does nothing.
+ *
+ * @param request The HTTP request.
+ * @param response The HTTP response.
+ * @since 1.1
+ * @see #handleSecurity(HttpServletRequest, HttpServletResponse)
+ */
+ public void finishSecurity(final HttpServletRequest request,
+ final HttpServletResponse response) {
+ // do nothing
+ }
+
+ /**
+ * Maps a resource name to a URL.
+ * <p>
+ * Called by the Http Whiteboard implementation to map the specified
+ * resource name to a URL. For servlets, the Http Whiteboard implementation
+ * will call this method to support the {@code ServletContext} methods
+ * {@code getResource} and {@code getResourceAsStream}. For resources, the
+ * Http Whiteboard implementation will call this method to locate the named
+ * resource.
+ * <p>
+ * The context can control from where resources come. For example, the
+ * resource can be mapped to a file in the bundle's persistent storage area
+ * via {@code BundleContext.getDataFile(name).toURI().toURL()} or to a
+ * resource in the context's bundle via {@code getClass().getResource(name)}
+ *
+ * @param name The name of the requested resource.
+ * @return A URL that a Http Whiteboard implementation can use to read the
+ * resource or {@code null} if the resource does not exist.
+ */
+ public URL getResource(String name) {
+ if ((name != null) && (bundle != null)) {
+ if (name.startsWith("/")) {
+ name = name.substring(1);
+ }
+
+ return bundle.getEntry(name);
+ }
+ return null;
+ }
+
+ /**
+ * Maps a name to a MIME type.
+ *
+ * <p>
+ * Called by the Http Whiteboard implementation to determine the MIME type
+ * for the specified name. For whiteboard services, the Http Whiteboard
+ * implementation will call this method to support the
+ * {@code ServletContext} method {@code getMimeType}. For resource servlets,
+ * the Http Whiteboard implementation will call this method to determine the
+ * MIME type for the {@code Content-Type} header in the response.
+ *
+ * @param name The name for which to determine the MIME type.
+ * @return The MIME type (e.g. text/html) of the specified name or
+ * {@code null} to indicate that the Http Whiteboard implementation
+ * should determine the MIME type itself.
+ */
+ public String getMimeType(final String name) {
+ return null;
+ }
+
+ /**
+ * Returns a directory-like listing of all the paths to resources within the
+ * web application whose longest sub-path matches the supplied path
+ * argument.
+ *
+ * <p>
+ * Called by the Http Whiteboard implementation to support the
+ * {@code ServletContext} method {@code getResourcePaths} for whiteboard
+ * services.
+ *
+ * @param path The partial path used to match the resources, which must
+ * start with a /.
+ * @return A Set containing the directory listing, or {@code null} if there
+ * are no resources in the web application whose path begins with
+ * the supplied path.
+ */
+ public Set<String> getResourcePaths(final String path) {
+ if ((path != null) && (bundle != null)) {
+ final Enumeration<URL> e = bundle.findEntries(path, null, false);
+ if (e != null) {
+ final Set<String> result = new LinkedHashSet<String>();
+ while (e.hasMoreElements()) {
+ result.add(e.nextElement().getPath());
+ }
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Gets the real path corresponding to the given virtual path.
+ *
+ * <p>
+ * Called by the Http Whiteboard implementation to support the
+ * {@code ServletContext} method {@code getRealPath} for whiteboard
+ * services.
+ *
+ * @param path The virtual path to be translated to a real path.
+ * @return The real path, or {@code null} if the translation cannot be
+ * performed.
+ */
+ public String getRealPath(final String path) {
+ return null;
+ }
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/package-info.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/package-info.java
new file mode 100644
index 0000000..def7e75
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/package-info.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+/**
+ * Http Whiteboard Package Version 2.0.
+ * <p>
+ * Bundles wishing to use this package must list the package in the
+ * Import-Package header of the bundle's manifest. This package has two types of
+ * users: the consumers that use the API in this package and the providers that
+ * implement the API in this package.
+ * <p>
+ * Example import for consumers using the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.servlet.whiteboard; version="[2.0,3.0)"}
+ * <p>
+ * Example import for providers implementing the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.servlet.whiteboard; version="[2.0,2.1)"}
+ *
+ * @author $Id: e46233b315016463a9b79188e11cfac678f56783 $
+ */
+
+@Version(HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION + ".0")
+package org.osgi.service.servlet.whiteboard;
+
+import org.osgi.annotation.versioning.Version;
+
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/HttpServiceRuntime.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/HttpServiceRuntime.java
new file mode 100644
index 0000000..e48e299
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/HttpServiceRuntime.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime;
+
+import org.osgi.annotation.versioning.ProviderType;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RequestInfoDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.RuntimeDTO;
+
+/**
+ * The HttpServiceRuntime service represents the runtime information of an Http
+ * Whiteboard implementation.
+ *
+ * <p>
+ * It provides access to DTOs representing the current state of the service.
+ * <p>
+ * The HttpServiceRuntime service must be registered with the
+ * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT} service
+ * property.
+ *
+ * @ThreadSafe
+ * @author $Id: fde5b917c3d888c6cf1aa77bb330eb5b8b4e3919 $
+ */
+@ProviderType
+public interface HttpServiceRuntime {
+
+ /**
+ * Return the runtime DTO representing the current state.
+ *
+ * @return The runtime DTO.
+ */
+ public RuntimeDTO getRuntimeDTO();
+
+ /**
+ * Return a request info DTO containing the services involved with
+ * processing a request for the specified path.
+ *
+ * @param path The request path, relative to the root of the Http Whiteboard
+ * implementation.
+ * @return The request info DTO for the specified path.
+ */
+ public RequestInfoDTO calculateRequestInfoDTO(String path);
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/HttpServiceRuntimeConstants.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/HttpServiceRuntimeConstants.java
new file mode 100644
index 0000000..d7423b9
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/HttpServiceRuntimeConstants.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime;
+
+/**
+ * Defines standard names for Http Runtime Service constants.
+ *
+ * @author $Id: 86b2dc4aa0b2a8601d247a043a127017d5d02c0e $
+ */
+public final class HttpServiceRuntimeConstants {
+ private HttpServiceRuntimeConstants() {
+ // non-instantiable
+ }
+
+ /**
+ * Http Runtime Service service property specifying the endpoints upon which
+ * the Http Whiteboard implementation is listening.
+ *
+ * <p>
+ * An endpoint value is a URL or a relative path, to which the Http
+ * Whiteboard implementation is listening. For example,
+ * {@code http://192.168.1.10:8080/} or {@code /myapp/}. A relative path may
+ * be used if the scheme and authority parts of the URL are not known, e.g.
+ * in a bridged Http Whiteboard implementation. If the Http Whiteboard
+ * implementation is serving the root context and neither scheme nor
+ * authority is known, the value of the property is "/". Both, a URL and a
+ * relative path, must end with a slash.
+ * <p>
+ * An Http Whiteboard implementation can be listening on multiple endpoints.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String},
+ * {@code String[]}, or {@code Collection<String>}.
+ */
+ public static final String HTTP_SERVICE_ENDPOINT = "osgi.http.endpoint";
+
+ /**
+ * Http Runtime Service service property to associate the Http Runtime
+ * Service with one or more HttpService services.
+ *
+ * <p>
+ * If this Http Whiteboard implementation also implements the Http Service
+ * Specification, this service property is set to a collection of
+ * {@code service.id} for the {@code HttpService} services registered by
+ * this implementation.
+ *
+ * <p>
+ * The value of this service property must be of type
+ * {@code Collection<Long>}.
+ */
+ public static final String HTTP_SERVICE_ID = "osgi.http.service.id";
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/BaseServletDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/BaseServletDTO.java
new file mode 100644
index 0000000..eb63f3d
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/BaseServletDTO.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import java.util.Map;
+
+import org.osgi.dto.DTO;
+
+/**
+ * Represents common information about a {@code jakarta.servlet.Servlet} service.
+ *
+ * @NotThreadSafe
+ * @author $Id: d032fb76a9922508ba7d4084ee20079eb6df8a8f $
+ */
+public abstract class BaseServletDTO extends DTO {
+ /**
+ * The name of the servlet. This value is never {@code null}, unless this
+ * object represents a {@code FailedServletDTO} or a
+ * {@code FailedErrorPageDTO} where the value might be {@code null}.
+ */
+ public String name;
+
+ /**
+ * The information string from the servlet.
+ * <p>
+ * This is the value returned by the {@code Servlet.getServletInfo()}
+ * method. For a {@code FailedServletDTO} or a {@code FailedErrorPageDTO}
+ * this is always {@code null}.
+ */
+ public String servletInfo;
+
+ /**
+ * Specifies whether the servlet supports asynchronous processing.
+ */
+ public boolean asyncSupported;
+
+ /**
+ * The servlet initialization parameters as provided during registration of
+ * the servlet. Additional parameters like the Http Service Runtime
+ * attributes are not included. If the service has no initialization
+ * parameters, the map is empty.
+ */
+ public Map<String, String> initParams;
+
+ /**
+ * The service id of the servlet context for the servlet represented by this
+ * DTO.
+ */
+ public long servletContextId;
+
+ /**
+ * Service property identifying the servlet. In the case of a servlet
+ * registered in the service registry and picked up by a Http Whiteboard
+ * Implementation, this value is not negative and corresponds to the service
+ * id in the registry. If the servlet has not been registered in the service
+ * registry, the value is negative and a unique negative value is generated
+ * by the Http Service Runtime in this case.
+ */
+ public long serviceId;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/DTOConstants.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/DTOConstants.java
new file mode 100644
index 0000000..027a0a5
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/DTOConstants.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Defines standard constants for the DTOs.
+ */
+public final class DTOConstants {
+ private DTOConstants() {
+ // non-instantiable
+ }
+
+ /**
+ * Failure reason is unknown.
+ */
+ public static final int FAILURE_REASON_UNKNOWN = 0;
+
+ /**
+ * No matching {@code ServletContextHelper}.
+ **/
+ public static final int FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING = 1;
+
+ /**
+ * Matching {@code ServletContextHelper}, but the context is not used due to
+ * a problem with the context.
+ */
+ public static final int FAILURE_REASON_SERVLET_CONTEXT_FAILURE = 2;
+
+ /**
+ * Service is shadowed by another service.
+ * <p>
+ * For example, another service with the same service properties but having
+ * a higher service ranking. See
+ * {@link org.osgi.framework.ServiceReference#compareTo(Object)}.
+ */
+ public static final int FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE = 3;
+
+ /**
+ * An exception occurred during initializing of the service.
+ * <p>
+ * This reason can only happen for servlets and servlet filters.
+ */
+ public static final int FAILURE_REASON_EXCEPTION_ON_INIT = 4;
+
+ /**
+ * The service is registered in the service registry but getting the service
+ * fails as it returns {@code null}.
+ */
+ public static final int FAILURE_REASON_SERVICE_NOT_GETTABLE = 5;
+
+ /**
+ * The service is registered in the service registry but the service
+ * properties are invalid.
+ */
+ public static final int FAILURE_REASON_VALIDATION_FAILED = 6;
+
+ /**
+ * The service is not registered as a prototype scoped service and is
+ * already in use with a servlet context and therefore can't be used with
+ * another servlet context.
+ */
+ public static final int FAILURE_REASON_SERVICE_IN_USE = 7;
+
+ /**
+ * The servlet is not registered as it is configured to have multipart
+ * enabled, but the bundle containing the servlet has no write permission to
+ * the provided location for the uploaded files.
+ *
+ * @since 1.1
+ */
+ public static final int FAILURE_REASON_SERVLET_WRITE_TO_LOCATION_DENIED = 8;
+
+ /**
+ * The servlet is not registered as it is configured to have multipart
+ * enabled, but the whiteboard implementation has no write permission to the
+ * default location for the uploaded files.
+ *
+ * @since 1.1
+ */
+ public static final int FAILURE_REASON_WHITEBOARD_WRITE_TO_DEFAULT_DENIED = 9;
+
+ /**
+ * The servlet is not registered as it is configured to have multipart
+ * enabled, but the bundle containing the servlet has no read permission to
+ * the default location for the uploaded files.
+ *
+ * @since 1.1
+ */
+ public static final int FAILURE_REASON_SERVLET_READ_FROM_DEFAULT_DENIED = 10;
+
+ /**
+ * The servlet is not registered as it is configured to have multipart
+ * enabled, but the whiteboard implementation has no write permission to the
+ * provided location for the uploaded files.
+ *
+ * @since 1.1
+ */
+ public static final int FAILURE_REASON_WHITEBOARD_WRITE_TO_LOCATION_DENIED = 11;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ErrorPageDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ErrorPageDTO.java
new file mode 100644
index 0000000..db627a3
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ErrorPageDTO.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a {@code jakarta.servlet.Servlet} for handling errors and currently
+ * being used by a servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: c31329ea4864f9cd8c29a21081f3b08d78f0b308 $
+ */
+public class ErrorPageDTO extends BaseServletDTO {
+ /**
+ * The exceptions the error page is used for. This array might be
+ * empty.
+ */
+ public String[] exceptions;
+
+ /**
+ * The error codes the error page is used for. This array might be
+ * empty.
+ */
+ public long[] errorCodes;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedErrorPageDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedErrorPageDTO.java
new file mode 100644
index 0000000..90a9067
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedErrorPageDTO.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a {@code jakarta.servlet.Servlet} service registered as an error
+ * page but currently not being used by a servlet context due to a problem.
+ * <p>
+ * As the servlet represented by this DTO is not used due to a failure, the
+ * field {@link FailedErrorPageDTO#servletContextId} always returns {@code 0}
+ * and does not point to an existing {@code ServletContextHelper}.
+ *
+ * @NotThreadSafe
+ * @author $Id: 825431b9b203fc72787b0f59e94a69c09d3669dc $
+ */
+public class FailedErrorPageDTO extends ErrorPageDTO {
+
+ /**
+ * The reason why the servlet represented by this DTO is not used.
+ *
+ * @see DTOConstants#FAILURE_REASON_UNKNOWN
+ * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT
+ * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING
+ * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE
+ * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE
+ * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE
+ */
+ public int failureReason;
+
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedFilterDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedFilterDTO.java
new file mode 100644
index 0000000..89c8e7f
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedFilterDTO.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a servlet {@code Filter} service which is currently not being used
+ * by a servlet context due to a problem.
+ * <p>
+ * As the service represented by this DTO is not used due to a failure, the
+ * field {@link FailedFilterDTO#servletContextId} always returns {@code 0} and
+ * does not point to an existing servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: 731a48dc3e5862ed5105c6deb77f349eedea993b $
+ */
+public class FailedFilterDTO extends FilterDTO {
+
+ /**
+ * The reason why the servlet filter represented by this DTO is not used.
+ *
+ * @see DTOConstants#FAILURE_REASON_UNKNOWN
+ * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT
+ * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING
+ * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE
+ * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE
+ * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE
+ */
+ public int failureReason;
+
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedListenerDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedListenerDTO.java
new file mode 100644
index 0000000..001a73e
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedListenerDTO.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a listener service which is currently not being used by a servlet
+ * context due to a problem.
+ * <p>
+ * As the listener represented by this DTO is not used due to a failure, the
+ * field {@link FailedErrorPageDTO#servletContextId} always returns {@code 0}
+ * and does not point to an existing servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: 3bda6964deaf7ad0765b2d99b4c89e783e6e1555 $
+ */
+public class FailedListenerDTO extends ListenerDTO {
+
+ /**
+ * The reason why the listener represented by this DTO is not used.
+ *
+ * @see DTOConstants#FAILURE_REASON_UNKNOWN
+ * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT
+ * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING
+ * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE
+ * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE
+ * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE
+ */
+ public int failureReason;
+
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedPreprocessorDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedPreprocessorDTO.java
new file mode 100644
index 0000000..d187854
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedPreprocessorDTO.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a preprocessor service which is currently not being used due to a
+ * problem.
+ *
+ * @NotThreadSafe
+ * @author $Id: ab753c468cc54608ed9ff7df6df98601d50b761c $
+ * @since 1.1
+ */
+public class FailedPreprocessorDTO extends PreprocessorDTO {
+
+ /**
+ * The reason why the preprocessor represented by this DTO is not used.
+ *
+ * @see DTOConstants#FAILURE_REASON_UNKNOWN
+ * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT
+ * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE
+ */
+ public int failureReason;
+
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedResourceDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedResourceDTO.java
new file mode 100644
index 0000000..4267c90
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedResourceDTO.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a resource definition which is currently not being used by a
+ * servlet context due to a problem.
+ * <p>
+ * As the resource represented by this DTO is not used due to a failure, the
+ * field {@link FailedResourceDTO#servletContextId} always returns {@code 0} and
+ * does not point to an existing servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: 5b5d69f64342b8481c971c9cea5a68c893acbf9a $
+ */
+public class FailedResourceDTO extends ResourceDTO {
+
+ /**
+ * The reason why the resource represented by this DTO is not used.
+ *
+ * @see DTOConstants#FAILURE_REASON_UNKNOWN
+ * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT
+ * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING
+ * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE
+ * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE
+ * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE
+ */
+ public int failureReason;
+
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedServletContextDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedServletContextDTO.java
new file mode 100644
index 0000000..d98b969
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedServletContextDTO.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a servlet context that is currently not used due to some problem.
+ *
+ * The following fields return an empty array for a
+ * {@code FailedServletContextDTO}:
+ * <ul>
+ * <li>{@link ServletContextDTO#servletDTOs}</li>
+ * <li>{@link ServletContextDTO#resourceDTOs}</li>
+ * <li>{@link ServletContextDTO#filterDTOs}</li>
+ * <li>{@link ServletContextDTO#errorPageDTOs}</li>
+ * <li>{@link ServletContextDTO#listenerDTOs}</li>
+ * </ul>
+ * <p>
+ * The method {@link ServletContextDTO#attributes} returns an empty map for a
+ * {@code FailedServletContextDTO}.
+ *
+ * @NotThreadSafe
+ * @author $Id: a34bc53757b13933cfb9748a70d76f6256eb8c6c $
+ */
+public class FailedServletContextDTO extends ServletContextDTO {
+
+ /**
+ * The reason why the servlet context represented by this DTO is not used.
+ *
+ * @see DTOConstants#FAILURE_REASON_UNKNOWN
+ * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT
+ * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING
+ * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE
+ * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE
+ * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE
+ */
+ public int failureReason;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedServletDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedServletDTO.java
new file mode 100644
index 0000000..f4ced29
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FailedServletDTO.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+/**
+ * Represents a {@code jakarta.servlet.Servlet} service which is currently not
+ * being used by a servlet context due to a problem.
+ * <p>
+ * As the servlet represented by this DTO is not used due to a failure, the
+ * field {@link FailedServletDTO#servletContextId} always returns {@code 0} and
+ * does not point to an existing servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: c38e5223a80f9dd52a669cc516b27ff1b6fdf953 $
+ */
+public class FailedServletDTO extends ServletDTO {
+
+ /**
+ * The reason why the servlet represented by this DTO is not used.
+ *
+ * @see DTOConstants#FAILURE_REASON_UNKNOWN
+ * @see DTOConstants#FAILURE_REASON_EXCEPTION_ON_INIT
+ * @see DTOConstants#FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING
+ * @see DTOConstants#FAILURE_REASON_SERVICE_NOT_GETTABLE
+ * @see DTOConstants#FAILURE_REASON_SERVLET_CONTEXT_FAILURE
+ * @see DTOConstants#FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE
+ * @see DTOConstants#FAILURE_REASON_SERVLET_WRITE_TO_LOCATION_DENIED
+ * @see DTOConstants#FAILURE_REASON_WHITEBOARD_WRITE_TO_DEFAULT_DENIED
+ * @see DTOConstants#FAILURE_REASON_SERVLET_READ_FROM_DEFAULT_DENIED
+ */
+ public int failureReason;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FilterDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FilterDTO.java
new file mode 100644
index 0000000..ad4f112
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/FilterDTO.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import java.util.Map;
+
+import org.osgi.dto.DTO;
+
+/**
+ * Represents a servlet {@code jakarta.servlet.Filter} service currently being
+ * used for by a servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: 5f71f7f381920718225af356f1af58a9da3400c5 $
+ */
+public class FilterDTO extends DTO {
+ /**
+ * The name of the servlet filter. This field is never {@code null}.
+ */
+ public String name;
+
+ /**
+ * The request mappings for the servlet filter.
+ *
+ * <p>
+ * The specified patterns are used to determine whether a request is mapped
+ * to the servlet filter. This array might be empty.
+ */
+ public String[] patterns;
+
+ /**
+ * The servlet names for the servlet filter.
+ *
+ * <p>
+ * The specified names are used to determine the servlets whose requests are
+ * mapped to the servlet filter. This array might be empty.
+ */
+ public String[] servletNames;
+
+ /**
+ * The request mappings for the servlet filter.
+ *
+ * <p>
+ * The specified regular expressions are used to determine whether a request
+ * is mapped to the servlet filter. This array might be empty.
+ */
+ public String[] regexs;
+
+ /**
+ * Specifies whether the servlet filter supports asynchronous processing.
+ */
+ public boolean asyncSupported;
+
+ /**
+ * The dispatcher associations for the servlet filter.
+ *
+ * <p>
+ * The specified names are used to determine in what occasions the servlet
+ * filter is called. This array is never {@code null}.
+ */
+ public String[] dispatcher;
+
+ /**
+ * The servlet filter initialization parameters as provided during
+ * registration of the servlet filter. Additional parameters like the Http
+ * Service Runtime attributes are not included. If the servlet filter has
+ * not initialization parameters, this map is empty.
+ */
+ public Map<String, String> initParams;
+
+ /**
+ * Service property identifying the servlet filter. In the case of a servlet
+ * filter registered in the service registry and picked up by a Http
+ * Whiteboard Implementation, this value is not negative and corresponds to
+ * the service id in the registry. If the servlet filter has not been
+ * registered in the service registry, the value is negative and a unique
+ * negative value is generated by the Http Service Runtime in this case.
+ */
+ public long serviceId;
+
+ /**
+ * The service id of the servlet context for the servlet filter represented
+ * by this DTO.
+ */
+ public long servletContextId;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ListenerDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ListenerDTO.java
new file mode 100644
index 0000000..6aef442
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ListenerDTO.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import org.osgi.dto.DTO;
+
+/**
+ * Represents a listener currently being used by a servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: d774ac5b249f95b9f5f684830f3854ce225835cf $
+ */
+public class ListenerDTO extends DTO {
+
+ /**
+ * The fully qualified type names the listener. This array is never empty.
+ */
+ public String[] types;
+
+ /**
+ * Service property identifying the listener. In the case of a Listener
+ * registered in the service registry and picked up by a Http Whiteboard
+ * Implementation, this value is not negative and corresponds to the service
+ * id in the registry. If the listener has not been registered in the
+ * service registry, the value is negative and a unique negative value is
+ * generated by the Http Service Runtime in this case.
+ */
+ public long serviceId;
+
+ /**
+ * The service id of the servlet context for the listener represented by
+ * this DTO.
+ */
+ public long servletContextId;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/PreprocessorDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/PreprocessorDTO.java
new file mode 100644
index 0000000..24c44fe
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/PreprocessorDTO.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import java.util.Map;
+
+import org.osgi.dto.DTO;
+
+/**
+ * Represents a preprocessor
+ * {@code org.osgi.service.servlet.whiteboard.Preprocessor} service currently
+ * being used during request processing.
+ *
+ * @NotThreadSafe
+ * @author $Id: a3e9ab5231111107fe83b92ce9e1c343def5486f $
+ * @since 1.1
+ */
+public class PreprocessorDTO extends DTO {
+
+ /**
+ * The preprocessor initialization parameters as provided during
+ * registration of the preprocessor. Additional parameters like the Http
+ * Service Runtime attributes are not included. If the preprocessor has not
+ * initialization parameters, this map is empty.
+ */
+ public Map<String, String> initParams;
+
+ /**
+ * Service property identifying the preprocessor. In the case of a
+ * preprocessor registered in the service registry and picked up by a Http
+ * Whiteboard Implementation, this value is not negative and corresponds to
+ * the service id in the registry. If the preprocessor has not been
+ * registered in the service registry, the value is negative and a unique
+ * negative value is generated by the Http Service Runtime in this case.
+ */
+ public long serviceId;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/RequestInfoDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/RequestInfoDTO.java
new file mode 100644
index 0000000..272e67e
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/RequestInfoDTO.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import org.osgi.dto.DTO;
+
+/**
+ * Represents the services used to process a specific request.
+ *
+ * @NotThreadSafe
+ * @author $Id: f3d9f6ac1f3f37783c0ac218974f4a4001b05e73 $
+ */
+public class RequestInfoDTO extends DTO {
+ /**
+ * The path of the request relative to the root.
+ */
+ public String path;
+
+ /**
+ * The service id of the servlet context processing the request represented
+ * by this DTO.
+ */
+ public long servletContextId;
+
+ /**
+ * The servlet filters processing this request. If no servlet filters are
+ * called for processing this request, an empty array is returned.
+ */
+ public FilterDTO[] filterDTOs;
+
+ /**
+ * The servlet processing this request. If the request is processed by a
+ * servlet, this field points to the DTO of the servlet. If the request is
+ * processed by another type of component like a resource, this field is
+ * {@code null}.
+ */
+ public ServletDTO servletDTO;
+
+ /**
+ * The resource processing this request. If the request is processed by a
+ * resource, this field points to the DTO of the resource. If the request is
+ * processed by another type of component like a servlet, this field is
+ * {@code null}.
+ */
+ public ResourceDTO resourceDTO;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ResourceDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ResourceDTO.java
new file mode 100644
index 0000000..51c46d5
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ResourceDTO.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import org.osgi.dto.DTO;
+
+/**
+ * Represents a resource definition currently being used by a servlet context.
+ *
+ * @NotThreadSafe
+ * @author $Id: 3b8730c2185679aaf164b22ddb7884a61172cfbb $
+ */
+public class ResourceDTO extends DTO {
+ /**
+ * The request mappings for the resource.
+ *
+ * <p>
+ * The specified patterns are used to determine whether a request is mapped
+ * to the resource. This value is never {@code null}.
+ */
+ public String[] patterns;
+
+ /**
+ * The prefix of the resource.
+ */
+ public String prefix;
+
+ /**
+ * Service property identifying the resource. In the case of a resource
+ * registered in the service registry and picked up by a Http Whiteboard
+ * Implementation, this value is not negative and corresponds to the service
+ * id in the registry. If the resource has not been registered in the
+ * service registry, the value is negative and a unique negative value is
+ * generated by the Http Service Runtime in this case.
+ */
+ public long serviceId;
+
+ /**
+ * The service id of the servlet context for the resource represented by
+ * this DTO.
+ */
+ public long servletContextId;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/RuntimeDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/RuntimeDTO.java
new file mode 100644
index 0000000..6b2ae1e
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/RuntimeDTO.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import org.osgi.dto.DTO;
+import org.osgi.framework.dto.ServiceReferenceDTO;
+
+/**
+ * Represents the state of a Http Service Runtime.
+ *
+ * @NotThreadSafe
+ * @author $Id: 2d4dff10956db843a122d231cff2f1fbceb568b3 $
+ */
+public class RuntimeDTO extends DTO {
+
+ /**
+ * The DTO for the corresponding
+ * {@code org.osgi.service.servlet.whiteboard.runtime.HttpServiceRuntime}.
+ * This value is never {@code null}.
+ */
+ public ServiceReferenceDTO serviceDTO;
+
+ /**
+ * Returns the representations of the
+ * {@code org.osgi.service.servlet.whiteboard.Preprocessor} objects used by
+ * the Http Service Runtime. The returned array may be empty if the Http
+ * Service Runtime is currently not using any
+ * {@code org.osgi.service.servlet.whiteboard.Preprocessor} objects.
+ *
+ * @since 1.1
+ */
+ public PreprocessorDTO[] preprocessorDTOs;
+
+ /**
+ * Returns the representations of the {@code jakarta.servlet.ServletContext}
+ * objects used by the Http Service Runtime. The returned array may be empty
+ * if the Http Service Runtime is currently not using any
+ * {@code jakarta.servlet.ServletContext} objects.
+ */
+ public ServletContextDTO[] servletContextDTOs;
+
+ /**
+ * Returns the representations of the {@code jakarta.servlet.ServletContext}
+ * objects currently not used by the Http service runtime due to some
+ * problem. The returned array may be empty.
+ */
+ public FailedServletContextDTO[] failedServletContextDTOs;
+
+ /**
+ * Returns the representations of the {@code jakarta.servlet.Servlet} services
+ * associated with this runtime but currently not used due to some problem.
+ * The returned array may be empty.
+ */
+ public FailedServletDTO[] failedServletDTOs;
+
+ /**
+ * Returns the representations of the resources associated with this runtime
+ * but currently not used due to some problem. The returned array may be
+ * empty.
+ */
+ public FailedResourceDTO[] failedResourceDTOs;
+
+ /**
+ * Returns the representations of the servlet
+ * {@code org.osgi.service.servlet.whiteboard.Preprocessor} services
+ * associated with this runtime but currently not used due to some problem.
+ * The returned array may be empty.
+ *
+ * @since 1.1
+ */
+ public FailedPreprocessorDTO[] failedPreprocessorDTOs;
+
+ /**
+ * Returns the representations of the {@code jakarta.servlet.Filter} services
+ * associated with this runtime but currently not used due to some problem.
+ * The returned array may be empty.
+ */
+ public FailedFilterDTO[] failedFilterDTOs;
+
+ /**
+ * Returns the representations of the error page
+ * {@code jakarta.servlet.Servlet} services associated with this runtime but
+ * currently not used due to some problem. The returned array may be empty.
+ */
+ public FailedErrorPageDTO[] failedErrorPageDTOs;
+
+ /**
+ * Returns the representations of the listeners associated with this runtime
+ * but currently not used due to some problem. The returned array may be
+ * empty.
+ */
+ public FailedListenerDTO[] failedListenerDTOs;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ServletContextDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ServletContextDTO.java
new file mode 100644
index 0000000..c600d7a
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ServletContextDTO.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import java.util.Map;
+
+import org.osgi.dto.DTO;
+
+/**
+ * Represents a {@code jakarta.servlet.ServletContext} created for servlets,
+ * resources, servlet Filters, and listeners associated with that servlet
+ * context. The Servlet Context is usually backed by a
+ * {@link org.osgi.service.servlet.whiteboard.ServletContextHelper} service.
+ *
+ * @NotThreadSafe
+ * @author $Id: 49ec465915485a38964ac7d5a9c216c71385de21 $
+ */
+public class ServletContextDTO extends DTO {
+ /**
+ * The name of the servlet context.
+ * The name of the corresponding
+ * {@link org.osgi.service.servlet.whiteboard.ServletContextHelper}.
+ * <p>
+ * This is the value returned by the
+ * {@code ServletContext.getServletContextName()} method.
+ */
+ public String name;
+
+ /**
+ * The servlet context path.
+ *
+ * This is the value returned by the {@code ServletContext.getContextPath()}
+ * method.
+ */
+ public String contextPath;
+
+ /**
+ * The servlet context initialization parameters. This is the set of
+ * parameters provided when registering this context. Additional parameters
+ * like the Http Service Runtime attributes are not included. If the context
+ * has no initialization parameters, this map is empty.
+ */
+ public Map<String, String> initParams;
+
+ /**
+ * The servlet context attributes.
+ *
+ * <p>
+ * The value type must be a numerical type, {@code Boolean}, {@code String},
+ * {@code DTO} or an array of any of the former. Therefore this method will
+ * only return the attributes of the servlet context conforming to this
+ * constraint. Other attributes are omitted. If there are no attributes
+ * conforming to the constraint, an empty map is returned.
+ */
+ public Map<String, Object> attributes;
+
+ /**
+ * Service property identifying the servlet context. In the case of a
+ * servlet context backed by a {@code ServletContextHelper} registered in
+ * the service registry and picked up by a Http Whiteboard Implementation,
+ * this value is not negative and corresponds to the service id in the
+ * registry. If the servlet context is not backed by a service registered in
+ * the service registry, the value is negative and a unique negative value
+ * is generated by the Http Service Runtime in this case.
+ */
+ public long serviceId;
+
+ /**
+ * Returns the representations of the {@code Servlet} services associated
+ * with this context.
+ *
+ * The representations of the {@code Servlet} services associated with this
+ * context. The returned array may be empty if this context is currently not
+ * associated with any {@code Servlet} services.
+ */
+ public ServletDTO[] servletDTOs;
+
+ /**
+ * Returns the representations of the resource services associated with this
+ * context.
+ *
+ * The representations of the resource services associated with this
+ * context. The returned array may be empty if this context is currently not
+ * associated with any resource services.
+ */
+ public ResourceDTO[] resourceDTOs;
+
+ /**
+ * Returns the representations of the servlet {@code Filter} services
+ * associated with this context.
+ *
+ * The representations of the servlet {@code Filter} services associated
+ * with this context. The returned array may be empty if this context is
+ * currently not associated with any servlet {@code Filter} services.
+ */
+ public FilterDTO[] filterDTOs;
+
+ /**
+ * Returns the representations of the error page {@code Servlet} services
+ * associated with this context.
+ *
+ * The representations of the error page {@code Servlet} services associated
+ * with this context. The returned array may be empty if this context is
+ * currently not associated with any error pages.
+ */
+ public ErrorPageDTO[] errorPageDTOs;
+
+ /**
+ * Returns the representations of the listener services associated with this
+ * context.
+ *
+ * The representations of the listener services associated with this
+ * context. The returned array may be empty if this context is currently not
+ * associated with any listener services.
+ */
+ public ListenerDTO[] listenerDTOs;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ServletDTO.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ServletDTO.java
new file mode 100644
index 0000000..c53165e
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/ServletDTO.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+
+/**
+ * Represents a {@code jakarta.servlet.Servlet} currently being used by a servlet
+ * context.
+ *
+ * @NotThreadSafe
+ * @author $Id: 296b28fed893e951c34a4d2e4edf27f720ff2f9a $
+ */
+public class ServletDTO extends BaseServletDTO {
+ /**
+ * The request mappings for the servlet.
+ * <p>
+ * The specified patterns are used to determine whether a request is mapped
+ * to the servlet. This array is never {@code null}. It might be empty for
+ * named servlets.
+ */
+ public String[] patterns;
+
+ /**
+ * Specifies whether multipart support is enabled.
+ * @since 1.1
+ */
+ public boolean multipartEnabled;
+
+ /**
+ * Specifies the size threshold after which the file will be written to
+ * disk. If multipart is not enabled for this servlet, {@code 0} is
+ * returned.
+ *
+ * @since 1.1
+ * @see #multipartEnabled
+ */
+ public int multipartFileSizeThreshold;
+
+ /**
+ * Specifies the location where the files can be stored on disk. If
+ * multipart is not enabled for this servlet, {@code null} is returned.
+ *
+ * @since 1.1
+ * @see #multipartEnabled
+ */
+ public String multipartLocation;
+
+ /**
+ * Specifies the maximum size of a file being uploaded. If multipart is not
+ * enabled for this servlet, {@code 0} is returned.
+ *
+ * @since 1.1
+ * @see #multipartEnabled
+ */
+ public long multipartMaxFileSize;
+
+ /**
+ * Specifies the maximum request size. If multipart is not enabled for this
+ * servlet, {@code 0} is returned.
+ *
+ * @since 1.1
+ * @see #multipartEnabled
+ */
+ public long multipartMaxRequestSize;
+}
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/package-info.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/package-info.java
new file mode 100644
index 0000000..f2160df
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/dto/package-info.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+/**
+ * Http Runtime DTO Package Version 2.0.
+ * <p>
+ * Bundles wishing to use this package must list the package in the
+ * Import-Package header of the bundle's manifest. This package has two types of
+ * users: the consumers that use the API in this package and the providers that
+ * implement the API in this package.
+ * <p>
+ * Example import for consumers using the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.servlet.whiteboard.runtime.dto; version="[2.0,3.0)"}
+ * <p>
+ * Example import for providers implementing the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.servlet.whiteboard.runtime.dto; version="[2.0,3.1)"}
+ *
+ * @author $Id: ad5c4695782df6c27613e6e00daf7e20aff78a98 $
+ */
+
+@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION + ".0")
+package org.osgi.service.servlet.whiteboard.runtime.dto;
+
+import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION;
+
+import org.osgi.annotation.versioning.Version;
+
diff --git a/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/package-info.java b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/package-info.java
new file mode 100644
index 0000000..d022635
--- /dev/null
+++ b/http/base/src/main/java/org/osgi/service/servlet/whiteboard/runtime/package-info.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) Contributors to the Eclipse Foundation
+ *
+ * Licensed 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *******************************************************************************/
+
+/**
+ * Http Runtime Package Version 2.0.
+ * <p>
+ * Bundles wishing to use this package must list the package in the
+ * Import-Package header of the bundle's manifest. This package has two types of
+ * users: the consumers that use the API in this package and the providers that
+ * implement the API in this package.
+ * <p>
+ * Example import for consumers using the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.servlet.whiteboard.runtime; version="[2.0,3.0)"}
+ * <p>
+ * Example import for providers implementing the API in this package:
+ * <p>
+ * {@code Import-Package: org.osgi.service.servlet.whiteboard.runtime; version="[2.0,2.1)"}
+ *
+ * @author $Id: 0fe988614ef6019ea42a1e47e76863d722cbb948 $
+ */
+
+@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION + ".0")
+package org.osgi.service.servlet.whiteboard.runtime;
+
+import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION;
+
+import org.osgi.annotation.versioning.Version;
+
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/FilterHandlerTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/handler/FilterHandlerTest.java
index b655105..873b2d1 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/FilterHandlerTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/handler/FilterHandlerTest.java
@@ -26,16 +26,6 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import java.util.Collections;
-import java.util.Map;
-
-import jakarta.servlet.DispatcherType;
-import jakarta.servlet.Filter;
-import jakarta.servlet.FilterChain;
-import jakarta.servlet.FilterConfig;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
import org.apache.felix.http.base.internal.context.ExtServletContext;
import org.apache.felix.http.base.internal.dispatch.InvocationChain;
import org.apache.felix.http.base.internal.runtime.FilterInfo;
@@ -46,7 +36,14 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceObjects;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
+
+import jakarta.servlet.DispatcherType;
+import jakarta.servlet.Filter;
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.FilterConfig;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
public class FilterHandlerTest
{
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistryTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistryTest.java
index 24b3d2d..290548b 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistryTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ErrorPageRegistryTest.java
@@ -42,9 +42,9 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.runtime.dto.DTOConstants;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.Servlet;
import jakarta.servlet.ServletConfig;
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/EventListenerRegistryTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/EventListenerRegistryTest.java
index 5380856..7cd0da2 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/EventListenerRegistryTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/EventListenerRegistryTest.java
@@ -37,7 +37,7 @@ import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceObjects;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.ServletException;
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/FilterRegistryTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/FilterRegistryTest.java
index 2ba8536..656d583 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/FilterRegistryTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/FilterRegistryTest.java
@@ -36,8 +36,8 @@ import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceObjects;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.Filter;
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/HandlerRegistryTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/HandlerRegistryTest.java
index c2e704e..f90e615 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/HandlerRegistryTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/HandlerRegistryTest.java
@@ -30,8 +30,8 @@ import org.apache.felix.http.base.internal.runtime.dto.FailedDTOHolder;
import org.apache.felix.http.base.internal.service.HttpServiceFactory;
import org.junit.Test;
import org.mockito.Mockito;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.runtime.dto.ServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletDTO;
import jakarta.servlet.Servlet;
import jakarta.servlet.ServletConfig;
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ServletRegistryTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ServletRegistryTest.java
index 6e33ade..1abe6c8 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ServletRegistryTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/registry/ServletRegistryTest.java
@@ -42,9 +42,9 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
-import org.osgi.service.http.runtime.dto.ServletContextDTO;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.ServletContextDTO;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
import jakarta.servlet.Servlet;
import jakarta.servlet.ServletConfig;
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/ListenerInfoTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/ListenerInfoTest.java
index 53cab1f..b643b31 100755
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/ListenerInfoTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/runtime/ListenerInfoTest.java
@@ -25,8 +25,6 @@ import static org.mockito.Mockito.when;
import java.util.EventListener;
-import jakarta.servlet.ServletContextListener;
-
import org.junit.Test;
import org.mockito.ArgumentMatchers;
import org.osgi.framework.Bundle;
@@ -35,7 +33,9 @@ import org.osgi.framework.Constants;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants;
+
+import jakarta.servlet.ServletContextListener;
public class ListenerInfoTest
{
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandlerTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandlerTest.java
index b7789a3..79c437d 100644
--- a/http/base/src/test/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandlerTest.java
+++ b/http/base/src/test/java/org/apache/felix/http/base/internal/whiteboard/FailureStateHandlerTest.java
@@ -27,8 +27,8 @@ import java.util.Set;
import org.apache.felix.http.base.internal.runtime.ServletInfo;
import org.apache.felix.http.base.internal.runtime.dto.FailedDTOHolder;
import org.junit.Test;
-import org.osgi.service.http.runtime.dto.DTOConstants;
-import org.osgi.service.http.runtime.dto.FailedServletDTO;
+import org.osgi.service.servlet.whiteboard.runtime.dto.DTOConstants;
+import org.osgi.service.servlet.whiteboard.runtime.dto.FailedServletDTO;
public class FailureStateHandlerTest {
diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml
index 9bd51d6..d271130 100644
--- a/http/jetty/pom.xml
+++ b/http/jetty/pom.xml
@@ -158,6 +158,7 @@
org.osgi.service.http.runtime,
org.osgi.service.http.runtime.dto,
org.osgi.service.http.whiteboard,
+ org.osgi.service.servlet.*,
!org.eclipse.jetty,
!org.eclipse.jetty.version,
org.eclipse.jetty.*,
@@ -242,6 +243,7 @@
org.osgi.service.http.runtime,
org.osgi.service.http.runtime.dto,
org.osgi.service.http.whiteboard,
+ org.osgi.service.servlet.*,
org.apache.felix.http.jetty
</Export-Package>
<Private-Package>