com.ca.jcs.processor
Class RetryOpProcessorProxy

java.lang.Object
  extended by com.ca.jcs.processor.ConnectorProcessorProxyHandler
      extended by com.ca.jcs.processor.RetryOpProcessorProxy
All Implemented Interfaces:
InvocationHandler

public class RetryOpProcessorProxy
extends ConnectorProcessorProxyHandler

This proxy that can wrap any of a connectors processors (attribute-style/method-style etc) and provide resilient retrying when transient connection-related failures (aka "soft failures") are encountered, based on the retryGroupMap configured on a connector's ConnectorConfig JavaBean (usually configured from /conf/connector.xml using Spring XML). Connector implementations can also force an exception to be handled as retriable by throwing LdapServiceUnavailableException with a result code of ResultCodeEnum.UNAVAILABLE). This class also handles:

  1. Retrying as dictated by entries in configured retryGroupMap, e.g. normal transient failures, stale connections dealing with transient "too busy" state.
  2. In the event of a retry sequence failing without connection being reestablished, the connector's connection manager is cleared so that new connections will be created for future use as required.
  3. If caching is active in OpProcessor then this proxy also handles retrying in the case where a cached connector DN has become stale and we need to determine what the real DN is (if it still exists at all) and retry with it.


Field Summary
 Pattern CONNECTION_CLOSED
          Matches ".
static String RETRY_OP_PROCESSOR_PROXY
          This tag is to specify an entry in "exceptionRetryMap" in connector.xml is related to retry behaviour.
static String STALE_CONNECTION_EXCEPTION_MESSAGES_KEY
          Optional key in ConnectorConfig.getExceptionRetryMap() which can be used to provide extra strings to be searched for in exception messages, which signify stale connections
 
Constructor Summary
RetryOpProcessorProxy(Connector connector, AttributeStyleOpProcessor proc)
           
RetryOpProcessorProxy(Connector connector, MethodStyleOpProcessor proc)
           
 
Method Summary
 Object invoke(Object proxy, Method method, Object[] args)
          Invoke methods on a wrapped processor object, handling automatic retrying in the event of configured transient failures.
 
Methods inherited from class com.ca.jcs.processor.ConnectorProcessorProxyHandler
createAttributeStyleOpProcessorProxy, createMethodStyleOpProcessorProxy, createScriptStyleOpProcessorProxy, getConnector, getOperation, getTarget, getTargetAttributeStyleOpProcessor, getTargetMethodStyleOpProcessor, getTargetScriptStyleOpProcessor, logError, proxyToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STALE_CONNECTION_EXCEPTION_MESSAGES_KEY

public static final String STALE_CONNECTION_EXCEPTION_MESSAGES_KEY
Optional key in ConnectorConfig.getExceptionRetryMap() which can be used to provide extra strings to be searched for in exception messages, which signify stale connections

See Also:
Constant Field Values

CONNECTION_CLOSED

public final Pattern CONNECTION_CLOSED
Matches ".*connection closed.*" in an excpetion message, ignoring case.


RETRY_OP_PROCESSOR_PROXY

public static final String RETRY_OP_PROCESSOR_PROXY
This tag is to specify an entry in "exceptionRetryMap" in connector.xml is related to retry behaviour.

See Also:
Constant Field Values
Constructor Detail

RetryOpProcessorProxy

public RetryOpProcessorProxy(Connector connector,
                             AttributeStyleOpProcessor proc)

RetryOpProcessorProxy

public RetryOpProcessorProxy(Connector connector,
                             MethodStyleOpProcessor proc)
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Invoke methods on a wrapped processor object, handling automatic retrying in the event of configured transient failures.

Specified by:
invoke in interface InvocationHandler
Specified by:
invoke in class ConnectorProcessorProxyHandler
Throws:
Throwable


Created 2011-07-14 13:27 EST