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
Fields Modifier and Type Field Description protected int
maxRetries
protected int
retryDelay
protected int
successInterval
-
Constructor Summary
Constructors Constructor Description DefaultConnectionListenerFailureHandler()
Create a new DefaultConnectionListenerFailureHandler with default settings.DefaultConnectionListenerFailureHandler(int retryDelay, int successInterval, int maxRetries)
Create a new DefaultConnectionListenerFailureHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
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 Detail
-
failed
public 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. May subclass and override this method to change the behavior.- Specified by:
failed
in 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:
notifyAbnormalTermination
in interfaceConnectionListenerFailureHandler
- Parameters:
connectionListener
- the associated connection listenermessage
- explanation of terminationcause
- last exception that is causing termination
-
-