Examples of Cache


Examples of org.dozer.cache.Cache

*/
public class DozerCacheTest extends AbstractDozerTest {

  @Test
  public void testPutGetFromCache() throws Exception {
    Cache cache = new DozerCache(getRandomString(), 50);
    int numCacheEntriesToAdd = 45;
    for (int i = 0; i < numCacheEntriesToAdd; i++) {
      Object key = String.valueOf(i);

      assertNull("cache entry should not already exist", cache.get(key));

      cache.put(key, "testvalue" + i);

      String value = (String) cache.get(key);
      assertEquals("cache entries should be equal", value, "testvalue" + i);
    }
    assertEquals("invlid cache size", numCacheEntriesToAdd, cache.getSize());
  }

Examples of org.dspace.services.model.Cache

     */
    public void queueEvent(Event event) {
        validateEvent(event);

        // get the cache
        Cache queueCache = this.cachingService.getCache(QUEUE_CACHE_NAME, new CacheConfig(CacheScope.REQUEST));

        // put the event in the queue if this is in a request
        if (requestService.getCurrentRequestId() != null) {
            // create a key which is orderable and unique
            String key = System.currentTimeMillis() + ":" + queueCache.size() + ":" + event.getId();
            queueCache.put(key, event);
        } else {
            // no request so fire the event immediately
            log.info("No request to queue this event ("+event+") so firing immediately");
            fireEvent(event);
        }

Examples of org.eclipse.core.internal.utils.Cache

  }

  public ProjectContentTypes(Workspace workspace) {
    this.workspace = workspace;
    // keep cache small
    this.contentTypesPerProject = new Cache(5, 30, 0.4);
  }

Examples of org.eurekastreams.server.persistence.mappers.cache.Cache

    public void testExecute()
    {
        final Transformer<ActionContext, Serializable> parameterSupplier = context.mock(Transformer.class,
                "parameterSupplier");
        final DomainMapper<Serializable, Serializable> domainMapper = context.mock(DomainMapper.class, "domainMapper");
        final Cache cache = context.mock(Cache.class);
        final Transformer<ActionContext, Serializable> cacheKeyParameterSupplier = context.mock(Transformer.class,
                "cacheKeyParameterSupplier");
        final Serializable params = context.mock(Serializable.class, "params");
        final Serializable extractedParams = context.mock(Serializable.class, "extractedParams");
        final Serializable result = context.mock(Serializable.class, "result");

Examples of org.exist.storage.cache.Cache


    @Override
    public void deregisterCache( Cache cache )
    {
        Cache next;

        for( int i = 0; i < caches.size(); i++ ) {
            next = (Cache)caches.get( i );

            if( cache == next ) {

Examples of org.glassfish.web.deployment.runtime.Cache

  ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();

        boolean notApp = false;
        //Cache cache = getCache(descriptor);
        try{
            Cache cache = ((SunWebAppImpl)descriptor.getSunDescriptor()).getCache();
            CacheMapping[] cacheMapp=null;
            String servletName=null;
            String urlPattern=null;
            String timeout=null;
            String[] httpMethods;
            //boolean[] keyFields;
            String cacheHelperRef;
            if (cache != null ){
                cacheMapp=cache.getCacheMapping();
            }
            if (cache != null && cacheMapp !=null && cacheMapp.length != 0 ){
                for(int rep=0;rep < cacheMapp.length;rep++){
                    servletName = cacheMapp[rep].getServletName();

Examples of org.h2.util.Cache

        return Utils.getMemoryUsed();
    }

    private void testCache() {
        out = "";
        Cache c = CacheLRU.getCache(this, "LRU", 16);
        for (int i = 0; i < 20; i++) {
            c.put(new Obj(i));
        }
        assertEquals("flush 0 flush 1 flush 2 flush 3 ", out);
    }

Examples of org.hibernate.Cache

     *
     * @param emf
     * @see org.hibernate.ejb.EntityManagerFactoryImpl.JPACache#evictAll()
     */
    public static void evictLevel2Cache(EntityManagerFactory emf) {
        Cache cache = HibernateUtils.getCache(emf);
        cache.evictEntityRegions();
        cache.evictCollectionRegions();
        cache.evictDefaultQueryRegion();
        cache.evictQueryRegions();
        cache.evictNaturalIdRegions();
    }

Examples of org.hibernate.annotations.Cache

      return false;
    }
  }

  private static Cache determineCacheSettings(XClass clazzToProcess, Mappings mappings) {
    Cache cacheAnn = clazzToProcess.getAnnotation( Cache.class );
    if ( cacheAnn != null ) {
      return cacheAnn;
    }

    Cacheable cacheableAnn = clazzToProcess.getAnnotation( Cacheable.class );

Examples of org.hibernate.cache.Cache

   */
  public synchronized SecondLevelCacheStatistics getSecondLevelCacheStatistics(String regionName) {
    SecondLevelCacheStatistics slcs = (SecondLevelCacheStatistics) secondLevelCacheStatistics.get(regionName);
    if (slcs==null) {
      if (sessionFactory == null) return null;
      Cache cache = sessionFactory.getSecondLevelCacheRegion(regionName);
      if (cache==null) return null;
      slcs = new SecondLevelCacheStatistics(cache);
      secondLevelCacheStatistics.put(regionName, slcs);
    }
    return slcs;
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.