Module RelayOSGi runtime fieldbook
OSGi · Dynamic Module SystemsView Markdown source

HTTP Whiteboard, Jakarta REST, and web integration

Whiteboard patterns let applications publish web endpoints as services.

HTTP Whiteboard

Servlets, filters, listeners, and resources register with properties declaring patterns and context selection. The runtime tracks their lifecycle.

@Component(service = Servlet.class, property = {
  "osgi.http.whiteboard.servlet.pattern=/health/*",
  "osgi.http.whiteboard.servlet.asyncSupported=true"
})
public final class HealthServlet extends HttpServlet { }

Context helpers isolate applications and security policies. Target filters bind servlets to the intended context. Failures often come from property type, pattern, context selection, or DTO failure reasons—not from the servlet code.

Jakarta REST Whiteboard

Jakarta REST resources and applications can also be registered as services. Use standard whiteboard properties for application base, resource role, and extensions. Track the runtime's Jakarta namespace and compatible servlet stack.

Karaf web stack

Karaf 4.4.x uses Pax Web and supports feature-based provisioning. Its exact Jetty, Servlet/Jakarta, and whiteboard versions are part of the runtime compatibility matrix. Do not independently upgrade one web bundle in production without resolving and testing the complete feature.

Security

Authenticate at an explicit context/filter boundary and authorize again in the business service. Configure TLS, forwarded headers, upload limits, timeouts, error responses, and management endpoint isolation.

Feynman check

The whiteboard is a noticeboard: a servlet pins up “I handle /health/*.” The runtime installs it into the matching context. Explain how removing the service removes the route.

Module RelayIndependent study material · verify runtime details in official project documentation