Class JmsConnectionErrorHandler
- java.lang.Object
-
- com.adaptris.core.ConnectionErrorHandlerImp
-
- com.adaptris.core.jms.JmsConnectionErrorHandlerImpl
-
- com.adaptris.core.jms.JmsConnectionErrorHandler
-
- All Implemented Interfaces:
ComponentLifecycle
,ConnectionErrorHandler
,javax.jms.ExceptionListener
public class JmsConnectionErrorHandler extends JmsConnectionErrorHandlerImpl implements javax.jms.ExceptionListener
Standard implementation of ConnectionErrorHandler which implementsExceptionListener
.In the adapter configuration file this class is aliased as jms-connection-error-handler which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
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 JmsConnectionErrorHandler()
JmsConnectionErrorHandler(java.lang.Boolean singleExecution)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the component.java.lang.Boolean
getSingleExecution()
void
init()
Initialises the component.void
onException(javax.jms.JMSException e)
void
setSingleExecution(java.lang.Boolean b)
Ignore multiple invocations of theExceptionListener.onException(JMSException)
method.void
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.- Specified by:
start
in interfaceComponentLifecycle
- 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- Specified by:
stop
in interfaceComponentLifecycle
-
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- Specified by:
close
in interfaceComponentLifecycle
-
onException
public void onException(javax.jms.JMSException e)
- Specified by:
onException
in interfacejavax.jms.ExceptionListener
-
getSingleExecution
public java.lang.Boolean getSingleExecution()
- Returns:
- the singleExecution value.
-
setSingleExecution
public void setSingleExecution(java.lang.Boolean b)
Ignore multiple invocations of theExceptionListener.onException(JMSException)
method.There is no JMS specification guarantee that a provider will not issue multiple calls to
ExceptionListener.onException(JMSException)
in short order. In some cases this does happen, which can cause subequent problems based on timing around when the connections re-initialise themselves.- Parameters:
b
- whether or not to filter multiple executions; defaults to true if not specified.
-
-