use of javax.enterprise.context.ApplicationScoped in project oxTrust by GluuFederation.
the class AppInitializer method initUmaMetadataConfiguration.
@Produces
@ApplicationScoped
@Named("umaMetadataConfiguration")
public UmaConfiguration initUmaMetadataConfiguration() throws OxIntializationException {
String umaConfigurationEndpoint = getUmaConfigurationEndpoint();
if (StringHelper.isEmpty(umaConfigurationEndpoint)) {
return null;
}
UmaConfigurationService metaDataConfigurationService = UmaClientFactory.instance().createMetaDataConfigurationService(umaConfigurationEndpoint);
UmaConfiguration metadataConfiguration = metaDataConfigurationService.getMetadataConfiguration();
if (metadataConfiguration == null) {
throw new OxIntializationException("UMA meta data configuration is invalid!");
}
return metadataConfiguration;
}
use of javax.enterprise.context.ApplicationScoped in project oxAuth by GluuFederation.
the class AppInitializer method getLdapEntryManager.
@Produces
@ApplicationScoped
@Named(LDAP_ENTRY_MANAGER_NAME)
public LdapEntryManager getLdapEntryManager() {
LdapEntryManager ldapEntryManager = new LdapEntryManager(new OperationsFacade(this.connectionProvider, this.bindConnectionProvider));
log.info("Created {}: {}", new Object[] { LDAP_ENTRY_MANAGER_NAME, ldapEntryManager.getLdapOperationService() });
return ldapEntryManager;
}
use of javax.enterprise.context.ApplicationScoped in project oxAuth by GluuFederation.
the class ApplicationFactory method getSmtpConfiguration.
@Produces
@ApplicationScoped
public SmtpConfiguration getSmtpConfiguration() {
GluuAppliance appliance = applianceService.getAppliance();
SmtpConfiguration smtpConfiguration = appliance.getSmtpConfiguration();
if (smtpConfiguration == null) {
return null;
}
String password = smtpConfiguration.getPassword();
if (StringHelper.isNotEmpty(password)) {
try {
smtpConfiguration.setPasswordDecrypted(encryptionService.decrypt(password));
} catch (EncryptionException ex) {
log.error("Failed to decript SMTP user password", ex);
}
}
return smtpConfiguration;
}
use of javax.enterprise.context.ApplicationScoped in project oxAuth by GluuFederation.
the class AppInitializer method createLdapAuthEntryManager.
@Produces
@ApplicationScoped
@Named(LDAP_AUTH_ENTRY_MANAGER_NAME)
public List<LdapEntryManager> createLdapAuthEntryManager() {
List<LdapEntryManager> ldapAuthEntryManagers = new ArrayList<LdapEntryManager>();
if (this.ldapAuthConfigs.size() == 0) {
return ldapAuthEntryManagers;
}
for (int i = 0; i < this.ldapAuthConfigs.size(); i++) {
LdapEntryManager ldapAuthEntryManager = new LdapEntryManager(new OperationsFacade(this.authConnectionProviders.get(i), this.authBindConnectionProviders.get(i)));
log.debug("Created {}#{}: {}", new Object[] { LDAP_AUTH_ENTRY_MANAGER_NAME, i, ldapAuthEntryManager });
ldapAuthEntryManagers.add(ldapAuthEntryManager);
}
return ldapAuthEntryManagers;
}
use of javax.enterprise.context.ApplicationScoped in project deltaspike by apache.
the class ViewConfigResolverProducer method createViewConfigResolver.
@Produces
@ApplicationScoped
public ViewConfigResolver createViewConfigResolver() {
if (!viewConfigExtension.isActivated()) {
return createEmptyDefaultViewConfigResolver();
}
if (//esp. for easier unit-tests
!viewConfigExtension.isTransformed()) {
viewConfigExtension.transformMetaDataTree();
}
ViewConfigResolver viewConfigResolver = viewConfigExtension.getViewConfigResolver();
if (viewConfigResolver == null) {
LOG.warning("It wasn't possible to create a ViewConfigResolver");
viewConfigResolver = createEmptyDefaultViewConfigResolver();
}
return viewConfigResolver;
}
Aggregations