Package org.jboss.util

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


         params = {@ManagementParameter(name = "securityDomain", description = "The security domain name")})
   public SecurityDomainContext createSecurityDomainContext(String securityDomain) throws Exception
   {  
      log.debug("Creating SDC for domain="+securityDomain);
      AuthenticationManager am = createAuthenticationManager(securityDomain);
      CachePolicy cache = createDefaultCachePolicy();
      //Set security cache if the auth manager implementation supports it
      setSecurityDomainCache(am, cache);
      //Set DeepCopySubject option if supported
      if(SecurityConfiguration.isDeepCopySubjectMode())
      {
View Full Code Here

      try
      {
         if( cacheJndiName == null )
            throw new LoginException("Required cacheJndiName option not set");
         InitialContext iniCtx = new InitialContext();
         CachePolicy cache = (CachePolicy) iniCtx.lookup(cacheJndiName);
         SRPSessionKey key;
         if( userPrincipal instanceof SRPPrincipal )
         {
            SRPPrincipal srpPrincpal = (SRPPrincipal) userPrincipal;
            key = new SRPSessionKey(username, srpPrincpal.getSessionID());
         }
         else
         {
            key = new SRPSessionKey(username);
         }
         Object cacheCredential = cache.get(key);
         if( cacheCredential == null )
         {
            throw new LoginException("No SRP session found for: "+key);
         }
         log.trace("Found SRP cache credential: "+cacheCredential);
View Full Code Here

      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

      this.factory = factory;
   }

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

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

   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

   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

         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

    @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

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.