Class ClientRoute

All Implemented Interfaces:
Uniform

public class ClientRoute extends Route
Router scorer based on a target client connector. Concurrency note: instances of this class or its subclasses can be invoked by several threads at the same time and therefore must be thread-safe. You should be especially careful when storing state in member variables.
Author:
Jerome Louvel
  • Constructor Details

    • ClientRoute

      public ClientRoute(Router router, Client target)
      Constructor.
      Parameters:
      router - The parent router.
      target - The target client.
  • Method Details

    • getClient

      public Client getClient()
      Returns the target client.
      Returns:
      The target client.
    • score

      public float score(Request request, Response response)
      Returns the score for a given call (between 0 and 1.0).
      Specified by:
      score in class Route
      Parameters:
      request - The request to score.
      response - The response to score.
      Returns:
      The score for a given call (between 0 and 1.0).
    • setNext

      public void setNext(Client next)
      Sets the next client.
      Parameters:
      next - The next client.