-
1. Re: Producer method object as a delegate object?
swd847 Dec 13, 2010 12:45 AM (in response to sivakumart)This is not a valid scenario.
I agree that the spec is not clear on the issue, however I know that Gavin has stated that the expert group expected interceptors and decorators to be implemented via sub classing rather than proxies, which means that it would not be possible to apply them to produced beans (The spec sort of implies this in a round about way, as it does not place restrictions such as no-arg constructors on decorated beans, which are necessary for implementation via proxy).
Weld has just changed to implementing interceptors/decorators via subclassing, which will be in the next release.
-
2. Re: Producer method object as a delegate object?
pmuir Dec 13, 2010 7:01 AM (in response to sivakumart)
Stuart Douglas wrote on Dec 13, 2010 00:45:
This is not a valid scenario.
I agree that the spec is not clear on the issue, however I know that Gavin has stated that the expert group expected interceptors and decorators to be implemented via sub classing rather than proxies, which means that it would not be possible to apply them to produced beans (The spec sort of implies this in a round about way, as it does not place restrictions such as no-arg constructors on decorated beans, which are necessary for implementation via proxy).
Weld has just changed to implementing interceptors/decorators via subclassing, which will be in the next release.
The spec does state this
Decorators may be associated with any managed bean that is not itself an interceptor or decorator or with any EJB session bean. A decorator instance is a dependent object of the object it decorates.However annoyingly doesn't clearly define
associated
very clearly, however it is possible to infer from reading the spec thatassociated
does mean mean applied.