Apache Incubator

Architecture of Sling

Page Status

2008-02-01: this page is out of sync with the current codebase, needs to be reviewed and updated.

Sling is an implementation of the Component API consisting of several modules. The core architectural features of Sling are as follows:

Launching

Sling may be launched as a standalone application using the Sling Application or as a Web Application running inside any Servlet API 2.3 or newer Servlet Container.

The Sling Application is a standalone Java Application which is relatively small. It contains some helper classes to launch Apache Felix as the OSGi Framework. Of course the Apache Felix Framework library as well as the OSGi Core and Compendium libraries are part of the Sling Application. These three parts are actually the only ones, which may not be exchanged through the OSGi Lifecycle Layer. To enable bootstrapping, the Sling Application also contains three bundles, which are by default deployed into the started framework: The log bundle, the assembly bundle and the Apache Felix Bundle Repository bundle. As these bundles are deployed using the OSGi Lifecycle Layer, they may of course be updated if need be.

The Sling Servlet is an extension of the Sling Application in that it contains a simple Servlet calling into the Sling Application Launcher to launch Sling inside the Web Application. Additionally, the Sling Servlet provides the hook for the integration of the OSGi Http Service running inside the framework to attach to the Servlet Container in which the Sling Servlet is running.

Servlet Container support

As we have seen, Sling may be launched as a standalone Java Application or as a Web Application inside any compliant Servlet Container. To blur the differences of the launching mechanism, Sling internally registers a Servlet with a OSGi HttpService. Depending on the launch method, the following HttpService implementations are used:

Bootstrapping Sling

The Sling launcher (standalone or web application) only contains core classes and bundles to get a first launch. After the launch, the bundle activator of the sling-assembly bundle will look at the framework properties to try to install further bundles and thus bootstrap Sling.

See Provisioning and Startup for a detailed description of this process.

Bundles of Sling

Sling consists of the following bundles: