Package org.nemesis.forum.util.cache

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


    if (!cacheManager.isCacheEnabled()) {
      User user = new DbUser(username);
      return getUser(user.getID());
    }
    //Cache is enabled.
    CacheableInteger userIDInteger = (CacheableInteger) cacheManager.get(DbCacheManager.USER_ID_CACHE, username);
    //if id wan't found in cache, load it up and put it there.
    if (userIDInteger == null) {
      User user = new DbUser(username);
      userIDInteger = new CacheableInteger(new Integer(user.getID()));
      cacheManager.add(DbCacheManager.USER_ID_CACHE, username, userIDInteger);
    }
    return getUser(userIDInteger.getInteger().intValue());
  }
View Full Code Here


    if (!cacheManager.isCacheEnabled()) {
      Group group = new DbGroup(name, null, factory);
      return getGroup(group.getID());
    }
    //Cache is enabled.
    CacheableInteger groupIDInteger = (CacheableInteger) cacheManager.get(DbCacheManager.GROUP_ID_CACHE, name);
    //if id wan't found in cache, load it up and put it there.
    if (groupIDInteger == null) {
      Group group = new DbGroup(name, null, factory);
      groupIDInteger = new CacheableInteger(new Integer(group.getID()));
      cacheManager.add(DbCacheManager.GROUP_ID_CACHE, name, groupIDInteger);
    }
    return getGroup(groupIDInteger.getInteger().intValue());
  }
View Full Code Here

    if (!cacheManager.isCacheEnabled()) {
      Forum forum = new DbForum(name, this);
      return forum;
    }
    //Cache is enabled.
    CacheableInteger forumIDInteger = (CacheableInteger) cacheManager.get(DbCacheManager.FORUM_ID_CACHE, name);
    //if id wan't found in cache, load it up and put it there.
    if (forumIDInteger == null) {
      Forum forum = new DbForum(name, this);
      forumIDInteger = new CacheableInteger(new Integer(forum.getID()));
      cacheManager.add(DbCacheManager.FORUM_ID_CACHE, name, forumIDInteger);
    }
    return getForum(forumIDInteger.getInteger().intValue());
  }
View Full Code Here

TOP

Related Classes of org.nemesis.forum.util.cache.CacheableInteger

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.