Examples of Caching


Examples of org.apache.cassandra.config.CFMetaData.Caching

        this.directories = directories;
        this.indexManager = new SecondaryIndexManager(this);
        this.metric = new ColumnFamilyMetrics(this);
        fileIndexGenerator.set(generation);

        Caching caching = metadata.getCaching();

        if (logger.isDebugEnabled())
            logger.debug("Starting CFS {}", columnFamily);

        // scan for sstables corresponding to this cf and load them
View Full Code Here

Examples of org.hibernate.metamodel.binding.Caching

    if ( hibernateCacheAnnotation != null ) {
      final org.hibernate.cache.spi.access.AccessType accessType = hibernateCacheAnnotation.value( "usage" ) == null
          ? getLocalBindingContext().getMappingDefaults().getCacheAccessType()
          : CacheConcurrencyStrategy.parse( hibernateCacheAnnotation.value( "usage" ).asEnum() )
          .toAccessType();
      return new Caching(
          hibernateCacheAnnotation.value( "region" ) == null
              ? getName()
              : hibernateCacheAnnotation.value( "region" ).asString(),
          accessType,
          hibernateCacheAnnotation.value( "include" ) != null
              && "all".equals( hibernateCacheAnnotation.value( "include" ).asString() )
      );
    }

    final AnnotationInstance jpaCacheableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), JPADotNames.CACHEABLE
    );

    boolean cacheable = true; // true is the default
    if ( jpaCacheableAnnotation != null && jpaCacheableAnnotation.value() != null ) {
      cacheable = jpaCacheableAnnotation.value().asBoolean();
    }

    final boolean doCaching;
    switch ( getLocalBindingContext().getMetadataImplementor().getOptions().getSharedCacheMode() ) {
      case ALL: {
        doCaching = true;
        break;
      }
      case ENABLE_SELECTIVE: {
        doCaching = cacheable;
        break;
      }
      case DISABLE_SELECTIVE: {
        doCaching = jpaCacheableAnnotation == null || cacheable;
        break;
      }
      default: {
        // treat both NONE and UNSPECIFIED the same
        doCaching = false;
        break;
      }
    }

    if ( !doCaching ) {
      return null;
    }

    return new Caching(
        getName(),
        getLocalBindingContext().getMappingDefaults().getCacheAccessType(),
        true
    );
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.Caching

    if ( hibernateCacheAnnotation != null ) {
      final org.hibernate.cache.spi.access.AccessType accessType = hibernateCacheAnnotation.value( "usage" ) == null
          ? getLocalBindingContext().getMappingDefaults().getCacheAccessType()
          : CacheConcurrencyStrategy.parse( hibernateCacheAnnotation.value( "usage" ).asEnum() )
          .toAccessType();
      return new Caching(
          hibernateCacheAnnotation.value( "region" ) == null
              ? getName()
              : hibernateCacheAnnotation.value( "region" ).asString(),
          accessType,
          hibernateCacheAnnotation.value( "include" ) != null
              && "all".equals( hibernateCacheAnnotation.value( "include" ).asString() )
      );
    }

    final AnnotationInstance jpaCacheableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), JPADotNames.CACHEABLE
    );

    boolean cacheable = true; // true is the default
    if ( jpaCacheableAnnotation != null && jpaCacheableAnnotation.value() != null ) {
      cacheable = jpaCacheableAnnotation.value().asBoolean();
    }

    final boolean doCaching;
    switch ( getLocalBindingContext().getMetadataImplementor().getOptions().getSharedCacheMode() ) {
      case ALL: {
        doCaching = true;
        break;
      }
      case ENABLE_SELECTIVE: {
        doCaching = cacheable;
        break;
      }
      case DISABLE_SELECTIVE: {
        doCaching = jpaCacheableAnnotation == null || cacheable;
        break;
      }
      default: {
        // treat both NONE and UNSPECIFIED the same
        doCaching = false;
        break;
      }
    }

    if ( !doCaching ) {
      return null;
    }

    return new Caching(
        getName(),
        getLocalBindingContext().getMappingDefaults().getCacheAccessType(),
        true
    );
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.Caching

    final String region = cache.getRegion() != null
        ? cache.getRegion()
        : StringHelper.qualify( container().getPath(), getName() );
    final AccessType accessType = Enum.valueOf( AccessType.class, cache.getUsage() );
    final boolean cacheLazyProps = !"non-lazy".equals( cache.getInclude() );
    return new Caching( region, accessType, cacheLazyProps );
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.Caching

      return null;
    }
    final String region = cache.getRegion() != null ? cache.getRegion() : getEntityName();
    final AccessType accessType = Enum.valueOf( AccessType.class, cache.getUsage() );
    final boolean cacheLazyProps = !"non-lazy".equals( cache.getInclude() );
    return new Caching( region, accessType, cacheLazyProps );
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.Caching

    if ( hibernateCacheAnnotation != null ) {
      final org.hibernate.cache.spi.access.AccessType accessType = hibernateCacheAnnotation.value( "usage" ) == null
          ? getLocalBindingContext().getMappingDefaults().getCacheAccessType()
          : CacheConcurrencyStrategy.parse( hibernateCacheAnnotation.value( "usage" ).asEnum() )
          .toAccessType();
      return new Caching(
          hibernateCacheAnnotation.value( "region" ) == null
              ? getName()
              : hibernateCacheAnnotation.value( "region" ).asString(),
          accessType,
          hibernateCacheAnnotation.value( "include" ) != null
              && "all".equals( hibernateCacheAnnotation.value( "include" ).asString() )
      );
    }

    final AnnotationInstance jpaCacheableAnnotation = JandexHelper.getSingleAnnotation(
        getClassInfo(), JPADotNames.CACHEABLE
    );

    boolean cacheable = true; // true is the default
    if ( jpaCacheableAnnotation != null && jpaCacheableAnnotation.value() != null ) {
      cacheable = jpaCacheableAnnotation.value().asBoolean();
    }

    final boolean doCaching;
    switch ( getLocalBindingContext().getMetadataImplementor().getOptions().getSharedCacheMode() ) {
      case ALL: {
        doCaching = true;
        break;
      }
      case ENABLE_SELECTIVE: {
        doCaching = cacheable;
        break;
      }
      case DISABLE_SELECTIVE: {
        doCaching = jpaCacheableAnnotation == null || cacheable;
        break;
      }
      default: {
        // treat both NONE and UNSPECIFIED the same
        doCaching = false;
        break;
      }
    }

    if ( !doCaching ) {
      return null;
    }

    return new Caching(
        getName(),
        getLocalBindingContext().getMappingDefaults().getCacheAccessType(),
        true
    );
  }
