I am very new to play framework. I am trying to do something when my application will start and also do something when application will stop. I started searching for the entry and finish points and found out that in the 2.0 documentation there is ScalaGlobal where i can override the onStart, onStop and onError methods and do something inside it. For example:
object Global extends GlobalSettings {
override def onStart(app: Application) {
Logger.info("Application has started")
}
override def onStop(app: Application) {
Logger.info("Application shutdown...")
}
}
This code works fine for me in scala. But it is deprecated.
But i could't find anything like that in 2.5.x documentation. Is there any methods to access the Start and Stop points of an application in play framework??
- How can i access the lifecycle methods in play framework??
EDIT: Is there any callbacks in play framework where any request will go through that method and then to others when certain methods are called like global ajax event handlers ??