Class MessageHandlerSupport
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
- All Implemented Interfaces:
Aware,BeanFactoryAware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,Ordered,ExpressionCapable,Orderable,IntegrationPattern,NamedComponent,IntegrationManagement,TrackableComponent
- Direct Known Subclasses:
AbstractMessageHandler,AbstractReactiveMessageHandler
@IntegrationManagedResource
public abstract class MessageHandlerSupport
extends IntegrationObjectSupport
implements TrackableComponent, Orderable, IntegrationManagement, IntegrationPattern
Base class for Message handling components that provides basic validation and error
handling capabilities. Asserts that the incoming Message is not null and that it does
not contain a null payload. Converts checked exceptions into runtime
MessagingExceptions.- Since:
- 5.3
- Author:
- Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan, Amit Sadafule, David Turanski
-
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.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.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected TimerFacadebuildSendTimer(boolean success, String exception) voiddestroy()Subclasses may implement this method to provide component type information.Return a pattern type this component implements.protected MetricsCaptorprotected io.micrometer.observation.ObservationRegistryintgetOrder()Return the overrides.booleanReturn whether logging is enabled.booleanTrue if this implementation is going to deal with a registry other than theObservationRegistry.NOOPinstance.voidregisterMetricsCaptor(MetricsCaptor metricsCaptorToRegister) Inject aMetricsCaptor.voidregisterObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Inject anObservationRegistry.protected TimerFacadevoidsetLoggingEnabled(boolean loggingEnabled) Enable logging or not.voidsetManagedName(String managedName) voidsetManagedType(String managedType) voidsetOrder(int order) Set the order for this component.voidsetShouldTrack(boolean shouldTrack) protected booleanMethods 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, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, 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
-
MessageHandlerSupport
public MessageHandlerSupport()
-
-
Method Details
-
isLoggingEnabled
public boolean isLoggingEnabled()Description copied from interface:IntegrationManagementReturn whether logging is enabled.- Specified by:
isLoggingEnabledin interfaceIntegrationManagement- Returns:
- true if enabled.
-
setLoggingEnabled
public void setLoggingEnabled(boolean loggingEnabled) Description copied from interface:IntegrationManagementEnable logging or not.- Specified by:
setLoggingEnabledin interfaceIntegrationManagement- Parameters:
loggingEnabled- false to disable.
-
registerMetricsCaptor
Description copied from interface:IntegrationManagementInject aMetricsCaptor. Ignored ifObservationRegistryis provided.- Specified by:
registerMetricsCaptorin interfaceIntegrationManagement- Parameters:
metricsCaptorToRegister- the captor.- See Also:
-
getMetricsCaptor
-
registerObservationRegistry
public void registerObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Description copied from interface:IntegrationManagementInject anObservationRegistry. If provided, theMetricsCaptoris ignored. The meters capturing has to be configured as anObservationHandleron the providedObservationRegistry.- Specified by:
registerObservationRegistryin interfaceIntegrationManagement- Parameters:
observationRegistry- theObservationRegistryto expose observations from the component.- See Also:
-
isObserved
public boolean isObserved()Description copied from interface:IntegrationManagementTrue if this implementation is going to deal with a registry other than theObservationRegistry.NOOPinstance.- Specified by:
isObservedin interfaceIntegrationManagement- Returns:
- true if this implementation is going to deal with a registry other than the
ObservationRegistry.NOOPinstance.
-
getObservationRegistry
protected io.micrometer.observation.ObservationRegistry getObservationRegistry() -
setOrder
public void setOrder(int order) Description copied from interface:OrderableSet the order for this component. -
getOrder
public int getOrder() -
getComponentType
Description copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
getComponentTypein interfaceNamedComponent- Overrides:
getComponentTypein classIntegrationObjectSupport
-
setShouldTrack
public void setShouldTrack(boolean shouldTrack) - Specified by:
setShouldTrackin interfaceTrackableComponent
-
shouldTrack
protected boolean shouldTrack() -
getOverrides
Description copied from interface:IntegrationManagementReturn the overrides.- Specified by:
getOverridesin interfaceIntegrationManagement- Returns:
- the overrides.
-
getIntegrationPatternType
Description copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
getIntegrationPatternTypein interfaceIntegrationPattern- Returns:
- the
IntegrationPatternTypethis component implements.
-
sendTimer
-
buildSendTimer
-
setManagedName
- Specified by:
setManagedNamein interfaceIntegrationManagement
-
getManagedName
- Specified by:
getManagedNamein interfaceIntegrationManagement
-
setManagedType
- Specified by:
setManagedTypein interfaceIntegrationManagement
-
getManagedType
- Specified by:
getManagedTypein interfaceIntegrationManagement
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean- Specified by:
destroyin interfaceIntegrationManagement
-