[jboss-dev-forums] [Design of POJO Server] - KernelDeploymentManagedObjectCreator doesn't include all BMD

alesj do-not-reply at jboss.com
Fri Nov 7 17:59:27 EST 2008


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



More information about the jboss-dev-forums mailing list