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


Java HttpClient类代码示例

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


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

示例1: Worker

import org.mortbay.jetty.client.HttpClient; //导入依赖的package包/类
public Worker(CyclicBarrier barrier, int requestsCount, String sessionCookie, String[] urls)
{
    this.client = new HttpClient();
    this.client.setConnectorType(HttpClient.CONNECTOR_SOCKET);
    this.barrier = barrier;
    this.requestsCount = requestsCount;
    this.sessionCookie = sessionCookie;
    this.urls = urls;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:10,代码来源:TIMLightLoadTest.java

示例2: BayeuxClient

import org.mortbay.jetty.client.HttpClient; //导入依赖的package包/类
public BayeuxClient(HttpClient client, Address address, String uri) throws IOException
{
    _client=client;
    _address=address;
    _uri=uri;

    _inQ=new ArrayQueue<Message>();
    _outQ=new ArrayQueue<Message>();
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:10,代码来源:BayeuxClient.java

示例3: BayeuxLoadGenerator

import org.mortbay.jetty.client.HttpClient; //导入依赖的package包/类
public BayeuxLoadGenerator() throws Exception
{
    http=new HttpClient();

    http.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
    // http.setConnectorType(HttpClient.CONNECTOR_SOCKET);
    http.setMaxConnectionsPerAddress(20000);

    QueuedThreadPool pool = new QueuedThreadPool();
    pool.setMaxThreads(500);
    pool.setDaemon(true);
    http.setThreadPool(pool);
    http.start();

}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:16,代码来源:BayeuxLoadGenerator.java

示例4: StreamingMarketQuote

import org.mortbay.jetty.client.HttpClient; //导入依赖的package包/类
public StreamingMarketQuote() throws ModelException
{
	client.setThreadPool(new QueuedThreadPool(250));
	client.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
	client.setMaxConnectionsPerAddress(500); // max 200 concurrent connections to every address
	try
	{
		client.start();
	}
	catch (Exception e)
	{
		throw new ModelException("Start HTTP Client", e);
	}
}
 
开发者ID:Ccook,项目名称:conniption,代码行数:15,代码来源:StreamingMarketQuote.java


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