[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Merged ClassInfo annotation view?

alesj do-not-reply at jboss.com
Wed Oct 29 10:30:34 EDT 2008


It depends.

If you have ControllerContext, then something like this:

  |          ControllerContext context = ...
  |          KernelMetaDataRepository repository = kernel.getMetaDataRepository();
  |          MetaData md = repository.getMetaData(context);
  | 

Or get a handle on MetaDataRepository.

  | public interface MetaDataRepository
  | {
  |    /**
  |     * Get the meta data for a scope key
  |     * 
  |     * @param key the key
  |     * @return the meta data
  |     */
  |    MetaData getMetaData(ScopeKey key);
  | 
  |    /**
  |     * Get the meta data retrieval for a scope key
  |     * 
  |     * @param key the key
  |     * @return the meta data
  |     */
  |    MetaDataRetrieval getMetaDataRetrieval(ScopeKey key);
  | 
  |    /**
  |     * Get the children of this scope
  |     * 
  |     * @param key the key
  |     * @return the children
  |     */
  |    Set<ScopeKey> getChildren(ScopeKey key);
  |    
  |    /**
  |     * Visit each node
  |     * 
  |     * @param visitor the visitor
  |     * @return the matching scopes
  |     */
  |    Set<ScopeKey> matchScopes(MetaDataRepositoryVisitor visitor);
  | }
  | 
Where you then pull the MetaData out with the right ScopeKey.

Note: each deployment unit has MetaDataRepository as an attachment:

  |                if (repository != null)
  |                   context.getTransientAttachments().addAttachment(MutableMetaDataRepository.class, repository);
  | 

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

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



More information about the jboss-dev-forums mailing list