Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » programmatically add new bundles?
programmatically add new bundles? [message #480691] Tue, 18 August 2009 08:20 Go to next message
Sandro Boehme is currently offline Sandro BoehmeFriend
Messages: 95
Registered: July 2009
Member
Hello,

in my usecase I have server types where each one is composed of it's own
collection of jars and I would like to be able to start multiple
instances of the same server type simultaneously within Eclipse.
But:
a) I don't want the jars of one server type be visible to other server
types and
b) I cannot guarantee that multiple instances of the same server type
can work together within the same class loader as there might be some
class state involved in one server instance that would influence the
other server instance.

The first thought was to create a bundle per server type. But then I
would need to programmatically add new bundles to start new servers.
E.g. by copying the server type bundle, adding an id to the SymbolicName
attribute, and starting it.
Isn't there a more elegant way of reaching the same goal? An instance of
an OSGi Service doesn't have an own classloader, it lives within a
bundle that is already there right?
Any hints are much appreciated!

Best,

Sandro
Re: programmatically add new bundles? [message #480711 is a reply to message #480691] Tue, 18 August 2009 09:58 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

I don't know an elegant way Smile but I was experimenting with a similar approach.

Creating bundles so that different versions of a library could be dynamically loaded into a running instance.

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

There is some sample code attached to that bug. I think I was exposing it as a service, but that's not necessary. I think the BundleContext can be used to install the new bundle and the PackageAdmin service can be used to refresh the packages it exports.

PW


Re: programmatically add new bundles? [message #480721 is a reply to message #480711] Tue, 18 August 2009 10:11 Go to previous message
Sandro Boehme is currently offline Sandro BoehmeFriend
Messages: 95
Registered: July 2009
Member
Hello Paul,

thanks for the quick pointer! I will have a look at it.

Best,

Sandro


Paul Webster schrieb:
> I don't know an elegant way :) but I was experimenting with a similar
> approach.
>
> Creating bundles so that different versions of a library could be
> dynamically loaded into a running instance.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=263723
>
> There is some sample code attached to that bug. I think I was exposing
> it as a service, but that's not necessary. I think the BundleContext
> can be used to install the new bundle and the PackageAdmin service can
> be used to refresh the packages it exports.
>
> PW
>
Previous Topic:[P2] Problems with Galileo Update Site
Next Topic:PDE build don't set execute permission on launcher binary
Goto Forum:
  


Current Time: Thu Apr 25 08:08:28 GMT 2024

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

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

Back to the top