Class HttpDestination

    • Constructor Detail

      • HttpDestination

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

      • accept

        public void accept​(Connection connection)
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Starts the managed lifecycle beans in the order they were added.
        doStart in class ContainerLifeCycle
        AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
        java.lang.Exception - If there was a problem starting. Will cause a transition to FAILED state
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Stops the managed lifecycle beans in the reverse order they were added.
        doStop in class ContainerLifeCycle
        java.lang.Exception - If there was a problem stopping. Will cause a transition to FAILED state
      • isSecure

        public boolean isSecure()
      • getHttpClient

        public HttpClient getHttpClient()
      • getOrigin

        public Origin getOrigin()
      • getHttpExchanges

        public java.util.Queue<HttpExchange> getHttpExchanges()
      • getHostField

        public HttpField getHostField()
      • failed

        public void failed​(java.lang.Throwable x)
        Description copied from interface: Callback

        Callback invoked when the operation fails.

        Specified by:
        failed in interface Callback
        x - the reason for the operation failure
      • send

        public void send()
      • newConnection

        public void newConnection​(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<>();
         Connection connection = futureConnection.get(5, TimeUnit.SECONDS);
        Specified by:
        newConnection in interface Destination
        promise - the promise of a new, unpooled, Connection
      • createConnection

        protected void createConnection​(Promise<Connection> promise)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface
      • release

        public void release​(Connection connection)
      • remove

        public boolean remove​(Connection connection)
      • abort

        public void abort​(java.lang.Throwable cause)
        Aborts all the HttpExchanges queued in this destination.
        cause - the abort cause
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
        Description copied from interface: Dumpable
        Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
        Specified by:
        dump in interface Dumpable
        dump in class ContainerLifeCycle
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws: - if unable to write to Appendable
      • asString

        public java.lang.String asString()