This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Understanding of OSGi

 
Ranch Hand
Posts: 45
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 7181
166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic