Example #1
0
 /** Starts us. */
 public void start() throws PushletException {
   if (timer != null) {
     stop();
   }
   timer = new Timer(false);
   timer.schedule(new AgingTimerTask(), TIMER_INTERVAL_MILLIS, TIMER_INTERVAL_MILLIS);
   info("started; interval=" + TIMER_INTERVAL_MILLIS + "ms");
 }
Example #2
0
 /** Add session. */
 public void addSession(Session session) {
   synchronized (mutex) {
     sessions.put(session.getId(), session);
     sessionCacheDirty = true;
   }
   // log(session.getId() + " at " + session.getAddress() + " adding ");
   info(session.getId() + " at " + session.getAddress() + " added ");
 }
Example #3
0
 /** Stopis us. */
 public void stop() {
   if (timer != null) {
     timer.cancel();
     timer = null;
   }
   synchronized (mutex) {
     sessions.clear();
   }
   info("stopped");
 }
Example #4
0
 /** Register session for removal. */
 public Session removeSession(Session aSession) {
   synchronized (mutex) {
     Session session = (Session) sessions.remove(aSession.getId());
     if (session != null) {
       info(session.getId() + " at " + session.getAddress() + " removed ");
     }
     sessionCacheDirty = true;
     return session;
   }
 }