本文整理了Java中org.apache.cxf.jaxrs.client.WebClient.getClientState()
方法的一些代码示例,展示了WebClient.getClientState()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.getClientState()
方法的具体详情如下:
包路径:org.apache.cxf.jaxrs.client.WebClient
类名称:WebClient
方法名:getClientState
暂无
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
/**
* Creates WebClient, baseURI will be set to Client currentURI
* @param client existing client
* @param inheritHeaders if existing Client headers can be inherited by new client
*/
public static WebClient fromClient(Client client, boolean inheritHeaders) {
WebClient webClient = null;
ClientState clientState = getClientState(client);
if (clientState == null) {
webClient = create(client.getCurrentURI());
if (inheritHeaders) {
webClient.headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
webClient = new WebClient(clientState.newState(client.getCurrentURI(), headers, null));
}
copyProperties(webClient, client);
return webClient;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-rs-client
/**
* Creates WebClient, baseURI will be set to Client currentURI
* @param client existing client
* @param inheritHeaders if existing Client headers can be inherited by new client
*/
public static WebClient fromClient(Client client, boolean inheritHeaders) {
WebClient webClient = null;
ClientState clientState = getClientState(client);
if (clientState == null) {
webClient = create(client.getCurrentURI());
if (inheritHeaders) {
webClient.headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
webClient = new WebClient(clientState.newState(client.getCurrentURI(), headers, null));
}
copyProperties(webClient, client);
return webClient;
}
代码示例来源:origin: apache/cxf
/**
* Creates WebClient, baseURI will be set to Client currentURI
* @param client existing client
* @param inheritHeaders if existing Client headers can be inherited by new client
*/
public static WebClient fromClient(Client client, boolean inheritHeaders) {
WebClient webClient = null;
ClientState clientState = getClientState(client);
if (clientState == null) {
webClient = create(client.getCurrentURI());
if (inheritHeaders) {
webClient.headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
webClient = new WebClient(clientState.newState(client.getCurrentURI(), headers, null));
}
copyProperties(webClient, client);
return webClient;
}
代码示例来源:origin: apache/cxf
/**
* Creates a proxy, baseURI will be set to Client currentURI
* @param client Client instance
* @param cls proxy class, if not interface then a CGLIB proxy will be created
* @param inheritHeaders if true then existing Client headers will be inherited by new proxy
* and subresource proxies if any
* @return typed proxy
*/
public static <T> T fromClient(Client client, Class<T> cls, boolean inheritHeaders) {
JAXRSClientFactoryBean bean = getBean(client.getCurrentURI().toString(), cls, null);
bean.setInheritHeaders(inheritHeaders);
ClientState clientState = WebClient.getClientState(client);
T proxy = null;
if (clientState == null) {
proxy = bean.create(cls);
if (inheritHeaders) {
WebClient.client(proxy).headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
bean.setInitialState(clientState.newState(client.getCurrentURI(), headers, null));
proxy = bean.create(cls);
}
WebClient.copyProperties(WebClient.client(proxy), client);
return proxy;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-rs-client
/**
* Creates a proxy, baseURI will be set to Client currentURI
* @param client Client instance
* @param cls proxy class, if not interface then a CGLIB proxy will be created
* @param inheritHeaders if true then existing Client headers will be inherited by new proxy
* and subresource proxies if any
* @return typed proxy
*/
public static <T> T fromClient(Client client, Class<T> cls, boolean inheritHeaders) {
JAXRSClientFactoryBean bean = getBean(client.getCurrentURI().toString(), cls, null);
bean.setInheritHeaders(inheritHeaders);
ClientState clientState = WebClient.getClientState(client);
T proxy = null;
if (clientState == null) {
proxy = bean.create(cls);
if (inheritHeaders) {
WebClient.client(proxy).headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
bean.setInitialState(clientState.newState(client.getCurrentURI(), headers, null));
proxy = bean.create(cls);
}
WebClient.copyProperties(WebClient.client(proxy), client);
return proxy;
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
/**
* Creates a proxy, baseURI will be set to Client currentURI
* @param client Client instance
* @param cls proxy class, if not interface then a CGLIB proxy will be created
* @param inheritHeaders if true then existing Client headers will be inherited by new proxy
* and subresource proxies if any
* @return typed proxy
*/
public static <T> T fromClient(Client client, Class<T> cls, boolean inheritHeaders) {
JAXRSClientFactoryBean bean = getBean(client.getCurrentURI().toString(), cls, null);
bean.setInheritHeaders(inheritHeaders);
ClientState clientState = WebClient.getClientState(client);
T proxy = null;
if (clientState == null) {
proxy = bean.create(cls);
if (inheritHeaders) {
WebClient.client(proxy).headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
bean.setInitialState(clientState.newState(client.getCurrentURI(), headers, null));
proxy = bean.create(cls);
}
WebClient.copyProperties(WebClient.client(proxy), client);
return proxy;
}
内容来源于网络,如有侵权,请联系作者删除!