I tried to configure a hierarchical cache, composed of a first-level
memory-only cache, and a second-level file-only cache. It seems not to work
when I the caches are jboss services, but works when I use plain classes.
Please help.
Details:
The caches are created as follows:
TreeCacheMBean sCacheSecondLevel =
(TreeCacheMBean)MBeanProxyExt.create(TreeCacheMBean.class, serviceName1,
server);
TreeCacheMBean sCacheFirstLevel =
(TreeCacheMBean)MBeanProxyExt.create(TreeCacheMBean.class, serviceName2,
server);
LocalDelegatingCacheLoader sCacheLoader = new
LocalDelegatingCacheLoader(sCacheSecondLevel.getInstance());
sCacheFirstLevel.setCacheLoader(sCacheLoader);
sCacheFirstLevel.setCacheLoader(sCacheLoader);
I then insert elements into sCacheFirstLevel, and it seems they are not
delegated into sCacheSecondLevel .
I even tried to issue stopService() and startService() before the creating the
LocalDelegatingCacheLoader , but it did not change anything.
When I use the following code to create the caches, everything seems to work
fine:
sCacheSecondLevel = new TreeCache();
sCacheSecondLevel.setCacheLoaderClass"org.jboss.cache.loader.FileCacheLoader");
Properties filecacheLoaderProperties = new Properties();
filecacheLoaderProperties.put("location","c:\\temp\\cache\\requests");
sCacheSecondLevel.setCacheLoaderConfig(filecacheLoaderProperties);
sCacheFirstLevel = new TreeCache();
CacheLoader cacheLoader = new LocalDelegatingCacheLoader (sCacheSecondLevel);
sCacheFirstLevel.setCacheLoader(cacheLoader);
/* Configure the caches (removed) */
sCacheSecondLevel.createService();
sCacheSecondLevel.startService();
sCacheFirstLevel.createService();
sCacheFirstLevel.startService();
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3888933#3888933
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3888933
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user