It works! Thanks James. I was really glad to find out the URL Handlers resolve at runtime and not at startup. Great work!
Glad to hear it works
BTW I raised an issue so that when folks are not inside Karaf (e.g. they are inside a Java Container with no fabric8 code inside) we could have a similar way to access configuration using the file system and a system property / environment variable too: https://github.com/fabric8io/fabric8/issues/1452
Yeah I am not sure there is a non invasive way of registering custom url handlers in a JVM that would could leverage for JVMs with no fabric-agent inside.
Though I wonder if using a java-agent can be considered a non invasive way? Though I like the idea of copying those profile resources to a known location, then the url is just standard file based, and you do not have to use "profile:" which would tie the code to fabric.
Yeah - another approach could be a canonical REST API which includes the current container's ID in the URL so that the JVM doesn't need to try guess what its contianer ID and profiles are etc.
something like new URL(System.getProperty("fabric8.container.url") + "/profile/mythingy.json")
where the system property fabric8.container.url could be something like "http://localhost:8181/fabric8/containers/mycontainerid" or something.
The REST API might be a bit nicer really; as its a bit more flexible then and we can expose any information at all from the fabric cleanly as a little REST API.