Welcome to the Joint-Venture Blog from Fabio Cortesi and Stefan Jäger.
Today, I encountered a very helpful feature in Eclipse. When I am debugging code, I sometimes want to know, what’s the result of a method is. If the result it’s not assigned to a variable, it gets complicated. Take a look to this example: what is the result of add(17,19)?
public class DemoApplication { public static void main(String[] args) throws Exception { DemoApplication calc = new DemoApplication(); System.out.println(calc.divide(calc.add(17, 19), 2)); } public int add(int i, int j) { return i + j; } public int divide(int i, int j) { return i / j; } }
In earlier times, I stepped one step further to get into the method divide. Then I got the result of add(17,19) in my parameter.
There was a time, OSGi was for me just an “not understandable” abbreviation. Wiki told me, that OSGi is a framework for a dynamic component model. Huh? Is it just a specification or is it an implementation? Didn’t understand it all.
I started about two months with working a little bit with OSGi. I want to write here these parts, which were unclear for me at the beginning. It should be an introduction for everyone, who has never heard about OSGi.
Okay, let’s start.
The setup of OSGi is something like EJB.
- EJB has a specification from Sun.
- OSGi has specification from the OSGi Alliance.
- EJB need’s an application server as a platform (Weblogic, Glassfish, Websphere, JBoss, and so on) to run an “EJB” application.
- OSGi need’s also a platform to run “OSGi” application. Like an application server, which is implementing the EJB contract, an OSGi platform implements the OSGi framework specification. Currently, there some OSGi implementation out there. The most known are Equinox, Apache Felix or Knopflerfish.
Okay, now, we know, how OSGi is built. But what does it? In one sentence, it is something like a JVM with some extra features. OSGi extends the JVM and a Java program is running on that OSGi Platform instead of running directly on the JVM. OSGi offers some advantages, which I will mention shortly.
(Source: http://de.wikipedia.org/wiki/OSGi)