[jboss-cvs] JBossCache/src/org/jboss/cache/jmx ...
Brian Stansberry
brian.stansberry at jboss.com
Mon May 21 16:19:49 EDT 2007
User: bstansberry
Date: 07/05/21 16:19:49
Modified: src/org/jboss/cache/jmx CacheJmxWrapperMBean.java
CacheJmxWrapper.java
Log:
[JBCACHE-1063] Expose Cache.getLocalAddress() and Cache.getMembers()
Revision Changes Path
1.5 +21 -0 JBossCache/src/org/jboss/cache/jmx/CacheJmxWrapperMBean.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheJmxWrapperMBean.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/CacheJmxWrapperMBean.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- CacheJmxWrapperMBean.java 9 May 2007 18:28:55 -0000 1.4
+++ CacheJmxWrapperMBean.java 21 May 2007 20:19:49 -0000 1.5
@@ -6,8 +6,11 @@
*/
package org.jboss.cache.jmx;
+import java.util.List;
+
import org.jboss.cache.Cache;
import org.jboss.cache.config.Configuration;
+import org.jgroups.Address;
/**
* JMX interface to the {@link org.jboss.cache.Cache}. Full access to the cache is not supported, only a certain
@@ -54,6 +57,24 @@
String getCacheDetailsAsHtml();
/**
+ * Returns the local address of this cache in a cluster, or <code>null</code>
+ * if running in local mode.
+ *
+ * @return the local address of this cache in a cluster, or <code>null</code>
+ * if running in local mode.
+ */
+ Address getLocalAddress();
+
+ /**
+ * Returns a list of members in the cluster, or <code>null</code>
+ * if running in local mode.
+ *
+ * @return a {@link List} of members in the cluster, or <code>null</code>
+ * if running in local mode.
+ */
+ List<Address> getMembers();
+
+ /**
* @return number of nodes in the cache
*/
int getNumberOfNodes();
1.19 +12 -1 JBossCache/src/org/jboss/cache/jmx/CacheJmxWrapper.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheJmxWrapper.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/CacheJmxWrapper.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- CacheJmxWrapper.java 11 May 2007 22:42:10 -0000 1.18
+++ CacheJmxWrapper.java 21 May 2007 20:19:49 -0000 1.19
@@ -42,6 +42,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.interceptors.Interceptor;
+import org.jgroups.Address;
/**
* Wrapper class that provides exposes a
@@ -49,7 +50,7 @@
* {@link CacheImpl}.
*
* @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision: 1.18 $
+ * @version $Revision: 1.19 $
*/
public class CacheJmxWrapper
extends NotificationBroadcasterSupport
@@ -116,6 +117,16 @@
return cache == null ? "Cache is null" : formatHtml(cache.printDetails());
}
+ public Address getLocalAddress()
+ {
+ return cache == null ? null : cache.getLocalAddress();
+ }
+
+ public List<Address> getMembers()
+ {
+ return cache == null ? null : cache.getMembers();
+ }
+
public int getNumberOfNodes()
{
return cache == null ? -1 : cache.getNumberOfNodes();
More information about the jboss-cvs-commits
mailing list