Package org.apache.cxf.jaxrs.client
Class ClientProxyImpl
java.lang.Object
org.apache.cxf.jaxrs.client.AbstractClient
org.apache.cxf.jaxrs.client.ClientProxyImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,InvocationHandler,Client,InvocationHandlerAware
public class ClientProxyImpl
extends AbstractClient
implements InvocationHandlerAware, InvocationHandler, Closeable
Proxy-based client implementation
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classNested classes/interfaces inherited from class org.apache.cxf.jaxrs.client.AbstractClient
AbstractClient.AbstractBodyWriter, AbstractClient.AbstractClientAsyncResponseInterceptor, AbstractClient.ConfigurationReference -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClientProxyImpl.BodyWriterprotected static final Stringprotected static final ResourceBundleprotected org.apache.cxf.jaxrs.model.ClassResourceInfoprotected booleanprotected booleanprotected static final Loggerprotected Clientprotected static final Stringprotected ClassLoaderprotected static final StringFields inherited from class org.apache.cxf.jaxrs.client.AbstractClient
cfg, EXECUTOR_SERVICE_PROPERTY, HTTP_SCHEME, KEEP_CONDUIT_ALIVE, REQUEST_CONTEXT, RESPONSE_CONTEXT -
Constructor Summary
ConstructorsConstructorDescriptionClientProxyImpl(URI baseURI, ClassLoader loader, org.apache.cxf.jaxrs.model.ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues) ClientProxyImpl(URI baseURI, ClassLoader loader, org.apache.cxf.jaxrs.model.ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Map<String, Object> properties, Object... varValues) ClientProxyImpl(ClientState initialState, ClassLoader loader, org.apache.cxf.jaxrs.model.ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFormValue(jakarta.ws.rs.core.MultivaluedMap<String, String> form, String name, Object pValue, Annotation[] anns) protected voidaddNonEmptyPath(jakarta.ws.rs.core.UriBuilder builder, String pathValue) protected jakarta.ws.rs.client.InvocationCallback<Object>checkAsyncCallback(org.apache.cxf.jaxrs.model.OperationResourceInfo ori, Map<String, Object> reqContext, org.apache.cxf.message.Message outMessage) protected voidcheckResponse(Method m, jakarta.ws.rs.core.Response r, org.apache.cxf.message.Message inMessage) protected org.apache.cxf.message.MessagecreateMessage(Object body, org.apache.cxf.jaxrs.model.OperationResourceInfo ori, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, URI currentURI, org.apache.cxf.message.Exchange exchange, Map<String, Object> invocationContext, boolean isProxy) protected ObjectdoChainedInvocation(URI uri, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, org.apache.cxf.jaxrs.model.OperationResourceInfo ori, Object[] methodParams, Object body, int bodyIndex, org.apache.cxf.message.Exchange exchange, Map<String, Object> invocationContext) protected jakarta.ws.rs.client.InvocationCallback<Object>doCheckAsyncCallback(org.apache.cxf.jaxrs.model.OperationResourceInfo ori, jakarta.ws.rs.client.InvocationCallback<Object> callback) protected ObjectdoInvokeAsync(org.apache.cxf.jaxrs.model.OperationResourceInfo ori, org.apache.cxf.message.Message outMessage, jakarta.ws.rs.client.InvocationCallback<Object> asyncCallback) protected static ResponseExceptionMapper<?>findExceptionMapper(org.apache.cxf.message.Message message, Class<?> exType) protected List<jakarta.ws.rs.core.MediaType>getBeanGetter(Class<?> clazz, String property, Class<?>... parameterTypes) protected static intgetBodyIndex(jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, org.apache.cxf.jaxrs.model.OperationResourceInfo ori) protected TypegetGenericReturnType(Class<?> serviceCls, Method method, Class<?> returnType) protected static Annotation[]getMethodAnnotations(Method aMethod, int bodyIndex) protected static org.apache.cxf.jaxrs.ext.multipart.MultipartgetMultipart(org.apache.cxf.jaxrs.model.OperationResourceInfo ori, int index) protected static Annotation[]getParamAnnotations(Method m, org.apache.cxf.jaxrs.model.Parameter p) protected static List<org.apache.cxf.jaxrs.model.Parameter>getParameters(jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, org.apache.cxf.jaxrs.model.ParameterType key) protected jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType,org.apache.cxf.jaxrs.model.Parameter> getParametersInfo(Method m, Object[] params, org.apache.cxf.jaxrs.model.OperationResourceInfo ori) getPathParamValues(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, List<org.apache.cxf.jaxrs.model.Parameter> beanParams, org.apache.cxf.jaxrs.model.OperationResourceInfo ori, int bodyIndex) protected Class<?>getReturnType(Method method, org.apache.cxf.message.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 booleangetValuesFromBeanParamField(Object bean, Field f, Class<? extends Annotation> annClass, Map<String, ClientProxyImpl.BeanPair> values) protected voidhandleCookies(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, List<org.apache.cxf.jaxrs.model.Parameter> beanParams, jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map) handleForm(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, List<org.apache.cxf.jaxrs.model.Parameter> beanParams) protected voidhandleHeaders(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, List<org.apache.cxf.jaxrs.model.Parameter> beanParams, jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map) protected voidhandleMatrixes(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, List<org.apache.cxf.jaxrs.model.Parameter> beanParams, jakarta.ws.rs.core.UriBuilder ub) protected List<org.apache.cxf.jaxrs.ext.multipart.Attachment>handleMultipart(jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, org.apache.cxf.jaxrs.model.OperationResourceInfo ori, Object[] params) protected voidhandleQueries(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, List<org.apache.cxf.jaxrs.model.Parameter> beanParams, jakarta.ws.rs.core.UriBuilder ub) protected ObjecthandleResponse(org.apache.cxf.message.Message outMessage, Class<?> serviceCls) 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 booleanisIgnorableParameter(Method m, org.apache.cxf.jaxrs.model.Parameter p) protected JaxrsClientCallback<?>newJaxrsClientCallback(jakarta.ws.rs.client.InvocationCallback<Object> asyncCallback, org.apache.cxf.message.Message outMessage, Class<?> responseClass, Type outGenericType) protected static voidreportInvalidResourceMethod(Method m, String name) protected ObjectretryInvoke(URI newRequestURI, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, Object body, org.apache.cxf.message.Exchange exchange, Map<String, Object> invContext) setRequestHeaders(jakarta.ws.rs.core.MultivaluedMap<String, String> headers, org.apache.cxf.jaxrs.model.OperationResourceInfo ori, boolean formParams, Class<?> bodyClass, Class<?> responseClass) Methods inherited from class org.apache.cxf.jaxrs.client.AbstractClient
accept, accept, acceptEncoding, acceptLanguage, addMatrixQueryParamsToBuilder, authorization, calculateNewRequestURI, checkClientException, checkClosed, checkIfBodyEmpty, close, completeExchange, convertParamValue, convertParamValue, convertToWebApplicationException, cookie, createExchange, createMessage, doRunInterceptorChain, encoding, finalize, findCallbackType, getBaseURI, getCallbackClass, getCallbackType, getConfiguration, getConfigurationReference, 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, setConfigurationReference, setContexts, setEmptyRequestPropertyIfNeeded, setPlainOperationNameProperty, setResponseBuilder, setSupportOnewayResponseProperty, setupInFaultObserver, setupInInterceptorChain, setupOutInterceptorChain, type, type, waitForResponseCode, writeBody
-
Field Details
-
LOG
-
BUNDLE
-
SLASH
- See Also:
-
BUFFER_PROXY_RESPONSE
- See Also:
-
PROXY_METHOD_PARAM_BODY_INDEX
- See Also:
-
cri
protected org.apache.cxf.jaxrs.model.ClassResourceInfo cri -
proxyLoader
-
inheritHeaders
protected boolean inheritHeaders -
isRoot
protected boolean isRoot -
valuesMap
-
bodyWriter
-
proxy
-
-
Constructor Details
-
ClientProxyImpl
public ClientProxyImpl(URI baseURI, ClassLoader loader, org.apache.cxf.jaxrs.model.ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues) -
ClientProxyImpl
-
ClientProxyImpl
public ClientProxyImpl(ClientState initialState, ClassLoader loader, org.apache.cxf.jaxrs.model.ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues)
-
-
Method Details
-
invoke
Updates the current state if Client method is invoked, otherwise does the remote invocation or returns a new proxy if subresource method is invoked. Can throw an expected exception if ResponseExceptionMapper is registered- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
addNonEmptyPath
-
getParametersInfo
-
isIgnorableParameter
-
getBodyIndex
protected static int getBodyIndex(jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, org.apache.cxf.jaxrs.model.OperationResourceInfo ori) -
getBeanGetter
-
checkResponse
protected void checkResponse(Method m, jakarta.ws.rs.core.Response r, org.apache.cxf.message.Message inMessage) throws Throwable - Throws:
Throwable
-
findExceptionMapper
protected static ResponseExceptionMapper<?> findExceptionMapper(org.apache.cxf.message.Message message, Class<?> exType) -
setRequestHeaders
-
getAccept
-
getPathParamValues
protected List<Object> getPathParamValues(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, List<org.apache.cxf.jaxrs.model.Parameter> beanParams, org.apache.cxf.jaxrs.model.OperationResourceInfo ori, int bodyIndex) -
getParamAnnotations
-
getParameters
protected static List<org.apache.cxf.jaxrs.model.Parameter> getParameters(jakarta.ws.rs.core.MultivaluedMap<org.apache.cxf.jaxrs.model.ParameterType, org.apache.cxf.jaxrs.model.Parameter> map, org.apache.cxf.jaxrs.model.ParameterType key) -
handleQueries
-
getValuesFromBeanParam
protected Map<String,ClientProxyImpl.BeanPair> getValuesFromBeanParam(Object bean, Class<? extends Annotation> annClass) -
getValuesFromBeanParam
protected Map<String,ClientProxyImpl.BeanPair> getValuesFromBeanParam(Object bean, Class<? extends Annotation> annClass, Map<String, ClientProxyImpl.BeanPair> values) -
getValuesFromBeanParamField
protected boolean getValuesFromBeanParamField(Object bean, Field f, Class<? extends Annotation> annClass, Map<String, ClientProxyImpl.BeanPair> values) -
handleMatrixes
-
handleForm
-
addFormValue
protected void addFormValue(jakarta.ws.rs.core.MultivaluedMap<String, String> form, String name, Object pValue, Annotation[] anns) -
handleMultipart
-
handleHeaders
-
getMultipart
protected static org.apache.cxf.jaxrs.ext.multipart.Multipart getMultipart(org.apache.cxf.jaxrs.model.OperationResourceInfo ori, int index) -
handleCookies
-
createMessage
-
doChainedInvocation
protected Object doChainedInvocation(URI uri, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, org.apache.cxf.jaxrs.model.OperationResourceInfo ori, Object[] methodParams, Object body, int bodyIndex, org.apache.cxf.message.Exchange exchange, Map<String, throws ThrowableObject> invocationContext) - Throws:
Throwable
-
checkAsyncCallback
-
doCheckAsyncCallback
-
doInvokeAsync
-
newJaxrsClientCallback
protected JaxrsClientCallback<?> newJaxrsClientCallback(jakarta.ws.rs.client.InvocationCallback<Object> asyncCallback, org.apache.cxf.message.Message outMessage, Class<?> responseClass, Type outGenericType) -
retryInvoke
protected Object retryInvoke(URI newRequestURI, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, Object body, org.apache.cxf.message.Exchange exchange, Map<String, throws ThrowableObject> invContext) - Specified by:
retryInvokein classAbstractClient- Throws:
Throwable
-
handleResponse
protected Object handleResponse(org.apache.cxf.message.Message outMessage, Class<?> serviceCls) throws Throwable - Throws:
Throwable
-
getGenericReturnType
-
getReturnType
-
getInvocationHandler
- Specified by:
getInvocationHandlerin interfaceInvocationHandlerAware
-
reportInvalidResourceMethod
-
getMethodAnnotations
-