Book Image

Mastering Eclipse Plug-in Development

By : Alex Blewitt, Bandlem Limited
Book Image

Mastering Eclipse Plug-in Development

By: Alex Blewitt, Bandlem Limited

Overview of this book

Table of Contents (18 chapters)
Mastering Eclipse Plug-in Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Plugging in to JFace and the Common Navigator Framework
Index

OSGi fragment bundles


An OSGi runtime consists of a set of bundles running in a managed environment. These bundles provide classes and resources, a (sub)set of which can be exported to other bundles. Each bundle has its own class space (provided by its own ClassLoader instance) that permits the dependencies and exports to be wired up appropriately.

OSGi also has the ability to manage fragment bundles or simply fragments. These are like bundles that don't have their own life cycle, but can still contribute classes and package dependencies to a host bundle at runtime.

The difference between a fragment bundle and a host bundle is the existence of the Fragment-Host header, which specifies the Bundle-SymbolicName and, optionally, the bundle-version attribute of the bundle to attach to. All other OSGi headers are valid for fragments, except for Bundle-Activator. The reason why the activator is not valid is that fragments do not have their own life cycle; they share the life cycle of their parent...