incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r818658 [3/23] - in /websites/staging/sling/trunk/content: ./ tutorials-how-tos/
Date Tue, 22 May 2012 08:25:36 GMT
Modified: websites/staging/sling/trunk/content/architecture.html
==============================================================================
--- websites/staging/sling/trunk/content/architecture.html (original)
+++ websites/staging/sling/trunk/content/architecture.html Tue May 22 08:25:32 2012
@@ -82,195 +82,63 @@
         <a href="/">Home</a>
       </div>
       <h1>Architecture</h1>
-      <p><a name="Architecture-ArchitectureofSling"></a></p>
-<h1 id="architecture-of-sling">Architecture of Sling</h1>
+      <h1 id="architecture-of-sling">Architecture of Sling</h1>
 <p>The following is a short list of high-lights of Sling:</p>
 <ul>
-<li>*<a href="#osgi.html">OSGi</a></li>
-<li>--- The Sling application is built as a series of OSGi bundles and makes
-heavy use of a number of OSGi core and compendium services.</li>
-<li>*<a href="#sling-api.html">#Sling API</a></li>
-<li>--- To implement content based Web applications with Sling, an API has
-been defined, this extends the Servlet API and provides more functionality
-to work on the content.</li>
-<li>*<a href="#request-processing.html">#Request Processing</a></li>
-<li>--- Sling takes a unique approach to handling requests in that a request
-URL is first resolved to a resource, then based on the resource (and only
-the resource) it selects the actual servlet or script to handle the
-request.</li>
-<li>*<a href="#resources.html">#Resources</a></li>
-<li>--- The central mantra of Sling is the <em>Resource</em>, which represents the
-resource addressed by any request URL. It is the resource that is first
-resolved when handling a request. Based on the resource, a first servlet or
-script is then accessed to actually handle the request.</li>
-<li>*<a href="#servlets-and-scripts.html">#Servlets and Scripts</a></li>
-<li>--- Servlets and Scripts are handled uniformly in that they are
-represented as resources themselves and are accessible by a resource path.</li>
-<li>*<a href="#launchpad.html">#Launchpad</a></li>
-<li>--- Sling uses a very thin launcher to integrate with an existing servlet
-container, launching Sling as a Web application or providing a main class
-to represent a standalone Java application.</li>
+<li><em><a href="">OSGi</a></em> --- The Sling application is built as a series of OSGi bundles and makes heavy use of a number of OSGi core and compendium services.</li>
+<li><em><a href="">#Sling API</a></em> --- To implement content based Web applications with Sling, an API has been defined, this extends the Servlet API and provides more functionality to work on the content.</li>
+<li><em><a href="">#Request Processing</a></em> --- Sling takes a unique approach to handling requests in that a request URL is first resolved to a resource, then based on the resource (and only the resource) it selects the actual servlet or script to handle the request.</li>
+<li><em><a href="">#Resources</a></em> --- The central mantra of Sling is the <em>Resource</em>, which represents the resource addressed by any request URL. It is the resource that is first resolved when handling a request. Based on the resource, a first servlet or script is then accessed to actually handle the request.</li>
+<li><em><a href="">#Servlets and Scripts</a></em> --- Servlets and Scripts are handled uniformly in that they are represented as resources themselves and are accessible by a resource path.</li>
+<li><em><a href="">#Launchpad</a></em> --- Sling uses a very thin launcher to integrate with an existing servlet container, launching Sling as a Web application or providing a main class to represent a standalone Java application.</li>
 </ul>
 <p>The following sections elaborate on each of these highlights.</p>
-<p><a name="Architecture-OSGi"></a></p>
 <h2 id="osgi">OSGi</h2>
