How do I wire a custom annotation at the same time as @Autowired?
Hi,
I've got a custom logger annotation that is based off this post: http://jgeeks.blogspot.com/2008/10/a...to-spring.html
It works fine unless I try to use the logger in a method annotated with @Autowired. For example,
Code:
@Repository
public class MyDao
{
@AutowiredLogger
private Logger _logger;
private JdbcTemplate _jt;
@Autowired
public void setDatasource(DataSource ds)
{
_logger.debug("Entering setDs")
_jt = new JdbcTemplate(ds);
_logger.debut("Exiting setDs);
}
}
Is there a way to have my @AutowiredLogger wired before or with @Autowired annotations? Section 4.6.1.1 of the Spring Framework Reference advises not to use the InitializingBean interface - is my only option to configure my setDatasource method as an init method in my configuration XML?
Thanks,
Paul