Package org.jboss.util

Examples of org.jboss.util.CachePolicy


    @param timeoutInSecs - the cache timeout in seconds.
    @param resInSecs - resolution of timeouts in seconds.
    */
   public void setCacheTimeout(String securityDomain, int timeoutInSecs, int resInSecs)
   {
      CachePolicy cache = getCachePolicy(securityDomain);
      if( cache != null && cache instanceof TimedCachePolicy )
      {
         TimedCachePolicy tcp = (TimedCachePolicy) cache;
         synchronized( tcp )
         {
View Full Code Here


   /** flush the cache policy for the indicated security domain if one exists.
    * @param securityDomain the name of the security domain cache
    */
   public void flushAuthenticationCache(String securityDomain)
   {
      CachePolicy cache = getCachePolicy(securityDomain);
      if( cache != null )
      {
         cache.flush();
      }
      else
      {
         log.warn("Failed to find cache policy for securityDomain='"
            + securityDomain + "'");
View Full Code Here

    * @param securityDomain the name of the security domain cache
    * @param user the principal of the user to flush
    */
   public void flushAuthenticationCache(String securityDomain, Principal user)
   {
      CachePolicy cache = getCachePolicy(securityDomain);
      if( cache != null )
      {
         cache.remove(user);
      }
      else
      {
         log.warn("Failed to find cache policy for securityDomain='"
            + securityDomain + "'");
View Full Code Here

    * @return List<Principal> of active keys found in the auth cache if
    *    the cache exists and is accessible, null otherwise.
    */
   public List getAuthenticationCachePrincipals(String securityDomain)
   {
      CachePolicy cache = getCachePolicy(securityDomain);
      List validPrincipals = null;
      if( cache instanceof TimedCachePolicy )
      {
         TimedCachePolicy tcache = (TimedCachePolicy) cache;
         validPrincipals = tcache.getValidKeys();
View Full Code Here

    * @param instance the SecurityDomain instance to bind
    */
   public synchronized void registerSecurityDomain(String securityDomain, SecurityDomain instance)
   {
      log.debug("Added "+securityDomain+", "+instance+" to map");
      CachePolicy authCache = lookupCachePolicy(securityDomain);
     
      SecurityDomainContext sdc = new SecurityDomainContext(instance, authCache);
      sdc.setAuthorizationManager(AuthorizationManagerService.newAuthorizationManager(securityDomain));
      securityDomainCtxMap.put(securityDomain, sdc);
      // See if the security mgr supports an externalized cache policy
View Full Code Here

    */
   private static CachePolicy getCachePolicy(String securityDomain)
   {
      if( securityDomain.startsWith(SECURITY_MGR_PATH) )
         securityDomain = securityDomain.substring(SECURITY_MGR_PATH.length()+1);
      CachePolicy cache = null;
      try
      {
         SecurityDomainContext sdc = lookupSecurityDomain(securityDomain);
         if( sdc != null )
            cache = sdc.getAuthenticationCache();
View Full Code Here

    looking up the CachePolicy for a domain. If this fails then the cacheJndiName
    location is treated as a single CachePolicy for all security domains.
    */
   static CachePolicy lookupCachePolicy(String securityDomain)
   {
      CachePolicy authCache = null;
      String domainCachePath = cacheJndiName + '/' + securityDomain;
      try
      {
         InitialContext iniCtx = new InitialContext();
         authCache = (CachePolicy) iniCtx.lookup(domainCachePath);
View Full Code Here

         Constructor ctor = securityMgrClass.getConstructor(parameterTypes);
         CallbackHandler handler = (CallbackHandler) callbackHandlerClass.newInstance();
         Object[] args = {securityDomain, handler};
         AuthenticationManager securityMgr = (AuthenticationManager) ctor.newInstance(args);
         log.debug("Created securityMgr="+securityMgr);
         CachePolicy cachePolicy = lookupCachePolicy(securityDomain);
         sdc = new SecurityDomainContext(securityMgr, cachePolicy);
         // See if the security mgr supports an externalized cache policy
         setSecurityDomainCache(securityMgr, cachePolicy);
         if(deepCopySubjectMode)
            setDeepCopySubjectOption(securityMgr, true);
View Full Code Here

         CallbackHandler handler = (CallbackHandler) callbackHandlerClass.newInstance();
         Object[] args = {securityDomain, handler};
         securityMgr = (AuthorizationManager) ctor.newInstance(args);
         log.debug("Created AuthorizationManager="+securityMgr);
        
         CachePolicy cachePolicy = JaasSecurityManagerService.lookupCachePolicy(securityDomain);
         log.debug("Found Cache Policy="+cachePolicy);
         /*TimedCachePolicy cachePolicy = new TimedCachePolicy(defaultCacheTimeout,
               true, defaultCacheResolution);
         cachePolicy.create();
         cachePolicy.start(); */
 
View Full Code Here

TOP

Related Classes of org.jboss.util.CachePolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.