01: package org.manentia.kasai.util;
02:
03: import org.apache.oro.util.CacheFIFO;
04: import org.manentia.kasai.User;
05:
06: /**
07: *
08: * @author fpena
09: */
10: public class CacheUsers {
11:
12: private static CacheFIFO cache;
13:
14: static {
15: cache = new CacheFIFO(100);
16: }
17:
18: public static void addUser(String login, User u) {
19: cache.addElement(login, u);
20: }
21:
22: public static User getUser(String login) {
23: try {
24: return (User) cache.getElement(login);
25: } catch (Exception e) {
26: return null;
27: }
28: }
29: }
|