My question is similar to this one, but with regard to Java instead of Python.
How can I force some Java code to run whenever a new instance of a Google App Engine server starts?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
in google app engine, your java code is executed within the servlet environment. thus, you could define listeners to boostrap your startup code. to do this, you need to implement your startup code in the listener and define the listener in your web.xml:
listner class:
web.xml: