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


Java DefaultRequestDirector类代码示例

本文整理汇总了Java中org.apache.http.impl.client.DefaultRequestDirector的典型用法代码示例。如果您正苦于以下问题:Java DefaultRequestDirector类的具体用法?Java DefaultRequestDirector怎么用?Java DefaultRequestDirector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DefaultRequestDirector类属于org.apache.http.impl.client包,在下文中一共展示了DefaultRequestDirector类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRequestDirector

import org.apache.http.impl.client.DefaultRequestDirector; //导入依赖的package包/类
/** This method mainly exists to make the wrapper more testable. oh, apache's insanity. */
protected RequestDirector getRequestDirector(HttpRequestExecutor requestExec,
                                             ClientConnectionManager conman,
                                             ConnectionReuseStrategy reustrat,
                                             ConnectionKeepAliveStrategy kastrat,
                                             HttpRoutePlanner rouplan,
                                             HttpProcessor httpProcessor,
                                             HttpRequestRetryHandler retryHandler,
                                             RedirectHandler redirectHandler,
                                             AuthenticationHandler targetAuthHandler,
                                             AuthenticationHandler proxyAuthHandler,
                                             UserTokenHandler stateHandler,
                                             HttpParams params
) {
    return new DefaultRequestDirector(requestExec, conman, reustrat, kastrat, rouplan,
            httpProcessor, retryHandler, redirectHandler, targetAuthHandler, proxyAuthHandler,
            stateHandler, params);
}
 
开发者ID:triveous,项目名称:SoundcloudAPI,代码行数:19,代码来源:ApiWrapper.java

示例2: getRequestDirector

import org.apache.http.impl.client.DefaultRequestDirector; //导入依赖的package包/类
/** This method mainly exists to make the wrapper more testable. oh, apache's insanity. */
protected RequestDirector getRequestDirector(HttpRequestExecutor requestExec,
                                             ClientConnectionManager conman,
                                             ConnectionReuseStrategy reustrat,
                                             ConnectionKeepAliveStrategy kastrat,
                                             HttpRoutePlanner rouplan,
                                             HttpProcessor httpProcessor,
                                             HttpRequestRetryHandler retryHandler,
                                             RedirectHandler redirectHandler,
                                             AuthenticationHandler targetAuthHandler,
                                             AuthenticationHandler proxyAuthHandler,
                                             UserTokenHandler stateHandler,
                                             HttpParams params
) {
	return new DefaultRequestDirector(requestExec, conman, reustrat, kastrat, rouplan,
			httpProcessor, retryHandler, redirectHandler, targetAuthHandler, proxyAuthHandler,
			stateHandler, params);
}
 
开发者ID:EnteriseToolkit,项目名称:paperchains,代码行数:19,代码来源:ApiWrapper.java

示例3: __constructor__

import org.apache.http.impl.client.DefaultRequestDirector; //导入依赖的package包/类
public void __constructor__(
    HttpRequestExecutor requestExec,
    ClientConnectionManager conman,
    ConnectionReuseStrategy reustrat,
    ConnectionKeepAliveStrategy kastrat,
    HttpRoutePlanner rouplan,
    HttpProcessor httpProcessor,
    HttpRequestRetryHandler retryHandler,
    RedirectHandler redirectHandler,
    AuthenticationHandler targetAuthHandler,
    AuthenticationHandler proxyAuthHandler,
    UserTokenHandler userTokenHandler,
    HttpParams params) {
  __constructor__(
      LogFactory.getLog(DefaultRequestDirector.class),
      requestExec,
      conman,
      reustrat,
      kastrat,
      rouplan,
      httpProcessor,
      retryHandler,
      redirectHandler,
      targetAuthHandler,
      proxyAuthHandler,
      userTokenHandler,
      params);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:29,代码来源:ShadowDefaultRequestDirector.java

示例4: setUp_EnsureStaticStateIsReset

import org.apache.http.impl.client.DefaultRequestDirector; //导入依赖的package包/类
@Before
public void setUp_EnsureStaticStateIsReset() {
  FakeHttpLayer fakeHttpLayer = Robolectric.getFakeHttpLayer();
  assertFalse(fakeHttpLayer.hasPendingResponses());
  assertFalse(fakeHttpLayer.hasRequestInfos());
  assertFalse(fakeHttpLayer.hasResponseRules());
  assertNull(fakeHttpLayer.getDefaultResponse());

  connectionKeepAliveStrategy = new ConnectionKeepAliveStrategy() {
    @Override public long getKeepAliveDuration(HttpResponse httpResponse, HttpContext httpContext) {
      return 0;
    }
  };
  requestDirector = new DefaultRequestDirector(null, null, null, connectionKeepAliveStrategy, null, null, null, null, null, null, null, null);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:16,代码来源:DefaultRequestDirectorTest.java

示例5: shouldRecordExtendedRequestData

import org.apache.http.impl.client.DefaultRequestDirector; //导入依赖的package包/类
@Test
public void shouldRecordExtendedRequestData() throws Exception {
  Robolectric.addPendingHttpResponse(200, "a happy response body");
  HttpGet httpGet = new HttpGet("http://example.com");
  requestDirector.execute(null, httpGet, null);

  assertSame(Robolectric.getSentHttpRequestInfo(0).getHttpRequest(), httpGet);
  ConnectionKeepAliveStrategy strategy = shadowOf((DefaultRequestDirector) Robolectric.getSentHttpRequestInfo(0).getRequestDirector()).getConnectionKeepAliveStrategy();
  assertSame(strategy, connectionKeepAliveStrategy);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:11,代码来源:DefaultRequestDirectorTest.java

示例6: makeRequest

import org.apache.http.impl.client.DefaultRequestDirector; //导入依赖的package包/类
private void makeRequest(String uri) throws HttpException, IOException {
  Robolectric.addPendingHttpResponse(200, "a happy response body");

  ConnectionKeepAliveStrategy connectionKeepAliveStrategy = new ConnectionKeepAliveStrategy() {
    @Override
    public long getKeepAliveDuration(HttpResponse httpResponse, HttpContext httpContext) {
      return 0;
    }

  };
  DefaultRequestDirector requestDirector = new DefaultRequestDirector(null, null, null, connectionKeepAliveStrategy, null, null, null, null, null, null, null, null);

  requestDirector.execute(null, new HttpGet(uri), null);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:15,代码来源:RobolectricTest.java

示例7: shadowOf

import org.apache.http.impl.client.DefaultRequestDirector; //导入依赖的package包/类
public static ShadowDefaultRequestDirector shadowOf(DefaultRequestDirector instance) {
  return (ShadowDefaultRequestDirector) shadowOf_(instance);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:4,代码来源:Robolectric.java


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