1 package org.sapia.regis.cache; 2 3 import org.sapia.regis.RegisSession; 4 5 public class CacheSessions { 6 7 private static ThreadLocal sessions = new ThreadLocal (); 8 9 public static RegisSession get(){ 10 if(sessions.get() == null){ 11 throw new IllegalStateException ("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 |