Examples of Cache


Examples of org.infinispan.Cache

         Configuration overrides = configurationOverrides.get(cacheName);
         if (overrides != null) c.applyOverrides(overrides);
      }

      c.assertValid();
      Cache cache = new InternalCacheFactory().createCache(c, globalComponentRegistry, cacheName);
      Cache other = caches.putIfAbsent(cacheName, cache);
      if (other == null) {
         cache.start();
         return cache;
      } else {
         return other;

Examples of org.jahia.services.cache.Cache

            // get the cache name
            String curCacheName = (String)cacheNameIte.next ();

            if (request.getParameter ("flush_" + curCacheName) != null) {
                Cache cache = ServicesRegistry.getInstance().getCacheService().getCache (curCacheName);
                if (cache != null) {
                    logger.info("Flushing cache: " + curCacheName);
                    cache.flush(false);
                }
            }
        }
       
        for (String cacheName : ehcacheManager.getCacheNames()) {
            if (request.getParameter ("flush_ehcache_" + cacheName) != null) {
                net.sf.ehcache.Cache cache = ehcacheManager.getCache(cacheName);
                if (cache != null) {
                    logger.info("Flushing cache: " + cacheName);
                    // flush without notifying the other cluster nodes
                    cache.removeAll(true);
                    // reset statistics
                    cache.clearStatistics();
                }
            }
        }

        displaySettings (request, response, session);

Examples of org.jboss.cache.Cache

      replListeners = new ReplicationListener[getNumCacheManagers()];
      /* Make sure that the buddy group is formed before starting the tests */
      List<Cache> createdCaches = new ArrayList<Cache>();
      for (int i = 0; i <  getCacheManagers().size(); i++)
      {
         Cache cache = getCacheManagers().get(i).getCache(getCacheConfigName(), false);
         createdCaches.add(cache);
         replListeners[i] = ReplicationListener.getReplicationListener(cache);
      }
      BuddyReplicationTestsBase.waitForSingleBuddy(createdCaches);
   }

Examples of org.jboss.ejb3.annotation.Cache

      if(this.cache!=null && this.cache.isStarted())
      {
         return;
      }
     
      Cache cacheConfig = getAnnotation(Cache.class);
      CacheFactoryRegistry registry = getCacheFactoryRegistry();
      Ejb3CacheFactory factory = registry.getCacheFactory(cacheConfig.value());
      this.cache = factory.createCache();
      this.cache.initialize(this);
      this.cache.start();
   }

Examples of org.jboss.resteasy.annotations.cache.Cache

   public boolean accept(Class declaring, Method method)
   {
      if (declaring == null || method == null) return false;

      if (!method.isAnnotationPresent(GET.class)) return false;
      Cache cache = (Cache) declaring.getAnnotation(Cache.class);
      NoCache nocache = (NoCache) declaring.getAnnotation(NoCache.class);
      Cache methodCached = method.getAnnotation(Cache.class);
      NoCache noMethodCache = method.getAnnotation(NoCache.class);

      if (methodCached != null)
      {
         initCacheControl(methodCached);

Examples of org.jivesoftware.util.cache.Cache

                cacheStats = (Map<String, Map<String, long[]>>)com.tangosol.net.CacheFactory.getCache("opt-$cacheStats");
            }
            String uid = cluster.getLocalMember().getUid().toString();
            Map<String, long[]> stats = new HashMap<String, long[]>();
            for (String cacheName : caches.keySet()) {
                Cache cache = caches.get(cacheName);
                // The following information is published:
                // current size, max size, num elements, cache
                // hits, cache misses.
                long [] info = new long[5];
                info[0] = cache.getCacheSize();
                info[1] = cache.getMaxCacheSize();
                info[2] = cache.size();
                info[3] = cache.getCacheHits();
                info[4] = cache.getCacheMisses();
                stats.put(cacheName, info);
            }
            // Publish message
            cacheStats.put(uid, stats);
        }

