|
From: Rob H. <ro...@ca...> - 2004-11-07 19:37:08
|
All, I have been working on an idea for auto injecting Commons Log instances into beans for a while. I have commited initial support for this to the sandbox. It uses a bean post processor and injects a log into all beans that define a setLog() method. The bean post processor itself uses a strategy interface to determine the name of the log and I have created three basic implementations that satisfy the needs for my projects. I'm not sure if this is useful for anyone else, and I have a feeling there is a better way of doing this. In particular I am not happy about the use of a magic method for identifying classes that have a Log dependency, but I didn't want to introduce a Spring interface that beans have to implement just to have a Log injected. Let me know your thoughts. Rob |