Tabnine Logo
HttpChannel
Code IndexAdd Tabnine to your IDE (free)

How to use
HttpChannel
in
org.eclipse.jetty.client

Best Java code snippets using org.eclipse.jetty.client.HttpChannel (Showing top 20 results out of 315)

origin: org.eclipse.jetty.http2/http2-http-client-transport

private void abort(Throwable failure)
{
  for (HttpChannel channel : activeChannels)
  {
    HttpExchange exchange = channel.getHttpExchange();
    if (exchange != null)
      exchange.getRequest().abort(failure);
  }
  activeChannels.clear();
  HttpChannel channel = idleChannels.poll();
  while (channel!=null)
  {
    channel.destroy();
    channel = idleChannels.poll();
  }
}
origin: org.eclipse.jetty/jetty-client

@Override
public String toString()
{
  return String.format("%s[send=%s,recv=%s]",
      super.toString(),
      sender,
      receiver);
}
origin: org.eclipse.jetty/jetty-client

public boolean abort(HttpExchange exchange, Throwable requestFailure, Throwable responseFailure)
{
  boolean requestAborted = false;
  if (requestFailure != null)
    requestAborted = getHttpSender().abort(exchange, requestFailure);
  boolean responseAborted = false;
  if (responseFailure != null)
    responseAborted = abortResponse(exchange, responseFailure);
  return requestAborted || responseAborted;
}
origin: org.eclipse.jetty/jetty-client

    getHttpChannel().abortResponse(exchange, failure);
result = channel.exchangeTerminating(exchange, result);
HttpDestination destination = getHttpChannel().getHttpDestination();
boolean ordered = destination.getHttpClient().isStrictEventOrdering();
if (!ordered)
  channel.exchangeTerminated(exchange, result);
if (LOG.isDebugEnabled())
  LOG.debug("Request/Response {}: {}", failure == null ? "succeeded" : "failed", result);
destination.getResponseNotifier().notifyComplete(conversation.getResponseListeners(), result);
if (ordered)
  channel.exchangeTerminated(exchange, result);
origin: org.eclipse.jetty/jetty-client

public void send()
{
  HttpExchange exchange = getHttpExchange();
  if (exchange != null)
  {
    HttpRequest request = exchange.getRequest();
    long timeoutAt = request.getTimeoutAt();
    if (timeoutAt != -1)
    {
      exchange.getResponseListeners().add(_totalTimeout);
      _totalTimeout.schedule(request, timeoutAt);
    }
    send(exchange);
  }
}
origin: org.eclipse.jetty/jetty-client

protected HttpExchange getHttpExchange()
{
  return channel.getHttpExchange();
}
origin: org.eclipse.jetty/jetty-client

if (channel.associate(exchange))
  channel.send();
  result = null;
  channel.release();
  result = new SendFailure(new HttpRequestException("Could not associate request to connection", request), false);
origin: org.eclipse.jetty/jetty-client

private void terminateResponse(HttpExchange exchange, Result result)
{
  HttpResponse response = exchange.getResponse();
  if (LOG.isDebugEnabled())
    LOG.debug("Response complete {}", response);
  if (result != null)
  {
    result = channel.exchangeTerminating(exchange, result);
    boolean ordered = getHttpDestination().getHttpClient().isStrictEventOrdering();
    if (!ordered)
      channel.exchangeTerminated(exchange, result);
    if (LOG.isDebugEnabled())
      LOG.debug("Request/Response {}: {}", failure == null ? "succeeded" : "failed", result);
    List<Response.ResponseListener> listeners = exchange.getConversation().getResponseListeners();
    ResponseNotifier notifier = getHttpDestination().getResponseNotifier();
    notifier.notifyComplete(listeners, result);
    if (ordered)
      channel.exchangeTerminated(exchange, result);
  }
}
origin: org.eclipse.jetty/jetty-client

protected HttpDestination getHttpDestination()
{
  return channel.getHttpDestination();
}
origin: org.eclipse.jetty.http2/http2-http-client-transport

@Override
public void exchangeTerminated(HttpExchange exchange, Result result)
{
  super.exchangeTerminated(exchange, result);
  if (result.isSucceeded())
  {
    release();
  }
  else
  {
    Stream stream = getStream();
    if (stream != null)
      stream.reset(new ResetFrame(stream.getId(), ErrorCode.CANCEL_STREAM_ERROR.code), new ReleaseCallback());
    else
      release();
  }
}
origin: org.eclipse.jetty/jetty-client

