exo-jcr SVN: r460 - ws/branches/2.2.x.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-30 18:03:54 -0400 (Fri, 30 Oct 2009)
New Revision: 460
Removed:
ws/branches/2.2.x/frameworks/
ws/branches/2.2.x/rest/
Modified:
ws/branches/2.2.x/pom.xml
Log:
EXOJCR-163 :
Modified: ws/branches/2.2.x/pom.xml
===================================================================
--- ws/branches/2.2.x/pom.xml 2009-10-30 21:47:17 UTC (rev 459)
+++ ws/branches/2.2.x/pom.xml 2009-10-30 22:03:54 UTC (rev 460)
@@ -52,13 +52,13 @@
</properties>
<modules>
- <module>commons</module>
- <module>frameworks/json</module>
- <module>frameworks/servlet</module>
- <module>testframework</module>
- <module>rest/core</module>
- <module>rest/ext</module>
- <module>rest/exo.ws.rest.deploy</module>
+ <module>exo.ws.commons</module>
+ <module>exo.ws.frameworks.json</module>
+ <module>exo.ws.frameworks.servlet</module>
+ <module>exo.ws.testframework</module>
+ <module>exo.ws.rest.core</module>
+ <module>exo.ws.rest.ext</module>
+ <module>exo.ws.rest.deploy</module>
<module>packaging/module</module>
</modules>
14 years, 6 months
exo-jcr SVN: r459 - in ws/branches/2.2.x: exo.ws.rest.core/src/main/java/conf and 10 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-30 17:47:17 -0400 (Fri, 30 Oct 2009)
New Revision: 459
Added:
ws/branches/2.2.x/exo.ws.commons/
ws/branches/2.2.x/exo.ws.frameworks.javascript.cross-domain-ajax/
ws/branches/2.2.x/exo.ws.frameworks.json/
ws/branches/2.2.x/exo.ws.frameworks.servlet/
ws/branches/2.2.x/exo.ws.rest.core/
ws/branches/2.2.x/exo.ws.rest.core/src/main/resources/conf/
ws/branches/2.2.x/exo.ws.rest.core/src/main/resources/conf/portal/
ws/branches/2.2.x/exo.ws.rest.core/src/test/resources/conf/
ws/branches/2.2.x/exo.ws.rest.deploy/
ws/branches/2.2.x/exo.ws.rest.ext/
ws/branches/2.2.x/exo.ws.testframework/
Removed:
ws/branches/2.2.x/commons/
ws/branches/2.2.x/exo.ws.rest.core/src/main/java/conf/portal/
ws/branches/2.2.x/exo.ws.rest.core/src/test/java/conf/
ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/conf/
ws/branches/2.2.x/exo.ws.rest.ext/src/test/java/conf/
ws/branches/2.2.x/frameworks/javascript/cross-domain-ajax/
ws/branches/2.2.x/frameworks/json/
ws/branches/2.2.x/frameworks/servlet/
ws/branches/2.2.x/rest/core/
ws/branches/2.2.x/rest/exo.ws.rest.deploy/
ws/branches/2.2.x/rest/ext/
ws/branches/2.2.x/testframework/
Modified:
ws/branches/2.2.x/exo.ws.rest.deploy/src/main/resources/conf/portal/configuration.xml
ws/branches/2.2.x/pom.xml
Log:
Apply module name rules to branches
Copied: ws/branches/2.2.x/exo.ws.commons (from rev 444, ws/branches/2.2.x/commons)
Copied: ws/branches/2.2.x/exo.ws.frameworks.javascript.cross-domain-ajax (from rev 444, ws/branches/2.2.x/frameworks/javascript/cross-domain-ajax)
Copied: ws/branches/2.2.x/exo.ws.frameworks.json (from rev 444, ws/branches/2.2.x/frameworks/json)
Copied: ws/branches/2.2.x/exo.ws.frameworks.servlet (from rev 444, ws/branches/2.2.x/frameworks/servlet)
Copied: ws/branches/2.2.x/exo.ws.rest.core (from rev 458, ws/branches/2.2.x/rest/core)
Copied: ws/branches/2.2.x/exo.ws.rest.core/src/main/resources/conf/portal (from rev 458, ws/branches/2.2.x/rest/core/src/main/java/conf/portal)
Copied: ws/branches/2.2.x/exo.ws.rest.core/src/test/resources/conf (from rev 458, ws/branches/2.2.x/rest/core/src/test/java/conf)
Copied: ws/branches/2.2.x/exo.ws.rest.deploy (from rev 444, ws/branches/2.2.x/rest/exo.ws.rest.deploy)
Modified: ws/branches/2.2.x/exo.ws.rest.deploy/src/main/resources/conf/portal/configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/exo.ws.rest.deploy/src/main/resources/conf/portal/configuration.xml 2009-10-29 16:49:03 UTC (rev 444)
+++ ws/branches/2.2.x/exo.ws.rest.deploy/src/main/resources/conf/portal/configuration.xml 2009-10-30 21:47:17 UTC (rev 459)
@@ -22,35 +22,8 @@
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
+
<component>
- <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
- <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
- <init-params>
- <value-param>
- <name>logger</name>
- <value>org.slf4j.Logger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
- <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>Log4J properties</description>
- <property name="log4j.rootLogger" value="INFO, stdout" />
- <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
- <property name="log4j.appender.stdout.threshold" value="DEBUG" />
- <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
- <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
- <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
- <property name="log4j.appender.file.File" value="target/container.log" />
- <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
- <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
- </properties-param>
- </init-params>
- </component>
- <component>
<type>org.exoplatform.services.rest.impl.ExoJAXRSApplication</type>
<init-params>
<values-param>
Copied: ws/branches/2.2.x/exo.ws.rest.ext (from rev 444, ws/branches/2.2.x/rest/ext)
Copied: ws/branches/2.2.x/exo.ws.testframework (from rev 444, ws/branches/2.2.x/testframework)
Modified: ws/branches/2.2.x/pom.xml
===================================================================
--- ws/branches/2.2.x/pom.xml 2009-10-30 16:21:38 UTC (rev 458)
+++ ws/branches/2.2.x/pom.xml 2009-10-30 21:47:17 UTC (rev 459)
@@ -36,9 +36,9 @@
<name>eXo WS</name>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/exo-jcr/ws/trunk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branches/2.2.x</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/branches/2.2.x</developerConnection>
+ <url>http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.2.x</url>
</scm>
<properties>
14 years, 6 months
exo-jcr SVN: r458 - jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-30 12:21:38 -0400 (Fri, 30 Oct 2009)
New Revision: 458
Modified:
jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java
Log:
EXOJCR-178 bug with an empty content type fixed.
Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java 2009-10-30 15:05:37 UTC (rev 457)
+++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/GetCommand.java 2009-10-30 16:21:38 UTC (rev 458)
@@ -273,8 +273,12 @@
ArrayList<MediaType> mediaTypesList = new ArrayList<MediaType>(cacheControlMap.keySet());
Collections.sort(mediaTypesList, MediaTypeHelper.MEDIA_TYPE_COMPARATOR);
- String cacheControlValue = "";
+ String cacheControlValue = "no-cache";
+ if(contentType == null || contentType.equals("")){
+ return cacheControlValue;
+ }
+
for (MediaType mediaType : mediaTypesList)
{
if(contentType.equals(MediaType.WILDCARD)){
14 years, 6 months
exo-jcr SVN: r457 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-30 11:05:37 -0400 (Fri, 30 Oct 2009)
New Revision: 457
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java
Log:
EXOJCR-201: test fix
Modified: 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 2009-10-30 15:04:32 UTC (rev 456)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-10-30 15:05:37 UTC (rev 457)
@@ -39,14 +39,18 @@
{
private Cache<Serializable, Object> cache;
-
+
+ private Node<Serializable, Object> tree;
+
+ private Node<Serializable, Object> items;
+
/**
* {@inheritDoc}
*/
protected void setUp() throws Exception
{
super.setUp();
-
+
// JBossCache
String jbcConfig = "conf/standalone/test-jbosscache-config-exoloader.xml";
@@ -64,8 +68,8 @@
cache.start();
// JCR connection
- conn = new JBossCacheStorageConnection(cache, tree, items);
-
+ //conn = new JBossCacheStorageConnection(cache, tree, items);
+
}
/**
14 years, 6 months
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.
by do-not-reply@jboss.org
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@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" />
14 years, 6 months
exo-jcr SVN: r455 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-10-30 10:25:11 -0400 (Fri, 30 Oct 2009)
New Revision: 455
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java
Log:
EXOJCR-200: storage connection add, update
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-30 13:37:26 UTC (rev 454)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10-30 14:25:11 UTC (rev 455)
@@ -355,9 +355,7 @@
// TODO it's put anyway.. but with check?
Fqn<String> parentFqn = makeParentFqn(data.getQPath());
- Object prev =
- cache.put(parentFqn, data.getQPath().getEntries()[data.getQPath().getEntries().length - 1].getAsString(true),
- data.getIdentifier());
+ Object prev = cache.put(parentFqn, data.getQPath().getName().getAsString(), data.getIdentifier());
if (prev == null)
{
throw new IllegalStateException("Property was deleted (tree)");
@@ -402,7 +400,7 @@
{
LOG.debug("rollback " + batchStarted);
}
-
+
// rollback batch
if (batchStarted)
{
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 13:37:26 UTC (rev 454)
+++ 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)
@@ -48,6 +48,7 @@
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
+import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
import org.jboss.cache.Cache;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
@@ -196,6 +197,13 @@
Node<Serializable, Object> itemsNode = items.getChild(Fqn.fromElements(node1id));
assertNotNull("Node item data should exists", itemsNode);
+
+ Object dataObject = itemsNode.get(JBossCacheStorageConnection.ITEM_DATA);
+ assertTrue("Node item data is not a Node", dataObject instanceof NodeData);
+
+ NodeData data = (NodeData)dataObject;
+ assertEquals("Node id wrong", node1id, data.getIdentifier());
+ assertEquals("Node path wrong", node1path, data.getQPath());
}
public void testAddProperty() throws Exception
@@ -206,13 +214,19 @@
// add property (/jcr:primaryType)
String propId1 = "1";
- conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_PRIMARYTYPE), propId1,
- 1, 1, Constants.ROOT_UUID, false));
+ QPath propPath1 = QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_PRIMARYTYPE);
+ TransientPropertyData propData1 = new TransientPropertyData(propPath1, propId1, 1, 1, Constants.ROOT_UUID, false);
+ String propValue1 = "Property value #1";
+ propData1.setValue(new TransientValueData(propValue1));
+ conn.add(propData1);
// add property (/jcr:mixinTypes)
String propId2 = "2";
- conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_MIXINTYPES), propId2,
- 1, 1, Constants.ROOT_UUID, false));
+ QPath propPath2 = QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_MIXINTYPES);
+ TransientPropertyData propData2 = new TransientPropertyData(propPath2, propId2, 1, 1, Constants.ROOT_UUID, false);
+ String propValue2 = "Property value #2";
+ propData2.setValue(new TransientValueData(propValue2));
+ conn.add(propData2);
// check in tree
treePrint(tree);
@@ -223,13 +237,13 @@
assertEquals("Attributes ammount wrong", 3, rootNode.getKeys().size());
- String pid = (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsString());
- assertNotNull("Property ID should exists", pid);
- assertEquals("Property ID wrong", propId1, pid);
+ String pid1 = (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsString());
+ assertNotNull("Property ID should exists", pid1);
+ assertEquals("Property ID wrong", propId1, pid1);
- pid = (String)rootNode.get(Constants.JCR_MIXINTYPES.getAsString());
- assertNotNull("Property ID should exists", pid);
- assertEquals("Property ID wrong", propId2, pid);
+ String pid2 = (String)rootNode.get(Constants.JCR_MIXINTYPES.getAsString());
+ assertNotNull("Property ID should exists", pid2);
+ assertEquals("Property ID wrong", propId2, pid2);
// TODO check order
int index = 0;
@@ -242,8 +256,27 @@
// check in items
treePrint(items);
- assertNotNull("Property item data should exists", items.getChild(Fqn.fromElements(propId1)));
- assertNotNull("Property item data should exists", items.getChild(Fqn.fromElements(propId2)));
+ Node<Serializable, Object> itemsProp1 = items.getChild(Fqn.fromElements(propId1));
+ Object data1Object = itemsProp1.get(JBossCacheStorageConnection.ITEM_DATA);
+ assertNotNull("Property item data should exists", data1Object);
+ assertTrue("Property item data is not a Property", data1Object instanceof PropertyData);
+
+ PropertyData data1 = (PropertyData)data1Object;
+ assertEquals("Property id wrong", propId1, data1.getIdentifier());
+ assertEquals("Property path wrong", propPath1, data1.getQPath());
+ assertEquals("Property Value wrong", propValue1, new String(data1.getValues().get(0).getAsByteArray(),
+ Constants.DEFAULT_ENCODING));
+
+ Node<Serializable, Object> itemsProp2 = items.getChild(Fqn.fromElements(propId2));
+ Object data2Object = itemsProp2.get(JBossCacheStorageConnection.ITEM_DATA);
+ assertNotNull("Property item data should exists", data2Object);
+ assertTrue("Property item data is not a Property", data2Object instanceof PropertyData);
+
+ PropertyData data2 = (PropertyData)data2Object;
+ assertEquals("Property id wrong", propId2, data2.getIdentifier());
+ assertEquals("Property path wrong", propPath2, data2.getQPath());
+ assertEquals("Property Value wrong", propValue2, new String(data2.getValues().get(0).getAsByteArray(),
+ Constants.DEFAULT_ENCODING));
}
public void testDeleteNode() throws Exception
@@ -339,6 +372,98 @@
assertNotNull("Property item data should exists", items.getChild(Fqn.fromElements(propId2)));
}
+ public void testUpdateNode() throws Exception
+ {
+ // add root (/)
+ conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED,
+ new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+
+ // add node (/node)
+ String node1id = "1";
+ QPath node1path = QPath.parse("[]:1[]node:1");
+ conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0], 0,
+ Constants.ROOT_UUID, new AccessControlList()));
+
+ // get root node ([]:1)
+ Node<Serializable, Object> rootNode =
+ tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[Constants.ROOT_PATH.getEntries().length - 1]
+ .getAsString(true)));
+
+ // update /node (order number)
+ int nodeOrderNumb = 1;
+ conn.update(new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0],
+ nodeOrderNumb, Constants.ROOT_UUID, new AccessControlList()));
+
+ // check in tree
+ treePrint(tree);
+
+ Node<Serializable, Object> node =
+ rootNode.getChild(Fqn
+ .fromElements(node1path.getEntries()[node1path.getEntries().length - 1].getAsString(true)));
+
+ assertNotNull("Node should exists", node);
+ assertEquals("Child expected", 1, rootNode.getChildren().size());
+
+ // check in items
+ treePrint(items);
+
+ Node<Serializable, Object> itemNode = items.getChild(Fqn.fromElements(node1id));
+ assertNotNull("Node item data should exists", itemNode);
+
+ Object dataObject = itemNode.get(JBossCacheStorageConnection.ITEM_DATA);
+ assertTrue("Node item data should be a NodeData", dataObject instanceof NodeData);
+ assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getIdentifier());
+ assertEquals("Node path wrong", node1path, ((NodeData)dataObject).getQPath());
+ assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)dataObject).getOrderNumber());
+ }
+
+ public void testUpdateProperty() throws Exception
+ {
+ // add root (/)
+ conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED,
+ new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()));
+
+ // add property (/prop1)
+ String propId1 = "1";
+ QPath propPath1 = QPath.makeChildPath(Constants.ROOT_PATH, Constants.JCR_PRIMARYTYPE);
+ TransientPropertyData propData1 = new TransientPropertyData(propPath1, propId1, 1, 1, Constants.ROOT_UUID, false);
+ String propValue1 = "Property value #1";
+ propData1.setValue(new TransientValueData(propValue1));
+ conn.add(propData1);
+
+ // update property (/prop1) with new value
+ TransientPropertyData propDataU = new TransientPropertyData(propPath1, propId1, 1, 1, Constants.ROOT_UUID, false);
+ String propValueU = "Updated Property value #1";
+ propDataU.setValue(new TransientValueData(propValueU));
+ conn.update(propDataU);
+
+ // check in tree
+ treePrint(tree);
+
+ Node<Serializable, Object> rootNode =
+ tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[Constants.ROOT_PATH.getEntries().length - 1]
+ .getAsString(true)));
+
+ assertEquals("Attributes ammount wrong", 2, rootNode.getKeys().size());
+
+ String pid = (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsString());
+ assertEquals("Property ID wrong", propId1, pid);
+
+ // check in items
+ treePrint(items);
+
+ Node<Serializable, Object> itemsProp1 = items.getChild(Fqn.fromElements(propId1));
+ Object data1Object = itemsProp1.get(JBossCacheStorageConnection.ITEM_DATA);
+ assertNotNull("Property item data should exists", data1Object);
+ assertTrue("Property item data is not a Property", data1Object instanceof PropertyData);
+
+ PropertyData data1 = (PropertyData)data1Object;
+ assertEquals("Property id wrong", propId1, data1.getIdentifier());
+ assertEquals("Property path wrong", propPath1, data1.getQPath());
+ assertEquals("Property Value wrong", propValueU, new String(data1.getValues().get(0).getAsByteArray(),
+ Constants.DEFAULT_ENCODING));
+ }
+
public void testGetNodeByName() throws Exception
{
// TODO prepare using JCR WDC API (not a right way, JBC API better... but read assumes the write works)
14 years, 6 months
exo-jcr SVN: r454 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-10-30 09:37:26 -0400 (Fri, 30 Oct 2009)
New Revision: 454
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
Log:
EXOJCR-218 : Add heder to JCRItemExistsException
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java 2009-10-30 13:12:18 UTC (rev 453)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java 2009-10-30 13:37:26 UTC (rev 454)
@@ -1,3 +1,21 @@
+/*
+ * 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 2.1 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;
import javax.jcr.ItemExistsException;
14 years, 6 months
exo-jcr SVN: r453 - jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-30 09:12:18 -0400 (Fri, 30 Oct 2009)
New Revision: 453
Modified:
jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-configuration.xml
Log:
EXOJCR-178 test configuration updated
Modified: jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-configuration.xml 2009-10-30 11:11:43 UTC (rev 452)
+++ jcr/trunk/exo.jcr.component.webdav/src/test/resources/conf/standalone/test-configuration.xml 2009-10-30 13:12:18 UTC (rev 453)
@@ -186,7 +186,7 @@
<value-param>
<name>cache-control</name>
- <value>image/jpeg,image/png:max-age=3600;text/html,text/xml:max-age=1800</value>
+ <value>text/xml,text/html:max-age=1800;text/*:max-age=777;image/png,image/jpg:max-age=3600;*/*:no-cache;image/*:max-age=555</value>
</value-param>
</init-params>
14 years, 6 months
exo-jcr SVN: r452 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-10-30 07:11:43 -0400 (Fri, 30 Oct 2009)
New Revision: 452
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
Log:
EXOJCR-218 : Add exception JCRItemExistsException.
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java 2009-10-30 11:11:43 UTC (rev 452)
@@ -0,0 +1,130 @@
+package org.exoplatform.services.jcr.impl.storage;
+
+import javax.jcr.ItemExistsException;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>
+ * Date: 29.10.2009
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex Reshetnyak</a>
+ * @version $Id$
+ */
+public class JCRItemExistsException
+ extends ItemExistsException
+{
+ /**
+ * serialVersionUID - autogenerated.
+ */
+ private static final long serialVersionUID = -5201442796959443584L;
+
+ /**
+ * Context Item Id.
+ */
+ private final String itemId;
+
+ /**
+ * Context Item state.
+ */
+ private final int itemState;
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ */
+ public JCRItemExistsException(String message)
+ {
+ super(message);
+ this.itemId = null;
+ this.itemState = -1;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ */
+ public JCRItemExistsException(String message, String itemId)
+ {
+ super(message);
+ this.itemId = itemId;
+ this.itemState = -1;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ * @param itemState
+ * - context Item state
+ */
+ public JCRItemExistsException(String message, String itemId, int itemState)
+ {
+ super(message);
+ this.itemId = itemId;
+ this.itemState = itemState;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ *@param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ * @param e - cause error
+ */
+ public JCRItemExistsException(String message, String itemId, Throwable e)
+ {
+ super(message, e);
+ this.itemId = itemId;
+ this.itemState = -1;
+ }
+
+ /**
+ * JCRItemExistsException constructor.
+ *
+ * @param message
+ * - context message
+ * @param itemId
+ * - context Item id
+ * @param itemState
+ * - context Item state
+ * @param e - cause error
+ */
+ public JCRItemExistsException(String message, String itemId, int itemState, Throwable e)
+ {
+ super(message, e);
+ this.itemId = itemId;
+ this.itemState = itemState;
+ }
+
+ /**
+ * Get context Item Id.
+ *
+ * @return String Item id
+ */
+ public String getIdentifier()
+ {
+ return itemId;
+ }
+
+ /**
+ * Get context Item state.
+ *
+ * @return int state
+ */
+ public int getState()
+ {
+ return itemState;
+ }
+}
\ No newline at end of file
Property changes on: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/JCRItemExistsException.java
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
14 years, 6 months
exo-jcr SVN: r451 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc and 1 other directories.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-10-30 07:08:16 -0400 (Fri, 30 Oct 2009)
New Revision: 451
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
Log:
EXOJCR-218 : The exception JCRItemExistsException was added. This exception is throwing in SQLExceptionHandler and catching in BackupWorkspaceinitializer, BackupManagerImpl.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java 2009-10-30 10:57:51 UTC (rev 450)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/BackupWorkspaceInitializer.java 2009-10-30 11:08:16 UTC (rev 451)
@@ -37,6 +37,7 @@
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager;
import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateException;
+import org.exoplatform.services.jcr.impl.storage.JCRItemExistsException;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.observation.ExtendedEvent;
@@ -67,19 +68,21 @@
*
* @version $Id: BackupWorkspaceInitializer.java 34801 2009-07-31 15:44:50Z dkatayev $
*/
-public class BackupWorkspaceInitializer extends SysViewWorkspaceInitializer
+public class BackupWorkspaceInitializer
+ extends SysViewWorkspaceInitializer
{
private final String restoreDir;
private FileCleaner fileCleaner;
public BackupWorkspaceInitializer(WorkspaceEntry config, RepositoryEntry repConfig,
- CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl namespaceRegistry,
- LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager, ValueFactoryImpl valueFactory,
- AccessManager accessManager) throws RepositoryConfigurationException, PathNotFoundException, RepositoryException
+ CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl namespaceRegistry,
+ LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager, ValueFactoryImpl valueFactory,
+ AccessManager accessManager) throws RepositoryConfigurationException, PathNotFoundException,
+ RepositoryException
{
super(config, repConfig, dataManager, namespaceRegistry, locationFactory, nodeTypeManager, valueFactory,
- accessManager);
+ accessManager);
this.fileCleaner = new FileCleaner();
@@ -98,7 +101,7 @@
if (isWorkspaceInitialized())
{
- return (NodeData)dataManager.getItemData(Constants.ROOT_UUID);
+ return (NodeData) dataManager.getItemData(Constants.ROOT_UUID);
}
try
@@ -116,10 +119,10 @@
// restore from incremental backup
incrementalRead();
- final NodeData root = (NodeData)dataManager.getItemData(Constants.ROOT_UUID);
+ final NodeData root = (NodeData) dataManager.getItemData(Constants.ROOT_UUID);
log.info("Workspace " + workspaceName + " restored from file " + restorePath + " in "
- + (System.currentTimeMillis() - start) * 1d / 1000 + "sec");
+ + (System.currentTimeMillis() - start) * 1d / 1000 + "sec");
return root;
}
@@ -163,7 +166,7 @@
}
private void incrementalRestore(File incrementalBackupFile) throws FileNotFoundException, IOException,
- ClassNotFoundException, RepositoryException
+ ClassNotFoundException, RepositoryException
{
ObjectInputStream ois = null;
try
@@ -200,14 +203,26 @@
catch (JCRInvalidItemStateException e)
{
TransactionChangesLog normalizeChangesLog =
- getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
+ getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
if (normalizeChangesLog != null)
saveChangesLog(normalizeChangesLog);
else
throw new RepositoryException(
- "Collisions found during save of restore changes log, but caused item is not found by ID "
- + e.getIdentifier() + ". " + e, e);
+ "Collisions found during save of restore changes log, but caused item is not found by ID "
+ + e.getIdentifier() + ". " + e, e);
}
+ catch (JCRItemExistsException e)
+ {
+ TransactionChangesLog normalizeChangesLog =
+ getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
+ if (normalizeChangesLog != null)
+ saveChangesLog(normalizeChangesLog);
+ else
+ throw new RepositoryException(
+ "Collisions found during save of restore changes log, but caused item is not found by ID "
+ + e.getIdentifier() + ". " + e, e);
+ }
+
}
private TransactionChangesLog getNormalizedChangesLog(String collisionID, int state, TransactionChangesLog changesLog)
@@ -235,7 +250,7 @@
{
// Node... by ID and desc path
if (!item.getIdentifier().equals(collisionID)
- && !item.getQPath().isDescendantOf(citem.getData().getQPath()))
+ && !item.getQPath().isDescendantOf(citem.getData().getQPath()))
normalized.add(change);
}
else if (!item.getIdentifier().equals(collisionID))
@@ -273,7 +288,8 @@
return list;
}
- class BackupFilesFilter implements FileFilter
+ class BackupFilesFilter
+ implements FileFilter
{
public boolean accept(File pathname)
{
@@ -308,7 +324,7 @@
{
// read ChangesLog
- transactionChangesLog = (TransactionChangesLog)in.readObject();
+ transactionChangesLog = (TransactionChangesLog) in.readObject();
// read FixupStream count
int iFixupStream = in.readInt();
@@ -338,7 +354,7 @@
}
RestoreChangesLog restoreChangesLog =
- new RestoreChangesLog(transactionChangesLog, listFixupStreams, listFiles, fileCleaner);
+ new RestoreChangesLog(transactionChangesLog, listFixupStreams, listFiles, fileCleaner);
restoreChangesLog.restore();
@@ -347,7 +363,7 @@
}
else if (changesLogType == RestoreChangesLog.Type.ItemDataChangesLog_without_Streams)
{
- transactionChangesLog = (TransactionChangesLog)in.readObject();
+ transactionChangesLog = (TransactionChangesLog) in.readObject();
}
return transactionChangesLog;
@@ -372,8 +388,8 @@
}
else if (readBytes < bufferSize)
{
- ois.readFully(buf, 0, (int)readBytes);
- fos.write(buf, 0, (int)readBytes);
+ ois.readFully(buf, 0, (int) readBytes);
+ fos.write(buf, 0, (int) readBytes);
}
readBytes -= bufferSize;
}
@@ -402,7 +418,7 @@
private FileCleaner fileCleaner;
public RestoreChangesLog(TransactionChangesLog transactionChangesLog, List<FixupStream> listFixupStreams,
- List<File> listFiles, FileCleaner fileCleaner)
+ List<File> listFiles, FileCleaner fileCleaner)
{
this.itemDataChangesLog = transactionChangesLog;
this.listFixupStream = listFixupStreams;
@@ -423,9 +439,9 @@
ItemState itemState = listItemState.get(listFixupStream.get(i).getItemSateId());
ItemData itemData = itemState.getData();
- TransientPropertyData propertyData = (TransientPropertyData)itemData;
+ TransientPropertyData propertyData = (TransientPropertyData) itemData;
TransientValueData transientValueData =
- (TransientValueData)(propertyData.getValues().get(listFixupStream.get(i).getValueDataId()));
+ (TransientValueData) (propertyData.getValues().get(listFixupStream.get(i).getValueDataId()));
transientValueData.setStream(new FileInputStream(listFile.get(i)));
transientValueData.setFileCleaner(fileCleaner);
transientValueData.isByteArray();
@@ -436,7 +452,8 @@
}
}
- class FixupStream implements Externalizable
+ class FixupStream
+ implements Externalizable
{
int iItemStateId = -1;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2009-10-30 10:57:51 UTC (rev 450)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2009-10-30 11:08:16 UTC (rev 451)
@@ -23,6 +23,7 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateException;
+import org.exoplatform.services.jcr.impl.storage.JCRItemExistsException;
import java.io.IOException;
import java.sql.SQLException;
@@ -175,7 +176,7 @@
{
// item already exists
message += "Item already exists in storage: " + itemInfo;
- ownException = new ItemExistsException(message, e);
+ ownException = new JCRItemExistsException(message, me.getIdentifier(), ItemState.ADDED, e);
throw ownException;
}
@@ -183,7 +184,7 @@
if (me != null)
{
message += "Item already exists in storage: " + itemInfo;
- ownException = new ItemExistsException(message, e);
+ ownException = new JCRItemExistsException(message, me.getIdentifier(), ItemState.ADDED, e);
throw ownException;
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2009-10-30 10:57:51 UTC (rev 450)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2009-10-30 11:08:16 UTC (rev 451)
@@ -49,6 +49,7 @@
import org.exoplatform.services.jcr.impl.core.SysViewWorkspaceInitializer;
import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateException;
+import org.exoplatform.services.jcr.impl.storage.JCRItemExistsException;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.observation.ExtendedEvent;
import org.exoplatform.services.jcr.util.IdGenerator;
@@ -88,7 +89,8 @@
* @version $Id: $
*/
-public class BackupManagerImpl implements BackupManager, Startable
+public class BackupManagerImpl
+ implements BackupManager, Startable
{
protected static Log log = ExoLogger.getLogger("ext.BackupManagerImpl");
@@ -144,7 +146,8 @@
private final AutoStopper stopper;
- class MessagesListener implements BackupJobListener
+ class MessagesListener
+ implements BackupJobListener
{
public void onError(BackupJob job, String message, Throwable error)
@@ -227,7 +230,8 @@
}
}
- class LogsFilter implements FileFilter
+ class LogsFilter
+ implements FileFilter
{
public boolean accept(File pathname)
@@ -236,7 +240,8 @@
}
}
- class TaskFilter implements FileFilter
+ class TaskFilter
+ implements FileFilter
{
public boolean accept(File pathname)
@@ -245,7 +250,8 @@
}
}
- class AutoStopper extends Thread
+ class AutoStopper
+ extends Thread
{
/**
@@ -398,8 +404,8 @@
*/
@Deprecated
public void restore(BackupChainLog log, String repositoryName, WorkspaceEntry workspaceEntry)
- throws BackupOperationException, RepositoryException, RepositoryConfigurationException,
- BackupConfigurationException
+ throws BackupOperationException, RepositoryException, RepositoryConfigurationException,
+ BackupConfigurationException
{
List<JobEntryInfo> list = log.getJobEntryInfos();
@@ -457,8 +463,8 @@
}
protected void restoreOverInitializer(BackupChainLog log, String repositoryName, WorkspaceEntry workspaceEntry)
- throws BackupOperationException, RepositoryException, RepositoryConfigurationException,
- BackupConfigurationException
+ throws BackupOperationException, RepositoryException, RepositoryConfigurationException,
+ BackupConfigurationException
{
List<JobEntryInfo> list = log.getJobEntryInfos();
@@ -516,7 +522,7 @@
}
private boolean workspaceAlreadyExist(String repository, String workspace) throws RepositoryException,
- RepositoryConfigurationException
+ RepositoryConfigurationException
{
String[] ws = repoService.getRepository(repository).getWorkspaceNames();
@@ -530,7 +536,7 @@
* {@inheritDoc}
*/
public BackupChain startBackup(BackupConfig config) throws BackupOperationException, BackupConfigurationException,
- RepositoryException, RepositoryConfigurationException
+ RepositoryException, RepositoryConfigurationException
{
return startBackup(config, null);
@@ -548,7 +554,7 @@
* @throws RepositoryConfigurationException
*/
BackupChain startBackup(BackupConfig config, BackupJobListener jobListener) throws BackupOperationException,
- BackupConfigurationException, RepositoryException, RepositoryConfigurationException
+ BackupConfigurationException, RepositoryException, RepositoryConfigurationException
{
if (config.getIncrementalJobPeriod() < 0)
@@ -561,8 +567,8 @@
config.setIncrementalJobPeriod(defaultIncrementalJobPeriod);
BackupChain bchain =
- new BackupChainImpl(config, logsDirectory, repoService.getRepository(config.getRepository()), fullBackupType,
- incrementalBackupType, IdGenerator.generate());
+ new BackupChainImpl(config, logsDirectory, repoService.getRepository(config.getRepository()),
+ fullBackupType, incrementalBackupType, IdGenerator.generate());
bchain.addListener(messagesListener);
bchain.addListener(jobListener);
@@ -666,20 +672,20 @@
@Deprecated
private void fullRestore(String pathBackupFile, String repositoryName, String workspaceName,
- WorkspaceEntry workspaceEntry) throws FileNotFoundException, IOException, RepositoryException,
- RepositoryConfigurationException
+ WorkspaceEntry workspaceEntry) throws FileNotFoundException, IOException, RepositoryException,
+ RepositoryConfigurationException
{
- RepositoryImpl defRep = (RepositoryImpl)repoService.getRepository(repositoryName);
+ RepositoryImpl defRep = (RepositoryImpl) repoService.getRepository(repositoryName);
defRep.importWorkspace(workspaceEntry.getName(), new FileInputStream(pathBackupFile));
}
private void fullRestoreOverInitializer(String pathBackupFile, String repositoryName, WorkspaceEntry workspaceEntry)
- throws FileNotFoundException, IOException, RepositoryException, RepositoryConfigurationException
+ throws FileNotFoundException, IOException, RepositoryException, RepositoryConfigurationException
{
- RepositoryImpl defRep = (RepositoryImpl)repoService.getRepository(repositoryName);
+ RepositoryImpl defRep = (RepositoryImpl) repoService.getRepository(repositoryName);
// set the initializer SysViewWorkspaceInitializer
WorkspaceInitializerEntry wiEntry = new WorkspaceInitializerEntry();
@@ -698,13 +704,13 @@
}
private void incrementalRestore(String pathBackupFile, String repositoryName, String workspaceName)
- throws RepositoryException, RepositoryConfigurationException, BackupOperationException, FileNotFoundException,
- IOException, ClassNotFoundException
+ throws RepositoryException, RepositoryConfigurationException, BackupOperationException,
+ FileNotFoundException, IOException, ClassNotFoundException
{
- SessionImpl sesion = (SessionImpl)repoService.getRepository(repositoryName).getSystemSession(workspaceName);
+ SessionImpl sesion = (SessionImpl) repoService.getRepository(repositoryName).getSystemSession(workspaceName);
WorkspacePersistentDataManager dataManager =
- (WorkspacePersistentDataManager)sesion.getContainer().getComponentInstanceOfType(
- WorkspacePersistentDataManager.class);
+ (WorkspacePersistentDataManager) sesion.getContainer().getComponentInstanceOfType(
+ WorkspacePersistentDataManager.class);
ObjectInputStream ois = null;
File backupFile = null;
@@ -739,7 +745,7 @@
}
private void saveChangesLog(WorkspacePersistentDataManager dataManager, TransactionChangesLog changesLog)
- throws RepositoryException, BackupOperationException
+ throws RepositoryException, BackupOperationException
{
try
{
@@ -748,14 +754,26 @@
catch (JCRInvalidItemStateException e)
{
TransactionChangesLog normalizeChangesLog =
- getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
+ getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
if (normalizeChangesLog != null)
saveChangesLog(dataManager, normalizeChangesLog);
else
throw new BackupOperationException(
- "Collisions found during save of restore changes log, but caused item is not found by ID "
- + e.getIdentifier() + ". " + e, e);
+ "Collisions found during save of restore changes log, but caused item is not found by ID "
+ + e.getIdentifier() + ". " + e, e);
}
+ catch (JCRItemExistsException e)
+ {
+ TransactionChangesLog normalizeChangesLog =
+ getNormalizedChangesLog(e.getIdentifier(), e.getState(), changesLog);
+ if (normalizeChangesLog != null)
+ saveChangesLog(dataManager, normalizeChangesLog);
+ else
+ throw new RepositoryException(
+ "Collisions found during save of restore changes log, but caused item is not found by ID "
+ + e.getIdentifier() + ". " + e, e);
+ }
+
}
private TransactionChangesLog getNormalizedChangesLog(String collisionID, int state, TransactionChangesLog changesLog)
@@ -783,7 +801,7 @@
{
// Node... by ID and desc path
if (!item.getIdentifier().equals(collisionID)
- && !item.getQPath().isDescendantOf(citem.getData().getQPath()))
+ && !item.getQPath().isDescendantOf(citem.getData().getQPath()))
normalized.add(change);
}
else if (!item.getIdentifier().equals(collisionID))
@@ -817,7 +835,7 @@
{
// read ChangesLog
- transactionChangesLog = (TransactionChangesLog)in.readObject();
+ transactionChangesLog = (TransactionChangesLog) in.readObject();
// read FixupStream count
int iFixupStream = in.readInt();
@@ -848,7 +866,7 @@
}
PendingChangesLog pendingChangesLog =
- new PendingChangesLog(transactionChangesLog, listFixupStreams, listFiles, fileCleaner);
+ new PendingChangesLog(transactionChangesLog, listFixupStreams, listFiles, fileCleaner);
pendingChangesLog.restore();
@@ -857,7 +875,7 @@
}
else if (changesLogType == PendingChangesLog.Type.CHANGESLOG_WITHOUT_STREAM)
{
- transactionChangesLog = (TransactionChangesLog)in.readObject();
+ transactionChangesLog = (TransactionChangesLog) in.readObject();
}
return transactionChangesLog;
@@ -882,8 +900,8 @@
}
else if (readBytes < bufferSize)
{
- ois.readFully(buf, 0, (int)readBytes);
- fos.write(buf, 0, (int)readBytes);
+ ois.readFully(buf, 0, (int) readBytes);
+ fos.write(buf, 0, (int) readBytes);
}
readBytes -= bufferSize;
}
@@ -905,7 +923,7 @@
* @throws RepositoryException
*/
private void writeParamsToRegistryService(SessionProvider sessionProvider) throws IOException, SAXException,
- ParserConfigurationException, RepositoryException
+ ParserConfigurationException, RepositoryException
{
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element root = doc.createElement(SERVICE_NAME);
@@ -931,7 +949,7 @@
* @throws PathNotFoundException
*/
private void readParamsFromRegistryService(SessionProvider sessionProvider) throws PathNotFoundException,
- RepositoryException
+ RepositoryException
{
String entryPath = RegistryService.EXO_SERVICES + "/" + SERVICE_NAME + "/" + BACKUP_PROPERTIES;
RegistryEntry registryEntry = registryService.getEntry(sessionProvider, entryPath);
@@ -1043,7 +1061,7 @@
{
BackupChain chain = it.next();
if (repository.equals(chain.getBackupConfig().getRepository())
- && workspace.equals(chain.getBackupConfig().getWorkspace()))
+ && workspace.equals(chain.getBackupConfig().getWorkspace()))
return chain;
}
return null;
@@ -1146,13 +1164,13 @@
* {@inheritDoc}
*/
public void restore(BackupChainLog log, String repositoryName, WorkspaceEntry workspaceEntry, boolean asynchronous)
- throws BackupOperationException, BackupConfigurationException, RepositoryException,
- RepositoryConfigurationException
+ throws BackupOperationException, BackupConfigurationException, RepositoryException,
+ RepositoryConfigurationException
{
if (asynchronous)
{
JobWorkspaceRestore jobRestore =
- new JobWorkspaceRestore(repoService, this, repositoryName, log, workspaceEntry);
+ new JobWorkspaceRestore(repoService, this, repositoryName, log, workspaceEntry);
restoreJobs.add(jobRestore);
jobRestore.start();
}
14 years, 6 months