I need a method to be called every time play reloads so I can use the new classes to rescan some stuff. How can I get that without developing a full blown plugin? ( I really just want to add something quick to my application and move on).
On a side note, is there any good tutorial on doing a play plugin?
thanks,
Dean
Well, if you have any method that is run alot like NoSql.em(), and NoSql is in another jar file, it will not be in the Play.classloader and in that method, I finally do a Play.classloader.getAnnotatedResources() which gives me a List and I keep comparing the first one and when it changes, I know play reloaded. For now, this sort of hack worked for me and the nosql layer stays up constantly with the in-memory nosql database now.
While @OnApplicationStart is NOT called “every” single time play reloads, you can use the above method to know when it does reload 100% of the time instead of 75% of the time which is about the case of using @OnApplicationStart.