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 intafterShutdown()voidafterSingletonsInstantiated()intbeforeShutdown()voiddestroy()protected voiddoStart()protected voiddoStop()java.lang.StringgetComponentType()ChannelPublishingJmsMessageListenergetListener()protected voidonInit()voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetErrorChannel(org.springframework.messaging.MessageChannel errorChannel)voidsetErrorChannelName(java.lang.String errorChannelName)voidsetOutputChannel(org.springframework.messaging.MessageChannel outputChannel)voidsetOutputChannelName(java.lang.String outputChannelName)voidsetSendTimeout(long sendTimeout)voidsetSessionAcknowledgeMode(java.lang.String sessionAcknowledgeMode)Set the session acknowledge mode on the listener container.voidsetShouldTrack(boolean shouldTrack)voidsetShutdownContainerOnStop(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, subscribeToPublisherMethods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopMethods 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:
setOutputChannelin interfaceorg.springframework.integration.core.MessageProducer- Overrides:
setOutputChannelin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setOutputChannelName
public void setOutputChannelName(java.lang.String outputChannelName)- Specified by:
setOutputChannelNamein interfaceorg.springframework.integration.core.MessageProducer- Overrides:
setOutputChannelNamein classorg.springframework.integration.endpoint.MessageProducerSupport
-
setErrorChannel
public void setErrorChannel(org.springframework.messaging.MessageChannel errorChannel)- Overrides:
setErrorChannelin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setErrorChannelName
public void setErrorChannelName(java.lang.String errorChannelName)- Overrides:
setErrorChannelNamein classorg.springframework.integration.endpoint.MessageProducerSupport
-
setSendTimeout
public void setSendTimeout(long sendTimeout)- Overrides:
setSendTimeoutin classorg.springframework.integration.endpoint.MessageProducerSupport
-
setShouldTrack
public void setShouldTrack(boolean shouldTrack)- Specified by:
setShouldTrackin interfaceorg.springframework.integration.support.management.TrackableComponent- Overrides:
setShouldTrackin 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Overrides:
setApplicationContextin classorg.springframework.integration.context.IntegrationObjectSupport- Throws:
org.springframework.beans.BeansException
-
getComponentType
public java.lang.String getComponentType()- Specified by:
getComponentTypein interfaceorg.springframework.integration.support.context.NamedComponent- Overrides:
getComponentTypein classorg.springframework.integration.context.IntegrationObjectSupport
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceorg.springframework.beans.factory.SmartInitializingSingleton- Overrides:
afterSingletonsInstantiatedin classorg.springframework.integration.endpoint.MessageProducerSupport
-
onInit
protected void onInit()- Overrides:
onInitin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStart
protected void doStart()- Overrides:
doStartin classorg.springframework.integration.endpoint.MessageProducerSupport
-
doStop
protected void doStop()- Overrides:
doStopin classorg.springframework.integration.endpoint.MessageProducerSupport
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Overrides:
destroyin classorg.springframework.integration.endpoint.AbstractEndpoint
-
beforeShutdown
public int beforeShutdown()- Specified by:
beforeShutdownin interfaceorg.springframework.integration.context.OrderlyShutdownCapable
-
afterShutdown
public int afterShutdown()- Specified by:
afterShutdownin interfaceorg.springframework.integration.context.OrderlyShutdownCapable
-