1 /**
2 * Copyright 2003-2007 Greg Luck
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.management;
18
19 import java.util.List;
20
21 /**
22 * An MBean interface for those attributes and operations we wish to expose on net.sf.ehcache.CacheManager
23 * @author Greg Luck
24 * @version $Id: CacheManagerMBean.java 512 2007-07-10 09:18:45Z gregluck $
25 * @since 1.3
26 */
27 public interface CacheManagerMBean {
28
29
30 /**
31 * Gets the status attribute of the Ehcache
32 *
33 * @return The status value, as a String from the Status enum class
34 */
35 public String getStatus();
36
37
38
39 /**
40 * Shuts down the CacheManager.
41 * <p/>
42 * If the shutdown occurs on the singleton, then the singleton is removed, so that if a singleton access method
43 * is called, a new singleton will be created.
44 */
45 public void shutdown();
46
47
48 /**
49 * Clears the contents of all caches in the CacheManager, but without
50 * removing any caches.
51 * <p/>
52 * This method is not synchronized. It only guarantees to clear those elements in a cache
53 * at the time that the {@link net.sf.ehcache.Ehcache#removeAll()} mehod on each cache is called.
54 */
55 public void clearAll();
56
57
58 /**
59 * Returns a JMX Cache bean
60 *
61 */
62 public Cache getCache(String name);
63
64
65 /**
66 * Gets the cache names managed by the CacheManager
67 */
68 public String[] getCacheNames() throws IllegalStateException;
69
70 /**
71 * Gets a list of caches in this CacheManager
72 * @return a list of JMX Cache objects
73 */
74 public List getCaches();
75 }