Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Understanding of OSGi

 
Ranch Hand
Posts: 45
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Below is my understanding with respect to OSGi.Kindly let me know in case iam not correct in any aspect.

1) OSGi helps us to break the application into modules called Bundles.
2) So, OSGi acts like a local server where in we deploy our bundles in a jar.
3) The Dependencies are to be mentioned in the Manifest file (Just like .classpath file created in eclipse)
4) Bundle Activator is the java class that is created using OSGi API which need to override some method which is automatically when started the server.This is somthing like main method in standalone class (or) doGet() in a servlet which initiates the action
5) Apart from the above we can also configure listeners when a task has to be performed on an event
6) We can also contact other bundles which is similar to Webservices.

Kindly let me know any other benefits/purpose.

Below are my questions

1) Need Real time scenarios/Application where OSGi is used
2) Need the purpose, since am still not able to understand the purpose after going through a lot of stuff
3) Or it is used only for development purpose - If so, why cant we use JUNIT to test the modules.
\
Just want to make myself very clear to make it Simple Straight
 
Saloon Keeper
Posts: 5863
146
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#2: OSGi is just the API; the container in which the bundles run is provided by an implementation such as Apache Felix or Eclipse Equinox.

#4 and #5: Sort of. There are other interesting interfaces you can implement as well, such as BundleListener and ServiceListener. Services are sort of a higher-level API than Bundles.

Q1: OSGi has very little to do with realtime scenarios, just like Java has very little to do with realtime scenarios. Well-known applications that use OSGi are GlassFish and Eclipse.

Q2: You already mentioned modularization. OSGi also offers capabilities like adding/removing code at runtime, using different versions of the same classes within the same JVM, and updating code without stopping the JVM etc. It is a specialized technology that many applications will not need, but it does simplify tasks that require this kind of flexibility. See https://coderanch.com/how-to/java/OSGiLinks for some introductory material.

Q3: It's about deployment, not development.
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!