Fixed a bug in the ARP caching that was preventing the site arp from expiring.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 8 May 2003 16:42:38 +0000 (16:42 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 8 May 2003 16:42:38 +0000 (16:42 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@592 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/arp/provider/BaseArpRepository.java

index 20d6a37..d26717f 100755 (executable)
@@ -370,15 +370,20 @@ class ArpCache {
                                                        }
                                                }
                                        }
-                                               //release the lock to be friendly
-                                               Iterator deleteIterator = needsDeleting.iterator();
-                                               while (deleteIterator.hasNext()) {
-                                                       synchronized (cache) {
+                                       //release the lock to be friendly
+                                       Iterator deleteIterator = needsDeleting.iterator();
+                                       while (deleteIterator.hasNext()) {
+                                               synchronized (cache) {
+                                                       CachedArp cachedArp = (CachedArp) deleteIterator.next();
+                                                       if (cachedArp.arp.isSitePolicy()) {
+                                                               log.debug("Expiring site ARP from the Cache.");
+                                                               cache.remove(new SiteCachePrincipal());
+                                                       } else {
                                                                log.debug("Expiring an ARP from the Cache.");
-                                                               cache.remove(
-                                                                       ((CachedArp) deleteIterator.next()).arp.getPrincipal());
+                                                               cache.remove(cachedArp.arp.getPrincipal());
                                                        }
                                                }
+                                       }
 
                                        sleep(5 * 60 * 1000);
                                } catch (InterruptedException e) {