Elasticsearch's top-level event loop or handler?

If I want to collect response time stats and exceptions for a standard
Java web application, I can instrument the Servlet.service(request,
response) method.

Is there a comparable method in elasticsearch?