com.sun.jersey.api.client.Client.getProperties()方法的使用及代码示例

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

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

Client.getProperties介绍

[英]Get the mutable property bag.
[中]获取可变属性包。

代码示例

代码示例来源:origin: com.sun.jersey/jersey-bundle

  1. /**
  2. * Set if redirection should be performed or not.
  3. *
  4. * This method is the functional equivalent to setting the property
  5. * {@link ClientConfig#PROPERTY_FOLLOW_REDIRECTS} on the property bag
  6. * returned from {@link #getProperties}
  7. *
  8. * @param redirect if true then the client will automatically redirect
  9. * to the URI declared in 3xx responses.
  10. */
  11. public void setFollowRedirects(Boolean redirect) {
  12. getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, redirect);
  13. }

代码示例来源:origin: jersey/jersey-1.x

  1. /**
  2. * Set the connect timeout interval, in milliseconds.
  3. *
  4. * This method is the functional equivalent to setting the property
  5. * {@link ClientConfig#PROPERTY_CONNECT_TIMEOUT} on the property bag
  6. * returned from {@link #getProperties}
  7. *
  8. * @param interval the connect timeout interval. If null or 0 then
  9. * an interval of infinity is declared.
  10. */
  11. public void setConnectTimeout(Integer interval) {
  12. getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, interval);
  13. }

代码示例来源:origin: com.sun.jersey/jersey-bundle

  1. /**
  2. * Set the read timeout interval, in milliseconds.
  3. *
  4. * This method is the functional equivalent to setting the property
  5. * {@link ClientConfig#PROPERTY_READ_TIMEOUT} on the property bag
  6. * returned from {@link #getProperties}
  7. *
  8. * @param interval the read timeout interval. If null or 0 then
  9. * an interval of infinity is declared.
  10. */
  11. public void setReadTimeout(Integer interval) {
  12. getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, interval);
  13. }

代码示例来源:origin: com.sun.jersey/jersey-bundle

  1. /**
  2. * Set the connect timeout interval, in milliseconds.
  3. *
  4. * This method is the functional equivalent to setting the property
  5. * {@link ClientConfig#PROPERTY_CONNECT_TIMEOUT} on the property bag
  6. * returned from {@link #getProperties}
  7. *
  8. * @param interval the connect timeout interval. If null or 0 then
  9. * an interval of infinity is declared.
  10. */
  11. public void setConnectTimeout(Integer interval) {
  12. getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, interval);
  13. }

代码示例来源:origin: com.sun.jersey/jersey-bundle

  1. /**
  2. * Set the client to send request entities using chunked encoding
  3. * with a particular chunk size.
  4. *
  5. * This method is the functional equivalent to setting the property
  6. * {@link ClientConfig#PROPERTY_CHUNKED_ENCODING_SIZE} on the property bag
  7. * returned from {@link #getProperties}
  8. *
  9. * @param chunkSize the chunked encoding size. If &lt= 0 then the default
  10. * size will be used. If null then chunked encoding will not be
  11. * utilized.
  12. */
  13. public void setChunkedEncodingSize(Integer chunkSize) {
  14. getProperties().put(ClientConfig.PROPERTY_CHUNKED_ENCODING_SIZE, chunkSize);
  15. }

代码示例来源:origin: jersey/jersey-1.x

  1. /**
  2. * Set if redirection should be performed or not.
  3. *
  4. * This method is the functional equivalent to setting the property
  5. * {@link ClientConfig#PROPERTY_FOLLOW_REDIRECTS} on the property bag
  6. * returned from {@link #getProperties}
  7. *
  8. * @param redirect if true then the client will automatically redirect
  9. * to the URI declared in 3xx responses.
  10. */
  11. public void setFollowRedirects(Boolean redirect) {
  12. getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, redirect);
  13. }

代码示例来源:origin: jersey/jersey-1.x

  1. /**
  2. * Set the read timeout interval, in milliseconds.
  3. *
  4. * This method is the functional equivalent to setting the property
  5. * {@link ClientConfig#PROPERTY_READ_TIMEOUT} on the property bag
  6. * returned from {@link #getProperties}
  7. *
  8. * @param interval the read timeout interval. If null or 0 then
  9. * an interval of infinity is declared.
  10. */
  11. public void setReadTimeout(Integer interval) {
  12. getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, interval);
  13. }

