devlocal = ef.Env('devlocal')devi = ef.Env('devi')devs = ef.Env('devs')preprod = ef.Env('preprod')prod = ef.Env('prod')
Hi WernerModeling some kind of environment makes sense, but I think it is also important not to constraint, what environments are defined (consequently an enum would not be the best solution ;-) ).
--
You received this message because you are subscribed to the Google Groups "java-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-config...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-config.
For more options, visit https://groups.google.com/groups/opt_out.
Hi ArjanThis might look like, but I also was already considering this feature (therefore my remark about binary types):,
- values might be of any type, as far as they can be converted out of a String.
public interface ConfigConverterSpi{<T> T createConfiguration(Class<T> targetType, String key, Configuration configurationNode});
Given such a mechanism we could also provide InputStream as a value type, so the consumer may read from the stream, using the configuration (reading) logic, that already is in place.
One other advantage is that our JSR does not have to define, how all the JSRs around will best benefit from a configuration JSR. In a EE context, I assume the EE8 EG can discuss this with the several
JSRs in place, whereas other non EE JSRs can support this JSR also independently. The configuration JSR is only providing the mechanisms...
Hi,
Perhaps a little off-topic to this JSR, or maybe not, but conversion from and to String is a rather general concept as well. JSF has its own Converter interface for this and via java.beans.PropertyEditorManager there actually is one in the standard JDK as well (I provided an example and some background for this at http://jdevelopment.nl/switching-data-sources-datasourcedefinition). Furthermore, JAX-B has its own converters and third parties like Apache BeanUtils have ones as well.Maybe something like a Bean Conversion JSR as analogy to the Bean Validation one wouldn't be a bad idea. On the other hand yet another JSR and yet another layer may not really be beneficial for actually getting things done.
First and foremost it should then be clearly understood that the Configuration JSR is not directly going to make deployment descriptors configurable. I.e. this Configuration JSR would not be the thing that directly solves JAVAEE_SPEC-19.
While reading from InputStream may indeed be an important building block, there should then still be a specification of some sorts that details how an external property arrives at a specific "part" (e.g. JSF, JPA etc) of a Java EE server.Also, instead of specifying the deployment descriptors for each sub-spec of Java EE individually, it would be convenient if you could start a Java EE server with e.g. "-Djavax.javaee.archive-alt-dd=META-INF/dev", causing all sub-specs that read deployment descriptors to consult that folder inside the application archive before consulting the regular location. Perhaps some additional options would be handy to say if you want an override (complete replacement) or an addition.Furthermore, there was talk of having placeholders in deployment descriptors based on EL, and then there's the idea pioneered by JSF 2.2 that applications at start-up time can push raw configuration into the deployment descriptor loading chain (see e.g. http://jdevelopment.nl/jsf-22#533).
All of that would be best handled I think in an umbrella Configuration JSR, and not (or at least not all of it) left to each individual specification. If this JSR is not going to address these concerns then there might still be something needed like a "Java EE Configuration JSR". As this "Java EE Configuration JSR" would be building upon the "Java SE Configuration JSR" (this JSR), I guess it has to wait for that latter one then to be defined and implemented. This on its turn may make it hard to reach the Java EE 8 deadline.
From the presentation at http://www.jfokus.se/jfokus13/preso/jf13_JavaEEConfiguration.pdf I also thought that this JSR would already be that "Java EE Configuration JSR" (it's even the name of the document :P), but this is thus not the case?
Again, correct me if I'm wrong as I'm still trying to understand what the exact scope is, but would the Configuration JSR as currently discussed essentially be a kind of JAX-P/JAX-B for .properties files and system properties?
Again, for me the question is, how big a JSR'scope should be.in the first release. There are quite a couple of things to consider. My experience shows that you will have to boil down things to a minimum to be successful at the end.
Summarizing I would try to say:
- one key point is, how far we want to go in defining EE integration/EE support by this JSR, i.e. if we want to have a separate EE umbrella. From a JSRs scope, it makes sense, but may be challenging to get on the EE train.
- Another option could also be, to define - as you somehow suggested - some default mappings from configuration to beans, usable then
- for datasources
- and all kind other code artifacts using Java Bean semantics
- other target types relevant for EE
- I think we have to live with Java SE as it is. I think a Bean Conversion JSR will be beyond the scope that is feasible.
WDYT?
Wouldn't it be easier perhaps to focus on Java EE, as that is (AFAIK) the place where advanced configuration is most needed. Maybe it's because I haven't been really involved with pure Java SE code for some time and I could easily be missing a use case, but for my Java SE application System.getProperty basically worked for me.
Wouldn't it be easier perhaps to focus on Java EE, as that is (AFAIK) the place where advanced configuration is most needed. Maybe it's because I haven't been really involved with pure Java SE code for some time and I could easily be missing a use case, but for my Java SE application System.getProperty basically worked for me.How do you manage system properties for such an application ? Do you have some external launch script to set them all ? How do you version it and distribute to various environments ? This is EXACTLY the question I expect this JSR to address.
--
As for the other points, I still have a hard time wrapping my head around it to be honest. The most difficult issue seems to be the Java SE focus.
Maybe it's an idea to actually find out where Java SE support is exactly needed for. Is this just (or mainly) to support Tomcat? What other really important Java SE use cases are there these days? Command line utils like Maven and Ant? IDEs like Eclipse and Netbeans? Is there anything else that's really important?
It now mostly looks like this JSR seeks to implement an alternative to Java SE's System.getProperty and Java EE's @Resource injection for simple values, ServletContext.getInitParameter and a JNDI lookup for java:comp/env/. The last two as are currently defined in web.xml as <context-param> and <env-entry>.
But if the focus of this JSR is Java SE, how easy would it be to really provide an alternative for @Resource, ServletContext.getInitParameter etc?
Wouldn't it be easier perhaps to focus on Java EE, as that is (AFAIK) the place where advanced configuration is most needed. Maybe it's because I haven't been really involved with pure Java SE code for some time and I could easily be missing a use case, but for my Java SE application System.getProperty basically worked for me. For my Java EE applications I almost always code up some kind of "ApplicationSettingsService", e.g.
Two other important parts are swapping out and augmenting deployment descriptors, as well as the ability to use placeholders (EL) in those deployment descriptors, e.g. in web.xml or application.xml:<data-source><name>java:app/someDS</name><class-name>org.example.Something</class-name><url>jdbc:someDB</url><user>${mycompany.someDS.user}</user><password>${mycompany.someDS.password}</password></data-source>Or in web.xml:<context-param><param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name><param-value>${empty facelets.refresh? -1 : facelets.refresh}</param-value></context-param>This is thus about configuring Java EE itself, which is currently not entirely trivial. I would really hope that a configuration JSR for Java EE addresses this and not just focus on making values available to application code.
You could say that optionally all specs could get their values from the configuration JSR, and this would probably work for the javax.faces.FACELETS_REFRESH_PERIOD example above, but not I think for the earlier data-source example. The data source is defined in web.xml by those tags. I'm not entirely sure how a "mapping from configuration to a bean" would be able to actually define a data source.
--
You received this message because you are subscribed to the Google Groups "java-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-config...@googlegroups.com.
Visit this group at http://groups.google.com/group/java-config.
For more options, visit https://groups.google.com/groups/opt_out.