Examples of Cache


Examples of com.cetsoft.imcache.cache.Cache

  @Test
  public void getCache(){
    doReturn(1).when(type).getType();
    doReturn(cacheMap).when(cacheCoordinator).getOrCreate();
    doReturn(cache).when(cacheMap).get(anyInt());
    Cache actualCache = cacheCoordinator.getCache(type);
    assertEquals(cache, actualCache);
  }

Examples of com.cj.jshintmojo.cache.Cache

    try {
      final File targetPath = new File(basedir, "target");
      mkdirs(targetPath);
      final File cachePath = new File(targetPath, "lint.cache");
     
      final Cache cache = readCache(cachePath, new Cache(this.options, this.globals));
     
      if(!nullSafeEquals(options, cache.options)){
        getLog().warn("Options changed ... clearing cache");
        cache.previousResults.clear();
      }
     
      if(!nullSafeEquals(globals, cache.globals)){
        getLog().warn("Globals changed ... clearing cache");
        cache.previousResults.clear();
      }
     
      List<File> javascriptFiles = new ArrayList<File>();

      for(String next: directories){
        File path = new File(basedir, next);
        if(!path.exists() && !path.isDirectory()){
          getLog().warn("You told me to find tests in " + next + ", but there is nothing there (" + path.getAbsolutePath() + ")");
        }else{
          collect(path, javascriptFiles);
        }
      }

      List<File> matches = FunctionalJava.filter(javascriptFiles, new Fn<File, Boolean>(){
        public Boolean apply(File i) {
          for(String exclude : excludes){
            File e = new File(basedir, exclude);
            if(i.getAbsolutePath().startsWith(e.getAbsolutePath())){
              getLog().warn("Excluding " + i);
             
              return Boolean.FALSE;
            }
          }

          return Boolean.TRUE;
        }
      });

      JSHint jshint = new JSHint();

      final Map<String, Result> currentResults = new HashMap<String, Result>();
      for(File file : matches){
        Result previousResult = cache.previousResults.get(file.getAbsolutePath());
        Result theResult;
        if(previousResult==null || (previousResult.lastModified.longValue()!=file.lastModified())){
          getLog().info("  " + file );
          List<Error> errors = jshint.run(new FileInputStream(file), options, globals);
          theResult = new Result(file.getAbsolutePath(), file.lastModified(), errors);
        }else{
          getLog().info("  " + file + " [no change]");
          theResult = previousResult;
        }
       
        if(theResult!=null){
          currentResults.put(theResult.path, theResult);
          Result r = theResult;
          currentResults.put(r.path, r);
          for(Error error: r.errors){
            getLog().error("   " + error.line.intValue() + "," + error.character.intValue() + ": " + error.reason);
          }
        }
      }
     
      Util.writeObject(new Cache(options, this.globals, currentResults), cachePath);
     
     
      int numProblematicFiles = 0;
      for(Result r : currentResults.values()){
        if(!r.errors.isEmpty()){

Examples of com.dotcms.repackage.com.google.common.cache.Cache

    if(group ==null ){
      return ;
    }
    group = group.toLowerCase();

    Cache cache = getCache(group);


    if(isDiskCache(group)){
      try {
        diskCache.remove(new Fqn(group));
      } catch (Exception e) {
        Logger.debug(DotGuavaCacheAdministratorImpl.class,e.getMessage(),e);
      }
    }
    cache.invalidateAll();

  }

Examples of com.extjs.gxt.ui.client.core.Templates.Cache

    }

    private boolean isCache(JMethod method) {
      boolean cache = false;
      Cache cacheAnn = method.getAnnotation(Cache.class);
      cache = (cacheAnn != null);
      return cache;
    }

Examples of com.flaptor.util.Cache

     * Invalidates all the caches, after printing statistics about their hitrate.
     */
    private void clearCaches() {
        if (null != caches) {
            for (int i = 0; i < caches.size(); i++) {
                Cache cache = caches.get(i);
                logger.info("Cache " + i + ": hit ratio since last clear is " + cache.getRecentHitRatio() + ", historic is " + cache.getHitRatio());
                cache.clear();
            }
        }
    }

Examples of com.gargoylesoftware.htmlunit.Cache

                final String referer = page.getWebResponse().getRequestSettings().getUrl().toExternalForm();
                request.setAdditionalHeader("Referer", referer);
            }

            uri = request.getUrl().toExternalForm();
            final Cache cache = client.getCache();
            final Object fromCache = cache.getCachedObject(request);
            if (fromCache != null && fromCache instanceof CSSStyleSheet) {
                sheet = new Stylesheet(element, (CSSStyleSheet) fromCache, uri);
            }
            else {
                final WebResponse response = client.loadWebResponse(request);
                uri = response.getRequestSettings().getUrl().toExternalForm();
                client.printContentIfNecessary(response);
                client.throwFailingHttpStatusCodeExceptionIfNecessary(response);
                // CSS content must have downloaded OK; go ahead and build the corresponding stylesheet.
                final String css = response.getContentAsString();
                final InputSource source = new InputSource(new StringReader(css));
                sheet = new Stylesheet(element, source, uri);
                cache.cacheIfPossible(request, response, sheet.getWrappedSheet());
            }
        }
        catch (final FailingHttpStatusCodeException e) {
            // Got a 404 response or something like that; behave nicely.
            LOG.error(e.getMessage());

Examples of com.gemstone.gemfire.cache.Cache

    }
    logger.info("Starting Cache Server");
    @SuppressWarnings("resource")
    FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(path);
    context.registerShutdownHook();
    Cache cache = context.getBean(Cache.class);
    ManagementService ms = ManagementService.getExistingManagementService(cache);
    CacheServerMXBean cacheServerManager = ms.getLocalCacheServerMXBean(port);
    if (!cacheServerManager.isRunning()) {
      System.out.println("failed to start cache server ");
      System.exit(1);

Examples of com.github.dynamicextensionsalfresco.webscripts.annotations.Cache

    Transaction transaction = beanFactory.findAnnotationOnBean(beanName, Transaction.class);
    if (transaction == null) {
      transaction = getDefaultTransactionAnnotation();
    }
    handleTransactionAnnotation(transaction, beanName, description);
    Cache cache = beanFactory.findAnnotationOnBean(beanName, Cache.class);
    if (cache == null) {
      cache = getDefaultCacheAnnotation();
    }
    handleCacheAnnotation(cache, beanName, description);

Examples of com.github.mrcritical.ironcache.model.Cache

  public void testClearCache() throws URISyntaxException {

    // Add items to the cache first
    primeTheCache(cacheName);

    Assert.assertTrue(cacheProvider.getCache(cacheName).or(new Cache()).getSize() > 0);

    cacheProvider.clearCache(cacheName);

    Assert.assertTrue(cacheProvider.getCache(cacheName).get().getSize() == 0);
  }

Examples of com.google.common.cache.Cache

    @Override
    public ConcurrentMap getCacheByName(String cacheName) {
        synchronized (caches) {
            if(!caches.containsKey(cacheName)) {
                Cache c = CacheBuilder.newBuilder()
                        .expireAfterAccess(configurationService.getIntConfiguration(CoreOptions.CACHING_EXPIRATION,30), TimeUnit.MINUTES)
                        .maximumSize(configurationService.getLongConfiguration(CoreOptions.CACHING_MAXIMUM_SIZE,10000L))
                        .build();
                caches.put(cacheName,c);
            }
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.