public class ClientProxyImpl extends AbstractClient implements InvocationHandlerAware, InvocationHandler, Closeable
Modifier and Type | Class and Description |
---|---|
protected static class |
ClientProxyImpl.BeanPair |
protected class |
ClientProxyImpl.BodyWriter |
AbstractClient.AbstractBodyWriter, AbstractClient.AbstractClientAsyncResponseInterceptor
Modifier and Type | Field and Description |
---|---|
protected ClientProxyImpl.BodyWriter |
bodyWriter |
protected static String |
BUFFER_PROXY_RESPONSE |
protected static ResourceBundle |
BUNDLE |
protected ClassResourceInfo |
cri |
protected boolean |
inheritHeaders |
protected boolean |
isRoot |
protected static Logger |
LOG |
protected Client |
proxy |
protected static String |
PROXY_METHOD_PARAM_BODY_INDEX |
protected ClassLoader |
proxyLoader |
protected static String |
SLASH |
protected Map<String,Object> |
valuesMap |
cfg, EXECUTOR_SERVICE_PROPERTY, HTTP_SCHEME, KEEP_CONDUIT_ALIVE, REQUEST_CONTEXT, RESPONSE_CONTEXT
Constructor and Description |
---|
ClientProxyImpl(ClientState initialState,
ClassLoader loader,
ClassResourceInfo cri,
boolean isRoot,
boolean inheritHeaders,
Object... varValues) |
ClientProxyImpl(URI baseURI,
ClassLoader loader,
ClassResourceInfo cri,
boolean isRoot,
boolean inheritHeaders,
Map<String,Object> properties,
Object... varValues) |
ClientProxyImpl(URI baseURI,
ClassLoader loader,
ClassResourceInfo cri,
boolean isRoot,
boolean inheritHeaders,
Object... varValues) |
Modifier and Type | Method and Description |
---|---|
protected void |
addFormValue(javax.ws.rs.core.MultivaluedMap<String,String> form,
String name,
Object pValue,
Annotation[] anns) |
protected void |
addNonEmptyPath(javax.ws.rs.core.UriBuilder builder,
String pathValue) |
protected javax.ws.rs.client.InvocationCallback<Object> |
checkAsyncCallback(OperationResourceInfo ori,
Map<String,Object> reqContext,
Message outMessage) |
protected void |
checkResponse(Method m,
javax.ws.rs.core.Response r,
Message inMessage) |
protected Message |
createMessage(Object body,
OperationResourceInfo ori,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
URI currentURI,
Exchange exchange,
Map<String,Object> invocationContext,
boolean isProxy) |
protected Object |
doChainedInvocation(URI uri,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
OperationResourceInfo ori,
Object[] methodParams,
Object body,
int bodyIndex,
Exchange exchange,
Map<String,Object> invocationContext) |
protected javax.ws.rs.client.InvocationCallback<Object> |
doCheckAsyncCallback(OperationResourceInfo ori,
javax.ws.rs.client.InvocationCallback<Object> callback) |
protected Object |
doInvokeAsync(OperationResourceInfo ori,
Message outMessage,
javax.ws.rs.client.InvocationCallback<Object> asyncCallback) |
protected static ResponseExceptionMapper<?> |
findExceptionMapper(Message message,
Class<?> exType) |
protected List<javax.ws.rs.core.MediaType> |
getAccept(javax.ws.rs.core.MultivaluedMap<String,String> allHeaders) |
protected static int |
getBodyIndex(javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map,
OperationResourceInfo ori) |
protected Type |
getGenericReturnType(Class<?> serviceCls,
Method method,
Class<?> returnType) |
Object |
getInvocationHandler() |
protected static Annotation[] |
getMethodAnnotations(Method aMethod,
int bodyIndex) |
protected static Multipart |
getMultipart(OperationResourceInfo ori,
int index) |
protected static Annotation[] |
getParamAnnotations(Method m,
Parameter p) |
protected static List<Parameter> |
getParameters(javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map,
ParameterType key) |
protected javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> |
getParametersInfo(Method m,
Object[] params,
OperationResourceInfo ori) |
protected List<Object> |
getPathParamValues(Method m,
Object[] params,
javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map,
List<Parameter> beanParams,
OperationResourceInfo ori,
int bodyIndex) |
protected Class<?> |
getReturnType(Method method,
Message outMessage) |
protected Map<String,ClientProxyImpl.BeanPair> |
getValuesFromBeanParam(Object bean,
Class<? extends Annotation> annClass) |
protected Map<String,ClientProxyImpl.BeanPair> |
getValuesFromBeanParam(Object bean,
Class<? extends Annotation> annClass,
Map<String,ClientProxyImpl.BeanPair> values) |
protected boolean |
getValuesFromBeanParamField(Object bean,
Field f,
Class<? extends Annotation> annClass,
Map<String,ClientProxyImpl.BeanPair> values) |
protected void |
handleCookies(Method m,
Object[] params,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
List<Parameter> beanParams,
javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map) |
protected javax.ws.rs.core.MultivaluedMap<String,String> |
handleForm(Method m,
Object[] params,
javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map,
List<Parameter> beanParams) |
protected void |
handleHeaders(Method m,
Object[] params,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
List<Parameter> beanParams,
javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map) |
protected void |
handleMatrixes(Method m,
Object[] params,
javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map,
List<Parameter> beanParams,
javax.ws.rs.core.UriBuilder ub) |
protected List<Attachment> |
handleMultipart(javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map,
OperationResourceInfo ori,
Object[] params) |
protected void |
handleQueries(Method m,
Object[] params,
javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map,
List<Parameter> beanParams,
javax.ws.rs.core.UriBuilder ub) |
protected Object |
handleResponse(Message outMessage,
Class<?> serviceCls) |
Object |
invoke(Object o,
Method m,
Object[] params)
Updates the current state if Client method is invoked, otherwise
does the remote invocation or returns a new proxy if subresource
method is invoked.
|
protected boolean |
isIgnorableParameter(Method m,
Parameter p) |
protected JaxrsClientCallback<?> |
newJaxrsClientCallback(javax.ws.rs.client.InvocationCallback<Object> asyncCallback,
Message outMessage,
Class<?> responseClass,
Type outGenericType) |
protected static void |
reportInvalidResourceMethod(Method m,
String name) |
protected Object |
retryInvoke(URI newRequestURI,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
Object body,
Exchange exchange,
Map<String,Object> invContext) |
protected javax.ws.rs.core.MultivaluedMap<String,String> |
setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> headers,
OperationResourceInfo ori,
boolean formParams,
Class<?> bodyClass,
Class<?> responseClass) |
accept, accept, acceptEncoding, acceptLanguage, addMatrixQueryParamsToBuilder, authorization, calculateNewRequestURI, checkClientException, checkClosed, checkIfBodyEmpty, close, completeExchange, convertParamValue, convertParamValue, convertToWebApplicationException, cookie, createExchange, createMessage, doRunInterceptorChain, encoding, findCallbackType, getBaseURI, getCallbackClass, getCallbackType, getConfiguration, getContentsList, getCurrentBuilder, getCurrentURI, getHeaders, getRequestContext, getResponse, getState, getTemplateParametersMap, header, headers, language, match, modified, parseQuotedHeaderValue, prepareConduitSelector, preProcessResult, query, readBody, removeAllHeaders, reportMessageHandlerProblem, reset, resetBaseAddress, resetCurrentBuilder, resetResponse, resetResponseStateImmediatelyIfNeeded, responseStreamCanBeClosed, retryInvoke, setAsyncMessageObserverIfNeeded, setConfiguration, setContexts, setEmptyRequestPropertyIfNeeded, setPlainOperationNameProperty, setResponseBuilder, setSupportOnewayResponseProperty, setupInFaultObserver, setupInInterceptorChain, setupOutInterceptorChain, type, type, waitForResponseCode, writeBody
protected static final Logger LOG
protected static final ResourceBundle BUNDLE
protected static final String SLASH
protected static final String BUFFER_PROXY_RESPONSE
protected static final String PROXY_METHOD_PARAM_BODY_INDEX
protected ClassResourceInfo cri
protected ClassLoader proxyLoader
protected boolean inheritHeaders
protected boolean isRoot
protected ClientProxyImpl.BodyWriter bodyWriter
protected Client proxy
public ClientProxyImpl(URI baseURI, ClassLoader loader, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues)
public ClientProxyImpl(URI baseURI, ClassLoader loader, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Map<String,Object> properties, Object... varValues)
public ClientProxyImpl(ClientState initialState, ClassLoader loader, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues)
public Object invoke(Object o, Method m, Object[] params) throws Throwable
invoke
in interface InvocationHandler
Throwable
protected void addNonEmptyPath(javax.ws.rs.core.UriBuilder builder, String pathValue)
protected javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> getParametersInfo(Method m, Object[] params, OperationResourceInfo ori)
protected static int getBodyIndex(javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map, OperationResourceInfo ori)
protected void checkResponse(Method m, javax.ws.rs.core.Response r, Message inMessage) throws Throwable
Throwable
protected static ResponseExceptionMapper<?> findExceptionMapper(Message message, Class<?> exType)
protected javax.ws.rs.core.MultivaluedMap<String,String> setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> headers, OperationResourceInfo ori, boolean formParams, Class<?> bodyClass, Class<?> responseClass)
protected List<javax.ws.rs.core.MediaType> getAccept(javax.ws.rs.core.MultivaluedMap<String,String> allHeaders)
protected List<Object> getPathParamValues(Method m, Object[] params, javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map, List<Parameter> beanParams, OperationResourceInfo ori, int bodyIndex)
protected static Annotation[] getParamAnnotations(Method m, Parameter p)
protected static List<Parameter> getParameters(javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map, ParameterType key)
protected void handleQueries(Method m, Object[] params, javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map, List<Parameter> beanParams, javax.ws.rs.core.UriBuilder ub)
protected Map<String,ClientProxyImpl.BeanPair> getValuesFromBeanParam(Object bean, Class<? extends Annotation> annClass)
protected Map<String,ClientProxyImpl.BeanPair> getValuesFromBeanParam(Object bean, Class<? extends Annotation> annClass, Map<String,ClientProxyImpl.BeanPair> values)
protected boolean getValuesFromBeanParamField(Object bean, Field f, Class<? extends Annotation> annClass, Map<String,ClientProxyImpl.BeanPair> values)
protected void handleMatrixes(Method m, Object[] params, javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map, List<Parameter> beanParams, javax.ws.rs.core.UriBuilder ub)
protected javax.ws.rs.core.MultivaluedMap<String,String> handleForm(Method m, Object[] params, javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map, List<Parameter> beanParams)
protected void addFormValue(javax.ws.rs.core.MultivaluedMap<String,String> form, String name, Object pValue, Annotation[] anns)
protected List<Attachment> handleMultipart(javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map, OperationResourceInfo ori, Object[] params)
protected void handleHeaders(Method m, Object[] params, javax.ws.rs.core.MultivaluedMap<String,String> headers, List<Parameter> beanParams, javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map)
protected static Multipart getMultipart(OperationResourceInfo ori, int index)
protected void handleCookies(Method m, Object[] params, javax.ws.rs.core.MultivaluedMap<String,String> headers, List<Parameter> beanParams, javax.ws.rs.core.MultivaluedMap<ParameterType,Parameter> map)
protected Message createMessage(Object body, OperationResourceInfo ori, javax.ws.rs.core.MultivaluedMap<String,String> headers, URI currentURI, Exchange exchange, Map<String,Object> invocationContext, boolean isProxy)
protected Object doChainedInvocation(URI uri, javax.ws.rs.core.MultivaluedMap<String,String> headers, OperationResourceInfo ori, Object[] methodParams, Object body, int bodyIndex, Exchange exchange, Map<String,Object> invocationContext) throws Throwable
Throwable
protected javax.ws.rs.client.InvocationCallback<Object> checkAsyncCallback(OperationResourceInfo ori, Map<String,Object> reqContext, Message outMessage)
protected javax.ws.rs.client.InvocationCallback<Object> doCheckAsyncCallback(OperationResourceInfo ori, javax.ws.rs.client.InvocationCallback<Object> callback)
protected Object doInvokeAsync(OperationResourceInfo ori, Message outMessage, javax.ws.rs.client.InvocationCallback<Object> asyncCallback)
protected JaxrsClientCallback<?> newJaxrsClientCallback(javax.ws.rs.client.InvocationCallback<Object> asyncCallback, Message outMessage, Class<?> responseClass, Type outGenericType)
protected Object retryInvoke(URI newRequestURI, javax.ws.rs.core.MultivaluedMap<String,String> headers, Object body, Exchange exchange, Map<String,Object> invContext) throws Throwable
retryInvoke
in class AbstractClient
Throwable
protected Object handleResponse(Message outMessage, Class<?> serviceCls) throws Throwable
Throwable
protected Type getGenericReturnType(Class<?> serviceCls, Method method, Class<?> returnType)
public Object getInvocationHandler()
getInvocationHandler
in interface InvocationHandlerAware
protected static void reportInvalidResourceMethod(Method m, String name)
protected static Annotation[] getMethodAnnotations(Method aMethod, int bodyIndex)
Apache CXF