config = (org.glassfish.security.services.config.RoleMappingService) securityServiceConfiguration;
if (config != null) {
// Get the role mapping provider configuration
// Consider only one provider for now and take the first provider found!
List<SecurityProvider> providersConfig = config.getSecurityProviders();
SecurityProvider roleProviderConfig = null;
if (providersConfig != null) roleProviderConfig = providersConfig.get(0);
if (roleProviderConfig != null) {
// Get the provider
String providerName = roleProviderConfig.getName();
if (isDebug()) {
logger.log(DEBUG_LEVEL, "Attempting to get Role Mapping Provider \"{0}\".", providerName );
}
provider = AccessController.doPrivileged(
new PrivilegedLookup<RoleMappingProvider>(serviceLocator, RoleMappingProvider.class, providerName) );