Search in sources :

Example 6 with DependsOn

use of org.springframework.context.annotation.DependsOn in project aries by apache.

the class DependsOnAttributeResolver method handleBeanAnnotation.

@Override
public void handleBeanAnnotation(AnnotatedElement annotatedElement, String id, ContextEnricher contextEnricher, BeanEnricher beanEnricher) {
    DependsOn annotation = annotatedElement.getAnnotation(DependsOn.class);
    String[] value = annotation.value();
    if (value.length == 0) {
        return;
    }
    String dependsOnValue = StringUtils.join(value, " ");
    beanEnricher.addAttribute("depends-on", dependsOnValue);
}
Also used : DependsOn(org.springframework.context.annotation.DependsOn)

Example 7 with DependsOn

use of org.springframework.context.annotation.DependsOn in project ocvn by devgateway.

the class DatabaseConfiguration method dataSource.

/**
     * Creates a {@link javax.sql.DataSource} based on Tomcat {@link DataSource}
     * 
     * @return
     */
@Bean
@DependsOn(value = { "derbyServer" })
public DataSource dataSource() {
    PoolProperties pp = new PoolProperties();
    pp.setJmxEnabled(true);
    pp.setDefaultTransactionIsolation(springDatasourceTransactionIsolation);
    pp.setInitialSize(springDatasourceInitialSize);
    pp.setMaxActive(springDatasourceMaxActive);
    DataSource dataSource = new DataSource(pp);
    dataSource.setUrl(springDatasourceUrl);
    dataSource.setUsername(springDatasourceUsername);
    dataSource.setPassword(springDatasourcePassword);
    dataSource.setDriverClassName(springDatasourceDriverClassName);
    return dataSource;
}
Also used : PoolProperties(org.apache.tomcat.jdbc.pool.PoolProperties) DataSource(org.apache.tomcat.jdbc.pool.DataSource) DependsOn(org.springframework.context.annotation.DependsOn) Bean(org.springframework.context.annotation.Bean)

Aggregations

DependsOn (org.springframework.context.annotation.DependsOn)7 Bean (org.springframework.context.annotation.Bean)6 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)4 ClassPathResource (org.springframework.core.io.ClassPathResource)3 ResourceDatabasePopulator (org.springframework.jdbc.datasource.init.ResourceDatabasePopulator)3 Properties (java.util.Properties)1 DataSource (org.apache.tomcat.jdbc.pool.DataSource)1 PoolProperties (org.apache.tomcat.jdbc.pool.PoolProperties)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 LdapContextSource (org.springframework.ldap.core.support.LdapContextSource)1