I want to initialise some variables on application startup in Play framework. I'm following this document http://www.playframework.com/documentation/2.2.x/JavaGlobal for doing the same.. However when I run the application I get with the command "play run" the initialization does not happen. Am I doing something wrong here?
import com.Constants;
import controllers.Application;
import controllers.Utils;
import play.*;
public class Global extends GlobalSettings {
public void onStart(Application app) throws Exception {
Logger.info("Application has started");
Constants.data1= Utils.getMerchantToBrMapping(Utils.getMerchantName());
Constants.data2 = Utils.getBrToMerchantMapping(Utils.getMerchantName());
Logger.info("Loaded the Merchant To BR Map");
}
}