Author: bstansberry(a)jboss.com
Date: 2008-02-28 13:06:54 -0500 (Thu, 28 Feb 2008)
New Revision: 5378
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheManagerImpl.java
Log:
[JBCACHE-1299] Add extension point to CacheManagerImpl for actual cache creation
Modified: core/trunk/src/main/java/org/jboss/cache/CacheManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheManagerImpl.java 2008-02-27 20:23:40 UTC
(rev 5377)
+++ core/trunk/src/main/java/org/jboss/cache/CacheManagerImpl.java 2008-02-28 18:06:54 UTC
(rev 5378)
@@ -116,7 +116,7 @@
{
config.getRuntimeConfig().setMuxChannelFactory(channelFactory);
}
- cache = new DefaultCacheFactory().createCache(config, false);
+ cache = createCache(config);
registerCache(cache, configName);
}
else if (cache != null)
@@ -127,6 +127,20 @@
return cache;
}
+
+ /**
+ * Extension point for subclasses, where we actually use a
+ * {@link CacheFactory} to create a cache. This default implementation
+ * uses {@link DefaultCacheFactory}.
+ *
+ * @param config the Configuration for the cache
+ * @return the Cache
+ */
+ @SuppressWarnings("unchecked")
+ protected Cache<Object, Object> createCache(Configuration config)
+ {
+ return new DefaultCacheFactory().createCache(config, false);
+ }
public void releaseCache(String configName)
{
Show replies by date