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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...