Peter Kriens wrote:
During the specification of the Event Admin we had some discussions
about this. I recall that we did not want to specify who was bridging
the events. The natural solution is that each subsystem (like UPnP)
sends out the events to the event admin. This is in line with the way
we are going with new specs, they usually do not have their own
listeners anymore.

However, this leaves legacy code. In our reference implementation we
added mappers to Event Admin so we could minimize the work on the
older reference implementations. Obviously the huge disadvantage is
that Event Admin becomes coupled to everything which creates a Devil's
snare that you will get entangled in. This is therefore not the road
I'd like to go.

So for now, the best solution is to make each mapper a separate bundle. This is
a bit of extra work, but then the deployer can on a case by case basis
decide if a specific subsystem needs an event mapper.

In the future, the intention is that the subsystems (like UPnP)
deliver the events to Event Admin themselves.

When you talk about UPnP Subsystem you refer to both the Base Driver and UPnPDevice (imported and exported) , don't? I like your previous proposal, but I think it will be (would had to be) a definitive solution if we want to maintain compatibility with UPnPDevice (OSGi side) already developed and coming ones.

Best regards,
   francesco


So the spec does not define this case because we wanted it to leave
open. However, it would be nice if we had said we left it open and
showed the possibilities, sorry.

Kind regards,

     Peter Kriens





Hm, the problem I see with this is how do you know that a device that
reads the spec differently doesn't send its events to the event admin
too? Then we end-up with a situation where we have duplicated events.

Sure, but this is legacy since the
org.osgi.service.upnp.UPnPEventListener exists before R4 and EventAdmin.

KP> But how does this change things in this regard? The spec clearly
KP> states that in R4 UPnPEvents must be available through the EA. It,
KP> however, fails to mention who is responsible to do this. Moreover, it
KP> is not exactly a legacy problem (it is now, but only because the R4
KP> spec is vague) - all that would have been necessary to avoid it would
KP> have been to be specific about who is doing the adaption.

One more thing : an argument to add the UPnP to EA bridge inside the EA
implementation may be an optimization
in which the bridge is deactived when non EventHandler with
(event.topics=org/osgi/service/upnp/UPnPEvent) is registered !
A general-purpose dependency manager could be useful in this context !
Isn't it Rick ;-)

KP> Sure, that was my intention. I do the same with for example the
KP> adaption of LogService entries to events. There is no hard dependency
KP> on a LogService nor on the org.osgi.service.log package. As soon as a
KP> LogService becomes available its entries are adapted until it goes
KP> away again.

More over, there is the same optimization for Framework-,
Bundle-,Service-, and  Log-Events
Karl, how do you tacckle that in your EA implementation ?

KP> Yes, as I was saying, that is the reason why I find it a good idea to
KP> put the UPnPEvent adaption in the EA too. As stated above, the EA has
KP> a dynamic import header for the org.osgi.service.log package and
KP> registers a service listener for LogReaders. As soon as such a service
KP> becomes available adaption is started for it until the service goes
KP> away. That way the EA has no hard dependency on any other bundle.

Didier

KP> O.k., let me propose the following, I integrate the bridge in the EA
KP> and make it a configurable option. That way we provide the possibility
KP> to adapt all UPnPEvents in case

KP> org.apache.felix.eventadmin.AdaptUPnPEvents=true

KP> if not then we don't. Additionally, I will ask at the osgi-dev list
KP> whether there is any better approach we didn't see.

KP> Opinions?

KP> regards,

KP> Karl

KP> --
KP> Karl Pauls
KP> [EMAIL PROTECTED]



Reply via email to