java.lang.Object
org.springframework.extensions.webscripts.connector.EndpointManager

public final class EndpointManager extends Object
The EndpointManager is responsible for maintaining connection timeout and connection retry information for endpoints. It may be used by multiple Connector objects to ensure that failing endpoints are not repeatedly connected to or waited on.
Author:
Kevin Roast
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    allowConnect(String endpoint)
    Returns true if the connector should make a connection attempt to the specified endpoint, false if the endpoint is still in the "wait" period between retries.
    static boolean
    processResponseCode(String endpoint, int code)
    Process the given response code for an endpoint - recording if that remote connection is unavailable for a time.
    static void
    Register an endpoint with the manager - the same endpoint can be registered any number of times by multiple threads without side effects.
    static void
    Register an endpoint with the manager - the same endpoint can be registered any number of times by multiple threads without side effects.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • registerEndpoint

      public static void registerEndpoint(String endpoint)
      Register an endpoint with the manager - the same endpoint can be registered any number of times by multiple threads without side effects.
      Parameters:
      endpoint - The endpoint to register
    • registerEndpoint

      public static void registerEndpoint(String endpoint, RemoteConfigElement.ConnectorDescriptor descriptor)
      Register an endpoint with the manager - the same endpoint can be registered any number of times by multiple threads without side effects.
      Parameters:
      endpoint - The endpoint to register
      descriptor - The ConnectorDescriptor used to connect to this endpoint Used to retrieve reconnection timeout config.
    • allowConnect

      public static boolean allowConnect(String endpoint)
      Returns true if the connector should make a connection attempt to the specified endpoint, false if the endpoint is still in the "wait" period between retries.
      Parameters:
      endpoint - The endpoint to test
      Returns:
      true to allow connect, false otherwise
    • processResponseCode

      public static boolean processResponseCode(String endpoint, int code)
      Process the given response code for an endpoint - recording if that remote connection is unavailable for a time. Returns true if further response processing should continue, false otherwise.
      Parameters:
      endpoint - The endpoint to record code against
      code - Response code
      Returns:
      true if further processing should continue, false otherwise