Skip to main content

TimeShiftEvent not sent to ServiceContextEventListener

2 replies [Last post]
ramks
Offline
Joined: 2010-06-17
Points: 0

Since TimeShiftEvent is also a ServiceContextEvent, I expect the event to get notified to a ServiceContextEventListener (apart from TimeShiftEventListener). But in RI code the event is sent only to TimeShiftEventListener.

DVR spec says

6.2.1.3.4 Resource Management
h) the implementation SHALL generate an org.ocap.dvr.TimeShiftEvent to the service context.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cpratt
Offline
Joined: 2008-12-18
Points: 0

Agreed that the spec could be clarified in this area. And I'll put in a request for clarification.

However, I don't believe the text in 6.2.1.3.4(g)(h)(i) makes it a requirement that a listener registered via ServiceContext.addListener(ServiceContextListener) should receive TimeShiftEvents.

First, TimeShiftProperties is a ServiceContext. So when the text below refers to "the service context", that doesn't necessarily refer to the ServiceContextListener - since the TimeShiftListener is also registered on the ServiceContext. I believe TSE extends SCE since TSE.getServiceContext() is necessary to get a reference back to the ServiceContext (which is necessarily a TimeShiftProperties).

Second, the TimeShiftListener javadoc states that "The TimeShiftListener interface is implemented by applications wishing to receive events related to time shift resources." This implies (to me at least) that applications will only get these events if they wish to (by registering a TimeShiftListener). If the event was posted to the SCL, they would get the event even when they didn't wish to.

ramks
Offline
Joined: 2010-06-17
Points: 0

I can also argue that TimeShiftListener was introduced for apps who are only interested in TSEvents and other apps can happily depend on SCL alone.

I am just playing devil's advocate here. It would be great to know the intention of the spec writers.

Thanks.