Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » update bundle question
update bundle question [message #36494] Tue, 09 March 2004 17:59 Go to next message
Martin Lippert is currently offline Martin LippertFriend
Messages: 124
Registered: July 2009
Senior Member
Hi,

I am playing with the dynamic features of the runtime and got a number
of questions. I hope someone could help...

I wrote a simple RCP application that defines an extension point and I
registered for extension registry change events. I wrote an extension to
that point in a separate plugin. Now I start the runtime workbench with
the console.

First question:
Is it right that ...
.... I don't get an event notification if I stop the extension plugin ?
.... I do get an event notification if I uninstall the extension plugin ?
.... I don't get an event notification if a install the bundle again ?
.... I do get an event notification if I start the bundle ?
(everything done via console commands)

The second thing that I am trying is to change the plugin in my Eclipse
IDE and type "update" in the console. What I get is an exception that
tells me that the bundle is at the same location and could therefore not
be updated. Is that right?

Thank you very much for your help!!!

Best regards,
Martin
Re: update bundle question [message #36564 is a reply to message #36494] Wed, 10 March 2004 04:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pascal.ibm.canada

Martin Lippert wrote:
> Hi,
>
> I am playing with the dynamic features of the runtime and got a number
> of questions. I hope someone could help...
>
> I wrote a simple RCP application that defines an extension point and I
> registered for extension registry change events. I wrote an extension to
> that point in a separate plugin. Now I start the runtime workbench with
> the console.
>
> First question:
> Is it right that ...
> ... I don't get an event notification if I stop the extension plugin ?
Yes. Extensions are considered as long as / as soon as a plugin in the
resolved state. It is basically like in eclipse 2.1 where extensions are
connected to extension-point even though they are not started.

> ... I do get an event notification if I uninstall the extension plugin ?
This is normal, because when you uninstall the plugin this one loose
its resolved state, which gets picked up by the extension registry.

> ... I don't get an event notification if a install the bundle again ?
This is normal, because installing a bundle just makes it available to
the system for later resolution (which can be now done by refresh) but
it does *not* resolved it. This is the result of a general least
perturbation policy implemented by the fwk. To resolve a bundle use the
refresh command.


> ... I do get an event notification if I start the bundle ?
This is normal because before being started a bundle is resolved.

> (everything done via console commands)
>
> The second thing that I am trying is to change the plugin in my Eclipse
> IDE and type "update" in the console. What I get is an exception that
> tells me that the bundle is at the same location and could therefore not
> be updated. Is that right?
Yes, since it does not make sense to update org.eclipse.foo_3.0.0 with
org.eclipse.foo_3.0.0. You want to update the bundle with
org.eclipse.foo_3.0.1 (or any other location actually).

HTH,

PaScaL
Re: update bundle question [message #36597 is a reply to message #36564] Wed, 10 March 2004 06:38 Go to previous messageGo to next message
Martin Lippert is currently offline Martin LippertFriend
Messages: 124
Registered: July 2009
Senior Member
Hi,

>> First question:
>> Is it right that ...
>> ... I don't get an event notification if I stop the extension plugin ?
>
> Yes. Extensions are considered as long as / as soon as a plugin in
> the resolved state. It is basically like in eclipse 2.1 where extensions
> are connected to extension-point even though they are not started.
>
>> ... I do get an event notification if I uninstall the extension plugin ?
>
> This is normal, because when you uninstall the plugin this one loose
> its resolved state, which gets picked up by the extension registry.
>
>> ... I don't get an event notification if a install the bundle again ?
>
> This is normal, because installing a bundle just makes it available
> to the system for later resolution (which can be now done by refresh)
> but it does *not* resolved it. This is the result of a general least
> perturbation policy implemented by the fwk. To resolve a bundle use the
> refresh command.
>
>> ... I do get an event notification if I start the bundle ?
>
> This is normal because before being started a bundle is resolved.

Okay, got it. Thanks for the explanation.

>> (everything done via console commands)
>>
>> The second thing that I am trying is to change the plugin in my
>> Eclipse IDE and type "update" in the console. What I get is an
>> exception that tells me that the bundle is at the same location and
>> could therefore not be updated. Is that right?
>
> Yes, since it does not make sense to update org.eclipse.foo_3.0.0
> with org.eclipse.foo_3.0.0. You want to update the bundle with
> org.eclipse.foo_3.0.1 (or any other location actually).

What I would like to do is to force the framework to reload a bundle on
demand. The reason for that is that I modify bytecode of bundles at
classloading time (you might remember ;-). And I would like to be able
to update the bundle to let my mechanism modify the bytecode again (for
example to put it back into the unwoven state).

I first thought that update might be the easiest way to do that. But
from your explanations I think that I need to 1.) uninstall the bundle,
2.) re-install it, and 3.) do a refresh. Does that sound like the right way?

