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 17:34 Go to next message
Claas Wilke is currently offline Claas Wilke
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 08:40 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6857
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.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .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: Wed Jul 23 14:21:03 EDT 2014

Powered by FUDForum. Page generated in 0.01724 seconds