use of org.springframework.context.annotation.DependsOn in project spring-boot by spring-projects.
the class EmbeddedLdapAutoConfiguration method ldapContextSource.
@Bean
@DependsOn("directoryServer")
@ConditionalOnMissingBean
public ContextSource ldapContextSource() {
LdapContextSource source = new LdapContextSource();
if (hasCredentials(this.embeddedProperties.getCredential())) {
source.setUserDn(this.embeddedProperties.getCredential().getUsername());
source.setPassword(this.embeddedProperties.getCredential().getPassword());
}
source.setUrls(this.properties.determineUrls(this.environment));
return source;
}
use of org.springframework.context.annotation.DependsOn in project gs-spring-security-3.2 by rwinch.
the class DataConfiguration method initDatabase.
@Bean
@DependsOn("entityManagerFactory")
public ResourceDatabasePopulator initDatabase(DataSource dataSource) throws Exception {
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
populator.addScript(new ClassPathResource("data.sql"));
populator.populate(dataSource.getConnection());
return populator;
}
use of org.springframework.context.annotation.DependsOn in project spring-security by spring-projects.
the class DataConfig method initDatabase.
@Bean
@DependsOn("entityManagerFactory")
public ResourceDatabasePopulator initDatabase(DataSource dataSource) throws Exception {
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
populator.addScript(new ClassPathResource("data.sql"));
populator.populate(dataSource.getConnection());
return populator;
}
use of org.springframework.context.annotation.DependsOn in project spring-security by spring-projects.
the class DataConfiguration method initDatabase.
@Bean
@DependsOn("entityManagerFactory")
public ResourceDatabasePopulator initDatabase(DataSource dataSource) throws Exception {
ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
populator.addScript(new ClassPathResource("data.sql"));
populator.populate(dataSource.getConnection());
return populator;
}
use of org.springframework.context.annotation.DependsOn in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850PersistenceConfig method iec61850EntityManagerFactory.
/**
* Method for creating the Entity Manager Factory Bean.
*
* @return LocalContainerEntityManagerFactoryBean
* @throws ClassNotFoundException
* when class not found
*/
@Bean
@DependsOn("iec61850Flyway")
public LocalContainerEntityManagerFactoryBean iec61850EntityManagerFactory() throws ClassNotFoundException {
final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setPersistenceUnitName("OSGP_PROTOCOL_ADAPTER_IEC61850");
entityManagerFactoryBean.setDataSource(this.iec61850DataSource());
entityManagerFactoryBean.setPackagesToScan(this.entityManagerPackagesToScan);
entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistence.class);
final Properties jpaProperties = new Properties();
jpaProperties.put(PROPERTY_NAME_HIBERNATE_DIALECT, this.hibernateDialect);
jpaProperties.put(PROPERTY_NAME_HIBERNATE_FORMAT_SQL, this.hibernateFormatSql);
jpaProperties.put(PROPERTY_NAME_HIBERNATE_NAMING_STRATEGY, this.hibernateNamingStrategy);
jpaProperties.put(PROPERTY_NAME_HIBERNATE_SHOW_SQL, this.hibernateShowSql);
entityManagerFactoryBean.setJpaProperties(jpaProperties);
return entityManagerFactoryBean;
}
Aggregations