abstract class AbstractXmlApplicationContext : AbstractRefreshableConfigApplicationContext
Convenient base class for org.springframework.context.ApplicationContext implementations, drawing configuration from XML documents containing bean definitions understood by an org.springframework.beans.factory.xml.XmlBeanDefinitionReader. Subclasses just have to implement the |
|
abstract class ApplicationObjectSupport : ApplicationContextAware
Convenient superclass for application objects that want to be aware of the application context, e.g. for custom lookup of collaborating beans or for context-specific resource access. It saves the application context reference and provides an initialization callback method. Furthermore, it offers numerous convenience methods for message lookup. There is no requirement to subclass this class: It just makes things a little easier if you need access to the context, e.g. for access to file resources or to the message source. Note that many application objects do not need to be aware of the application context at all, as they can receive collaborating beans via bean references. Many framework classes are derived from this class, particularly within the web support. |
|
open class BeanDefinitionDsl : ApplicationContextInitializer<GenericApplicationContext>
Class implementing functional bean definition Kotlin DSL. |
|
open class ClassPathXmlApplicationContext : AbstractXmlApplicationContext
Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g. "mypackage/myresource.txt"). Useful for test harnesses as well as for application contexts embedded within JARs. The config location defaults can be overridden via Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file. This is a simple, one-stop shop convenience ApplicationContext. Consider using the GenericApplicationContext class in combination with an org.springframework.beans.factory.xml.XmlBeanDefinitionReader for more flexible context setup. |
|
open class ConversionServiceFactoryBean : FactoryBean<ConversionService>, InitializingBean
A factory providing convenient access to a ConversionService configured with converters appropriate for most environments. Set the This implementation creates a DefaultConversionService. Subclasses may override Like all |
|
open class DefaultLifecycleProcessor : LifecycleProcessor, BeanFactoryAware
Default implementation of the LifecycleProcessor strategy. |
|
open class DefaultMessageSourceResolvable : MessageSourceResolvable, Serializable
Default implementation of the MessageSourceResolvable interface. Offers an easy way to store all the necessary values needed to resolve a message via a org.springframework.context.MessageSource. |
|
open class DelegatingMessageSource : MessageSourceSupport, HierarchicalMessageSource
Empty MessageSource that delegates all calls to the parent MessageSource. If no parent is available, it simply won't resolve any message. Used as placeholder by AbstractApplicationContext, if the context doesn't define its own MessageSource. Not intended for direct use in applications. |
|
open class EmbeddedValueResolutionSupport : EmbeddedValueResolverAware
Convenient base class for components with a need for embedded value resolution (i.e. org.springframework.context.EmbeddedValueResolverAware consumers). |
|
open class FileSystemXmlApplicationContext : AbstractXmlApplicationContext
Standalone XML application context, taking the context definition files from the file system or from URLs, interpreting plain paths as relative file system locations (e.g. "mydir/myfile.txt"). Useful for test harnesses as well as for standalone environments. NOTE: Plain paths will always be interpreted as relative to the current VM working directory, even if they start with a slash. (This is consistent with the semantics in a Servlet container.) Use an explicit "file:" prefix to enforce an absolute file path. The config location defaults can be overridden via Note: In case of multiple config locations, later bean definitions will override ones defined in earlier loaded files. This can be leveraged to deliberately override certain bean definitions via an extra XML file. This is a simple, one-stop shop convenience ApplicationContext. Consider using the GenericApplicationContext class in combination with an org.springframework.beans.factory.xml.XmlBeanDefinitionReader for more flexible context setup. |
|
open class GenericGroovyApplicationContext : GenericApplicationContext, GroovyObject
An org.springframework.context.ApplicationContext implementation that extends GenericApplicationContext and implements GroovyObject such that beans can be retrieved with the dot de-reference syntax instead of using Consider this as the equivalent of GenericXmlApplicationContext for Groovy bean definitions, or even an upgrade thereof since it seamlessly understands XML bean definition files as well. The main difference is that, within a Groovy script, the context can be used with an inline bean definition closure as follows:
Alternatively, load a Groovy bean definition script like the following from an external resource (e.g. an "applicationContext.groovy" file):
With the following Java code creating the
Or even more concise, provided that no extra configuration is needed:
This application context also understands XML bean definition files, allowing for seamless mixing and matching with Groovy bean definition files. ".xml" files will be parsed as XML content; all other kinds of resources will be parsed as Groovy scripts. |
|
open class GenericXmlApplicationContext : GenericApplicationContext
Convenient application context with built-in XML support. This is a flexible alternative to ClassPathXmlApplicationContext and FileSystemXmlApplicationContext, to be configured via setters, with an eventual In case of multiple configuration files, bean definitions in later files will override those defined in earlier files. This can be leveraged to intentionally override certain bean definitions via an extra configuration file appended to the list. |
|
open class LiveBeansView : LiveBeansViewMBean, ApplicationContextAware
Adapter for live beans view exposure, building a snapshot of current beans and their dependencies from either a local Note: This feature is still in beta and primarily designed for use with Spring Tool Suite 3.1 and higher. |
|
interface LiveBeansViewMBean
MBean operation interface for the LiveBeansView feature. |
|
open class MessageSourceResourceBundle : ResourceBundle
Helper class that allows for accessing a Spring org.springframework.context.MessageSource as a java.util.ResourceBundle. Used for example to expose a Spring MessageSource to JSTL web views. |
|
abstract class MessageSourceSupport
Base class for message source implementations, providing support infrastructure such as java.text.MessageFormat handling but not implementing concrete methods defined in the org.springframework.context.MessageSource. AbstractMessageSource derives from this class, providing concrete |
|
open class PropertySourcesPlaceholderConfigurer : PlaceholderConfigurerSupport, EnvironmentAware
Specialization of PlaceholderConfigurerSupport that resolves ${...} placeholders within bean definition property values and This class is designed as a general replacement for Any local properties (e.g. those added via See org.springframework.core.env.ConfigurableEnvironment and related javadocs for details on manipulating environment property sources. |
|
open class ReloadableResourceBundleMessageSource : AbstractResourceBasedMessageSource, ResourceLoaderAware
Spring-specific org.springframework.context.MessageSource implementation that accesses resource bundles using specified basenames, participating in the Spring org.springframework.context.ApplicationContext's resource loading. In contrast to the JDK-based ResourceBundleMessageSource, this class uses java.util.Properties instances as its custom data structure for messages, loading them via a org.springframework.util.PropertiesPersister strategy from Spring Resource handles. This strategy is not only capable of reloading files based on timestamp changes, but also of loading properties files with a specific character encoding. It will detect XML property files as well. Note that the basenames set as For a typical web application, message files could be placed in This MessageSource can easily be used outside of an org.springframework.context.ApplicationContext: it will use a org.springframework.core.io.DefaultResourceLoader as default, simply getting overridden with the ApplicationContext's resource loader if running in a context. It does not have any other specific dependencies. Thanks to Thomas Achleitner for providing the initial implementation of this message source! |
|
open class ResourceBundleMessageSource : AbstractResourceBasedMessageSource, BeanClassLoaderAware
org.springframework.context.MessageSource implementation that accesses resource bundles using specified basenames. This class relies on the underlying JDK's java.util.ResourceBundle implementation, in combination with the JDK's standard message parsing provided by java.text.MessageFormat. This MessageSource caches both the accessed ResourceBundle instances and the generated MessageFormats for each message. It also implements rendering of no-arg messages without MessageFormat, as supported by the AbstractMessageSource base class. The caching provided by this MessageSource is significantly faster than the built-in caching of the The basenames follow java.util.ResourceBundle conventions: essentially, a fully-qualified classpath location. If it doesn't contain a package qualifier (such as |
|
open class SimpleThreadScope : Scope
A simple thread-backed Scope implementation. NOTE: This thread scope is not registered by default in common contexts. Instead, you need to explicitly assign it to a scope key in your setup, either through
For an implementation of a thread-based Thanks to Eugene Kuleshov for submitting the original prototype for a thread scope! |
|
open class StaticApplicationContext : GenericApplicationContext
org.springframework.context.ApplicationContext implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources. Mainly useful for testing. |
|
open class StaticMessageSource : AbstractMessageSource
Simple implementation of org.springframework.context.MessageSource which allows messages to be registered programmatically. This MessageSource supports basic internationalization. Intended for testing rather than for use in production systems. |
fun GenericApplicationContext(configure: GenericApplicationContext.() -> Unit): GenericApplicationContext
Extension for GenericApplicationContext allowing |
|
fun beans(init: BeanDefinitionDsl.() -> Unit): BeanDefinitionDsl
Functional bean definition Kotlin DSL. |
|
fun <T : Any> GenericApplicationContext.registerBean(vararg customizers: BeanDefinitionCustomizer): Unit
Extension for GenericApplicationContext.registerBean providing a
fun <T : Any> GenericApplicationContext.registerBean(beanName: String, vararg customizers: BeanDefinitionCustomizer): Unit
Extension for GenericApplicationContext.registerBean providing a
fun <T : Any> GenericApplicationContext.registerBean(vararg customizers: BeanDefinitionCustomizer, function: (ApplicationContext) -> T): Unit
Extension for GenericApplicationContext.registerBean providing a fun <T : Any> GenericApplicationContext.registerBean(name: String, vararg customizers: BeanDefinitionCustomizer, function: (ApplicationContext) -> T): Unit
Extension for GenericApplicationContext.registerBean providing a
|