-
1. Re: Merged ClassInfo annotation view?
alesj Oct 29, 2008 5:46 AM (in response to starksm64)"scott.stark@jboss.org" wrote:
Do we have framework to augment the ClassInfo with annotation information from other sources, such as mc BeanMetaData?
It's called MDR. :-)
See how I check for annotations in our MC IoC,
regardless of what source they come from:
- http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/CommonAnnotationAdapter.java
ClassInfo is not the right place to augment this,
as this annotation/metadata info is per instance,
hence you need some middle layer to bind the two == MDR. -
2. Re: Merged ClassInfo annotation view?
starksm64 Oct 29, 2008 9:41 AM (in response to starksm64)Ok, so jboss-managed would have to add a dependency on jboss-mdr and a MetaData instance added to the ManagedObjectFactory and related apis. I was thinkin it might be better to avoid that, and hook the mdr into a Configuration ClassAdapter plugin for example.
I don't see where the BeanMetaData.getAnnotations is used in the org.jboss.kernel.plugins.annotations package, so where does the metadata layer annotation override the class annotation when MetaData.getAnnotation is called? -
3. Re: Merged ClassInfo annotation view?
alesj Oct 29, 2008 9:45 AM (in response to starksm64)"scott.stark@jboss.org" wrote:
I don't see where the BeanMetaData.getAnnotations is used in the org.jboss.kernel.plugins.annotations package, so where does the metadata layer annotation override the class annotation when MetaData.getAnnotation is called?
http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelScopeInfo.java -
4. Re: Merged ClassInfo annotation view?
starksm64 Oct 29, 2008 10:14 AM (in response to starksm64)Ok, that is a torturous path to follow. So I assume that its the DeploymentUnit.getMetaData() accessor that gives me what I want to build the management interface from?
-
5. Re: Merged ClassInfo annotation view?
alesj Oct 29, 2008 10:30 AM (in response to starksm64)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);
-
6. Re: Merged ClassInfo annotation view?
starksm64 Oct 29, 2008 10:37 AM (in response to starksm64)It looks like the AbstractDeploymentContext.getMetaData() method does this for me though.
-
7. Re: Merged ClassInfo annotation view?
alesj Oct 29, 2008 10:45 AM (in response to starksm64)"scott" wrote:
It looks like the AbstractDeploymentContext.getMetaData() method does this for me though.
True, but w/o this fix:
- https://jira.jboss.org/jira/browse/JBDEPLOY-118
you won't get the right MetaData.
- Bean's ScopeKey != ComponentDU ScopeKey.
But even then, you might run into problems --> see Adrian's last note/warning on JIRA's forum thread. -
8. Re: Merged ClassInfo annotation view?
starksm64 Oct 29, 2008 2:45 PM (in response to starksm64)"alesj" wrote:
True, but w/o this fix:
- https://jira.jboss.org/jira/browse/JBDEPLOY-118
you won't get the right MetaData.
- Bean's ScopeKey != ComponentDU ScopeKey.
But even then, you might run into problems --> see Adrian's last note/warning on JIRA's forum thread.
Ok, I'll have to see what I'm getting. -
9. Re: Merged ClassInfo annotation view?
alesj Oct 29, 2008 4:43 PM (in response to starksm64)"scott.stark@jboss.org" wrote:
Ok, I'll have to see what I'm getting.
You can temp use 2.2.0-SNAPSHOT deployers
- which has the latest fixes / tasks -
as I've already deployed it into snapshot repo. -
10. Re: Merged ClassInfo annotation view?
starksm64 Oct 29, 2008 6:11 PM (in response to starksm64)Don't I need to make the changes on the Branch_2_0 branch for 2.0.0.x?
-
11. Re: Merged ClassInfo annotation view?
alesj Oct 29, 2008 7:47 PM (in response to starksm64)"scott.stark@jboss.org" wrote:
Don't I need to make the changes on the Branch_2_0 branch for 2.0.0.x?
Sure, on both - Branch_2_0 and trunk.
You should do the same for jboss-man. ;-) -
12. Re: Merged ClassInfo annotation view?
starksm64 Oct 29, 2008 9:05 PM (in response to starksm64)"alesj" wrote:
You should do the same for jboss-man. ;-)
Your a branch slave driver. -
13. Re: Merged ClassInfo annotation view?
alesj Oct 30, 2008 4:51 AM (in response to starksm64)"scott.stark@jboss.org" wrote:
"alesj" wrote:
You should do the same for jboss-man. ;-)
Your a branch slave driver.
Whip whoosh, whooos!!
And make it fast. :-) -
14. Re: Merged ClassInfo annotation view?
starksm64 Oct 30, 2008 5:42 PM (in response to starksm64)I have all of the changes in deployers and managed, but as I'm testing these in jbossas I don't see the BeanMetaData annotations showing up in the MetaData for the deployments. In fact, there MetaData obtained from the DeploymentUnit.getMetaData does not have anything it appears. I'm using the current jboss-deployers trunk code and jboss-managed trunk where I have the changes locally. I'm going to drill down into why there is nothing in the MetaData tree.