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.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.html 13146 2011-08-01 17:12:39Z oletizi $
25 * @since 1.3
26 */
27 public interface CacheManagerMBean {
28
29 /***
30 * Gets the status attribute of the Ehcache
31 *
32 * @return The status value, as a String from the Status enum class
33 */
34 String getStatus();
35
36 /***
37 * Gets the name of the cache manager
38 *
39 * @return The name of the CacheManager
40 */
41 String getName();
42
43 /***
44 * Shuts down the CacheManager.
45 * <p/>
46 * If the shutdown occurs on the singleton, then the singleton is removed, so that if a singleton access method
47 * is called, a new singleton will be created.
48 */
49 void shutdown();
50
51
52 /***
53 * Clears the contents of all caches in the CacheManager, but without
54 * removing any caches.
55 * <p/>
56 * This method is not synchronized. It only guarantees to clear those elements in a cache
57 * at the time that the {@link net.sf.ehcache.Ehcache#removeAll()} mehod on each cache is called.
58 */
59 void clearAll();
60
61
62 /***
63 * Returns a JMX Cache bean
64 *
65 */
66 Cache getCache(String name);
67
68
69 /***
70 * Gets the cache names managed by the CacheManager
71 */
72 String[] getCacheNames() throws IllegalStateException;
73
74 /***
75 * Gets a list of caches in this CacheManager
76 * @return a list of JMX Cache objects
77 */
78 List getCaches();
79
80 /***
81 * Get the committed transactions count
82 * @return the committed transactions count
83 */
84 long getTransactionCommittedCount();
85
86 /***
87 * Get the rolled back transactions count
88 * @return the rolled back transactions count
89 */
90 long getTransactionRolledBackCount();
91
92 /***
93 * Get the timed out transactions count. Note that only transactions which failed to
94 * commit due to a timeout are taken into account
95 * @return the timed out transactions count
96 */
97 long getTransactionTimedOutCount();
98
99 }