[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Scoped beans deployment

adrian@jboss.org do-not-reply at jboss.com
Thu Feb 8 06:53:35 EST 2007


I don't understand the question?

The policy xml should be unmarshalled to an object that implements
BeanMetaDataFactory. When the deployment invokes getBeans()
that object will create some BeanMetaData for a POJO
that knows how to install/uninstall data into the MetaData repository.


  | public class Policy implements BeanMetaDataFactory
  | {
  |    public void setScope(ScopeMetaData);
  | 
  |    public void setMappings(Map<String, ValueMetaData>)
  | 
  |    public List<BeanMetaData> getBeanMetaData()
  |    {
  |         // IMPORTANT the Mappings needs to be converted to a MapMetaData
  |         // such that the injections in ValueMetaData work correctly, i.e. dependencies
  |         return buildMetaDataRepositoryInstallerBeanMetaData();
  |    }
  | }
  | 
  | public class MetaDataRepositoryInstaller
  | {
  |    public void setScope(ScopeMetaData);
  | 
  |    @Inject // If we can assume there be will only one instance?
  |    public void setKernelMetaDataRepository(KernelMetaDataRepository)
  | 
  |    // The MC will resolve the ValueMetaData to objects!
  |    public void setMappings(Map<String, Object>)
  | 
  |    public void start()
  |    {
  |         // Install
  |    }
  | 
  |    public void stop()
  |    {
  |         // Uninstall
  |    }
  | }
  | 

NOTE: I'm not overly impressed by the name "Policy"
perhaps <metadata> would be a better name?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012985#4012985

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012985



More information about the jboss-dev-forums mailing list