java.lang.Object
edu.iu.client.RemoteInvocationHandler
- All Implemented Interfaces:
InvocationHandler
May be extended for synchronous client=side remote invocation of a Java
interface via HTTP POST.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> IuJsonAdapter<T> Get aIuJsonAdapterfor converting to a generic type.protected abstract voidauthorize(HttpRequest.Builder requestBuilder) Adds authorization headers to a pending remote call requestprotected voidpayload(HttpRequest.Builder requestBuilder, Method method, Object[] args) Adds request payload to a pending remote call request.protected abstract URISupplies the remote invocation URI.
-
Constructor Details
-
RemoteInvocationHandler
protected RemoteInvocationHandler()Default constructor.
-
-
Method Details
-
uri
Supplies the remote invocation URI.- Parameters:
method- remote method- Returns:
URI
-
authorize
Adds authorization headers to a pending remote call request- Parameters:
requestBuilder- pending remote call request
-
payload
Adds request payload to a pending remote call request.Default behavior is to POST arguments as a JSON array, using
adapt(Type)for conversion.- Parameters:
requestBuilder- pending remote call requestmethod- methodargs- arguments
-
adapt
Get aIuJsonAdapterfor converting to a generic type.- Type Parameters:
T- Java type- Parameters:
type- Java type- Returns:
IuJsonAdapter
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-