[Design the new POJO MicroContainer] - Re: Bean instantiate order with contextual injection
by alesj
"adrian(a)jboss.org" wrote : That is because you have done it wrong.
|
| This MC is state machine a metadata model.
|
| What you should be doing is changing the way the AbstractDependencyValueMetaData
| works to include demand like processing when the "bean=" is missing.
|
| i.e. You create a new DependencyItem type like the demand dependency
| (see org.jboss.beans.metadata.plugins.AbstractDemandMetaData$DemandDependencyItem)
|
| In particular the method "public boolean resolve(Controller controller)"
|
I must probably put in a 'demand' of my property's class ... and for each context instantiation I supply all implementings classes?
But what if there actually are more then one such matching bean - I would probably get the one that is first instantiated injected, discarting the fact that more matching bean can occur.
What about @Inject meta data?
Where to do the inspection and add dependency items?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964966#3964966
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964966
19 years, 7 months
[Design the new POJO MicroContainer] - Re: Bean instantiate order with contextual injection
by adrian@jboss.org
Additionally, please don't modify any "spi" interfaces
without discussing it first.
This change in Controller
"
/**
* @return all instantiated contexts whose target is instance of this class clazz param
*/
Set getInstantiatedContexts(Class clazz);
/**
* add instantiated context into contextsByClass map
* look at all target's superclasses and interfaces
*/
void addInstantiatedContext(ControllerContext context);
/**
* remove instantiated context from contextsByClass map
* look at all target's superclasses and interfaces
*/
void removeInstantiatedContext(ControllerContext context);
"
Should be a private implementation api not a public api.
See for example AbstractKernelController add/removeSupplies.
Additionally the Controller in dependency is an abstract model.
It has no notion of "instantiate" beyond the state model that
is plugged as an implementation detail.
Neither does it have any notion of "java.lang.Class".
It manages contexts which can be anything.
It is only the KernelController that introduces the notion of POJO.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3964953#3964953
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3964953
19 years, 7 months