Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Recommendations for provider id when using the equinox extension registry
Recommendations for provider id when using the equinox extension registry [message #53907] Thu, 01 December 2005 23:51 Go to next message
Jim DAnjou is currently offline Jim DAnjouFriend
Messages: 25
Registered: July 2009
Junior Member
I am exploring the new extension registry that can be used independent of
eclipse. The method IExtensionRegistry.addXMLContribution takes as input a
provider id defined as a long. I presume this has its heritage in OSGI
bundles.
I would appreciate any recommendations on how to best derive a id in this
form from a string since that is what is referenced by extension points
and their extensions. I looked for some correlation between
Bundle-SymbolicName (a string) and BundleId (a long) but could not find
something helpful. I know how to derive a long from a string by obtaining
it's hashcode but I am not sure that this approach is sufficiently robust
to guarantee uniqueness.

Thanks
Jim D'Anjou
Re: Recommendations for provider id when using the equinox extension registry [message #53995 is a reply to message #53907] Fri, 02 December 2005 01:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_nospam_mcaffer.ca.ibm.com

Hey Jim

That long id will change very shortly to be a String. You are right in
identifying its OSGi heritage. Expect to see some new code in the repo real
soon now.

BTW, the framework assigns the long bundle ids according to the order in
which the bundles are installed. They are used to uniquely identify the
bundle without having to talk in terms of symbolic id and version. So there
is no overt corelation until you actually install the bundle. For fun,
start Eclipse with -console. Then at the osgi> prompt, type ss. you will
see a number list of bundles and symbolic names (and versions). That is the
relationship.

Jeff

"Jim D'Anjou" <danjou@us.ibm.com> wrote in message
news:8b86990febddec3587abfb51c5ff0542$1@www.eclipse.org...
> I am exploring the new extension registry that can be used independent of
> eclipse. The method IExtensionRegistry.addXMLContribution takes as input a
> provider id defined as a long. I presume this has its heritage in OSGI
> bundles.
> I would appreciate any recommendations on how to best derive a id in this
> form from a string since that is what is referenced by extension points
> and their extensions. I looked for some correlation between
> Bundle-SymbolicName (a string) and BundleId (a long) but could not find
> something helpful. I know how to derive a long from a string by obtaining
> it's hashcode but I am not sure that this approach is sufficiently robust
> to guarantee uniqueness.
>
> Thanks
> Jim D'Anjou
>
>
Re: Recommendations for provider id when using the equinox extension registry [message #54326 is a reply to message #53995] Tue, 06 December 2005 23:54 Go to previous messageGo to next message
Jim DAnjou is currently offline Jim DAnjouFriend
Messages: 25
Registered: July 2009
Junior Member
Thanks, Jeff, I look forward to that API change....Jim
Re: Recommendations for provider id when using the equinox extension registry [message #54579 is a reply to message #54326] Mon, 12 December 2005 21:51 Go to previous messageGo to next message
Jim DAnjou is currently offline Jim DAnjouFriend
Messages: 25
Registered: July 2009
Junior Member
I have been monitoring CVS Head for this API change. Is there an outlook
for when it will be available? Thanks!

Jim D'Anjou
Re: Recommendations for provider id when using the equinox extension registry [message #54841 is a reply to message #54579] Mon, 12 December 2005 23:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jeff_nospam_mcaffer.ca.ibm.com

Watch the bug reports!

https://bugs.eclipse.org/bugs/show_bug.cgi?id=118482



"Jim D'Anjou" <danjou@us.ibm.com> wrote in message
news:9f9fbdb9304d4dbf90a3a977e0b115c2$1@www.eclipse.org...
> I have been monitoring CVS Head for this API change. Is there an outlook
> for when it will be available? Thanks!
>
> Jim D'Anjou
>
Re: Recommendations for provider id when using the equinox extension registry [message #55138 is a reply to message #54841] Tue, 20 December 2005 21:44 Go to previous messageGo to next message
Jim DAnjou is currently offline Jim DAnjouFriend
Messages: 25
Registered: July 2009
Junior Member
I have applied the patches in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=118482
and am adapting some registry junit test cases to use this registry.

IConfigurationElement.createExecutable extension is failing with a class
not found. This is a test that has worked in other environments not relatd
to this registry implementation. The stacktrace below indicates that the
BundleLoader class was called to load the class. Since I am supplying a
plug-in manifest myself from a stream that was never read by Eclipse/OSGI
I suspect that this is the possible cause of the CNF exception and I need
to supply a class loader that will resolve the class.

I can probably override RegistryStrategy.createExecutableExtension to
supply my own class loader. Would it be reasonable to extend the
RegistryStrategy class API to allow a registry provider to supply a class
loader (and avoid a near duplication of the default implementation of this
method)? Thanks!

e1= ClassNotFoundException (id=110)
backtrace= Object[43] (id=113)
[0]= int[84] (id=115)
[1]= Class (org.eclipse.osgi.framework.internal.core.BundleLoader)
(id=116)
[2]= Class (org.eclipse.osgi.framework.internal.core.BundleLoader)
(id=116)
[3]= Class (org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader )
(id=117)
[4]= Class (java.lang.ClassLoader) (id=69)
[5]= Class (java.lang.Class) (id=78)
[6]= Class (java.lang.Class) (id=78)
[7]= Class (org.eclipse.equinox.registry.spi.RegistryStrategy) (id=77)
[8]= Class (org.eclipse.core.internal.registry.ExtensionRegistry)
(id=104)
[9]= Class (org.eclipse.core.internal.registry.ConfigurationElement)
(id=13)
[10]= Class
(org.eclipse.core.internal.registry.ConfigurationElementHand le) (id=85)
[11]= Class (com.xxx.xxxx.xxxx.xxxxxx.registry.tests.PushRegistryTest)
(id=17)
[12]= Class (sun.reflect.NativeMethodAccessorImpl) (id=18)
[13]= Class (sun.reflect.NativeMethodAccessorImpl) (id=18)
[14]= Class (sun.reflect.NativeMethodAccessorImpl) (id=18)
[15]= Class (sun.reflect.DelegatingMethodAccessorImpl) (id=19)
[16]= Class (java.lang.reflect.Method) (id=20)
[17]= Class (junit.framework.TestCase) (id=21)
[18]= Class (junit.framework.TestCase) (id=21)
[19]= Class (junit.framework.TestResult$1) (id=22)
[20]= Class (junit.framework.TestResult) (id=23)
[21]= Class (junit.framework.TestResult) (id=23)
[22]= Class (junit.framework.TestCase) (id=21)
[23]= Class (junit.framework.TestSuite) (id=24)
[24]= Class (junit.framework.TestSuite) (id=24)
[25]= Class (org.eclipse.jdt.internal.junit.runner.RemoteTestRunner)
(id=25)
[26]= Class (org.eclipse.jdt.internal.junit.runner.RemoteTestRunner)
(id=25)
[27]= Class
(org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunn er) (id=26)
[28]= Class (org.eclipse.pde.internal.junit.runtime.CoreTestApplication)
(id=27)
[29]= Class (org.eclipse.core.internal.runtime.PlatformActivator$1)
(id=28)
[30]= Class
(org.eclipse.core.runtime.internal.adaptor.EclipseAppLaunche r) (id=29)
[31]= Class
(org.eclipse.core.runtime.internal.adaptor.EclipseAppLaunche r) (id=29)
[32]= Class (org.eclipse.core.runtime.adaptor.EclipseStarter) (id=30)
[33]= Class (org.eclipse.core.runtime.adaptor.EclipseStarter) (id=30)
[34]= Class (sun.reflect.NativeMethodAccessorImpl) (id=18)
[35]= Class (sun.reflect.NativeMethodAccessorImpl) (id=18)
[36]= Class (sun.reflect.NativeMethodAccessorImpl) (id=18)
[37]= Class (sun.reflect.DelegatingMethodAccessorImpl) (id=19)
[38]= Class (java.lang.reflect.Method) (id=20)
[39]= Class (org.eclipse.core.launcher.Main) (id=31)
[40]= Class (org.eclipse.core.launcher.Main) (id=31)
[41]= Class (org.eclipse.core.launcher.Main) (id=31)
[42]= Class (org.eclipse.core.launcher.Main) (id=31)
cause= null
detailMessage=
" com.xxx.xxxx.xxxx.xxxxxx.registry.tests.util.TestCreateExecu tableExtension1 "
ex= null
stackTrace= null
Re: Recommendations for provider id when using the equinox extension registry [message #55165 is a reply to message #55138] Tue, 20 December 2005 23:04 Go to previous message
Jim DAnjou is currently offline Jim DAnjouFriend
Messages: 25
Registered: July 2009
Junior Member
Just confirming that supplying my own class loader resolved the CNF
exception.

I have my own RegistryStrategy subclass with an additional constuctor to
supply a class loader. If its not supplied then my override of
createExecutableExtension uses the calling class' class loader.
Previous Topic:What is the best way to enumerate contents of instance file ?
Next Topic:org.eclipse.equinox.registry refactoring observation
Goto Forum:
  


Current Time: Wed Apr 24 14:18:57 GMT 2024

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

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

Back to the top