public class DefaultConnectionListenerFailureHandler extends Object implements ConnectionListenerFailureHandler
Modifier and Type | Field and Description |
---|---|
protected int |
maxRetries |
protected int |
retryDelay |
protected int |
successInterval |
Constructor and Description |
---|
DefaultConnectionListenerFailureHandler()
Create a new DefaultConnectionListenerFailureHandler with default settings.
|
DefaultConnectionListenerFailureHandler(int retryDelay,
int successInterval,
int maxRetries)
Create a new DefaultConnectionListenerFailureHandler
|
Modifier and Type | Method and Description |
---|---|
boolean |
failed(IOProcessor connectionListener,
Throwable cause)
Default behavior is to log a warning and attempt retry per constructor config, eventually failing with a logged error and notification.
|
void |
notifyAbnormalTermination(IOProcessor connectionListener,
String message,
Throwable cause)
Default bevarior is to log the error.
|
protected int retryDelay
protected int successInterval
protected int maxRetries
public DefaultConnectionListenerFailureHandler()
public DefaultConnectionListenerFailureHandler(int retryDelay, int successInterval, int maxRetries)
retryDelay
- millis to wait before retryingsuccessInterval
- millis after which an initial or retry attempt will be deemed a success, resetting retry count to 0maxRetries
- maximum number of retries allowed without a success, after which the listener will terminatepublic boolean failed(IOProcessor connectionListener, Throwable cause)
failed
in interface ConnectionListenerFailureHandler
connectionListener
- the associated connection listenercause
- cause of failurepublic void notifyAbnormalTermination(IOProcessor connectionListener, String message, Throwable cause)
notifyAbnormalTermination
in interface ConnectionListenerFailureHandler
connectionListener
- the associated connection listenermessage
- explanation of terminationcause
- last exception that is causing terminationCopyright © 2004–2015 The Apache Software Foundation. All rights reserved.