Class SiteContext
java.lang.Object
org.craftercms.engine.service.context.SiteContext
Wrapper for a
Context
that adds properties specific to Crafter Engine.- Author:
- Alfonso Vásquez
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]
protected org.springframework.context.ConfigurableApplicationContext
protected org.craftercms.core.util.cache.CacheTemplate
protected SiteCacheWarmer
protected URLClassLoader
protected org.apache.commons.configuration2.HierarchicalConfiguration
protected org.craftercms.core.service.Context
protected String
protected boolean
protected org.springframework.web.servlet.view.freemarker.FreeMarkerConfig
protected org.springframework.context.ApplicationContext
protected graphql.GraphQL
protected GraphQLFactory
protected CountDownLatch
protected String
protected long
protected org.springframework.web.servlet.LocaleResolver
protected ExecutorService
protected org.apache.commons.configuration2.HierarchicalConfiguration
protected String
protected org.quartz.Scheduler
protected ScriptFactory
protected org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor
protected String
protected SiteContext.State
protected String
protected org.craftercms.core.service.ContentStoreService
protected String
protected org.apache.commons.configuration2.HierarchicalConfiguration
protected org.tuckey.web.filters.urlrewrite.UrlRewriter
protected org.craftercms.core.url.UrlTransformationEngine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
static void
clear()
Removes the context from the current thread.void
destroy()
boolean
protected void
String[]
org.springframework.context.ConfigurableApplicationContext
org.craftercms.core.util.cache.CacheTemplate
org.apache.commons.configuration2.HierarchicalConfiguration
org.craftercms.core.service.Context
static SiteContext
Returns the context for the current thread.org.springframework.web.servlet.view.freemarker.FreeMarkerConfig
<T> T
getFromCache
(org.craftercms.commons.lang.Callback<T> loader, Object... keyElements) static <T> T
getFromCurrentCache
(org.craftercms.commons.lang.Callback<T> loader, Object... keyElements) Returns the item from the cache of the current site context.org.springframework.context.ApplicationContext
graphql.GraphQL
org.springframework.web.servlet.LocaleResolver
org.apache.commons.configuration2.HierarchicalConfiguration
org.quartz.Scheduler
getState()
org.craftercms.core.service.ContentStoreService
org.apache.commons.configuration2.HierarchicalConfiguration
org.tuckey.web.filters.urlrewrite.UrlRewriter
org.craftercms.core.url.UrlTransformationEngine
int
hashCode()
void
init
(boolean waitTillFinished) boolean
boolean
boolean
isValid()
protected void
publishEvent
(SiteEvent event) protected static void
release
(SiteContext siteContext) void
setAllowedTemplatePaths
(String[] allowedTemplatePaths) void
setApplicationContext
(org.springframework.context.ConfigurableApplicationContext applicationContext) void
setCacheTemplate
(org.craftercms.core.util.cache.CacheTemplate cacheTemplate) void
setCacheWarmer
(SiteCacheWarmer cacheWarmer) void
setClassLoader
(URLClassLoader classLoader) void
setConfig
(org.apache.commons.configuration2.HierarchicalConfiguration config) void
setContext
(org.craftercms.core.service.Context context) void
setControllerScriptsPath
(String controllerScriptsPath) static void
setCurrent
(SiteContext siteContext) Sets the context for the current thread.void
setFallback
(boolean fallback) void
setFreeMarkerConfig
(org.springframework.web.servlet.view.freemarker.FreeMarkerConfig freeMarkerConfig) void
setGlobalApplicationContext
(org.springframework.context.ApplicationContext globalApplicationContext) void
setGraphQLFactory
(GraphQLFactory graphQLFactory) void
setInitScriptPath
(String initScriptPath) void
setInitTimeout
(long initTimeout) void
setLocaleResolver
(org.springframework.web.servlet.LocaleResolver localeResolver) void
setProxyConfig
(org.apache.commons.configuration2.HierarchicalConfiguration proxyConfig) void
setRestScriptsPath
(String restScriptsPath) void
setScheduler
(org.quartz.Scheduler scheduler) void
setScriptFactory
(ScriptFactory scriptFactory) void
setServletContext
(jakarta.servlet.ServletContext servletContext) void
setShutdownTimeout
(long shutdownTimeout) void
setSiteName
(String siteName) void
setStaticAssetsPath
(String staticAssetsPath) void
setStoreService
(org.craftercms.core.service.ContentStoreService storeService) void
setTemplatesPath
(String templatesPath) void
setTranslationConfig
(org.apache.commons.configuration2.HierarchicalConfiguration translationConfig) void
setUrlRewriter
(org.tuckey.web.filters.urlrewrite.UrlRewriter urlRewriter) void
setUrlTransformationEngine
(org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine) void
void
startCacheClear
(Runnable callback) void
void
startGraphQLSchemaBuild
(Runnable callback) toString()
-
Field Details
-
storeService
protected org.craftercms.core.service.ContentStoreService storeService -
cacheTemplate
protected org.craftercms.core.util.cache.CacheTemplate cacheTemplate -
siteName
-
context
protected org.craftercms.core.service.Context context -
fallback
protected boolean fallback -
staticAssetsPath
-
templatesPath
-
allowedTemplatePaths
-
restScriptsPath
-
controllerScriptsPath
-
initScriptPath
-
freeMarkerConfig
protected org.springframework.web.servlet.view.freemarker.FreeMarkerConfig freeMarkerConfig -
urlTransformationEngine
protected org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine -
scriptFactory
-
config
protected org.apache.commons.configuration2.HierarchicalConfiguration config -
globalApplicationContext
protected org.springframework.context.ApplicationContext globalApplicationContext -
applicationContext
protected org.springframework.context.ConfigurableApplicationContext applicationContext -
classLoader
-
urlRewriter
protected org.tuckey.web.filters.urlrewrite.UrlRewriter urlRewriter -
scheduler
protected org.quartz.Scheduler scheduler -
graphQLFactory
-
cacheWarmer
-
proxyConfig
protected org.apache.commons.configuration2.HierarchicalConfiguration proxyConfig -
translationConfig
protected org.apache.commons.configuration2.HierarchicalConfiguration translationConfig -
localeResolver
protected org.springframework.web.servlet.LocaleResolver localeResolver -
initTimeout
protected long initTimeout -
initializationLatch
-
maintenanceTaskExecutor
-
graphQL
protected graphql.GraphQL graphQL -
state
-
scriptSandbox
protected org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor scriptSandbox
-
-
Constructor Details
-
SiteContext
public SiteContext()
-
-
Method Details
-
getCurrent
Returns the context for the current thread. -
getFromCurrentCache
public static <T> T getFromCurrentCache(org.craftercms.commons.lang.Callback<T> loader, Object... keyElements) Returns the item from the cache of the current site context. If there's no current site context, the loader is called directly to get the item.- Parameters:
loader
- the loader used to retrieve the item if it's not in cachekeyElements
- the elements that conform the key- Returns:
- the cached item
-
setCurrent
Sets the context for the current thread. -
clear
public static void clear()Removes the context from the current thread. -
release
-
getStoreService
public org.craftercms.core.service.ContentStoreService getStoreService() -
setStoreService
public void setStoreService(org.craftercms.core.service.ContentStoreService storeService) -
getCacheTemplate
public org.craftercms.core.util.cache.CacheTemplate getCacheTemplate() -
setCacheTemplate
public void setCacheTemplate(org.craftercms.core.util.cache.CacheTemplate cacheTemplate) -
getSiteName
-
setSiteName
-
getContext
public org.craftercms.core.service.Context getContext() -
setContext
public void setContext(org.craftercms.core.service.Context context) -
isFallback
public boolean isFallback() -
setFallback
public void setFallback(boolean fallback) -
getStaticAssetsPath
-
setStaticAssetsPath
-
getTemplatesPath
-
setTemplatesPath
-
getAllowedTemplatePaths
-
setAllowedTemplatePaths
-
getRestScriptsPath
-
setRestScriptsPath
-
getControllerScriptsPath
-
setControllerScriptsPath
-
getInitScriptPath
-
setInitScriptPath
-
getFreeMarkerConfig
public org.springframework.web.servlet.view.freemarker.FreeMarkerConfig getFreeMarkerConfig() -
setFreeMarkerConfig
public void setFreeMarkerConfig(org.springframework.web.servlet.view.freemarker.FreeMarkerConfig freeMarkerConfig) -
getUrlTransformationEngine
public org.craftercms.core.url.UrlTransformationEngine getUrlTransformationEngine() -
setUrlTransformationEngine
public void setUrlTransformationEngine(org.craftercms.core.url.UrlTransformationEngine urlTransformationEngine) -
getScriptFactory
-
setScriptFactory
-
getConfig
public org.apache.commons.configuration2.HierarchicalConfiguration getConfig() -
setConfig
public void setConfig(org.apache.commons.configuration2.HierarchicalConfiguration config) -
setServletContext
public void setServletContext(jakarta.servlet.ServletContext servletContext) -
getGlobalApplicationContext
public org.springframework.context.ApplicationContext getGlobalApplicationContext() -
setGlobalApplicationContext
public void setGlobalApplicationContext(org.springframework.context.ApplicationContext globalApplicationContext) -
getApplicationContext
public org.springframework.context.ConfigurableApplicationContext getApplicationContext() -
setApplicationContext
public void setApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext) -
getClassLoader
-
setClassLoader
-
getUrlRewriter
public org.tuckey.web.filters.urlrewrite.UrlRewriter getUrlRewriter() -
setUrlRewriter
public void setUrlRewriter(org.tuckey.web.filters.urlrewrite.UrlRewriter urlRewriter) -
getScheduler
public org.quartz.Scheduler getScheduler() -
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler) -
getGraphQLFactory
-
setGraphQLFactory
-
getCacheWarmer
-
setCacheWarmer
-
setInitTimeout
public void setInitTimeout(long initTimeout) -
setShutdownTimeout
public void setShutdownTimeout(long shutdownTimeout) -
getGraphQL
public graphql.GraphQL getGraphQL() -
getProxyConfig
public org.apache.commons.configuration2.HierarchicalConfiguration getProxyConfig() -
setProxyConfig
public void setProxyConfig(org.apache.commons.configuration2.HierarchicalConfiguration proxyConfig) -
getTranslationConfig
public org.apache.commons.configuration2.HierarchicalConfiguration getTranslationConfig() -
setTranslationConfig
public void setTranslationConfig(org.apache.commons.configuration2.HierarchicalConfiguration translationConfig) -
isTranslationEnabled
public boolean isTranslationEnabled() -
getLocaleResolver
public org.springframework.web.servlet.LocaleResolver getLocaleResolver() -
setLocaleResolver
public void setLocaleResolver(org.springframework.web.servlet.LocaleResolver localeResolver) -
isValid
public boolean isValid() throws org.craftercms.core.exception.CrafterException- Throws:
org.craftercms.core.exception.CrafterException
-
getState
-
init
-
startCacheClear
public void startCacheClear() -
startCacheClear
-
startGraphQLSchemaBuild
- Throws:
GraphQLBuildException
-
startGraphQLSchemaBuild
- Throws:
GraphQLBuildException
-
destroy
public void destroy() throws org.craftercms.core.exception.CrafterException- Throws:
org.craftercms.core.exception.CrafterException
-
getFromCache
-
cacheClear
protected void cacheClear() -
buildGraphQLSchema
protected void buildGraphQLSchema() -
executeInitScript
protected void executeInitScript() -
publishEvent
-
equals
-
hashCode
public int hashCode() -
toString
-