[exo-jcr-commits] exo-jcr SVN: r456 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 30 11:04:33 EDT 2009


Author: pnedonosko
Date: 2009-10-30 11:04:32 -0400 (Fri, 30 Oct 2009)
New Revision: 456

Added:
   jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jbosscache-configuration.xml
   jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java
   jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-exoloader.xml
   jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-jdbcloader.xml
Removed:
   jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
Modified:
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
   jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
   jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
   jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
   jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-201: cache loaders configurations; injection via JBC comp registry; per-Workspace model (was per-JVM)

Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java	2009-10-30 14:25:11 UTC (rev 455)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jbosscache/JBossCacheService.java	2009-10-30 15:04:32 UTC (rev 456)
@@ -64,7 +64,7 @@
 
    public JBossCacheService(InitParams params)
    {
-      String jbcConfig = params.getValueParam("jboss-cache-configuration").getValue();
+      String jbcConfig = params.getValueParam("jbosscache-configuration").getValue();
 
       CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
 

Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java	2009-10-30 14:25:11 UTC (rev 455)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java	2009-10-30 15:04:32 UTC (rev 456)
@@ -18,20 +18,10 @@
  */
 package org.exoplatform.services.jcr.impl.storage.jbosscache;
 
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jcr.RepositoryException;
-
 import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
 import org.exoplatform.services.jcr.datamodel.ItemData;
 import org.exoplatform.services.jcr.datamodel.NodeData;
 import org.exoplatform.services.jcr.datamodel.PropertyData;
-import org.exoplatform.services.jcr.datamodel.QPath;
 import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
 import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
 import org.jboss.cache.CacheSPI;
@@ -39,8 +29,18 @@
 import org.jboss.cache.Modification;
 import org.jboss.cache.RegionManager;
 import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.factories.annotations.Inject;
 import org.jboss.cache.loader.CacheLoader;
 
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+
 /**
  * Created by The eXo Platform SAS.
  * 
@@ -66,6 +66,7 @@
     *
     * @param dataContainer WorkspaceDataContainer
     */
+   @Inject
    public void initDataContainer(WorkspaceDataContainer dataContainer) throws RepositoryConfigurationException
    {
       if (this.dataContainer != null)

Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java	2009-10-30 14:25:11 UTC (rev 455)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java	2009-10-30 15:04:32 UTC (rev 456)
@@ -31,9 +31,11 @@
 import org.exoplatform.services.log.Log;
 import org.exoplatform.services.naming.InitialContextInitializer;
 import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.Node;
-import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
 import org.picocontainer.Startable;
 
 import java.io.IOException;
@@ -53,7 +55,7 @@
 public class JBossCacheWorkspaceDataContainer extends WorkspaceDataContainerBase implements Startable
 {
 
-   public static final String JBOSSCACHE_CONFIG = "jboss-cache-conf";
+   public static final String JBOSSCACHE_CONFIG = "jbosscache-configuration";
 
    public static final String ROOT = "$ROOT".intern();
 
@@ -72,39 +74,51 @@
    private final Node<Serializable, Object> tree;
 
    private final Node<Serializable, Object> items;
-   
+
    /**
     * JBossWorkspaceDataContainer  constructor.
     *
     */
-   public JBossCacheWorkspaceDataContainer(JBossCacheService jbcService, WorkspaceEntry wsConfig,
+   public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig,
       RepositoryEntry repConfig, InitialContextInitializer contextInit, ValueStoragePluginProvider valueStorageProvider)
       throws RepositoryConfigurationException, NamingException, RepositoryException, IOException
    {
       this.repositoryName = repConfig.getName();
       this.containerName = wsConfig.getName();
 
-      this.cache = jbcService.getCache();
+      //this.cache = jbcService.getCache();
+      String jbcConfig = wsConfig.getContainer().getParameterValue(JBOSSCACHE_CONFIG);
+      CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+      LOG.info("JBoss Cache configuration used: " + jbcConfig);
+      this.cache = factory.createCache(jbcConfig, false);
 
       // TODO hardcoded now
       this.persistentContainer = new JDBCWorkspaceDataContainer(wsConfig, repConfig, contextInit, valueStorageProvider);
 
       // TODO configure CacheLoader here with this.persistentContainer
-      for (IndividualCacheLoaderConfig loaderCfg : this.cache.getConfiguration().getCacheLoaderConfig()
-         .getIndividualCacheLoaderConfigs())
-      {
-         if (loaderCfg.getClassName().equals(ExoJCRCacheLoader.class.getName()))
-         {
-            ((ExoJCRCacheLoader)loaderCfg.getCacheLoader()).initDataContainer(this.persistentContainer);
-         }
-      }
+      //      for (IndividualCacheLoaderConfig loaderCfg : this.cache.getConfiguration().getCacheLoaderConfig()
+      //         .getIndividualCacheLoaderConfigs())
+      //      {
+      //         if (loaderCfg.getClassName().equals(ExoJCRCacheLoader.class.getName()))
+      //         {
+      //            ((ExoJCRCacheLoader)loaderCfg.getCacheLoader()).initDataContainer(this.persistentContainer);
+      //         }
+      //      }
+      
+      // inject JDBC DC via JBC ComponentRegistry 
+      ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().registerComponent(this.persistentContainer,
+         WorkspaceDataContainer.class);
 
+      // TODO check lifecycle, might be we have to create in start(), with jdbc start. 
+      // initializes configuration state, the root node, etc.
+      this.cache.create();
+
       Node<Serializable, Object> cacheRoot = cache.getRoot();
-      Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements(repositoryName, containerName));
+      //Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements(repositoryName, containerName));
 
       // prepare cache structures
-      this.tree = wsRoot.addChild(Fqn.fromString(ROOT));
-      this.items = wsRoot.addChild(Fqn.fromString(ITEMS));
+      this.tree = cacheRoot.addChild(Fqn.fromString(ROOT));
+      this.items = cacheRoot.addChild(Fqn.fromString(ITEMS));
    }
 
    public void start()

Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml	2009-10-30 14:25:11 UTC (rev 455)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml	2009-10-30 15:04:32 UTC (rev 456)
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xmlns="urn:jboss:jbosscache-core:config:3.1">
-
-   <!-- Configure the TransactionManager -->
-   <transaction
-      transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />
-
-   <clustering mode="replication">
-      
-      <jgroupsConfig>
-         <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
-              loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
-              mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
-              oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
-              oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
-              oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
-              thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
-              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
-              tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
-              use_incoming_packet_handler="true" />
-         <PING num_initial_members="3" timeout="2000" />
-         
-         <!-- TCP bind_addr="192.168.0.15" start_port="7800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
-            max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="true" use_send_queues="false" sock_conn_timeout="300"
-            skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
-            thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
-
-            oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
-            oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
-         <MPING timeout="2000" num_initial_members="3" mcast_port="34526" bind_addr="192.168.0.15" mcast_addr="224.0.0.1" /-->
-         
-         <MERGE2 max_interval="30000" min_interval="10000"/>
-         <FD_SOCK/>
-         <FD max_tries="5" shun="true" timeout="10000"/>
-         <VERIFY_SUSPECT timeout="1500"/>
-         <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
-                        use_mcast_xmit="false"/>
-         <UNICAST timeout="300,600,1200,2400,3600"/>
-         <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
-         <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
-                     view_bundling="true"/>
-         <FRAG2 frag_size="60000"/>
-         <pbcast.STREAMING_STATE_TRANSFER/>
-         <pbcast.FLUSH timeout="0"/>
-
-      </jgroupsConfig>
-
-      <sync />
-      <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below.  -->
-      <!-- <async /> -->
-
-   </clustering>
-   <loaders passivation="false" shared="false">
-        <!-- loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
-         fetchPersistentState="true" ignoreModifications="false"
-         purgeOnStartup="false">
-         <properties>
-            location=/tmp/test-jboss-cache/proxy
-        </properties>
-        </loader -->
-        
-      <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="true"
-              ignoreModifications="false" purgeOnStartup="false">
-         <properties>
-            cache.jdbc.table.name=jdbcjcr
-            cache.jdbc.table.create=true
-            cache.jdbc.table.drop=true
-            cache.jdbc.table.primarykey=exojcr_pk
-            cache.jdbc.fqn.column=fqn
-            cache.jdbc.fqn.type=VARCHAR(512)
-            cache.jdbc.node.column=node
-            cache.jdbc.node.type=VARBINARY(65535)
-            cache.jdbc.parent.column=parent
-            cache.jdbc.driver=org.hsqldb.jdbcDriver
-            cache.jdbc.url=jdbc:hsqldb:file:target/temp/data/exojcr
-            cache.jdbc.user=sa
-            cache.jdbc.password=
-          </properties>
-      </loader>  
-   </loaders>
-   
-    <!-- Enable batching -->
-    <invocationBatching enabled="true"/>
-</jbosscache>

Copied: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jbosscache-configuration.xml (from rev 454, jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/exojcr-jboss-cache-conf.xml)
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jbosscache-configuration.xml	                        (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jbosscache-configuration.xml	2009-10-30 15:04:32 UTC (rev 456)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+   <!-- Configure the TransactionManager -->
+   <transaction
+      transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />
+
+   <clustering mode="replication">
+      
+      <jgroupsConfig>
+         <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
+              loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
+              mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
+              oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
+              oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
+              oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
+              use_incoming_packet_handler="true" />
+         <PING num_initial_members="3" timeout="2000" />
+         
+         <!-- TCP bind_addr="192.168.0.15" start_port="7800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
+            max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="true" use_send_queues="false" sock_conn_timeout="300"
+            skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
+            thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
+
+            oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+            oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
+         <MPING timeout="2000" num_initial_members="3" mcast_port="34526" bind_addr="192.168.0.15" mcast_addr="224.0.0.1" /-->
+         
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD max_tries="5" shun="true" timeout="10000"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        use_mcast_xmit="false"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+         <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
+                     view_bundling="true"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER/>
+         <pbcast.FLUSH timeout="0"/>
+
+      </jgroupsConfig>
+
+      <sync />
+      <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below.  -->
+      <!-- <async /> -->
+
+   </clustering>
+   <loaders passivation="false" shared="false">
+        <!-- loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
+         fetchPersistentState="true" ignoreModifications="false"
+         purgeOnStartup="false">
+         <properties>
+            location=/tmp/test-jboss-cache/proxy
+        </properties>
+        </loader -->
+        
+      <!-- loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="true"
+              ignoreModifications="false" purgeOnStartup="false">
+         <properties>
+            cache.jdbc.table.name=jdbcjcr
+            cache.jdbc.table.create=true
+            cache.jdbc.table.drop=true
+            cache.jdbc.table.primarykey=exojcr_pk
+            cache.jdbc.fqn.column=fqn
+            cache.jdbc.fqn.type=VARCHAR(512)
+            cache.jdbc.node.column=node
+            cache.jdbc.node.type=VARBINARY(65535)
+            cache.jdbc.parent.column=parent
+            cache.jdbc.driver=org.hsqldb.jdbcDriver
+            cache.jdbc.url=jdbc:hsqldb:file:target/temp/data/exojcr
+            cache.jdbc.user=sa
+            cache.jdbc.password=
+          </properties>
+      </loader -->  
+      
+      <loader class="org.exoplatform.services.jcr.impl.storage.jbosscache.ExoJCRCacheLoader" 
+              async="false" fetchPersistentState="true" ignoreModifications="false" purgeOnStartup="false">
+        <properties>
+        </properties>
+      </loader>  
+      
+   </loaders>
+   
+    <!-- Enable batching -->
+    <invocationBatching enabled="true"/>
+</jbosscache>


Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jbosscache-configuration.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java	                        (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java	2009-10-30 15:04:32 UTC (rev 456)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+
+import java.io.Serializable;
+
+import junit.framework.TestCase;
+
+/**
+ * Created by The eXo Platform SAS.
+ * 
+ * <br/>Date: 30.10.2009
+ *
+ * @author <a href="mailto:peter.nedonosko at exoplatform.com.ua">Peter Nedonosko</a> 
+ * @version $Id$
+ */
+public class ExoJCRCacheLoaderTest extends TestCase
+{
+
+   private Cache<Serializable, Object> cache;
+   
+   /**
+    * {@inheritDoc}
+    */
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      
+      // JBossCache 
+      String jbcConfig = "conf/standalone/test-jbosscache-config-exoloader.xml";
+
+      cache = new DefaultCacheFactory<Serializable, Object>().createCache(jbcConfig);
+
+      Node<Serializable, Object> cacheRoot = cache.getRoot();
+      Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements("repo", "ws"));
+
+      // prepare cache structures
+      tree = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ROOT));
+      items = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ITEMS));
+
+      // run cache
+      cache.create();
+      cache.start();
+
+      // JCR connection
+      conn = new JBossCacheStorageConnection(cache, tree, items);
+      
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   protected void tearDown() throws Exception
+   {
+      super.tearDown();
+   }
+
+}


Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java	2009-10-30 14:25:11 UTC (rev 455)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java	2009-10-30 15:04:32 UTC (rev 456)
@@ -84,16 +84,16 @@
       super.setUp();
 
       // JBossCache 
