Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSGi Threading Model

Tags:

osgi

I have searched the Internet but failed to find a satisfactory answer. What is the threading model present in an OSGi container? Does it simply spawn a new thread to each registered bundle e.g.? Any reference regarding the threading model would be great.

like image 971
chamibuddhika Avatar asked Nov 07 '10 09:11

chamibuddhika


2 Answers

You have not found anything because there is no such thing as an "OSGi threading model". Bundles simply exist and don't "have threads" unless they start them.

like image 103
Holger Hoffstätte Avatar answered Oct 22 '22 11:10

Holger Hoffstätte


The OSGi framework follows a synchronous model, ie. everything happens in a strict order. Bundles are not executed in threads (but they have their own classloader instances). There are some exceptions, though. For example, when an event is raised via the postEvent method, the delivery of the event is done asynchronously, usually implemented in many framework implementations as a thread.

like image 32
Andreas Kraft Avatar answered Oct 22 '22 12:10

Andreas Kraft