Class HttpDestination

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.client.HttpDestination
All Implemented Interfaces:
Closeable, AutoCloseable, Destination, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle, org.eclipse.jetty.util.thread.Invocable
Direct Known Subclasses:
DuplexHttpDestination, MultiplexHttpDestination

@ManagedObject public abstract class HttpDestination extends org.eclipse.jetty.util.component.ContainerLifeCycle implements Destination, Closeable, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.component.Dumpable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback

    org.eclipse.jetty.util.Callback.Completable, org.eclipse.jetty.util.Callback.Completing, org.eclipse.jetty.util.Callback.Nested

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable

    org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.Task

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.Callback

    NOOP

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY

    Fields inherited from interface org.eclipse.jetty.util.thread.Invocable

    __nonBlocking
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpDestination(HttpClient client, Origin origin, boolean intrinsicallySecure)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Aborts all the HttpExchanges queued in this destination.
    void
    accept(Connection connection)
     
     
    void
     
    protected void
    createConnection(org.eclipse.jetty.util.Promise<Connection> promise)
     
    protected void
     
    protected void
     
    void
    dump(Appendable out, String indent)
     
    protected boolean
     
    void
     
    org.eclipse.jetty.io.ClientConnectionFactory
     
     
     
     
    org.eclipse.jetty.http.HttpField
     
     
     
     
    int
     
     
    int
     
     
     
     
    boolean
     
    void
    newConnection(org.eclipse.jetty.util.Promise<Connection> promise)
    Creates asynchronously a new, unpooled, Connection that will be returned at a later time through the given Promise.
    protected ConnectionPool
     
    protected Queue<HttpExchange>
     
    protected org.eclipse.jetty.io.ClientConnectionFactory
    newSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory, org.eclipse.jetty.io.ClientConnectionFactory connectionFactory)
     
    void
    release(Connection connection)
     
    boolean
    remove(Connection connection)
     
    boolean
    remove(HttpExchange exchange)
     
    void
     
    void
     
    void
    send(HttpExchange exchange)
     
    protected void
     
    protected SendFailure
    send(IConnection connection, HttpExchange exchange)
     
    void
     
     

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.Callback

    completeWith

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dump, dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.util.thread.Invocable

    getInvocationType
  • Constructor Details

    • HttpDestination

      public HttpDestination(HttpClient client, Origin origin, boolean intrinsicallySecure)
  • Method Details

    • accept

      public void accept(Connection connection)
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      Exception
    • newConnectionPool

      protected ConnectionPool newConnectionPool(HttpClient client)
    • newExchangeQueue

      protected Queue<HttpExchange> newExchangeQueue(HttpClient client)
    • newSslClientConnectionFactory

      protected org.eclipse.jetty.io.ClientConnectionFactory newSslClientConnectionFactory(org.eclipse.jetty.util.ssl.SslContextFactory.Client sslContextFactory, org.eclipse.jetty.io.ClientConnectionFactory connectionFactory)
    • isSecure

      public boolean isSecure()
    • getHttpClient

      public HttpClient getHttpClient()
    • getOrigin

      public Origin getOrigin()
    • getHttpExchanges

      public Queue<HttpExchange> getHttpExchanges()
    • getRequestNotifier

      public RequestNotifier getRequestNotifier()
    • getResponseNotifier

      public ResponseNotifier getResponseNotifier()
    • getProxy

      public ProxyConfiguration.Proxy getProxy()
    • getClientConnectionFactory

      public org.eclipse.jetty.io.ClientConnectionFactory getClientConnectionFactory()
    • getScheme

      @ManagedAttribute(value="The destination scheme", readonly=true) public String getScheme()
      Specified by:
      getScheme in interface Destination
      Returns:
      the scheme of this destination, such as "http" or "https"
    • getHost

      @ManagedAttribute(value="The destination host", readonly=true) public String getHost()
      Specified by:
      getHost in interface Destination
      Returns:
      the host of this destination, such as "127.0.0.1" or "google.com"
    • getPort

      @ManagedAttribute(value="The destination port", readonly=true) public int getPort()
      Specified by:
      getPort in interface Destination
      Returns:
      the port of this destination such as 80 or 443
    • getQueuedRequestCount

      @ManagedAttribute(value="The number of queued requests", readonly=true) public int getQueuedRequestCount()
    • getConnectAddress

      public Origin.Address getConnectAddress()
    • getHostField

      public org.eclipse.jetty.http.HttpField getHostField()
    • getConnectionPool

      @ManagedAttribute(value="The connection pool", readonly=true) public ConnectionPool getConnectionPool()
    • succeeded

      public void succeeded()
      Specified by:
      succeeded in interface org.eclipse.jetty.util.Callback
    • failed

      public void failed(Throwable x)
      Specified by:
      failed in interface org.eclipse.jetty.util.Callback
    • send

      public void send(Request request, Response.CompleteListener listener)
    • send

      protected void send(HttpRequest request, List<Response.ResponseListener> listeners)
    • send

      public void send(HttpExchange exchange)
    • enqueue

      protected boolean enqueue(Queue<HttpExchange> queue, HttpExchange exchange)
    • send

      public void send()
    • send

      protected SendFailure send(IConnection connection, HttpExchange exchange)
    • newConnection

      public void newConnection(org.eclipse.jetty.util.Promise<Connection> promise)
      Description copied from interface: Destination
      Creates asynchronously a new, unpooled, Connection that will be returned at a later time through the given Promise.

      Use FuturePromise to wait for the connection:

       Destination destination = ...;
       FuturePromise<Connection> futureConnection = new FuturePromise<>();
       destination.newConnection(futureConnection);
       Connection connection = futureConnection.get(5, TimeUnit.SECONDS);
       
      Specified by:
      newConnection in interface Destination
      Parameters:
      promise - the promise of a new, unpooled, Connection
    • createConnection

      protected void createConnection(org.eclipse.jetty.util.Promise<Connection> promise)
    • remove

      public boolean remove(HttpExchange exchange)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • release

      public void release(Connection connection)
    • remove

      public boolean remove(Connection connection)
    • abort

      public void abort(Throwable cause)
      Aborts all the HttpExchanges queued in this destination.
      Parameters:
      cause - the abort cause
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Specified by:
      dump in interface org.eclipse.jetty.util.component.Dumpable
      Overrides:
      dump in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      IOException
    • asString

      public String asString()
    • toString

      public String toString()
      Overrides:
      toString in class org.eclipse.jetty.util.component.AbstractLifeCycle