Class HttpDestination

    • Constructor Detail

      • HttpDestination

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

      • stale

        public boolean stale()
      • sweep

        public boolean sweep()
        Specified by:
        sweep in interface Sweeper.Sweepable
        Returns:
        whether this resource should be swept
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Starts the managed lifecycle beans in the order they were added.
        Overrides:
        doStart in class ContainerLifeCycle
        Throws:
        java.lang.Exception
      • 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.
        Overrides:
        doStop in class ContainerLifeCycle
        Throws:
        java.lang.Exception
      • 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
        Parameters:
        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<>();
         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​(Promise<Connection> promise)
      • close

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

        public void release​(Connection connection)
      • remove

        public boolean remove​(Connection connection)
      • close

        @Deprecated
        public void close​(Connection connection)
        Deprecated.
        use remove(Connection) instead
        Parameters:
        connection - the connection to remove
      • abort

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

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        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
        Overrides:
        dump in class ContainerLifeCycle
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable
      • asString

        public java.lang.String asString()
      • getIdle

        @ManagedAttribute("For how long this destination has been idle in ms")
        public long getIdle()
      • isStale

        @ManagedAttribute("Whether this destinations is stale")
        public boolean isStale()