Class 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). The reloadMappings() method then can be called to reload the mappings.
    Author:
    avasquez
    • Field Detail

      • mappingsFile

        protected org.springframework.core.io.Resource mappingsFile
      • mappings

        protected volatile Properties mappings
    • Constructor Detail

      • ReloadableMappingsSiteResolver

        public ReloadableMappingsSiteResolver()
    • 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 interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • reloadMappings

        public void reloadMappings()
                            throws org.craftercms.core.exception.CrafterException
        Throws:
        org.craftercms.core.exception.CrafterException
      • getSiteName

        public String getSiteName​(javax.servlet.http.HttpServletRequest request)
        Specified by:
        getSiteName in interface SiteResolver
      • loadMappings

        protected void loadMappings()
                             throws org.craftercms.core.exception.CrafterException
        Throws:
        org.craftercms.core.exception.CrafterException