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 10:46 Go to next message
Eclipse User
Originally posted by: no-spam.ge.com

Hello,

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.

Thanks,

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

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.

HTH

Tom.
Re: Multiple instances of same bundle [message #72097 is a reply to message #71908] Sat, 12 August 2006 10:16 Go to previous message
Eclipse User
Originally posted by: Bill.B.med.ge.com

Tom,

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.

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


Current Time: Sun Apr 20 19:51:17 EDT 2014

Powered by FUDForum. Page generated in 0.01531 seconds