}
@Override
public void validateConfiguration() throws ConfigurationException
{
PluginManager pluginManager;
try
{
pluginManager = ApplicationRegistry.getInstance().getPluginManager();
}
catch (IllegalStateException ise)
{
// We see this happen during shutdown due to asynchronous reconfig performed IO threads
// running at the same time as the shutdown handler.
_policyPlugin = null;
return;
}
if (!containsPositiveLong("messageAge") &&
!containsPositiveLong("depth") &&
!containsPositiveLong("messageCount"))
{
throw new ConfigurationException("At least one configuration property" +
"('messageAge','depth' or 'messageCount') must be specified.");
}
SlowConsumerDetectionPolicyConfiguration policyConfig = getConfiguration(SlowConsumerDetectionPolicyConfiguration.class.getName());
Map<String, SlowConsumerPolicyPluginFactory> factories = pluginManager.getSlowConsumerPlugins();
if (policyConfig == null)
{
throw new ConfigurationException("No Slow Consumer Policy specified. Known Policies:" + factories.keySet());
}