public class IntegrationManagementConfigurer
extends java.lang.Object
implements org.springframework.beans.factory.SmartInitializingSingleton, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.config.BeanPostProcessor
IntegrationManagement
.
Configures counts, stats, logging for all (or selected) components.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MANAGEMENT_CONFIGURER_NAME |
Constructor and Description |
---|
IntegrationManagementConfigurer() |
Modifier and Type | Method and Description |
---|---|
void |
afterSingletonsInstantiated() |
MessageChannelMetrics |
getChannelMetrics(java.lang.String name) |
java.lang.String[] |
getChannelNames() |
java.lang.Boolean |
getDefaultCountsEnabled() |
java.lang.Boolean |
getDefaultStatsEnabled() |
MessageHandlerMetrics |
getHandlerMetrics(java.lang.String name) |
java.lang.String[] |
getHandlerNames() |
MessageSourceMetrics |
getSourceMetrics(java.lang.String name) |
java.lang.String[] |
getSourceNames() |
java.lang.Object |
postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanName(java.lang.String name) |
void |
setDefaultCountsEnabled(java.lang.Boolean defaultCountsEnabled)
Set whether managed components maintain message counts by default.
|
void |
setDefaultLoggingEnabled(boolean defaultLoggingEnabled)
Disable all logging in the normal message flow in framework components.
|
void |
setDefaultStatsEnabled(java.lang.Boolean defaultStatsEnabled)
Set whether managed components maintain message statistics by default.
|
void |
setEnabledCountsPatterns(java.lang.String[] enabledCountsPatterns)
Set the array of simple patterns for component names for which message counts will
be enabled (defaults to '*').
|
void |
setEnabledStatsPatterns(java.lang.String[] enabledStatsPatterns)
Set the array of simple patterns for component names for which message statistics
will be enabled (response times, rates etc), as well as counts (a positive match
here overrides
enabledCountsPatterns ,
you can't have statistics without counts). |
void |
setMetricsFactory(MetricsFactory metricsFactory)
Set a metrics factory.
|
void |
setMetricsFactoryBeanName(java.lang.String metricsFactory)
Set a metrics factory bean name.
|
public static final java.lang.String MANAGEMENT_CONFIGURER_NAME
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void setBeanName(java.lang.String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void setMetricsFactory(MetricsFactory metricsFactory)
metricsFactoryBeanName
.
Defaults to DefaultMetricsFactory
.metricsFactory
- the factory.public void setMetricsFactoryBeanName(java.lang.String metricsFactory)
metricsFactory
isn't specified.metricsFactory
- the factory.public void setEnabledCountsPatterns(java.lang.String[] enabledCountsPatterns)
enabledStatsPatterns
which is additional
functionality over simple counts. If a pattern starts with `!`, counts are disabled
for matches. For components that match multiple patterns, the first pattern wins.
Disabling counts at runtime also disables stats.enabledCountsPatterns
- the patterns.public void setEnabledStatsPatterns(java.lang.String[] enabledStatsPatterns)
enabledCountsPatterns
,
you can't have statistics without counts). (defaults to '*').
Enables statistics for those components that support statistics
(channels - when sending, message handlers, etc). This is the initial setting only,
individual components can have stats enabled/disabled at runtime. If a pattern
starts with `!`, stats (and counts) are disabled for matches. Note: this means that
'!foo' here will disable stats and counts for 'foo' even if counts are enabled for
'foo' in enabledCountsPatterns
. For
components that match multiple patterns, the first pattern wins. Enabling stats at
runtime also enables counts.enabledStatsPatterns
- the patterns.public void setDefaultCountsEnabled(java.lang.Boolean defaultCountsEnabled)
defaultCountsEnabled
- true to enable.public java.lang.Boolean getDefaultCountsEnabled()
public void setDefaultStatsEnabled(java.lang.Boolean defaultStatsEnabled)
defaultStatsEnabled
- true to enable.public java.lang.Boolean getDefaultStatsEnabled()
public void setDefaultLoggingEnabled(boolean defaultLoggingEnabled)
Exception logging (debug or otherwise) is not affected by this setting.
It has been found that in high-volume messaging environments, calls to methods such as
logger.isDebuggingEnabled()
can be quite expensive and account for an inordinate amount of CPU
time.
Set this to false to disable logging by default in all framework components that implement
IntegrationManagement
(channels, message handlers etc). This turns off logging such as
"PreSend on channel", "Received message" etc.
After the context is initialized, individual components can have their setting changed by invoking
IntegrationManagement.setLoggingEnabled(boolean)
.
defaultLoggingEnabled
- defaults to true.public void afterSingletonsInstantiated()
afterSingletonsInstantiated
in interface org.springframework.beans.factory.SmartInitializingSingleton
public java.lang.Object postProcessAfterInitialization(java.lang.Object bean, java.lang.String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
public java.lang.String[] getChannelNames()
public java.lang.String[] getHandlerNames()
public java.lang.String[] getSourceNames()
public MessageChannelMetrics getChannelMetrics(java.lang.String name)
public MessageHandlerMetrics getHandlerMetrics(java.lang.String name)
public MessageSourceMetrics getSourceMetrics(java.lang.String name)