org.springframework.extensions.webscripts.connector
Class EndpointManager

java.lang.Object
  extended by 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 shared endpoints are not repeatedly connected to or waited on.

Author:
Kevin Roast

Method Summary
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 registerEndpoint(String endpoint)
          Register an endpoint with the manager - the same endpoint can be registered any number of times with side effects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerEndpoint

public static void registerEndpoint(String endpoint)
Register an endpoint with the manager - the same endpoint can be registered any number of times with side effects.

Parameters:
endpoint - The endpoint to register

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


Copyright © 2009 SpringSource, Inc. All Rights Reserved.