-
1. Re: How to hide a bean from other deployments?
trustin Jan 12, 2009 2:38 AM (in response to trustin)Hmm, this question might have been answered here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=147135 -
2. Re: How to hide a bean from other deployments?
alesj Jan 12, 2009 4:15 AM (in response to trustin)"trustin" wrote:
Hmm, this question might have been answered here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=147135
Yes, exactly.
Scoping kernel is at prototype stage, although I did quite a lot of tests on it.
So, I'm pretty confident it does what I wanted to do with it. :-)
Search for @Search or @ApplicationScope annotations to see the scoping usage. -
3. Re: How to hide a bean from other deployments?
trustin Jan 12, 2009 1:23 PM (in response to trustin)"alesj" wrote:
"trustin" wrote:
Hmm, this question might have been answered here:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=147135
Yes, exactly.
Scoping kernel is at prototype stage, although I did quite a lot of tests on it.
So, I'm pretty confident it does what I wanted to do with it. :-)
Search for @Search or @ApplicationScope annotations to see the scoping usage.
Thanks for the answer, Ales. I found that SearchPropertyAnnotationPlugin needs to be added to BeanAnnotationAdapter, and it seems like ALR has found a way to do it: http://tinyurl.com/a7pwo6 -
4. Re: How to hide a bean from other deployments?
dmlloyd Jan 12, 2009 1:29 PM (in response to trustin)Is there any way to add scoping attributes to a bean using the BeanMetaDataBuilder API?
-
5. Re: How to hide a bean from other deployments?
alesj Jan 13, 2009 5:16 AM (in response to trustin)"david.lloyd@jboss.com" wrote:
Is there any way to add scoping attributes to a bean using the BeanMetaDataBuilder API?
Via BMDB::addAnnotation? ;-) -
6. Re: How to hide a bean from other deployments?
obrien Jan 31, 2009 9:49 PM (in response to trustin)I've summarized the scoped kernel usage within the blog post at
http://laststation.net/2009/01/31/jbossmc-scoped-kernel/
It took me quite a while to understand it from the test cases. @Search seems to be a bit confusing way how to handle this. Wouldn't be easier to move search strategies into the @Inject itself and integrate it with the core microcontainer (instead of plugins).
Radim -
7. Re: How to hide a bean from other deployments?
alesj Feb 1, 2009 3:31 AM (in response to trustin)"obrien" wrote:
@Search seems to be a bit confusing way how to handle this.
How would you do it?"obrien" wrote:
Wouldn't be easier to move search strategies into the @Inject itself
Since this is a wip/prototype and out of the usual inject notion
(injection usually works just up the hierarchy) I wanted explicitly
to separate the two.
To actually get proper scoping, as you hinted yourself with 'scope'
element, we need to do certain other things first:
(a) by default bean name should be guid, aliases would be the human name
(b) move all of the aliasing logic past PreInstall state
(c) proper hooks for applying scope (not just annotations)
(d) allow definition of scoping through deployment layer"obrien" wrote:
integrate it with the core microcontainer (instead of plugins).
The core?
The interfaces are a spi, where as the impls are of course plugins.
You can impl your own SearchInfo. -
8. Re: How to hide a bean from other deployments?
obrien Feb 1, 2009 6:13 AM (in response to trustin)I got your point about SPI/implementation.
How would you do it?
Because injection, as you said, is already doing a search - but only up the hierarchy - wouldn't be more coherent to provide this as another search strategy?
Something like<inject bean="something" search="leaves"/> or <inject bean="something"><search type="leaves"/></inject>
Unfortunately when I tried to find the best way where to 'plug' it, I got lost somewhere around FromContext as called within AbstractInjectionValueMetaData.getValue. Guess I need to understand full notion of this first.
---
Wish I had more time to dig into JBossMC code. -
9. Re: How to hide a bean from other deployments?
alesj Feb 1, 2009 8:19 AM (in response to trustin)"obrien" wrote:
Because injection, as you said, is already doing a search - but only up the hierarchy - wouldn't be more coherent to provide this as another search strategy?
At the time I introduced this I though that would bloat inject too much.
Thinking about it now, I think it could be made nicely.
I'll check more in detail over the week and post about it here. -
10. Re: How to hide a bean from other deployments?
alesj Feb 2, 2009 4:31 AM (in response to trustin)"alesj" wrote:
I'll check more in detail over the week and post about it here.
Unless you wanna do it ... ;-) -
11. Re: How to hide a bean from other deployments?
dmlloyd Feb 2, 2009 11:04 AM (in response to trustin)I don't see any way to create a search injection with the BMDB API at all (it doesn't seem like an annotation can be used here; please correct me if I'm wrong).
-
12. Re: How to hide a bean from other deployments?
alesj Feb 2, 2009 11:08 AM (in response to trustin)"david.lloyd@jboss.com" wrote:
I don't see any way to create a search injection with the BMDB API at all (it doesn't seem like an annotation can be used here; please correct me if I'm wrong).
I think you're right, as the annotation currently only applies to bean.
I'll add a new method to BMDB, where you can set the annotation for a property (metadata).
btw: I'll be adding this search directly to inject anyway -
13. Re: How to hide a bean from other deployments?
obrien Feb 2, 2009 11:13 AM (in response to trustin)Unless you wanna do it ... ;-)
I'll give it a go. I know where to start (AbstractDependencyInfo.resolveDependencies), so it's should be 'so difficult.' -
14. Re: How to hide a bean from other deployments?
alesj Feb 2, 2009 11:16 AM (in response to trustin)"obrien" wrote:
Unless you wanna do it ... ;-)
I'll give it a go. I know where to start (AbstractDependencyInfo.resolveDependencies), so it's should be 'so difficult.'
Not really. :-)
You already figured it out. ;-) It's just the AbstractInjectionDependencyMetaData.
You just need to properly fix its DependencyItem and getValue lookup.