use of org.springframework.context.annotation.Lazy in project cas by apereo.
the class GoogleAuthenticatorJpaConfiguration method googleAuthenticatorEntityManagerFactory.
@Lazy
@Bean
public LocalContainerEntityManagerFactoryBean googleAuthenticatorEntityManagerFactory() {
final LocalContainerEntityManagerFactoryBean bean = Beans.newHibernateEntityManagerFactoryBean(new JpaConfigDataHolder(jpaGoogleAuthenticatorVendorAdapter(), "jpaGoogleAuthenticatorContext", jpaPackagesToScanGoogleAuthenticator(), dataSourceGoogleAuthenticator()), casProperties.getAuthn().getMfa().getGauth().getJpa().getDatabase());
bean.getJpaPropertyMap().put("hibernate.enable_lazy_load_no_trans", Boolean.TRUE);
return bean;
}
use of org.springframework.context.annotation.Lazy in project cas by apereo.
the class EhcacheTicketRegistryConfiguration method cacheManager.
@Lazy
@Bean
public EhCacheManagerFactoryBean cacheManager() {
final EhcacheProperties cache = casProperties.getTicket().getRegistry().getEhcache();
final EhCacheManagerFactoryBean bean = new EhCacheManagerFactoryBean();
bean.setConfigLocation(cache.getConfigLocation());
bean.setShared(cache.isShared());
bean.setCacheManagerName(cache.getCacheManagerName());
return bean;
}
use of org.springframework.context.annotation.Lazy in project camel by apache.
the class CamelCloudServiceFilterAutoConfiguration method serviceFilter.
@Lazy
@Bean(name = "service-filter")
public CamelCloudServiceFilter serviceFilter(CamelCloudConfigurationProperties properties) {
BlacklistServiceFilter blacklist = new BlacklistServiceFilter();
Map<String, List<String>> services = properties.getServiceFilter().getBlacklist();
for (Map.Entry<String, List<String>> entry : services.entrySet()) {
for (String part : entry.getValue()) {
String host = StringHelper.before(part, ":");
String port = StringHelper.after(part, ":");
if (ObjectHelper.isNotEmpty(host) && ObjectHelper.isNotEmpty(port)) {
blacklist.addServer(entry.getKey(), host, Integer.parseInt(port));
}
}
}
return new CamelCloudServiceFilter(Arrays.asList(new HealthyServiceFilter(), blacklist));
}
use of org.springframework.context.annotation.Lazy in project camel by apache.
the class SalesforceUpsertContactConnectorAutoConfiguration method configureSalesforceUpsertContactComponent.
@Lazy
@Bean(name = "salesforce-upsert-contact-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(org.foo.salesforce.contact.SalesforceUpsertContactComponent.class)
public SalesforceUpsertContactComponent configureSalesforceUpsertContactComponent(CamelContext camelContext, SalesforceUpsertContactConnectorConfiguration configuration) throws Exception {
SalesforceUpsertContactComponent connector = new SalesforceUpsertContactComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), connector, parameters);
connector.setComponentOptions(parameters);
return connector;
}
use of org.springframework.context.annotation.Lazy in project camel by apache.
the class TwitterMentionConnectorAutoConfiguration method configureTwitterMentionComponent.
@Lazy
@Bean(name = "twitter-mention-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(org.foo.mention.TwitterMentionComponent.class)
public TwitterMentionComponent configureTwitterMentionComponent(CamelContext camelContext, TwitterMentionConnectorConfiguration configuration) throws Exception {
TwitterMentionComponent connector = new TwitterMentionComponent();
connector.setCamelContext(camelContext);
Map<String, Object> parameters = new HashMap<>();
IntrospectionSupport.getProperties(configuration, parameters, null, false);
IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), connector, parameters);
connector.setComponentOptions(parameters);
return connector;
}
Aggregations