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(a)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(a)hibernate.org>
To: Scott Ferguson <ferg(a)caucho.com>
Cc: Michael Keith <michael.keith(a)oracle.com>; WebBeans
<webbeans-dev(a)lists.jboss.org>; Java Community Process JSR #299 Expert List
<JSR-299-EG(a)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(a)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(a)gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org
_______________________________________________
webbeans-dev mailing list
webbeans-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/webbeans-dev
_______________________________________________
webbeans-dev mailing list
webbeans-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/webbeans-dev