use of org.zalando.nakadi.plugin.api.authz.AuthorizationServiceFactory in project nakadi by zalando.
the class PluginsConfig method authorizationService.
@Bean
public AuthorizationService authorizationService(@Value("${nakadi.plugins.authz.factory}") final String factoryName, final SystemProperties systemProperties, final DefaultResourceLoader loader) {
try {
LOGGER.info("Initialize per-resource authorization service factory: " + factoryName);
final Class<AuthorizationServiceFactory> factoryClass = (Class<AuthorizationServiceFactory>) loader.getClassLoader().loadClass(factoryName);
final AuthorizationServiceFactory factory = factoryClass.newInstance();
return factory.init(systemProperties);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
throw new BeanCreationException("Can't create AuthorizationService " + factoryName, e);
}
}
Aggregations