public class JAXRSClientFactoryBean extends AbstractJAXRSFactoryBean
Modifier and Type | Field and Description |
---|---|
protected javax.ws.rs.core.MultivaluedMap<String,String> |
headers |
protected boolean |
inheritHeaders |
protected ClientState |
initialState |
protected static Logger |
LOG |
protected String |
password |
protected ClassLoader |
proxyLoader |
protected Class<?> |
serviceClass |
protected boolean |
threadSafe |
protected long |
timeToKeepState |
protected String |
username |
entityProviders, schemaLocations, serviceFactory
address, bindingConfig, bindingFactory, bindingId, bus, conduitSelector, dataBinding, destinationFactory, endpointName, endpointReference, features, properties, publishedEndpointUrl, serviceName, transportId
Constructor and Description |
---|
JAXRSClientFactoryBean() |
JAXRSClientFactoryBean(JAXRSServiceFactoryBean serviceFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyFeatures(AbstractClient client) |
Client |
create()
Create a Client instance.
|
<T> T |
create(Class<T> cls,
Object... varValues)
Creates a proxy.
|
protected ClientProxyImpl |
createClientProxy(ClassResourceInfo cri,
boolean isRoot,
ClientState actualState,
Object[] varValues) |
WebClient |
createWebClient()
Creates a WebClient instance
|
Client |
createWithValues(Object... varValues)
Create a Client instance.
|
protected ClientState |
getActualState() |
protected ConduitSelector |
getConduitSelector(Endpoint ep) |
protected <C extends javax.ws.rs.core.Configurable<C>> |
getConfigurableFor(C context) |
Map<String,List<String>> |
getHeaders()
Gets the initial headers
|
String |
getPassword()
Gets the password
|
Class<?> |
getServiceClass()
Returns the service class.
|
String |
getUsername()
Gets the user name
|
protected void |
initClient(AbstractClient client,
Endpoint ep,
boolean addHeaders) |
protected void |
notifyLifecycleManager(Object client) |
void |
setClassLoader(ClassLoader loader)
Sets the custom class loader to be used for creating proxies.
|
void |
setHeaders(Map<String,String> map)
Sets the headers new proxy or WebClient instances will be
initialized with.
|
void |
setInheritHeaders(boolean ih)
Indicates if the headers set by a current proxy will be inherited
when a subresource proxy is created
vice versa.
|
void |
setInitialState(ClientState initialState)
Sets the initial client state, can be a thread-safe state.
|
void |
setPassword(String password)
Sets the password.
|
void |
setResourceClass(Class<?> cls)
Sets the resource class
|
void |
setSecondsToKeepState(long time)
Sets the time a thread-local client state will be kept.
|
void |
setServiceClass(Class<?> cls)
Sets the service class, may be called from a Spring handler
|
void |
setThreadSafe(boolean threadSafe)
Indicates if a single proxy or WebClient instance can be reused
by multiple threads.
|
void |
setUsername(String username)
Sets the username.
|
checkResources, createBindingInfo, createEndpoint, createEndpointInfo, getBus, getProviders, getServiceFactory, isValidClassResourceInfo, setBus, setDataBindingProvider, setModelBeans, setModelBeans, setModelBeansWithServiceClass, setModelRef, setModelRefWithServiceClass, setProvider, setProviderComparator, setProviders, setSchemaLocation, setSchemaLocations, setServiceFactory, setServiceName, setupFactory
addToBeans, checkPrivateEndpoint, getAddress, getBindingConfig, getBindingFactory, getBindingId, getBus, getConduitSelector, getDataBinding, getDestinationFactory, getEndpointName, getFeatures, getProperties, getProperties, getPublishedEndpointUrl, getServiceName, getTransportId, initializeAnnotationInterceptors, initializeAnnotationInterceptors, initializeAnnotationInterceptors, setAddress, setBindingConfig, setBindingFactory, setBindingId, setConduitSelector, setDataBinding, setDestinationFactory, setEndpointName, setEndpointReference, setFeatures, setProperties, setPublishedEndpointUrl, setTransportId
getInFaultInterceptors, getInInterceptors, getOutFaultInterceptors, getOutInterceptors, setInFaultInterceptors, setInInterceptors, setOutFaultInterceptors, setOutInterceptors
protected static final Logger LOG
protected String username
protected String password
protected boolean inheritHeaders
protected ClientState initialState
protected boolean threadSafe
protected long timeToKeepState
protected Class<?> serviceClass
protected ClassLoader proxyLoader
public JAXRSClientFactoryBean()
public JAXRSClientFactoryBean(JAXRSServiceFactoryBean serviceFactory)
public void setClassLoader(ClassLoader loader)
loader
- public void setThreadSafe(boolean threadSafe)
threadSafe
- if true then multiple threads can invoke on
the same proxy or WebClient instance.public void setSecondsToKeepState(long time)
time
- secondsToKeepStatepublic String getUsername()
public void setUsername(String username)
username
- the user namepublic String getPassword()
public void setPassword(String password)
password
- the passwordpublic void setInheritHeaders(boolean ih)
ih
- if set to true then the current headers will be inheritedpublic void setResourceClass(Class<?> cls)
cls
- the resource classpublic void setServiceClass(Class<?> cls)
cls
- the service classpublic Class<?> getServiceClass()
public void setHeaders(Map<String,String> map)
map
- the headerspublic Map<String,List<String>> getHeaders()
public WebClient createWebClient()
protected void notifyLifecycleManager(Object client)
protected ClientState getActualState()
public <T> T create(Class<T> cls, Object... varValues)
cls
- the proxy classvarValues
- optional list of values which will be used to substitute
template variables specified in the class-level JAX-RS Path annotationspublic Client create()
public Client createWithValues(Object... varValues)
varValues
- optional list of values which will be used to substitute
template variables specified in the class-level JAX-RS Path annotationsprotected ClientProxyImpl createClientProxy(ClassResourceInfo cri, boolean isRoot, ClientState actualState, Object[] varValues)
protected ConduitSelector getConduitSelector(Endpoint ep)
protected void initClient(AbstractClient client, Endpoint ep, boolean addHeaders)
protected <C extends javax.ws.rs.core.Configurable<C>> javax.ws.rs.core.Configurable<?> getConfigurableFor(C context)
protected void applyFeatures(AbstractClient client)
public void setInitialState(ClientState initialState)
initialState
- the stateApache CXF