Package org.jboss.util

Examples of org.jboss.util.TimedCachePolicy$ResolutionTimer


   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 )
         {
            tcp.setDefaultLifetime(timeoutInSecs);
            tcp.setResolution(resInSecs);
         }
      }
      else
      {
         log.warn("Failed to find cache policy for securityDomain='"
View Full Code Here


   {
      CachePolicy cache = getCachePolicy(securityDomain);
      List validPrincipals = null;
      if( cache instanceof TimedCachePolicy )
      {
         TimedCachePolicy tcache = (TimedCachePolicy) cache;
         validPrincipals = tcache.getValidKeys();
      }
      return validPrincipals;
   }
View Full Code Here

       was created by out getObjectInstance() method. All this does is create
       a new TimedCache instance.
       */
      public Object invoke(Object obj, Method method, Object[] args) throws Throwable
      {
         TimedCachePolicy cachePolicy = new TimedCachePolicy(defaultCacheTimeout,
            true, defaultCacheResolution);
         cachePolicy.create();
         cachePolicy.start();
         return cachePolicy;
      }
View Full Code Here

     if(securityDomainCtx != null)
     {
        CachePolicy cache = securityDomainCtx.getAuthenticationCache();
        if( cache != null && cache instanceof TimedCachePolicy )
        {
           TimedCachePolicy tcp = (TimedCachePolicy) cache;
           synchronized( tcp )
           {
              tcp.setDefaultLifetime(timeoutInSecs);
              tcp.setResolution(resInSecs);
           }
        }
        else
        {
           log.warn("Failed to find cache policy for securityDomain='"
View Full Code Here

    * Create a Default Cache Policy
    * @return
    */
   private CachePolicy createDefaultCachePolicy()
   {
      TimedCachePolicy cachePolicy =
          new AuthenticationTimedCachePolicy(SecurityConstantsBridge.defaultCacheTimeout,
                               true,
                               SecurityConstantsBridge.defaultCacheResolution);
      cachePolicy.create();
      cachePolicy.start();
      return cachePolicy;
   }
View Full Code Here

      }
      catch(Exception e)
      {
         log.trace("Failed to find existing cache at: "+cacheJndiName, e);
         // Not found, default to a TimedCachePolicy
         cachePolicy = new TimedCachePolicy(cacheTimeout, true, cacheResolution);
         cachePolicy.create();
         cachePolicy.start();
         // Bind a reference to store using NonSerializableFactory as the ObjectFactory
         Name name = ctx.getNameParser("").parse(cacheJndiName);
         NonSerializableFactory.rebind(name, cachePolicy, true);
View Full Code Here

      InitialContext ctx = new InitialContext();
      ctx.bind("java:policyRegistration", new SimplePolicyRegistration());

      JBossSecurityContext context = new JBossSecurityContext("TestApp");
      JBossAuthenticationManager authenticationManager = (JBossAuthenticationManager) context.getAuthenticationManager();
      TimedCachePolicy domainCache = new TimedCachePolicy();
      domainCache.create();
      domainCache.start();
      authenticationManager.setCachePolicy(domainCache);
      NonSerializableFactory.rebind(ctx, "java:AuthenticationManager", authenticationManager);
   }
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

      this.resolution = resolution;
   }

   public CachePolicy createCachePolicy()
   {
      return new TimedCachePolicy(defaultLifetime, threadSafe, resolution);
   }
View Full Code Here

       was created by out getObjectInstance() method. All this does is create
       a new TimedCache instance.
       */
      public Object invoke(Object obj, Method method, Object[] args) throws Throwable
      {
         TimedCachePolicy cachePolicy = new TimedCachePolicy(defaultCacheTimeout,
            true, defaultCacheResolution);
         cachePolicy.create();
         cachePolicy.start();
         return cachePolicy;
      }
View Full Code Here

TOP

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

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.