Returns the list of response listeners that needs to be notified of response events.
This list changes as the conversation proceeds, as follows:
-
request R1 send => conversation.updateResponseListeners(null)
- exchanges in conversation: E1
- listeners to be notified: E1.listeners
-
response R1 arrived, 401 => conversation.updateResponseListeners(AuthenticationProtocolHandler.listener)
- exchanges in conversation: E1
- listeners to be notified: AuthenticationProtocolHandler.listener
-
request R2 send => conversation.updateResponseListeners(null)
- exchanges in conversation: E1 + E2
- listeners to be notified: E2.listeners + E1.listeners
-
response R2 arrived, 302 => conversation.updateResponseListeners(RedirectProtocolHandler.listener)
- exchanges in conversation: E1 + E2
- listeners to be notified: E2.listeners + RedirectProtocolHandler.listener
-
request R3 send => conversation.updateResponseListeners(null)
- exchanges in conversation: E1 + E2 + E3
- listeners to be notified: E3.listeners + E1.listeners
-
response R3 arrived, 200 => conversation.updateResponseListeners(null)
- exchanges in conversation: E1 + E2 + E3
- listeners to be notified: E3.listeners + E1.listeners
Basically the override conversation listener replaces the first exchange response listener,
and we also notify the last exchange response listeners (if it's not also the first).
This scheme allows for protocol handlers to not worry about other protocol handlers, or to worry
too much about notifying the first exchange response listeners, but still allowing a protocol
handler to perform completion activities while another protocol handler performs new ones (as an
example, the
AuthenticationProtocolHandler
stores the successful authentication credentials
while the
RedirectProtocolHandler
performs a redirect).