Snippets are examples of OSGi code that you can copy and paste or just use to learn. All snippets are based on the bnd tool but are easily ported to other environments. All code in the snippets section is placed in the public domain, you can freely copy it and do whatever you want with it; there is no requirement to retain copyright texts.
- Track a Set of Service with Components
- Track a Set of Service
- A Bundle That Stops Itself
- Register a Service with a Component
- Register a Servlet with the Http Service
- Register a Log Service with a Bundle Activator
- Hello World as Declarative Service Component
- Hello World (and Goodbye)
- Get a Service (classic and component)
- Get Configuration Data with a Managed Service
- Extender Pattern with Automatic Servlet Registration
- Use of the OSGi Bundle-ClassPath with Beanshell
If you have interesting snippets, do not hesitate to send them.