Packages

c

akka.http.javadsl

ServerBinding

class ServerBinding extends AnyRef

Represents a prospective HTTP server binding.

Source
ServerBinding.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerBinding
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ServerBinding toany2stringadd[ServerBinding] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ServerBinding, B)
    Implicit
    This member is added by an implicit conversion from ServerBinding toArrowAssoc[ServerBinding] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def addToCoordinatedShutdown(hardTerminationDeadline: Duration, system: ClassicActorSystemProvider): ServerBinding

    Adds this ServerBinding to the actor system's coordinated shutdown, so that unbind and terminate get called appropriately before the system is shut down.

    Adds this ServerBinding to the actor system's coordinated shutdown, so that unbind and terminate get called appropriately before the system is shut down.

    hardTerminationDeadline

    timeout after which all requests and connections shall be forcefully terminated

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  9. def ensuring(cond: (ServerBinding) => Boolean, msg: => Any): ServerBinding
    Implicit
    This member is added by an implicit conversion from ServerBinding toEnsuring[ServerBinding] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (ServerBinding) => Boolean): ServerBinding
    Implicit
    This member is added by an implicit conversion from ServerBinding toEnsuring[ServerBinding] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: => Any): ServerBinding
    Implicit
    This member is added by an implicit conversion from ServerBinding toEnsuring[ServerBinding] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): ServerBinding
    Implicit
    This member is added by an implicit conversion from ServerBinding toEnsuring[ServerBinding] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def localAddress: InetSocketAddress

    The local address of the endpoint bound by the materialization of the connections akka.stream.javadsl.Source.

  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def terminate(hardDeadline: Duration): CompletionStage[HttpTerminated]

    Triggers "graceful" termination request being handled on this connection.

    Triggers "graceful" termination request being handled on this connection.

    Termination works as follows:

    1) Unbind: - the server port is unbound; no new connections will be accepted.

    1.5) Immediately the ServerBinding whenTerminationSignalIssued future is completed. This can be used to signal parts of the application that the http server is shutting down and they should clean up as well. Note also that for more advanced shut down scenarios you may want to use the Coordinated Shutdown capabilities of Akka.

    2) if a connection has no "in-flight" request, it is terminated immediately

    3) Handle in-flight request: - if a request is "in-flight" (being handled by user code), it is given hardDeadline time to complete,

    • if user code emits a response within the timeout, then this response is sent to the client with a Connection: close header and the connection is closed.
      • however if it is a streaming response, it is also mandated that it shall complete within the deadline, and if it does not the connection will be terminated regardless of status of the streaming response (this is because such response could be infinite, which could trap the server in a situation where it could not terminate if it were to wait for a response to "finish")
      • existing streaming responses must complete before the deadline as well. When the deadline is reached the connection will be terminated regardless of status of the streaming responses.
    • if user code does not reply with a response within the deadline we produce a special akka.http.javadsl.settings.ServerSettings.getTerminationDeadlineExceededResponse HTTP response (e.g. 503 Service Unavailable)

    4) Keep draining incoming requests on existing connection: - The existing connection will remain alive for until the hardDeadline is exceeded, yet no new requests will be delivered to the user handler. All such drained responses will be replied to with an termination response (as explained in phase 3).

    5) Close still existing connections - Connections are terminated forcefully once the hardDeadline is exceeded. The whenTerminated future is completed as well, so the graceful termination (of the ActorSystem or entire JVM itself can be safely performed, as by then it is known that no connections remain alive to this server).

    Note that the termination response is configurable in akka.http.javadsl.settings.ServerSettings, and by default is an 503 Service Unavailable, with an empty response entity.

    hardDeadline

    timeout after which all requests and connections shall be forcefully terminated

    returns

    completion stage which completes successfully with a marker object once all connections have been terminated

  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. def unbind(): CompletionStage[Done]

    Asynchronously triggers the unbinding of the port that was bound by the materialization of the connections akka.stream.javadsl.Source

    Asynchronously triggers the unbinding of the port that was bound by the materialization of the connections akka.stream.javadsl.Source

    The produced java.util.concurrent.CompletionStage is fulfilled when the unbinding has been completed.

  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. def whenTerminated: CompletionStage[HttpTerminated]

    This completion stage completes when the termination process, as initiated by an terminate call has completed.

    This completion stage completes when the termination process, as initiated by an terminate call has completed. This means that the server is by then: unbound, and has closed all existing connections.

    This signal can for example be used to safely terminate the underlying ActorSystem.

    Note: This mechanism is currently NOT hooked into the Coordinated Shutdown mechanisms of Akka. TODO: This feature request is tracked by: https://github.com/akka/akka-http/issues/1210

    Note that this signal may be used for Coordinated Shutdown to proceed to next steps in the shutdown. You may also explicitly depend on this completion stage to perform your next shutting down steps.

  30. def whenTerminationSignalIssued: CompletionStage[Duration]

    Completes when the terminate is called and server termination is in progress.

    Completes when the terminate is called and server termination is in progress. Can be useful to make parts of your application aware that termination has been issued, and they have java.time.Duration time remaining to clean-up before the server will forcefully close existing connections.

    Note that while termination is in progress, no new connections will be accepted (i.e. termination implies prior unbind).

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ServerBinding toStringFormat[ServerBinding] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (ServerBinding, B)
    Implicit
    This member is added by an implicit conversion from ServerBinding toArrowAssoc[ServerBinding] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromServerBinding to any2stringadd[ServerBinding]

Inherited by implicit conversion StringFormat fromServerBinding to StringFormat[ServerBinding]

Inherited by implicit conversion Ensuring fromServerBinding to Ensuring[ServerBinding]

Inherited by implicit conversion ArrowAssoc fromServerBinding to ArrowAssoc[ServerBinding]

Ungrouped