Apache Sling Engine Implementation

Clone this repo:
  1. 3780cd8 fix: handle IOException internally and fix session ID lookup (#77) by Carsten Ziegeler · 2 weeks ago master
  2. d48beec Add security section to AGENTS.md by Robert Munteanu · 2 weeks ago
  3. ce69e3a docs: add AGENTS.md, CLAUDE.md, and expand README (#78) by Carsten Ziegeler · 2 weeks ago
  4. 33a996f Merge pull request #76 from apache/maia/workflow-1779890019254 by Carsten Ziegeler · 3 weeks ago
  5. 9cfc844 chore(deps): bump sling-bundle-parent from 62 to 66 by Carsten Ziegeler · 3 weeks ago

Apache Sling

Build Status Test Status Coverage Sonarcloud Status JavaDoc Maven Central License

Apache Sling Engine Implementation

This module is part of the Apache Sling project and implements the core Sling request processing pipeline.

Overview

org.apache.sling.engine provides the Sling engine bundle that:

  • registers the main servlet via OSGi HTTP Whiteboard
  • resolves resources and dispatches requests
  • manages Sling filter chains and request/response wrapping
  • exposes request processor and filter processor metrics via JMX
  • supports both javax.servlet (legacy) and jakarta.servlet through adapter classes

Requirements

  • Java 17
  • Maven

Build and test

# Build and package (skip tests)
mvn clean install -DskipTests

# Full build with tests
mvn clean install

# Run all tests
mvn test

# Run a single test class
mvn test -Dtest=SlingRequestPathInfoTest

# Run tests with a name pattern
mvn test -Dtest="*FilterChain*"

# License header check (Apache RAT)
mvn apache-rat:check

# Check formatting (Spotless, inherited from parent POM)
mvn spotless:check

# Apply formatting
mvn spotless:apply

# Run Japex microbenchmarks
mvn test -Pbenchmarks

Repository layout

pom.xml                          Maven build descriptor
bnd.bnd                          OSGi bundle manifest instructions
src/
  main/java/org/apache/sling/engine/
    *.java                       Public API
    impl/                        Internal implementation
      adapter/                   javax <-> jakarta servlet adapters
      console/                   Web Console plugins
      debug/                     RequestProgressTracker integration
      filter/                    Sling filter chain management
      helper/                    Servlet context/request listener helpers
      log/                       Request logging support
      parameters/                Request parameter and multipart handling
      request/                   Request data and dispatching
    jmx/                         JMX MBean interfaces
    servlets/                    Error handler servlet API
  test/java/                     Unit tests
  test/resources/japex/          Benchmark configurations

Notes

  • OSGi Declarative Services annotations are used (org.osgi.service.component.annotations).
  • The bundle imports javax.servlet with a compatibility range and supports Jakarta Servlet API in parallel.