On 2012-5-17, at 下午10:09, maaruks wrote:
no, is just a local variable. means it can't be changed after
it has
got a value
IMO final prevent ref to get a new value, so when you uninstall the
service provider bundle, the ServiceReference is gone(means ref become
null) and have no chance to assign a new value to ref.
In your code, the ref do need change when you uninstall/install
service provider bundle as the ServiceReference actually changed, so
it just couldn't be final.
I am not sure why my code didn't work. "OSGi in action" book has
similar
code and claims it should work.
--
View this message in context:
http://karaf.922171.n3.nabble.com/service-reference-is-null-after-service-reinstall-tp3996874p3999113.html
Sent from the Karaf - User mailing list archive at Nabble.com.
---------------------------------------------
Freeman Fang
FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042