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

Registering a service declaratively


Registering services imperatively in the start method of an Activator class is one way of installing services in an OSGi framework. However, it requires that the bundle be started, which in turn requires that either the bundle is started automatically or has classes (such as API classes) accessed by default. Both approaches will mean that additional code will have to be run to bring the system into the desired state.

An alternative is to use one of the declarative service approaches, which represents the service definition in an external file. These are processed using an extender pattern, which looks out for bundles with a given file or files and then instantiates the service from this definition. It combines the declarative nature of the extension registry with the flexibility of OSGi services.

There are two providers of declarative service support. Both achieve a similar result but use slightly different configuration files and approaches. They are Declarative...