aspose file tools*
The moose likes Other Application Frameworks and the fly likes OSGi Use Cases Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "OSGi Use Cases" Watch "OSGi Use Cases" New topic
Author

OSGi Use Cases

Dan King
Ranch Hand

Joined: Mar 18, 2009
Posts: 84
Recently I've been reading about OSGi. What I've understood from my reading is that OSGi offers modularity, 'encapsulation' at the jar level, and 'hot-plugability.' But what I've not been able to discern is when is it 'appropriate' to use OSGi. For example, I have an Http Service that I implemented using CXF. Could I re-do the service using CXF over OSGi? If, yes what would need to change? Lastly, of the various implementations -- Flex, Equinox, Knopflerfish -- which one should I start with as I learn? Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42629
    
  65
Could I re-do the service using CXF over OSGi?

The question is phrased in a way that leads me to believe that you do not yet fully understand what OSGi is, and how it might be applied to a given application scenario. You probably could implement the WS using OSGi, but the salient question is - why would you? OSGi doesn't offer benefits that apply to every single use case; only once you know which problem you'd like to solve using OSGi can you make an informed decision if, and how, to use it.

Lastly, of the various implementations -- Flex, Equinox, Knopflerfish -- which one should I start with as I learn?

There's no "should". All of them implement OSGi; if you don't know enough about OSGi to discern their differences, then you might as well choose any one of them - they're all plenty mature enough.


Ping & DNS - my free Android networking tools app
Dan King
Ranch Hand

Joined: Mar 18, 2009
Posts: 84
Ulf Dittmer wrote:
The question is phrased in a way that leads me to believe that you do not yet fully understand what OSGi is, and how it might be applied to a given application scenario. You probably could implement the WS using OSGi, but the salient question is - why would you? OSGi doesn't offer benefits that apply to every single use case; only once you know which problem you'd like to solve using OSGi can you make an informed decision if, and how, to use it.


You're correct, I do not fully understand what OSGi is, nor do I fully understand which situations OSGi is suited for; the purpose of the original post was to find answers to both of those questions. So, going back to the WS example, while I could use OSGi, what criteria should I use to determine if i should use OSGi? Furthermore, if you have any example use cases that could demonstrate suitable situations for OSGi, I'd appreciate it if you could share those examples. Thanks.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42629
    
  65
Once use case is managing plugins for an application. A while ago I wrote about how to do that in stock Java. All that fiddling with classloaders and security managers would be handled by OSGi if each plugin came as an OSGi bundle. And it would be easily possible to add/chabge/remove plugins at application runtime.

The http://www.coderanch.com/how-to/java/OSGiLinks page links to a few introductory articles that may be helpful.
 
 
subject: OSGi Use Cases