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
MessagingException
s.- 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, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected TimerFacade
buildSendTimer
(boolean success, String exception) void
destroy()
Subclasses may implement this method to provide component type information.Return a pattern type this component implements.protected MetricsCaptor
protected io.micrometer.observation.ObservationRegistry
int
getOrder()
Return the overrides.boolean
Return whether logging is enabled.boolean
True if this implementation is going to deal with a registry other than theObservationRegistry.NOOP
instance.void
registerMetricsCaptor
(MetricsCaptor metricsCaptorToRegister) Inject aMetricsCaptor
.void
registerObservationRegistry
(io.micrometer.observation.ObservationRegistry observationRegistry) Inject anObservationRegistry
.protected TimerFacade
void
setLoggingEnabled
(boolean loggingEnabled) Enable logging or not.void
setManagedName
(String managedName) void
setManagedType
(String managedType) void
setOrder
(int order) Set the order for this component.void
setShouldTrack
(boolean shouldTrack) protected boolean
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, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs
Methods 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:IntegrationManagement
Return whether logging is enabled.- Specified by:
isLoggingEnabled
in interfaceIntegrationManagement
- Returns:
- true if enabled.
-
setLoggingEnabled
public void setLoggingEnabled(boolean loggingEnabled) Description copied from interface:IntegrationManagement
Enable logging or not.- Specified by:
setLoggingEnabled
in interfaceIntegrationManagement
- Parameters:
loggingEnabled
- false to disable.
-
registerMetricsCaptor
Description copied from interface:IntegrationManagement
Inject aMetricsCaptor
. Ignored ifObservationRegistry
is provided.- Specified by:
registerMetricsCaptor
in interfaceIntegrationManagement
- Parameters:
metricsCaptorToRegister
- the captor.- See Also:
-
getMetricsCaptor
-
registerObservationRegistry
public void registerObservationRegistry(io.micrometer.observation.ObservationRegistry observationRegistry) Description copied from interface:IntegrationManagement
Inject anObservationRegistry
. If provided, theMetricsCaptor
is ignored. The meters capturing has to be configured as anObservationHandler
on the providedObservationRegistry
.- Specified by:
registerObservationRegistry
in interfaceIntegrationManagement
- Parameters:
observationRegistry
- theObservationRegistry
to expose observations from the component.- See Also:
-
isObserved
public boolean isObserved()Description copied from interface:IntegrationManagement
True if this implementation is going to deal with a registry other than theObservationRegistry.NOOP
instance.- Specified by:
isObserved
in interfaceIntegrationManagement
- Returns:
- true if this implementation is going to deal with a registry other than the
ObservationRegistry.NOOP
instance.
-
getObservationRegistry
protected io.micrometer.observation.ObservationRegistry getObservationRegistry() -
setOrder
public void setOrder(int order) Description copied from interface:Orderable
Set the order for this component. -
getOrder
public int getOrder() -
getComponentType
Description copied from class:IntegrationObjectSupport
Subclasses may implement this method to provide component type information.- Specified by:
getComponentType
in interfaceNamedComponent
- Overrides:
getComponentType
in classIntegrationObjectSupport
-
setShouldTrack
public void setShouldTrack(boolean shouldTrack) - Specified by:
setShouldTrack
in interfaceTrackableComponent
-
shouldTrack
protected boolean shouldTrack() -
getOverrides
Description copied from interface:IntegrationManagement
Return the overrides.- Specified by:
getOverrides
in interfaceIntegrationManagement
- Returns:
- the overrides.
-
getIntegrationPatternType
Description copied from interface:IntegrationPattern
Return a pattern type this component implements.- Specified by:
getIntegrationPatternType
in interfaceIntegrationPattern
- Returns:
- the
IntegrationPatternType
this component implements.
-
sendTimer
-
buildSendTimer
-
setManagedName
- Specified by:
setManagedName
in interfaceIntegrationManagement
-
getManagedName
- Specified by:
getManagedName
in interfaceIntegrationManagement
-
setManagedType
- Specified by:
setManagedType
in interfaceIntegrationManagement
-
getManagedType
- Specified by:
getManagedType
in interfaceIntegrationManagement
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDisposableBean
- Specified by:
destroy
in interfaceIntegrationManagement
-