OSGi design patterns

Trail on OSGi  design patterns.
This trail provides a set of application specific OSGi design patterns along with basics for easy understanding. Sample source code given are implemented using AEM 6.x running on Java 8. Note that AEM uses Apache felix OSGi container with Declarative Services component model.

This is WORK IN PROGRESS. Keep visiting often.

Basics

Application design Patterns

  • Service publisher and service consumer.
  • Components which requires mandatory configuration object.
  • Service listener pattern.
  • Filtered service listener.
  • Factory pattern.
  • Config factory pattern.
  • Extender pattern.
  • Service deployment.
  • Event admin
  • Wire admin
  • Named dynamic extension pattern (Query builder case).
  • Dynamic implementation selection of a service.
  • Overriding OOTB servlet in AEM.

Source code for sample implementation of OSGi design patterns used in this trail are available in github.

Reference

  • OSGi Spec – Link here.
  • Apache felix. Link here.
  • Apache felix SCR annotations – Link here.
  • Handy book on OSGi. Link here.

One thought on “OSGi design patterns

Leave a Reply

Your email address will not be published. Required fields are marked *