Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Listening to removed Extensions and ExtensionPoints(How is it possible to use these methods if all they get are invalied IExtension and IExtensionPoints?)
icon9.gif  Listening to removed Extensions and ExtensionPoints [message #501353] Tue, 01 December 2009 22:34 Go to next message
Claas Wilke is currently offline Claas WilkeFriend
Messages: 5
Registered: November 2009
Junior Member
I'm currently working on a project that implements an IRegistryEventListener that uses the added(IExtension) and added(IExtensionPoint) methods as well as the removed(IExtension) and removed(IExtensionPoint) methods.

This listener manages its own registry of extensions and extensions points internally by storing additional information on them like contracts that must be fulfilled by both parties.

The problem is that every tike the removed(IExtension) orremoved(IExtensionPoint) method is invoked, the whole application crashes in an InvalidRegistryObjectException. I learned that this is because the bundle of the IExtension respectively the IExtensionPoint has been uninstalled and thus, the object is no longer valid.

Well, but what is the use of these removed() methods at all when all I get is an invalid object on which I can only invoke the isValid() method?

I can't event use these object to cache some additional information in a Map because the access to the Map crashes as well in an InvalidRegistryObjectException.
Re: Listening to removed Extensions and ExtensionPoints [message #503996 is a reply to message #501353] Wed, 16 December 2009 13:40 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

When you create objects from your IExtensions/IConfigurationElements you
could use org.eclipse.core.runtime.dynamichelpers.ExtensionTracker

When the extension is being removed you will get back an array of all
the objects you created.


Paul Webster .platform.doc.isv/guide/workbench.htm

Previous Topic:Installing feature jars instead of feature folders
Next Topic:Opening hte p2 update ui with eclipse commands?
Goto Forum:

Current Time: Sun May 27 03:44:20 GMT 2018

Powered by FUDForum. Page generated in 0.01329 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top