O'Reilly logo

Mastering Play Framework for Scala by Shiti Saxena

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The life cycle of an application

An application's life cycle has two states: running and stopped. These are times when the state of the application changes. At times, we need to perform some operations right before or after a state change has occurred or is about to occur.

Play applications use a Netty server. For this, a class with the same name is used. It is defined as follows:

class NettyServer(appProvider: ApplicationProvider, port: Option[Int], sslPort: Option[Int] = None, address: String = "0.0.0.0", val mode: Mode.Mode = Mode.Prod) extends Server with ServerWithStop { … }

This class is responsible for binding or bootstrapping the application to the server.

The ApplicationProvider trait is defined as follows:

trait ApplicationProvider { def ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required