Package org.apereo.cas.util.spring
Class ApplicationContextProvider
- java.lang.Object
-
- org.apereo.cas.util.spring.ApplicationContextProvider
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class ApplicationContextProvider extends java.lang.Object implements org.springframework.context.ApplicationContextAwareAn implementation ofApplicationContextAwarethat statically holds the application context.- Since:
- 3.0.0.
-
-
Constructor Summary
Constructors Constructor Description ApplicationContextProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.springframework.context.ApplicationContextgetApplicationContext()static java.util.Optional<org.apereo.cas.authentication.attribute.AttributeDefinitionStore>getAttributeDefinitionStore()Gets attribute definition store.static java.util.Optional<org.apereo.services.persondir.IPersonAttributeDao>getAttributeRepository()Gets attribute repository.static java.util.Optional<org.apereo.cas.configuration.CasConfigurationProperties>getCasConfigurationProperties()Gets cas properties.static org.springframework.context.ConfigurableApplicationContextgetConfigurableApplicationContext()Gets configurable application context.static java.util.Optional<MessageSanitizer>getMessagSanitizer()Gets messag sanitizer.static java.util.List<org.apereo.cas.authentication.MultifactorAuthenticationPrincipalResolver>getMultifactorAuthenticationPrincipalResolvers()Gets multifactor authentication principal resolvers.static java.util.Optional<org.apereo.cas.authentication.principal.RegisteredServicePrincipalAttributesRepository>getPrincipalAttributesRepository()Gets principal attributes repository.static java.util.Optional<org.apereo.cas.authentication.principal.PrincipalAttributesRepositoryCache>getPrincipalAttributesRepositoryCache()Gets principal attributes repository cache.static java.util.Optional<ScriptResourceCacheManager<java.lang.String,ExecutableCompiledGroovyScript>>getScriptResourceCacheManager()Gets script resource cache manager.static voidholdApplicationContext(org.springframework.context.ApplicationContext ctx)Hold application context statically.static voidprocessBeanInjections(java.lang.Object bean)Process bean injections.static <T> TregisterBeanIntoApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext, java.lang.Class<T> beanClazz, java.lang.String beanId)Register bean into application context.static <T> TregisterBeanIntoApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext, T beanInstance, java.lang.String beanId)Register bean into application context t.voidsetApplicationContext(org.springframework.context.ApplicationContext context)
-
-
-
Method Detail
-
getApplicationContext
public static org.springframework.context.ApplicationContext getApplicationContext()
-
processBeanInjections
public static void processBeanInjections(java.lang.Object bean)
Process bean injections.- Parameters:
bean- the bean
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext context)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getMultifactorAuthenticationPrincipalResolvers
public static java.util.List<org.apereo.cas.authentication.MultifactorAuthenticationPrincipalResolver> getMultifactorAuthenticationPrincipalResolvers()
Gets multifactor authentication principal resolvers.- Returns:
- the multifactor authentication principal resolvers
-
holdApplicationContext
public static void holdApplicationContext(org.springframework.context.ApplicationContext ctx)
Hold application context statically.- Parameters:
ctx- the ctx
-
registerBeanIntoApplicationContext
public static <T> T registerBeanIntoApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext, java.lang.Class<T> beanClazz, java.lang.String beanId)Register bean into application context.- Type Parameters:
T- the type parameter- Parameters:
applicationContext- the application contextbeanClazz- the bean clazzbeanId- the bean id- Returns:
- the type registered
-
registerBeanIntoApplicationContext
public static <T> T registerBeanIntoApplicationContext(org.springframework.context.ConfigurableApplicationContext applicationContext, T beanInstance, java.lang.String beanId)Register bean into application context t.- Type Parameters:
T- the type parameter- Parameters:
applicationContext- the application contextbeanInstance- the bean instancebeanId- the bean id- Returns:
- the t
-
getCasConfigurationProperties
public static java.util.Optional<org.apereo.cas.configuration.CasConfigurationProperties> getCasConfigurationProperties()
Gets cas properties.- Returns:
- the cas properties
-
getAttributeRepository
public static java.util.Optional<org.apereo.services.persondir.IPersonAttributeDao> getAttributeRepository()
Gets attribute repository.- Returns:
- the attribute repository
-
getConfigurableApplicationContext
public static org.springframework.context.ConfigurableApplicationContext getConfigurableApplicationContext()
Gets configurable application context.- Returns:
- the configurable application context
-
getScriptResourceCacheManager
public static java.util.Optional<ScriptResourceCacheManager<java.lang.String,ExecutableCompiledGroovyScript>> getScriptResourceCacheManager()
Gets script resource cache manager.- Returns:
- the script resource cache manager
-
getAttributeDefinitionStore
public static java.util.Optional<org.apereo.cas.authentication.attribute.AttributeDefinitionStore> getAttributeDefinitionStore()
Gets attribute definition store.- Returns:
- the attribute definition store
-
getPrincipalAttributesRepository
public static java.util.Optional<org.apereo.cas.authentication.principal.RegisteredServicePrincipalAttributesRepository> getPrincipalAttributesRepository()
Gets principal attributes repository.- Returns:
- the principal attributes repository
-
getPrincipalAttributesRepositoryCache
public static java.util.Optional<org.apereo.cas.authentication.principal.PrincipalAttributesRepositoryCache> getPrincipalAttributesRepositoryCache()
Gets principal attributes repository cache.- Returns:
- the principal attributes repository cache
-
getMessagSanitizer
public static java.util.Optional<MessageSanitizer> getMessagSanitizer()
Gets messag sanitizer.- Returns:
- the messag sanitizer
-
-