Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Multiple instances of same bundle
Multiple instances of same bundle [message #71659] Sun, 06 August 2006 14:46 Go to next message
Eclipse UserFriend
Originally posted by:


This is probably more of a straight OSGi question. Is there a way to run
multiple instances of a single bundle without having to install the same
bundle more than once? Is it even possible to install the same bundle more
than once?

My desire is to have the same functionality running in multiple, independent
contexts. Instead of designing a single bundle to juggle the multiple
contexts, I'd rather design a bundle that only has to manage a single
context and to have multiple instances of the same bundle to handle the
multiple contexts required.


Re: Multiple instances of same bundle [message #71908 is a reply to message #71659] Thu, 10 August 2006 13:35 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 479
Registered: July 2009
Senior Member

There is no way to have multiple "instances" of a single bundle active
in the OSGi Framework. For example, there is no concept of duplicating
a bundle instance and have multiple instances active. A bundle can only
be started once and cannot be started again until it is first stopped

You also cannot install the exact same bundle more than once in the
Framework (same is defined as having the same Bundle-SymbolicName and
Bundle-Version). You could change the bundle-version for each context
but that is really artificial if you did not change a line of code in
the bundle.

What is your definition of a "context". OSGi does have a concept of a
ServiceFactory. You can register a service with the framework that is
an instance of a ServiceFactory. Each time the service is gotten by
another bundle the ServiceFactory is called using the bundle as the
context. This way you can create one of the service objects for each
bundle that is using it. If your context is the bundle that uses your
service then ServiceFactories can work for you.

You can also use ConfigurationAdmin to configure your services. This
would allow you to register a different service instance for each
context that you want.


Re: Multiple instances of same bundle [message #72097 is a reply to message #71908] Sat, 12 August 2006 14:16 Go to previous message
Eclipse UserFriend
Originally posted by:


Thank you for your reply. As you can probably tell, I'm early into my
investigation of OSGi. I am trying to map the concepts of our internal
component framework to those of OSGi. I think you have given me a couple
of good leads.

Previous Topic:Extension points
Next Topic:How to get files in bundle's classpath
Goto Forum:

Current Time: Wed Apr 25 22:29:21 GMT 2018

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

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