OSGi Basics

A generator is made up of a set of OSGi bundles and is executed inside an OSGi container. For this reason you need to know something about OSGi in order to be able to develop generators for Virtual Developer. The stuff you mostly need is:

  • working with the Eclipse Plug-In Development Environment (PDE)
  • import and export packages in the META-INF/MANIFEST.MF file
  • develop service implementation classes that implement ModelAccessProviderI, ModelConverterProviderI or GenerationGroupProviderI (for more details about this see the subsequent chapters)
  • declaratively define the OSGi services in OSGI-INF/[service-name].xml files and configure them in META-INF/MANIFEST.MF

Please note that as of Eclipse 4.7 (Oxygen) you can use annotations in your service implementation classes and let Eclipse generate the [service-name].xml files:

Generate Service Definitions from Annotations

The OSGi specification defines many, many more things. But you do not need them for Virtual Developer.

There are loads of resources on the web to learn about OSGi. A good and comprehensible starting point is the OSGi Modularity Tutorial by Lars Vogel and Simon Scholz.