|
Page Edited :
SLINGxSITE :
Launch Sling
Launch Sling has been edited by Mike Mueller (Jun 01, 2009). Content:Initial Provisioning and Startup
We got a LaunchThe 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. When Sling is first started the following steps are executed:
Initial Bundle Installation by the sling-assembly BundleWhen 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: String startLevelList = bundleContext.getProperty( "sling.install.bundles" ); for ( String startLevel: startLevelList ) { String bundleList = bundleContext.getProperty( "sling.install." + startLevel ); for ( Bundle bundle: bundleList ) { if ( ! isInstalled( bundle ) ) { install( bundle ); setStartLevel( bundle, startLevel ); } } }
for ( each bundle installed ) {
start( bundle );
}
ExampleGiven the following properties sling.install.bundles = 1, 10, 20 sling.install.1 = org.apache.sling.assemblies.osgi-compendium-assembly:0.1.0, \ org.apache.sling.assemblies.sling-console-web-assembly:0.1.0 sling.install.10 = org.apache.sling.assemblies.sling-crx-server-assembly:[1,2) sling.install.20 = org.apache.sling.assemblies.sling-assembly$ These bundles will be installed:
Notes
Important PropertiesTo recapitulate here is a list of Framework properties used for initial provisioning:
Using the Sling Standalone ApplicationThe Sling Standalone Application is available as an executable JAR file and may be started by just specifying a simple command line: $ java -jar sling-app.jar 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. Using the Sling Web ApplicationLaunching 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. |
Unsubscribe or edit your notifications preferences
