當前位置: 首頁>>代碼示例>>Java>>正文


Java HttpResponse類代碼示例

本文整理匯總了Java中com.github.kristofa.brave.http.HttpResponse的典型用法代碼示例。如果您正苦於以下問題:Java HttpResponse類的具體用法?Java HttpResponse怎麽用?Java HttpResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HttpResponse類屬於com.github.kristofa.brave.http包,在下文中一共展示了HttpResponse類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import com.github.kristofa.brave.http.HttpResponse; //導入依賴的package包/類
@Override
public Response execute(Request request, Request.Options options) throws IOException {
    Map<String, Collection<String>> traceHeaders = new HashMap<>();
    traceHeaders.putAll(request.headers());
    Request wrappedRequest =
            Request.create(request.method(), request.url(), traceHeaders, request.body(), request.charset());
    HttpClientRequest httpClientRequest = new TraceableHttpClientRequest(wrappedRequest);
    ClientRequestAdapter adapter = new HttpClientRequestAdapter(httpClientRequest, new DefaultSpanNameProvider());
    requestInterceptor.handle(adapter);

    Response response = clientDelegate.execute(wrappedRequest, options);

    HttpResponse httpResponse = new TraceableHttpClientResponse(response);
    ClientResponseAdapter responseAdapter = new HttpClientResponseAdapter(httpResponse);
    responseInterceptor.handle(responseAdapter);
    return response;
}
 
開發者ID:wso2,項目名稱:msf4j,代碼行數:18,代碼來源:FeginZipkinTracingClient.java

示例2: postCall

import com.github.kristofa.brave.http.HttpResponse; //導入依賴的package包/類
/**
 * Intercepts the server response flow and extract response information
 * to be published to the Zipkin server for tracing.
 */
@Override
public void postCall(Request request, int status, ServiceMethodInfo serviceMethodInfo) throws Exception {
    HttpResponse httpResponse = new TraceableHttpServerResponse((Response) serviceMethodInfo
            .getAttribute(RESPONDER_ATTRIBUTE));
    HttpServerResponseAdapter adapter = new HttpServerResponseAdapter(httpResponse);
    respInterceptor.handle(adapter);
}
 
開發者ID:wso2,項目名稱:msf4j,代碼行數:12,代碼來源:MSF4JZipkinTracingInterceptor.java

示例3: filter

import com.github.kristofa.brave.http.HttpResponse; //導入依賴的package包/類
@Override
public void filter(ClientRequestContext clientRequestContext, ClientResponseContext clientResponseContext) throws IOException {
    final HttpResponse response = () -> clientResponseContext.getStatus();

    responseInterceptor.handle(new HttpClientResponseAdapter(response));
}
 
開發者ID:hawkular,項目名稱:hawkular-apm,代碼行數:7,代碼來源:HttpClientProducer.java


注:本文中的com.github.kristofa.brave.http.HttpResponse類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。