4 Replies Latest reply on Oct 10, 2007 3:58 PM by anil.saldhana

    CachePolicy in JaasSecurityManagerService

    anil.saldhana

      Scott, do you remember the reason behind the CachePolicy injection into security managers happening via JNDI (java:/timedCachePolicy)?

      Why not just a property taking a FQN of the cache policy implementation?

        • 1. Re: CachePolicy in JaasSecurityManagerService
          starksm64

          Its just a factory that happens to use a jndi lookup as an implicit factory api based on the javax.naming.spi.ObjectFactory. In reality, its equivalent to:

          public interface AuthenticationManagerFactory
          {
           public AuthenticationManager newInstance(String domainName);
          }
          // Getting hold of this is the problem the jndi lookup solves
          AuthenticationManagerFactory factory = ...;
          AuthenticationManager am = factory.newInstance("jaas-domain");
          


          Instead, use of a naming convention for the security domain (java:/jaas prefix) implicitly locates the AuthenticationManager factory:
          InitialContextFactory factory = new InitialContextFactory();
          AuthenticationManager am = (AuthenticationManager) factory.lookup("java:/jaas/jaas-domain");
          



          • 2. Re: CachePolicy in JaasSecurityManagerService
            anil.saldhana

            I know about what you said. I am thinking whether there was any other reason why the objectfactory approach was chosen, like some customer wanting to do "java:/jaas/securitydomain/cache-policy" to get to the cache policy instance or such.

            I think the simpler approach is just to inject the FQN of the cache policy implementation into the jaassecmgr mbean service.

            • 3. Re: CachePolicy in JaasSecurityManagerService
              starksm64

              Injection meant a shot at the doctor 5 years ago when this was created.

              • 4. Re: CachePolicy in JaasSecurityManagerService
                anil.saldhana

                Ok got it. Inheritance from Dan and team.

                I will request Stefan (who brought this issue up originally) to do the FQN way to add clustered cache policy if an user requires.