Examples of CacheEntry


Examples of org.exoplatform.services.jcr.config.CacheEntry

   public LinkedWorkspaceStorageCacheImpl(WorkspaceEntry wsConfig) throws RepositoryConfigurationException
   {

      this.name = "jcr." + wsConfig.getUniqueName();

      CacheEntry cacheConfig = wsConfig.getCache();

      long statisticPeriod;
      long cleanerPeriod;
      boolean cleanStats;
      int blockingUsers;
      boolean showStatistic;

      if (cacheConfig != null)
      {
         this.enabled = cacheConfig.isEnabled();

         int maxSizeConf;
         try
         {
            maxSizeConf = cacheConfig.getParameterInteger(MAX_SIZE_PARAMETER_NAME);
         }
         catch (RepositoryConfigurationException e)
         {
            maxSizeConf = cacheConfig.getParameterInteger("maxSize");
         }
         this.maxSize = maxSizeConf;

         int initialSize = maxSize > MAX_CACHE_SIZE ? maxSize / 4 : maxSize;
         this.nodesCache = new WeakHashMap<String, List<NodeData>>(initialSize, LOAD_FACTOR);
         this.propertiesCache = new WeakHashMap<String, List<PropertyData>>(initialSize, LOAD_FACTOR);

         try
         {
            // apply in milliseconds
            this.liveTime = cacheConfig.getParameterTime(LIVE_TIME_PARAMETER_NAME);
         }
         catch (RepositoryConfigurationException e)
         {
            this.liveTime = cacheConfig.getParameterTime("liveTime");
         }

         this.deepDelete = cacheConfig.getParameterBoolean(DEEP_DELETE_PARAMETER_NAME, false);

         blockingUsers = cacheConfig.getParameterInteger(BLOCKING_USERS_COUNT_PARAMETER_NAME, DEF_BLOCKING_USERS_COUNT);

         cleanerPeriod = cacheConfig.getParameterTime(CLEANER_PERIOD_PARAMETER_NAME, DEF_CLEANER_PERIOD);

         cleanStats = cacheConfig.getParameterBoolean(STATISTIC_CLEAN_PARAMETER_NAME, true);
         statisticPeriod = cacheConfig.getParameterTime(STATISTIC_PERIOD_PARAMETER_NAME, DEF_STATISTIC_PERIOD);
         showStatistic = cacheConfig.getParameterBoolean(STATISTIC_LOG_PARAMETER_NAME, false);

      }
      else
      {
         this.maxSize = MAX_CACHE_SIZE;
View Full Code Here

Examples of org.glassfish.hk2.utilities.cache.CacheEntry

            results = immediate.getTimelessResults();
            if (!results.getErrors().isEmpty()) {
                currentErrorHandlers = new LinkedList<ErrorService>(errorHandlers);
            }
            else if (ck != null) {
                CacheEntry entry = cache.put(ck, results);
               
                String releaseKey = rawClass.getName();
                List<CacheEntry> addToMe = cacheEntries.get(releaseKey);
                if (addToMe == null) {
                    addToMe = new LinkedList<CacheEntry>();
View Full Code Here

Examples of org.hibernate.cache.entry.CacheEntry

            "adding entity to second-level cache: " +
            MessageHelper.infoString( persister, id, session.getFactory() )
          );

      Object version = Versioning.getVersion(hydratedState, persister);
      CacheEntry entry = new CacheEntry(
          hydratedState,
          persister,
          entityEntry.isLoadedWithLazyPropertiesUnfetched(),
          version,
          session,
View Full Code Here

Examples of org.hibernate.cache.entry.CacheEntry

      if ( persister.isCacheInvalidationRequired() || entry.getStatus()!=Status.MANAGED ) {
        persister.getCacheAccessStrategy().remove( ck );
      }
      else {
        //TODO: inefficient if that cache is just going to ignore the updated state!
        CacheEntry ce = new CacheEntry(
            state,
            persister,
            persister.hasUninitializedLazyProperties( instance, session.getEntityMode() ),
            nextVersion,
            getSession(),
View Full Code Here

Examples of org.hibernate.cache.entry.CacheEntry

    final SessionFactoryImplementor factory = getSession().getFactory();

    if ( isCachePutEnabled( persister, session ) ) {
     
      CacheEntry ce = new CacheEntry(
          state,
          persister,
          persister.hasUninitializedLazyProperties( instance, session.getEntityMode() ),
          version,
          session,
View Full Code Here

Examples of org.hibernate.cache.entry.CacheEntry

    if ( hasCache() ) {
      CacheKey cacheKey = new CacheKey(id, getIdentifierType(), getEntityName(), session.getEntityMode(), getFactory() );
      Object ce = getCacheAccessStrategy().get( cacheKey, session.getTimestamp() );
      if (ce!=null) {
        CacheEntry cacheEntry = (CacheEntry) getCacheEntryStructure().destructure(ce, factory);
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          //note early exit here:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

Examples of org.hibernate.cache.entry.CacheEntry

          );
        }
      }

      if ( ce != null ) {
        CacheEntry entry = (CacheEntry) persister.getCacheEntryStructure().destructure( ce, factory );

        // Entity was found in second-level cache...
        return assembleCacheEntry(
            entry,
            event.getEntityId(),
View Full Code Here

Examples of org.hibernate.cache.spi.entry.CacheEntry

    if ( hasCache() ) {
      CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getEntityName() );
      Object ce = getCacheAccessStrategy().get( cacheKey, session.getTimestamp() );
      if ( ce != null ) {
        CacheEntry cacheEntry = (CacheEntry) getCacheEntryStructure().destructure( ce, getFactory() );
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          // note early exit here:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

Examples of org.hibernate.cache.spi.entry.CacheEntry

    if ( hasCache() ) {
      CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getEntityName() );
      Object ce = getCacheAccessStrategy().get( cacheKey, session.getTimestamp() );
      if ( ce != null ) {
        CacheEntry cacheEntry = (CacheEntry) getCacheEntryStructure().destructure( ce, getFactory() );
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          // note early exit here:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

Examples of org.infinispan.container.entries.CacheEntry

      if (trace) log.trace("Number of entries in context: {0}", entries.size());

      if (commit) {
         while (it.hasNext()) {
            Map.Entry<Object, CacheEntry> e = it.next();
            CacheEntry entry = e.getValue();
            Object key = e.getKey();
            boolean needToUnlock = lockManager.possiblyLocked(entry);
            // could be null with read-committed
            if (entry != null && entry.isChanged()) {
               commitEntry(ctx, entry);
            } else {
               if (trace) log.trace("Entry for key {0} is null, not calling commitUpdate", key);
            }

            // and then unlock
            if (needToUnlock) {
               if (trace) log.trace("Releasing lock on [" + key + "] for owner " + owner);
               lockManager.unlock(key, owner);
            }
         }
      } else {
         while (it.hasNext()) {
            Map.Entry<Object, CacheEntry> e = it.next();
            CacheEntry entry = e.getValue();
            Object key = e.getKey();
            boolean needToUnlock = lockManager.possiblyLocked(entry);
            // could be null with read-committed
            if (entry != null && entry.isChanged()) entry.rollback();
            else {
               if (trace) log.trace("Entry for key {0} is null, not calling rollbackUpdate", key);
            }
            // and then unlock
            if (needToUnlock) {
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.