Geertjan's Blog

  • March 18, 2008

Pluggable Photo Album Ported to the NetBeans Platform

Geertjan Wielenga
Product Manager
A few days ago I blogged about using the NetBeans Lookup API outside the NetBeans Platform. I referred to the very handy Creating Extensible Applications With the Java Platform, by John O'Conner, and then wrote How to Create a Pluggable Photo Album in Java on Javalobby. The next logical step was to move my pluggable photo album to the NetBeans Platform:

Now, instead of three Java applications, I have three modules. The first (module 1) provides the TopComponent, an SPI for photos, and a service that acts as a bridge between the SPI and the providers (module 2 and module 3). The photos are NOT in module 1. They come from module 2 and module 3. Below you see the content of module 2, which is the same structure as module 3. Both implement the Photo class provides by module 1. They also use the META-INF/services folder to register their Photo implementation:

Next, I will explore the special features that the Lookup class provides over those provided by the JDK 6 ServiceLoader class. For example... the LookupListener class, which should be very interesting to examine in this context. And I am expecting other benefits too.

By the way, I highly recommend the procedure I used to get to this point: take a NetBeans API through its paces outside the NetBeans Platform, where possible, and then port the application to the NetBeans Platform to reap the additional rewards that the NetBeans Platform gives you.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.