November 2018
Intermediate to advanced
388 pages
9h 5m
English
Let's consider the example that we wrote earlier, where we created a person identity. Let's say we want to invoke some functionality around this identity creation function and that we don't necessarily want to mix this logic with the existing business function.
For instance, let's say we want to add audit functionality, which is a common cross-cutting concern. We can use interceptors to write a function to add audit messages, which will be invoked around the execution of the business function. We use the @Interceptors annotation to do this and then we can provide one or more interceptors for common application concerns:
@Stateless@Interceptors(AuditInterceptor.class)class App { @Inject private lateinit var identityCreator: ...Read now
Unlock full access