[webbeans-dev] Re: Bean.getInjectionPoints()

Gavin King gavin at hibernate.org
Fri Jan 2 04:40:13 EST 2009


No, this stuff does actually require a well-defined contract because
Bean is an extension point that is implemented by third-parties.

On Fri, Jan 2, 2009 at 6:05 PM, Gurkan Erdogdu <gurkanerdogdu at yahoo.com> wrote:
> Just my comment:
>
> For adding the new API for this complicates the specification.
> I think, specification provides the necessary API related with Bean
> creation. As I said, these concerns are left to the implementations.
>
> Gurkan
>
> ________________________________
> From: Gavin King <gavin at hibernate.org>
> To: Scott Ferguson <ferg at caucho.com>
> Cc: Michael Keith <michael.keith at oracle.com>; WebBeans
> <webbeans-dev at lists.jboss.org>; Java Community Process JSR #299 Expert List
> <JSR-299-EG at jcp.org>
> Sent: Friday, January 2, 2009 7:19:20 AM
> Subject: Re: [webbeans-dev] Re: Bean.getInjectionPoints()
>
> On Fri, Jan 2, 2009 at 3:42 PM, Gavin King <gavin at hibernate.org> wrote:
>
>> Actually I think there is a better way to solve the problem, but I
>> need to talk it over with Pete.
>
> The alternate solution is something like:
>
>   interface CreationalContext {
>       void add(Bean<X> bean, X instance); //registers an "incomplete"
> instance
>   }
>
>   interface Contextual<T> {
>       public abstract T create(CreationalContext ctx);
>       ...
>   }
>
>   interface Context {
>       public <T> T get(Contextual<T> bean); //get any existing instance
>       public <T> T get(Contextual<T> bean, CreationalContext ctx);
> //get or create an instance
>
>       public Class<? extends Annotation> getScopeType();
>       boolean isActive();
>   }
>
>   interface Manager {
>       Object getInstanceToInject(CreationalContext ctx,
> InjectionPoint ij, Type type, Annotation... bindings);
>       ...
>   }
>
> And getInstanceToInject() would be smart enough to return any object
> that had already been registered with the CreationalContext.
>
> Note that this solution addresses the problem of circular references,
> and also fixes a hole in how the Manager knows about the
> InjectionPoint.
>
> --
> Gavin King
> gavin.king at gmail.com
> http://in.relation.to/Bloggers/Gavin
> http://hibernate.org
> http://seamframework.org
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>
>
> _______________________________________________
> webbeans-dev mailing list
> webbeans-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/webbeans-dev
>
>



-- 
Gavin King
gavin.king at gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org



More information about the weld-dev mailing list