Class EndpointManager
- java.lang.Object
-
- org.springframework.extensions.webscripts.connector.EndpointManager
-
public final class EndpointManager extends java.lang.ObjectThe 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanallowConnect(java.lang.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 booleanprocessResponseCode(java.lang.String endpoint, int code)Process the given response code for an endpoint - recording if that remote connection is unavailable for a time.static voidregisterEndpoint(java.lang.String endpoint)Register an endpoint with the manager - the same endpoint can be registered any number of times by multiple threads without side effects.static voidregisterEndpoint(java.lang.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.
-
-
-
Method Detail
-
registerEndpoint
public static void registerEndpoint(java.lang.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(java.lang.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 registerdescriptor- The ConnectorDescriptor used to connect to this endpoint Used to retrieve reconnection timeout config.
-
allowConnect
public static boolean allowConnect(java.lang.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(java.lang.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 againstcode- Response code- Returns:
- true if further processing should continue, false otherwise
-
-