Author: sohil.shah(a)jboss.com
Date: 2010-06-11 08:31:53 -0400 (Fri, 11 Jun 2010)
New Revision: 13938
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
modules/cms/trunk/cms-jackrabbit/src/test/resources/jcr/repository.xml
Log:
JBEPP-165 - making pre-loading for JBossCachePersistenceManager configurable
Modified:
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
===================================================================
---
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2010-06-10
12:46:56 UTC (rev 13937)
+++
modules/cms/trunk/cms-jackrabbit/src/main/java/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2010-06-11
12:31:53 UTC (rev 13938)
@@ -108,6 +108,8 @@
/** BLOBStore that manages BLOB data in the file system (if
<code>externalBLOBs==true</code>) */
protected BLOBStore blobStore = null;
+
+ private boolean enablePreLoading;
/**
* JackRabbit initalizes multiple instances of the Persistence Manager to perform its
operations. A static TreeCache
@@ -118,6 +120,7 @@
private static TreeCacheMBean pmCache = null;
private static boolean preloaded = false;
+
/**
*
@@ -128,6 +131,7 @@
schemaObjectPrefix = "";
externalBLOBs = true;
initialized = false;
+ this.enablePreLoading = true; //enabled by default. can be disabled via
configuration
}
//
------------------------------------------------------------------------------------------------------------------------------------------------
@@ -165,8 +169,20 @@
{
this.externalBLOBs = Boolean.valueOf(externalBLOBs).booleanValue();
}
+
+
- /*
+ public boolean isEnablePreLoading()
+ {
+ return enablePreLoading;
+ }
+
+ public void setEnablePreLoading(boolean enablePreLoading)
+ {
+ this.enablePreLoading = enablePreLoading;
+ }
+
+/*
*
*/
public void init(PMContext context) throws Exception
@@ -267,13 +283,22 @@
}
// pre-load the cache with property nodes
- if (!JBossCachePersistenceManager.preloaded)
+ if (this.enablePreLoading)
{
- JBossCachePersistenceManager.loadProperties(this.jndiName);
- log.info("-------------------------------------------------");
- log.info("JBossCachePersistenceManager is fully loaded.....");
- log.info("-------------------------------------------------");
+ if(!JBossCachePersistenceManager.preloaded)
+ {
+ JBossCachePersistenceManager.loadProperties(this.jndiName);
+ log.info("-------------------------------------------------");
+ log.info("JBossCachePersistenceManager is fully loaded.....");
+ log.info("-------------------------------------------------");
+ }
}
+ else
+ {
+ log.info("-------------------------------------------------");
+ log.info("JBossCachePersistenceManager is disabled.........");
+ log.info("-------------------------------------------------");
+ }
}
catch (Exception e)
{
Modified: modules/cms/trunk/cms-jackrabbit/src/test/resources/jcr/repository.xml
===================================================================
--- modules/cms/trunk/cms-jackrabbit/src/test/resources/jcr/repository.xml 2010-06-10
12:46:56 UTC (rev 13937)
+++ modules/cms/trunk/cms-jackrabbit/src/test/resources/jcr/repository.xml 2010-06-11
12:31:53 UTC (rev 13938)
@@ -49,6 +49,7 @@
<param name="schemaObjectPrefix" value="WSP"/>
<param name="JNDIName"
value="java:/SessionFactory"/>
<param name="externalBLOBs" value="false"/>
+ <param name="enablePreLoading" value="true"/>
</PersistenceManager>
<SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
@@ -74,6 +75,7 @@
<param name="schemaObjectPrefix" value="Version"/>
<param name="JNDIName"
value="java:/SessionFactory"/>
<param name="externalBLOBs" value="false"/>
+ <param name="enablePreLoading" value="true"/>
</PersistenceManager>
</Versioning>
</Repository>
\ No newline at end of file