[
https://issues.apache.org/jira/browse/OWB-329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12846446#action_12846446
]
Mark Struberg commented on OWB-329:
-----------------------------------
a solution has been discussed on the list. The most important parts copied from
the thread:
* separate the proxies for the NormalScoped beans from the proxies we need for
implementing interceptor and decorator logic.
* The NormalScopedBeanMethodHandler should not derive from the
InterceptorHandler anymore, but should form the parent of an own tree (with
ApplicationScopedBeanHandler, SessionScopedBeanHandler, ... with caching
functionality). They will get created as usual, one proxy instance for each
injection point.
* Cut the logic from the InterceptorHandler 1:1 and apply it as separate proxy
to form the effective contextual instance to store inside the Context.
* The Bean<T>#create(CreationalContext<T>) should check whether a decorator or
interceptor should get applied and then return not only the pure contextual
instance, but proxied with the filled InterceptorHandler. The
InterceptorHandler contains the fully evaluated
* in BeanManager.getReference(Bean, ...) and all other injection points where
needed, the proxy with the NormalScopedBeanMethodHandler will get applied on
top of it and has a completely different logic on it's own.
> Interceptor instances get created each time the interceptor gets called
> -----------------------------------------------------------------------
>
> Key: OWB-329
> URL: https://issues.apache.org/jira/browse/OWB-329
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Interceptor and Decorators
> Affects Versions: M4
> Reporter: Mark Struberg
> Assignee: Mark Struberg
> Priority: Critical
> Fix For: 1.0.0
>
>
> Interceptors are defined as being @Dependent scoped. Thus, for one
> @ApplicationScoped contextual instance, only one interceptor instance of a
> certain type must exist. But we currently create a new instance for each and
> every method invocation which is intercepted.
> This is not only terribly slow, but also doesn't work as expected from a
> portable perspective.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.