Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Latest commit

 

History

History
51 lines (32 loc) · 1.56 KB

application-context.md

File metadata and controls

51 lines (32 loc) · 1.56 KB

Application Context

Introduction

The application context is the central interface for component injection.

Context Lifecycle

The application context has a lifecycle that determines what type of operation can be performed with the application context.

The lifecycle can be describe as the following steps:

  1. the context configuration phase
  2. the context start
  3. the execution phase
  4. the context stop

The context gets configured and, once started, becomes read-only.

Context Configuration

Not documented yet.

Annotation-Based Configuration

While an application context can be configured programmatically, the same result can be obtained declaratively.

This is achieved through the AnnotationConfigApplicationContext class.

Annotation-based configuration makes it possible to:

  • declare components that need to be registered, via the @ComponentScan decorator
  • declare other configurations that are dependencies, via the @Import decorator
  • provide component instances via methods annotated with a @Component decorator

More information regarding annotation-based configuration can be found in the Annotation-based Configuration chapter.

Context Start

Not documented yet.

Context Stop

Not documented yet.