public class ResourceModuleRegistry extends AbstractModuleRegistry implements org.springframework.context.ResourceLoaderAware
Resource
based implementation of ModuleRegistry
that supports two kinds of modules:
source/time.xml
source/time/config/time.xml
and extra classpath is loaded from jars in a lib subdirectory
e.g. source/time/lib/*.jar
Constructor and Description |
---|
ResourceModuleRegistry(java.lang.String root) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
inferModuleName(org.springframework.core.io.Resource resource)
Recover the name of the module, given its resource location.
|
protected org.springframework.core.io.Resource |
locateApplicationContext(java.lang.String name,
ModuleType type)
Return a resource pointing to an
ApplicationContext XML definition file. |
protected java.util.List<org.springframework.core.io.Resource> |
locateApplicationContexts(ModuleType type)
Return a list of resources pointing to
ApplicationContext XML definition files. |
protected java.net.URL[] |
maybeLocateClasspath(org.springframework.core.io.Resource resource,
java.lang.String name,
ModuleType type)
Return an array of jar files locations or
null if the module is a plain xml file. |
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
findDefinition, findDefinitions, findDefinitions, findDefinitions
protected org.springframework.core.io.Resource locateApplicationContext(java.lang.String name, ModuleType type)
AbstractModuleRegistry
ApplicationContext
XML definition file.locateApplicationContext
in class AbstractModuleRegistry
protected java.net.URL[] maybeLocateClasspath(org.springframework.core.io.Resource resource, java.lang.String name, ModuleType type)
AbstractModuleRegistry
null
if the module is a plain xml file. Default implementation
returns null
system.maybeLocateClasspath
in class AbstractModuleRegistry
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
protected java.util.List<org.springframework.core.io.Resource> locateApplicationContexts(ModuleType type)
AbstractModuleRegistry
ApplicationContext
XML definition files.locateApplicationContexts
in class AbstractModuleRegistry
protected java.lang.String inferModuleName(org.springframework.core.io.Resource resource)
AbstractModuleRegistry
inferModuleName
in class AbstractModuleRegistry