1 package com.lutris.appserver.server.session; 2 3 import java.util.Hashtable ; 4 12 13 public class MemoryPersistence { 14 15 private static Hashtable managers = new Hashtable (); 16 private static Hashtable classLoaders = new Hashtable (); 17 18 private MemoryPersistence() { 19 } 20 27 static public SessionManager getSessionManager(String appName){ 28 if(managers.containsKey(appName)) 29 return (SessionManager) managers.remove(appName); 30 else return null; 31 } 32 33 42 static public void putSessionManager(String appName,SessionManager sessMgr){ 43 managers.put(appName,sessMgr); 44 } 45 52 static public ClassLoader getClassLoader(String appName){ 53 if(classLoaders.containsKey(appName)) 54 return ((ClassLoader ) classLoaders.get(appName)); 55 else return null; 56 } 57 63 static public void setClassLoader(String appName, ClassLoader cl){ 64 classLoaders.put(appName,cl); 65 } 66 71 static public void removeClassLoader(String appName){ 72 classLoaders.remove(appName); 73 } 74 77 static public void shutdown(){ 78 managers = new Hashtable (); 79 classLoaders = new Hashtable (); 80 } 81 } 82 | Popular Tags |