Apache CXF API

org.apache.cxf.jaxrs.client
Class ClientProxyImpl

java.lang.Object
  extended by org.apache.cxf.jaxrs.client.AbstractClient
      extended by org.apache.cxf.jaxrs.client.ClientProxyImpl
All Implemented Interfaces:
InvocationHandler, Client, InvocationHandlerAware

public class ClientProxyImpl
extends AbstractClient
implements InvocationHandlerAware, InvocationHandler

Proxy-based client implementation


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.cxf.jaxrs.client.AbstractClient
AbstractClient.AbstractBodyWriter
 
Field Summary
 
Fields inherited from class org.apache.cxf.jaxrs.client.AbstractClient
cfg, HTTP_SCHEME, KEEP_CONDUIT_ALIVE, REQUEST_CONTEXT, RESPONSE_CONTEXT
 
Constructor Summary
ClientProxyImpl(ClientState initialState, ClassLoader loader, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues)
           
ClientProxyImpl(URI baseURI, ClassLoader loader, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues)
           
 
Method Summary
 Object getInvocationHandler()
           
protected static Annotation[] getMethodAnnotations(Method aMethod, int bodyIndex)
           
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 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)
           
 
Methods inherited from class org.apache.cxf.jaxrs.client.AbstractClient
accept, accept, acceptEncoding, acceptLanguage, addMatrixQueryParamsToBuilder, calculateNewRequestURI, checkClientException, checkIfBodyEmpty, close, completeExchange, convertParamValue, convertToWebApplicationException, cookie, createExchange, createMessage, doRunInterceptorChain, encoding, getBaseURI, getConfiguration, getContentsList, getCurrentBuilder, getCurrentURI, getHeaders, getRequestContext, getResponse, getState, getTemplateParametersMap, header, headers, language, match, modified, parseQuotedHeaderValue, prepareConduitSelector, preProcessResult, query, readBody, reportMessageHandlerProblem, reset, resetBaseAddress, resetCurrentBuilder, resetResponse, responseStreamCanBeClosed, retryInvoke, setAllHeaders, setConfiguration, setContexts, setEmptyRequestPropertyIfNeeded, setPlainOperationNameProperty, setResponseBuilder, setupInFaultObserver, setupInInterceptorChain, setupOutInterceptorChain, type, type, waitForResponseCode, writeBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientProxyImpl

public ClientProxyImpl(URI baseURI,
                       ClassLoader loader,
                       ClassResourceInfo cri,
                       boolean isRoot,
                       boolean inheritHeaders,
                       Object... varValues)

ClientProxyImpl

public ClientProxyImpl(ClientState initialState,
                       ClassLoader loader,
                       ClassResourceInfo cri,
                       boolean isRoot,
                       boolean inheritHeaders,
                       Object... varValues)
Method Detail

invoke

public Object invoke(Object o,
                     Method m,
                     Object[] params)
              throws Throwable
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:
invoke in interface InvocationHandler
Throws:
Throwable

retryInvoke

protected Object retryInvoke(URI newRequestURI,
                             javax.ws.rs.core.MultivaluedMap<String,String> headers,
                             Object body,
                             Exchange exchange,
                             Map<String,Object> invContext)
                      throws Throwable
Specified by:
retryInvoke in class AbstractClient
Throws:
Throwable

handleResponse

protected Object handleResponse(Message outMessage,
                                Class<?> serviceCls)
                         throws Throwable
Throws:
Throwable

getInvocationHandler

public Object getInvocationHandler()
Specified by:
getInvocationHandler in interface InvocationHandlerAware

reportInvalidResourceMethod

protected static void reportInvalidResourceMethod(Method m,
                                                  String name)

getMethodAnnotations

protected static Annotation[] getMethodAnnotations(Method aMethod,
                                                   int bodyIndex)

Apache CXF API

Apache CXF