April 6, 2020
Estimated Post Reading Time ~

OSGi Design Patterns

The trail on OSGi design patterns.
This trail provides a set of application-specific OSGi design patterns along with basics for easy understanding. The sample source code given is implemented using AEM 6.x running on Java 8. Note that AEM uses Apache Felix OSGi container with the Declarative Services component model.

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 a sample implementation of OSGi design patterns used in this trail is available in github.

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


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.