Class JmsMessageDrivenEndpoint
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.jms.JmsMessageDrivenEndpoint
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.beans.factory.SmartInitializingSingleton
,org.springframework.context.ApplicationContextAware
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
,org.springframework.integration.context.ExpressionCapable
,org.springframework.integration.context.OrderlyShutdownCapable
,org.springframework.integration.core.MessageProducer
,org.springframework.integration.IntegrationPattern
,org.springframework.integration.support.context.NamedComponent
,org.springframework.integration.support.management.ManageableLifecycle
,org.springframework.integration.support.management.ManageableSmartLifecycle
,org.springframework.integration.support.management.TrackableComponent
public class JmsMessageDrivenEndpoint
extends org.springframework.integration.endpoint.MessageProducerSupport
implements org.springframework.integration.context.OrderlyShutdownCapable
A message-driven endpoint that receive JMS messages, converts them into
Spring Integration Messages, and then sends the result to a channel.
-
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLock
-
Constructor Summary
Constructors Constructor Description JmsMessageDrivenEndpoint(org.springframework.jms.listener.AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener)
Construct an instance with an externally configured container. -
Method Summary
Modifier and Type Method Description int
afterShutdown()
void
afterSingletonsInstantiated()
int
beforeShutdown()
void
destroy()
protected void
doStart()
protected void
doStop()
java.lang.String
getComponentType()
ChannelPublishingJmsMessageListener
getListener()
protected void
onInit()
void
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
void
setErrorChannel(org.springframework.messaging.MessageChannel errorChannel)
void
setErrorChannelName(java.lang.String errorChannelName)
void
setOutputChannel(org.springframework.messaging.MessageChannel outputChannel)
void
setOutputChannelName(java.lang.String outputChannelName)
void
setSendTimeout(long sendTimeout)
void
setSessionAcknowledgeMode(java.lang.String sessionAcknowledgeMode)
Set the session acknowledge mode on the listener container.void
setShouldTrack(boolean shouldTrack)
void
setShutdownContainerOnStop(boolean shutdownContainerOnStop)
Set to false to prevent listener container shutdown when the endpoint is stopped.Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorMessageStrategy, subscribeToPublisher
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
JmsMessageDrivenEndpoint
public JmsMessageDrivenEndpoint(org.springframework.jms.listener.AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener)Construct an instance with an externally configured container.- Parameters:
listenerContainer
- the container.listener
- the listener.
-
-
Method Details
-
setSessionAcknowledgeMode
public void setSessionAcknowledgeMode(java.lang.String sessionAcknowledgeMode)Set the session acknowledge mode on the listener container. It will override the container setting even if an external container is provided. Defaults to null (won't change container) if an external container is provided or `transacted` when the framework creates an implicitDefaultMessageListenerContainer
.- Parameters:
sessionAcknowledgeMode
- the acknowledge mode.
-
setOutputChannel
public void setOutputChannel(org.springframework.messaging.MessageChannel outputChannel)- Specified by:
setOutputChannel
in interfaceorg.springframework.integration.core.MessageProducer
- Overrides:
setOutputChannel
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
setOutputChannelName
public void setOutputChannelName(java.lang.String outputChannelName)- Specified by:
setOutputChannelName
in interfaceorg.springframework.integration.core.MessageProducer
- Overrides:
setOutputChannelName
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
setErrorChannel
public void setErrorChannel(org.springframework.messaging.MessageChannel errorChannel)- Overrides:
setErrorChannel
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
setErrorChannelName
public void setErrorChannelName(java.lang.String errorChannelName)- Overrides:
setErrorChannelName
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
setSendTimeout
public void setSendTimeout(long sendTimeout)- Overrides:
setSendTimeout
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
setShouldTrack
public void setShouldTrack(boolean shouldTrack)- Specified by:
setShouldTrack
in interfaceorg.springframework.integration.support.management.TrackableComponent
- Overrides:
setShouldTrack
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
setShutdownContainerOnStop
public void setShutdownContainerOnStop(boolean shutdownContainerOnStop)Set to false to prevent listener container shutdown when the endpoint is stopped. Then, if so configured, any cached consumer(s) in the container will remain. Otherwise the shared connection and will be closed and the listener invokers shut down; this behavior is new starting with version 5.1. Default: true.- Parameters:
shutdownContainerOnStop
- false to not shutdown.- Since:
- 5.1
-
getListener
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Overrides:
setApplicationContext
in classorg.springframework.integration.context.IntegrationObjectSupport
- Throws:
org.springframework.beans.BeansException
-
getComponentType
public java.lang.String getComponentType()- Specified by:
getComponentType
in interfaceorg.springframework.integration.support.context.NamedComponent
- Overrides:
getComponentType
in classorg.springframework.integration.context.IntegrationObjectSupport
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiated
in interfaceorg.springframework.beans.factory.SmartInitializingSingleton
- Overrides:
afterSingletonsInstantiated
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
onInit
protected void onInit()- Overrides:
onInit
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStart
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStop
protected void doStop()- Overrides:
doStop
in classorg.springframework.integration.endpoint.MessageProducerSupport
-
destroy
public void destroy()- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Overrides:
destroy
in classorg.springframework.integration.endpoint.AbstractEndpoint
-
beforeShutdown
public int beforeShutdown()- Specified by:
beforeShutdown
in interfaceorg.springframework.integration.context.OrderlyShutdownCapable
-
afterShutdown
public int afterShutdown()- Specified by:
afterShutdown
in interfaceorg.springframework.integration.context.OrderlyShutdownCapable
-