|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
CacheJmxWrapperMBean.java | - | - | - | - |
|
1 | /* | |
2 | * JBoss, Home of Professional Open Source | |
3 | * | |
4 | * Distributable under LGPL license. | |
5 | * See terms of license at gnu.org. | |
6 | */ | |
7 | package org.jboss.cache.jmx; | |
8 | ||
9 | import org.jboss.cache.Cache; | |
10 | import org.jboss.cache.CacheException; | |
11 | import org.jboss.cache.CacheStatus; | |
12 | import org.jboss.cache.config.Configuration; | |
13 | import org.jgroups.Address; | |
14 | ||
15 | import java.util.List; | |
16 | ||
17 | /** | |
18 | * JMX interface to the {@link org.jboss.cache.Cache}. Full access to the cache is not supported, only a certain | |
19 | * set of operations are exposed via JMX: | |
20 | * <p/> | |
21 | * <ol> | |
22 | * <li> Lifecycle methods - create, start, stop, destroy</li> | |
23 | * <li> Configuration (read-only) getter - which retrieves a String (or formatted HTML for web based JMX consoles) representation of the configuration</li> | |
24 | * <li> Properties exposing {@link Configuration} elements</li> | |
25 | * <li> Cache information methods (numNodes, numAttributes, lockInfo, printDetails) which print as Strings or as formatted HTML (for web based JMX consoles)</li> | |
26 | * | |
27 | * @since 2.0.0 | |
28 | */ | |
29 | public interface CacheJmxWrapperMBean extends LegacyConfiguration | |
30 | { | |
31 | /** The lifecycle method stop has completed */ | |
32 | public static final int STOPPED = 0; | |
33 | /** The lifecycle method stop has been invoked */ | |
34 | public static final int STOPPING = 1; | |
35 | /** The lifecycle method start has been invoked */ | |
36 | public static final int STARTING = 2; | |
37 | /** The lifecycle method start has completed */ | |
38 | public static final int STARTED = 3; | |
39 | /** There has been an error during some operation */ | |
40 | public static final int FAILED = 4; | |
41 | /** The lifecycle method destroy has completed */ | |
42 | public static final int DESTROYED = 5; | |
43 | /** The lifecycle method create has completed */ | |
44 | public static final int CREATED = 6; | |
45 | /** The MBean has been instantiated but has not completed MBeanRegistration.postRegister */ | |
46 | public static final int UNREGISTERED = 7; | |
47 | /** The MBean has been instantiated and has completed MBeanRegistration.postRegister */ | |
48 | public static final int REGISTERED = 8; | |
49 | ||
50 | void create() throws CacheException; | |
51 | ||
52 | void start() throws CacheException; | |
53 | ||
54 | void stop(); | |
55 | ||
56 | void destroy(); | |
57 | ||
58 | /** | |
59 | * Gets where this object is in its lifecycle transitions. | |
60 | * | |
61 | * @return the current status. Will not return <code>null</code> | |
62 | */ | |
63 | CacheStatus getCacheStatus(); | |
64 | ||
65 | /** | |
66 | * Legacy attribute to expose the {@link #getCacheStatus() cache status} | |
67 | * in terms of the JBoss AS ServiceMBean values. This interface does | |
68 | * not extend ServiceMBean, but this attribute is retained to provide | |
69 | * compatibility with the JBoss AS JSR-77 integration layer. | |
70 | * | |
71 | * @return the current status, e.g. {@link #STARTED}. | |
72 | */ | |
73 | int getState(); | |
74 | ||
75 | /** | |
76 | * Retrieves a reference to the underlying {@link Cache} | |
77 | */ | |
78 | Cache getCache(); | |
79 | ||
80 | /** | |
81 | * @return an immutable configuration | |
82 | */ | |
83 | Configuration getConfiguration(); | |
84 | ||
85 | /** | |
86 | * @return a string based representation of the configuration | |
87 | */ | |
88 | String getConfigurationAsString(); | |
89 | ||
90 | /** | |
91 | * @return an HTML formatted string based representation of the configuration | |
92 | */ | |
93 | String getConfigurationAsHtmlString(); | |
94 | ||
95 | /** | |
96 | * @return details of nodes in the cache | |
97 | */ | |
98 | String getCacheDetails(); | |
99 | ||
100 | /** | |
101 | * @return details of nodes in the cache, formatted as HTML | |
102 | */ | |
103 | String getCacheDetailsAsHtml(); | |
104 | ||
105 | /** | |
106 | * Returns the local address of this cache in a cluster, or <code>null</code> | |
107 | * if running in local mode. | |
108 | * | |
109 | * @return the local address of this cache in a cluster, or <code>null</code> | |
110 | * if running in local mode. | |
111 | */ | |
112 | Address getLocalAddress(); | |
113 | ||
114 | /** | |
115 | * Returns a list of members in the cluster, or <code>null</code> | |
116 | * if running in local mode. | |
117 | * | |
118 | * @return a {@link List} of members in the cluster, or <code>null</code> | |
119 | * if running in local mode. | |
120 | */ | |
121 | List<Address> getMembers(); | |
122 | ||
123 | /** | |
124 | * @return number of nodes in the cache | |
125 | */ | |
126 | int getNumberOfNodes(); | |
127 | ||
128 | /** | |
129 | * @return number of attributes in the cache | |
130 | */ | |
131 | int getNumberOfAttributes(); | |
132 | ||
133 | /** | |
134 | * @return information on the state of node locks | |
135 | */ | |
136 | String getLockInfo(); | |
137 | ||
138 | /** | |
139 | * @return information on the state of node locks, formatted as HTML | |
140 | */ | |
141 | String getLockInfoAsHtml(); | |
142 | ||
143 | /** | |
144 | * Gets whether this object should register the cache's interceptors | |
145 | * with JMX during {@link {@link #create()}. | |
146 | * <p/> | |
147 | * Default is <code>true</code>. | |
148 | */ | |
149 | boolean getRegisterInterceptors(); | |
150 | ||
151 | /** | |
152 | * Sets whether this object should register the cache's interceptors | |
153 | * with JMX during {@link #create()}. | |
154 | * <p/> | |
155 | * Default is <code>true</code>. | |
156 | */ | |
157 | void setRegisterInterceptors(boolean register); | |
158 | } |
|