Download NetBeans!

20090517 Sunday May 17, 2009

Generate BundleActivators for OSGi Bundles in Netigso!

Build 132 of Netigso is pretty cool—an OSGi BundleActivator is created when you use the Module Installer wizard in an OSGI Bundle project:

  1. Create OSGi Bundle project:

  2. Specify location and whether it belongs to an application:

  3. Specify unique code name, display name, localizing bundle, and optional layer.xml file:

  4. Finish the wizard and then you have the applicable OSGi keys in your manifest, as well as a dependency on the OSGi framework, so that you can reference the OSGi container APIs (that's thanks to Build 131 of Netigso):

  5. Next, use the "Module Installer" wizard, exactly as you'd do for a NetBeans module. I.e., nothing to fill in at all, simply click Finish:

  6. And now you have a BundleActivator class, instead of a NetBeans API ModuleInstall class:

Excellent, right? Now, the main thing I'm looking forward to is services in BundleContexts being added to the Lookup of applications, so that NetBeans modules can use the Lookup to access those OSGi services!

May 17 2009, 07:36:19 AM PDT Permalink

Trackback URL: http://blogs.sun.com/geertjan/entry/generate_bundleactivators_for_osgi_bundles
Comments:

Hi Geertjan, are your BundleActivators getting called? Mine seem to be ignored... (build 142)
--Toni

Posted by Toni Epple on May 20, 2009 at 05:08 AM PDT #

Sorry it's build 143

Posted by Toni Epple on May 20, 2009 at 05:09 AM PDT #

What do you see in the Manifest? You should see the BundleActivator registered there.

Posted by Geertjan on May 20, 2009 at 09:13 AM PDT #

The Manifest is ok, the Problem is that either the output to system.out in the my bundleactivator is ignored, or start isn't called...

Posted by Toni Epple on May 26, 2009 at 07:31 AM PDT #

Works for me! Why don't you create a bundle, then send it to me, and I will integrate it into my application and then I will describe how to do so?

Posted by Geertjan Wielenga on May 26, 2009 at 07:42 AM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed