public ApplicationPolicyConfigurationManager(Map contextIdToPermissionsMap, Map roleDesignates, ClassLoader cl, PrincipalRoleMapper principalRoleMapper) throws PolicyContextException, ClassNotFoundException {
this.principalRoleMapper = principalRoleMapper;
Thread currentThread = Thread.currentThread();
ClassLoader oldClassLoader = currentThread.getContextClassLoader();
currentThread.setContextClassLoader(cl);
PolicyConfigurationFactory policyConfigurationFactory;
try {
policyConfigurationFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
} finally {
currentThread.setContextClassLoader(oldClassLoader);
}
for (Iterator iterator = contextIdToPermissionsMap.entrySet().iterator(); iterator.hasNext();) {
Map.Entry entry = (Map.Entry) iterator.next();
String contextID = (String) entry.getKey();
ComponentPermissions componentPermissions = (ComponentPermissions) entry.getValue();
PolicyConfiguration policyConfiguration = policyConfigurationFactory.getPolicyConfiguration(contextID, true);
contextIdToPolicyConfigurationMap.put(contextID, policyConfiguration);
policyConfiguration.addToExcludedPolicy(componentPermissions.getExcludedPermissions());
policyConfiguration.addToUncheckedPolicy(componentPermissions.getUncheckedPermissions());
for (Iterator roleIterator = componentPermissions.getRolePermissions().entrySet().iterator(); roleIterator.hasNext();) {
Map.Entry roleEntry = (Map.Entry) roleIterator.next();