Class EurekaUpdatingListener

java.lang.Object
com.linecorp.armeria.server.ServerListenerAdapter
com.linecorp.armeria.server.eureka.EurekaUpdatingListener
All Implemented Interfaces:
com.linecorp.armeria.server.ServerListener

public final class EurekaUpdatingListener extends com.linecorp.armeria.server.ServerListenerAdapter
A ServerListener which registers the current Server to Eureka. EurekaUpdatingListener sends renewal requests periodically so that the Server is not removed from the registry. When the Server stops, EurekaUpdatingListener deregisters the Server from Eureka by sending a cancellation request.
  • Method Details

    • of

      public static EurekaUpdatingListener of(String eurekaUri)
      Returns a new EurekaUpdatingListener which registers the current Server to the specified eurekaUri.
    • of

      public static EurekaUpdatingListener of(URI eurekaUri)
      Returns a new EurekaUpdatingListener which registers the current Server to the specified eurekaUri.
    • of

      public static EurekaUpdatingListener of(com.linecorp.armeria.common.SessionProtocol sessionProtocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
      Returns a new EurekaUpdatingListener which registers the current Server to the specified EndpointGroup.
    • of

      public static EurekaUpdatingListener of(com.linecorp.armeria.common.SessionProtocol sessionProtocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, String path)
      Returns a new EurekaUpdatingListener which registers the current Server to the specified EndpointGroup under the specified path.
    • builder

      public static EurekaUpdatingListenerBuilder builder(String eurekaUri)
      Returns a new EurekaUpdatingListenerBuilder created with the specified eurekaUri.
    • builder

      public static EurekaUpdatingListenerBuilder builder(URI eurekaUri)
      Returns a new EurekaUpdatingListenerBuilder created with the specified eurekaUri.
    • builder

      public static EurekaUpdatingListenerBuilder builder(com.linecorp.armeria.common.SessionProtocol sessionProtocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
      Returns a new EurekaUpdatingListenerBuilder created with the specified SessionProtocol and EndpointGroup.
    • builder

      public static EurekaUpdatingListenerBuilder builder(com.linecorp.armeria.common.SessionProtocol sessionProtocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, String path)
      Returns a new EurekaUpdatingListenerBuilder created with the specified SessionProtocol, EndpointGroup and path.
    • serverStarted

      public void serverStarted(com.linecorp.armeria.server.Server server) throws Exception
      Specified by:
      serverStarted in interface com.linecorp.armeria.server.ServerListener
      Overrides:
      serverStarted in class com.linecorp.armeria.server.ServerListenerAdapter
      Throws:
      Exception
    • serverStopping

      public void serverStopping(com.linecorp.armeria.server.Server server) throws Exception
      Specified by:
      serverStopping in interface com.linecorp.armeria.server.ServerListener
      Overrides:
      serverStopping in class com.linecorp.armeria.server.ServerListenerAdapter
      Throws:
      Exception