[jboss-cvs] JBossCache/src/org/jboss/cache/jmx ...
Brian Stansberry
brian.stansberry at jboss.com
Fri Jul 13 16:23:12 EDT 2007
User: bstansberry
Date: 07/07/13 16:23:12
Modified: src/org/jboss/cache/jmx CacheJmxWrapperMBean.java
CacheJmxWrapper.java
Log:
[JBCACHE-1131] Genericize CacheJmxWrapper
Revision Changes Path
1.11 +2 -2 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.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- CacheJmxWrapperMBean.java 29 Jun 2007 04:08:19 -0000 1.10
+++ CacheJmxWrapperMBean.java 13 Jul 2007 20:23:12 -0000 1.11
@@ -26,7 +26,7 @@
*
* @since 2.0.0
*/
-public interface CacheJmxWrapperMBean extends LegacyConfiguration
+public interface CacheJmxWrapperMBean<K, V> extends LegacyConfiguration
{
/** The lifecycle method stop has completed */
public static final int STOPPED = 0;
@@ -75,7 +75,7 @@
/**
* Retrieves a reference to the underlying {@link Cache}
*/
- Cache getCache();
+ Cache<K, V> getCache();
/**
* @return an immutable configuration
1.30 +11 -9 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.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- CacheJmxWrapper.java 29 Jun 2007 04:08:19 -0000 1.29
+++ CacheJmxWrapper.java 13 Jul 2007 20:23:12 -0000 1.30
@@ -25,6 +25,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheFactory;
import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheStatus;
import org.jboss.cache.DefaultCacheFactory;
@@ -64,18 +65,18 @@
* {@link CacheImpl}.
*
* @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision: 1.29 $
+ * @version $Revision: 1.30 $
*/
-public class CacheJmxWrapper
+public class CacheJmxWrapper<K, V>
extends NotificationBroadcasterSupport
- implements CacheJmxWrapperMBean, MBeanRegistration, CacheNotificationBroadcaster
+ implements CacheJmxWrapperMBean<K, V>, MBeanRegistration, CacheNotificationBroadcaster
{
private Log log = LogFactory.getLog(getClass().getName());
private MBeanServer server;
private String cacheObjectName;
private boolean interceptorsRegistered;
- private CacheImpl<?, ?> cache;
+ private CacheImpl<K, V> cache;
private Configuration config;
private boolean registerInterceptors = true;
private final AtomicInteger listenerCount = new AtomicInteger(0);
@@ -102,7 +103,7 @@
cacheStatus = CacheStatus.INSTANTIATED;
}
- public CacheJmxWrapper(Cache cache)
+ public CacheJmxWrapper(Cache<K, V> cache)
{
this();
setCache(cache);
@@ -110,7 +111,7 @@
// --------------------------------------------------- CacheJmxWrapperMBean
- public org.jboss.cache.Cache getCache()
+ public Cache<K, V> getCache()
{
return cache;
}
@@ -796,7 +797,7 @@
*
* @param cache
*/
- public void setCache(Cache cache)
+ public void setCache(Cache<K, V> cache)
{
if (cacheStatus != CacheStatus.INSTANTIATED
&& cacheStatus != CacheStatus.CREATING
@@ -806,7 +807,7 @@
}
// FIXME -- having to cast is ugly!!
- this.cache = (CacheImpl) cache;
+ this.cache = (CacheImpl<K, V>) cache;
this.config = (cache == null ? null : cache.getConfiguration());
synchronized (listenerCount)
{
@@ -929,7 +930,8 @@
protected void constructCache() throws ConfigurationException
{
log.debug("Constructing Cache");
- setCache(DefaultCacheFactory.getInstance().createCache(config, false));
+ CacheFactory<K, V> cf = DefaultCacheFactory.getInstance();
+ setCache(cf.createCache(config, false));
if (multiplexerService != null)
{
injectMuxChannel();
More information about the jboss-cvs-commits
mailing list