[Design the new POJO MicroContainer] - Re: Indirect dependency names
by adrian@jboss.org
"alesj" wrote :
| Perhaps having a more open BeanMetaDataBuilder is the way to go - meaning you can provide what the actual metadata impls are we gonna use,
|
You mean something like Builder::addInstallCallback(InstallCallback ic);
Where ic can be your own implementation. Ok.
But I don't think that is the issue here is it?
For this case (as I understand it),
the thing that is building the BeanMetaData just needs to do:
builder.addInstallCallback(method, someGeneratedName);
The part I don't understand is why it has to get more complicated?
Why do we need lots of new interfaces or methods when the thing creating
the BeanMetaData is the one that knows what the generated names are?
Like I said above, if you don't know what the generated name is
how are you going to uninstall it when it is no longer required?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143114#4143114
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143114
17 years, 12 months
[Design the new POJO MicroContainer] - Re: Indirect dependency names
by scott.stark@jboss.org
"adrian(a)jboss.org" wrote :
| 1) Why can't the thing that creates the MC contexts do your logical name + next number
| processing? i.e. you store next number within the factory.
|
It can, and currently does. Its just needing to rebuild the bean metadata list for the components for each new instance even though all that changes are the underlying mc bean names. In terms of types of metadata and relationships between then, nothing changes once the factory is initialized. If there was a name indirection on the dependency values then only that piece would need to be updated.
Actually, back to the guid idea notion, if there was auto generated id notion with a scoped alias notion such that the dependencies names used the alias scoped to the list of beans used by the factory, and the bean guid was generated each time then that is something that would work.
"adrian(a)jboss.org" wrote :
| 2) What unregisters the MC contexts when they are no longer required?
| i.e. what keeps track of this generated name to remove it?
I updated the "GenericBeanFactory and install methods" thread:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=133332
with the current ComponentFactory spi, it has a destroyBeans call to unregister the beans created during createBeans.
This code is checked in the jboss-kernel project tests under org.jboss.test.kernel.deployment.support.container.{spi,plugin}.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143108#4143108
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143108
17 years, 12 months
[Design the new POJO MicroContainer] - Re: Indirect dependency names
by alesj
As I understand what Scott is trying to do is to have a pre-defined metadata, e.g. InstallMetaData that does 'mybean::addInterceptor'.
Where mybean would be determined in createBean method, mostly preprending 'baseName' and appending some number to existing meaningful name (e.g. BeanContext).
Reusing pre-defined metadata should be done by cloning, since when metadata moves through states, we set some member variables. Knowing where this is done is impl detail on which you should not rely - e.g. we might change the actual metadata impl.
Perhaps having a more open BeanMetaDataBuilder is the way to go - meaning you can provide what the actual metadata impls are we gonna use, e.g. when we do a LifecycleMetaData instantiation, one could override that with it's own impl, not using our default AbstractLifecycleMetaData.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4143105#4143105
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4143105
17 years, 12 months