Class ActiveJmsConnectionErrorHandler
- java.lang.Object
-
- com.adaptris.core.ConnectionErrorHandlerImp
-
- com.adaptris.core.jms.JmsConnectionErrorHandlerImpl
-
- com.adaptris.core.jms.ActiveJmsConnectionErrorHandler
-
- All Implemented Interfaces:
ComponentLifecycle
,ConnectionErrorHandler
public class ActiveJmsConnectionErrorHandler extends JmsConnectionErrorHandlerImpl
ConnectionErrorHandler
implementation that actively attempts messages via JMS to detect outages.Implementation of
ConnectionErrorHandler
which tests the connection everygetCheckInterval()
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ActiveJmsConnectionErrorHandler.JmsConnectionVerifier
protected class
ActiveJmsConnectionErrorHandler.JmsTemporaryDestination
-
Field Summary
-
Fields inherited from class com.adaptris.core.jms.JmsConnectionErrorHandlerImpl
idForLogging
-
Fields inherited from class com.adaptris.core.ConnectionErrorHandlerImp
log
-
-
Constructor Summary
Constructors Constructor Description ActiveJmsConnectionErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
additionalLogging()
void
close()
Closes the component.java.lang.Boolean
getAdditionalLogging()
TimeInterval
getCheckInterval()
void
init()
Initialises the component.long
retryInterval()
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 verivoid
start()
Starts the component.void
stop()
Stop the component-
Methods inherited from class com.adaptris.core.jms.JmsConnectionErrorHandlerImpl
allowedInConjunctionWith, equals, handleConnectionException, hashCode
-
Methods inherited from class com.adaptris.core.ConnectionErrorHandlerImp
getRegisteredChannels, registerConnection, restartAffectedComponents, retrieveConnection, retryWaitTimeMs
-
-
-
-
Method Detail
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Overrides:
init
in classJmsConnectionErrorHandlerImpl
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences
-
getAdditionalLogging
public java.lang.Boolean getAdditionalLogging()
-
setAdditionalLogging
public void setAdditionalLogging(java.lang.Boolean b)
Whether or not to log each attempt at verifying the connection.- Parameters:
b
- true to enable trace logging of every attempt to verify the connection status, default is null (false)
-
additionalLogging
public boolean additionalLogging()
-
retryInterval
public long retryInterval()
-
getCheckInterval
public TimeInterval getCheckInterval()
-
setCheckInterval
public void setCheckInterval(TimeInterval checkInterval)
Set interval between each attempt to veri- Parameters:
checkInterval
- the retry interval, if <=0 then the default is assumed (5 seconds).
-
-