In order to access configurations stored in the classpath,
a link must be created in the configuration
hierachy. The link configuration needs to be of type
org.sape.carbon.services.config.classloader.ClassloaderLinkNodeConfiguration
.
Within a ClassloaderLinkNodeConfiguration
.
To place the entire configuration structure into the classpath
use the CarbonConfigRoot.link
document and instance
of ClassloaderLinkNodeConfiguration
.
Property Name |
Description |
Required (Y/N) |
PathPrefix |
This is the prefix path to locate the resources
inside of a classpath. For example, if a jar file
contained the configuration resources inside of a
"config" directory, this would be set to config.
When a call is made to load a resrouce, this prefix
is prepended.
|
Y |
ClassloaderURLs |
URLs where configuration information is stored.
This may be valid file url (file://) or a
remote URL (http://).
|
N |
Example of a Local Classpath Link Configuration
<Configuration
ConfigurationInterface="org.sape.carbon.services.config.classloader.ClassloaderLinkNodeConfiguration">
<LinkNodeFactoryClass>org.sape.carbon.services.config.classloader.ClassloaderLinkNodeFactory</LinkNodeFactoryClass>
<PathPrefix>config/</PathPrefix>
</Configuration>
The above example stores the config inside of a local classpath.
For example, inside of an EAR file, there may be a CarbonConfig.jar,
which contains a "config" directory that holds configuration.
Example of a URL Classpath Link Configuration
<Configuration
ConfigurationInterface="org.sape.carbon.services.config.classloader.ClassloaderLinkNodeConfiguration">
<LinkNodeFactoryClass>org.sape.carbon.services.config.classloader.ClassloaderLinkNodeFactory</LinkNodeFactoryClass>
<PathPrefix>application-config/</PathPrefix>
<ClassloaderURLsArray>
<ClassloaderURLs>http://localhost:8080/</ClassloaderURLs>
</ClassloaderURLsArray>
</Configuration>
The above example stores the config inside an http server with documents
residing under http://localhost:8080/application-config
.