Spring applicationcontext java class

Interface ApplicationContext

Central interface to provide configuration for an application. This is read-only while the application is running, but may be reloaded if the implementation supports this.

  • Bean factory methods for accessing application components. Inherited from ListableBeanFactory .
  • The ability to load file resources in a generic fashion. Inherited from the ResourceLoader interface.
  • The ability to publish events to registered listeners. Inherited from the ApplicationEventPublisher interface.
  • The ability to resolve messages, supporting internationalization. Inherited from the MessageSource interface.
  • Inheritance from a parent context. Definitions in a descendant context will always take priority. This means, for example, that a single parent context can be used by an entire web application, while each servlet has its own child context that is independent of that of any other servlet.

Field Summary

Fields inherited from interface org.springframework.beans.factory.BeanFactory

Fields inherited from interface org.springframework.core.io.ResourceLoader

Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver

Method Summary

Return the parent context, or null if there is no parent and this is the root of the context hierarchy.

Methods inherited from interface org.springframework.context.ApplicationEventPublisher

Methods inherited from interface org.springframework.beans.factory.BeanFactory

Methods inherited from interface org.springframework.core.env.EnvironmentCapable

Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory

Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory

Methods inherited from interface org.springframework.context.MessageSource

Methods inherited from interface org.springframework.core.io.ResourceLoader

Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver

Method Details

getId

getApplicationName

getDisplayName

getStartupDate

getParent

Return the parent context, or null if there is no parent and this is the root of the context hierarchy.

Читайте также:  Основы языка web программирования html

getAutowireCapableBeanFactory

Expose AutowireCapableBeanFactory functionality for this context. This is not typically used by application code, except for the purpose of initializing bean instances that live outside the application context, applying the Spring bean lifecycle (fully or partly) to them. Alternatively, the internal BeanFactory exposed by the ConfigurableApplicationContext interface offers access to the AutowireCapableBeanFactory interface too. The present method mainly serves as a convenient, specific facility on the ApplicationContext interface. NOTE: As of 4.2, this method will consistently throw IllegalStateException after the application context has been closed. In current Spring Framework versions, only refreshable application contexts behave that way; as of 4.2, all application context implementations will be required to comply.

Источник

Uses of Interface
org.springframework.context.ApplicationContext

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.

Annotation support for the Application Context, including JSR-250 «common» annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.

Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.

Support package for declarative messaging configuration, with Java configuration and XML schema support.

Common infrastructure for invoking message handler methods with non-blocking, and reactive contracts.

Support classes for the open source scheduler Quartz, allowing to set up Quartz Schedulers, JobDetails and Triggers as beans in a Spring context.

This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.

Core support for integrating the Spring TestContext Framework with the JUnit Jupiter extension model in JUnit 5.

Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator) into a Spring ApplicationContext and in particular with Spring’s data binding and validation APIs.

Contains a variant of the application context interface for web applications, and the ContextLoaderListener that bootstraps a root web application context.

Classes supporting the org.springframework.web.context package, such as WebApplicationContext implementations and various utility classes.

Common infrastructure for handler method processing, as used by Spring MVC’s org.springframework.web.servlet.mvc.method package.

Top-level package for the spring-webflux module that contains DispatcherHandler , the main entry point for WebFlux server endpoint processing including key contracts used to map requests to handlers, invoke them, and process the result.

Источник

Оцените статью