Author: fmeschbe
Date: Fri Jul 27 20:02:17 2012
New Revision: 1366518
URL: http://svn.apache.org/viewvc?rev=1366518&view=rev
Log:
table fixes
Modified:
sling/site/trunk/content/documentation/development/embedding-sling.mdtext
Modified:
sling/site/trunk/content/documentation/development/embedding-sling.mdtext
URL:
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/embedding-sling.mdtext?rev=1366518&r1=1366517&r2=1366518&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/development/embedding-sling.mdtext
(original)
+++ sling/site/trunk/content/documentation/development/embedding-sling.mdtext
Fri Jul 27 20:02:17 2012
@@ -3,9 +3,9 @@ Title: Embedding Sling
The Sling Launchpad Launcher can be used to embed the OSGi Framework startup
in your own Java application. This functionality is implemented in the [Sling
Launchpad Base project]({{
refs.http://svn.apache.org/repos/asf/sling/trunk/launchpad/base.path }}). This
project has the following features:
* Builds three artifacts:
-** A standalone Java Application with the artifact qualifier *app*; e.g.
`org.apache.sling.launchpad.base-2.3.1-SNAPSHOT-app.jar`
-** A Web Application with the artifact qualifier *webapp*; e.g
`org.apache.sling.launchpad.base-2.3.1-SNAPSHOT-wepabb.war`
-** The primary artifact without an artifact qualifier; e.g.
`org.apache.sling.launchpad.base-2.3.1-SNAPSHOT.jar`
+ * A standalone Java Application with the artifact qualifier *app*; e.g.
`org.apache.sling.launchpad.base-2.3.1-SNAPSHOT-app.jar`
+ * A Web Application with the artifact qualifier *webapp*; e.g
`org.apache.sling.launchpad.base-2.3.1-SNAPSHOT-wepabb.war`
+ * The primary artifact without an artifact qualifier; e.g.
`org.apache.sling.launchpad.base-2.3.1-SNAPSHOT.jar`
* Embeds the OSGi Framework (Apache Felix) in the primary artifact
* Encapsulates the OSGi Framework in its own `URLClassLoader`
* Supports Framework restart
@@ -16,6 +16,7 @@ This page is about the internal details
# Structure
The Launcher is based on three parts:
+
1. The external part which is for example the standalone Java application's
main class or the servlet deployed into the servlet container
1. The internal part which is the OSGi framework plus helper classes to
control the framework and run initial installations
1. The bridging part, which contains API common to the external and internal
part.
@@ -31,6 +32,7 @@ The external part uses the bridging part
The bridging part is provided in the `org.apache.sling.launchpad.base.shared`
package:
| Class | Description |
+|--|--|
| Launcher | The interface implemented by the internal class matching the
external class being called to start/stop the framework. |
| LauncherClassLoader | `URLClassLoader` implementing the class loader to load
the internal part (along with the OSGi framework). This class loader only
delegates to the parent class loader any packages not contained in the
launchpad library (primary artifact of the Launchpad Base project). |
| Loader | Helper class to find the launchpad library and to create the
`LauncherClassLoader` with that library. This class is also used to actually
load the `Launcher` implementation to be called from the external launcher
class. |
@@ -59,6 +61,7 @@ The external part is comprised of a main
The standalone Java Application makes use of three classes:
| Class | Description |
+|--|--|
| Main | This is the main class whose `main` method is called by the Java VM.
This class is itself the `Notifiable` and finds the `sling.home` location from
the environment (command line parameter, system property, or environment
variable). |
| MainDelegate | This class is loaded by the `Loader` from the
`LauncherClassLoader` to actually complete the initial setup before creating
the `Sling` class to start the framework. |
| ControlListener | This class is used by the `Main` class to open a server
socket to be able to start and stop Sling as a server. This class allows for
starting (opening the server socket), status check (connecting to the socket
asking for status), and shutdown (connecting to the socket asking for
shutdown). |
@@ -89,6 +92,8 @@ The `sling.control.socket` is either a n
The `sling.control.action` takes either of three values:
+| Value | Description |
+|--|--|
| `start` | Starts a server socket as specified by the `sling.control.socket`
property. If the socket cannot be bound to (because the port is in use) an
error message is printed. Using the `start` action only makes sense when
starting the application. |
| `stop` | The `stop` action is used to stop a running application. For that a
connection is opened to the server running on the socket specified by the
`sling.control.socket` property. On this connection the server is instructed to
shut down. After executing the `stop` action, the Java application should be
terminated. |
| `status` | The `status` action is used to check the status of a running
application. For that a connection is opened to the server running on the
socket specified by the `sling.control.socket` property. On this connection the
server is queried on its status. After executing the `stop` action, the Java
application should be terminated. |
@@ -117,6 +122,7 @@ When calling the Main class through the
The web application makes use of 5 classes:
| Class | Description |
+|--|--|
| SlingServlet | This is the servlet registered in the `web.xml` descriptor
and loaded by the servlet container into which Sling is deplyoed. This class
locates the `sling.home` folder and loads the `SlingServletDelagate` to
actually launch the framework. |
| SlingSessionListener | This -- somewhat inappropriately named -- class is
registered as a listener by the Sling `web.xml` descriptor. It is called by the
servlet container and forwards events to the `SlingHttpSessionListenerDelegate`
which in turn forwards the events to the respective Servlet API listener
services registered in the OSGi Framework. |
| SlingBridge | Simple extension of the `Sling` class which registers the
system bundle's `BundleContext` as a servlet context attribute of the Sling web
application. This allows Servlet Container bridging to properly work. |