Class DefaultConnectionListenerFailureHandler
java.lang.Object
org.apache.axis2.transport.http.server.DefaultConnectionListenerFailureHandler
- All Implemented Interfaces:
ConnectionListenerFailureHandler
public class DefaultConnectionListenerFailureHandler
extends Object
implements ConnectionListenerFailureHandler
Default hander for failures in connection listener IOProcessors.
Supports configuration of number retries, delay per retry, and uptime interval considered a success (resets number retries to zero).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected int -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new DefaultConnectionListenerFailureHandler with default settings.DefaultConnectionListenerFailureHandler(int retryDelay, int successInterval, int maxRetries) Create a new DefaultConnectionListenerFailureHandler -
Method Summary
Modifier and TypeMethodDescriptionbooleanfailed(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.voidnotifyAbnormalTermination(IOProcessor connectionListener, String message, Throwable cause) Default bevarior is to log the error.
-
Field Details
-
retryDelay
protected int retryDelay -
successInterval
protected int successInterval -
maxRetries
protected int maxRetries
-
-
Constructor Details
-
DefaultConnectionListenerFailureHandler
public DefaultConnectionListenerFailureHandler()Create a new DefaultConnectionListenerFailureHandler with default settings. retryDelay is 1 second, successInterval is 60 seconds, maxRetries is 10 -
DefaultConnectionListenerFailureHandler
public DefaultConnectionListenerFailureHandler(int retryDelay, int successInterval, int maxRetries) Create a new DefaultConnectionListenerFailureHandler- Parameters:
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 terminate
-
-
Method Details
-
failed
Default behavior is to log a warning and attempt retry per constructor config, eventually failing with a logged error and notification. May subclass and override this method to change the behavior.- Specified by:
failedin interfaceConnectionListenerFailureHandler- Parameters:
connectionListener- the associated connection listenercause- cause of failure- Returns:
- true if the listener should attempt to re-establish itself, false if it should terminate.
-
notifyAbnormalTermination
public void notifyAbnormalTermination(IOProcessor connectionListener, String message, Throwable cause) Default bevarior is to log the error. May subclass and override this method to change behavior.- Specified by:
notifyAbnormalTerminationin interfaceConnectionListenerFailureHandler- Parameters:
connectionListener- the associated connection listenermessage- explanation of terminationcause- last exception that is causing termination
-