Implementing your own configurable monitoring interceptor

Implementing a CDI interceptor is not that complicated. Thus, you may want to have your own if you do not find a library matching your expectations. It can have two kinds of direct impact on the way you use monitoring:

  • Be able to control the counters you use depending on the case you are in. This includes success/failure handling, but it can also be tenant-related (if your application is handling multiple tenants). This can be very important if you do not use the exact same system as the tenant (one can have a slower database than the other, for instance).
  • Be able to configure the monitored beans. Yes, with CDI you can also avoid having to decorate the beans you want to monitor and ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.