Examples of org.nemesis.forum.util.cache.Cache

  public ForumPermissions getPermissions(Authorization authorization) {
    int userID = authorization.getUserID();

    //Get the user perm cache for this forum
    Cache userPermCache = (Cache) getCacheManager().get(DbCacheManager.USER_PERMS_CACHE, new Integer(-1));

    //Simple case: if cache is turned on and the user is already cached,
    //we can simply return the cached permissions.
    if (userPermCache != null) {
      ForumPermissions permissions = (ForumPermissions) userPermCache.get(new Integer(userID));
      if (permissions != null) {
        return permissions;
      }
    }

    //Not so simple case: cache is not turned on or the user permissions
    //have not been cached yet.
    boolean isAnonymous = (userID == -1);
    boolean isUser = !isAnonymous;

    ForumPermissions finalPermissions = ForumPermissions.none();
    // check each forum for a specific permission
    Iterator allForums = this.forums();
    Forum forum;
    ForumPermissions forumUserPermissions;
    while (allForums.hasNext()) {
      forum = (Forum) allForums.next();
      forumUserPermissions = getUserPermissions(userID, forum.getID());
      finalPermissions = new ForumPermissions(finalPermissions, forumUserPermissions);
    }

    //Step 1 - Get permissions for the User. This includes anonymous
    //perms, "special user" perms, and the specific perms for the user.
    if (isUser) {
      ForumPermissions userPermissions = getUserPermissions(userID, -1);
      //Combine permissions
      finalPermissions = new ForumPermissions(finalPermissions, userPermissions);
    }
    //Add in anonymous perms.
    ForumPermissions anonyPermissions = null;
    if (userPermCache != null) {
      anonyPermissions = (ForumPermissions) userPermCache.get(new Integer(-1));
    }
    //Otherwise, do our own lookup.
    if (anonyPermissions == null) {
      anonyPermissions = getUserPermissions(-1, -1);
      //Add to cache so it will be there next time.
      if (userPermCache != null) {
        userPermCache.add(new Integer(-1), anonyPermissions);
      }
    }
    //Combine permissions
    finalPermissions = new ForumPermissions(finalPermissions, anonyPermissions);

    //If they are a valid user, figure out "any user" permissions.
    if (isUser) {
      ForumPermissions specialUserPermissions = null;
      //Check for cache
      if (userPermCache != null) {
        specialUserPermissions = (ForumPermissions) userPermCache.get(new Integer(0));
      }
      //Otherwise, do our own lookup.
      if (specialUserPermissions == null) {
        specialUserPermissions = getUserPermissions(0, -1);
        //Add to cache so it will be there next time.
        if (userPermCache != null) {
          userPermCache.add(new Integer(0), specialUserPermissions);
        }
      }
      //Combine permissions
      finalPermissions = new ForumPermissions(finalPermissions, specialUserPermissions);
    }

    //Step 2 -- get Permissions for all groups the user is in.
    int[] groups = ((DbProfileManager) getProfileManager()).getUserGroups(userID);
    for (int i = 0; i < groups.length; i++) {
      ForumPermissions groupPermissions = getGroupPermissions(groups[i], -1);
      finalPermissions = new ForumPermissions(finalPermissions, groupPermissions);
    }

    //Finally, add user to cache so it will be there next time.
    if (isUser && userPermCache != null) {
      userPermCache.add(new Integer(userID), finalPermissions);
    }

    return finalPermissions;
  }

Examples of org.nutz.dao.cache.Cache

  public static void removeRelationObj(ObsArgClass msg, String tableName) {
    String className=msg.getCacheStrategy().getClassNameByTableName(tableName);
     removeRelationObjByClassName(msg, className);
  }
  public static void removeRelationObjByClassName(ObsArgClass msg, String className) {
    Cache cache=msg.getCache();
    Map<Object, Object> cacheMap=cache.toMap();
    Set<Object> keySet=cacheMap.keySet();
    for (Object key : keySet) {//这里暂时假设key是字符串
      if(key.toString().startsWith(className)){
        cache.remove(key);
      }
    }
  }

Examples of org.objectweb.speedo.jmx.mbeans.Cache

        CacheAttributeController ca = (CacheAttributeController)
          Fractal.getAttributeController(
                FractalHelper.getSubComponent(cache, "cache-manager", logger));
        UnbindManager um = (UnbindManager) cache.getFcInterface("unbind-manager");
        CacheManager cm = (CacheManager) cache.getFcInterface("cache-manager");
        Cache c = new Cache(ca, um, cm, getPMF(), getJormFactory());
        server.registerMBean(c, new ObjectName("speedo:name=cache"));
    }

Examples of org.ofbiz.entity.cache.Cache

        }
       
        this.modelReader = ModelReader.getModelReader(delegatorBaseName);
        this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorBaseName);

        cache = new Cache(delegatorFullName);

        // do the entity model check
        List<String> warningList = FastList.newInstance();
        Debug.logImportant("Doing entity definition check...", module);
        ModelEntityChecker.checkEntities(this, warningList);
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.