Package org.exoplatform.services.cache

Examples of org.exoplatform.services.cache.CacheService


      config.setName(param.getName());
      config.setImplementation("java.lang.String");
      param.setObject(config);
      params.addParameter(param);

      CacheService cs = new CacheServiceImpl(params, new MyExoCacheFactory());
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("NoImpl").getClass(),
         cs.getCacheInstance("NoImpl") instanceof MyExoCache);
      assertTrue("Expected type ConcurrentFIFOExoCache found " + cs.getCacheInstance("KnownImpl").getClass(),
         cs.getCacheInstance("KnownImpl") instanceof ConcurrentFIFOExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImpl").getClass(),
         cs.getCacheInstance("UnKnownImpl") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImplButCorrectFQN").getClass(),
         cs.getCacheInstance("UnKnownImplButCorrectFQN") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("NoImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("NoImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("KnownImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("KnownImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("UnKnownImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found "
         + cs.getCacheInstance("UnKnownImplButCorrectFQN-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("UnKnownImplButCorrectFQN-MyExoCacheConfig") instanceof MyExoCache);
   }
View Full Code Here


      }
   }

   public void testCacheFactory()
   {
      CacheService service_ =
         (CacheService)pc.getComponentInstanceOfType(CacheService.class);
      @SuppressWarnings("rawtypes")
      ExoCache cache = service_.getCacheInstance("myCache");
      assertTrue("expect an instance of MCExoCache but was " + cache, cache instanceof MCExoCache);
   }
View Full Code Here

      config.setName(param.getName());
      config.setImplementation("java.lang.String");
      param.setObject(config);
      params.addParameter(param);

      CacheService cs = new CacheServiceImpl(params, new MyExoCacheFactory());
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("NoImpl").getClass(),
         cs.getCacheInstance("NoImpl") instanceof MyExoCache);
      assertTrue("Expected type ConcurrentFIFOExoCache found " + cs.getCacheInstance("KnownImpl").getClass(),
         cs.getCacheInstance("KnownImpl") instanceof ConcurrentFIFOExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImpl").getClass(),
         cs.getCacheInstance("UnKnownImpl") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImplButCorrectFQN").getClass(),
         cs.getCacheInstance("UnKnownImplButCorrectFQN") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("NoImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("NoImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("KnownImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("KnownImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("UnKnownImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found "
         + cs.getCacheInstance("UnKnownImplButCorrectFQN-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("UnKnownImplButCorrectFQN-MyExoCacheConfig") instanceof MyExoCache);
   }
View Full Code Here

      config.setName(param.getName());
      config.setImplementation("java.lang.String");
      param.setObject(config);
      params.addParameter(param);

      CacheService cs = new CacheServiceImpl(params, new MyExoCacheFactory());
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("NoImpl").getClass(),
         cs.getCacheInstance("NoImpl") instanceof MyExoCache);
      assertTrue("Expected type ConcurrentFIFOExoCache found " + cs.getCacheInstance("KnownImpl").getClass(),
         cs.getCacheInstance("KnownImpl") instanceof ConcurrentFIFOExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImpl").getClass(),
         cs.getCacheInstance("UnKnownImpl") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImplButCorrectFQN").getClass(),
         cs.getCacheInstance("UnKnownImplButCorrectFQN") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("NoImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("NoImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("KnownImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("KnownImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found " + cs.getCacheInstance("UnKnownImpl-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("UnKnownImpl-MyExoCacheConfig") instanceof MyExoCache);
      assertTrue("Expected type MyExoCache found "
         + cs.getCacheInstance("UnKnownImplButCorrectFQN-MyExoCacheConfig").getClass(),
         cs.getCacheInstance("UnKnownImplButCorrectFQN-MyExoCacheConfig") instanceof MyExoCache);
   }
View Full Code Here

          // remove mixin
          currentNode.removeMixin(GoogleDocsConstants.GOOGLE_DRIVE_NODE_TYPE);
          currentNode.save();

          // clear corresponding cache entry
          CacheService cacheService = (CacheService) PortalContainer.getInstance().getComponentInstanceOfType(CacheService.class);
          ExoCache<Serializable, Object> pdfCache = cacheService.getCacheInstance(PDFViewerRESTService.class.getName());
          StringBuilder sbFileCacheKey = new StringBuilder();
          sbFileCacheKey.append(((RepositoryImpl) currentNode.getSession().getRepository()).getName()) //
            .append("/") //
            .append(currentNode.getSession().getWorkspace().getName()) //
            .append("/") //
View Full Code Here

TOP

Related Classes of org.exoplatform.services.cache.CacheService

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.