Class HttpApp

java.lang.Object
akka.http.javadsl.server.directives.BasicDirectives

@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 Details

    • systemReference

      protected 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 Details

    • HttpApp

      public HttpApp()
      Deprecated.
  • Method Details

    • startServer

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

      public void startServer(String host, int port, akka.actor.ActorSystem system) throws ExecutionException, 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:
      ExecutionException
      InterruptedException
    • startServer

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

      public void startServer(String host, int port, ServerSettings settings, akka.actor.ActorSystem system) throws ExecutionException, 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:
      ExecutionException
      InterruptedException
    • startServer

      public void startServer(String host, int port, ServerSettings settings, Optional<akka.actor.ActorSystem> system) throws ExecutionException, 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:
      ExecutionException
      InterruptedException
    • postServerShutdown

      protected void postServerShutdown(Optional<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(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 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.