- Hands-On Microservices with Kotlin
- Juan Antonio Medina Iglesias
- 181字
- 2021-06-30 19:10:56
Creating an application object
The @SpringBootApplication annotation provides a convenient way to bootstrap a Spring application that can be started from a main() method. In many situations, you can just delegate to the static runApplication method:
@SpringBootApplication
class Chapter2Application
fun main(args: Array<String>) {
runApplication<Chapter2Application>(*args)
}
You can see that we have used the @SpringBootApplication annotation for marking a class that we will use as our application context. We will learn more about the Spring Application Context shortly.
When a Spring Boot application starts it will autoconfigure all the required systems; if it is a web app, it will start a web application.
Spring Boot provides an embedded Tomcat server that will start when our application starts. This is a fully functional server, so it's not required to deploy our software in any application server. However, Spring allows us to do it. We will discuss more on this in the section: Packing and running a Spring Boot application.
The application will also configure and run any other system that we need, such as a connection pool to a database or a queue.
推薦閱讀
- Web前端開發技術:HTML、CSS、JavaScript(第3版)
- Python快樂編程:人工智能深度學習基礎
- 工程軟件開發技術基礎
- 大學計算機基礎實驗教程
- INSTANT Sencha Touch
- 軟件架構:Python語言實現
- Hands-On Natural Language Processing with Python
- 數據結構與算法分析(C++語言版)
- Apache Spark 2.x for Java Developers
- Kotlin編程實戰:創建優雅、富于表現力和高性能的JVM與Android應用程序
- ASP.NET Core 2 Fundamentals
- ASP.NET開發與應用教程
- 分布式數據庫原理、架構與實踐
- AMP:Building Accelerated Mobile Pages
- Java設計模式深入研究