IQ_RETRYUTIL_MAX_RETRIES_PROPNAME
System property to control the number of retries when attempting to retrieve members from an
AssociationList that is being modified.
IQ_RETRYUTIL_WAIT_MS_PROPNAME
System property to control the number of milliseconds to wait between attempts to retrieve members
from an AssociationList that is being modified.
tryAction(RetryUtil.Actor<T> actor)
Performs the action() of the Actor object and returns the value from that method
for either 10 attempts or for the value of the system property "IQ.RetryUtil.MaxRetries".
static
<T> T
tryAction(RetryUtil.Actor<T> actor,
org.apache.log4j.Logger logger)
Performs the action() of the Actor object and returns the value from that method
for either 10 attempts or for the value of the system property "IQ.RetryUtil.MaxRetries".
static
<T> T
tryAction(RetryUtil.Actor<T> actor,
long maxRetries,
long retryWaitMs,
org.apache.log4j.Logger logger)
Performs the action() of the Actor object and returns the value from that method.
Field Detail
IQ_RETRYUTIL_WAIT_MS_PROPNAME
public static final java.lang.StringIQ_RETRYUTIL_WAIT_MS_PROPNAME
System property to control the number of milliseconds to wait between attempts to retrieve members
from an AssociationList that is being modified. A value of 0 or greater will cause the retrieving
thread to execute a Thread.sleep(milliseconds) between attempts and any interrupts
recieved during that sleep will cause the most recent retry failure to be thrown.
Default value for IQ.RetryUtil.RetryWaitMs is 10 milliseconds wait between attempts.
IQ_RETRYUTIL_MAX_RETRIES_PROPNAME
public static final java.lang.StringIQ_RETRYUTIL_MAX_RETRIES_PROPNAME
System property to control the number of retries when attempting to retrieve members from an
AssociationList that is being modified. A value less than 1 will not retry and will throw
the first java.util.ConcurrentModificationException encountered (if any).
Performs the action() of the Actor object and returns the value from that method
for either 10 attempts or for the value of the system property "IQ.RetryUtil.MaxRetries".
If that property is set to less than 1, then no retries will be made.
Parameters:
actor -
logger - logger to use for log messages, if null then no logging will be done.
Returns:
result from the Actor.action() call.
Throws:
RetryUtil.ActionFailed - if the action and retries fail, its getCause() should return any exception responsible.
Performs the action() of the Actor object and returns the value from that method
for either 10 attempts or for the value of the system property "IQ.RetryUtil.MaxRetries".
If that property is set to less than 1, then no retries will be made.
By default, this method writes log messages to the IQ.RetryUtil.Logging context.
Parameters:
actor -
Returns:
result from the Actor.action() call.
Throws:
RetryUtil.ActionFailed - if the action and retries fail, its getCause() should return any exception responsible.
tryAction
public static <T> T tryAction(RetryUtil.Actor<T> actor,
long maxRetries,
long retryWaitMs,
org.apache.log4j.Logger logger)
throws RetryUtil.ActionFailed
Performs the action() of the Actor object and returns the value from that method.
If the retry value is set to less than 1, then no retries will be made.
Parameters:
actor -
maxRetries - maximum number of retries after the first attempt (<1 means no retries).
retryWaitMs - maximum time to wait between attempts in milliseconds (<0 means do not pause the thread).
logger - null if no logger messages should be output.
Returns:
result from the Actor.action() call.
Throws:
RetryUtil.ActionFailed - if the action and retries fail, its getCause() should return any exception responsible.