Package org.jboss.util

Examples of org.jboss.util.CachePolicy


/* 296 */     JNDIBasedSecurityManagement.setCacheTimeout(securityDomain, timeoutInSecs, resInSecs);
/*     */   }
/*     */
/*     */   public void flushAuthenticationCache(String securityDomain)
/*     */   {
/* 304 */     CachePolicy cache = getCachePolicy(securityDomain);
/* 305 */     if (cache != null)
/*     */     {
/* 307 */       cache.flush();
/*     */     }
/*     */     else
/*     */     {
/* 311 */       log.warn("Failed to find cache policy for securityDomain='" + securityDomain + "'");
/*     */     }
View Full Code Here


/*     */     }
/*     */   }
/*     */
/*     */   public void flushAuthenticationCache(String securityDomain, Principal user)
/*     */   {
/* 324 */     CachePolicy cache = getCachePolicy(securityDomain);
/* 325 */     if (cache != null)
/*     */     {
/* 327 */       cache.remove(user);
/*     */     }
/*     */     else
/*     */     {
/* 331 */       log.warn("Failed to find cache policy for securityDomain='" + securityDomain + "'");
/*     */     }
View Full Code Here

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

/*     */   }
/*     */
/*     */   public synchronized void registerSecurityDomain(String securityDomain, SecurityDomain instance)
/*     */   {
/* 511 */     log.debug("Added " + securityDomain + ", " + instance + " to map");
/* 512 */     CachePolicy authCache = lookupCachePolicy(securityDomain);
/*     */
/* 514 */     SecurityDomainContext sdc = new SecurityDomainContext(instance, authCache);
/* 515 */     sdc.setAuthorizationManager(AuthorizationManagerService.newAuthorizationManager(securityDomain));
/* 516 */     securityDomainCtxMap.put(securityDomain, sdc);
/*     */
View Full Code Here

/*     */
/*     */   private static CachePolicy getCachePolicy(String securityDomain)
/*     */   {
/* 527 */     if (securityDomain.startsWith("java:/jaas"))
/* 528 */       securityDomain = securityDomain.substring("java:/jaas".length() + 1);
/* 529 */     CachePolicy cache = null;
/*     */     try
/*     */     {
/* 532 */       SecurityDomainContext sdc = lookupSecurityDomain(securityDomain);
/* 533 */       if (sdc != null)
/* 534 */         cache = sdc.getAuthenticationCache();
View Full Code Here

/* 540 */     return cache;
/*     */   }
/*     */
/*     */   static CachePolicy lookupCachePolicy(String securityDomain)
/*     */   {
/* 552 */     CachePolicy authCache = null;
/* 553 */     String domainCachePath = cacheJndiName + '/' + securityDomain;
/*     */     try
/*     */     {
/* 556 */       InitialContext iniCtx = new InitialContext();
/* 557 */       authCache = (CachePolicy)iniCtx.lookup(domainCachePath);
View Full Code Here

/* 655 */       Constructor ctor = securityMgrClass.getConstructor(parameterTypes);
/* 656 */       CallbackHandler handler = (CallbackHandler)callbackHandlerClass.newInstance();
/* 657 */       Object[] args = { securityDomain, handler };
/* 658 */       AuthenticationManager securityMgr = (AuthenticationManager)ctor.newInstance(args);
/* 659 */       log.debug("Created securityMgr=" + securityMgr);
/* 660 */       CachePolicy cachePolicy = lookupCachePolicy(securityDomain);
/* 661 */       sdc = new SecurityDomainContext(securityMgr, cachePolicy);
/*     */
/* 663 */       setSecurityDomainCache(securityMgr, cachePolicy);
/* 664 */       if (deepCopySubjectMode) {
/* 665 */         setDeepCopySubjectOption(securityMgr, true);
View Full Code Here

/* 210 */       CallbackHandler handler = (CallbackHandler)callbackHandlerClass.newInstance();
/* 211 */       Object[] args = { securityDomain, handler };
/* 212 */       securityMgr = (AuthorizationManager)ctor.newInstance(args);
/* 213 */       log.debug("Created AuthorizationManager=" + securityMgr);
/*     */
/* 215 */       CachePolicy cachePolicy = JaasSecurityManagerService.lookupCachePolicy(securityDomain);
/* 216 */       log.debug("Found Cache Policy=" + cachePolicy);
/*     */
/* 218 */       setSecurityDomainCache(securityMgr, cachePolicy);
/*     */     }
/*     */     catch (Exception e2)
View Full Code Here

/*     */     }
/*  85 */     synchronized (getCacheLock())
/*     */     {
/*  87 */       BeanCacheSnapshot snapshot = (BeanCacheSnapshot)s;
/*  88 */       snapshot.m_passivatingBeans = 0;
/*  89 */       CachePolicy policy = getCache();
/*  90 */       if ((policy instanceof Monitorable))
/*     */       {
/*  92 */         ((Monitorable)policy).sample(s);
/*     */       }
/*     */     }
View Full Code Here

/*     */   {
/* 109 */     if (id == null) throw new IllegalArgumentException("Can't get an object with a null key");
/*     */     EnterpriseContext ctx;
/* 113 */     synchronized (getCacheLock())
/*     */     {
/* 115 */       CachePolicy cache = getCache();
/* 116 */       ctx = (EnterpriseContext)cache.get(id);
/* 117 */       if (ctx == null)
/*     */       {
/*     */         try
/*     */         {
/* 121 */           ctx = acquireContext();
/* 122 */           setKey(id, ctx);
/* 123 */           if (!doActivate(ctx))
/*     */           {
/* 125 */             return ctx;
/* 126 */           }logActivation(id);
/*     */
/* 129 */           cache.insert(id, ctx);
/*     */         }
/*     */         catch (Throwable x)
/*     */         {
/* 133 */           log.debug("Activation failure", x);
/* 134 */           throw new NoSuchObjectException(x.getMessage());
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.