Skip to content

Commit

Permalink
add allow circular dependency config to Microserver annotation also
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcclean committed Mar 18, 2015
1 parent 87f7577 commit 6610661
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@
String[] properties() default {};


/**
* @return true if the spring context should allow circular dependencies
* We recommend not to allow circular dependencies
*/
boolean allowCircularDependencies() default false;

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public Config buildConfig(Class class1) {
Map<String, String> properties = buildProperties(microserver);

return Config.instance().withEntityScan(microserver.entityScan()).withClasses(ImmutableSet.copyOf(classes))
.withPropertiesName(microserver.propertiesName()).withProperties(ImmutableMap.copyOf(properties)).set();
.withPropertiesName(microserver.propertiesName())
.withAllowCircularReferences(microserver.allowCircularDependencies())
.withProperties(ImmutableMap.copyOf(properties)).set();
}

private Map<String, String> buildProperties(Microserver microserver) {
Expand Down

0 comments on commit 6610661

Please sign in to comment.