use of net.socialgamer.cah.task.BroadcastGameListUpdateTask in project PretendYoureXyzzy by ajanata.
the class StartupUtils method contextInitialized.
@Override
public void contextInitialized(final ServletContextEvent contextEvent) {
final ServletContext context = contextEvent.getServletContext();
reconfigureLogging(context);
final Injector injector = getInjector(context);
final ScheduledThreadPoolExecutor timer = injector.getInstance(ScheduledThreadPoolExecutor.class);
final UserPingTask ping = injector.getInstance(UserPingTask.class);
timer.scheduleAtFixedRate(ping, PING_START_DELAY, PING_CHECK_DELAY, TimeUnit.MILLISECONDS);
final BroadcastGameListUpdateTask broadcastUpdate = injector.getInstance(BroadcastGameListUpdateTask.class);
timer.scheduleAtFixedRate(broadcastUpdate, BROADCAST_UPDATE_START_DELAY, BROADCAST_UPDATE_DELAY, TimeUnit.MILLISECONDS);
context.setAttribute(INJECTOR, injector);
context.setAttribute(DATE_NAME, injector.getInstance(Key.get(Date.class, ServerStarted.class)));
// this is called in the process of setting up the injector right now... ideally we wouldn't
// need to do that there and can just do it here again.
// reloadProperties(context);
CardcastService.hackSslVerifier();
// log that the server (re-)started to metrics logging (to flush all old games and users)
injector.getInstance(Metrics.class).serverStart(injector.getInstance(Key.get(String.class, UniqueId.class)));
}
Aggregations