Class ReloadableMappingsSiteResolver
- java.lang.Object
-
- org.craftercms.engine.service.context.ReloadableMappingsSiteResolver
-
- All Implemented Interfaces:
SiteListResolver
,SiteResolver
,org.springframework.beans.factory.InitializingBean
public class ReloadableMappingsSiteResolver extends Object implements SiteListResolver, SiteResolver, org.springframework.beans.factory.InitializingBean
SiteResolver
that resolves the current site name from a mapping of the request domain name to site name. These mappings are dynamic in that anytime while Engine is running they can change (ones can be added and others removed). ThereloadMappings()
method then can be called to reload the mappings.- Author:
- avasquez
-
-
Field Summary
Fields Modifier and Type Field Description protected Properties
mappings
protected org.springframework.core.io.Resource
mappingsFile
protected SiteContextManager
siteContextManager
-
Constructor Summary
Constructors Constructor Description ReloadableMappingsSiteResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
Collection<String>
getSiteList()
Returns the entire list of sites.String
getSiteName(javax.servlet.http.HttpServletRequest request)
protected void
loadMappings()
void
reloadMappings()
void
setMappingsFile(org.springframework.core.io.Resource mappingsFile)
void
setSiteContextManager(SiteContextManager siteContextManager)
-
-
-
Field Detail
-
mappingsFile
protected org.springframework.core.io.Resource mappingsFile
-
siteContextManager
protected SiteContextManager siteContextManager
-
mappings
protected volatile Properties mappings
-
-
Method Detail
-
setMappingsFile
public void setMappingsFile(org.springframework.core.io.Resource mappingsFile)
-
setSiteContextManager
public void setSiteContextManager(SiteContextManager siteContextManager)
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
reloadMappings
public void reloadMappings() throws org.craftercms.core.exception.CrafterException
- Throws:
org.craftercms.core.exception.CrafterException
-
getSiteList
public Collection<String> getSiteList()
Description copied from interface:SiteListResolver
Returns the entire list of sites.- Specified by:
getSiteList
in interfaceSiteListResolver
-
getSiteName
public String getSiteName(javax.servlet.http.HttpServletRequest request)
- Specified by:
getSiteName
in interfaceSiteResolver
-
loadMappings
protected void loadMappings() throws org.craftercms.core.exception.CrafterException
- Throws:
org.craftercms.core.exception.CrafterException
-
-