org.eclipse.jetty.client.HttpClient.getScheduler()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(130)

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

HttpClient.getScheduler介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.jetty.websocket/websocket-client

public Scheduler getScheduler()
{
  return httpClient.getScheduler();
}

代码示例来源:origin: org.eclipse.jetty/jetty-client

protected ClientSelectorManager(HttpClient client, int selectors)
{
  super(client.getExecutor(), client.getScheduler(), selectors);
  this.client = client;
}

代码示例来源:origin: org.eclipse.jetty/jetty-client

protected HttpChannel(HttpDestination destination)
{
  _destination = destination;
  _totalTimeout = new TimeoutCompleteListener(destination.getHttpClient().getScheduler());
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

protected SelectorManager newSelectorManager()
{
  return new ClientSelectorManager(getExecutor(), getScheduler());
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

protected SelectorManager newSelectorManager()
{
  return new ClientSelectorManager(getExecutor(), getScheduler());
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public void send(Response.CompleteListener listener)
{
  if (getTimeout() > 0)
  {
    TimeoutCompleteListener timeoutListener = new TimeoutCompleteListener(this);
    timeoutListener.schedule(client.getScheduler());
    responseListeners.add(timeoutListener);
  }
  send(this, listener);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public void send(Response.CompleteListener listener)
{
  if (getTimeout() > 0)
  {
    TimeoutCompleteListener timeoutListener = new TimeoutCompleteListener(this);
    timeoutListener.schedule(client.getScheduler());
    responseListeners.add(timeoutListener);
  }
  send(this, listener);
}

代码示例来源:origin: com.proofpoint.platform/http-client

@Override
public void close()
{
  // client must be destroyed before the pools or
  // you will create a several second busy wait loop
  closeQuietly(httpClient);
  closeQuietly((LifeCycle) httpClient.getExecutor());
  closeQuietly(httpClient.getScheduler());
}

代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9

@Override
public void send(Request request, Response.CompleteListener listener)
{
  ArrayList<Response.ResponseListener> listeners = new ArrayList<>(2);
  if (request.getTimeout() > 0)
  {
    TimeoutCompleteListener timeoutListener = new TimeoutCompleteListener(request);
    timeoutListener.schedule(client.getScheduler());
    listeners.add(timeoutListener);
  }
  if (listener != null)
    listeners.add(listener);
  HttpConversation conversation = client.getConversation(request.getConversationID(), true);
  HttpExchange exchange = new HttpExchange(conversation, getDestination(), request, listeners);
  send(exchange);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public void send(Request request, Response.CompleteListener listener)
{
  ArrayList<Response.ResponseListener> listeners = new ArrayList<>(2);
  if (request.getTimeout() > 0)
  {
    TimeoutCompleteListener timeoutListener = new TimeoutCompleteListener(request);
    timeoutListener.schedule(client.getScheduler());
    listeners.add(timeoutListener);
  }
  if (listener != null)
    listeners.add(listener);
  HttpConversation conversation = client.getConversation(request.getConversationID(), true);
  HttpExchange exchange = new HttpExchange(conversation, getDestination(), request, listeners);
  send(exchange);
}

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

@Override
public void close()
{
  // client must be destroyed before the pools or
  // you will create a several second busy wait loop
  closeQuietly(httpClient);
  closeQuietly((LifeCycle) httpClient.getExecutor());
  closeQuietly(httpClient.getScheduler());
  requestLogger.close();
}

代码示例来源:origin: org.eclipse.jetty.http2/http2-http-client-transport

@Override
protected void doStart() throws Exception
{
  if (!client.isStarted())
  {
    HttpClient httpClient = getHttpClient();
    client.setExecutor(httpClient.getExecutor());
    client.setScheduler(httpClient.getScheduler());
    client.setByteBufferPool(httpClient.getByteBufferPool());
    client.setConnectTimeout(httpClient.getConnectTimeout());
    client.setIdleTimeout(httpClient.getIdleTimeout());
    client.setInputBufferSize(httpClient.getResponseBufferSize());
  }
  addBean(client);
  super.doStart();
  this.connectionFactory = new HTTP2ClientConnectionFactory();
  client.setClientConnectionFactory((endPoint, context) ->
  {
    HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
    return destination.getClientConnectionFactory().newConnection(endPoint, context);
  });
}

代码示例来源:origin: com.proofpoint.platform/http-client

httpClient.getScheduler(),
    config.getConnectTimeout().toMillis()));
    httpClient.getScheduler(),
    config.getConnectTimeout().toMillis()));
httpClient.addBean(new Sweeper(httpClient.getScheduler(), SWEEP_PERIOD_MILLIS), true);

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

httpClient.getScheduler(),
    config.getConnectTimeout().toMillis()));
httpClient.addBean(new Sweeper(httpClient.getScheduler(), SWEEP_PERIOD_MILLIS), true);

代码示例来源:origin: org.eclipse.jetty/jetty-client

public HttpDestination(HttpClient client, Origin origin)
{
  this.client = client;
  this.origin = origin;
  this.exchanges = newExchangeQueue(client);
  this.requestNotifier = new RequestNotifier(client);
  this.responseNotifier = new ResponseNotifier();
  
  this.timeout = new TimeoutTask(client.getScheduler());
  ProxyConfiguration proxyConfig = client.getProxyConfiguration();
  proxy = proxyConfig.match(origin);
  ClientConnectionFactory connectionFactory = client.getTransport();
  if (proxy != null)
  {
    connectionFactory = proxy.newClientConnectionFactory(connectionFactory);
    if (proxy.isSecure())
      connectionFactory = newSslClientConnectionFactory(connectionFactory);
  }
  else
  {
    if (isSecure())
      connectionFactory = newSslClientConnectionFactory(connectionFactory);
  }
  this.connectionFactory = connectionFactory;
  String host = HostPort.normalizeHost(getHost());
  if (!client.isDefaultPort(getScheme(), getPort()))
    host += ":" + getPort();
  hostField = new HttpField(HttpHeader.HOST, host);
}

相关文章

HttpClient类方法