Package org.jboss.util

Examples of org.jboss.util.TimedCachePolicy$DefaultTimedEntry


         return subject;

      long lifetime = 0;
      if( domainCache instanceof TimedCachePolicy )
      {
         TimedCachePolicy cache = (TimedCachePolicy) domainCache;
         lifetime = cache.getDefaultLifetime();
      }
      DomainInfo info = new DomainInfo(lifetime);
      info.loginCtx = lc;
      info.subject = new Subject();
      SubjectActions.copySubject(subject, info.subject, true, this.deepCopySubjectOption);
View Full Code Here


  
   public CtClassCache createCache()
   {
      CachePolicy policy = null;
      if (policyClass == TimedCachePolicy.class)
         policy = new TimedCachePolicy(lifetime, true, resolution);
      else if (policyClass == LRUCachePolicy.class)
         policy = new LRUCachePolicy(min, max);
      else
      {
         try
View Full Code Here

   @Override
   @SuppressWarnings("unchecked")
   public Iterable<VFSContext> getCachedContexts()
   {
      TimedCachePolicy tcp = getPolicy();
      List keys = tcp.getValidKeys();
      if (keys != null && keys.isEmpty() == false)
      {
         Map<Object, VFSContext> contexts = new TreeMap<Object, VFSContext>();
         for (Object key : keys)
            contexts.put(key, (VFSContext)tcp.peek(key));

         return contexts.values();
      }
      return Collections.emptySet();
   }
View Full Code Here

      if (resolution == null)
         resolution = getInteger(readInstanceProperties(VFSUtils.VFS_CACHE_KEY + ".TimedPolicyCaching.resolution", null, true));

      log.debug("Creating timed cache policy, lifetime: " + defaultLifetime + ", threadSafe: " + threadSafe + ", resolution: " + resolution);

      TimedCachePolicy tcp;
      if (defaultLifetime == null)
         tcp = new TimedCachePolicy();
      else if (resolution != null)
         tcp = new TimedCachePolicy(defaultLifetime, threadSafe, resolution);
      else
         tcp = new TimedCachePolicy(defaultLifetime);

      info = getCacheName() + "{lifetime=" + tcp.getDefaultLifetime() + ", resolution=" + tcp.getResolution() + "}";

      return tcp;
   }
View Full Code Here

/* 698 */       return subject;
/*     */     }
/* 700 */     long lifetime = 0L;
/* 701 */     if ((this.domainCache instanceof TimedCachePolicy))
/*     */     {
/* 703 */       TimedCachePolicy cache = (TimedCachePolicy)this.domainCache;
/* 704 */       lifetime = cache.getDefaultLifetime();
/*     */     }
/* 706 */     DomainInfo info = new DomainInfo(lifetime);
/* 707 */     DomainInfo.access$302(info, lc);
/* 708 */     DomainInfo.access$202(info, new Subject());
/* 709 */     SubjectActions.copySubject(subject, info.subject, true, this.deepCopySubjectOption);
View Full Code Here

/* 273 */     if (securityDomainCtx != null)
/*     */     {
/* 275 */       CachePolicy cache = securityDomainCtx.getAuthenticationCache();
/* 276 */       if ((cache != null) && ((cache instanceof TimedCachePolicy)))
/*     */       {
/* 278 */         TimedCachePolicy tcp = (TimedCachePolicy)cache;
/* 279 */         synchronized (tcp)
/*     */         {
/* 281 */           tcp.setDefaultLifetime(timeoutInSecs);
/* 282 */           tcp.setResolution(resInSecs);
/*     */         }
/*     */       }
/*     */       else
/*     */       {
/* 287 */         log.warn("Failed to find cache policy for securityDomain='" + securityDomain + "'");
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   private CachePolicy createDefaultCachePolicy()
/*     */   {
/* 457 */     TimedCachePolicy cachePolicy = new TimedCachePolicy(SecurityConstantsBridge.defaultCacheTimeout, true, SecurityConstantsBridge.defaultCacheResolution);
/*     */
/* 461 */     cachePolicy.create();
/* 462 */     cachePolicy.start();
/* 463 */     return cachePolicy;
/*     */   }
View Full Code Here

/*     */   public void setCacheTimeout(String securityDomain, int timeoutInSecs, int resInSecs)
/*     */   {
/* 279 */     CachePolicy cache = getCachePolicy(securityDomain);
/* 280 */     if ((cache != null) && ((cache instanceof TimedCachePolicy)))
/*     */     {
/* 282 */       TimedCachePolicy tcp = (TimedCachePolicy)cache;
/* 283 */       synchronized (tcp)
/*     */       {
/* 285 */         tcp.setDefaultLifetime(timeoutInSecs);
/* 286 */         tcp.setResolution(resInSecs);
/*     */       }
/*     */     }
/*     */     else
/*     */     {
/* 291 */       log.warn("Failed to find cache policy for securityDomain='" + securityDomain + "'");
View Full Code Here

/*     */   {
/* 343 */     CachePolicy cache = getCachePolicy(securityDomain);
/* 344 */     List validPrincipals = null;
/* 345 */     if ((cache instanceof TimedCachePolicy))
/*     */     {
/* 347 */       TimedCachePolicy tcache = (TimedCachePolicy)cache;
/* 348 */       validPrincipals = tcache.getValidKeys();
/*     */     }
/* 350 */     return validPrincipals;
/*     */   }
View Full Code Here

/*     */     }
/*     */
/*     */     public Object invoke(Object obj, Method method, Object[] args)
/*     */       throws Throwable
/*     */     {
/* 830 */       TimedCachePolicy cachePolicy = new TimedCachePolicy(JaasSecurityManagerService.defaultCacheTimeout, true, JaasSecurityManagerService.defaultCacheResolution);
/*     */
/* 832 */       cachePolicy.create();
/* 833 */       cachePolicy.start();
/* 834 */       return cachePolicy;
/*     */     }
View Full Code Here

TOP

Related Classes of org.jboss.util.TimedCachePolicy$DefaultTimedEntry

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.