Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » State doesn't return all plugin versions(Issue with State.getBundles(String symbolicName))
State doesn't return all plugin versions [message #644627] Mon, 13 December 2010 14:31 Go to next message
DK  is currently offline DK
Messages: 16
Registered: June 2010
Junior Member
I am using org.eclipse.osgi.service.resolver.State to get all versions of a Plugin installed i.e. latest version and older versions.

The code I'm using is:

 PlatformAdmin platformAdmin = Platform.getPlatformAdmin();
 State state = platformAdmin.getState();
 BundleDescription[] bundles = state.getBundles("com.my.plugin");



The State.getBundles(String symbolicName) is supposed to return all bundle descriptions with the given bundle symbolic name.

However, it is only returning the latest version 2.0.0. Older version 1.0.0 is not picked up.
Re: State doesn't return all plugin versions [message #644648 is a reply to message #644627] Mon, 13 December 2010 15:46 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

DK wrote:
>
> The State.getBundles(String symbolicName) is supposed to return all
> bundle descriptions with the given bundle symbolic name.
>
> However, it is only returning the latest version 2.0.0. Older version
> 1.0.0 is not picked up.

Is it a singleton bundle?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
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


Re: State doesn't return all plugin versions [message #644722 is a reply to message #644648] Mon, 13 December 2010 22:48 Go to previous messageGo to next message
DK  is currently offline DK
Messages: 16
Registered: June 2010
Junior Member
Yes I had to make the plugin a singleton because it defines an extension.

The plugin's extension basically defines a path to a resource (a file within the plugin).

The plugin does not contain any code.
Re: State doesn't return all plugin versions [message #644841 is a reply to message #644722] Tue, 14 December 2010 12:37 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If it's a singleton, then the system only allows one version (and you should only get back on state). This sounds like it is working correctly.

PW


Previous Topic:TableViewer with SWT.SINGLE rejects CTRL-click to clear selection
Next Topic:SaveAllAction NonPartSourcs
Goto Forum:
  


Current Time: Sat Oct 25 13:28:52 GMT 2014

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

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