"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
would be unwinded to appropriate state, but the ref would still be there,
once it's re-winded.
| 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.
| // do some uninstall on CC:getTarget
| // invoke CC:ungetTarget
View the original post :
Reply to the post :