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  package net.sf.ehcache.config;
17  
18  /***
19   * Instances of CacheConfigurationListener can be registered with CacheConfiguration
20   * instances in order to receive notification when any of the dynamic properties of
21   * the configuration are changed.
22   *
23   * @author Chris Dennis
24   */
25  public interface CacheConfigurationListener {
26  
27      /***
28       * Indicates a change in the configurations time to idle
29       *
30       * @param oldTimeToIdle previous time to idle value
31       * @param newTimeToIdle new time to idle value
32       */
33      public void timeToIdleChanged(long oldTimeToIdle, long newTimeToIdle);
34  
35      /***
36       * Indicates a change in the configurations time to live
37       *
38       * @param oldTimeToLive previous time to live value
39       * @param newTimeToLive new time to live value
40       */
41      public void timeToLiveChanged(long oldTimeToLive, long newTimeToLive);
42  
43      /***
44       * Indicates a change in the configurations disk store capacity
45       *
46       * @param oldCapacity previous capacity
47       * @param newCapacity new capacity
48       */
49      public void diskCapacityChanged(int oldCapacity, int newCapacity);
50  
51      /***
52       * Indicates a change in the configurations memory store capacity
53       *
54       * @param oldCapacity previous capacity
55       * @param newCapacity new capacity
56       */
57      public void memoryCapacityChanged(int oldCapacity, int newCapacity);
58      
59      /***
60       * Indicates a change in the configuration for enable/disable logging
61       * @param oldValue old value whether logging was enabled or not
62       * @param newValue new value whether logging was enabled or not
63       */
64      public void loggingChanged(boolean oldValue, boolean newValue);
65  
66      /***
67       * Indicates that this listener was registered with the given configuration
68       *
69       * @param config
70       */
71      public void registered(CacheConfiguration config);
72  
73      /***
74       * Indicates that this listener was removed from the given configuration
75       * 
76       * @param config
77       */
78      public void deregistered(CacheConfiguration config);
79  }