var System = Java.type('java.lang.System');
var myProp = System.getProperty('foo.bar.prop');
But, the ultimate solution here would be to allow cfg files for each app named the same as the app. For example, foo.bar.myapp could have a configuration file foo.bar.myapp.cfg inside $XP_HOME/config. When this file is changed, the app is restarted. And the app could then get the configuration from app.config variable.
The illustrated solution is not working right now, but I will describe it in a task (and discuss it internally). It should be pretty trivial to implement.
System.getProperty should suffice for now, but since there are multiple machines in the cluster, that would also mean I would have to update the system.properties file on all nodes, and restart Enonic on all nodes.
Most cfg files are identical on all nodes, while a few are different. Would it be a good idea to put the files that are identical on nfs, and make symlinks to them? That way one would only have to change one file?
I guess having config in blob store would be a more cluster friendly solution?