Let's Dive into Event Handlers today!
Event Handler is responsible for Sling Level Events. It uses the OSGi Event Admin service to receive events. You can use it to capture custom events or events from other parts of the system.
Event Handlers have a default 5 sec Timeout(Set in Apache Felix Event Admin Implementation). If the execution time goes beyond Timeout value, then the handler would be blacklisted and would never execute.
How to listen to an Sling Level event?
An event is listened by implementing EventHandler interface which belongs to org.osgi.service.event package.
Handler Implementation will consist of one method i.e. handleEvent (Event event). handleEvent method gets called whenever event occurs.
That's all for today! If you've found this blog post informative or helpful, I’d greatly appreciate it if you could give it a like. It keeps me motivated 💛