public class ProtocolInvocationHandler extends Object implements InvocationHandler
InvocationHandler
for ProtocolClient
. The
invoke(Object,Method,Object[])
translates the interface
Method
invocation into an HttpMessage
through a
ProtocolRequestBuilder
. If the Method.getReturnType()
is
assignable from the generated HttpMessage
, then it is simply
returned; otherwise, the request is executed through
ProtocolClient.client()
with the
ProtocolClient.context()
. If the Method.getReturnType()
is HttpResponse
then the response is returned with no further
processing (and the caller is responsible for consuming any entities).
Otherwise, a ProtocolResponseHandler
is provided to the call.Modifier | Constructor and Description |
---|---|
protected |
ProtocolInvocationHandler(ProtocolClient<?> client)
Sole constructor.
|
protected ProtocolInvocationHandler(ProtocolClient<?> client)
client
- The ProtocolClient
.Copyright © 2015–2020 Allen D. Ball. All rights reserved.