"alesj" wrote :
| But that still leaves the problem of actual service usage at undeploy:
| "alesj" wrote :
| | whereas service could still hold onto the ref - which might be an issue if that
ref is ServiceFactory,
| | as ServiceFactory::unget could modify the actual created service.
| |
Actually SF::unget is called at service unregister,
so this is a bit different, but doesn't change the problem that much.
We could still end up with "illegal" service,
but that's also the case right now - any install/uninstall that keeps injected service
ref,
would be unwinded to appropriate state, but the ref would still be there,
once it's re-winded.
e.g.
| public someInstall(@Inject Foo bar)
| {
| if (this.bar != null) // which is true after unwind/re-wind
| ... // do some crazy stuff on it
|
| this.bar = bar;
| }
|
But I guess that's the problem of encapsulation,
where we go beyond plain java beans.
So, the problem just remains with the ugliness,
but I guess we can cope with that.
| try
| {
| // do some uninstall on CC:getTarget
| }
| finally
| {
| // invoke CC:ungetTarget
| }
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266340#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...