Examples of Cache


Examples of org.tomighty.resources.cache.Cache

    return image;
  }

  public Image time(Time time) {
    String iconName = iconNameFor(time);
    Cache cache = caches.of(Icons.class);
    if (cache.contains(iconName)) {
      return cache.get(iconName);
    }

    Dimension size = tray.iconSize();
    Colors colors = look.colors();
    Canvas canvas = new Canvas(size);
    canvas.fontSize((float) size.height * 0.58f);
    canvas.paintGradient(colors.background());
    canvas.drawBorder(colors.background().darker().darker().darker());
    canvas.drawCentralizedText(time.shortestString());

    cache.store(canvas.image(), iconName);

    return canvas.image();
  }

Examples of org.uiautomation.ios.inspector.model.Cache

        log.warning("couldn't find the end point.");
      }
    } catch (MalformedURLException e) {
      log.log(Level.SEVERE, "url format", e);
    }
    Cache cache = (Cache) getServletContext().getAttribute(Cache.KEY);
    if (cache == null) {
      cache = new CacheDefaultImpl(u);
    }

    controllers.add(new SessionGuesserController(cache));

Examples of org.wso2.caching.Cache

                scope + " with ID : " + cacheObjKey);
        }

        // look up cache
        Parameter param = axisCfg.getParameter(cacheObjKey);
        Cache cache = null;
        if (param != null && param.getValue() instanceof Cache) {
            cache = (Cache) param.getValue();

        } else {
            synchronized (axisCfg) {
                // check again after taking the lock to make sure no one else did it before us
                param = axisCfg.getParameter(cacheObjKey);
                if (param != null && param.getValue() instanceof Cache) {
                    cache = (Cache) param.getValue();

                } else {
                    if (traceOrDebugOn) {
                        traceOrDebug(traceOn, "Creating/recreating the cache object");
                    }
                    cache = new Cache();
                    try {
                        axisCfg.addParameter(cacheObjKey, cache);
                    } catch (AxisFault af) {
                        auditWarn("Unable to create a cache with ID : " + cacheObjKey, synCtx);
                    }

Examples of org.xbill.DNS.Cache

    private AtomicInteger requestCounter;

    public BrowserMobHttpClient(StreamManager streamManager, AtomicInteger requestCounter) {
        this.requestCounter = requestCounter;
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        hostNameResolver = new BrowserMobHostNameResolver(new Cache(DClass.ANY));

        this.socketFactory = new SimulatedSocketFactory(hostNameResolver, streamManager);
        this.sslSocketFactory = new TrustingSSLSocketFactory(hostNameResolver, streamManager);

        this.sslSocketFactory.setHostnameVerifier(new AllowAllHostnameVerifier());

Examples of powermock.examples.bypassencapsulation.nontest.Cache

    // Mock only the modifyData method
    ReportDao tested = createPartialMock(ReportDao.class, getReportFromTargetNameMethodName);

    // Create a mock of the distributed cache.
    Cache cacheMock = createMock(Cache.class);

    /*
     * Now that we have a mock of the cache we need to set this instance in
     * the class being tested.
     */
    Whitebox.setInternalState(tested, "cache", cacheMock);

    /*
     * Create an expectation for the private method
     * "getReportFromTargetName".
     */
    expectPrivate(tested, getReportFromTargetNameMethodName, reportName).andReturn(report);

    // Expect the call to invalidate cache.
    cacheMock.invalidateCache(report);
    expectLastCall().once();

    replay(tested, cacheMock);

    tested.deleteReport(reportName);

Examples of railo.commons.io.cache.Cache

  }

  @Override
  public void clearUnused(PageContext pc) throws IOException {
   
    Cache c = getCache(pc);
    List<CacheEntry> entries = c.entries();
    if(entries.size()<100) return;
   
    Iterator<CacheEntry> it = entries.iterator();
    while(it.hasNext()){
      it.next(); // touch them to makes sure the cache remove them, not really good, cache must do this by itself

Examples of se.rupy.sprout.Sprout.Cache

    return old;
  }

  public static Cache get(String type, int start, int limit) throws SQLException {
    String key = type + "|" + start + "|" + limit;
    Cache old = (Cache) cache2.get(key);

    if(old == null) {
      old = new Cache(true);
    }

    if(old.invalid) {
      old = new Cache(false);
      old.setType(ARTICLE | USER);
      old.setParent(-1);
      old.setStart(start);
      old.setLimit(limit);
      Sprout.update(Base.SELECT, old);

      int index = 0;
      Iterator it = old.iterator();

      while(it.hasNext()) {
        NodeBean node = (NodeBean) it.next();
        Article article = new Article();

        article.copy(node);
        article.fill(10, 0, 100);

        cache1.put(new Long(article.getId()), article);

        article.count();

        //Node user = (Node) article.child(USER).getFirst();
        //user.meta();

        old.set(index++, article);
      }

      cache2.put(key, old);
    }
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.