4 Replies Latest reply on Nov 2, 2003 7:00 PM by cenos

    Problems with custom CachePolicy

    cenos

      I've created a mbean with my own version of TimedCachePolicy (that refreshes the expiration time when accessed from cache). I've put this jndi name into AuthenticationCacheJndiName (JaasSecurityManagerService) and it's been bound successfully.
      My problem is when I call the getAuthenticationCachePrincipals method from JaasSecurityManagerService. It returns null because there is the code:
      if( cache instanceof TimedCachePolicy )
      {
      TimedCachePolicy tcache = (TimedCachePolicy) cache;
      validPrincipals = tcache.getValidKeys();
      }
      It means that you can bind your own CachePolicy, but it can't return the cached Principals, because TimedCachePolicy is hardcoded inside JaasSecurityManagerService mbean...

      My solution was to create another version of JaasSecurityManagerService with my own TimedCachePolicy...

      Am I doing something wrong? Any comments/suggestions/workarounds for this?