javax.ws.rs.client.Client.property()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中javax.ws.rs.client.Client.property()方法的一些代码示例,展示了Client.property()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Client.property()方法的具体详情如下:
包路径:javax.ws.rs.client.Client
类名称:Client
方法名:property

Client.property介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) {
  Client client = ClientBuilder.newClient();

  client.property(ClientProperties.CONNECT_TIMEOUT, 1000);
  client.property(ClientProperties.READ_TIMEOUT,    1000);

  WebTarget target = client.target("http://1.2.3.4:8080");

  try {
    String responseMsg = target.path("application.wadl").request().get(String.class);
    System.out.println("responseMsg: " + responseMsg);
  } catch (ProcessingException pe) {
    pe.printStackTrace();
  }
}

代码示例来源:origin: apache/usergrid

jerseyClient.property(ClientProperties.CONNECT_TIMEOUT, timeout);
jerseyClient.property(ClientProperties.READ_TIMEOUT, readTimeout);

代码示例来源:origin: jersey/jersey

client.property(ClientProperties.CONNECT_TIMEOUT, 2000)
    .register(new MoxyJsonFeature())
    .register(HttpAuthenticationFeature.basic(App.getTwitterUserName(), App.getTwitterUserPassword()))

代码示例来源:origin: eclipse-ee4j/glassfish

@Override
public Client property(String name, Object value) {
  realClient.property(name, value);
  return this;
}

代码示例来源:origin: ga4gh/dockstore

/**
 * Set the read timeout (in milliseconds).
 * A value of 0 means no timeout, otherwise values must be between 1 and
 * {@link Integer#MAX_VALUE}.
 * @param readTimeout Read timeout in milliseconds
 * @return API client
 */
public ApiClient setReadTimeout(int readTimeout) {
 this.readTimeout = readTimeout;
 httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
 return this;
}

代码示例来源:origin: iterate-ch/cyberduck

/**
 * Set the connect timeout (in milliseconds).
 * A value of 0 means no timeout, otherwise values must be between 1 and
 * {@link Integer#MAX_VALUE}.
 * @param connectionTimeout Connection timeout in milliseconds
 * @return API client
 */
public ApiClient setConnectTimeout(int connectionTimeout) {
 this.connectionTimeout = connectionTimeout;
 httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
 return this;
}

代码示例来源:origin: ga4gh/dockstore

/**
 * Set the connect timeout (in milliseconds).
 * A value of 0 means no timeout, otherwise values must be between 1 and
 * {@link Integer#MAX_VALUE}.
 * @param connectionTimeout Connection timeout in milliseconds
 * @return API client
 */
public ApiClient setConnectTimeout(int connectionTimeout) {
 this.connectionTimeout = connectionTimeout;
 httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
 return this;
}

代码示例来源:origin: com.yammer.tenacity/tenacity-core

@Override
public Client property(String name, Object value) {
  delegate.property(name, value);
  return this;
}

代码示例来源:origin: org.symphonyoss.symphony/symphony-authenticator-java-jersey2-client

/**
 * Set the connect timeout (in milliseconds).
 * A value of 0 means no timeout, otherwise values must be between 1 and
 * {@link Integer#MAX_VALUE}.
 * @param connectionTimeout Connection timeout in milliseconds
 * @return API client
 */
public ApiClient setConnectTimeout(int connectionTimeout) {
 this.connectionTimeout = connectionTimeout;
 httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
 return this;
}

代码示例来源:origin: yammer/tenacity

@Override
public Client property(String name, Object value) {
  delegate.property(name, value);
  return this;
}

代码示例来源:origin: ga4gh/dockstore

/**
 * Set the connect timeout (in milliseconds).
 * A value of 0 means no timeout, otherwise values must be between 1 and
 * {@link Integer#MAX_VALUE}.
 * @param connectionTimeout Connection timeout in milliseconds
 * @return API client
 */
public ApiClient setConnectTimeout(int connectionTimeout) {
 this.connectionTimeout = connectionTimeout;
 httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
 return this;
}

代码示例来源:origin: ga4gh/dockstore

/**
 * Set the connect timeout (in milliseconds).
 * A value of 0 means no timeout, otherwise values must be between 1 and
 * {@link Integer#MAX_VALUE}.
 * @param connectionTimeout Connection timeout in milliseconds
 * @return API client
 */
public ApiClient setConnectTimeout(int connectionTimeout) {
 this.connectionTimeout = connectionTimeout;
 httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout);
 return this;
}

代码示例来源:origin: ga4gh/dockstore

/**
 * Set the read timeout (in milliseconds).
 * A value of 0 means no timeout, otherwise values must be between 1 and
 * {@link Integer#MAX_VALUE}.
 * @param readTimeout Read timeout in milliseconds
 * @return API client
 */
public ApiClient setReadTimeout(int readTimeout) {
 this.readTimeout = readTimeout;
 httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout);
 return this;
}

代码示例来源:origin: net.oneandone.reactive/reactive-http

@Override
public RxClient property(String name, Object value) {
  return new RxClient(client.property(name, value));
}

代码示例来源:origin: oracle/oci-java-sdk

@Override
public void customizeClient(Client client) {
  super.customizeClient(client);
  client.property(ClientProperties.REQUEST_ENTITY_PROCESSING, null);
}

代码示例来源:origin: apache/cxf

protected WebTarget createWebTarget(final String url) {
  return ClientBuilder
    .newClient()
    .property("http.receive.timeout", 8000)
    .register(JacksonJsonProvider.class)
    .target("http://localhost:" + getPort() + url);
}

代码示例来源:origin: org.apache.cxf.systests/cxf-systests-rs-sse-base

protected WebTarget createWebTarget(final String url) {
  return ClientBuilder
    .newClient()
    .property("http.receive.timeout", 8000)
    .register(JacksonJsonProvider.class)
    .target("http://localhost:" + getPort() + url);
}

代码示例来源:origin: andreschaffer/microservices-testing-examples

private CreditScoreService createCreditScoreService(SpecialMembershipServiceConfiguration configuration, Environment environment) {
  WebTarget webTarget = new JerseyClientBuilder(environment)
      .using(environment.getObjectMapper().copy())
      .build(getName())
      .property(CONNECT_TIMEOUT, 1000)
      .property(READ_TIMEOUT, 2000)
      .target(configuration.getCreditScoreServiceUrl());
  return new CreditScoreService(webTarget);
}

代码示例来源:origin: Texera/texera

@BeforeClass
public static void setUpClient() {
  client = new JerseyClientBuilder(RULE.getEnvironment()).build("test client");
  client.property(ClientProperties.CONNECT_TIMEOUT, 5000);
  client.property(ClientProperties.READ_TIMEOUT,    5000);
}

代码示例来源:origin: Texera/texera

@BeforeClass
public static void setUpClient() {
  client = new JerseyClientBuilder(RULE.getEnvironment()).build("test client");
  client.property(ClientProperties.CONNECT_TIMEOUT, 5000);
  client.property(ClientProperties.READ_TIMEOUT,    5000);
}

相关文章