incubator-deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Gonzalez <adr_gonza...@yahoo.fr>
Subject ConfigResolver : adding @ConfigProperty injection ?
Date Mon, 05 Mar 2012 11:19:40 GMT
Hello,

Deltaspike config module is based on ConfigResolver usage :
  ConfigResolver.getPropertyValue("test")


Wouldn't it be interesting to add on top of it some injection capacity ? (i.e. providing
@ConfigProperty annotation) 

Sample usage [1] :
@Produces
public LoginContext produceLoginContext(@ConfigProperty("loginConfigFile") String loginConfigFileName,
                                        @ConfigProperty("loginModuleName")
String loginModuleName)
   blabla
}

This approach is based on Antonio's petstore application - config code is available in [2]

[1] https://github.com/agoncal/agoncal-application-petstore-ee6/blob/master/src/main/java/org/agoncal/application/petstore/security/LoginContextProducer.java

[2] https://github.com/agoncal/agoncal-application-petstore-ee6/blob/master/src/main/java/org/agoncal/application/petstore/util/ConfigProperty.java
https://github.com/agoncal/agoncal-application-petstore-ee6/blob/master/src/main/java/org/agoncal/application/petstore/util/ConfigPropertyProducer.java


Mime
View raw message