Package net.solarnetwork.central.web
Class BaseTransientDataAccessRetryController
java.lang.Object
net.solarnetwork.central.web.BaseTransientDataAccessRetryController
Support for transient data access exception retry handling.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThetransientExceptionRetryCountproperty default value.static final longThetransientExceptionRetryDelayproperty default value.protected final org.slf4j.LoggerA class-level logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intGet the number of retry attempts for transient DAO exceptions.final longGet the length of time, in milliseconds, to sleep before retrying a request after a transient exception.final voidsetTransientExceptionRetryCount(int transientExceptionRetryCount) Set the number of retry attempts for transient DAO exceptions.final voidsetTransientExceptionRetryDelay(long transientExceptionRetryDelay) Set the length of time, in milliseconds, to sleep before retrying a request after a transient exception.
-
Field Details
-
DEFAULT_TRANSIENT_EXCEPTION_RETRY_COUNT
public static final int DEFAULT_TRANSIENT_EXCEPTION_RETRY_COUNTThetransientExceptionRetryCountproperty default value.- See Also:
-
DEFAULT_TRANSIENT_EXCEPTION_RETRY_DELAY
public static final long DEFAULT_TRANSIENT_EXCEPTION_RETRY_DELAYThetransientExceptionRetryDelayproperty default value.- See Also:
-
log
protected final org.slf4j.Logger logA class-level logger.
-
-
Constructor Details
-
BaseTransientDataAccessRetryController
public BaseTransientDataAccessRetryController()
-
-
Method Details
-
getTransientExceptionRetryCount
public final int getTransientExceptionRetryCount()Get the number of retry attempts for transient DAO exceptions.- Returns:
- the retry count; defaults to
DEFAULT_TRANSIENT_EXCEPTION_RETRY_COUNT.
-
setTransientExceptionRetryCount
public final void setTransientExceptionRetryCount(int transientExceptionRetryCount) Set the number of retry attempts for transient DAO exceptions.- Parameters:
transientExceptionRetryCount- the retry count, or 0 for no retries
-
getTransientExceptionRetryDelay
public final long getTransientExceptionRetryDelay()Get the length of time, in milliseconds, to sleep before retrying a request after a transient exception.- Returns:
- the delay, in milliseconds; defaults to
DEFAULT_TRANSIENT_EXCEPTION_RETRY_DELAY
-
setTransientExceptionRetryDelay
public final void setTransientExceptionRetryDelay(long transientExceptionRetryDelay) Set the length of time, in milliseconds, to sleep before retrying a request after a transient exception.- Parameters:
transientExceptionRetryDelay- the delay to set
-