[
https://issues.apache.org/jira/browse/SYNAPSE-207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556396#action_12556396
]
Andreas Veithen commented on SYNAPSE-207:
-----------------------------------------
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.
> Support classpath resources in registry entries
> -----------------------------------------------
>
> Key: SYNAPSE-207
> URL: https://issues.apache.org/jira/browse/SYNAPSE-207
> Project: Synapse
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.1
> Reporter: Jose Luis Alba
> Assignee: Asankha C. Perera
> Priority: Minor
> Fix For: 1.1.1
>
>
> When defining a localEntry the src attribute specifies a URL resource. It
> would be useful to load the resources from classpath using something like
> (spring) src="classpath:someFile.xml".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]