-      String jbcConfig = "conf/portal/exojcr-jboss-cache-conf.xml";
+      String jbcConfig = "conf/standalone/test-jbosscache-config-jdbcloader.xml";
 
       cache = new DefaultCacheFactory<Serializable, Object>().createCache(jbcConfig);
 
       Node<Serializable, Object> cacheRoot = cache.getRoot();
-      Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements("repo", "ws"));
+      //Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements("repo", "ws"));
 
       // prepare cache structures
-      tree = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ROOT));
-      items = wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ITEMS));
+      tree = cacheRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ROOT));
+      items = cacheRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataContainer.ITEMS));
 
       // run cache
       cache.create();

Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml	2009-10-30 14:25:11 UTC (rev 455)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-configuration.xml	2009-10-30 15:04:32 UTC (rev 456)
@@ -92,15 +92,15 @@
     </init-params>
   </component>
 
-   <component>
+   <!-- component>
       <type>org.exoplatform.services.jbosscache.JBossCacheService</type>
       <init-params>
          <value-param>
-            <name>jboss-cache-configuration</name>
+            <name>jbosscache-configuration</name>
             <value>conf/portal/exojcr-jboss-cache-conf.xml</value>
          </value-param>
       </init-params>
-   </component>
+   </component -->
 
   <component>
     <key>org.exoplatform.services.jcr.RepositoryService</key>

Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-exoloader.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-exoloader.xml	                        (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-exoloader.xml	2009-10-30 15:04:32 UTC (rev 456)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+   <!-- Configure the TransactionManager -->
+   <transaction
+      transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />
+
+   <clustering mode="replication">
+      
+      <jgroupsConfig>
+         <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
+              loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
+              mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
+              oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
+              oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
+              oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
+              use_incoming_packet_handler="true" />
+         <PING num_initial_members="3" timeout="2000" />
+         
+         <!-- TCP bind_addr="192.168.0.15" start_port="7800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
+            max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="true" use_send_queues="false" sock_conn_timeout="300"
+            skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
+            thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
+
+            oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+            oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
+         <MPING timeout="2000" num_initial_members="3" mcast_port="34526" bind_addr="192.168.0.15" mcast_addr="224.0.0.1" /-->
+         
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD max_tries="5" shun="true" timeout="10000"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        use_mcast_xmit="false"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+         <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
+                     view_bundling="true"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER/>
+         <pbcast.FLUSH timeout="0"/>
+
+      </jgroupsConfig>
+
+      <sync />
+      <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below.  -->
+      <!-- <async /> -->
+   </clustering>
+   
+   <loaders passivation="false" shared="false">
+        <!-- loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
+         fetchPersistentState="true" ignoreModifications="false"
+         purgeOnStartup="false">
+         <properties>
+            location=/tmp/test-jboss-cache/proxy
+        </properties>
+        </loader -->
+        
+      <loader class="org.exoplatform.services.jcr.impl.storage.jbosscache.ExoJCRCacheLoader" 
+              async="false" fetchPersistentState="true" ignoreModifications="false" purgeOnStartup="false">
+        <properties>
+        </properties>
+      </loader>   
+   </loaders>
+   
+    <!-- Enable batching -->
+    <invocationBatching enabled="true"/>
+</jbosscache>


Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-exoloader.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-jdbcloader.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-jdbcloader.xml	                        (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-jdbcloader.xml	2009-10-30 15:04:32 UTC (rev 456)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+   <!-- Configure the TransactionManager -->
+   <transaction
+      transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />
+
+   <clustering mode="replication">
+      
+      <jgroupsConfig>
+         <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2"
+              loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10"
+              mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000"
+              oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4"
+              oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10"
+              oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true"
+              thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1"
+              thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run"
+              tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" use_concurrent_stack="true"
+              use_incoming_packet_handler="true" />
+         <PING num_initial_members="3" timeout="2000" />
+         
+         <!-- TCP bind_addr="192.168.0.15" start_port="7800" loopback="true" recv_buf_size="20000000" send_buf_size="640000" discard_incompatible_packets="true"
+            max_bundle_size="64000" max_bundle_timeout="30" use_incoming_packet_handler="true" enable_bundling="true" use_send_queues="false" sock_conn_timeout="300"
+            skip_suspected_members="true" use_concurrent_stack="true" thread_pool.enabled="true" thread_pool.min_threads="1" thread_pool.max_threads="25"
+            thread_pool.keep_alive_time="5000" thread_pool.queue_enabled="false" thread_pool.queue_max_size="100" thread_pool.rejection_policy="run"
+
+            oob_thread_pool.enabled="true" oob_thread_pool.min_threads="1" oob_thread_pool.max_threads="8" oob_thread_pool.keep_alive_time="5000"
+            oob_thread_pool.queue_enabled="false" oob_thread_pool.queue_max_size="100" oob_thread_pool.rejection_policy="run" />
+         <MPING timeout="2000" num_initial_members="3" mcast_port="34526" bind_addr="192.168.0.15" mcast_addr="224.0.0.1" /-->
+         
+         <MERGE2 max_interval="30000" min_interval="10000"/>
+         <FD_SOCK/>
+         <FD max_tries="5" shun="true" timeout="10000"/>
+         <VERIFY_SUSPECT timeout="1500"/>
+         <pbcast.NAKACK discard_delivered_msgs="true" gc_lag="0" retransmit_timeout="300,600,1200,2400,4800"
+                        use_mcast_xmit="false"/>
+         <UNICAST timeout="300,600,1200,2400,3600"/>
+         <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+         <pbcast.GMS join_timeout="5000" print_local_addr="true" shun="false" view_ack_collection_timeout="5000"
+                     view_bundling="true"/>
+         <FRAG2 frag_size="60000"/>
+         <pbcast.STREAMING_STATE_TRANSFER/>
+         <pbcast.FLUSH timeout="0"/>
+
+      </jgroupsConfig>
+
+      <sync />
+      <!-- Alternatively, to use async replication, comment out the element above and uncomment the element below.  -->
+      <!-- <async /> -->
+
+   </clustering>
+   <loaders passivation="false" shared="false">
+        <!-- loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
+         fetchPersistentState="true" ignoreModifications="false"
+         purgeOnStartup="false">
+         <properties>
+            location=/tmp/test-jboss-cache/proxy
+        </properties>
+        </loader -->
+        
+      <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="false" fetchPersistentState="true"
+              ignoreModifications="false" purgeOnStartup="false">
+         <properties>
+            cache.jdbc.table.name=jdbcjcr
+            cache.jdbc.table.create=true
+            cache.jdbc.table.drop=true
+            cache.jdbc.table.primarykey=exojcr_pk
+            cache.jdbc.fqn.column=fqn
+            cache.jdbc.fqn.type=VARCHAR(512)
+            cache.jdbc.node.column=node
+            cache.jdbc.node.type=VARBINARY(65535)
+            cache.jdbc.parent.column=parent
+            cache.jdbc.driver=org.hsqldb.jdbcDriver
+            cache.jdbc.url=jdbc:hsqldb:file:target/temp/data/exojcr
+            cache.jdbc.user=sa
+            cache.jdbc.password=
+          </properties>
+      </loader>  
+      
+   </loaders>
+   
+    <!-- Enable batching -->
+    <invocationBatching enabled="true"/>
+</jbosscache>


Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jbosscache-config-jdbcloader.xml
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id

Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml	2009-10-30 14:25:11 UTC (rev 455)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml	2009-10-30 15:04:32 UTC (rev 456)
@@ -32,6 +32,7 @@
                <!-- for system storage -->
                <container class="org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheWorkspaceDataContainer">
                   <properties>
+                     <property name="jbosscache-configuration" value="conf/portal/exojcr-jboss-cache-conf.xml" />
                      <property name="source-name" value="jdbcjcr" />
                      <property name="dialect" value="hsqldb" />
                      <property name="multi-db" value="true" />



More information about the exo-jcr-commits mailing list