Platform wide DebugOptionsListener [message #892426] |
Thu, 28 June 2012 08:08 |
Nirmal Sasidharan Messages: 120 Registered: July 2009 Location: Germany |
Senior Member |
|
|
Hello,
The OSGi based trace feature is really cool. However, the current implementation (as far as I understand) requires that every bundle writes some boiler plate code to enable tracing (to check if the option is enabled or not etc.). I am planning to move this into a central component and cache the queried options. I can, as recommended, use a DebugOptionsListener to invalidate/update my cache. The problem is that the listener is registered based on the symbolicname of the bundle and only the registered DebugOptionsListener for the particular bundle will be called incase of changes. This of course makes sense. Additionally, is it possible to provide a feature such that I can register a DebugOptionsListener with "*" as symbolicname and it gets invoked for changes in options for any bundle?
For example,
Dictionary<String, Object> props = new Hashtable<String, Object>(4);
props.put(DebugOptions.LISTENER_SYMBOLICNAME, "*");
context.registerService(DebugOptionsListener.class.getName(), new OwnDebugOptionsListener(), props);
Or is there a better way of doing this already without having to register listeners for each bundle?
Thanks in advance.
Regards,
Nirmal
|
|
|
|
Powered by
FUDForum. Page generated in 0.02960 seconds