KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > regis > cache > CacheSessions


1 package org.sapia.regis.cache;
2
3 import org.sapia.regis.RegisSession;
4
5 public class CacheSessions {
6   
7   private static ThreadLocal JavaDoc sessions = new ThreadLocal JavaDoc();
8     
9   public static RegisSession get(){
10     if(sessions.get() == null){
11       throw new IllegalStateException JavaDoc("Server thread not registered with session");
12     }
13     return (RegisSession)sessions.get();
14   }
15
16   public static void join(RegisSession session){
17     sessions.set(session);
18   }
19
20 }
21
Popular Tags