Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 209344 - [log] need an event adapter
Summary: [log] need an event adapter
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 202278
Blocks:
  Show dependency tree
 
Reported: 2007-11-09 10:26 EST by Chris Aniszczyk CLA
Modified: 2007-12-03 10:17 EST (History)
1 user (show)

See Also:
caniszczyk: review?


Attachments
org.eclipse.equinox.log.patch (10.19 KB, patch)
2007-11-12 17:05 EST, Chris Aniszczyk CLA
no flags Details | Diff
mylyn/context/zip (826 bytes, application/octet-stream)
2007-11-12 17:05 EST, Chris Aniszczyk CLA
no flags Details
org.eclipse.equinox.log.patch (13.34 KB, patch)
2007-11-13 10:23 EST, Chris Aniszczyk CLA
no flags Details | Diff
patch (11.50 KB, patch)
2007-12-03 10:15 EST, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2007-11-09 10:26:33 EST
See bug 202278 for more details
Comment 1 Chris Aniszczyk CLA 2007-11-12 17:03:54 EST
I'll take it
Comment 2 Chris Aniszczyk CLA 2007-11-12 17:05:45 EST
Created attachment 82710 [details]
org.eclipse.equinox.log.patch

Here it is! I fixed up the log event adapter to be compliant with the spec, see section 101.6.4 for more details. In the old implementation, we weren't broadcasting events with the right topic.

I also set the BREE to OSGi Minimum 1.1.
Comment 3 Chris Aniszczyk CLA 2007-11-12 17:05:47 EST
Created attachment 82711 [details]
mylyn/context/zip
Comment 4 Chris Aniszczyk CLA 2007-11-12 17:06:23 EST
Tom to review.
Comment 5 Thomas Watson CLA 2007-11-12 22:55:11 EST
Patch does not work.  LogReader objects must be registered with the LogReaderService *not* the service registry.  LogService (like HttpService) was developed before the white board pattern become popular in OSGi.  I suggest you access the internal implementation of LogReaderService to add the LogEntryEventAdapter.  This way you know you are only firing events for this implementation of the LogService not some other random one which may be installed.
Comment 6 Chris Aniszczyk CLA 2007-11-12 22:59:32 EST
That sucks, I love the whiteboard pattern.

I guess you learn something new everyday.
Comment 7 Chris Aniszczyk CLA 2007-11-13 10:23:07 EST
Created attachment 82773 [details]
org.eclipse.equinox.log.patch

Ok, updated the patch to include the optional import and register the event adapter in the proper place.
Comment 8 Thomas Watson CLA 2007-12-03 10:15:54 EST
Created attachment 84322 [details]
patch

The patch will not work properly unless a bundle is actually using the LogReaderService.  This is because the LogEntryEventAdaptor is not registered as a LogListener until the LogReader factory creates a LogReader for a bundle.

This patch instead makes the adaptor a LogListener and it is registered as a listener to the log impls LogReaderService.  This will ensure that the log events are always propagated to EventAdmin even when no other LogListeners are registered with the LogReaderService.
Comment 9 Thomas Watson CLA 2007-12-03 10:17:26 EST
Patch released for 3.4 M4.