/**
* Removes a service listener from the given bundle context. This method
* simply takes care of any exceptions that might be thrown (in case the
* context is invalid).
*
* @param context bundle context to unregister the listener from
* @param listener service listener to unregister
* @return true if the listener unregistration has succeeded, false
* otherwise (for example if the bundle context is invalid)
*/
public static boolean removeServiceListener(BundleContext context, ServiceListener listener) {
if (context == null || listener == null)
return false;
try {
context.removeServiceListener(listener);
return true;
}
catch (IllegalStateException e) {
// Bundle context is no longer valid
}
return false;
}
OsgiListenerUtils.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:gemini.blueprint
作者:
评论列表
文章目录