Technical Context
In AEM (CQ), sevlets are defined as OSGi services implementing javax.servlet.Servlet
interface. A service listener org.apache.sling.servlets.resolver.internal.SlingServletResolver
in sling framework listens for OSGi services implementing javax.servlet.Servlet
interface and registers its reference. When a request hits the server, this SlingServletResolver
… read the rest.
Tag: OSGi
Dynamic component programming model in OSGi
In OSGi deployment model for java, bundles come and go at run time. Hence, dependencies between the bundles would have to be resolved at run time. This would lead to inconsistency as programs cannot be written with confidence referring types … read the rest.
OSGi – A simplistic view
OSGi
OSGi is a specification describing dynamic modular system for java platform. Essentially, two key aspects here – dynamic modules called bundles in OSGi and the OSGi runtime facilitating these bundles.
More details on OSGi can be found here.… read the rest.
Service Listener – OSGi pattern in AEM
Forces
- Model independent functions which are similar in nature.
- Ability to plugin these independent functions on the fly.
- Consume or invoke these functions in a controlled manner through a single facade.
Design
Model independent functions as OSGi services implementing the … read the rest.
OSGi Component Vs Service in AEM
AEM ships with an OSGi container Apache felix that implements Declarative Services (DS) component model. Most of the developers who are new to AEM often gets confused between OSGi components and services.
OSGi Component
If you want the life of … read the rest.
OSGi component in AEM that is active only in specific run mode (say, publish).
Scenario
Implementing an OSGi component in AEM which is active (that runs) only in specific run modes (say, publish).
Implementation
Generally, in OSGi container (Apache felix in AEM), to get a component ‘satisfied’, all the referenced services have to be … read the rest.