After receiving a site ID from the SiteContextPipelineServlet, the SiteContextManager (/atg/multisite/SiteContextManager
) uses it to create a SiteContext component for the current request by calling getSiteContext()
. The SiteContext component gives the current request thread access to site properties, and provides a mechanism for storing and retrieving transient attributes related to that site.
After the SiteContext component is created, the SiteContextPipelineServlet then calls the following methods on the SiteContextManager:
clearSiteContextStack()
ensures that the SiteContext stack is cleared out for this request, in case another request used this thread.pushSiteContext()
pushes the new SiteContext object onto the SiteContext stack, making it the SiteContext for the current thread.
Subsequent calls to SiteContextManager.getCurrentSite()
return this SiteContext. Also, if a request resolves a reference to the component at /atg/multisite/SiteContext
, it receives an implementation of SiteContext that routes all method calls to the SiteContext returned by SiteContextManager.getCurrentSite()
.