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

alesj do-not-reply at jboss.com
Fri Feb 9 11:29:22 EST 2007


"adrian at jboss.org" wrote : 
  | 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 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
  |   |    }
  |   | }
  |   | 
  | 

You probably meant this code:

  | // Get a link to the scoped metadata
  | KernelMetaDataRepository kmdr = kernel.getMetaDataRepository();
  | MutableMetaDataRepository mmdr = kmdr.getMutableMetaDataRepository();
  | ScopeKey scope = from the <scope/>;
  | MutableMetaData mmd = (MutableMetaData) mmdr.getMetaDataRetrieval(scope);
  | 
  | // Not found create it
  | if (mmd != null)
  | {
  |   mmd = ...;
  |   mmdr.addMetaDataRetrieval(mmd);
  | }
  | 
  | for (iterate)
  |    mmd.addMetaData(name, object, object.getClass());
  | 

into MetaDataRepositoryInstaller.start()?

So this means that Bindings should be deployed against new (Scoped)Kernel, not against the underlying.

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

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



More information about the jboss-dev-forums mailing list