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
Constructors Constructor Description MessageHandlerSupport()
-
Method Summary
Modifier and Type Method Description protected TimerFacade
buildSendTimer(boolean success, String exception)
void
destroy()
String
getComponentType()
Subclasses may implement this method to provide component type information.IntegrationPatternType
getIntegrationPatternType()
Return a pattern type this component implements.String
getManagedName()
String
getManagedType()
protected MetricsCaptor
getMetricsCaptor()
int
getOrder()
IntegrationManagement.ManagementOverrides
getOverrides()
Return the overrides.boolean
isLoggingEnabled()
Return whether logging is enabled.void
registerMetricsCaptor(MetricsCaptor metricsCaptorToRegister)
Inject aMetricsCaptor
protected TimerFacade
sendTimer()
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
shouldTrack()
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
- dalse to disable.
-
registerMetricsCaptor
Description copied from interface:IntegrationManagement
Inject aMetricsCaptor
- Specified by:
registerMetricsCaptor
in interfaceIntegrationManagement
- Parameters:
metricsCaptorToRegister
- the captor.
-
getMetricsCaptor
-
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
-