本文整理汇总了Java中org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration.getServiceUrl方法的典型用法代码示例。如果您正苦于以下问题:Java HttpInvokerClientConfiguration.getServiceUrl方法的具体用法?Java HttpInvokerClientConfiguration.getServiceUrl怎么用?Java HttpInvokerClientConfiguration.getServiceUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration
的用法示例。
在下文中一共展示了HttpInvokerClientConfiguration.getServiceUrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doExecuteRequest
import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration; //导入方法依赖的package包/类
@Override
protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config, ByteArrayOutputStream baos) throws Exception {
HttpPost postMethod = new HttpPost(config.getServiceUrl());
ByteArrayEntity entity = new ByteArrayEntity(baos.toByteArray());
entity.setContentType(getContentType());
postMethod.setEntity(entity);
BasicHttpContext context = null;
if (environment.useSslContext()) {
context = new BasicHttpContext();
context.setAttribute(HttpClientContext.USER_TOKEN, goAgentServerHttpClient.principal());
}
try (CloseableHttpResponse response = goAgentServerHttpClient.execute(postMethod, context)) {
validateResponse(response);
InputStream responseBody = getResponseBody(response);
return readRemoteInvocationResult(responseBody, config.getCodebaseUrl());
}
}
示例2: createPostMethod
import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration; //导入方法依赖的package包/类
/**
* Create a PostMethod for the given configuration.
* <p>The default implementation creates a standard PostMethod with
* "application/x-java-serialized-object" as "Content-Type" header.
* @param config the HTTP invoker configuration that specifies the
* target service
* @return the PostMethod instance
* @throws IOException if thrown by I/O methods
*/
protected PostMethod createPostMethod(HttpInvokerClientConfiguration config) throws IOException {
PostMethod postMethod = new PostMethod(config.getServiceUrl());
LocaleContext locale = LocaleContextHolder.getLocaleContext();
if (locale != null) {
postMethod.addRequestHeader(HTTP_HEADER_ACCEPT_LANGUAGE, StringUtils.toLanguageTag(locale.getLocale()));
}
if (isAcceptGzipEncoding()) {
postMethod.addRequestHeader(HTTP_HEADER_ACCEPT_ENCODING, ENCODING_GZIP);
}
return postMethod;
}
示例3: currentServiceUrl
import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration; //导入方法依赖的package包/类
@Nullable
protected String currentServiceUrl(String url, HttpInvokerClientConfiguration config) {
return url == null ? null : url + "/" + config.getServiceUrl();
}
示例4: createPostMethod
import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration; //导入方法依赖的package包/类
/**
* Create a PostMethod for the given configuration.
* @param config the HTTP invoker configuration that specifies the
* target service
* @return the PostMethod instance
* @throws IOException if thrown by I/O methods
*/
protected PostMethod createPostMethod(HttpInvokerClientConfiguration config) throws IOException {
PostMethod postMethod = new PostMethod(config.getServiceUrl());
postMethod.setRequestHeader(HTTP_HEADER_CONTENT_TYPE, CONTENT_TYPE_SERIALIZED_OBJECT);
return postMethod;
}