2008/12/4 William Drew <[EMAIL PROTECTED]>

> I am looking for some guidance on best practices or well known approaches
> to
> building OSGi "enabled" applications. Currently I have an application that
> is started from the command line calling a class with a static main().
>
> Ø  java –classpath <whatever> com.mycompany.MyApplication
>
> I'd like to take advantage of the modularity and adability of OSGi but I'm
> not sure of the best way of approaching it. Do I embed an OSGi framework in
> the existing application? Do I start an OSGi framework and install the
> required bundles which would "start" the application? Any guidance on how
> to
> approach this or how others are OSGi enabling their applications or systems
> would be appreciated.
>

<shameless-plug>

FYI, you might want to take a quick look at the code examples here:

   http://code.google.com/p/osgi-in-action/
   http://manning.com/hall/Hall_MEAP_01.pdf

the chapter1 examples show a very simple "Hello, world" application
implemented using the module, lifecycle, and service layers in turn.

there's also a simple launcher which shows how easy it is to embed
an OSGi framework using the new launching API (note this has yet
to be finalized in the spec)

for more detail, look at the Swing-based paint example in chapters
2 to 4, which we take from being a non-OSGi app to a fully fledged
OSGi app with services.

most of the examples can be run embedded (using the launcher)
or deployed onto the various OSGi frameworks (using pax-runner)

</shameless-plug>

HTH

-- 
Cheers, Stuart

Reply via email to