securityService.getMessageSecurityConfigByAuthLayer(messageLayer);
if(messageSecurity==null)
{
String msg = localStrings.getString( "admin.mbeans.configs.message_security_config_not_found",
new Object[]{messageLayer, targetName});
throw new MBeanConfigException(msg);
}
ProviderConfig[] providers = messageSecurity.getProviderConfig();
if(providers.length==1 && providerId.equals(providers[0].getProviderId()))
{
securityService.removeMessageSecurityConfig(messageSecurity);
return true;
}
ProviderConfig provider = messageSecurity.getProviderConfigByProviderId(providerId);
if(provider==null)
{
String msg = localStrings.getString( "admin.mbeans.configs.security_provider_not_found", new Object[]{providerId, messageLayer, targetName});
throw new MBeanConfigException(msg);
}
messageSecurity.removeProviderConfig(provider);
return true;
}