public class SpringContextSingleton extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<JahiaTemplateManagerService.TemplatePackageRedeployedEvent>
| Modifier and Type | Method and Description |
|---|---|
static Object |
getBean(String beanId)
Returns an instance of the requested bean.
|
static Object |
getBeanInModulesContext(String beanId) |
static <T> Map<String,T> |
getBeansOfType(org.springframework.context.ApplicationContext applicationContext,
Class<T> clazz)
Returns a map with beans of the specified type
If applicationContext is root context, only look in this context
Otherwise, lookup in all modules context.
|
static <T> Map<String,T> |
getBeansOfType(Class<T> type)
Returns a map with beans of the specified type, including beans in modules.
|
org.springframework.context.ApplicationContext |
getContext()
Returns the Spring application context instance.
|
static SpringContextSingleton |
getInstance() |
org.springframework.core.io.Resource[] |
getResources(String locationPatterns)
Searches for Spring resource locations given the specified (pattern-based) location.
|
org.springframework.core.io.Resource[] |
getResources(String locationPatterns,
boolean useCache)
Searches for Spring resource locations given the specified (pattern-based) location.
|
boolean |
isInitialized() |
void |
onApplicationEvent(JahiaTemplateManagerService.TemplatePackageRedeployedEvent event) |
void |
publishEvent(org.springframework.context.ApplicationEvent event)
Publishes the specified event in the core Spring context and publishes to each module's context.
|
void |
publishEvent(org.springframework.context.ApplicationEvent event,
boolean propagateToModules)
Publishes the specified event in the core Spring context and if
propagateToModules is set to true, publishes that event
to each module's context. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
public static Object getBean(String beanId)
beanId - the requested bean IDpublic static <T> Map<String,T> getBeansOfType(Class<T> type) throws org.springframework.beans.BeansException
type - the bean type to search fororg.springframework.beans.BeansException - in case of a lookup errorpublic static <T> Map<String,T> getBeansOfType(org.springframework.context.ApplicationContext applicationContext, Class<T> clazz)
applicationContext - the context to look for bean classes inclazz - the bean type to search fororg.springframework.beans.BeansException - in case of a lookup errorpublic static SpringContextSingleton getInstance()
public org.springframework.context.ApplicationContext getContext()
public void publishEvent(org.springframework.context.ApplicationEvent event)
ApplicationEventMulticaster.multicastEvent(ApplicationEvent) method is used to skip publishing event to the
module's parent context (which is our Spring core context).event - the Spring event to be publishedpublic void publishEvent(org.springframework.context.ApplicationEvent event,
boolean propagateToModules)
propagateToModules is set to true, publishes that event
to each module's context. When publishing the event to a module, the
ApplicationEventMulticaster.multicastEvent(ApplicationEvent) method is used to skip publishing event to the module's parent
context (which is our Spring core context).event - the Spring event to be publishedpropagateToModules - whether to propagate the event to all modulespublic boolean isInitialized()
public void onApplicationEvent(JahiaTemplateManagerService.TemplatePackageRedeployedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<JahiaTemplateManagerService.TemplatePackageRedeployedEvent>public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic org.springframework.core.io.Resource[] getResources(String locationPatterns) throws IOException
ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS ).locationPatterns - (pattern-based) location to search for resources. Multiple locations can be provided separated by comma (or any delimiter,
defined in ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS )Resource objects foundIOException - in case of a lookup errorpublic org.springframework.core.io.Resource[] getResources(String locationPatterns, boolean useCache) throws IOException
ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS ).locationPatterns - (pattern-based) location to search for resources. Multiple locations can be provided separated by comma (or any delimiter,
defined in ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS )useCache - can we use lookup caches?Resource objects foundIOException - in case of a lookup errorCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.