I have added a very simple RegistrationLocal class which will be used to associate the WSRP invocation with the optional Registration interface.
We need to have the WSRP layer to set the Registration when it is not null for the scope of the invocation in order to be able to retrieve it later in the call stack.
It looks like it could be added somewhere nearby the producer.checkRegistration(RegistrationContext rc). Perhaps that method should be renamed to something more meaningful that says that the current thread will be associated with the registration.
Makes sense. This was on my roadmap to do so.