Enterprise Integration Zone is brought to you in partnership with:

Ankur Sharma co-leads Eclipse Plug-in Development Environment (PDE) project. He holds a Masters degree in Computer Applications and has been working in Software Industry since 2002. Ankur is a DZone MVB and is not an employee of DZone and has posted 11 posts at DZone. View Full User Profile

Did My Plug-in Load?

05.26.2013
| 5810 views |
  • submit to reddit
One of the most frequent question I get asked is 'How to check if my plug-in is getting picked up properly?' The easiest way to verify is by using Host OSGi Console.
Note that if you do not see 'osgi>' prompt, just press Enter key once. Now you can issue OSGi commands and verify the status of your plug-in


ss is OSGi command to check the status of a plug-in.
Issue help command to see other commands possible as osgi prompt.

You may find some more info at

Useful Equinox OSGi commands Debugging your OSGi Application using OSGi console commands So the STARTING status means that the plug-in has been discovered but not loaded yet (lazy loading - no class from this plug-in has been requested yet). Once you invoke a functionality that shall need this plug-in, the status shall change to ACTIVE. This would mean that your plug-in is now been loaded into memory. This is fine, how did we land to OSGi console and how to use Self Hosting? Self Hosting is nothing but launching your plug-ins with 'Eclipse Application' launch configuration. This launches a new Eclipse instance (called guest instance) having your chosen plug-ins along with the Target Platform
So can be done now is, self-host your eclipse plug-ins. Invoke the Console view and switch to OSGi console and have a look at the state of your plug-ins. This will tell if the Eclipse was able to locate and load plug-ins.

But you want more.

How would you verify the manifest or plugin.xml for the plug-in that got loaded. Typical stuff to check when an extension is not behaving.

Invoke the Plug-ins view. It will show all the plug-ins with which the Guest Eclipse was launch. That is, target platform plus selected workspace plug-ins. You can find you plug-in in this view and expand it to see all its contents. Since, it not a binary plug-in but coming straight from the workspace, you can view the source code that got built and used for this plug-in.

Interestingly, there is one more friend - Plug-in Registry view. This would tell you the location from where the plug-in was picked. The extensions and extension points detected by Eclipse and the dependency tree.

With these views, you can pin point on what code got loaded, from where and what state it is in now.

 

Published at DZone with permission of Ankur Sharma, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)