当前位置: 首页>>代码示例>>Java>>正文


Java HttpInvokerClientConfiguration.getServiceUrl方法代码示例

本文整理汇总了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());
    }
}
 
开发者ID:gocd,项目名称:gocd,代码行数:22,代码来源:GoHttpClientHttpInvokerRequestExecutor.java

示例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;
}
 
开发者ID:payneteasy,项目名称:superfly,代码行数:21,代码来源:CommonsHttpInvokerRequestExecutor.java

示例3: currentServiceUrl

import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration; //导入方法依赖的package包/类
@Nullable
protected String currentServiceUrl(String url, HttpInvokerClientConfiguration config) {
    return url == null ? null :  url + "/" + config.getServiceUrl();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:ClusteredHttpInvokerRequestExecutor.java

示例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;
}
 
开发者ID:xingmima,项目名称:dubbos,代码行数:13,代码来源:CommonsHttpInvokerRequestExecutor.java


注:本文中的org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration.getServiceUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。