I'm writing a web application in GWT. Currently the only server-side logic I have are some RPC calls contained in a class that extends RemoteServiceServlet
. The structure of this class looks like this:
public class ProjectActionsImpl extends RemoteServiceServlet
implements ProjectActions {
public ProjectActionsImpl() {
... *lots* of preparations ...
}
public String action1(String request) {
...
}
public String action2(String request) {
...
}
...
}
But I just realized that I have too much initialization work in the constructor, that the first call would take tens of seconds to response. I can imagine it would be annoying for the first user.
Is there a way to initialize the back-end at the moment the server starts, and before the server starts listening?