Shanmuga Sundaram,
1) A bundle will be deactivated either when it is stopped by somebody
calling "stop()" against the Bundle object, or when its dependencies/
constraints are no longer satisfied, e.g. another bundle offering a
package imported by your bundle is uninstalled.
However I believe this should not really be your concern. The
activation state of a bundle is not much more than a flag. Instead,
you need to think about what activation means for your bundle. If your
bundle runs a thread when it is activated, then can that thread crash?
Yes it can. If your bundle creates a server socket then can that
socket fail? Yes, it can. These failures are not going to be visible
through the activation state of the bundle, yet they are presumably
the kind of errors that you need to deal with.
2) Services and package imports are completely different and non-
exclusive concepts. Imports are required in order to create static
type dependencies across bundles. Services are used to offer
functionality to other bundles without introducing a static type
dependency between them. Most OSGi applications use both services and
package imports extensively.
Be careful of saying you are not interested in SOA, you may have
misunderstood what is meant by the term. When we talk about SOA in
OSGi, we are not talking about "web services", SOAP, WSDL, UDDI and so
on. We are talking about an architectural pattern that is incredibly
useful even within the scope of a single VM for reducing coupling and
enabling reusability.
With apologies for self-promotion, please consider working through my
short OSGi tutorial at the following URL. It should help you to
understand the issues better:
http://neilbartlett.name/blog/osgi-articles/
Regards,
Neil
On 10 Jan 2008, at 11:25, Nagarajan, Shanmuga Sundaram wrote:
Hi,
Couple of questions regarding osgi
1. Can an active bundle stop automatically (goes from active to
Resolved/Installed state) without any user intervention ? We tested
out some failure scenarios by manually uninstalling bundles. But we
would like to understand if a bundle can go down by itself due to
any errors ? Based on this we need to decide our HA capabilities.
We tried throwing exceptions/errors from bundles but never were able
to get the bundle to go down. So any help in simulating the
conditions when a bundle can go down will be much appreciated.
2. What are advantages of using services compared to package-import.
We are not particularly interested in using service oriented
architecture so we were wondering what else we would miss out on by
sticking to package import.
Thanks & Regards,
Shanmuga Sundaram Nagarajan
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev