Thoughts on system properties for startup

Cantor, Scott cantor.2 at osu.edu
Sat May 17 11:48:49 EDT 2014


My proposal around this is that for the "normal" case, what we want is a
single IDP_HOME system property, and the ContextListener would use that as
a file path to look for idp.properties in well-known locations. Then
idp.properties would probably define idp.home.url or something like that
as a resource URI base for most of the Spring configuration properties
that are currently using idp.home. We could probably just redefine
idp.home also to be ${IDP_HOME} if that works (and assuming we actually
need it, like for the keypair files).

But in the edge cases, I was suggesting we also have IDP_PROPERTIES. The
ContextListener would start by looking for that, and if it's set, that
would be used to locate idp.properties. It would be a Spring resource URI,
so file:///whatever or classpath://whatever.

The rest would be the same as in the normal case.

So the listener pseudocode is basically:

if (getSystemProperty("IDP_PROPERTIES") {
	load that resource as a property source
} else {
	use getSystemProperty("IDP_HOME") to locate properties
	load the located resource as a property source
}

I guess we could also default IDP_HOME if we wanted to, maybe even one
default for Windows and one for non-Windows (though as a sometimes Windows
person, I can't think why I'd ever want to use Windows default locations
for anything, there's really no good place for server-software settings
files anyway, so /opt is as good as anything else).

Anyway, regardless of this, we want to change all the Spring resource
references to use a URL property instead of a file path, and take out the
file:/// prefix.

-- Scott




More information about the dev mailing list