[jboss-user] [Microcontainer] - Re: How to hide a bean from other deployments?
do-not-reply at jboss.com
Tue Feb 3 10:39:47 EST 2009
"alesj" wrote : This is now done.
| - https://jira.jboss.org/jira/browse/JBMICROCONT-406
| It took a bit more than just that patch. :-)
| And, DML, I also updated BMDB to be able to use
| search in inject or add annotation metadata to property.
proper integration :). Thanks for that.
I spend some time last night designing the integration with RESTEasy and realized scoping really needs significantly more work. This is total science fiction and terminology is most likely mixed, but :
1. search itself doesn't have any concept of precedence/relationship of two scopes and respective deployment, ie. possible to pick up wrong bean.
I'll solved that for now by provisioning custom LookupStrategy, but within the kernel structure there's not sense of the deployment structure. For example is there easy way how to pickup beans from particular deployment (from jboss-beans.xml for example)?
2. That leads to the <scope%gt> we've discussed and I think it doesn't make sense to create it in such a manner.
To provide some generalized control of scoping to application developer I realized it would be better to have it on deployment level. Something like this:
| <deployment scoped="true" name="myApp" xmlns="urn:jboss:bean-deployer:3.0">
where scoping could be enabled by default. Then it would be just matter to create nested deployments and define visibility/relationship rules between them.
3. Rules are needed for merging of deployment scopes(along two different physical deployments).
4. In such a case Kernel/Controller reference handed over to the application (for example WAR file), would represent just its deployment scope, with resolving functionality by default to be upwards in the structure (as it's currently).
5. Then concept of the ObjectName as it was used within JMX microkernel could be recreated to support something like maindeployment.subdepl:name=myBean to define cross-scope references.
6. And to get this to the extreme, it might be then possible to create RemoteDeployment where the given scope doesn't have to part of the same JVM. with clever mixing of VFS delegation to the other kernel, aspects and bit of dark magic that could work :)
*. Which leads me to the question, if there is currently way how to 'include' other XML deployment descriptor?
And don't ask me what I'm trying to implement :) now it's time to see my shrink.
To stay real, there's a small bit I can try to implement - AbstractKernelController to have support to return scope context, because I don't see other way than lookup strategy to get to the scoped beans.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4206609#4206609
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4206609
More information about the jboss-user