Package org.infinispan.marshall.core

Examples of org.infinispan.marshall.core.MarshalledEntry


            if (oldEntry != null) {
               isLoaded.set(null); //not loaded
               return oldEntry; //no changes in container
            }

            MarshalledEntry loaded = loadAndCheckExpiration(persistenceManager, key, ctx, timeService);
            if (loaded == null) {
               isLoaded.set(Boolean.FALSE); //not loaded
               return null; //no changed in container
            }
View Full Code Here


      });
   }

   public static MarshalledEntry loadAndCheckExpiration(PersistenceManager persistenceManager, Object key,
                                                        InvocationContext context, TimeService timeService) {
      final MarshalledEntry loaded = persistenceManager.loadFromAllStores(key, context);
      if (log.isTraceEnabled()) {
         log.tracef("Loaded %s for key %s from persistence.", loaded, key);
      }
      if (loaded == null) {
         return null;
      }
      InternalMetadata metadata = loaded.getMetadata();
      if (metadata != null && metadata.isExpired(timeService.wallClockTime())) {
         return null;
      }
      return loaded;
   }
View Full Code Here

      HashSet<IndexScopedKey> keysCollector = new HashSet<IndexScopedKey>();
      loadSomeKeys(keysCollector, Collections.EMPTY_SET, toLoadElements);
      for (IndexScopedKey key : keysCollector) {
         Object value = load(key);
         if (value != null) {
            MarshalledEntry cacheEntry = new MarshalledEntryImpl(key, value, null, marshaller);
            entriesCollector.add(cacheEntry);
         }
      }
   }
View Full Code Here

         public Void call() throws Exception {
            try {
               for (Object key : batch) {
                  if (taskContext.isStopped())
                     break;
                  MarshalledEntry entry = null;
                  if (loadEntry || loadMetadata) {
                     entry = load(key);
                  }
                  if (!loadEntry || !loadMetadata) {
                     entry = ctx.getMarshalledEntryFactory().newMarshalledEntry(key,
                           loadEntry ? entry.getValue() : null,
                           loadMetadata ? entry.getMetadata() : null);
                  }
                  cacheLoaderTask.processEntry(entry, taskContext);
               }
            } catch (Exception e) {
               log.errorExecutingParallelStoreTask(e);
View Full Code Here

               if (metadata != null && metadata.isExpired(timeService.wallClockTime())) continue;
               eacs.submit(new Callable<Void>() {
                  @Override
                  public Void call() throws Exception {
                     try {
                        final MarshalledEntry marshalledEntry = marshallerEntryFactory.newMarshalledEntry(key, entity, metadata);
                        if (marshalledEntry != null) {
                           task.processEntry(marshalledEntry, taskContext);
                        }
                        return null;
                     } catch (Exception e) {
View Full Code Here

      }

      @Override
      public Void call() throws Exception {
         try {
            final MarshalledEntry marshalledEntry = marshallerEntryFactory.newMarshalledEntry(key, entity, metadata);
            if (marshalledEntry != null) {
               task.processEntry(marshalledEntry, taskContext);
            }
            return null;
         } catch (Exception e) {
View Full Code Here

            if (emExec != null) {
               emExec.close();
            }
         }
         try {
            final MarshalledEntry marshalledEntry = marshallerEntryFactory.newMarshalledEntry(key, entity, metadata);
            if (marshalledEntry != null) {
               task.processEntry(marshalledEntry, taskContext);
            }
            return null;
         } catch (Exception e) {
View Full Code Here

      HashSet<IndexScopedKey> keysCollector = new HashSet<>();
      loadSomeKeys(keysCollector, Collections.EMPTY_SET, toLoadElements);
      for (IndexScopedKey key : keysCollector) {
         Object value = load(key);
         if (value != null) {
            MarshalledEntry cacheEntry = new MarshalledEntryImpl(key, value, null, marshaller);
            entriesCollector.add(cacheEntry);
         }
      }
   }
View Full Code Here

      for (Object key : remoteCache.keySet()) {
         if (taskContext.isStopped())
            break;
         if (filter == null || filter.shouldLoadKey(key)) {
            try {
               MarshalledEntry marshalledEntry = load(key);
               if (marshalledEntry != null) {
                  task.processEntry(marshalledEntry, taskContext);
               }
            } catch (InterruptedException e) {
               Thread.currentThread().interrupt();
View Full Code Here

         @Override
         public Void call() throws Exception {
            for (Object key : batch) {
               if (taskContext.isStopped())
                  break;
               MarshalledEntry marshalledEntry = !loadEntry && !loadMetadata ?
                     new MarshalledEntryImpl(key, (Object) null, null, ctx.getMarshaller()) :
                     load(key);
               if (marshalledEntry != null) {
                  cacheLoaderTask.processEntry(marshalledEntry, taskContext);
               }
View Full Code Here

TOP

Related Classes of org.infinispan.marshall.core.MarshalledEntry

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.