- 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.
推薦閱讀
- Puppet 4 Essentials(Second Edition)
- 程序設計與實踐(VB.NET)
- Beginning Java Data Structures and Algorithms
- JavaScript:Functional Programming for JavaScript Developers
- 基于Java技術的Web應用開發
- R語言數據可視化實戰
- Implementing Cisco Networking Solutions
- Python應用輕松入門
- Oracle Database 12c Security Cookbook
- QTP自動化測試進階
- OpenShift在企業中的實踐:PaaS DevOps微服務(第2版)
- HDInsight Essentials(Second Edition)
- 大學計算機基礎實驗指導
- Unity 3D/2D移動開發實戰教程
- 智能手機故障檢測與維修從入門到精通