Class EndpointManager
java.lang.Object
org.springframework.extensions.webscripts.connector.EndpointManager
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 TypeMethodDescriptionstatic booleanallowConnect(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(String endpoint, int code) Process the given response code for an endpoint - recording if that remote connection is unavailable for a time.static voidregisterEndpoint(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(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 Details
-
registerEndpoint
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 registerdescriptor- The ConnectorDescriptor used to connect to this endpoint Used to retrieve reconnection timeout config.
-
allowConnect
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
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
-