Examples of RefreshMode


Examples of com.anthavio.cache.Cache.RefreshMode

      if (!entry.isSoftExpired()) {
        return entry; //fresh hit
      } else {
        //soft expired - refresh needed
        logger.debug("Soft expired " + cacheKey);
        RefreshMode mode = request.getRefreshMode();
        if (mode == RefreshMode.BLOCK) {
          //logger.debug("Sync refresh start " + cacheKey);
          return refresh(cacheKey, request);
        } else if (mode == RefreshMode.ASYNC || mode == RefreshMode.RETURN) {
          asyncRefresh(cacheKey, request); //start asynchronous refresh
          logger.debug("Soft expired value returned " + cacheKey);
          return entry; //return soft expired value
        } else if (mode == RefreshMode.SCHEDULED) {
          if (scheduled.get(cacheKey) == null) {
            asyncRefresh(cacheKey, request); //start asynchronous refresh
            addScheduled(cacheKey, request); //register as scheduled
          }
          logger.debug("Soft expired value returned " + cacheKey);
          return entry; //return soft expired value
        } else {
          throw new IllegalArgumentException("Unknown RefreshMode " + mode);
        }
      }
    } else { //cache miss - we have nothing
      RefreshMode mode = request.getRefreshMode();
      if (mode == RefreshMode.BLOCK || mode == RefreshMode.RETURN) {
        return refresh(cacheKey, request);
      } else if (mode == RefreshMode.ASYNC) {
        asyncRefresh(cacheKey, request);
        return null;
View Full Code Here

Examples of com.anthavio.cache.Cache.RefreshMode

      if (!entry.isSoftExpired()) {
        return (CacheEntry<T>) entry; //fresh hit
      } else {
        //soft expired - refresh needed
        logger.debug("Soft expired " + cacheKey);
        RefreshMode mode = request.getRefreshMode();
        if (mode == RefreshMode.BLOCK) {
          //logger.debug("Sync refresh start " + cacheKey);
          return refresh(cacheKey, request);
        } else if (mode == RefreshMode.ASYNC || mode == RefreshMode.RETURN) {
          asyncRefresh(cacheKey, request); //start asynchronous refresh
          logger.debug("Soft expired value returned " + cacheKey);
          return entry; //return soft expired value
        } else if (mode == RefreshMode.SCHEDULED) {
          if (scheduled.get(cacheKey) == null) {
            asyncRefresh(cacheKey, request);
            addScheduled(cacheKey, request);
          }
          logger.debug("Soft expired value returned " + cacheKey);
          return entry; //return soft expired value
        } else {
          throw new IllegalArgumentException("Unknown RefreshMode " + mode);
        }
      }
    } else { //cache miss - we have nothing
      RefreshMode mode = request.getRefreshMode();
      if (mode == RefreshMode.BLOCK || mode == RefreshMode.RETURN) {
        return refresh(cacheKey, request);
      } else if (mode == RefreshMode.ASYNC) {
        asyncRefresh(cacheKey, request);
        return null;
View Full Code Here

Examples of jp.co.ntt.oss.RefreshMode

      assertEquals("argument error", actual);
    } catch (SQLException e) {
      fail("other exception thrown");
    }

    RefreshMode mode;
    // FULL refresh
    try {
      suber = SyncDatabaseDAO.getSubscriber(masterConn, 7);
      suber.setLastCount(6);
      mode = SyncDatabaseDAO.chooseFastestMode(masterConn, suber);
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.