Capgemini / spring-boot-capgemini

Apache License 2.0
16 stars 8 forks source link

Create concept of SettingBackedBean factory methods #20

Closed craigwilliams84 closed 9 years ago

craigwilliams84 commented 9 years ago

I would like to be able to annotate a class and factory methods with annotations so that the methods can be defined as bean factory methods that are backed by a setting.

For example, in the trace project, multiple pointcuts can be configured in an application, and I would like to be able to annotate a factory method like below, causing a bean to be created for every instance of the pointcut setting.

@SettingBackedBean(setting = "pointcut", beanNameSuffix = "Advisor") public Advisor createAdvisor(String pointcutExpression, TraceLoggerSettings settings) { Advisor advisor = null; .... Code to create advisor based on pointcutExpression (instance of pointcut setting) return advisor; }