[jboss-user] [JBoss Cache: Core Edition] - Re: Multiple Cache Loaders
LORDs_diakonos
do-not-reply at jboss.com
Wed Jul 1 12:51:18 EDT 2009
OK I have tried to extend the FileCacheLoader and use that to test what I am after. The issue is that I have break points on isCharacterPortableTree and isCharacterPortableLocation but I am not hitting either method and I don't understand why. I know my class is being loaded as I also put a break point in the constructor. But my get, puts or isCharacterPortableLocation methods are never called.
I was hoping to do this and test my case mentioned above to ignore a specific region in this cacheLoader. Basically I don't want one of the regions in disk cache but only memory cache.
My config is as follows
| <attribute name="IsolationLevel">READ_COMMITTED</attribute>
|
| <attribute name="CacheLoaderConfig">
| <config>
| <passivation>false</passivation>
| <cacheloader>
| <class>com.dotmarketing.business.TestLoader</class>
| <properties>
| location=/Users/jasontesser/dev/dotcms/trunk/cachetest
| check.character.portability=true
| </properties>
| <async>false</async>
| <fetchPersistentState>true</fetchPersistentState>
| <ignoreModifications>false</ignoreModifications>
| </cacheloader>
| </config>
| </attribute>
|
And my class
| public TestLoader() {
| super();
| }
|
| @Override
| public Map get(Fqn fqn) throws Exception {
| // TODO Auto-generated method stub
| return super.get(fqn);
| }
|
| @Override
| public void put(Fqn arg0, Map arg1, boolean arg2) throws Exception {
| // TODO Auto-generated method stub
| super.put(arg0, arg1, arg2);
| }
|
| @Override
| public Object put(Fqn arg0, Object arg1, Object arg2) throws Exception {
| // TODO Auto-generated method stub
| return super.put(arg0, arg1, arg2);
| }
|
| @Override
| public void put(Fqn fqn, Map attributes) throws Exception {
| // TODO Auto-generated method stub
| super.put(fqn, attributes);
| }
|
| @Override
| public void put(List<Modification> arg0) throws Exception {
| // TODO Auto-generated method stub
| super.put(arg0);
| }
|
| protected boolean isCharacterPortableLocation(String fileAbsolutePath) {
| if(fileAbsolutePath.indexOf("VelocityCache")>-1){
| return false;
| }
| return true;
| // return super.isCharacterPortableLocation(fileAbsolutePath);
| }
|
| protected boolean isCharacterPortableTree(Fqn fqn) {
| List elements = fqn.peekElements();
| // Don't assume the Fqn is composed of Strings!!
| for (Object anElement : elements){
| if(anElement.toString().contains("VelocityCache")){
| return false;
| }
| }
| return true;
| // return super.isCharacterPortableTree(fqn);
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241248#4241248
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241248
More information about the jboss-user
mailing list