[cdi-dev] Enabling programmatic/synthetic decorators added by extension
arjan.tijms at gmail.com
Wed Mar 2 10:31:56 EST 2016
I'm trying to add decorators and/or interceptors to a Bean<T> that's added
via an extension. There doesn't seem to be any way to add interceptors, but
decorators seem almost possible.
I've added a decorator in the following way:
AnnotatedType<AutoApplySessionDecorator> annotatedType =
BeanAttributes<AutoApplySessionDecorator> beanAttributes =
Bean<AutoApplySessionDecorator> bean =
Where the "AutoApplySessionDecorator" is an existing (non-scanned)
decorator just used as an example.
While this seems to work, the problem is with the enablement. @Priority is
not processed in this way, since it's only read from an AnnotatedType
that's been added to the deployment (see e.g. in
beans.xml is not really an option here due to the static nature of that and
the fact that the decorator needs to be enabled dynamically here, plus that
the implementation class of the decorator is a detail I would not like to
expose to the application.
Is there any other way to either enable a (synthetic) decorator
programmatically, or to add Interceptors to a programmatically added
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cdi-dev