public class ReloadableMappingsSiteResolver extends Object implements SiteListResolver, SiteResolver
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). The reloadMappings()
method then can be called to
reload the mappings.Modifier and Type | Field and Description |
---|---|
protected Properties |
mappings |
protected org.springframework.core.io.Resource |
mappingsFile |
protected SiteContextManager |
siteContextManager |
Constructor and Description |
---|
ReloadableMappingsSiteResolver() |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getSiteList()
Returns the entire list of sites.
|
String |
getSiteName(javax.servlet.http.HttpServletRequest request) |
void |
init() |
protected void |
loadMappings() |
void |
reloadMappings() |
void |
setMappingsFile(org.springframework.core.io.Resource mappingsFile) |
void |
setSiteContextManager(SiteContextManager siteContextManager) |
protected org.springframework.core.io.Resource mappingsFile
protected SiteContextManager siteContextManager
protected volatile Properties mappings
public void setMappingsFile(org.springframework.core.io.Resource mappingsFile)
public void setSiteContextManager(SiteContextManager siteContextManager)
@PostConstruct public void init() throws Exception
Exception
public void reloadMappings() throws org.craftercms.core.exception.CrafterException
org.craftercms.core.exception.CrafterException
public Collection<String> getSiteList()
SiteListResolver
getSiteList
in interface SiteListResolver
public String getSiteName(javax.servlet.http.HttpServletRequest request)
getSiteName
in interface SiteResolver
protected void loadMappings() throws org.craftercms.core.exception.CrafterException
org.craftercms.core.exception.CrafterException
Copyright © 2020 CrafterCMS. All rights reserved.