Class HttpApp

java.lang.Object
akka.http.scaladsl.server.HttpApp
All Implemented Interfaces:
ToNameReceptacleEnhancements, Directives, AttributeDirectives, BasicDirectives, CacheConditionDirectives, CodingDirectives, CookieDirectives, DebuggingDirectives, ExecutionDirectives, FileAndResourceDirectives, FileUploadDirectives, FormFieldDirectives, FormFieldDirectivesInstances, FramedEntityStreamingDirectives, FutureDirectives, HeaderDirectives, HostDirectives, MarshallingDirectives, MethodDirectives, MiscDirectives, ParameterDirectives, ParameterDirectivesInstances, PathDirectives, RangeDirectives, RespondWithDirectives, RouteDirectives, SchemeDirectives, SecurityDirectives, TimeoutDirectives, WebSocketDirectives, ImplicitPathMatcherConstruction, PathMatchers, RouteConcatenation

public abstract class HttpApp extends Object implements Directives
Deprecated.
HttpApp this doesn't reflect the latest Akka APIs. Since 10.2.0.
DEPRECATED, consider https://developer.lightbend.com/guides/akka-http-quickstart-scala/ 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.

  • Constructor Details

    • HttpApp

      public HttpApp()
      Deprecated.
  • Method Details

    • DoubleNumber

      public PathMatcher<scala.Tuple1<Object>> DoubleNumber()
      Deprecated.
      Specified by:
      DoubleNumber in interface PathMatchers
    • HexIntNumber

      public PathMatchers.HexIntNumber$ HexIntNumber()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      HexIntNumber in interface PathMatchers
      Returns:
      (undocumented)
    • HexLongNumber

      public PathMatchers.HexLongNumber$ HexLongNumber()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      HexLongNumber in interface PathMatchers
      Returns:
      (undocumented)
    • IntNumber

      public PathMatchers.IntNumber$ IntNumber()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      IntNumber in interface PathMatchers
      Returns:
      (undocumented)
    • JavaUUID

      public PathMatcher<scala.Tuple1<UUID>> JavaUUID()
      Deprecated.
      Specified by:
      JavaUUID in interface PathMatchers
    • LongNumber

      public PathMatchers.LongNumber$ LongNumber()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      LongNumber in interface PathMatchers
      Returns:
      (undocumented)
    • Neutral

      public PathMatcher<scala.runtime.BoxedUnit> Neutral()
      Deprecated.
      Specified by:
      Neutral in interface PathMatchers
    • PathEnd

      public PathMatchers.PathEnd$ PathEnd()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      PathEnd in interface PathMatchers
      Returns:
      (undocumented)
    • Remaining

      public PathMatchers.Remaining$ Remaining()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      Remaining in interface PathMatchers
      Returns:
      (undocumented)
    • RemainingPath

      public PathMatchers.RemainingPath$ RemainingPath()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      RemainingPath in interface PathMatchers
      Returns:
      (undocumented)
    • Segment

      public PathMatchers.Segment$ Segment()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      Segment in interface PathMatchers
      Returns:
      (undocumented)
    • Segments

      public PathMatcher<scala.Tuple1<scala.collection.immutable.List<String>>> Segments()
      Deprecated.
      Specified by:
      Segments in interface PathMatchers
    • Slash

      public PathMatchers.Slash$ Slash()
      Deprecated.
      Description copied from interface: PathMatchers
      Accessor for nested Scala object
      Specified by:
      Slash in interface PathMatchers
      Returns:
      (undocumented)
    • binding

      public scala.util.Try<Http.ServerBinding> binding()
      Deprecated.
      It tries to retrieve the ServerBinding if the server has been successfully started. It fails otherwise. You can use this method to attempt to retrieve the ServerBinding at any point in time to, for example, stop the server due to unexpected circumstances.
      Returns:
      (undocumented)
    • postHttpBinding

      protected void postHttpBinding(Http.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.
      Parameters:
      binding - (undocumented)
    • 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.
      Parameters:
      cause - (undocumented)
    • postServerShutdown

      protected void postServerShutdown(scala.util.Try<akka.Done> attempt, 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 attempt parameter is represented with a Try type that is successful only if the server was successfully shut down.
      Parameters:
      attempt - (undocumented)
      system - (undocumented)
    • routes

      protected abstract scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> routes()
      Deprecated.
      Override to implement the routes that will be served by this http server.
      Returns:
      (undocumented)
    • startServer

      public void startServer(String host, int port)
      Deprecated.
      Start a server on the specified host and port. Note that this method is blocking
      Parameters:
      host - (undocumented)
      port - (undocumented)
    • startServer

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

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

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

      public void startServer(String host, int port, ServerSettings settings, scala.Option<akka.actor.ActorSystem> system)
      Deprecated.
      Start a server on the specified host and port, using the provided settings and ActorSystem if present. Note that this method is blocking.

      Parameters:
      system - ActorSystem to use for starting the app, if None is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.
      host - (undocumented)
      port - (undocumented)
      settings - (undocumented)
    • systemReference

      protected AtomicReference<akka.actor.ActorSystem> systemReference()
      Deprecated.
      ActorSystem used to start this server. Stopping this system will interfere with the proper functioning condition of the server.
      Returns:
      (undocumented)
    • waitForShutdownSignal

      protected scala.concurrent.Future<akka.Done> waitForShutdownSignal(akka.actor.ActorSystem system, scala.concurrent.ExecutionContext ec)
      Deprecated.
      Hook that lets the user specify the future that will signal the shutdown of the server whenever completed.
      Parameters:
      system - (undocumented)
      ec - (undocumented)
      Returns:
      (undocumented)