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, Retryable, Client, InvocationHandlerAware

public class ClientProxyImpl
extends AbstractClient
implements InvocationHandlerAware, InvocationHandler

Proxy-based client implementation


Field Summary
 
Fields inherited from class org.apache.cxf.jaxrs.client.AbstractClient
cfg, KEEP_CONDUIT_ALIVE, REQUEST_CONTEXT, RESPONSE_CONTEXT
 
Constructor Summary
ClientProxyImpl(ClientState initialState, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues)
           
ClientProxyImpl(URI baseURI, ClassResourceInfo cri, boolean isRoot, boolean inheritHeaders, Object... varValues)
           
 
Method Summary
 Object getInvocationHandler()
           
protected  Object handleResponse(Message outMessage)
           
 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, addParametersToBuilder, calculateNewRequestURI, checkClientException, completeExchange, cookie, createExchange, createMessage, encoding, getBaseURI, getConfiguration, getContentsList, getCurrentBuilder, getCurrentURI, getHeaders, getRequestContext, getResponse, getState, getTemplateParametersMap, header, headers, invoke, language, match, modified, parseQuotedHeaderValue, prepareConduitSelector, preProcessResult, readBody, reportMessageHandlerProblem, reset, resetBaseAddress, resetCurrentBuilder, resetResponse, setAllHeaders, setConfiguration, setContexts, setEmptyRequestProperty, setPlainOperationNameProperty, setResponseBuilder, setupInInterceptorChain, setupOutInterceptorChain, type, type, 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,
                       ClassResourceInfo cri,
                       boolean isRoot,
                       boolean inheritHeaders,
                       Object... varValues)

ClientProxyImpl

public ClientProxyImpl(ClientState initialState,
                       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)
                         throws Throwable
Throws:
Throwable

getInvocationHandler

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

reportInvalidResourceMethod

protected static void reportInvalidResourceMethod(Method m,
                                                  String name)

Apache CXF API

Apache CXF