Interface Router


public interface Router
Router for server. Router contains routings of various types, so the server can handle each protocol as fast as possible.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Builder for a standalone router.
    static interface 
    Generic builder interface used by both Router.Builder and io.helidon.webserver.WebServer.Builder.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This is called after server closes ports.
    void
    This is called before server opens ports.
    Builder for router.
    static Router
    Empty router.
    <T extends Routing>
    T
    routing(Class<T> routingType, T defaultValue)
    Get routing of a specific type.
    List<? extends Routing>
    List of all conifgured routings.
  • Method Details

    • builder

      static Router.Builder builder()
      Builder for router.
      Returns:
      a new builder
    • empty

      static Router empty()
      Empty router.
      Returns:
      new empty router
    • routing

      <T extends Routing> T routing(Class<T> routingType, T defaultValue)
      Get routing of a specific type.
      Type Parameters:
      T - type of routing
      Parameters:
      routingType - type of the routing
      defaultValue - default value to use if the routing is not defined in this router
      Returns:
      routing defined or default value if not found
    • afterStop

      void afterStop()
      This is called after server closes ports.
    • beforeStart

      void beforeStart()
      This is called before server opens ports.
    • routings

      List<? extends Routing> routings()
      List of all conifgured routings.
      Returns:
      all routings