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

    • mappingsFile

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

      protected SiteContextManager siteContextManager
    • mappings

      protected volatile Properties mappings
  • Constructor Details

    • ReloadableMappingsSiteResolver

      public ReloadableMappingsSiteResolver(org.springframework.core.io.Resource mappingsFile, SiteContextManager siteContextManager)
  • Method Details

    • 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
    • getSiteList

      public Collection<String> getSiteList()
      Description copied from interface: SiteListResolver
      Returns the entire list of sites.
      Specified by:
      getSiteList in interface SiteListResolver
    • getSiteName

      public String getSiteName(jakarta.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