import java.util.Set;
import java.util.TimeZone;
import java.util.UUID;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/** Notifications for sone inserts. */
private final Map<Sone, TemplateNotification> soneInsertNotifications = new HashMap<>();
- /** Scheduled executor for time-based notifications. */
- private final ScheduledExecutorService ticker = Executors.newScheduledThreadPool(1);
-
@Inject
public WebInterface(SonePlugin sonePlugin, Loaders loaders, ListNotificationFilter listNotificationFilter,
PostVisibilityFilter postVisibilityFilter, ReplyVisibilityFilter replyVisibilityFilter,
*/
public void start() {
registerToadlets();
-
- /* notification templates. */
- Template wotMissingNotificationTemplate = loaders.loadTemplate("/templates/notify/wotMissingNotification.html");
- final TemplateNotification wotMissingNotification = new TemplateNotification("wot-missing-notification", wotMissingNotificationTemplate);
- ticker.scheduleAtFixedRate(new Runnable() {
-
- @Override
- @SuppressWarnings("synthetic-access")
- public void run() {
- if (getCore().getIdentityManager().isConnected()) {
- wotMissingNotification.dismiss();
- } else {
- notificationManager.addNotification(wotMissingNotification);
- }
- }
-
- }, 15, 15, TimeUnit.SECONDS);
}
/**
*/
public void stop() {
pageToadletRegistry.unregisterToadlets();
- ticker.shutdownNow();
}
//