Exemplo n.º 1
0
  public HttpClientInvoker provide(
      final ShopType shopType,
      final String url,
      final String refer,
      final String ip,
      final String userAgent) {
    final HttpClientHolder httpClient = new PoolingHttpClientHolder(ip, userAgent, refer);

    final HttpClientInvoker invoker = new HttpClientInvoker();
    invoker.setProvider(this);
    invoker.setHttpClient(httpClient);
    invoker.setShopType(shopType);
    invoker.setUrl(url);
    invoker.setRefer(refer);
    invoker.setIp(ip);
    invoker.setUserAgent(userAgent);
    invoker.setCookieStoreProvider(this.cookieStoreProvider);

    return invoker;
  }
Exemplo n.º 2
0
 /**
  *
  *
  * <pre>
  * 做流控规则限制
  * </pre>
  *
  * @param invoker
  */
 public void disable(HttpClientInvoker invoker) {
   // 目前仅禁用ip
   this.ipPools.disableIp(invoker.getShopType(), invoker.getIp());
 }
Exemplo n.º 3
0
 public HttpClientInvoker provide(final String url, final HttpClientInvoker refer) {
   return this.provide(
       refer.getShopType(), url, refer.getUrl(), refer.getIp(), refer.getUserAgent());
 }