1 26 27 package org.objectweb.jonas_lib.security.jacc; 28 29 import javax.security.jacc.PolicyConfiguration ; 30 import javax.security.jacc.PolicyConfigurationFactory ; 31 import javax.security.jacc.PolicyContextException ; 32 33 34 42 public class PolicyConfigurationFactoryWrapper extends PolicyConfigurationFactory { 43 44 48 private PolicyConfigurationFactory policyConfigurationFactory = null; 49 50 53 private static final String CLASS_NAME = "org.objectweb.jonas_lib.security.jacc.JPolicyConfigurationFactory"; 54 55 58 public PolicyConfigurationFactoryWrapper() { 59 try { 60 ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); 61 Class clazz = classLoader.loadClass(CLASS_NAME); 62 Object o = clazz.newInstance(); 63 policyConfigurationFactory = (PolicyConfigurationFactory ) o; 64 } catch (Exception e) { 65 System.err.println("PolicyConfigurationFactoryWrapper : Error with JACC :" + e.getMessage()); 67 } 68 } 69 70 71 95 public PolicyConfiguration getPolicyConfiguration(String contextID, boolean remove) throws PolicyContextException , SecurityException { 96 return policyConfigurationFactory.getPolicyConfiguration(contextID, remove); 97 } 98 99 114 public boolean inService(String contextID) throws PolicyContextException , SecurityException { 115 return policyConfigurationFactory.inService(contextID); 116 } 117 118 119 } 120 | Popular Tags |