public void afterPropertiesSet() throws Exception {
if (getProvider() == null) {
Map<String, ProviderConfig> providerConfigMap = applicationContext == null ? null : applicationContext.getBeansOfType(ProviderConfig.class, false, false);
if (providerConfigMap != null && providerConfigMap.size() > 0) {
Collection<ProviderConfig> providerConfigs = providerConfigMap.values();
ProviderConfig providerConfig = providerConfigs.iterator().next();
if (providerConfigs.size() > 1) {
Map<String, ProtocolConfig> protocolConfigMap = applicationContext == null ? null : applicationContext.getBeansOfType(ProtocolConfig.class, false, false);
if (protocolConfigMap != null && protocolConfigMap.size() > 0) {
throw new IllegalStateException("Duplicate provider configs: " + providerConfigs);
}