This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes OSGi In  Action - Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "OSGi In  Action - Questions" Watch "OSGi In  Action - Questions" New topic
Author

OSGi In Action - Questions

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Hello Authors,

I have not heard of OSGi so far. Had been browsing the threads here and somehow could get that OSGI is a platform for addressing the modularity issues in Java based applications.

1. Is that modularity in terms of packaging alone? or anything else?

2. Conceptually, how does the OSGi work?

3. Would there be any issues with scalability of my Java application? If so how do I address them?

Thanks,
Raghavan alias Saravanan M


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Richard S. Hall
author
Ranch Hand

Joined: Feb 14, 2011
Posts: 47
Raghavan Muthu wrote:
I have not heard of OSGi so far. Had been browsing the threads here and somehow could get that OSGI is a platform for addressing the modularity issues in Java based applications.

1. Is that modularity in terms of packaging alone? or anything else?


There is physical modularity in the sense that OSGi defines a packaging format (just a JAR file with some extra info inside) that is used for deployment. Logical modularity is created through another level of encapsulation where the visibility/exposure of code is completely controlled by the module itself. Dynamic module lifecycle management is supported (i.e., install, update, uninstall, etc). Lastly, an interface-based programming model (i.e., services) is promoted for loosely coupled collaboration among modules.

Raghavan Muthu wrote:
2. Conceptually, how does the OSGi work?


It uses a class loader per module to create and enforce modularity.

Raghavan Muthu wrote:
3. Would there be any issues with scalability of my Java application? If so how do I address them?


Depends on what sort of scalability. There isn't too much overhead associated with OSGi at execution time, so it should be an issue there. The biggest issue probably relates to the number of modules in a system, but I think most OSGi frameworks could easily handle 100s if not 1000s of modules without too much difficulty.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Thank you Richard for the answers. It is clear now!
Mike Van
Ranch Hand

Joined: Apr 06, 2006
Posts: 83
Richard S. Hall wrote:
Raghavan Muthu wrote:
Raghavan Muthu wrote:
3. Would there be any issues with scalability of my Java application? If so how do I address them?


Depends on what sort of scalability. There isn't too much overhead associated with OSGi at execution time, so it should be an issue there. The biggest issue probably relates to the number of modules in a system, but I think most OSGi frameworks could easily handle 100s if not 1000s of modules without too much difficulty.


Currently I use Felix, Karaf, and Camel to manage a system that processes millions of files of data a day. In that real-world application, I found it necessary to break out the major functional pieces of the system and run them in seperate OSGi instances, communicating via JMS. While the issues of scalability were created by our java code, breaking the pieces into seperate VM's works well to handle scalability issues. Oh, and we're running ~170 bundles in each OSGi instance.

Again, Felix + Karaf + Camel (2.5.0+) is a great way to go for back-end processing applications.


Mike Van
If at first you don't succeed, try, try again. Unless you really suck at it. Then, you might just want to try something else, if you dont' want to be a loser I mean.
 
 
subject: OSGi In Action - Questions
 
Similar Threads
osgi only for Java
* Welcome Craig Walls
Why I should use the OSGi platform?
OSGI bundling vs CDI bundling
General Questions on OSGi