public class ActiveJmsConnectionErrorHandler extends JmsConnectionErrorHandlerImpl
ConnectionErrorHandler
implementation that actively attempts messages via JMS to detect outages.
Implementation of ConnectionErrorHandler
which tests the connection every getCheckInterval()
interval (default
is 5 second) and if the test fails then restarts the Connection's owner and stops the testing thread.
In the adapter configuration file this class is aliased as active-jms-connection-error-handler which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
protected class |
ActiveJmsConnectionErrorHandler.JmsConnectionVerifier |
protected class |
ActiveJmsConnectionErrorHandler.JmsTemporaryDestination |
idForLogging
log
Constructor and Description |
---|
ActiveJmsConnectionErrorHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
additionalLogging() |
void |
close()
Closes the component.
|
java.lang.Boolean |
getAdditionalLogging() |
TimeInterval |
getCheckInterval() |
void |
init()
Initialises the component.
|
void |
setAdditionalLogging(java.lang.Boolean b)
Whether or not to log each attempt at verifying the connection.
|
void |
setCheckInterval(TimeInterval checkInterval)
Set interval between each attempt to veri
|
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
allowedInConjunctionWith, equals, handleConnectionException, hashCode
getRegisteredChannels, registerConnection, restartAffectedComponents, retrieveConnection, retryWaitTimeMs
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
init
in class JmsConnectionErrorHandlerImpl
CoreException
- wrapping any underlying Exception
spublic void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
public java.lang.Boolean getAdditionalLogging()
public void setAdditionalLogging(java.lang.Boolean b)
b
- true to enable trace logging of every attempt to verify the connection status, default is null (false)public boolean additionalLogging()
public TimeInterval getCheckInterval()
public void setCheckInterval(TimeInterval checkInterval)
checkInterval
- the retry interval, if <=0 then the default is assumed (5 seconds).