May 2015
Intermediate to advanced
274 pages
5h 11m
English
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 ...Read now
Unlock full access