Examples of CacheLoader


Examples of com.gemstone.gemfire.cache.CacheLoader

    ReplicatedRegionFactoryBean grandchild11FactoryBean = context.getBean("&/complexNested/child1/grandChild11",
      ReplicatedRegionFactoryBean.class);

    assertNotNull(grandchild11FactoryBean);

    CacheLoader expectedCacheLoader = TestUtils.readField("cacheLoader", grandchild11FactoryBean);

    assertNotNull(expectedCacheLoader);

    CacheLoader actualCacheLoader = grandchild11.getAttributes().getCacheLoader();

    assertSame(expectedCacheLoader, actualCacheLoader);
  }
View Full Code Here

Examples of javax.cache.CacheLoader

                                long now)
  {
    MnodeValue mnodeValue = getClusterBacking().loadClusterValue(entry, config);
   
    if (mnodeValue == null || mnodeValue.isEntryExpired(now)) {
      CacheLoader loader = config.getCacheLoader();

      if (loader != null && entry.getKey() != null) {
        Object value = loader.load(entry.getKey());

        if (value != null) {
          put(entry, value, config, now, mnodeValue);

          return;
View Full Code Here

Examples of javax.cache.CacheLoader

    Object value = get(key);

    if (value != null)
      return value;

    CacheLoader loader = _config.getCacheLoader();

    value = (loader != null) ? loader.load(key) : null;

    if (value != null)
      put(key, value);
    notifyLoad(key);
View Full Code Here

Examples of javax.util.jcache.CacheLoader

            return;
        }
        final CacheLogger logger = CacheImpl.getCache().getAttributes().getLogger();
        try {
            final CacheObject obj = getCacheObject(name, group);
            final CacheLoader loader = obj.getAttributes().getLoader();
            if (loader == null) {
                throw new ObjectNotFoundException("The object has no CacheLoader associated with it.");
            }
            Runnable runnable = new Runnable() {
                public void run() {
                    try {
                        loader.load(obj, arguments);
                    } catch (CacheException e) {
                        if (logger != null) {
                            logger.log("The object was not found in the cache.", e);
                        }
                    }
View Full Code Here

Examples of net.sf.ehcache.loader.CacheLoader

    protected static void registerCacheLoaders(CacheConfiguration cacheConfiguration, Ehcache cache) {
        List cacheLoaderConfigurations = cacheConfiguration.getCacheLoaderConfigurations();
        for (Object cacheLoaderConfiguration : cacheLoaderConfigurations) {
            CacheConfiguration.CacheLoaderFactoryConfiguration factoryConfiguration =
                    (CacheConfiguration.CacheLoaderFactoryConfiguration) cacheLoaderConfiguration;
            CacheLoader cacheLoader = createCacheLoader(factoryConfiguration, cache);
            cache.registerCacheLoader(cacheLoader);
        }
    }
View Full Code Here

Examples of net.sf.jsr107cache.CacheLoader

     * @throws CacheException
     */
    public Cache createCache(Map environment) throws CacheException {


        CacheLoader cacheLoader = null;
        Ehcache cache = null;
        try {
            String name = PropertyUtil.extractAndLogProperty("name", environment);

            String maxElementsInMemoryString = PropertyUtil.extractAndLogProperty("maxElementsInMemory", environment);
View Full Code Here

Examples of org.infinispan.loader.CacheLoader

   private CacheLoaderConfig parseIndividualCacheLoaderConfig(Element indivElement) {
      String clClass = getAttributeValue(indivElement, "class");
      if (!existsAttribute(clClass))
         throw new ConfigurationException("Missing 'class'  attribute for cache loader configuration");
      CacheLoader cl;
      CacheLoaderConfig clc;
      try {
         cl = (CacheLoader) Util.getInstance(clClass);
         clc = Util.getInstance(cl.getConfigurationClass());
      } catch (Exception e) {
         throw new ConfigurationException("Unable to instantiate cache loader or configuration", e);
      }

      clc.setCacheLoaderClassName(clClass);
View Full Code Here

Examples of org.infinispan.loaders.CacheLoader

      }
   }

   private void parseLoader(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder) throws XMLStreamException {
     ConfigurationBuilder builder = holder.getCurrentConfigurationBuilder();
      CacheLoader loader = null;
      Boolean fetchPersistentState = null;
      Boolean ignoreModifications = null;
      Boolean purgeOnStartup = null;
      Integer purgerThreads = null;
      Boolean purgeSynchronously = null;
View Full Code Here

Examples of org.infinispan.loaders.CacheLoader

   }
     
   @SuppressWarnings("unchecked")
   protected <KIn> Set<KIn> loadAllKeysFromCacheLoaderUsingFilter(Set<KIn> filterOutSet) {     
      Set<KIn> keysInCL = InfinispanCollections.<KIn>emptySet();
      CacheLoader cl = resolveCacheLoader();
      if (cl != null) {
         try {
            keysInCL = (Set<KIn>) cl.loadAllKeys((Set<Object>) filterOutSet);
         } catch (CacheLoaderException e) {
            throw new CacheException("Could not load key/value entries from cacheloader", e);
         }
      }
      return keysInCL;
View Full Code Here

Examples of org.infinispan.loaders.CacheLoader

   }
  
   @SuppressWarnings("unchecked")
   protected <KIn, KOut> KOut loadValueFromCacheLoader(KIn key) {     
      KOut value = null;
      CacheLoader cl = resolveCacheLoader();
      if (cl != null) {
         try {
            InternalCacheEntry entry = cl.load(key);
            if (entry != null) {              
               Object loadedValue = entry.getValue();
               if (loadedValue instanceof MarshalledValue) {
                  value = (KOut) ((MarshalledValue) loadedValue).get();
               } else {
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.