1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package org.jboss.seam.security.session;

import javax.inject.Inject;

public class SessionManager
{

   @Inject
   private SessionStore sessionStore;

   public void register(Session session)
   {
      sessionStore.persist(session);
   }

   public Session unregister(String id)
   {
      Session session = sessionStore.findById(id);
      // Might have been already unregistered
      if (session != null)
      {
         sessionStore.remove(session);
      }
      return session;
   }

   public boolean isSessionRegistered(String id)
   {
      return sessionStore.sessionExists(id);
   }

}