Second questions: is it possible to get a notification if a bundle is
stopped or installed?

Thanks for the help!

Best regards,
Martin
Re: update bundle question [message #36665 is a reply to message #36564] Wed, 10 March 2004 14:07 Go to previous messageGo to next message
Erik Wistrand is currently offline Erik WistrandFriend
Messages: 9
Registered: July 2009
Junior Member
Pascal Rapicault wrote:

> Martin Lippert wrote:
>> The second thing that I am trying is to change the plugin in my
>> Eclipse IDE and type "update" in the console. What I get is an
>> exception that tells me that the bundle is at the same location and
>> could therefore not be updated. Is that right?
>
> Yes, since it does not make sense to update org.eclipse.foo_3.0.0
> with org.eclipse.foo_3.0.0. You want to update the bundle with
> org.eclipse.foo_3.0.1 (or any other location actually).

Does the equinox OSGi FW really makes the assumption that a bundle
shouldn't be updated just because the location URL is identical? It
seems a bit bold to throw an exception at this, instead of just
reloading the code. Or is it just the console that is a bit too clever?

I could certainly agree that the OSGi spec on location usage is a bit
vague -- but during internal development cycles it's really annoying to
be forced to bump jar files names on every compile.

/Erik W

>
> HTH,
>
> PaScaL


--
Erik Wistrand, erik@wistrand.com
Re: update bundle question [message #36699 is a reply to message #36665] Thu, 11 March 2004 04:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pascal.ibm.canada

I think we implemented this behavior because of the spec.
Maybe should the spec be enhanced.

PaScaL

Erik Wistrand wrote:
> Pascal Rapicault wrote:
>
>> Martin Lippert wrote:
>>
>>> The second thing that I am trying is to change the plugin in my
>>> Eclipse IDE and type "update" in the console. What I get is an
>>> exception that tells me that the bundle is at the same location and
>>> could therefore not be updated. Is that right?
>>
>>
>> Yes, since it does not make sense to update org.eclipse.foo_3.0.0
>> with org.eclipse.foo_3.0.0. You want to update the bundle with
>> org.eclipse.foo_3.0.1 (or any other location actually).
>
>
> Does the equinox OSGi FW really makes the assumption that a bundle
> shouldn't be updated just because the location URL is identical? It
> seems a bit bold to throw an exception at this, instead of just
> reloading the code. Or is it just the console that is a bit too clever?
>
> I could certainly agree that the OSGi spec on location usage is a bit
> vague -- but during internal development cycles it's really annoying to
> be forced to bump jar files names on every compile.
>
> /Erik W
>
>>
>> HTH,
>>
>> PaScaL
>
>
>
Re: update bundle question [message #36733 is a reply to message #36597] Thu, 11 March 2004 04:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pascal.ibm.canada

look around the BundleEvent and bundleListener

PaScaL

Martin Lippert wrote:

> Hi,
>
>>> First question:
>>> Is it right that ...
>>> ... I don't get an event notification if I stop the extension plugin ?
>>
>>
>> Yes. Extensions are considered as long as / as soon as a plugin in
>> the resolved state. It is basically like in eclipse 2.1 where
>> extensions are connected to extension-point even though they are not
>> started.
>>
>>> ... I do get an event notification if I uninstall the extension plugin ?
>>
>>
>> This is normal, because when you uninstall the plugin this one
>> loose its resolved state, which gets picked up by the extension registry.
>>
>>> ... I don't get an event notification if a install the bundle again ?
>>
>>
>> This is normal, because installing a bundle just makes it
>> available to the system for later resolution (which can be now done by
>> refresh) but it does *not* resolved it. This is the result of a
>> general least perturbation policy implemented by the fwk. To resolve a
>> bundle use the refresh command.
>>
>>> ... I do get an event notification if I start the bundle ?
>>
>>
>> This is normal because before being started a bundle is resolved.
>
>
> Okay, got it. Thanks for the explanation.
>
>>> (everything done via console commands)
>>>
>>> The second thing that I am trying is to change the plugin in my
>>> Eclipse IDE and type "update" in the console. What I get is an
>>> exception that tells me that the bundle is at the same location and
>>> could therefore not be updated. Is that right?
>>
>>
>> Yes, since it does not make sense to update org.eclipse.foo_3.0.0
>> with org.eclipse.foo_3.0.0. You want to update the bundle with
>> org.eclipse.foo_3.0.1 (or any other location actually).
>
>
> What I would like to do is to force the framework to reload a bundle on
> demand. The reason for that is that I modify bytecode of bundles at
> classloading time (you might remember ;-). And I would like to be able
> to update the bundle to let my mechanism modify the bytecode again (for
> example to put it back into the unwoven state).
>
> I first thought that update might be the easiest way to do that. But
> from your explanations I think that I need to 1.) uninstall the bundle,
> 2.) re-install it, and 3.) do a refresh. Does that sound like the right
> way?
>
> Second questions: is it possible to get a notification if a bundle is
> stopped or installed?
>
> Thanks for the help!
>
> Best regards,
> Martin
Re: update bundle question [message #36835 is a reply to message #36699] Thu, 11 March 2004 09:59 Go to previous message
Eclipse UserFriend
Originally posted by: jeff_mcaffer.REMOVE.ca.ibm.com

I think this is a bug in our code. The OSGi API for update is
Bundle.update() and Bundle.update(InputStream). Notice that neither one
allows you to spec a different location. The OSGi idea of location is as a
unique identifier for the bundle which is independent of the content of the
bundle. Note that there is NO requirement that the "location" actually be a
location of that it actually contain the bundle which is installed. It is
more like a symbolic ID assigned by the system manager. It *happens* that
most OSGi frameworks allow the case where the locaiton can be interpreted as
a URL and that the location indicated by that URL in fact does contain the
content of the bundle.

I've entered a bug on this
https://bugs.eclipse.org/bugs/show_bug.cgi?id=54434
Jeff


"Pascal Rapicault" <pascal@ibm.canada> wrote in message
news:c2or6m$q62$1@eclipse.org...
> I think we implemented this behavior because of the spec.
> Maybe should the spec be enhanced.
>
> PaScaL
>
> Erik Wistrand wrote:
> > Pascal Rapicault wrote:
> >
> >> Martin Lippert wrote:
> >>
> >>> The second thing that I am trying is to change the plugin in my
> >>> Eclipse IDE and type "update" in the console. What I get is an
> >>> exception that tells me that the bundle is at the same location and
> >>> could therefore not be updated. Is that right?
> >>
> >>
> >> Yes, since it does not make sense to update org.eclipse.foo_3.0.0
> >> with org.eclipse.foo_3.0.0. You want to update the bundle with
> >> org.eclipse.foo_3.0.1 (or any other location actually).
> >
> >
> > Does the equinox OSGi FW really makes the assumption that a bundle
> > shouldn't be updated just because the location URL is identical? It
> > seems a bit bold to throw an exception at this, instead of just
> > reloading the code. Or is it just the console that is a bit too clever?
> >
> > I could certainly agree that the OSGi spec on location usage is a bit
> > vague -- but during internal development cycles it's really annoying to
> > be forced to bump jar files names on every compile.
> >
> > /Erik W
> >
> >>
> >> HTH,
> >>
> >> PaScaL
> >
> >
> >
Previous Topic:sample application for dynamic features
Next Topic:Knopflerfish OSGi
Goto Forum:
  


Current Time: Thu Apr 25 00:29:14 GMT 2024

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

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

Back to the top