本文整理汇总了Java中io.gravitee.plugin.core.internal.AnnotationBasedPluginContextConfigurer类的典型用法代码示例。如果您正苦于以下问题:Java AnnotationBasedPluginContextConfigurer类的具体用法?Java AnnotationBasedPluginContextConfigurer怎么用?Java AnnotationBasedPluginContextConfigurer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AnnotationBasedPluginContextConfigurer类属于io.gravitee.plugin.core.internal包,在下文中一共展示了AnnotationBasedPluginContextConfigurer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create0
import io.gravitee.plugin.core.internal.AnnotationBasedPluginContextConfigurer; //导入依赖的package包/类
private <T> T create0(Plugin plugin, Class<T> certificateClass, CertificateConfiguration certificateConfiguration) {
if (certificateClass == null) {
return null;
}
try {
T certificateObj = createInstance(certificateClass);
final Import annImport = certificateClass.getAnnotation(Import.class);
Set<Class<?>> configurations = (annImport != null) ?
new HashSet<>(Arrays.asList(annImport.value())) : Collections.emptySet();
ApplicationContext idpApplicationContext = pluginContextFactory.create(new AnnotationBasedPluginContextConfigurer(plugin) {
@Override
public Set<Class<?>> configurations() {
return configurations;
}
@Override
public ConfigurableApplicationContext applicationContext() {
ConfigurableApplicationContext configurableApplicationContext = super.applicationContext();
// Add certificate configuration bean
configurableApplicationContext.addBeanFactoryPostProcessor(
new CertificateConfigurationBeanFactoryPostProcessor(certificateConfiguration));
return configurableApplicationContext;
}
});
idpApplicationContext.getAutowireCapableBeanFactory().autowireBean(certificateObj);
if (certificateObj instanceof InitializingBean) {
((InitializingBean) certificateObj).afterPropertiesSet();
}
return certificateObj;
} catch (Exception ex) {
logger.error("An unexpected error occurs while loading certificate", ex);
return null;
}
}
示例2: create0
import io.gravitee.plugin.core.internal.AnnotationBasedPluginContextConfigurer; //导入依赖的package包/类
private <T> T create0(Plugin plugin, Class<T> extensionGrantClass, ExtensionGrantConfiguration extensionGrantConfiguration, AuthenticationProvider authenticationProvider) {
if (extensionGrantClass == null) {
return null;
}
try {
T extensionGrantObj = createInstance(extensionGrantClass);
final Import annImport = extensionGrantClass.getAnnotation(Import.class);
Set<Class<?>> configurations = (annImport != null) ?
new HashSet<>(Arrays.asList(annImport.value())) : Collections.emptySet();
ApplicationContext extensionGrantApplicationContext = pluginContextFactory.create(new AnnotationBasedPluginContextConfigurer(plugin) {
@Override
public Set<Class<?>> configurations() {
return configurations;
}
@Override
public ConfigurableApplicationContext applicationContext() {
ConfigurableApplicationContext configurableApplicationContext = super.applicationContext();
// Add extension grant configuration bean
configurableApplicationContext.addBeanFactoryPostProcessor(
new ExtensionGrantConfigurationBeanFactoryPostProcessor(extensionGrantConfiguration));
// Add extension grant identity provider bean
configurableApplicationContext.addBeanFactoryPostProcessor(
new ExtensionGrantIdentityProviderFactoryPostProcessor(authenticationProvider != null ? authenticationProvider : new NoAuthenticationProvider()));
return configurableApplicationContext;
}
});
extensionGrantApplicationContext.getAutowireCapableBeanFactory().autowireBean(extensionGrantObj);
if (extensionGrantObj instanceof InitializingBean) {
((InitializingBean) extensionGrantObj).afterPropertiesSet();
}
return extensionGrantObj;
} catch (Exception ex) {
logger.error("An unexpected error occurs while loading extension grant", ex);
return null;
}
}
开发者ID:gravitee-io,项目名称:graviteeio-access-management,代码行数:46,代码来源:ExtensionGrantPluginManagerImpl.java
示例3: create0
import io.gravitee.plugin.core.internal.AnnotationBasedPluginContextConfigurer; //导入依赖的package包/类
private <T> T create0(Plugin plugin, Class<T> identityClass, IdentityProviderConfiguration identityProviderConfiguration,
IdentityProviderMapper identityProviderMapper, IdentityProviderRoleMapper identityProviderRoleMapper) {
if (identityClass == null) {
return null;
}
try {
T identityObj = createInstance(identityClass);
final Import annImport = identityClass.getAnnotation(Import.class);
Set<Class<?>> configurations = (annImport != null) ?
new HashSet<>(Arrays.asList(annImport.value())) : Collections.emptySet();
ApplicationContext idpApplicationContext = pluginContextFactory.create(new AnnotationBasedPluginContextConfigurer(plugin) {
@Override
public Set<Class<?>> configurations() {
return configurations;
}
@Override
public ConfigurableApplicationContext applicationContext() {
ConfigurableApplicationContext configurableApplicationContext = super.applicationContext();
// Add identity provider configuration bean
configurableApplicationContext.addBeanFactoryPostProcessor(
new IdentityProviderConfigurationBeanFactoryPostProcessor(identityProviderConfiguration));
// Add identity provider mapper bean
configurableApplicationContext.addBeanFactoryPostProcessor(
new IdentityProviderMapperBeanFactoryPostProcessor(identityProviderMapper));
// Add identity provider role mapper bean
configurableApplicationContext.addBeanFactoryPostProcessor(
new IdentityProviderRoleMapperBeanFactoryPostProcessor(identityProviderRoleMapper));
return configurableApplicationContext;
}
});
idpApplicationContext.getAutowireCapableBeanFactory().autowireBean(identityObj);
if (identityObj instanceof InitializingBean) {
((InitializingBean) identityObj).afterPropertiesSet();
}
return identityObj;
} catch (Exception ex) {
logger.error("An unexpected error occurs while loading identity provider", ex);
return null;
}
}
开发者ID:gravitee-io,项目名称:graviteeio-access-management,代码行数:51,代码来源:IdentityProviderPluginManagerImpl.java
示例4: create
import io.gravitee.plugin.core.internal.AnnotationBasedPluginContextConfigurer; //导入依赖的package包/类
private <T> T create(Plugin plugin, Class<T> identityClass, Map<String, Object> properties) {
if (identityClass == null) {
return null;
}
try {
T identityObj = createInstance(identityClass);
final Import annImport = identityClass.getAnnotation(Import.class);
Set<Class<?>> configurations = (annImport != null) ?
new HashSet<>(Arrays.asList(annImport.value())) : Collections.emptySet();
ApplicationContext idpApplicationContext = pluginContextFactory.create(new AnnotationBasedPluginContextConfigurer(plugin) {
@Override
public Set<Class<?>> configurations() {
return configurations;
}
@Override
public ConfigurableEnvironment environment() {
return new StandardEnvironment() {
@Override
protected void customizePropertySources(MutablePropertySources propertySources) {
propertySources.addFirst(new MapPropertySource(plugin.id(), properties));
super.customizePropertySources(propertySources);
}
};
}
});
idpApplicationContext.getAutowireCapableBeanFactory().autowireBean(identityObj);
if (identityObj instanceof InitializingBean) {
((InitializingBean) identityObj).afterPropertiesSet();
}
return identityObj;
} catch (Exception ex) {
LOGGER.error("An unexpected error occurs while loading identity provider", ex);
return null;
}
}