1 Reply Latest reply on Jul 11, 2008 4:34 PM by Ales Justin

    BeanMetaDataBuilder and deprecated KernelDeployment.setBeans

    Scott Stark Master

      There is a bit of a mismatch with the migration to the BeanMetaDataFactory as the preferred KernelDeployment approach to describing the beans in the deployment and BeanMetaDataBuilder only providing access to a BeanMetaData instance. One either has to test whether the resulting BeanMetaData is a BeanMetaDataFactory (and for the default BeanMetaDataBuilder which returns an AbstractBeanMetaData it is), or use the deprecated KernelDeployment.setBeans. Can we add a way to get hold of a BeanMetaDataFactory from the BeanMetaDataBuilder to avoid this?

        • 1. Re: BeanMetaDataBuilder and deprecated KernelDeployment.setB
          Ales Justin Master

          I've added this two methods:

           /**
           * Get bean factory from underlying bean meta data.
           *
           * Note: this one includes all nested beans from
           * underlying bean metadata.
           *
           * @return bean meta data factory
           */
           public abstract BeanMetaDataFactory getBeanMetaDataFactory();
          
           /**
           * Get underlying bean as BeanMetaDataFactory.
           *
           * Note: this method doesn't include nested beans from
           * underlying bean metadata.
           *
           * @return bean meta data factory
           */
           public BeanMetaDataFactory asBeanMetaDataFactory()
           {
           return new BeanMetaDataFactory()
           {
           public List<BeanMetaData> getBeans()
           {
           return Collections.singletonList(getBeanMetaData());
           }
           };
           }