public void exchangeTerminated(HttpExchange exchange, Result result)
{
  disassociate(exchange);
}
origin: org.eclipse.jetty.http2/http2-http-client-transport

protected void close(Throwable failure)
{
  if (closed.compareAndSet(false, true))
  {
    getHttpDestination().close(this);
    abort(failure);
    session.close(ErrorCode.NO_ERROR.code, failure.getMessage(), Callback.NOOP);
    
    HttpChannel channel = idleChannels.poll();
    while (channel!=null)
    {
      channel.destroy();
      channel = idleChannels.poll();
    }
  }
}
origin: org.eclipse.jetty/jetty-client

boolean aborted = channel.abort(this, abortRequest ? failure : null, abortResponse ? failure : null);
if (LOG.isDebugEnabled())
  LOG.debug("Aborted ({}) while active {}: {}", aborted, this, failure);
origin: org.eclipse.jetty/jetty-client

protected HttpExchange getHttpExchange()
{
  return channel.getHttpExchange();
}
origin: org.eclipse.jetty/jetty-client

private void executeAbort(HttpExchange exchange, Throwable failure)
{
  try
  {
    Executor executor = getHttpChannel().getHttpDestination().getHttpClient().getExecutor();
    executor.execute(() -> abort(exchange, failure));
  }
  catch (RejectedExecutionException x)
  {
    if (LOG.isDebugEnabled())
      LOG.debug(x);
    abort(exchange, failure);
  }
}
origin: org.eclipse.jetty/jetty-client

@Override
public void exchangeTerminated(HttpExchange exchange, Result result)
  super.exchangeTerminated(exchange, result);
origin: org.eclipse.jetty/jetty-client

  @Override
  public String toString()
  {
    return String.format("%s@%x(exchange=%s)", getClass().getSimpleName(), hashCode(), getHttpExchange());
  }
}
origin: org.eclipse.jetty.http2/http2-http-client-transport

@Override
public String toString()
{
  return String.format("%s[send=%s,recv=%s]",
      super.toString(),
      sender,
      receiver);
}
origin: org.eclipse.jetty/jetty-client

protected boolean beginToHeaders(HttpExchange exchange)
{
  if (!updateRequestState(RequestState.BEGIN, RequestState.TRANSIENT))
    return false;
  Request request = exchange.getRequest();
  if (LOG.isDebugEnabled())
    LOG.debug("Request headers {}{}{}", request, System.lineSeparator(), request.getHeaders().toString().trim());
  RequestNotifier notifier = getHttpChannel().getHttpDestination().getRequestNotifier();
  notifier.notifyHeaders(request);
  if (updateRequestState(RequestState.TRANSIENT, RequestState.HEADERS))
    return true;
  terminateRequest(exchange);
  return false;
}
origin: org.eclipse.jetty/jetty-client

protected boolean someToContent(HttpExchange exchange, ByteBuffer content)
{
  RequestState current = requestState.get();
  switch (current)
  {
    case COMMIT:
    case CONTENT:
    {
      if (!updateRequestState(current, RequestState.TRANSIENT))
        return false;
      Request request = exchange.getRequest();
      if (LOG.isDebugEnabled())
        LOG.debug("Request content {}{}{}", request, System.lineSeparator(), BufferUtil.toDetailString(content));
      RequestNotifier notifier = getHttpChannel().getHttpDestination().getRequestNotifier();
      notifier.notifyContent(request, content);
      if (updateRequestState(RequestState.TRANSIENT, RequestState.CONTENT))
        return true;
      terminateRequest(exchange);
      return false;
    }
    default:
    {
      return false;
    }
  }
}
org.eclipse.jetty.clientHttpChannel

Most used methods

  • exchangeTerminated
  • getHttpExchange
  • toString
  • abort
  • abortResponse
  • associate
    Associates the given exchange to this channel in order to be sent over the network. If the associat
  • destroy
  • disassociate
  • exchangeTerminating
  • getHttpDestination
  • getHttpReceiver
  • getHttpSender
  • getHttpReceiver,
  • getHttpSender,
  • proceed,
  • release,
  • send

Popular in Java

  • Updating database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Permission (java.security)
    Legacy security code; do not use.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now