1 26 27 package org.objectweb.jonas.security.jacc; 28 29 34 public class JPolicyContextHandlerCurrent { 35 36 39 private static JPolicyContextHandlerCurrent current = new JPolicyContextHandlerCurrent(); 40 41 44 private static ThreadLocal threadData; 45 46 50 public static JPolicyContextHandlerCurrent getCurrent() { 51 return current; 52 } 53 54 57 private JPolicyContextHandlerCurrent() { 58 threadData = new ThreadLocal (); 59 threadData.set(new JPolicyContextHandlerData()); 60 } 61 62 66 public synchronized JPolicyContextHandlerData getJPolicyContextHandlerData() { 67 if (threadData.get() == null) { 68 threadData.set(new JPolicyContextHandlerData()); 69 } 70 return (JPolicyContextHandlerData) threadData.get(); 71 } 72 73 77 public void setJPolicyContextHandlerData(JPolicyContextHandlerData data) { 78 threadData.set(data); 79 } 80 81 } 82 | Popular Tags |