The Spring framework defines a ResourceLoader interface as a replacement for the URLStreamHandlerFactory mechanism. The DefaultResourceLoader handles standard URLs (those supported by the JRE) as well as classpath: URLs. There are also implementations that support servlet context resources properly.
Note that in my comment above I said that "The URLStreamHandlerFactory solution has one big advantage, which is that it is completely transparent, i.e. there is no need to modify code and it also works with third party libraries." The blog article you cite also says something along those lines. However this is actually incorrect. The reason is that you can always translate a classpath: URL into a URL supported by the JRE (either jar: or file: in the standalone case or jndi: in the servlet container case).
Actually the modifications required to support this in Synapse would be:
- In the initialization code (ServerManager?) create an appropriate ResourceLoader instance.
- In the code that parses the configuration (and only there, but except endpoint URLs obviously), all expressions that create URL objects from Strings should be replaced by a call to ResourceLoader#getResource#getURL. This will produce a standard URL to access the resource.
The only thing still to investigate is what will happen in the code that serializes the Synapse configuration to XML.