Daniel Fernández opened SPR-8963 and commented
IMHO, there is a mismatch between the configuration possibilities offered by XML and @Configuration classes in Spring 3.1, which could be fixed by allowing developers to create custom annotations that could be used in @Configuration classes (in the same way as @PropertySource) for performing pre-configured infrastructure tasks.
These annotations could perform these configuration tasks "underneath", hiding their complexities to Spring users, in the same way namespace handlers can in an XML file.
@PropertySource is the clear example to this, as it registers a PropertySource for the specified ".properties" files, but the object registered is of a specific class hard-coded into Spring's code. This avoids the possibility of creating instances of other implementations of the PropertySource interface that perform more complex processing of .properties entries.
Specifically, the jasypt project [ http://www.jasypt.org ] --of which I'm author-- defines an "encryption" XML namespace which allows developers to register an EncryptablePropertySource that performs automatic transparent decryption of properties with "encryption:encryptable-property-placeholder/", which works in a way equivalent to "context:property-placeholder/", but applying transparent decryption.
I would love to be able to offer this same easiness of configuration in @Configuration classes with an @EncryptablePropertySource annotation, but as it happens this is not possible :-(
Please, extend the @Configuration mechanism for allowing custom annotations (with their associated handlers).
Thanks.
Affects: 3.1 GA
Reference URL: http://forum.springsource.org/showthread.php?120147-Can-I-create-my-own-annotations-for-enabling-features-at-Configuration-classes
Issue Links:
Referenced from: commits a378912
5 votes, 12 watchers
Daniel Fernández opened SPR-8963 and commented
IMHO, there is a mismatch between the configuration possibilities offered by XML and
@Configurationclasses in Spring 3.1, which could be fixed by allowing developers to create custom annotations that could be used in@Configurationclasses (in the same way as@PropertySource) for performing pre-configured infrastructure tasks.These annotations could perform these configuration tasks "underneath", hiding their complexities to Spring users, in the same way namespace handlers can in an XML file.
@PropertySourceis the clear example to this, as it registers a PropertySource for the specified ".properties" files, but the object registered is of a specific class hard-coded into Spring's code. This avoids the possibility of creating instances of other implementations of the PropertySource interface that perform more complex processing of .properties entries.Specifically, the jasypt project [ http://www.jasypt.org ] --of which I'm author-- defines an "encryption" XML namespace which allows developers to register an EncryptablePropertySource that performs automatic transparent decryption of properties with "encryption:encryptable-property-placeholder/", which works in a way equivalent to "context:property-placeholder/", but applying transparent decryption.
I would love to be able to offer this same easiness of configuration in
@Configurationclasses with an@EncryptablePropertySourceannotation, but as it happens this is not possible :-(Please, extend the
@Configurationmechanism for allowing custom annotations (with their associated handlers).Thanks.
Affects: 3.1 GA
Reference URL: http://forum.springsource.org/showthread.php?120147-Can-I-create-my-own-annotations-for-enabling-features-at-Configuration-classes
Issue Links:
@PropertySourceloading support ("is duplicated by")@PropertySourceto be specified on a test class@PropertySource[SPR-13874] #18447 Add support for UTF-8 and other charset/encoding to@PropertySource@Profileannotations not working on@ConfigurationclassesReferenced from: commits a378912
5 votes, 12 watchers