public interface Connection
When implementing a Connection, it is a best practice to override Object.hashCode()
and Object.equals(Object)
to achieve maximum efficiency during execution. Doing so
allows the engine to identify when a Connection object equivalent to a known Connection is
supplied via the API. When that happens, the engine is able to re-use the same internal server
object for that connection rather than having to create a second one.
If the implementing object does not provide a useful Object.hashCode()
and Object.equals(Object)
, the net result is that the protocol may end up seeing multiple calls to
Interceptor.startInterception(ClientRequestHandler)
with different ClientRequestHandler
instances. In that case, it will be up to the protocol to decide how to
dispatch incoming requests and deal with the results (i.e. multiple calls to ClientRequest.sendResponse(RawResponse)
for one logical request in the event that the protocol
decides to dispatch the event to all known ClientRequestHandler
instances).