Class JmsInboundGateway
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.jms.JmsInboundGateway
- All Implemented Interfaces:
Aware,BeanFactoryAware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,Lifecycle,Phased,SmartLifecycle,ExpressionCapable,OrderlyShutdownCapable,IntegrationPattern,NamedComponent,IntegrationInboundManagement,IntegrationManagement,ManageableLifecycle,ManageableSmartLifecycle,TrackableComponent
A wrapper around the
JmsMessageDrivenEndpoint implementing
MessagingGatewaySupport.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
messagingTemplateFields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLockFields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionJmsInboundGateway(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener) -
Method Summary
Modifier and TypeMethodDescriptionintCalled after normal shutdown of schedulers, executors etc, and after the shutdown delay has elapsed, but before any forced shutdown of any remaining active scheduler/executor threads.Can optionally return the number of active messages still in process.intCalled before shutdown begins.voiddestroy()protected voiddoStart()Subclasses must implement this method with the start behavior.protected voiddoStop()Subclasses must implement this method with the stop behavior.Subclasses may implement this method to provide component type information.protected voidonInit()Subclasses may implement this for initialization logic.voidsetApplicationContext(ApplicationContext applicationContext) voidsetComponentName(String componentName) Sets the name of this component.voidsetErrorChannel(MessageChannel errorChannel) Set the error channel.voidsetErrorChannelName(String errorChannelName) Set the error channel name.voidsetErrorOnTimeout(boolean errorOnTimeout) If errorOnTimeout is true, construct an instance that will send anErrorMessagewith aMessageTimeoutExceptionpayload to the error channel if a reply is expected but none is received.voidsetReplyChannel(MessageChannel replyChannel) Set the reply channel.voidsetReplyChannelName(String replyChannelName) Set the reply channel name.voidsetReplyTimeout(long replyTimeout) Set the timeout value for receiving reply messages.voidsetRequestChannel(MessageChannel requestChannel) Set the request channel.voidsetRequestChannelName(String requestChannelName) Set the request channel name.voidsetRequestTimeout(long requestTimeout) Set the timeout value for sending request messages.voidsetShouldTrack(boolean shouldTrack) Specify whether this gateway should be tracked in the Message History of Messages that originate from its send or sendAndReceive operations.voidsetShutdownContainerOnStop(boolean shutdownContainerOnStop) Set to false to prevent listener container shutdown when the endpoint is stopped.Methods inherited from class org.springframework.integration.gateway.MessagingGatewaySupport
buildErrorMessage, buildSendTimer, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, isLoggingEnabled, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorMessageStrategy, setLoggingEnabled, setManagedName, setManagedType, setReplyMapper, setRequestMapperMethods 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, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
JmsInboundGateway
public JmsInboundGateway(AbstractMessageListenerContainer listenerContainer, ChannelPublishingJmsMessageListener listener)
-
-
Method Details
-
setRequestChannel
Description copied from class:MessagingGatewaySupportSet the request channel.- Overrides:
setRequestChannelin classMessagingGatewaySupport- Parameters:
requestChannel- the channel to which request messages will be sent
-
setRequestChannelName
Description copied from class:MessagingGatewaySupportSet the request channel name.- Overrides:
setRequestChannelNamein classMessagingGatewaySupport- Parameters:
requestChannelName- the channel bean name to which request messages will be sent
-
setReplyChannel
Description copied from class:MessagingGatewaySupportSet the reply channel. If no reply channel is provided, this gateway will always use an anonymous, temporary channel for handling replies.- Overrides:
setReplyChannelin classMessagingGatewaySupport- Parameters:
replyChannel- the channel from which reply messages will be received
-
setReplyChannelName
Description copied from class:MessagingGatewaySupportSet the reply channel name. If no reply channel is provided, this gateway will always use an anonymous, temporary channel for handling replies.- Overrides:
setReplyChannelNamein classMessagingGatewaySupport- Parameters:
replyChannelName- the channel bean name from which reply messages will be received
-
setErrorChannel
Description copied from class:MessagingGatewaySupportSet the error channel. If no error channel is provided, this gateway will propagate Exceptions to the caller. To completely suppress Exceptions, provide a reference to the "nullChannel" here.- Overrides:
setErrorChannelin classMessagingGatewaySupport- Parameters:
errorChannel- The error channel.
-
setErrorChannelName
Description copied from class:MessagingGatewaySupportSet the error channel name. If no error channel is provided, this gateway will propagate Exceptions to the caller. To completely suppress Exceptions, provide a reference to the "nullChannel" here.- Overrides:
setErrorChannelNamein classMessagingGatewaySupport- Parameters:
errorChannelName- The error channel bean name.
-
setRequestTimeout
public void setRequestTimeout(long requestTimeout) Description copied from class:MessagingGatewaySupportSet the timeout value for sending request messages. If not explicitly configured, the default is one second.- Overrides:
setRequestTimeoutin classMessagingGatewaySupport- Parameters:
requestTimeout- the timeout value in milliseconds
-
setReplyTimeout
public void setReplyTimeout(long replyTimeout) Description copied from class:MessagingGatewaySupportSet the timeout value for receiving reply messages. If not explicitly configured, the default is one second.- Overrides:
setReplyTimeoutin classMessagingGatewaySupport- Parameters:
replyTimeout- the timeout value in milliseconds
-
setErrorOnTimeout
public void setErrorOnTimeout(boolean errorOnTimeout) Description copied from class:MessagingGatewaySupportIf errorOnTimeout is true, construct an instance that will send anErrorMessagewith aMessageTimeoutExceptionpayload to the error channel if a reply is expected but none is received. If no error channel is configured, theMessageTimeoutExceptionwill be thrown.- Overrides:
setErrorOnTimeoutin classMessagingGatewaySupport- Parameters:
errorOnTimeout- true to create the error message on reply timeout.
-
setShouldTrack
public void setShouldTrack(boolean shouldTrack) Description copied from class:MessagingGatewaySupportSpecify whether this gateway should be tracked in the Message History of Messages that originate from its send or sendAndReceive operations.- Specified by:
setShouldTrackin interfaceTrackableComponent- Overrides:
setShouldTrackin classMessagingGatewaySupport
-
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
-
getComponentType
Description copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
getComponentTypein interfaceNamedComponent- Overrides:
getComponentTypein classMessagingGatewaySupport
-
setComponentName
Description copied from class:IntegrationObjectSupportSets the name of this component.- Overrides:
setComponentNamein classIntegrationObjectSupport- Parameters:
componentName- The component name.
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware- Overrides:
setApplicationContextin classIntegrationObjectSupport- Throws:
BeansException
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
onInitin classMessagingGatewaySupport
-
getListener
-
doStart
protected void doStart()Description copied from class:AbstractEndpointSubclasses must implement this method with the start behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
doStartin classMessagingGatewaySupport
-
doStop
protected void doStop()Description copied from class:AbstractEndpointSubclasses must implement this method with the stop behavior. This method will be invoked while holding theAbstractEndpoint.lifecycleLock.- Overrides:
doStopin classMessagingGatewaySupport
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean- Specified by:
destroyin interfaceIntegrationManagement- Overrides:
destroyin classMessagingGatewaySupport
-
beforeShutdown
public int beforeShutdown()Description copied from interface:OrderlyShutdownCapableCalled before shutdown begins. Implementations should stop accepting new messages. Can optionally return the number of active messages in process.- Specified by:
beforeShutdownin interfaceOrderlyShutdownCapable- Returns:
- The number of active messages if available.
-
afterShutdown
public int afterShutdown()Description copied from interface:OrderlyShutdownCapableCalled after normal shutdown of schedulers, executors etc, and after the shutdown delay has elapsed, but before any forced shutdown of any remaining active scheduler/executor threads.Can optionally return the number of active messages still in process.- Specified by:
afterShutdownin interfaceOrderlyShutdownCapable- Returns:
- The number of active messages if available.
-