package geniusweb.partiesserver; import javax.servlet.http.HttpServlet; import geniusweb.partiesserver.repository.AvailablePartiesRepo; import geniusweb.partiesserver.repository.RunningPartiesRepo; /** * Servlet that just starts the background tasks. */ public class BackgroundServlet extends HttpServlet { private static final int REFRESH_PERIOD_MS = 1000; private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public BackgroundServlet() { super(); new AvailablePartiesUpdater(AvailablePartiesRepo.instance()); new Thread(new RunningPartiesUpdater(RunningPartiesRepo.instance(), REFRESH_PERIOD_MS)).start(); } }