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
- Direct Known Subclasses:
MicroProfileClientProxyImpl
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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClientProxyImpl.BodyWriterprotected static final Stringprotected static final ResourceBundleprotected 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, 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(ClientState initialState, ClassLoader loader, 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(OperationResourceInfo ori, Map<String, Object> reqContext, Message outMessage) protected voidcheckResponse(Method m, jakarta.ws.rs.core.Response r, Message inMessage) protected MessagecreateMessage(Object body, OperationResourceInfo ori, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, URI currentURI, Exchange exchange, Map<String, Object> invocationContext, boolean isProxy) protected ObjectdoChainedInvocation(URI uri, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, OperationResourceInfo ori, Object[] methodParams, Object body, int bodyIndex, Exchange exchange, Map<String, Object> invocationContext) protected jakarta.ws.rs.client.InvocationCallback<Object>doCheckAsyncCallback(OperationResourceInfo ori, jakarta.ws.rs.client.InvocationCallback<Object> callback) protected ObjectdoInvokeAsync(OperationResourceInfo ori, Message outMessage, jakarta.ws.rs.client.InvocationCallback<Object> asyncCallback) protected static ResponseExceptionMapper<?>findExceptionMapper(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<ParameterType, Parameter> map, OperationResourceInfo ori) protected TypegetGenericReturnType(Class<?> serviceCls, Method method, Class<?> returnType) protected static Annotation[]getMethodAnnotations(Method aMethod, int bodyIndex) protected static MultipartgetMultipart(OperationResourceInfo ori, int index) protected static Annotation[]getParameters(jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, ParameterType key) protected jakarta.ws.rs.core.MultivaluedMap<ParameterType,Parameter> getParametersInfo(Method m, Object[] params, OperationResourceInfo ori) getPathParamValues(Method m, Object[] params, jakarta.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 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<Parameter> beanParams, jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map) handleForm(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, List<Parameter> beanParams) protected voidhandleHeaders(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, List<Parameter> beanParams, jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map) protected voidhandleMatrixes(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, List<Parameter> beanParams, jakarta.ws.rs.core.UriBuilder ub) protected List<Attachment>handleMultipart(jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, OperationResourceInfo ori, Object[] params) protected voidhandleQueries(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, List<Parameter> beanParams, jakarta.ws.rs.core.UriBuilder ub) protected ObjecthandleResponse(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 booleanprotected JaxrsClientCallback<?>newJaxrsClientCallback(jakarta.ws.rs.client.InvocationCallback<Object> asyncCallback, 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, Exchange exchange, Map<String, Object> invContext) setRequestHeaders(jakarta.ws.rs.core.MultivaluedMap<String, String> headers, 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, 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
-
Field Details
-
LOG
-
BUNDLE
-
SLASH
- See Also:
-
BUFFER_PROXY_RESPONSE
- See Also:
-
PROXY_METHOD_PARAM_BODY_INDEX
- See Also:
-
cri
-
proxyLoader
-
inheritHeaders
protected boolean inheritHeaders -
isRoot
protected boolean isRoot -
valuesMap
-
bodyWriter
-
proxy
-
-
Constructor Details
-
ClientProxyImpl
public ClientProxyImpl(URI baseURI, ClassLoader loader, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues) -
ClientProxyImpl
public ClientProxyImpl(URI baseURI, ClassLoader loader, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Map<String, Object> properties, Object... varValues) -
ClientProxyImpl
public ClientProxyImpl(ClientState initialState, ClassLoader loader, 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
protected jakarta.ws.rs.core.MultivaluedMap<ParameterType,Parameter> getParametersInfo(Method m, Object[] params, OperationResourceInfo ori) -
isIgnorableParameter
-
getBodyIndex
protected static int getBodyIndex(jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, OperationResourceInfo ori) -
getBeanGetter
-
checkResponse
protected void checkResponse(Method m, jakarta.ws.rs.core.Response r, Message inMessage) throws Throwable - Throws:
Throwable
-
findExceptionMapper
-
setRequestHeaders
-
getAccept
-
getPathParamValues
protected List<Object> getPathParamValues(Method m, Object[] params, jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, List<Parameter> beanParams, OperationResourceInfo ori, int bodyIndex) -
getParamAnnotations
-
getParameters
protected static List<Parameter> getParameters(jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, 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
protected List<Attachment> handleMultipart(jakarta.ws.rs.core.MultivaluedMap<ParameterType, Parameter> map, OperationResourceInfo ori, Object[] params) -
handleHeaders
-
getMultipart
-
handleCookies
-
createMessage
-
doChainedInvocation
protected Object doChainedInvocation(URI uri, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, OperationResourceInfo ori, Object[] methodParams, Object body, int bodyIndex, Exchange exchange, Map<String, throws ThrowableObject> invocationContext) - Throws:
Throwable
-
checkAsyncCallback
-
doCheckAsyncCallback
protected jakarta.ws.rs.client.InvocationCallback<Object> doCheckAsyncCallback(OperationResourceInfo ori, jakarta.ws.rs.client.InvocationCallback<Object> callback) -
doInvokeAsync
protected Object doInvokeAsync(OperationResourceInfo ori, Message outMessage, jakarta.ws.rs.client.InvocationCallback<Object> asyncCallback) -
newJaxrsClientCallback
protected JaxrsClientCallback<?> newJaxrsClientCallback(jakarta.ws.rs.client.InvocationCallback<Object> asyncCallback, Message outMessage, Class<?> responseClass, Type outGenericType) -
retryInvoke
protected Object retryInvoke(URI newRequestURI, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, Object body, Exchange exchange, Map<String, throws ThrowableObject> invContext) - Specified by:
retryInvokein classAbstractClient- Throws:
Throwable
-
handleResponse
- Throws:
Throwable
-
getGenericReturnType
-
getReturnType
-
getInvocationHandler
- Specified by:
getInvocationHandlerin interfaceInvocationHandlerAware
-
reportInvalidResourceMethod
-
getMethodAnnotations
-