-<p><a href="http://www.osgi.org">OSGi</a>
- is a consortium that has developed a specification to build modular and
-extensible applications. This offers [various benefits|http://www.osgi.org/About/WhyOSGi]
-. We deal mainly with two parts of the specifications: The Core
-Specification, which defines the OSGi Framework and Core Services, and the
-Compendium Services Specification, which defines a host of services that
-extend the functionality of the OSGi Framework.</p>
-<p><a name="Architecture-OSGiFramework"></a></p>
+<p><a href="">OSGi</a> is a consortium that has developed a specification to build modular and extensible applications. This offers [various benefits|http://www.osgi.org/About/WhyOSGi]. We deal mainly with two parts of the specifications: The Core Specification, which defines the OSGi Framework and Core Services, and the Compendium Services Specification, which defines a host of services that extend the functionality of the OSGi Framework.</p>
 <h3 id="osgi-framework">OSGi Framework</h3>
-<p>The OSGi Framework is made up of three layers -- Module, Lifecycle, and
-Services -- that define how extensible applications are built and deployed.
-The responsibilities of the layers are:</p>
+<p>The OSGi Framework is made up of three layers -- Module, Lifecycle, and Services -- that define how extensible applications are built and deployed. The responsibilities of the layers are:</p>
 <ul>
-<li><em>Module</em> --- Defines how a module, or a <em>Bundle</em> in OSGi-speak, is
-defined. Basically, a bundle is just a plain old JAR file, whose manifest
-file has some defined entries. These entries identify the bundle with a
-symbolic name, a version and more. In addition there are headers which
-define what a bundle provides -- <em>Export-Package</em> -- and what a bundle
-requires to be operative -- <em>Import-Package</em> and <em>Require-Bundle</em>.</li>
-<li><em>Lifecycle</em> --- The lifecycle layer defines the states a bundle may be in
-and describes the state changes. By providing a class, which implements the
-<em>BundleActivator</em> interface and which is named in the
-<em>Bundle-Activator</em> manifest header, a bundle may hook into the lifecycle
-process when the bundle is started and stopped.</li>
-<li><em>Services</em> --- For the application to be able to interact, the OSGi Core
-Specification defines the service layer. This describes a registry for
-services, which may be shared.</li>
+<li><em>Module</em> --- Defines how a module, or a <em>Bundle</em> in OSGi-speak, is defined. Basically, a bundle is just a plain old JAR file, whose manifest file has some defined entries. These entries identify the bundle with a symbolic name, a version and more. In addition there are headers which define what a bundle provides -- <code>Export-Package</code> -- and what a bundle requires to be operative -- <code>Import-Package</code> and <code>Require-Bundle</code>.</li>
+<li><em>Lifecycle</em> --- The lifecycle layer defines the states a bundle may be in and describes the state changes. By providing a class, which implements the <code>BundleActivator</code> interface and which is named in the <code>Bundle-Activator</code> manifest header, a bundle may hook into the lifecycle process when the bundle is started and stopped.</li>
+<li><em>Services</em> --- For the application to be able to interact, the OSGi Core Specification defines the service layer. This describes a registry for services, which may be shared.</li>
 </ul>
-<p><a name="Architecture-CompendiumServices"></a></p>
 <h3 id="compendium-services">Compendium Services</h3>
-<p>Based on the OSGi Framework specification, the Compendium Services
-specification defines a (growing) number of extension services, which may
-be used by applications for various tasks. Of these Compendium Services,
-Sling is using just a small number:</p>
+<p>Based on the OSGi Framework specification, the Compendium Services specification defines a (growing) number of extension services, which may be used by applications for various tasks. Of these Compendium Services, Sling is using just a small number:</p>
 <ul>
-<li><em>Log Service</em> --- Sling comes with its own implementation of the OSGi Log
-Service specification. The respective bundle not only provides this
-implementation, it also exports the SLF4J, Log4J and Commons Logging APIs
-needed for the Sling application to perform logging.</li>
-<li><em>Http Service</em> --- Sling leverages the OSGi Http Service to hook into a
-servlet container to provide the Web Application Framework mechanism.</li>
-<li><em>Configuration Admin Service</em> --- To simplify configuration of services
-in Sling, the OSGi Configuration Admin service is used. This provides a
-uniform API to configure services and to build configuration management
-agents.</li>
-<li><em>Metatype Service</em> --- The OSGi Metatype Service defines a way to
-describe the data types. Sling uses this service to describe the
-configurations that may be created using the Configuration Admin Service.
-These meta type descriptions are used by configuration management agents to
-present to user interface to manage the configurations.</li>
-<li><em>Event Admin Service</em> --- Sling uses the OSGi EventAdmin service to
-dispatch events when scheduling tasks.</li>
-<li><em>Declarative Services</em> --- One of the most important (beside the Log
-Service) services used by Sling is the Declarative Services Specification.
-This specification defines how to declaratively create components and
-services to have the Declarative Services runtime actually manage the
-lifecycle, configuration and references of components.</li>
+<li><em>Log Service</em> --- Sling comes with its own implementation of the OSGi Log Service specification. The respective bundle not only provides this implementation, it also exports the SLF4J, Log4J and Commons Logging APIs needed for the Sling application to perform logging.</li>
+<li><em>Http Service</em> --- Sling leverages the OSGi Http Service to hook into a servlet container to provide the Web Application Framework mechanism.</li>
+<li><em>Configuration Admin Service</em> --- To simplify configuration of services in Sling, the OSGi Configuration Admin service is used. This provides a uniform API to configure services and to build configuration management agents.</li>
+<li><em>Metatype Service</em> --- The OSGi Metatype Service defines a way to describe the data types. Sling uses this service to describe the configurations that may be created using the Configuration Admin Service. These meta type descriptions are used by configuration management agents to present to user interface to manage the configurations.</li>
+<li><em>Event Admin Service</em> --- Sling uses the OSGi EventAdmin service to dispatch events when scheduling tasks.</li>
+<li><em>Declarative Services</em> --- One of the most important (beside the Log Service) services used by Sling is the Declarative Services Specification. This specification defines how to declaratively create components and services to have the Declarative Services runtime actually manage the lifecycle, configuration and references of components.</li>
 </ul>
-<p><a name="Architecture-SlingAPI"></a></p>
 <h2 id="sling-api">Sling API</h2>
-<p>The Sling API is an extension to the Servlet API which provides more
-functionality to interact with the Sling framework and also to extend Sling
-itself and to implement Sling applications.</p>
-<p>See the <a href="sling-api.html">Sling API</a>
- page for more information.</p>
-<p><a name="Architecture-RequestProcessing"></a></p>
+<p>The Sling API is an extension to the Servlet API which provides more functionality to interact with the Sling framework and also to extend Sling itself and to implement Sling applications.</p>
+<p>See the <a href="/sling-api.html">Sling API</a> page for more information.</p>
 <h2 id="request-processing">Request Processing</h2>
-<p>Traditional Web Application framework emply more or less elaborate methods
-to select a Servlet or Controller based on the request URL, which in turn
-tries to load some data (usually from a database) to act upon and finally
-to render the result somehow.</p>
-<p>Sling turns this processing around in that it places the data to act upon
-at the center and consequently uses the request URL to first resolve the
-data to process. This data is internally represented as an instance of the
-<em>Resource</em> interface. Based on this resource as well as the request
-method and more properties of the request URL a script or servlet is then
-selected to handle the request.</p>
-<p>See the <a href="servlets.html">Servlets</a>
- page for more information.</p>
-<p><a name="Architecture-Resources"></a></p>
+<p>Traditional Web Application framework emply more or less elaborate methods to select a Servlet or Controller based on the request URL, which in turn tries to load some data (usually from a database) to act upon and finally to render the result somehow.</p>
+<p>Sling turns this processing around in that it places the data to act upon at the center and consequently uses the request URL to first resolve the data to process. This data is internally represented as an instance of the <code>Resource</code> interface. Based on this resource as well as the request method and more properties of the request URL a script or servlet is then selected to handle the request.</p>
+<p>See the <a href="/servlets.html">Servlets</a> page for more information.</p>
 <h2 id="resources">Resources</h2>
-<p>The Resource is one of the central parts of Sling. Extending from JCR's
-<em>Everything is Content</em>, Sling assumes <em>Everthing is a Resource</em>. Thus
-Sling is maintaining a virtual tree of resources, which is a merger of the
-actual contents in the JCR Repository and resources provided by so called
-resource providers.</p>
-<p>Each resource has a path by which it is addressed in the resource tree, a
-resource type and some resource metadata (such as file size, last
-modification time). It is important to understand, that a <em>Resource</em>
-instance actually is only a handle to the actual data. By virtue of the
-<em>adaptTo(Class<Type>)</em> method, a resource may be coerced into another
-data type, which may then be used while processing the request. Examples of
-data types are <em>javax.jcr.Node</em> and <em>java.io.InputStream</em>.</p>
-<p>See the <a href="resources.html">Resources</a>
- page for more information.</p>
-<p><a name="Architecture-ServletsandScripts"></a></p>
+<p>The Resource is one of the central parts of Sling. Extending from JCR's <em>Everything is Content</em>, Sling assumes <em>Everthing is a Resource</em>. Thus Sling is maintaining a virtual tree of resources, which is a merger of the actual contents in the JCR Repository and resources provided by so called resource providers.</p>
+<p>Each resource has a path by which it is addressed in the resource tree, a resource type and some resource metadata (such as file size, last modification time). It is important to understand, that a <code>Resource</code> instance actually is only a handle to the actual data. By virtue of the <code>adaptTo(Class&lt;Type&gt;)</code> method, a resource may be coerced into another data type, which may then be used while processing the request. Examples of data types are <code>javax.jcr.Node</code> and <code>java.io.InputStream</code>.</p>
+<p>See the <a href="/resources.html">Resources</a> page for more information.</p>
 <h2 id="servlets-and-scripts">Servlets and Scripts</h2>
-<p>Scripts are usually provided as content in a JCR repository. But since
-Sling is using a resource tree, a script actually is represented as a
-Resource and may be provided from within a Bundle (by virtue of the bundle
-resource provider) or even from the platform file system (by virtue of the
-file system resource provider).</p>
-<p>Accessing scripts in the resource tree, allows for a very easy to
-understand mapping from resource type to some script path.</p>
-<p>Having found the script resource, we still need access to the appropriate
-script language implementation to evaluate the script. To this avail, Sling
-is making use of the <em>Resource.adaptTo(Class<Type>)</em> method: If a script
-language implementation is available for the extension of the script name
-an adaptor for the script resource can be found, which handles the
-evaluation of the script.</p>
-<p>Besides scripting languages, such as ECMAScript, Groovy, JSP, Sling also
-supports regular servlets. To be able to use servlets for request
-processing, such servlets must be registered as OSGi services for the
-<em>javax.servlet.Servlet</em> interface and provide a number of service
-registration properties, which are used to use the servlets. In fact
-servlets thus registered as OSGi services are mapped into the resource tree
-by means of a servlet resource provider. This resource provider mapps the
-servlets into the resource tree using the service registration properties
-to build one or more resource paths for the servlet.</p>
-<p>As a result of mapping servlets into the resource tree and the possibility
-to adapt resource to an adaptor data type, scripts and servlets may be
-handled completely transparently: The servlet resolver just looks for a
-resource matching the resource type and adapts the resource found to
-<em>javax.jcr.Servlet</em>. If the resource happens to be provided by a servlet
-resource provider, the adapter is of course the servlet itself. If the
-resource happens to be a script, the adapter is a servlet facade which
-internally calls the script language implementation to evaluate the script.</p>
-<p>See the <a href="servlet-resolution.html">Servlet Resolution</a>
- page for more information.</p>
-<p><a name="Architecture-Launchpad"></a></p>
+<p>Scripts are usually provided as content in a JCR repository. But since Sling is using a resource tree, a script actually is represented as a Resource and may be provided from within a Bundle (by virtue of the bundle resource provider) or even from the platform file system (by virtue of the file system resource provider).</p>
+<p>Accessing scripts in the resource tree, allows for a very easy to understand mapping from resource type to some script path.</p>
+<p>Having found the script resource, we still need access to the appropriate script language implementation to evaluate the script. To this avail, Sling is making use of the <code>Resource.adaptTo(Class&lt;Type&gt;)</code> method: If a script language implementation is available for the extension of the script name an adaptor for the script resource can be found, which handles the evaluation of the script.</p>
+<p>Besides scripting languages, such as ECMAScript, Groovy, JSP, Sling also supports regular servlets. To be able to use servlets for request processing, such servlets must be registered as OSGi services for the <code>javax.servlet.Servlet</code> interface and provide a number of service registration properties, which are used to use the servlets. In fact servlets thus registered as OSGi services are mapped into the resource tree by means of a servlet resource provider. This resource provider mapps the servlets into the resource tree using the service registration properties to build one or more resource paths for the servlet.</p>
+<p>As a result of mapping servlets into the resource tree and the possibility to adapt resource to an adaptor data type, scripts and servlets may be handled completely transparently: The servlet resolver just looks for a resource matching the resource type and adapts the resource found to <code>javax.jcr.Servlet</code>. If the resource happens to be provided by a servlet resource provider, the adapter is of course the servlet itself. If the resource happens to be a script, the adapter is a servlet facade which internally calls the script language implementation to evaluate the script.</p>
+<p>See the <a href="/servlet-resolution.html">Servlet Resolution</a> page for more information.</p>
 <h2 id="launchpad">Launchpad</h2>
-<p>Sling may be launched as a standalone application using the Sling
-Application or as a Web Application running inside any Servlet API 2.4 or
-newer Servlet Container.</p>
-<p>The Sling Application is a standalone Java Application which is really
-small: Just the main class and some glue classes. The OSGi framework as
-well as the OSGi API libraries are packaged as a JAR file, which is loaded
-through a custom classloader. This enables to update the framework and/or
-OSGi API libraries from within Sling by updating the system bundle.</p>
-<p>The Sling Servlet is equally small as the Sling Application. It uses the
-Felix <em>HttpService</em> bridge as the glue between the servlet container and
-the OSGi framework.</p>
-<p>As we have seen, Sling may be launched as a standalone Java Application or
-as a Web Application inside any compliant Servlet Container. To hide the
-differences of the launching mechanism, Sling internally registers a
-Servlet with an OSGi <em>HttpService</em>. Regardless of how Sling is launched,
-the Felix implementation of the OSGi <em>HttpService</em> specification is used.
-When Sling is launched as a standalone Java Application, Felix HttpService
-uses an embedded version of the Jetty servlet container. When Sling is
-launched as a Web Application, the Felix HttpService Bridge is used.</p>
-<p>Optionally, PAX Web's implementation of HttpService can be used when Sling
-is launched as a standalone Java Application. See the <a href="maven-launchpad-plugin.html">Maven Launchpad Plugin</a>
- page for information on how to do this.</p>
-<p>See <a href="the-sling-launchpad.html">The Sling Launchpad</a>
- for more information.</p>
+<p>Sling may be launched as a standalone application using the Sling Application or as a Web Application running inside any Servlet API 2.4 or newer Servlet Container.</p>
+<p>The Sling Application is a standalone Java Application which is really small: Just the main class and some glue classes. The OSGi framework as well as the OSGi API libraries are packaged as a JAR file, which is loaded through a custom classloader. This enables to update the framework and/or OSGi API libraries from within Sling by updating the system bundle.</p>
+<p>The Sling Servlet is equally small as the Sling Application. It uses the Felix <code>HttpService</code> bridge as the glue between the servlet container and the OSGi framework.</p>
+<p>As we have seen, Sling may be launched as a standalone Java Application or as a Web Application inside any compliant Servlet Container. To hide the differences of the launching mechanism, Sling internally registers a Servlet with an OSGi <code>HttpService</code>. Regardless of how Sling is launched, the Felix implementation of the OSGi <code>HttpService</code> specification is used. When Sling is launched as a standalone Java Application, Felix HttpService uses an embedded version of the Jetty servlet container. When Sling is launched as a Web Application, the Felix HttpService Bridge is used.</p>
+<p>Optionally, PAX Web's implementation of HttpService can be used when Sling is launched as a standalone Java Application. See the <a href="/maven-launchpad-plugin.html">Maven Launchpad Plugin</a> page for information on how to do this.</p>
+<p>See <a href="/the-sling-launchpad.html">The Sling Launchpad</a> for more information.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000
+        Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project

Modified: websites/staging/sling/trunk/content/assembly.html
==============================================================================
--- websites/staging/sling/trunk/content/assembly.html (original)
+++ websites/staging/sling/trunk/content/assembly.html Tue May 22 08:25:32 2012
@@ -82,152 +82,48 @@
         <a href="/">Home</a>
       </div>
       <h1>Assembly</h1>
-      <p><a name="Assembly-Assembly:BundlingBundles"></a></p>
-<h1 id="assembly-bundling-bundles">Assembly: Bundling Bundles</h1>
+      <h1 id="assembly-bundling-bundles">Assembly: Bundling Bundles</h1>
 <p>{panel}
-The Assembly concept grew out of a need to bundle together a set of OSGi
-Bundles to deploy applications. The concept has been developped before the
-OSGi Deployment Package Service Specification has been published in the
-Release 4.1 Compendium Services Specification. It will have to be discussed
-whether the Assembly concept is dropped in favor of the Deplyoment Package
-Service.
+The Assembly concept grew out of a need to bundle together a set of OSGi Bundles to deploy applications. The concept has been developped before the OSGi Deployment Package Service Specification has been published in the Release 4.1 Compendium Services Specification. It will have to be discussed whether the Assembly concept is dropped in favor of the Deplyoment Package Service.
 {panel}</p>
-<p><a name="Assembly-Introduction"></a></p>
 <h2 id="introduction">Introduction</h2>
-<p>This chapter discusses the units of deployment as well as the units of
-functionality. The following contents is based on the Module and Service
-specifications of the OSGi Service Platform Core Specification, Release 4
-but enhances functionality for ease of use and in terms of best practices.</p>
-<p>The term <em>Units of Deployment</em> describes the idea of packaging up
-functionality implemented by Java Classes into modules, so called
-<em>Bundles</em>. For bigger and more complicated applications the fine grained
-modularity of <em>Bundles</em> may be to complicated, so this chapter proposes an
-extension called <em>Assembly</em>. The goal of the <em>Assembly</em> specification
-presented below is to provide functionality to delivery a collection of
-bundles belonging together.</p>
-<p>The term <em>Units of Functionality</em> describes the idea of providing services
-implemented by Java Classes, so called <em>Services</em>. A <em>Service</em> is an
-abstraction and does not actually prescribe the implementation of specific
-interfaces. Instead the OSGi specification states how functionality may be
-provided to clients by registering objects implementing interfaces defining
-the functionality in terms of a Java API.</p>
-<p><a name="Assembly-Bundles"></a></p>
+<p>This chapter discusses the units of deployment as well as the units of functionality. The following contents is based on the Module and Service specifications of the OSGi Service Platform Core Specification, Release 4 but enhances functionality for ease of use and in terms of best practices.</p>
+<p>The term <em>Units of Deployment</em> describes the idea of packaging up functionality implemented by Java Classes into modules, so called <em>Bundles</em>. For bigger and more complicated applications the fine grained modularity of <em>Bundles</em> may be to complicated, so this chapter proposes an extension called <em>Assembly</em>. The goal of the <em>Assembly</em> specification presented below is to provide functionality to delivery a collection of bundles belonging together.</p>
+<p>The term <em>Units of Functionality</em> describes the idea of providing services implemented by Java Classes, so called <em>Services</em>. A <em>Service</em> is an abstraction and does not actually prescribe the implementation of specific interfaces. Instead the OSGi specification states how functionality may be provided to clients by registering objects implementing interfaces defining the functionality in terms of a Java API.</p>
 <h2 id="bundles">Bundles</h2>
-<p>The core unit of deployment is the <em>Bundle</em>. The OSGi core specification
-defines a <em>Bundle</em> to be a Java Archive (JAR) file whose manifest - the
-<em>META-INF/MANIFEST.MF</em> file - contains specific headers identifying the
-bundle. Most manifest headers are optional with defined default values -
-only the <em>Bundle-SymbolicName</em> header is actually required and the
-<em>Bundle-ManifestVersion</em> header should be set to <em>2</em> to identify the
-bundle to be a R4 bundle. Other information defined in the manifest is the
-bundle version, the list of packages exported - provided to other bundles -
-and imported - used and required to be provided by other bundles. See
-chapter <em>3.2.1 Bundle Manifest Header</em> of the OSGi Service Platform Core
-Specification for a complete list of the defined bundle manifest headers.</p>
-<p>Bundles may be installed, updated , started, stopped and removed in an OSGi
-framework individually.</p>
-<p><a name="Assembly-Assemblies"></a></p>
+<p>The core unit of deployment is the <em>Bundle</em>. The OSGi core specification defines a <em>Bundle</em> to be a Java Archive (JAR) file whose manifest - the <code>META-INF/MANIFEST.MF</code> file - contains specific headers identifying the bundle. Most manifest headers are optional with defined default values - only the <code>Bundle-SymbolicName</code> header is actually required and the <code>Bundle-ManifestVersion</code> header should be set to <code>2</code> to identify the bundle to be a R4 bundle. Other information defined in the manifest is the bundle version, the list of packages exported - provided to other bundles - and imported - used and required to be provided by other bundles. See chapter <em>3.2.1 Bundle Manifest Header</em> of the OSGi Service Platform Core Specification for a complete list of the defined bundle manifest headers.</p>
+<p>Bundles may be installed, updated , started, stopped and removed in an OSGi framework individually.</p>
 <h2 id="assemblies">Assemblies</h2>
-<p>For the deployment of bigger systems, the number of bundles may increase
-very quickly. To ease the management of products consisting of multiple
-bundles, this chapter introduces the <em>Assembly</em>. An Assembly is simply a
-collection of bundles deployed together. An Assembly - like a Bundle - is a
-JAR file whose manifest contains specific headers. In fact, an Assembly is
-just a standard bundle, with additional functionality.</p>
-<p>Assemblies are managed by the <em>Assembly Manager</em> which itself is a bundle
-installed into the framework.</p>
-<p><a name="Assembly-Assemblymanifestheaders"></a></p>
+<p>For the deployment of bigger systems, the number of bundles may increase very quickly. To ease the management of products consisting of multiple bundles, this chapter introduces the <em>Assembly</em>. An Assembly is simply a collection of bundles deployed together. An Assembly - like a Bundle - is a JAR file whose manifest contains specific headers. In fact, an Assembly is just a standard bundle, with additional functionality.</p>
+<p>Assemblies are managed by the <em>Assembly Manager</em> which itself is a bundle installed into the framework.</p>
 <h3 id="assembly-manifest-headers">Assembly manifest headers</h3>
-<p>As an Assembly is a standard Bundle, all the defined Bundle manifest
-headers may be specified. In addition, for the <em>Assembly Manager</em> to
-recognize an assembly and for the OSGi Bundle Repository to support
-dependency resolution, the following manifest headers are defined. All
-headers are optional with documented default values except where noted.</p>
+<p>As an Assembly is a standard Bundle, all the defined Bundle manifest headers may be specified. In addition, for the <em>Assembly Manager</em> to recognize an assembly and for the OSGi Bundle Repository to support dependency resolution, the following manifest headers are defined. All headers are optional with documented default values except where noted.</p>
 <ul>
-<li><em>Assembly-Bundles</em> - The list of bundles contained in this assembly. See
-below for the definition of the syntax of this header. This header is
-required. The presence of this headers identifies an Assembly to the
-<em>Assembly Manager</em>.</li>
-<li><em>Assembly-BundleRepository</em> - A comma-separated list of URLs pointing to
-OSGi Bundle Repository descriptors. These bundle repositories will be used
-to install bundles listed in the <em>Assembly-Bundles</em> header. This header
-is optional with not default value.</li>
+<li><em>Assembly-Bundles</em> - The list of bundles contained in this assembly. See below for the definition of the syntax of this header. This header is required. The presence of this headers identifies an Assembly to the <em>Assembly Manager</em>.</li>
+<li><em>Assembly-BundleRepository</em> - A comma-separated list of URLs pointing to OSGi Bundle Repository descriptors. These bundle repositories will be used to install bundles listed in the <code>Assembly-Bundles</code> header. This header is optional with not default value.</li>
 </ul>
-<p><a name="Assembly-AssemblyLifecycle"></a></p>
 <h3 id="assembly-lifecycle">Assembly Lifecycle</h3>
 <p>An Assembly, like all bundles, may be in any of the defined bundle states:</p>
 <ul>
-<li><em>Installed</em> - The Assembly bundle has been installed into the system but
-not yet resolved. The <em>Assembly Manager</em> will try to install all bundles
-listed in the <em>Assembly-Bundles</em> header. The start levels of the bundles
-will be set according to the <em>startlevel</em> parameter. The bundles will not
-be started. If installation of one or more of the bundles fails, <em>Assembly
-Manager</em> logs an error message.</li>
-<li><em>Resolved</em> - The Assembly bundle is resolved, that is all imported
-packages are wired into the framework. The <em>Assembly Manager</em> does not
-handle this state change, rather the installed bundles will be resolved by
-the framework either automatically after installation or when started
-later.</li>
-<li><em>Started</em> - The Assembly bundle has been started by calling the
-<em>Bundle.start()</em> method. The <em>Assembly Manager</em> will start all newly
-installed and resolved bundles. Depending on the start level set on the
-bundle(s) and the current system start level, the bundles will only be
-permanently marked to start while actually starting the bundles may be
-delayed until the system enters the respective start level. If any bundle
-fails to start, an error message is logged.</li>
-<li><em>Stopped</em> - The Assembly bundle has been stopped by calling the
-<em>Bundle.stop()</em> method. All bundles belong to the Assembly and linked to
-the Assembly are also stopped.</li>
-<li><em>Unresolved</em> - The Assembly bundle has been unresolved by the system for
-any reason, possibly any missing dependencies. Assembly bundles entering
-this state are ignored by the <em>Assembly Manager</em>.</li>
-<li><em>Uninstalled</em> - The Assembly bundle is being uninstalled by calling the
-<em>Bundle.uninstall()</em> method. The <em>Assembly Manager</em> will (try to)
-uninstall all bundles listed in the <em>Assembly-Bundles</em> header.</li>
-<li><em>Updated</em> - The Assembly bundle will update all bundles installed
-previously according to the <em>Assembly-Bundles</em> header. If this header
-omits any bundle listed in the previous bundle version, the respective
-bundle is uninstalled from the system. If a bundle is already installed
-with the correct version, the installed bundle is not touched (It may
-though be uninstalled together with the Assembly Bundle if the Assembly
-Bundle is uninstalled).</li>
+<li><em>Installed</em> - The Assembly bundle has been installed into the system but not yet resolved. The <em>Assembly Manager</em> will try to install all bundles listed in the <code>Assembly-Bundles</code> header. The start levels of the bundles will be set according to the <code>startlevel</code> parameter. The bundles will not be started. If installation of one or more of the bundles fails, <em>Assembly Manager</em> logs an error message.</li>
+<li><em>Resolved</em> - The Assembly bundle is resolved, that is all imported packages are wired into the framework. The <em>Assembly Manager</em> does not handle this state change, rather the installed bundles will be resolved by the framework either automatically after installation or when started later.</li>
+<li><em>Started</em> - The Assembly bundle has been started by calling the <code>Bundle.start()</code> method. The <em>Assembly Manager</em> will start all newly installed and resolved bundles. Depending on the start level set on the bundle(s) and the current system start level, the bundles will only be permanently marked to start while actually starting the bundles may be delayed until the system enters the respective start level. If any bundle fails to start, an error message is logged.</li>
+<li><em>Stopped</em> - The Assembly bundle has been stopped by calling the <code>Bundle.stop()</code> method. All bundles belong to the Assembly and linked to the Assembly are also stopped.</li>
+<li><em>Unresolved</em> - The Assembly bundle has been unresolved by the system for any reason, possibly any missing dependencies. Assembly bundles entering this state are ignored by the <em>Assembly Manager</em>.</li>
+<li><em>Uninstalled</em> - The Assembly bundle is being uninstalled by calling the <code>Bundle.uninstall()</code> method. The <em>Assembly Manager</em> will (try to) uninstall all bundles listed in the <code>Assembly-Bundles</code> header.</li>
+<li><em>Updated</em> - The Assembly bundle will update all bundles installed previously according to the <code>Assembly-Bundles</code> header. If this header omits any bundle listed in the previous bundle version, the respective bundle is uninstalled from the system. If a bundle is already installed with the correct version, the installed bundle is not touched (It may though be uninstalled together with the Assembly Bundle if the Assembly Bundle is uninstalled).</li>
 </ul>
-<p><a name="Assembly-BundlesreferencedbymultipleAssemblyBundles"></a></p>
 <h3 id="bundles-referenced-by-multiple-assembly-bundles">Bundles referenced by multiple Assembly Bundles</h3>
-<p>It is conceivable, that bundles are listed in the <em>Assembly-Bundles</em>
-header of more than one Assembly Bundle. If this is the case, the following
-collision resolution takes place:</p>
+<p>It is conceivable, that bundles are listed in the <code>Assembly-Bundles</code> header of more than one Assembly Bundle. If this is the case, the following collision resolution takes place:</p>
 <ul>
-<li>If the version of the bundle installed by the first Assembly bundle
-handled matches the version specification of any later Assembly Bundle, the
-installed bundle is not touched. Otherwise, if the later Assembly Bundle
-lists a version specification, which is acceptable for the first Assembly
-Bundle, the installed bundle is updated to the required version. If the
-version specifications may not be matched one way or the other, the later
-Assembly Bundle fails to install.</li>
-<li>If the bundle is installed with a defined start level, the later
-Assembly Bundle will not overwrite the already set start level. If the
-start level has not been set yet it is set to the specified start level.</li>
-<li>Bundles installed through Assembly Bundles remain installed as long as
-there is at least one Assembly Bundle listing the bundle in the
-<em>Assembly-Bundles</em> header. As soon as there is no referring Assembly
-Bundle anymore, the bundle is uninstalled.</li>
-<li>Bundles not referred to by any Assembly Bundle are ignored by the
-<em>Assembly Manager</em>.</li>
-<li>Bundles installed through the <em>Assembly Manager</em> may be updated and/or
-uninstalled independently from their defining Assembly Bundle. If a bundle
-has been installed it will be reinstalled the next time the Assembly Bundle
-enters the <em>installed</em> state. If a bundle has been updated, it is not
-touched by the <em>Assembly Manager</em> as long as the updated version matches
-the version specification of the Assembly Bundle.</li>
+<li>If the version of the bundle installed by the first Assembly bundle handled matches the version specification of any later Assembly Bundle, the installed bundle is not touched. Otherwise, if the later Assembly Bundle lists a version specification, which is acceptable for the first Assembly Bundle, the installed bundle is updated to the required version. If the version specifications may not be matched one way or the other, the later Assembly Bundle fails to install.</li>
+<li>If the bundle is installed with a defined start level, the later Assembly Bundle will not overwrite the already set start level. If the start level has not been set yet it is set to the specified start level.</li>
+<li>Bundles installed through Assembly Bundles remain installed as long as there is at least one Assembly Bundle listing the bundle in the <code>Assembly-Bundles</code> header. As soon as there is no referring Assembly Bundle anymore, the bundle is uninstalled.</li>
+<li>Bundles not referred to by any Assembly Bundle are ignored by the <em>Assembly Manager</em>.</li>
+<li>Bundles installed through the <em>Assembly Manager</em> may be updated and/or uninstalled independently from their defining Assembly Bundle. If a bundle has been installed it will be reinstalled the next time the Assembly Bundle enters the <em>installed</em> state. If a bundle has been updated, it is not touched by the <em>Assembly Manager</em> as long as the updated version matches the version specification of the Assembly Bundle.</li>
 </ul>
-<p><a name="Assembly-BundleInstallation"></a></p>
 <h3 id="bundle-installation">Bundle Installation</h3>
-<p>When an Assembly is installed into the framework, the <em>Assembly Manager</em>
-checks to see whether the Assembly needs to be deployed. This is done by
-checking the bundles listed in the <em>Assembly-Bundles</em> header whether they
-are installed or not. All bundles not installed will be installed and
-started if requested so.</p>
+<p>When an Assembly is installed into the framework, the <em>Assembly Manager</em> checks to see whether the Assembly needs to be deployed. This is done by checking the bundles listed in the <code>Assembly-Bundles</code> header whether they are installed or not. All bundles not installed will be installed and started if requested so.</p>
 <p>The following BNF defines the syntax =Assembly-Bundles= header value:</p>
 <div class="codehilite"><pre><span class="n">Assembly</span><span class="o">-</span><span class="n">Bundles</span> <span class="o">=</span> <span class="n">Bundle</span> <span class="p">{</span> <span class="s">&quot;,&quot;</span> <span class="n">Bundle</span> <span class="p">}</span> <span class="o">.</span>
 <span class="n">Bundle</span> <span class="o">=</span> <span class="n">Symbolic</span><span class="o">-</span><span class="n">Name</span> <span class="p">{</span> <span class="s">&quot;;&quot;</span> <span class="n">Parameter</span> <span class="p">}</span> <span class="o">.</span>
@@ -236,97 +132,40 @@ started if requested so.</p>
 </pre></div>
 
 
-<p>To control the selection and installation of bundles, the following
-parameters may be used:</p>
+<p>To control the selection and installation of bundles, the following parameters may be used:</p>
 <ul>
-<li><em>version</em> - The version of the bundle to install. This is a version range
-specification as per chapter 3.2.5 Version Ranges of the OSGi core
-specification. When this parameter is declared as a single version - eg.
-<em>1.2.3</em> - it is interpreted as the version range <em>~[1.2.3, &infin;~)</em>. The
-default value is <em>~[0.0.0,&infin;~)</em> to install the most recent version of
-the bundle available.</li>
-<li><em>startlevel</em> - The start level to set for the bundle. This may be any
-positive integer value. Default value is undefined to use the current
-initial bundle start level of the framework.</li>
-<li><em>entry</em> - The path of the Assembly Bundle entry providing the data to be
-installed.</li>
-<li><em>linked</em> - Defines whether the bundle should be started and stopped
-together with the Assembly to which the bundle belongs. Default value is
-<em>true</em>.</li>
+<li><em>version</em> - The version of the bundle to install. This is a version range specification as per chapter 3.2.5 Version Ranges of the OSGi core specification. When this parameter is declared as a single version - eg. <em>1.2.3</em> - it is interpreted as the version range <em>~[1.2.3, &infin;~)</em>. The default value is <em>~[0.0.0,&infin;~)</em> to install the most recent version of the bundle available.</li>
+<li><em>startlevel</em> - The start level to set for the bundle. This may be any positive integer value. Default value is undefined to use the current initial bundle start level of the framework.</li>
+<li><em>entry</em> - The path of the Assembly Bundle entry providing the data to be installed.</li>
+<li><em>linked</em> - Defines whether the bundle should be started and stopped together with the Assembly to which the bundle belongs. Default value is <code>true</code>.</li>
 </ul>
-<p>If resolving the bundles results in more bundles to be downloaded from the
-bundle repository to resolve the dependency, these bundles are always
-automatically started and assigned a startlevel which is smaller than the
-smallest startlevel of any of the bundles listed.</p>
-<p><a name="Assembly-BundleLocation"></a></p>
+<p>If resolving the bundles results in more bundles to be downloaded from the bundle repository to resolve the dependency, these bundles are always automatically started and assigned a startlevel which is smaller than the smallest startlevel of any of the bundles listed.</p>
 <h3 id="bundle-location">Bundle Location</h3>
-<p>Generally bundles to be installed with an Assembly Bundle are retrieved
-from an OSGi Bundle Repository. The <em>Assembly-BundleRepository</em> header
-may list additional URLs which will be temporarily used to resovle the
-bundles. Otherwise the system default bundle repositories will be used
-only.</p>
-<p>If a bundle is defined in the <em>Assembly-Bundles</em> header with an <em>entry</em>
-parameter, the respective entry is first looked for in the Assembly Bundle.
-If the entry exists, it is used as the bundle source to install. If no
-<em>entry</em> parameter is present for a declared bundle or the entry is
-missing, the OSGi Bundle Repository is used.</p>
+<p>Generally bundles to be installed with an Assembly Bundle are retrieved from an OSGi Bundle Repository. The <code>Assembly-BundleRepository</code> header may list additional URLs which will be temporarily used to resovle the bundles. Otherwise the system default bundle repositories will be used only.</p>
+<p>If a bundle is defined in the <code>Assembly-Bundles</code> header with an <code>entry</code> parameter, the respective entry is first looked for in the Assembly Bundle. If the entry exists, it is used as the bundle source to install. If no <code>entry</code> parameter is present for a declared bundle or the entry is missing, the OSGi Bundle Repository is used.</p>
 <p>Restrictions when packaging bundles with the Assembly:</p>
 <ul>
-<li><em>Dependency Resolution</em> - Any missing dependencies of the bundles to be
-installed will not be resolved. That is, if the bundles fail to resolve,
-the Assembly fails to install.</li>
-<li><em><em>version</em> Parameter</em> - The <em>version</em> parameter of the bundle
-installation declaration is ignored because any JAR file whose name matches
-the bundle symbolic name to be installed, is installed.</li>
+<li><em>Dependency Resolution</em> - Any missing dependencies of the bundles to be installed will not be resolved. That is, if the bundles fail to resolve, the Assembly fails to install.</li>
+<li><em><code>version</code> Parameter</em> - The <code>version</code> parameter of the bundle installation declaration is ignored because any JAR file whose name matches the bundle symbolic name to be installed, is installed.</li>
 </ul>
-<p>If the <em>Assembly-BundleRepository</em> header contains a comma-separated list
-of URL to OSGi Bundle Repository descriptors and the OSGi Bundle Repository
-Service is available in the framework, the bundles declared in the
-<em>Assembly-Bundles</em> header are resolved through the OSGi Bundle Repository
-Service using the URL from the <em>Assembly-BundleRepository</em> header.</p>
-<p>If the bundles declare any dependencies, which may not be resolved by
-bundles already installed in the framework or by any of the bundles to be
-installed, the OSGi Bundle Repository is used to try to resolve these
-missing dependencies. If this resolution succeeds, installation of the
-Assembly succeeds. Any bundles not declared in the Assembly but installed
-due to this dependency resolution will not be assumed to belong to the
-Assembly. Hence, these bundles will not be uninstalled (or updated) if the
-Assembly is uninstalled (or updated).</p>
+<p>If the <code>Assembly-BundleRepository</code> header contains a comma-separated list of URL to OSGi Bundle Repository descriptors and the OSGi Bundle Repository Service is available in the framework, the bundles declared in the <code>Assembly-Bundles</code> header are resolved through the OSGi Bundle Repository Service using the URL from the <code>Assembly-BundleRepository</code> header.</p>
+<p>If the bundles declare any dependencies, which may not be resolved by bundles already installed in the framework or by any of the bundles to be installed, the OSGi Bundle Repository is used to try to resolve these missing dependencies. If this resolution succeeds, installation of the Assembly succeeds. Any bundles not declared in the Assembly but installed due to this dependency resolution will not be assumed to belong to the Assembly. Hence, these bundles will not be uninstalled (or updated) if the Assembly is uninstalled (or updated).</p>
 <ul>
-<li><em>Example</em> - Assume the <em>Assembly-Bundles</em> header is set to
-<em>org.apache.sling.sample1;entry=path.jar,org.apache.sling.sample2</em>. The
-bundle <em>org.apache.sling.sample1</em> is then installed from the Assembly
-Bundle entry <em>path.jar</em>, while the bundle <em>org.apache.sling.sample2</em> is
-resolved in the OSGi Bundle Repository.</li>
+<li><em>Example</em> - Assume the <code>Assembly-Bundles</code> header is set to <code>org.apache.sling.sample1;entry=path.jar,org.apache.sling.sample2</code>. The bundle <code>org.apache.sling.sample1</code> is then installed from the Assembly Bundle entry <code>path.jar</code>, while the bundle <code>org.apache.sling.sample2</code> is resolved in the OSGi Bundle Repository.</li>
 </ul>
-<p><a name="Assembly-BestPractices"></a></p>
 <h2 id="best-practices">Best Practices</h2>
-<p><a name="Assembly-SizeofBundles"></a></p>
 <h3 id="size-of-bundles">Size of Bundles</h3>
-<p>There is no fixed formula to calculate the best size for a bundle: It all
-depends on the contents and the intentions of the bundle and its
-programmer. The following list provides some hints:</p>
+<p>There is no fixed formula to calculate the best size for a bundle: It all depends on the contents and the intentions of the bundle and its programmer. The following list provides some hints:</p>
 <ul>
 <li>For ease of development follow the idea of <em>One Bundle - One Project</em></li>
-<li>Don't pack too much into a bundle but do not pack a single class into
-a bundle (unless you have a very good reason of course :-) )</li>
-<li>Do not mix and match everything into a bundle. Rather bundle things
-together which belong together, for example create separate bundles for a
-HTTP Client implementation and DB support classes</li>
-<li>Use similar heuristics to decide on the contents of a bundle as you
-would for the contents of a plain old JAR file.</li>
+<li>Don't pack too much into a bundle but do not pack a single class into a bundle (unless you have a very good reason of course :-) )</li>
+<li>Do not mix and match everything into a bundle. Rather bundle things together which belong together, for example create separate bundles for a HTTP Client implementation and DB support classes</li>
+<li>Use similar heuristics to decide on the contents of a bundle as you would for the contents of a plain old JAR file.</li>
 </ul>
-<p><a name="Assembly-NomenestOmen"></a></p>
 <h3 id="nomen-est-omen">Nomen est Omen</h3>
-<p>The symbolic name of a bundle should reflect its contents. A bundle should
-generally only contain a single subtree in the virtual package tree. The
-symbolic name of the bundle should be the root package contained within.
-For example, consider a bundle containing the packages
-<em>org.apache.sling.sample</em>, <em>org.apache.sling.sample.impl</em>,
-<em>org.apache.sling.more</em>. The bundle would the be named
-<em>org.apache.sling.sample</em>.</p>
+<p>The symbolic name of a bundle should reflect its contents. A bundle should generally only contain a single subtree in the virtual package tree. The symbolic name of the bundle should be the root package contained within. For example, consider a bundle containing the packages <code>org.apache.sling.sample</code>, <code>org.apache.sling.sample.impl</code>, <code>org.apache.sling.more</code>. The bundle would the be named <code>org.apache.sling.sample</code>.</p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1328899 by fmeschbe on Sun, 22 Apr 2012 16:52:13 +0000
+        Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project

Added: websites/staging/sling/trunk/content/authentication-actors.html
==============================================================================
--- websites/staging/sling/trunk/content/authentication-actors.html (added)
+++ websites/staging/sling/trunk/content/authentication-actors.html Tue May 22 08:25:32 2012
@@ -0,0 +1,138 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    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.
+-->
+  <head>
+    <title>Apache Sling - Authentication - Actors</title>
+    <link rel="stylesheet" href="/css/site.css" type="text/css" media="all">
+    <link rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://sling.apache.org/site/index.html">
+          <img border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><strong>Documentation</strong> <br />
+<a href="/getting-started.html">Getting Started</a> <br />
+<a href="/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/development.html">Development</a> <br />
+<a href="/bundles.html">Bundles</a> <br />
+<a href="/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/configuration.html">Configuration</a> <br />
+<a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a> <br />
+<a href="/sitemap.html">Site Map</a></p>
+<p><strong>API Docs</strong>  <br />
+<a href="http://sling.apache.org/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="http://sling.apache.org/apidocs/sling5/index.html">Sling 5</a> <br />
+</p>
+<p><strong>Project info</strong> <br />
+<a href="http://sling.apache.org/site/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Browse Source Repository</a> <br />
+<a href="/security.html">Security</a> <br />
+</p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a> <br />
+</p>
+<iframe 
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left" frameborder="0" 
+    scrolling="no"
+    width="135" 
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>
+      </div>
+      <h1>Authentication - Actors</h1>
+      <h1 id="actors">Actors</h1>
+<p>The authentication process involves a number of actors contributing to the concepts, the API and the particular implementations.</p>
+<h2 id="osgi-http-service-specification">OSGi Http Service Specification</h2>
+<p>The main support for authentication is defined by the OSGi Http Service specification. This specification defines how an OSGi application can register servlets and resources to build web applications. As part of the servlet and/or resource registration a <code>HttpContext</code> may be provided, which allows for additional support.</p>
+<p>The main method of interest to the authentication process is the <code>handleSecurity</code> method. This is called by the OSGi Http Service implementation before the registered servlet is called. Its intent is to authenticate the request and to provide authentication information for the request object: the authentication type and the remote user name.</p>
+<p>The Sling Commons Auth bundle provides the <code>AuthenticationSupport</code> service which may be used to the implement the <code>HttpContext.handleSecurity</code> method.</p>
+<h2 id="sling-engine">Sling Engine</h2>
+<p>The Sling Engine implements the main entry point into the Sling system by means of the <code>SlingMainServlet</code>. This servlet is registered with the OSGi Http Service and provides a custom <code>HttpContext</code> whose <code>handleSecurity</code> method is implemented by the <code>AuthenticationSupport</code> service.</p>
+<p>When the request hits the <code>service</code> method of the Sling Main Servlet, the resource resolver provided by the <code>AuthenticationSupport</code> service is retrieved from the request attributes and used as the resource resolver for the request.</p>
+<p>That's all there is for the Sling Engine to do with respect to authentication.</p>
+<h2 id="sling-commons-auth">Sling Commons Auth</h2>
+<p>The support for authenticating client requests is implemented in the Sling Commons Auth bundle. As such this bundle provides three areas of support</p>
+<ul>
+<li><code>AuthenticationHandler</code> service interface. This is implemented by services providing functionality to extract credentials from HTTP requests.</li>
+<li><code>Authenticator</code> service interface. This is implemented by the <code>SlingAuthenticator</code> class in the Commons Auth bundle and provides applications with entry points to login and logout.</li>
+<li><code>AuthenticationSupport</code> service interface. This is implemented by the <code>SlingAuthenticator</code> class in the Commons Auth bundle and allows applications registering with the OSGi HTTP Service to make use of the Sling authentication infrastructure.</li>
+</ul>
+<h2 id="jcr-repository">JCR Repository</h2>
+<p>The actual process of logging into the repository and provided a <code>Session</code> is implementation dependent. In the case of Jackrabbit extensibility is provided by configuration of the Jackrabbit repository by means of an interface and two helper classes:</p>
+<ul>
+<li><code>LoginModule</code> -- The interface to be implemented to provide login processing plugins</li>
+<li><code>AbstractLoginModule</code> -- A an abstract base class implementation of the <code>LoginModule</code> interface.</li>
+<li><code>DefaultLoginModule</code> -- The default implementation of the <code>AbstractLoginModule</code> provided by Jackabbit. This login module takes <code>SimpleCredentials</code> and uses the repository to lookup the users, validate the credentials and providing the <code>Principal</code> representing the user towards the repository.</li>
+</ul>
+<p>The Sling Jackrabbit Embedded Repository bundle provides additional plugin interfaces to extend the login process dynamically using OSGi services. To this avail the bundle configures a <code>LoginModule</code> with the provided default Jackrabbit configuration supporting these plugins:</p>
+<ul>
+<li><code>LoginModulePlugin</code> -- The main service interface. Plugins must implement this interface to be able to extend the login process. See for example the <a href="">Sling OpenID authentication handler</a>, which implements this interface to support OpenID authentication.</li>
+<li><code>AuthenticationPlugin</code> -- Helper interface for the <code>LoginModulePlugin</code>.</li>
+</ul>
+<h2 id="sling-applications">Sling Applications</h2>
+<p>Sling Applications requiring authenticed requests should not care about how authentication is implemented. To support such functionality the <code>Authenticator</code> service is provided with two methods:</p>
+<ul>
+<li>
+<p><code>login</code> -- allows the application to ensure requests are authenticated. This involves selecting an <code>AuthenticationHandler</code> to request credentials for authentication.</p>
+</li>
+<li>
+<p><code>logout</code> -- allows the application to forget about any authentication. This involves selecting an <code>AuthenticationHandler</code> to forget about credentials in the request.</p>
+</li>
+</ul>
+<p>Sling Applications should never directly use any knowledge of any authentication handler or directly call into an authentication handler. This will certainly break the application and cause unexpected behaviour.</p>
+<p>{info}
+If you want to know whether a request is authenticated or not, you can inspect the result of the <code>HttpServletRequest.getAuthType</code> method: If this method returns <code>null</code> the request is not authenticated.
+{info}</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>

Added: websites/staging/sling/trunk/content/authentication-authenticationhandler.html
==============================================================================
--- websites/staging/sling/trunk/content/authentication-authenticationhandler.html (added)
+++ websites/staging/sling/trunk/content/authentication-authenticationhandler.html Tue May 22 08:25:32 2012
@@ -0,0 +1,127 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!--
+
+    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.
+-->
+  <head>
+    <title>Apache Sling - Authentication - AuthenticationHandler</title>
+    <link rel="stylesheet" href="/css/site.css" type="text/css" media="all">
+    <link rel="icon" href="http://sling.apache.org/site/media.data/favicon.ico">
+    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+  </head>
+  <body>
+    <div class="title">
+      <div class="logo">
+        <a href="http://sling.apache.org/site/index.html">
+          <img border="0" alt="Apache Sling" src="http://sling.apache.org/site/media.data/logo.png">
+        </a>
+      </div>
+      <div class="header">
+        <a href="http://www.apache.org/">
+          <img border="0" alt="Apache" src="http://sling.apache.org/site/media.data/apache.png">
+        </a>
+      </div>
+    </div>
+    
+    <div class="menu"> 
+      <p><strong>Documentation</strong> <br />
+<a href="/getting-started.html">Getting Started</a> <br />
+<a href="/the-sling-engine.html">The Sling Engine</a> <br />
+<a href="/development.html">Development</a> <br />
+<a href="/bundles.html">Bundles</a> <br />
+<a href="/tutorials-how-tos.html">Tutorials &amp; How-Tos</a> <br />
+<a href="/configuration.html">Configuration</a> <br />
+<a href="http://s.apache.org/sling.wiki">Wiki</a> <br />
+<a href="http://s.apache.org/sling.faq">FAQ</a> <br />
+<a href="/sitemap.html">Site Map</a></p>
+<p><strong>API Docs</strong>  <br />
+<a href="http://sling.apache.org/apidocs/sling6/index.html">Sling 6</a> <br />
+<a href="http://sling.apache.org/apidocs/sling5/index.html">Sling 5</a> <br />
+</p>
+<p><strong>Project info</strong> <br />
+<a href="http://sling.apache.org/site/downloads.cgi">Downloads</a> <br />
+<a href="http://www.apache.org/licenses/">License</a> <br />
+<a href="/contributing.html">Contributing</a> <br />
+<a href="/news.html">News</a> <br />
+<a href="/links.html">Links</a> <br />
+<a href="/project-information.html">Project Information</a> <br />
+<a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a> <br />
+<a href="http://svn.apache.org/viewvc/sling/trunk">Browse Source Repository</a> <br />
+<a href="/security.html">Security</a> <br />
+</p>
+<p><strong>Sponsorship</strong> <br />
+<a href="http://www.apache.org/foundation/thanks.html">Thanks</a> <br />
+<a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a> <br />
+<a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a> <br />
+</p>
+<iframe 
+    src="http://www.apache.org/ads/button.html"
+    style="border-width:0; float: left" frameborder="0" 
+    scrolling="no"
+    width="135" 
+    height="135">
+</iframe>
+    </div>
+    
+    <div class="main">
+      <div class="breadcrump" style="font-size: 80%;">
+        <a href="/">Home</a>
+      </div>
+      <h1>Authentication - AuthenticationHandler</h1>
+      <h1 id="authenticationhandler">AuthenticationHandler</h1>
+<p>The <code>AuthenticationHandler</code> interface defines the service API which may be implemented by authentication handlers registered as OSGi services.</p>
+<p><code>AuthenticationHandler</code> services have a single required service registration property which is used to identify requests to which the <code>AuthenticationHandler</code> service is applicable:</p>
+<p>| <code>path</code> | One or more (array or vector) string values indicating the request URLs to which the <code>AuthenticationHandler</code> is applicable. |
+| <code>authtype</code> | The authentication type implemented by this handler. This is a string value property and should be the same as will be used as the authentication type of the <code>AuthenticationInfo</code> object provided by the <code>extractCredentials</code> method. If this property is set, the <code>requestCredentials</code> method of the authentication handler is only called if the <code>sling:authRequestLogin</code> request parameter is either not set or is set to the same value as the <code>authtype</code> of the handler. This property is optional. If not set, the <code>requestCredentials</code> method is always called regardless of the value of the <code>sling:authRequestLogin</code> request parameter. |</p>
+<p>Each path may be an absolute URL, an URL with just the host/port and path or just a plain absolute path:</p>
+<p>| URL part | Scheme | Host/Port | Path |
+| Absolute URL | must match | must match | request URL path is prefixed with the path |
+| Host/Port with Path | ignored | must match | request URL path is prefixed with the path |
+| Path | ignored | ignored | request URL path is prefixed with the path |</p>
+<p>When looking for an <code>AuthenticationHandler</code> the authentication handler is selected whose path is the longest match on the request URL. If the service is registered with Scheme and Host/Port, these must exactly match for the service to be eligible. If multiple <code>AuthenticationHandler</code> services are registered with the same length matching path, the handler with the higher service ranking is selected{footnote}Service ranking is defined by the OSGi Core Specification as follows: <em>If multiple qualifying service interfaces exist, a service with the highest <code>service.ranking</code> number, or when equal to the lowest <code>service.id</code>, determines which service object is returned by the Framework</em>.{footnote}.</p>
+<p>The value of <code>path</code> service registration property value triggering the call to any of the <code>AuthenticationHandler</code> methods is available as the <code>path</code> request attribute (for the time of the method call only). If the service is registered with multiple path values, the value of the <code>path</code> request attribute may be used to implement specific handling.</p>
+<h3 id="implementations-provided-by-sling">Implementations provided by Sling</h3>
+<ul>
+<li><a href="/form-based-authenticationhandler.html">Form Based AuthenticationHandler</a></li>
+<li><a href="/openid-authenticationhandler.html">OpenID AuthenticationHandler</a></li>
+</ul>
+<h3 id="sample-implementations">Sample implementations</h3>
+<h4 id="http-basic-authentication-handler">HTTP Basic Authentication Handler</h4>
+<ul>
+<li><code>extractCredentials</code> -- Get user name and password from the <code>Authorization</code> HTTP header</li>
+<li><code>requestCredentials</code> -- Send a 401/UNAUTHORIZED status with <code>WWW-Authenticate</code> response header setting the Realm</li>
+<li><code>dropCredentials</code> -- Send a 401/UNAUTHORIZED status with <code>WWW-Authenticate</code> response header setting the Realm</li>
+</ul>
+<p>Interestingly the <code>dropCredentials</code> method is implemented in the same way as the <code>requestCredentials</code> method. The reason for this is, that HTTP Basic authentication does not have a notion of login and logout. Rather the request is accompanied with an <code>Authorization</code> header or not. The contents of this header is usually cached by the client browser. So logout is actually simulated by sending a 401/UNAUTHORIZED status thus causing the client browser to clear the cache and ask for user name and password.</p>
+<h4 id="form-based-authentication-handler">Form Based Authentication Handler</h4>
+<ul>
+<li><code>extractCredentials</code> -- Get user name and password with the help of a special cookie (note, that of course the cookie should not contain this data, but refer to it in an internal store of the authentication handler). If the cookie is not set, check for specific login parameters to setup the cookie.</li>
+<li><code>requestCredentials</code> -- Send the login form for the user to provide the login parameters.</li>
+<li><code>dropCredentials</code> -- Clear the authentication cookie and internal store.</li>
+</ul>
+<p>///Footnotes Go Here///</p>
+      <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
+        Rev. 1341347 by fmeschbe on Tue, 22 May 2012 08:25:18 +0000
+      </div>
+      <div class="trademarkFooter"> 
+        Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project
+        logo are trademarks of The Apache Software Foundation. All other marks mentioned
+        may be trademarks or registered trademarks of their respective owners.
+      </div>
+    </div>
+  </body>
+</html>



Mime
View raw message