View Javadoc

1   /***
2    *  Copyright 2003-2010 Terracotta, Inc.
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  
17  package net.sf.ehcache.config.generator;
18  
19  import java.util.Map;
20  
21  import net.sf.ehcache.config.CacheConfiguration;
22  import net.sf.ehcache.config.Configuration;
23  
24  /***
25   * Utility class for generating configuration texts.
26   *
27   * <p />
28   *
29   * @author <a href="mailto:asanoujam@terracottatech.com">Abhishek Sanoujam</a>
30   * @deprecated Use {@link ConfigurationUtil#generateCacheManagerConfigurationText(Configuration)} or
31   *             {@link ConfigurationUtil#generateCacheConfigurationText(CacheConfiguration)} instead
32   */
33  @Deprecated
34  public class ConfigurationGenerator {
35  
36      /***
37       * Generates the configuration text for the provided {@link Configuration}, the default {@link CacheConfiguration} and the map of
38       * {@link CacheConfiguration}'s
39       *
40       * @param configuration
41       * @param defaultCacheConfiguration
42       * @param cacheConfigs
43       * @return String equivalent to an ehcache.xml for the input parameters
44       * @deprecated use appropriate methods in {@link ConfigurationUtil} instead
45       */
46      @Deprecated
47      public String generate(Configuration configuration, CacheConfiguration defaultCacheConfiguration,
48              Map<String, CacheConfiguration> cacheConfigs) {
49          return ConfigurationUtil.generateCacheManagerConfigurationText(configuration);
50      }
51  
52      /***
53       * Generates configuration text for a specific cache using the input {@link CacheConfiguration}
54       *
55       * @param cacheConfiguration
56       * @return String containing configuration for the input {@link CacheConfiguration}
57       * @deprecated use appropriate methods in {@link ConfigurationUtil} instead
58       */
59      @Deprecated
60      public String generate(CacheConfiguration cacheConfiguration) {
61          return ConfigurationUtil.generateCacheConfigurationText(cacheConfiguration);
62      }
63  
64  }