Examples of CachePolicy


Examples of org.jboss.util.CachePolicy

      return initializer;
   }
  
   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
         {
            policy = policyClass.newInstance();
         }
         catch(Exception e)
         {
            throw new IllegalStateException("Could not instantiate " + policyClass.getName(), e);
         }
      }
   
      try
      {
         policy.create();
         policy.start();
      }
      catch(Exception e)
      {
         throw new IllegalStateException("Error starting domain cache", e);
      }
View Full Code Here

Examples of org.jboss.util.CachePolicy

      this.factory = factory;
   }

   public CachePolicy createCachePolicy()
   {
      CachePolicy policy = factory.createCachePolicy();
      return new SynchronizedCachePolicy(policy);
   }
View Full Code Here

Examples of org.jboss.util.CachePolicy

    */
   protected CachePolicy createCachePolicy()
   {
      try
      {
         CachePolicy policy = factory.createCachePolicy();
         policy.create();
         policy.start();
         policies.add(policy);
         return policy;
      }
      catch (Exception e)
      {
View Full Code Here

Examples of org.jboss.util.CachePolicy

   public void stop()
   {
      ListIterator<CachePolicy> iter = policies.listIterator(policies.size());
      while(iter.hasPrevious())
      {
         CachePolicy policy = iter.previous();
         try
         {
            policy.stop();
         }
         catch (Throwable t)
         {
            log.debug("Exception while stopping policy: " + policy + ", problem: " + t);
         }
View Full Code Here

Examples of org.jboss.util.CachePolicy

   public void destroy()
   {
      ListIterator<CachePolicy> iter = policies.listIterator(policies.size());
      while(iter.hasPrevious())
      {
         CachePolicy policy = iter.previous();
         try
         {
            policy.destroy();
         }
         catch (Throwable t)
         {
            log.debug("Exception while destroying policy: " + policy + ", problem: " + t);
         }
View Full Code Here

Examples of org.jboss.util.CachePolicy

         log.trace("SetCacheTimeOut:Failed to look up SecurityDomainCtx:"+securityDomain);
     
     }
     if(securityDomainCtx != null)
     {
        CachePolicy cache = securityDomainCtx.getAuthenticationCache();
        if( cache != null && cache instanceof TimedCachePolicy )
        {
           TimedCachePolicy tcp = (TimedCachePolicy) cache;
           synchronized( tcp )
           {
View Full Code Here

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

Examples of org.jboss.util.CachePolicy

   /** 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

Examples of org.jboss.util.CachePolicy

    * @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

Examples of org.jboss.util.CachePolicy

    * @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
TOP
Copyright © 2018 www.massapi.com. 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.