Package net.sf.ehcache.config

Examples of net.sf.ehcache.config.TerracottaConfiguration


     */
    public static void validateEhcache(Ehcache cache) throws CacheException {
        CacheConfiguration cacheConfig = cache.getCacheConfiguration();

        if ( cacheConfig.isTerracottaClustered() ) {
            TerracottaConfiguration tcConfig = cacheConfig.getTerracottaConfiguration();
            switch ( tcConfig.getValueMode() ) {
                case IDENTITY:
                    throw new CacheException(
                            "The clustered Hibernate cache " + cache.getName() + " is using IDENTITY value mode.\n"
                                    + "Identity value mode cannot be used with Hibernate cache regions."
                    );
View Full Code Here


     */
    public static void validateEhcache(Ehcache cache) throws CacheException {
        CacheConfiguration cacheConfig = cache.getCacheConfiguration();

        if ( cacheConfig.isTerracottaClustered() ) {
            TerracottaConfiguration tcConfig = cacheConfig.getTerracottaConfiguration();
            switch ( tcConfig.getValueMode() ) {
                case IDENTITY:
                    throw new CacheException(
                            "The clustered Hibernate cache " + cache.getName() + " is using IDENTITY value mode.\n"
                                    + "Identity value mode cannot be used with Hibernate cache regions."
                    );
View Full Code Here

   */
  public static void validateEhcache(Ehcache cache) throws CacheException {
    final CacheConfiguration cacheConfig = cache.getCacheConfiguration();

    if ( cacheConfig.isTerracottaClustered() ) {
      final TerracottaConfiguration tcConfig = cacheConfig.getTerracottaConfiguration();
      switch ( tcConfig.getValueMode() ) {
        case IDENTITY: {
          throw new CacheException(
              "The clustered Hibernate cache " + cache.getName() + " is using IDENTITY value mode.\n"
                  + "Identity value mode cannot be used with Hibernate cache regions."
          );
View Full Code Here

     */
    public static void validateEhcache(Ehcache cache) throws CacheException {
        CacheConfiguration cacheConfig = cache.getCacheConfiguration();

        if ( cacheConfig.isTerracottaClustered() ) {
            TerracottaConfiguration tcConfig = cacheConfig.getTerracottaConfiguration();
            switch ( tcConfig.getValueMode() ) {
                case IDENTITY:
                    throw new CacheException(
                            "The clustered Hibernate cache " + cache.getName() + " is using IDENTITY value mode.\n"
                                    + "Identity value mode cannot be used with Hibernate cache regions."
                    );
View Full Code Here

    config.setDiskExpiryThreadIntervalSeconds(this.diskExpiryThreadIntervalSeconds);
    config.setMaxElementsOnDisk(this.maxElementsOnDisk);

    if (this.terracottaClustered) {
      TerracottaConfiguration tcConfig = new TerracottaConfiguration();
      tcConfig.setClustered(true);
      config.terracotta(tcConfig);
    }

    return new Cache(config);
  }
View Full Code Here

   */
  public static void validateEhcache(Ehcache cache) throws CacheException {
    final CacheConfiguration cacheConfig = cache.getCacheConfiguration();

    if ( cacheConfig.isTerracottaClustered() ) {
      final TerracottaConfiguration tcConfig = cacheConfig.getTerracottaConfiguration();
      switch ( tcConfig.getValueMode() ) {
        case IDENTITY: {
          throw new CacheException(
              "The clustered Hibernate cache " + cache.getName() + " is using IDENTITY value mode.\n"
                  + "Identity value mode cannot be used with Hibernate cache regions."
          );
View Full Code Here

        CacheWriterConfiguration cacheWriterConfiguration = cacheConfiguration.getCacheWriterConfiguration();
        if (cacheWriterConfiguration != null && !CacheConfiguration.DEFAULT_CACHE_WRITER_CONFIGURATION.equals(cacheWriterConfiguration)) {
            element.addChildElement(new CacheWriterConfigurationElement(element, cacheWriterConfiguration));
        }
        addAllFactoryConfigsAsChildElements(element, "cacheDecoratorFactory", cacheConfiguration.getCacheDecoratorConfigurations());
        TerracottaConfiguration terracottaConfiguration = cacheConfiguration.getTerracottaConfiguration();
        if (terracottaConfiguration != null) {
            element.addChildElement(new TerracottaConfigurationElement(element, terracottaConfiguration));
        }

        if (cacheConfiguration.isSearchable()) {
View Full Code Here

    private static void assertExpress(Map<String, CacheConfiguration> cacheConfigs, TerracottaClientConfiguration terracottaConfig) {
        // verify no identity caches if standalone will be used
        List<String> identityCaches = new ArrayList<String>();
        for (CacheConfiguration config : cacheConfigs.values()) {
            TerracottaConfiguration tcConfig = config.getTerracottaConfiguration();
            if (tcConfig != null && tcConfig.getValueMode() == TerracottaConfiguration.ValueMode.IDENTITY) {
                identityCaches.add(config.getName());
            }
        }
        if (!identityCaches.isEmpty()) {
            throw newExceptionIdentityNotSupportedInExpress(identityCaches);
View Full Code Here

                    .diskPersistent(diskPersistent)
                    .diskExpiryThreadIntervalSeconds(diskExpiryThreadIntervalSeconds)
                    .maxElementsOnDisk(maxElementsOnDisk)
                    .diskSpoolBufferSizeMB(diskSpoolBufferSizeMB)
                    .clearOnFlush(clearOnFlush)
                    .terracotta(new TerracottaConfiguration()
                        .clustered(isTerracottaClustered)
                        .valueMode(terracottaValueMode)
                        .coherentReads(terracottaCoherentReads)),
                registeredEventListeners,
                bootstrapCacheLoader);
View Full Code Here

     */
    static void validateEhcache(Ehcache cache) throws CacheException {
        CacheConfiguration cacheConfig = cache.getCacheConfiguration();

        if (cacheConfig.isTerracottaClustered()) {
            TerracottaConfiguration tcConfig = cacheConfig.getTerracottaConfiguration();
            switch (tcConfig.getValueMode()) {
                case IDENTITY:
                    throw new CacheException("The clustered Hibernate cache " + cache.getName() + " is using IDENTITY value mode.\n"
                           + "Identity value mode cannot be used with Hibernate cache regions.");
                case SERIALIZATION:
                default:
View Full Code Here

TOP

Related Classes of net.sf.ehcache.config.TerracottaConfiguration

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.