sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Sling Website > Launch Sling
Date Fri, 30 Jul 2010 21:55:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=SLINGxSITE&amp;forWysiwyg=true"
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="">Launch
    <h4>Page <b>edited</b> by             <a href="">Felix
                         <h4>Changes (2)</h4>
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1.
Initial Provisioning and Startup <br> <br>{note:Outdated} <br>The information
presented on this page is currently (13-Apr-2009) not up to date. We are in the process of
updating the site and will also fix this page. <br>{note} <br> <br>h2. We
got a Launch <br> <br>The most complicated tasks getting Sling or any Sling application
up and running is launching the framework and providing the initial installation. To simplify
these tasks, great efforts have been taken. The result is a Standalone Java Application -
the Sling App - and a Web Application - the Sling Servlet - with embedded libraries and a
core set of bundles and a mechanism to provide initial configuration and installation. The
following description applies to both the standalone application and the web application.
<br> <br>When Sling is first started the following steps are executed: <br>
<br>   * The initial configuration is loaded as described [here|Configuration#Initial_Configuration].
<br>   * The list of bundles embedded in the application is set to the {{felix.autostart.1}}
property. This will automatically install and start these bundles in start level 1. Currently
this list is hard coded and consists of the following bundles: <br>      * {{}}
- The OSGi Log Service implementation of Project Sling also exporting logging APIs <br>
     * {{}} - Installation and Update Management support <br>
     * {{org.apache.felix.bundlerepository}} - Apache Felix implementation of the OSGi Bundle
Repository specification. <br>   * The Apache Felix framework is launched and an URL
handler for the {{context:}} scheme is registered to provide access to the contents of the
Sling Web Application. <br>   * As soon as the Framework has been started, the {{}}
bundle inspects the Framework properties available through the {{BundleContext.getProperty(String)}}
method to install bundles from configured OSGi Bundle Repositories. <br> <br>
<br> <br>h2. Initial Bundle Installation by the sling-assembly Bundle <br>
<br>When the _sling-assembly_ bundle is started it registers a {{FrameworkEventListener}}
which justs listens for the {{FRAMEWORK_STARTED}} event. When this event comes in, the framework
is up and running, the _sling-assembly_ bundle will look at the Framework properties to see,
whether any bundles need to be installed. This is done along the lines of the following pseudo
code: <br> <br>{code} <br>String startLevelList = bundleContext.getProperty(
&quot;sling.install.bundles&quot; ); <br>for ( String startLevel: startLevelList
) { <br>    String bundleList = bundleContext.getProperty( &quot;sling.install.&quot;
+ startLevel ); <br>    for ( Bundle bundle: bundleList )  { <br>        if (
! isInstalled( bundle ) ) { <br>            install( bundle ); <br>          
 setStartLevel( bundle, startLevel ); <br>        } <br>    } <br>} <br>
<br>for ( each bundle installed ) { <br>    start( bundle ); <br>} <br>{code}
<br> <br> <br>h3. Example <br> <br>Given the following properties
<br> <br>{noformat} <br>sling.install.bundles = 1, 10, 20 <br>sling.install.1
=, \ <br>
<br>sling.install.10 =[1,2) <br>sling.install.20
=$ <br>{noformat} <br> <br> <br>These
bundles will be installed: <br> <br>|| Bundle || Version || Start Level || <br>|
{{}} | &gt;= 0.1.0 | 1 | <br>|
{{}} | &gt;= 0.1.0 | 1 | <br>|
{{}} | Any Version with Major Version
1 | 10 | <br>| {{}} | Any Version | 20 | <br>
<br> <br>*Notes* <br> <br>   # The Sling application takes care of
constructing the {{sling.install.bundles}} property from the {{sling.install.&lt;n&gt;}}
properties found from the different property sources loaded before launching the framework.
The {{sling.install.bundles}} property needs only be manually created in case the Sling Servlet
is not used to launch the OSGi framework for Sling. <br>   # Any {{sling.install.&lt;n&gt;}}
property whose start level value {{&lt;n&gt;}} is not listed in the {{sling.install.bundles}}
property is ignored. <br>   # The {{sling.install.&lt;n&gt;}} properties are
comma-separated lists of bundle specifications where each entry is a tuple of a bundle symbolic
name and an optional version range specification (see section 3.2.5, Version Ranges, in the
OSGi Service Platform Core Specification). If no version range (or single version) is specified
for an entry, any version is applicable. <br>   # The bundles listed in the {{sling.install.&lt;n&gt;}}
properties are simple bundles from the point of view of initial installation. If any of the
bundles happen to be an Assembly Bundle (see [Assembly: Bundling Bundles|Assembly]) the Assembly
Manager will take care of that bundle after the bundle has been installed. <br> <br>
<br> <br>h2. Important Properties <br> <br>To recapitulate here is
a list of Framework properties used for initial provisioning: <br> <br>|| Property
|| Description || <br>| {{obr.repository.url}} | A comma-separated list of OSGi Bundle
Repository URLs. This property is required to access the OSGi Bundle Repository to install
the bundles listed in the {{sling.install.&lt;n&gt;}} properties. See the {{org.apache.felix.bundlerepository}}
Bundle documentation for more information on this property. | <br>| {{sling.install.bundles}}
| A comma-separated list of start level numbers referring to {{sling.install.&lt;n&gt;}}
properties listing bundles to install. If this property is empty or  missing, nothing will
be installed. | <br>| {{sling.install.&lt;n&gt;}} | A comma-separated list of
bundle specifications consisting of the (required) bundle symbolic name and an (optional)
version range specification separated by colon. Any {{sling.install.&lt;n&gt;}} property
whose start level value {{&lt;n&gt;}} is not listed in the {{sling.install.bundles}},
property is ignored. | <br> <br> <br> <br>h2. Using the Sling Standalone
Application <br> <br>The Sling Standalone Application is available as an executable
JAR file and may be started by just specifying a simple command line: <br> <br>{noformat}
<br>$ java -jar sling-app.jar <br>{noformat} <br> <br>This causes
Sling to start up as described above. The configuration built into the Sling Standalone Application
causes the Apache Felix _http.jetty_ bundle to be installed to run an embedded Servlet Container
backing the OSGi HTTPService implementation used to provide the Sling Management Console.
<br> <br> <br> <br>h2. Using the Sling Web Application <br>
<br>Launching Sling in a servlet container is equally simple as using the standalone
application: Grab the _sling-servlet_ web application and deploy it into your favourite servlet
container. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Please
refer to [The Sling Launchpad] for up-to-date information on launching Sling. <br></td></tr>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>Please refer to <a href="/confluence/display/SLINGxSITE/The+Sling+Launchpad"
title="The Sling Launchpad">The Sling Launchpad</a> for up-to-date information on
launching Sling.</p>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
        <a href="">View
        <a href="">View
        <a href=";showCommentArea=true#addcomment">Add

View raw message