代码示例来源:origin: jersey/jersey-1.x

  1. /**
  2. * Set the client to send request entities using chunked encoding
  3. * with a particular chunk size.
  4. *
  5. * This method is the functional equivalent to setting the property
  6. * {@link ClientConfig#PROPERTY_CHUNKED_ENCODING_SIZE} on the property bag
  7. * returned from {@link #getProperties}
  8. *
  9. * @param chunkSize the chunked encoding size. If &lt= 0 then the default
  10. * size will be used. If null then chunked encoding will not be
  11. * utilized.
  12. */
  13. public void setChunkedEncodingSize(Integer chunkSize) {
  14. getProperties().put(ClientConfig.PROPERTY_CHUNKED_ENCODING_SIZE, chunkSize);
  15. }

代码示例来源:origin: org.apache.apex/apex-engine

  1. public WebServicesClient()
  2. {
  3. this(new DefaultClientConfig());
  4. client.getProperties().put(ClientConfig.PROPERTY_FOLLOW_REDIRECTS, true);
  5. client.getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, DEFAULT_CONNECT_TIMEOUT);
  6. client.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, DEFAULT_READ_TIMEOUT);
  7. }

代码示例来源:origin: com.emc.ecs/smart-client

  1. public static Client createSmartClient(SmartConfig smartConfig,
  2. ClientHandler clientHandler) {
  3. Client client = createStandardClient(smartConfig, clientHandler);
  4. // inject SmartFilter (this is the Jersey integration point of the load balancer)
  5. client.addFilter(new SmartFilter(smartConfig));
  6. // set up polling for updated host list (if polling is disabled in smartConfig or there's no host list provider,
  7. // nothing will happen)
  8. PollingDaemon pollingDaemon = new PollingDaemon(smartConfig);
  9. pollingDaemon.start();
  10. // attach the daemon thread to the client so users can stop it when finished with the client
  11. client.getProperties().put(PollingDaemon.PROPERTY_KEY, pollingDaemon);
  12. return client;
  13. }

代码示例来源:origin: com.intuit.autumn/autumn-client

  1. client.getProperties().put(PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true);
  2. LOGGER.info("Properties of the sun jersey client used by the application: {}", client.getProperties().toString());

代码示例来源:origin: com.intuit.data.autumn/autumn.client

  1. client.getProperties().put(PROPERTY_BUFFER_RESPONSE_ENTITY_ON_EXCEPTION, true);
  2. LOGGER.info("Properties of the sun jersey client used by the application: {}", client.getProperties().toString());

代码示例来源:origin: com.emc.ecs/smart-client

  1. /**
  2. * Destroy this client. Any system resources associated with the client
  3. * will be cleaned up.
  4. * <p>
  5. * This method must be called when there are not responses pending otherwise
  6. * undefined behavior will occur.
  7. * <p>
  8. * The client must not be reused after this method is called otherwise
  9. * undefined behavior will occur.
  10. */
  11. public static void destroy(Client client) {
  12. PollingDaemon pollingDaemon = (PollingDaemon) client.getProperties().get(PollingDaemon.PROPERTY_KEY);
  13. if (pollingDaemon != null) {
  14. log.debug("terminating polling daemon");
  15. pollingDaemon.terminate();
  16. if (pollingDaemon.getSmartConfig().getHostListProvider() != null) {
  17. log.debug("destroying host list provider");
  18. pollingDaemon.getSmartConfig().getHostListProvider().destroy();
  19. }
  20. }
  21. log.debug("destroying Jersey client");
  22. client.destroy();
  23. }

代码示例来源:origin: com.intuit.autumn/autumn-client

  1. client.getProperties().toString());

代码示例来源:origin: com.intuit.data.autumn/autumn.client

  1. client.getProperties().toString());

代码示例来源:origin: com.sun.jersey/jersey-bundle

  1. getProperties().putAll(config.getProperties());

代码示例来源:origin: jersey/jersey-1.x

  1. getProperties().putAll(config.getProperties());

相关文章