public class IntegrationManagementConfigurer extends Object implements SmartInitializingSingleton, ApplicationContextAware, BeanNameAware
IntegrationManagement
.
Configures counts, stats, logging for all (or selected) components.Modifier and Type | Field and Description |
---|---|
static String |
MANAGEMENT_CONFIGURER_NAME |
Constructor and Description |
---|
IntegrationManagementConfigurer() |
Modifier and Type | Method and Description |
---|---|
void |
afterSingletonsInstantiated() |
MessageChannelMetrics |
getChannelMetrics(String name) |
String[] |
getChannelNames() |
Boolean |
getDefaultCountsEnabled() |
Boolean |
getDefaultStatsEnabled() |
MessageHandlerMetrics |
getHandlerMetrics(String name) |
String[] |
getHandlerNames() |
MessageSourceMetrics |
getSourceMetrics(String name) |
String[] |
getSourceNames() |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setBeanName(String name) |
void |
setDefaultCountsEnabled(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(Boolean defaultStatsEnabled)
Set whether managed components maintain message statistics by default.
|
void |
setEnabledCountsPatterns(String[] enabledCountsPatterns)
Set the array of simple patterns for component names for which message counts will
be enabled (defaults to '*').
|
void |
setEnabledStatsPatterns(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(String metricsFactory)
Set a metrics factory bean name.
|
public static final String MANAGEMENT_CONFIGURER_NAME
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public void setBeanName(String name)
setBeanName
in interface BeanNameAware
public void setMetricsFactory(MetricsFactory metricsFactory)
metricsFactoryBeanName
.
Defaults to DefaultMetricsFactory
.metricsFactory
- the factory.public void setMetricsFactoryBeanName(String metricsFactory)
metricsFactory
isn't specified.metricsFactory
- the factory.public void setEnabledCountsPatterns(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(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(Boolean defaultCountsEnabled)
defaultCountsEnabled
- true to enable.public Boolean getDefaultCountsEnabled()
public void setDefaultStatsEnabled(Boolean defaultStatsEnabled)
defaultStatsEnabled
- true to enable.public 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 SmartInitializingSingleton
public String[] getChannelNames()
public String[] getHandlerNames()
public String[] getSourceNames()
public MessageChannelMetrics getChannelMetrics(String name)
public MessageHandlerMetrics getHandlerMetrics(String name)
public MessageSourceMetrics getSourceMetrics(String name)