org.eclipse.jetty.client.api.Request.getTimeout()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(158)

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

Request.getTimeout介绍

暂无

代码示例

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

@Override
public void onTimeoutExpired()
{
  Request request = this.request.getAndSet(null);
  if (LOG.isDebugEnabled())
    LOG.debug("Total timeout {} ms elapsed for {}", request.getTimeout(), request);
  if (request != null)
    request.abort(new TimeoutException("Total timeout " + request.getTimeout() + " ms elapsed"));
}

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

public boolean schedule(Scheduler scheduler)
{
  long timeout = request.getTimeout();
  Scheduler.Task task = scheduler.schedule(this, timeout, TimeUnit.MILLISECONDS);
  if (this.task.getAndSet(task) != null)
    throw new IllegalStateException();
  LOG.debug("Scheduled timeout task {} in {} ms", task, timeout);
  return true;
}

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

public boolean schedule(Scheduler scheduler)
{
  long timeout = request.getTimeout();
  Scheduler.Task task = scheduler.schedule(this, timeout, TimeUnit.MILLISECONDS);
  if (this.task.getAndSet(task) != null)
    throw new IllegalStateException();
  LOG.debug("Scheduled timeout task {} in {} ms", task, timeout);
  return true;
}

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

clientSocket.setSoTimeout(request.getTimeout());
outToServer = new ObjectOutputStream(clientSocket.getOutputStream());
inFromServer = new ObjectInputStream(clientSocket.getInputStream());

代码示例来源:origin: org.apache.camel/camel-jetty9

protected void doTaskCompleted(Throwable ex) {
  if (ex instanceof TimeoutException) {
    exchange.setException(new ExchangeTimedOutException(exchange, request.getTimeout()));
  } else {
    exchange.setException(new CamelExchangeException("JettyClient failed cause by: " + ex.getMessage(), exchange, ex));
  }
  done.countDown();
  if (callback != null) {
    // now invoke callback to indicate we are done async
    callback.done(false);
  }
}

代码示例来源: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);
}

相关文章