Description
OWB does not interceptors on UnmanagedInstance even though the specification is quite clear in that area.
https://jakarta.ee/specifications/cdi/4.0/jakarta-cdi-spec-4.0.html#biz_method_full
When the application invokes:
- a method of a bean via a contextual reference to the bean, as defined in Contextual reference for a bean,
- a method of a bean via a non-contextual reference to the bean, if the instance was created by the container (e.g. using InjectionTarget.produce() or UnmanagedInstance.produce(), or
- a method of a bean via a non-contextual reference to the bean, if the instance was enhanced with the InterceptionFactory interface as defined in The InterceptionFactory interface,
the invocation is treated as a business method invocation.
The spec also says
A method invocation passes through method interceptors and decorators if, and only if, it is a business method invocation.
Otherwise, the invocation is treated as a normal Java method call and is not intercepted by the container.
We can't pass the following TCK test org.jboss.cdi.tck.tests.full.extensions.beanManager.unmanaged.UnmanagedInstanceTest