Listener of a well behaved OCAP application
I have some questions on OCAP Well-Behaved Applications.I understand that like any other well behaved listener,OCAP application listener should not block.
1. Listener would be called from implementation's execution context
2. Any call made by the application from the event listener code would be also in implementation's execution context and not the application's context.
As per above two statements, the implementation identifies the caller (in this case the OCAP application) based on the caller's context, then caller's context will be incorrect if call is made directly from the event listener callaback.
1. OCAP application registers for ServiceContext events.
2. Implementation calls receiceServiceContext() of the application.
3. Application calls a OCAP API (example getServiceContentHandlers())in turn
public void receiceServiceContext(ServiceContextEvent event) //OCAP app
Now for the implementation, getServiceContentHandlers() is called in implementation's execution context and not in applications's context even though it's the application which is making the call.
What is the expected behaviour here?
1. OCAP Application listener should take care to make the calls from it's own context?How?
2. Should implementation be identifying the API caller without using the context?