KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > jmx > CacheLegacyJmxWrapperMBean


1 /*
2  * JBoss, Home of Professional Open Source.
3  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
4  * as indicated by the @author tags. See the copyright.txt file in the
5  * distribution for a full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.cache.jmx;
23
24 import org.jboss.cache.Region;
25 import org.jgroups.jmx.JChannelFactoryMBean;
26 import org.w3c.dom.Element JavaDoc;
27
28 import javax.transaction.TransactionManager JavaDoc;
29
30 /**
31  * StandardMBean interface for {@link CacheLegacyJmxWrapper}.
32  *
33  * @author <a HREF="brian.stansberry@jboss.com">Brian Stansberry</a>
34  * @version $Revision: 1.4 $
35  */

36 public interface CacheLegacyJmxWrapperMBean extends CacheJmxWrapperMBean
37 {
38    /**
39     * Get the name of the replication group
40     */

41    String JavaDoc getClusterName();
42
43    /**
44     * Set the name of the replication group
45     */

46    void setClusterName(String JavaDoc name);
47
48    /**
49     * Sets whether marshalling uses scoped class loaders on a per region basis.
50     * <p/>
51     * This property must be set to <code>true</code> before any call to
52     * {@link Region#registerContextClassLoader(ClassLoader)}.
53     *
54     * @param isTrue
55     */

56    void setUseRegionBasedMarshalling(boolean isTrue);
57
58    /**
59     * Gets whether marshalling uses scoped class loaders on a per region basis.
60     *
61     * @return true if region based marshalling is used.
62     */

63    boolean getUseRegionBasedMarshalling();
64
65    /**
66     * Gets whether the cache should create interceptor mbeans
67     * that are used to capture and publish interceptor statistics.
68     *
69     * @return true if mbeans should be created for each interceptor
70     */

71    boolean getExposeManagementStatistics();
72
73    void setExposeManagementStatistics(boolean expose);
74
75    /**
76     * Get the cluster properties (e.g. the protocol stack specification in case of JGroups)
77     */

78    String JavaDoc getClusterProperties();
79
80    /**
81     * Set the cluster properties. If the cache is to use the new properties, it has to be redeployed
82     *
83     * @param cluster_props The properties for the cluster (JGroups)
84     */

85    void setClusterProperties(String JavaDoc cluster_props);
86
87    Element JavaDoc getCacheLoaderConfiguration();
88
89    void setCacheLoaderConfiguration(Element JavaDoc cache_loader_config);
90
91    boolean getSyncCommitPhase();
92
93    void setSyncCommitPhase(boolean sync_commit_phase);
94
95    boolean getSyncRollbackPhase();
96
97    void setSyncRollbackPhase(boolean sync_rollback_phase);
98
99    Element JavaDoc getEvictionPolicyConfig();
100
101    /**
102     * Setup eviction policy configuration
103     */

104    void setEvictionPolicyConfig(Element JavaDoc config);
105
106    /**
107     * Convert a list of elements to the JG property string
108     */

109    void setClusterConfig(Element JavaDoc config);
110
111    /**
112     * Get the max time to wait until the initial state is retrieved. This is used in a replicating cache: when a new cache joins the cluster, it needs to acquire the (replicated) state of the other members to initialize itself. If no state has been received within <tt>timeout</tt> milliseconds, the map will be empty.
113     *
114     * @return long Number of milliseconds to wait for the state. 0 means to wait forever.
115     */

116    long getInitialStateRetrievalTimeout();
117
118    /**
119     * Set the initial state transfer timeout (see {@link #getInitialStateRetrievalTimeout()})
120     */

121    void setInitialStateRetrievalTimeout(long timeout);
122
123    /**
124     * Returns the current caching mode. Valid values are <ul> <li>LOCAL <li>REPL_ASYNC <li>REPL_SYNC <ul>
125     *
126     * @return String The caching mode
127     */

128    String JavaDoc getCacheMode();
129
130    /**
131     * Sets the default caching mode)
132     */

133    void setCacheMode(String JavaDoc mode) throws Exception JavaDoc;
134
135    /**
136     * Returns the default max timeout after which synchronous replication calls return.
137     *
138     * @return long Number of milliseconds after which a sync repl call must return. 0 means to wait forever
139     */

140    long getSyncReplTimeout();
141
142    /**
143     * Sets the default maximum wait time for synchronous replication to receive all results
144     */

145    void setSyncReplTimeout(long timeout);
146
147    boolean getUseReplQueue();
148
149    void setUseReplQueue(boolean flag);
150
151    long getReplQueueInterval();
152
153    void setReplQueueInterval(long interval);
154
155    int getReplQueueMaxElements();
156
157    void setReplQueueMaxElements(int max_elements);
158
159    /**
160     * Returns the transaction isolation level.
161     */

162    String JavaDoc getIsolationLevel();
163
164    /**
165     * Set the transaction isolation level. This determines the locking strategy to be used
166     */

167    void setIsolationLevel(String JavaDoc level);
168
169    /**
170     * Returns whether or not any initial state transfer or subsequent partial
171     * state transfer following an <code>activateRegion</code> call should
172     * include in-memory state. Allows for warm/hot caches (true/false). The
173     * characteristics of a state transfer can be further defined by a cache
174     * loader's FetchPersistentState property.
175     */

176    boolean getFetchInMemoryState();
177
178    /**
179     * Sets whether or not any initial or subsequent partial state transfer
180     * should include in-memory state.
181     */

182    void setFetchInMemoryState(boolean flag);
183
184    /**
185     * Gets the format version of the data transferred during an initial state
186     * transfer or a call to {@link Region#activate()}. Different
187     * releases of JBossCache may format this data differently; this property
188     * identifies the format version being used by this cache instance.
189     * <p/>
190     * The default value for this property is
191     * {@link org.jboss.cache.config.Configuration#DEFAULT_REPLICATION_VERSION}.
192     * </p>
193     *
194     * @return a short identifying JBossCache release; e.g. <code>124</code>
195     * for JBossCache 1.2.4
196     */

197    String JavaDoc getReplicationVersion();
198
199    /**
200     * Sets the format version of the data transferred during an initial state
201     * transfer or a call to {@link Region#activate()}. Different
202     * releases of JBossCache may format this data differently; this property
203     * identifies the format version being used by this cache instance. Setting
204     * this property to a value other than the default allows a cache instance
205     * from a later release to interoperate with a cache instance from an
206     * earlier release.
207     *
208     * @param version a short identifying JBossCache release;
209     * e.g. <code>124</code> for JBossCache 1.2.4
210     */

211    void setReplicationVersion(String JavaDoc version);
212
213    /**
214     * Default max time to wait for a lock. If the lock cannot be acquired within this time, a LockingException will be thrown.
215     *
216     * @return long Max number of milliseconds to wait for a lock to be acquired
217     */

218    long getLockAcquisitionTimeout();
219
220    /**
221     * Set the max time for lock acquisition. A value of 0 means to wait forever (not recomended). Note that lock acquisition timeouts may be removed in the future when we have deadlock detection.
222     *
223     * @param timeout
224     */

225    void setLockAcquisitionTimeout(long timeout);
226
227    String JavaDoc getTransactionManagerLookupClass();
228
229    /**
230     * Sets the class of the TransactionManagerLookup impl. This will attempt to create an instance, and will throw an exception if this fails.
231     *
232     * @param cl
233     * @throws Exception
234     */

235    void setTransactionManagerLookupClass(String JavaDoc cl) throws Exception JavaDoc;
236
237    TransactionManager JavaDoc getTransactionManager();
238
239    void setTransactionManager(TransactionManager JavaDoc manager);
240
241    void setNodeLockingScheme(String JavaDoc nodeLockingScheme);
242
243    String JavaDoc getNodeLockingScheme();
244
245    /**
246     * Gets whether the entire tree is inactive upon startup, only responding
247     * to replication messages after activateRegion is
248     * called to activate one or more parts of the tree.
249     * <p/>
250     * This property is only relevant if {@link org.jboss.cache.config.Configuration#isUseRegionBasedMarshalling()} is
251     * <code>true</code>.
252     */

253    boolean isInactiveOnStartup();
254
255    /**
256     * Sets whether the entire tree is inactive upon startup, only responding
257     * to replication messages after {@link Region#activate()} is
258     * called to activate one or more parts of the tree.
259     * <p/>
260     * This property is only relevant if {@link org.jboss.cache.config.Configuration#isUseRegionBasedMarshalling()} is
261     * <code>true</code>.
262     */

263    void setInactiveOnStartup(boolean inactiveOnStartup);
264
265    /**
266     * Sets the buddy replication configuration element
267     *
268     * @param config
269     */

270    void setBuddyReplicationConfig(Element JavaDoc config);
271
272    /**
273     * Retrieves the buddy replication cofiguration element
274     *
275     * @return config
276     */

277    Element JavaDoc getBuddyReplicationConfig();
278
279    /**
280     * Retrieves the JGroups multiplexer service name if defined.
281     *
282     * @return the multiplexer service name
283     */

284    String JavaDoc getMultiplexerService();
285
286    /**
287     * Sets the JGroups multiplexer service name.
288     * This attribute is optional; if not provided, a JGroups JChannel will be used
289     *
290     * @param serviceName the multiplexer service name
291     */

292    void setMultiplexerService(String JavaDoc serviceName);
293
294    /**
295     * Retrieves the JGroups multiplexer stack name if defined.
296     *
297     * @return the multiplexer stack name
298     */

299    String JavaDoc getMultiplexerStack();
300
301    /**
302     * Used with JGroups multiplexer, specifies stack to be used (e.g., fc-fast-minimalthreads)
303     * This attribute is optional; if not provided, a default multiplexer stack will be used.
304     *
305     * @param stackName the name of the multiplexer stack
306     */

307    void setMultiplexerStack(String JavaDoc stackName);
308
309    JChannelFactoryMBean getMuxChannelFactory();
310
311    void setMuxChannelFactory(JChannelFactoryMBean factory);
312
313 }
314
Popular Tags