Top Description Interfaces Classes
module spring.context

Package org.springframework.context

Annotations
@NonNullApi
@NonNullFields
Imports
org.springframework.lang.NonNullApi, .NonNullFields

This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.

There is no necessity for Spring applications to depend on ApplicationContext or even BeanFactory functionality explicitly. One of the strengths of the Spring architecture is that application objects can often be configured without any dependency on Spring-specific APIs.

Interface Summary

Modifier and TypeInterface and Description
public interface
ApplicationContext

Central interface to provide configuration for an application.

public interface
ApplicationContextAware

Interface to be implemented by any object that wishes to be notified of the ApplicationContext that it runs in.

Implementing this interface makes sense for example when an object requires access to a set of collaborating beans.

public interface
ApplicationContextInitializer<
the application context type
C extends ConfigurableApplicationContext
>

Callback interface for initializing a Spring ConfigurableApplicationContext prior to being refreshed.

public interface
ApplicationEventPublisher

Interface that encapsulates event publication functionality.

public interface
ApplicationEventPublisherAware

Interface to be implemented by any object that wishes to be notified of the ApplicationEventPublisher (typically the ApplicationContext) that it runs in.

public interface
ApplicationListener<
the specific ApplicationEvent subclass to listen to
E extends ApplicationEvent
>

Interface to be implemented by application event listeners.

public interface
ApplicationStartupAware

Interface to be implemented by any object that wishes to be notified of the ApplicationStartup that it runs with.

public interface
ConfigurableApplicationContext

SPI interface to be implemented by most if not all application contexts.

public interface
EmbeddedValueResolverAware

Interface to be implemented by any object that wishes to be notified of a StringValueResolver for the resolution of embedded definition values.

public interface
EnvironmentAware

Interface to be implemented by any bean that wishes to be notified of the Environment that it runs in.

public interface
HierarchicalMessageSource

Sub-interface of MessageSource to be implemented by objects that can resolve messages hierarchically.

public interface
Lifecycle

A common interface defining methods for start/stop lifecycle control.

public interface
LifecycleProcessor

Strategy interface for processing Lifecycle beans within the ApplicationContext.

public interface
MessageSource

Strategy interface for resolving messages, with support for the parameterization and internationalization of such messages.

public interface
MessageSourceAware

Interface to be implemented by any object that wishes to be notified of the MessageSource (typically the ApplicationContext) that it runs in.

Note that the MessageSource can usually also be passed in as a bean reference (via arbitrary bean properties or constructor arguments), because it is defined as a bean with name "messageSource" in the application context.

public interface
MessageSourceResolvable

Interface for objects that are suitable for message resolution in a MessageSource.

public interface
Phased

Interface for objects that may participate in a phased process such as lifecycle management.

public interface
ResourceLoaderAware

Interface to be implemented by any object that wishes to be notified of the ResourceLoader (typically the ApplicationContext) that it runs in. This is an alternative to a full ApplicationContext dependency via the org.springframework.context.ApplicationContextAware interface.

public interface
SmartLifecycle

An extension of the Lifecycle interface for those objects that require to be started upon ApplicationContext refresh and/or shutdown in a particular order.

Class Summary

Modifier and TypeClass and Description
public class
ApplicationContextException

Exception thrown during application context initialization.

public abstract class
ApplicationEvent

Class to be extended by all application events.

public class
NoSuchMessageException

Exception thrown when a message can't be resolved.

public class
PayloadApplicationEvent<
the payload type of the event
T
>

An ApplicationEvent that carries an arbitrary payload.