Class HttpApp


  • @Deprecated
    public abstract class HttpApp
    extends AllDirectives
    Deprecated.
    HttpApp this doesn't reflect the latest Akka APIs, since 10.2.0
    DEPRECATED, consider https://developer.lightbend.com/guides/akka-http-quickstart-java/ instead Bootstrap trait for Http Server. It helps booting up an akka-http server by only defining the desired routes. It offers additional hooks to modify the default behavior.
    • Field Detail

      • systemReference

        protected java.util.concurrent.atomic.AtomicReference<akka.actor.ActorSystem> systemReference
        Deprecated.
        Holds a reference to the ActorSystem used to start this server. Stopping this system will interfere with the proper functioning condition of the server.
    • Constructor Detail

      • HttpApp

        public HttpApp()
        Deprecated.
    • Method Detail

      • startServer

        public void startServer​(java.lang.String host,
                                int port)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Deprecated.
        Start a server on the specified host and port. Note that this method is blocking.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • startServer

        public void startServer​(java.lang.String host,
                                int port,
                                akka.actor.ActorSystem system)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Deprecated.
        Start a server on the specified host and port, using the provided [[ActorSystem]] Note that this method is blocking.
        Parameters:
        system - ActorSystem to use for starting the app, if null is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • startServer

        public void startServer​(java.lang.String host,
                                int port,
                                ServerSettings settings)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Deprecated.
        Start a server on the specified host and port, using the provided settings. Note that this method is blocking.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • startServer

        public void startServer​(java.lang.String host,
                                int port,
                                ServerSettings settings,
                                akka.actor.ActorSystem system)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Deprecated.
        Start a server on the specified host and port, using the provided settings and [[ActorSystem]]. Note that this method is blocking.
        Parameters:
        system - ActorSystem to use for starting the app, if null is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • startServer

        public void startServer​(java.lang.String host,
                                int port,
                                ServerSettings settings,
                                java.util.Optional<akka.actor.ActorSystem> system)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Deprecated.
        Start a server on the specified host and port, using the provided settings and [[ActorSystem]] if present. Note that this method is blocking. This method may throw an ExecutionException or InterruptedException if the future that signals that the server should shutdown is interrupted or cancelled.
        Parameters:
        system - ActorSystem to use for starting the app, if an empty Optional is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • postServerShutdown

        protected void postServerShutdown​(java.util.Optional<java.lang.Throwable> failure,
                                          akka.actor.ActorSystem system)
        Deprecated.
        Hook that will be called just after the server termination. Override this method if you want to perform some cleanup actions after the server is stopped. The failure parameter contains a Throwable only if there has been a problem shutting down the server.
      • postHttpBinding

        protected void postHttpBinding​(ServerBinding binding)
        Deprecated.
        Hook that will be called just after the Http server binding is done. Override this method if you want to perform some actions after the server is up.
      • postHttpBindingFailure

        protected void postHttpBindingFailure​(java.lang.Throwable cause)
        Deprecated.
        Hook that will be called in case the Http server binding fails. Override this method if you want to perform some actions after the server binding failed.
      • waitForShutdownSignal

        protected java.util.concurrent.CompletionStage<akka.Done> waitForShutdownSignal​(akka.actor.ActorSystem system)
        Deprecated.
        Hook that lets the user specify the future that will signal the shutdown of the server whenever completed.
      • routes

        protected abstract Route routes()
        Deprecated.
        Override to implement the route that will be served by this http server.