Home Projects DA-Launcher Getting Started
Getting Started with DA-Launcher Print E-mail

If your application needs to be run as a standalone application, then creating a launcher application can be done by following these steps:

  • Download da-launcher-standalone.zip and extract it locally.
  • Place your bundles and any bundles they use in the "/bundles/application-bundles" directory.
  • If there are any bundles that manage your bundles or provide infrastructural services (e.g., Spring Dynamic Modules, Logging Service, etc.) then place them in "/bundles/system-bundles" directory.
  • If you use any non-bundled libraries (JAR files that doesn't contain OSGi headers in their manifest files) then place them in "/bundles/non-bundled-libraries" directory.
  • Check the files in "/config" directory to configure DA-Launcher – Default configuration should work just fine.
  • If you want to optimize the size of your application then remove the unused OSGi Framework. It will be either “/osgi-framework/equinox”, “/osgi-framework/felix” or “/osgi-framework/knopflerfish”.

Now your application is ready to be run simply by executing one of the batch/script files in “/bin” directory.

If your application needs to be embedded in a Web Application, then creating the launcher can be done by following these steps:

  • Download da-launcher-web.war and extract it in the root directory of your Web Application. Just make sure not to overwrite your web.xml file if you need to keep it.
  • If you kept your web.xml then make sure that the contents of the web.xml file in the downloaded archive be copied to your web.xml file.
  • Repeat the steps 2-6 from the list above.

Now your OSGi-based application will be launched from your Web Application.

If your application needs to be embedded in another application you have (not Web Application), then creating the launcher can be done by following these steps:

  • Repeat the steps 1-6 from the first list.
  • Remove the “/bin” directory since you don't need it.
  • Add the contents of “/lib” directory to your application's class path.
  • Add the contents of this file to the place in your code where you would like to run DA-Launcher from.

This should run DA-Launcher from your application. Actually, the Servlet Context Listener used to embed DA-Launcher inside a Web Application works on the same principle.

You can always verify that DA-Launcher is working even if it doesn't have any bundles by checking the “/logs” directory.

All of the directories in DA-Launcher contain the about.txt file which explains what the directory does and the role of each file in it. And all the configuration files contain comments on all of the XML elements and attributes they have. It was done in this way to make DA-Launcher self documented so you wouldn't have to go for a reference material each time you forget what an element of DA-Launcher stands for.