[Design of POJO Server] - Re: KernelDeploymentManagedObjectCreator doesn't include all
by alesj
"scott.stark(a)jboss.org" wrote :
| So if its changed to a collection of beans (BeanMetaData) this is equivalent to call the deprecated setBeans() method on the KernelDeployment. Why is it deprecated?
|
I think this is an old leftover.
It should probably be removed before we did CR. :-(
But as you can see, both setBeans and setBeanFactories, set the same variable: List beanFactories
| @SuppressWarnings("unchecked")
| public void setBeans(List beans)
| {
| this.beanFactories = beans;
| flushJBossObjectCache();
| }
|
| /**
| * Set the bean factories.
| *
| * @param beanFactories a List<BeanMetaDataFactory>.
| */
| @ManagementProperty(managed=true)
| @XmlElements
| ({
| @XmlElement(name="bean", type=AbstractBeanMetaData.class),
| @XmlElement(name="beanfactory", type=GenericBeanFactoryMetaData.class),
| @XmlElement(name="lazy", type=AbstractLazyMetaData.class)
| })
| @XmlAnyElement
| public void setBeanFactories(List<BeanMetaDataFactory> beanFactories)
| {
| this.beanFactories = beanFactories;
|
So, setBeans != getBeans, in terms of what they handle.
Dunno how you can really solve this at the MO level then. :-)
Probably each BeanMetaDataFactory impl will have to declare its getBeans as MO property?
Or can this be done on the interface?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187889#4187889
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187889
17 years, 5 months
[Design of POJO Server] - KernelDeploymentManagedObjectCreator doesn't include all BMD
by alesj
Looking at KernelDeploymentManagedObjectCreator impl
| for(BeanMetaDataFactory bmdf : beanFactories)
| {
| if((bmdf instanceof BeanMetaData) == false)
| continue;
|
| BeanMetaData bmd = (BeanMetaData) bmdf;
|
This defeats the purpose of wildcard matching in KernelDeployment.
e.g. DML's Thread beans won't be picked up as MOs
But I guess if I do this
| for(BeanMetaDataFactory bmdf : beanFactories)
| {
| List<BeanMetaData> bmds = bmdf.getBeans();
| if (bmds != null && bmds.isEmpty() == false)
| {
| for (BeanMetaData bmd : bmds)
| {
|
then I break the MO code:
| CollectionMetaType moType = new CollectionMetaType(BeanMetaDataFactory.class.getName(), AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
|
| ...
|
| GenericValue[] mos = new GenericValue[tmp.size()];
| tmp.toArray(mos);
| CollectionValueSupport values = new CollectionValueSupport(moType, mos);
| // This bypasses the write through back to the metadata
| beanFactoriesMP.getFields().setField(Fields.VALUE, values);
|
ss this probably expect that all mos are also BMDF instances.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187851#4187851
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187851
17 years, 5 months