2013/11/14

Devoxx 2013 - Nuts and Bolts of Java EE 7 Interceptors

Emmanuel Bernard
Interceptor 1.2
  • update of 1.1, part of JEE7
  • common rules
  • used by developers and container providers (e.g. bean validation)
  • AroundConstruct lifecycle
  • priority ranges
Bean Validation and Interceptors
  • define / declare constraints on objects
  • annotation based
  • extensible
  • (new) validation of parameters and return values of methods
  • no proprietary hook
  • ordering of validators -> new @Priority
details
  • @AroundConstruct -> dedicated interceptor class
  • ordering of interceptors:
    • @Priority: global ordering (smaller number = first - cfr. Interceptor.Priority...)
    • or: ordering with @Interceptors list
    • @ExcludeClassInterceptors: remove interceptors defined on classlevel
  • Lyfecycle: simplified method signatures for checked exceptions

No comments: