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);
}
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;
}
Aggregations