View Full Code Here

Examples of org.hibernate.metamodel.binding.Caching

    }
    final String explicitRegion = cacheElement.attributeValue( "region" );
    final String region = explicitRegion != null ? explicitRegion : entityBinding.getEntity().getName();
    final String strategy = cacheElement.attributeValue( "usage" );
    final boolean cacheLazyProps = !"non-lazy".equals( cacheElement.attributeValue( "include" ) );
    entityBinding.setCaching( new Caching( region, strategy, cacheLazyProps ) );
  }
View Full Code Here

Examples of org.picocontainer.behaviors.Caching

        PicoContainer container = createPicoContainer();
        return new PicoStepsFactory(configuration(), container);
    }

    private PicoContainer createPicoContainer() {
        MutablePicoContainer container = new DefaultPicoContainer(new Caching().wrap(new ConstructorInjection()));
        container.addComponent(MySteps.class);
        return container;
    }
View Full Code Here

Examples of org.picocontainer.behaviors.Caching

    public InjectableStepsFactory stepsFactory() {
        return new PicoStepsFactory(configuration(), createPicoContainer());
    }

    private PicoContainer createPicoContainer() {
        MutablePicoContainer container = new DefaultPicoContainer(new Caching().wrap(new ConstructorInjection()));
        container.addComponent(TradingService.class);
        container.addComponent(TraderSteps.class);
        container.addComponent(BeforeAfterSteps.class);
        container.addComponent(AndSteps.class);
        container.addComponent(CalendarSteps.class);
View Full Code Here

Examples of org.picocontainer.behaviors.Caching

import static org.junit.Assert.assertTrue;

public class PicoStepsFactoryBehaviour {

    private MutablePicoContainer createPicoContainer() {
        return new DefaultPicoContainer(new Caching().wrap(new ConstructorInjection()));
    }
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.