exo-jcr SVN: r1004 - in kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3: src/main/java/org/exoplatform/services/cache/impl/jboss and 1 other directories.
by do-not-reply@jboss.org
Author: mstruk
Date: 2009-12-11 07:49:41 -0500 (Fri, 11 Dec 2009)
New Revision: 1004
Modified:
kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java
kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
Log:
Merged trunk changes up to r1003
Modified: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2009-12-11 12:41:36 UTC (rev 1003)
+++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2009-12-11 12:49:41 UTC (rev 1004)
@@ -1,36 +1,64 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>kernel-parent</artifactId>
- <version>2.2.0-Beta05-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>kernel-parent</artifactId>
+ <version>2.2.0-Beta05-SNAPSHOT</version>
+ </parent>
- <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
- <name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
- <description>JBoss Cache Implementation for the Cache Service</description>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ <name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
+ <description>JBoss Cache Implementation for the Cache Service</description>
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.tool</groupId>
- <artifactId>exo.tool.framework.junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.cache</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.tool</groupId>
+ <artifactId>exo.tool.framework.junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <!-- We add this system property due to some incompatibility between IPv6 and
+ some JVM of Linux distributions such as Ubuntu and Fedora-->
+ <property>
+ <name>java.net.preferIPv4Stack</name>
+ <value>true</value>
+ </property>
+ <!-- Avoid the firewall -->
+ <property>
+ <name>bind.address</name>
+ <value>127.0.0.1</value>
+ </property>
+ <property>
+ <name>jgroups.stack</name>
+ <value>udp</value>
+ </property>
+
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2009-12-11 12:41:36 UTC (rev 1003)
+++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2009-12-11 12:49:41 UTC (rev 1004)
@@ -18,12 +18,6 @@
*/
package org.exoplatform.services.cache.impl.jboss;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -42,6 +36,12 @@
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.config.Configuration.CacheMode;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
/**
* This class is the JBoss Cache implementation of the {@link org.exoplatform.services.cache.ExoCacheFactory}
* Created by The eXo Platform SAS
@@ -112,13 +112,13 @@
* 2. If no specific location has been defined, we use the default configuration which is
* "${CACHE_CONFIG_TEMPLATE_KEY}"
*/
- public ExoCache createCache(ExoCacheConfig config) throws ExoCacheInitException
+ public ExoCache<Serializable, Object> createCache(ExoCacheConfig config) throws ExoCacheInitException
{
final String region = config.getName();
final String customConfig = mappingCacheNameConfig.get(region);
final Cache<Serializable, Object> cache;
final CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
- final ExoCache eXoCache;
+ final ExoCache<Serializable, Object> eXoCache;
try
{
if (customConfig != null)
@@ -230,7 +230,13 @@
{
final Configuration config = cache.getConfiguration();
// Reset the eviction policies
- final EvictionConfig evictionConfig = config.getEvictionConfig();
+ EvictionConfig evictionConfig = config.getEvictionConfig();
+ if (evictionConfig == null)
+ {
+ // If not eviction config exists, we create an empty one
+ evictionConfig = new EvictionConfig();
+ config.setEvictionConfig(evictionConfig);
+ }
evictionConfig.setEvictionRegionConfigs(new LinkedList<EvictionRegionConfig>());
// Rename the cluster name
String clusterName = config.getClusterName();
Modified: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2009-12-11 12:41:36 UTC (rev 1003)
+++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2009-12-11 12:49:41 UTC (rev 1004)
@@ -232,6 +232,7 @@
@SuppressWarnings("unchecked")
public void testDistributedCache() throws Exception
{
+ System.out.println("WARNING: For Linux distributions the following JVM parameter must be set to true, java.net.preferIPv4Stack = " + System.getProperty("java.net.preferIPv4Stack"));
ExoCacheConfig config = new ExoCacheConfig();
config.setName("MyCacheDistributed");
config.setMaxSize(5);
@@ -404,7 +405,7 @@
long time = System.currentTimeMillis();
final ExoCache<Serializable, Object> cache = service.getCacheInstance("test-multi-threading");
final int totalElement = 100;
- final int totalTimes = 100;
+ final int totalTimes = 20;
int reader = 20;
int writer = 10;
int remover = 5;
16 years, 7 months
exo-jcr SVN: r1003 - in kernel/branches/mc-int-branch/exo.kernel.mc-integration: exo.kernel.mc-int-tests/src/test/java/org/exoplatform/kernel/it and 1 other directory.
by do-not-reply@jboss.org
Author: mstruk
Date: 2009-12-11 07:41:36 -0500 (Fri, 11 Dec 2009)
New Revision: 1003
Modified:
kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/test/java/org/exoplatform/kernel/it/TestMCInjectionIntegration.java
kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int/src/main/java/org/exoplatform/container/mc/impl/MCIntegrationImpl.java
Log:
JavaDoc + fix tests url to reflect tests artifact name change
Modified: kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int/src/main/java/org/exoplatform/container/mc/impl/MCIntegrationImpl.java
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int/src/main/java/org/exoplatform/container/mc/impl/MCIntegrationImpl.java 2009-12-11 11:20:38 UTC (rev 1002)
+++ kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int/src/main/java/org/exoplatform/container/mc/impl/MCIntegrationImpl.java 2009-12-11 12:41:36 UTC (rev 1003)
@@ -24,7 +24,11 @@
import java.util.Set;
/**
- * Implementation of MCIntegration that contains hard dependencies on
+ * Implementation of MCIntegration that contains hard dependencies on JBoss Microcontainer.
+ *
+ * There is a reflection style dependency on this class in
+ * {@link org.exoplatform.container.mc.MCIntegrationInvoker}.
+ *
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
public class MCIntegrationImpl implements MCIntegration
Modified: kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/test/java/org/exoplatform/kernel/it/TestMCInjectionIntegration.java
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/test/java/org/exoplatform/kernel/it/TestMCInjectionIntegration.java 2009-12-11 11:20:38 UTC (rev 1002)
+++ kernel/branches/mc-int-branch/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/test/java/org/exoplatform/kernel/it/TestMCInjectionIntegration.java 2009-12-11 12:41:36 UTC (rev 1003)
@@ -45,7 +45,7 @@
port = "8080";
}
// invoke servlet
- url = new URL("http://" + host + ":" + port + "/integration-tests/integration-tests?class=" + testClass);
+ url = new URL("http://" + host + ":" + port + "/mc-int-tests/integration-tests?class=" + testClass);
System.out.println("Executing remote tests: " + url);
InputStream is = (InputStream) url.getContent();
LineReader lineReader = new LineReader(new InputStreamReader(is));
16 years, 7 months
exo-jcr SVN: r1002 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow: session and 1 other directory.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-12-11 06:20:38 -0500 (Fri, 11 Dec 2009)
New Revision: 1002
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java
Log:
EXOJCR-274 LocalWorkspaceDataManagerStub manager used directly in TransactionableDataManager, was runtime error of method calling in JVM
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-11 10:27:59 UTC (rev 1001)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-11 11:20:38 UTC (rev 1002)
@@ -427,11 +427,6 @@
{
PropertyData prevData = (PropertyData)prevState.getData();
- // newData =
- // new PersistedPropertyData(prevData.getIdentifier(), prevData.getQPath(), prevData
- // .getParentIdentifier(), prevData.getPersistedVersion() + 1, prevData.getType(), prevData
- // .isMultiValued(), prevData.getValues());
-
if (prevData.getValues() != null)
{
List<ValueData> values = new ArrayList<ValueData>();
@@ -455,12 +450,6 @@
// TODO review TransientValueData logic about spool file and stream
values.add(new StreamPersistedValueData(destFile, tvd.getSpoolFile(),
tvd.getSpoolFile() == null ? tvd.getAsStream(false) : null, vd.getOrderNumber()));
-
- // {
- // throw new RepositoryException(
- // "Unexpected stream based ValueData implementaion on persistent level, only TransientValueData or PersistedValueData allowed. "
- // + vd.getClass());
- // }
}
}
else
@@ -517,7 +506,7 @@
}
else if (itemState.isDeleted())
{
- doDelete(data, conn); //conn.getChildNodesData((NodeData)conn.getItemData("7986bb30c0a800cb1610f7a03958e641"))
+ doDelete(data, conn); //conn.getChildNodesCount((NodeData)conn.getItemData("7d4a6b5ac0a800cb78d3df421b65bf00")) //getThisConnection()
}
else if (itemState.isRenamed())
{
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 2009-12-11 10:27:59 UTC (rev 1001)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 2009-12-11 11:20:38 UTC (rev 1002)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.jcr.impl.dataflow.session;
+import org.exoplatform.services.jcr.dataflow.CompositeChangesLog;
import org.exoplatform.services.jcr.dataflow.DataManager;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
@@ -49,7 +50,9 @@
public class TransactionableDataManager implements TransactionResource, DataManager
{
- private SharedDataManager storageDataManager;
+ // use LocalWorkspaceDataManagerStub, otherwise JVM will use save(ItemStateChangesLog changes) instead of
+ // VersionableWorkspaceDataManager.save(CompositeChangesLog changesLog)
+ private LocalWorkspaceDataManagerStub storageDataManager;
protected static Log log = ExoLogger.getLogger("jcr.TransactionableDataManager");
@@ -60,17 +63,17 @@
{
super();
this.storageDataManager = dataManager;
-
+
// TODO EXOJCR-272
-// try
-// {
-// this.storageDataManager = new LocalWorkspaceStorageDataManagerProxy(dataManager, session.getValueFactory());
-// }
-// catch (Exception e1)
-// {
-// String infoString = "[Error of read value factory: " + e1.getMessage() + "]";
-// throw new RepositoryException(infoString);
-// }
+ // try
+ // {
+ // this.storageDataManager = new LocalWorkspaceStorageDataManagerProxy(dataManager, session.getValueFactory());
+ // }
+ // catch (Exception e1)
+ // {
+ // String infoString = "[Error of read value factory: " + e1.getMessage() + "]";
+ // throw new RepositoryException(infoString);
+ // }
}
// --------------- ItemDataConsumer --------
@@ -125,7 +128,7 @@
throw new InvalidItemStateException("Node's child nodes were changed in another Transaction "
+ parent.getQPath().getAsString());
}
-
+
return childsCount;
}
else
@@ -281,12 +284,19 @@
PlainChangesLog statesLog = (PlainChangesLog)changes;
if (log.isDebugEnabled())
+ {
log.debug("save() " + this + " txStarted: " + txStarted() + "\n====== Changes ======\n"
+ (statesLog != null ? "\n" + statesLog.dump() : "[NULL]") + "=====================");
+ }
+
if (txStarted())
+ {
transactionLog.addLog(statesLog);
+ }
else
+ {
storageDataManager.save(new TransactionChangesLog(statesLog));
+ }
}
16 years, 7 months
exo-jcr SVN: r1001 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: xml/importing and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2009-12-11 05:27:59 -0500 (Fri, 11 Dec 2009)
New Revision: 1001
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java
Log:
EXOJCR-300: fix
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java 2009-12-11 09:13:48 UTC (rev 1000)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java 2009-12-11 10:27:59 UTC (rev 1001)
@@ -147,8 +147,8 @@
public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException
{
final List<NodeData> nodes = persistentManager.getChildNodesData(parent);
- for (NodeData node : nodes)
- initACL(parent, node);
+ for (int i = 0; i < nodes.size(); i++)
+ nodes.set(i, (NodeData)initACL(parent, nodes.get(i)));
return nodes;
}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-11 09:13:48 UTC (rev 1000)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-11 10:27:59 UTC (rev 1001)
@@ -396,7 +396,7 @@
protected PlainChangesLogImpl save(PlainChangesLog changesLog) throws InvalidItemStateException,
RepositoryException, IOException
- { //LOG.info(changesLog.dump())
+ { //LOG.info(changesLog.dump())
// copy state
PlainChangesLogImpl newLog =
new PlainChangesLogImpl(new ArrayList<ItemState>(), changesLog.getSessionId(), changesLog.getEventType(),
@@ -437,27 +437,35 @@
List<ValueData> values = new ArrayList<ValueData>();
for (ValueData vd : prevData.getValues())
{
- if (vd.isByteArray())
+ if (vd instanceof TransientValueData)
{
- values.add(new ByteArrayPersistedValueData(vd.getAsByteArray(), vd.getOrderNumber()));
+
+ if (vd.isByteArray())
+ {
+ values.add(new ByteArrayPersistedValueData(vd.getAsByteArray(), vd.getOrderNumber()));
+ }
+ else
+ {
+ // TODO ask dest file from VS provider, can be null after
+ // TODO what if JDBC spool used, i.e. without VS = storage will setPersistedFile()
+ // TODO for JBC case, the storage connection will evict the replicated Value to read it from the DB
+ File destFile = null;
+
+ TransientValueData tvd = (TransientValueData)vd;
+ // TODO review TransientValueData logic about spool file and stream
+ values.add(new StreamPersistedValueData(destFile, tvd.getSpoolFile(),
+ tvd.getSpoolFile() == null ? tvd.getAsStream(false) : null, vd.getOrderNumber()));
+
+ // {
+ // throw new RepositoryException(
+ // "Unexpected stream based ValueData implementaion on persistent level, only TransientValueData or PersistedValueData allowed. "
+ // + vd.getClass());
+ // }
+ }
}
else
{
- // TODO ask dest file from VS provider, can be null after
- // TODO what if JDBC spool used, i.e. without VS = storage will setPersistedFile()
- // TODO for JBC case, the storage connection will evict the replicated Value to read it from the DB
- File destFile = null;
-
- TransientValueData tvd = (TransientValueData)vd;
- // TODO review TransientValueData logic about spool file and stream
- values.add(new StreamPersistedValueData(destFile, tvd.getSpoolFile(),
- tvd.getSpoolFile() == null ? tvd.getAsStream(false) : null, vd.getOrderNumber()));
-
- // {
- // throw new RepositoryException(
- // "Unexpected stream based ValueData implementaion on persistent level, only TransientValueData or PersistedValueData allowed. "
- // + vd.getClass());
- // }
+ values.add(vd);
}
}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2009-12-11 09:13:48 UTC (rev 1000)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/BaseXmlImporter.java 2009-12-11 10:27:59 UTC (rev 1001)
@@ -580,7 +580,7 @@
case ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING :
removeExisted(sameUuidItem);
ItemData parentOfsameUuidItem = dataConsumer.getItemData(sameUuidItem.getParentIdentifier());
- tree.push(ImportNodeData.createCopy((TransientNodeData)parentOfsameUuidItem));
+ tree.push(ImportNodeData.createCopy((NodeData)parentOfsameUuidItem));
break;
case ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW :
// If an incoming referenceable node has the same UUID as a node
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java 2009-12-11 09:13:48 UTC (rev 1000)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java 2009-12-11 10:27:59 UTC (rev 1001)
@@ -22,6 +22,7 @@
import org.exoplatform.services.jcr.core.nodetype.NodeTypeData;
import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.ItemData;
+import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
import org.exoplatform.services.log.ExoLogger;
@@ -325,7 +326,7 @@
this.versionHistoryIdentifier = versionHistoryIdentifier;
}
- public static ImportNodeData createCopy(TransientNodeData source)
+ public static ImportNodeData createCopy(NodeData source)
{
return new ImportNodeData(source.getQPath(), source.getIdentifier(), source.getPersistedVersion(), source
.getPrimaryTypeName(), source.getMixinTypeNames(), source.getOrderNumber(), source.getParentIdentifier(),
16 years, 7 months
exo-jcr SVN: r1000 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/dataflow/persistent and 1 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-12-11 04:13:48 -0500 (Fri, 11 Dec 2009)
New Revision: 1000
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/ValueData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
Log:
EXOJCR-274 rework of BLOBs processing on save
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/ValueData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/ValueData.java 2009-12-11 09:05:22 UTC (rev 999)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/datamodel/ValueData.java 2009-12-11 09:13:48 UTC (rev 1000)
@@ -65,7 +65,7 @@
byte[] getAsByteArray() throws IllegalStateException, IOException;
/**
- * Renders this value data as stream of bytes NOTE: client is responsible for closing this stream,
+ * Renders this value data as stream of bytes. <br/>NOTE: client is responsible for closing this stream,
* else IllegalStateException occurs in close().
*
* @return InputStream, this value data as stream of bytes
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2009-12-11 09:05:22 UTC (rev 999)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2009-12-11 09:13:48 UTC (rev 1000)
@@ -54,16 +54,49 @@
this.stream = stream;
}
+ /**
+ * Return original data stream or null. <br/>
+ * For transport from non-spooled TransientValueData to persistent layer.<br/>
+ * WARN: after the stream will be consumed it will not contains data anymore.
+ *
+ * @return InputStream data stream or null
+ * @throws IOException if error occurs
+ */
public InputStream getStream() throws IOException
{
+ // if (stream != null)
+ // {
+ // return stream;
+ // }
+ // else if (tempFile != null)
+ // {
+ // return new FileInputStream(tempFile);
+ // }
+ // else
+ // {
+ // return super.getAsStream();
+ // }
+
return stream;
}
- public File getTempFile() throws IOException
+ /**
+ * Return temp file or null. For transport from spooled TransientValueData to persistent layer. <br/>
+ * WARN: after the save the temp file will be removed. So, temp file actual only during the save from transient state.
+ *
+ * @return File temporary file or null
+ */
+ public File getTempFile()
{
return tempFile;
}
+ /**
+ * Sets persistent file. Will reset (null) temp file and stream. This method should be called only from
+ * persistent layer (Value storage).
+ *
+ * @param file File
+ */
public void setPersistedFile(File file)
{
this.file = file;
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2009-12-11 09:05:22 UTC (rev 999)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2009-12-11 09:13:48 UTC (rev 1000)
@@ -132,30 +132,43 @@
else
{
// stream Value
- File tempFile;
- if ((tempFile = ((StreamPersistedValueData)value).getTempFile()) != null)
+ StreamPersistedValueData streamed = (StreamPersistedValueData)value;
+ if (streamed.isPersisted())
{
- // it's spooled Value, try move its file to VS
- if (!tempFile.renameTo(file))
+ // already persisted in another Value, copy it to this Value
+ // TODO should not occurs!
+ LOG.warn("File based persisted ValueData on save: " + streamed.getFile().getAbsolutePath() + " -> "
+ + file.getAbsoluteFile());
+ copyClose(streamed.getAsStream(), new FileOutputStream(file));
+ }
+ else
+ {
+ File tempFile;
+ if ((tempFile = streamed.getTempFile()) != null)
{
- // not succeeded - copy bytes
- if (LOG.isDebugEnabled())
+ // it's spooled Value, try move its file to VS
+ if (!tempFile.renameTo(file))
{
- LOG
- .debug("Value spool file move (rename) to Values Storage is not succeeded. Trying bytes copy. Spool file: "
- + tempFile.getAbsolutePath() + ". Destination: " + file.getAbsolutePath());
+ // not succeeded - copy bytes
+ if (LOG.isDebugEnabled())
+ {
+ LOG
+ .debug("Value spool file move (rename) to Values Storage is not succeeded. Trying bytes copy. Spool file: "
+ + tempFile.getAbsolutePath() + ". Destination: " + file.getAbsolutePath());
+ }
+
+ copyClose(new FileInputStream(tempFile), new FileOutputStream(file));
}
-
- copyClose(new FileInputStream(tempFile), new FileOutputStream(file));
}
+ else
+ {
+ // not spooled, use InputStream
+ copyClose(streamed.getStream(), new FileOutputStream(file));
+ }
+
+ // map this transient Value to file in VS
+ streamed.setPersistedFile(file);
}
- else
- {
- // not spooled, use InputStream
- copyClose(((StreamPersistedValueData)value).getStream(), new FileOutputStream(file));
- }
- // map this transient Value to file in VS
- ((StreamPersistedValueData)value).setPersistedFile(file);
}
}
@@ -178,11 +191,23 @@
}
else
{
- InputStream in = ((StreamPersistedValueData)value).getStream();
- if (in == null)
+ InputStream in;
+ StreamPersistedValueData streamed = (StreamPersistedValueData)value;
+ if (streamed.isPersisted())
{
- in = ((StreamPersistedValueData)value).getAsStream();
+ // already persisted in another Value, copy it to this Value
+ // TODO should not occurs!
+ LOG.warn("File based persisted ValueData on save: " + streamed.getFile().getAbsolutePath() + " -> CAS");
+ in = streamed.getAsStream();
}
+ else
+ {
+ in = streamed.getStream();
+ if (in == null)
+ {
+ in = new FileInputStream(streamed.getTempFile());
+ }
+ }
try
{
16 years, 7 months
exo-jcr SVN: r999 - kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2009-12-11 04:05:22 -0500 (Fri, 11 Dec 2009)
New Revision: 999
Modified:
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
Log:
EXOJCR-296: Apply some remarks after the work done for KER-119
Fix issues related to KER-125
Enforce to use 127.0.0.1 to prevent potential issues with the firewall
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2009-12-11 08:51:56 UTC (rev 998)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2009-12-11 09:05:22 UTC (rev 999)
@@ -46,6 +46,16 @@
<name>java.net.preferIPv4Stack</name>
<value>true</value>
</property>
+ <!-- Avoid the firewall -->
+ <property>
+ <name>bind.address</name>
+ <value>127.0.0.1</value>
+ </property>
+ <property>
+ <name>jgroups.stack</name>
+ <value>udp</value>
+ </property>
+
</systemProperties>
</configuration>
</plugin>
16 years, 7 months
exo-jcr SVN: r998 - kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2009-12-11 03:51:56 -0500 (Fri, 11 Dec 2009)
New Revision: 998
Modified:
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
Log:
EXOJCR-296: Apply some remarks after the work done for KER-119
Fix issues related to KER-125
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2009-12-11 08:36:28 UTC (rev 997)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2009-12-11 08:51:56 UTC (rev 998)
@@ -1,36 +1,54 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>kernel-parent</artifactId>
- <version>2.2.0-Beta05-SNAPSHOT</version>
- </parent>
+ <parent>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>kernel-parent</artifactId>
+ <version>2.2.0-Beta05-SNAPSHOT</version>
+ </parent>
- <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
- <name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
- <description>JBoss Cache Implementation for the Cache Service</description>
+ <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+ <name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
+ <description>JBoss Cache Implementation for the Cache Service</description>
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.tool</groupId>
- <artifactId>exo.tool.framework.junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.cache</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.cache</groupId>
- <artifactId>jbosscache-core</artifactId>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.tool</groupId>
+ <artifactId>exo.tool.framework.junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.cache</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <!-- We add this system property due to some incompatibility between IPv6 and
+ some JVM of Linux distributions such as Ubuntu and Fedora-->
+ <property>
+ <name>java.net.preferIPv4Stack</name>
+ <value>true</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
16 years, 7 months
exo-jcr SVN: r997 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/xml/exporting and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2009-12-11 03:36:28 -0500 (Fri, 11 Dec 2009)
New Revision: 997
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
Log:
EXOJCR-300: test fix
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2009-12-10 20:05:35 UTC (rev 996)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2009-12-11 08:36:28 UTC (rev 997)
@@ -179,6 +179,11 @@
else
{
InputStream in = ((StreamPersistedValueData)value).getStream();
+ if (in == null)
+ {
+ in = ((StreamPersistedValueData)value).getAsStream();
+ }
+
try
{
copy(in, out);
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java 2009-12-10 20:05:35 UTC (rev 996)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/BaseXmlExporter.java 2009-12-11 08:36:28 UTC (rev 997)
@@ -269,7 +269,7 @@
// TODO namespace mapping for values
try
{
- charValue = systemValueFactory.loadValue((TransientValueData)data, type).getString();
+ charValue = systemValueFactory.loadValue(data, type).getString();
}
catch (ValueFormatException e)
{
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2009-12-10 20:05:35 UTC (rev 996)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2009-12-11 08:36:28 UTC (rev 997)
@@ -20,8 +20,9 @@
import org.exoplatform.services.jcr.JcrImplBaseTest;
import org.exoplatform.services.jcr.datamodel.ValueData;
-import org.exoplatform.services.jcr.impl.dataflow.TesterTransientValueData;
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.FileStreamPersistedValueData;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData;
import org.exoplatform.services.jcr.impl.storage.value.cas.RecordAlreadyExistsException;
import org.exoplatform.services.jcr.impl.storage.value.cas.RecordNotFoundException;
import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAddressStorage;
@@ -57,15 +58,11 @@
protected File testFile;
- protected TesterTransientValueData testerTransientValueData;
-
@Override
public void setUp() throws Exception
{
super.setUp();
- testerTransientValueData = new TesterTransientValueData();
-
if (fileCleaner == null)
fileCleaner = new FileCleaner();
@@ -115,7 +112,7 @@
FileIOChannel fch = openCASChannel(digestType);
String propertyId = IdGenerator.generate();
- ValueData value = testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0);
+ ValueData value = new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0);
fch.write(propertyId, value);
fch.commit();
@@ -146,7 +143,7 @@
// prepare
String propertyId = IdGenerator.generate();
- ValueData value = testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0);
+ ValueData value = new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0);
fch.write(propertyId, value);
fch.commit();
@@ -155,8 +152,7 @@
try
{
fch = openCASChannel(digestType);
- fch.write(new String(propertyId), testerTransientValueData.getTransientValueData(
- new FileInputStream(testFile), 0));
+ fch.write(new String(propertyId), new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0));
fch.commit();
fail("RecordAlreadyExistsException should be thrown, record exists");
@@ -186,10 +182,10 @@
String propertyId = IdGenerator.generate();
try
{
- ValueData value = testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0);
+ ValueData value = new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0);
fch.write(propertyId, value);
fch.delete(propertyId);
- fch.write(propertyId, testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0));
+ fch.write(propertyId, new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0));
fch.commit();
// long initialSize = calcDirSize(rootDir);
@@ -213,7 +209,7 @@
FileIOChannel fch = openCASChannel(digestType);
String propertyId = IdGenerator.generate();
- ValueData value = testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0);
+ ValueData value = new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0);
fch.write(propertyId, value);
fch.commit();
@@ -236,7 +232,7 @@
FileIOChannel fch = openCASChannel(digestType);
String propertyId = IdGenerator.generate();
- ValueData value = testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0);
+ ValueData value = new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0);
fch.write(propertyId, value);
fch.commit();
@@ -320,7 +316,7 @@
for (int i = 0; i < 20; i++)
{
- fch.write(propertyId, testerTransientValueData.getTransientValueData(new FileInputStream(testFile), i));
+ fch.write(propertyId, new StreamPersistedValueData(null, null, new FileInputStream(testFile), i));
}
fch.commit();
@@ -350,7 +346,7 @@
{
File f = createBLOBTempFile(300);
addedSize += f.length();
- fch.write(propertyId, testerTransientValueData.getTransientValueData(new FileInputStream(f), i));
+ fch.write(propertyId, new StreamPersistedValueData(null, null, new FileInputStream(f), i));
}
fch.commit();
@@ -379,7 +375,7 @@
propertyId = IdGenerator.generate();
FileIOChannel fch = openCASChannel(digestType);
- fch.write(propertyId, testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0));
+ fch.write(propertyId, new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0));
fch.commit();
}
@@ -408,7 +404,7 @@
addedSize += f.length();
FileIOChannel fch = openCASChannel(digestType);
- fch.write(propertyId, testerTransientValueData.getTransientValueData(new FileInputStream(f), 0));
+ fch.write(propertyId, new StreamPersistedValueData(null, null, new FileInputStream(f), 0));
fch.commit();
}
@@ -438,7 +434,7 @@
propertyId = pid;
FileIOChannel fch = openCASChannel(digestType);
- fch.write(pid, testerTransientValueData.getTransientValueData(new FileInputStream(testFile), 0));
+ fch.write(pid, new StreamPersistedValueData(null, null, new FileInputStream(testFile), 0));
fch.commit();
}
@@ -479,7 +475,7 @@
addedSize += (fileSize = f.length());
FileIOChannel fch = openCASChannel(digestType);
- fch.write(pid, testerTransientValueData.getTransientValueData(new FileInputStream(f), 0));
+ fch.write(pid, new StreamPersistedValueData(null, null, new FileInputStream(f), 0));
fch.commit();
}
@@ -508,7 +504,7 @@
final String property1MultivaluedId = IdGenerator.generate();
- TransientValueData sharedValue = null;
+ StreamPersistedValueData sharedValue = null;
// add multivaued property
long m1fileSize = 0;
@@ -519,7 +515,7 @@
File f = createBLOBTempFile(450);
addedSize += (m1fileSize = f.length());
- TransientValueData v = testerTransientValueData.getTransientValueData(new FileInputStream(f), i);
+ StreamPersistedValueData v = new StreamPersistedValueData(null, null, new FileInputStream(f), i);
if (i == 1)
sharedValue = v;
@@ -541,8 +537,8 @@
if (i == 2)
{
// use shared
+ sharedValue = new StreamPersistedValueData(null, null, sharedValue.getAsStream(), i);
v = sharedValue;
- sharedValue.setOrderNumber(i);
}
else
{
@@ -550,7 +546,7 @@
m2filesCount++;
File f = createBLOBTempFile(350);
addedSize += (m2fileSize = f.length()); // add size
- v = testerTransientValueData.getTransientValueData(new FileInputStream(f), i);
+ v = new StreamPersistedValueData(null, null, new FileInputStream(f), i);
}
fch.write(property2MultivaluedId, v);
}
@@ -559,7 +555,7 @@
// add some single valued properties, two new property will have shared value too
String property1Id = null;
String property2Id = null;
- sharedValue.setOrderNumber(0);
+ sharedValue = new StreamPersistedValueData(null, null, sharedValue.getAsStream(), 0);
for (int i = 0; i < 10; i++)
{
String pid = IdGenerator.generate();
@@ -578,7 +574,7 @@
{
File f = createBLOBTempFile(425);
addedSize += f.length();
- v = testerTransientValueData.getTransientValueData(new FileInputStream(f), 0);
+ v = new StreamPersistedValueData(null, null, new FileInputStream(f), 0);
}
FileIOChannel vfch = openCASChannel(digestType);
vfch.write(pid, v);
16 years, 7 months
exo-jcr SVN: r996 - in kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src: test/java/org/exoplatform/services/cache/impl/jboss and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2009-12-10 15:05:35 -0500 (Thu, 10 Dec 2009)
New Revision: 996
Modified:
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java
kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
Log:
EXOJCR-296: Apply some remarks after the work done for KER-119
Fix issues related to KER-125
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2009-12-10 17:08:23 UTC (rev 995)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2009-12-10 20:05:35 UTC (rev 996)
@@ -18,12 +18,6 @@
*/
package org.exoplatform.services.cache.impl.jboss;
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
@@ -42,6 +36,12 @@
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.config.Configuration.CacheMode;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
/**
* This class is the JBoss Cache implementation of the {@link org.exoplatform.services.cache.ExoCacheFactory}
* Created by The eXo Platform SAS
@@ -112,13 +112,13 @@
* 2. If no specific location has been defined, we use the default configuration which is
* "${CACHE_CONFIG_TEMPLATE_KEY}"
*/
- public ExoCache createCache(ExoCacheConfig config) throws ExoCacheInitException
+ public ExoCache<Serializable, Object> createCache(ExoCacheConfig config) throws ExoCacheInitException
{
final String region = config.getName();
final String customConfig = mappingCacheNameConfig.get(region);
final Cache<Serializable, Object> cache;
final CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
- final ExoCache eXoCache;
+ final ExoCache<Serializable, Object> eXoCache;
try
{
if (customConfig != null)
@@ -230,7 +230,13 @@
{
final Configuration config = cache.getConfiguration();
// Reset the eviction policies
- final EvictionConfig evictionConfig = config.getEvictionConfig();
+ EvictionConfig evictionConfig = config.getEvictionConfig();
+ if (evictionConfig == null)
+ {
+ // If not eviction config exists, we create an empty one
+ evictionConfig = new EvictionConfig();
+ config.setEvictionConfig(evictionConfig);
+ }
evictionConfig.setEvictionRegionConfigs(new LinkedList<EvictionRegionConfig>());
// Rename the cluster name
String clusterName = config.getClusterName();
Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
===================================================================
--- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2009-12-10 17:08:23 UTC (rev 995)
+++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2009-12-10 20:05:35 UTC (rev 996)
@@ -232,6 +232,7 @@
@SuppressWarnings("unchecked")
public void testDistributedCache() throws Exception
{
+ System.out.println("WARNING: For Linux distributions the following JVM parameter must be set to true, java.net.preferIPv4Stack = " + System.getProperty("java.net.preferIPv4Stack"));
ExoCacheConfig config = new ExoCacheConfig();
config.setName("MyCacheDistributed");
config.setMaxSize(5);
@@ -404,7 +405,7 @@
long time = System.currentTimeMillis();
final ExoCache<Serializable, Object> cache = service.getCacheInstance("test-multi-threading");
final int totalElement = 100;
- final int totalTimes = 100;
+ final int totalTimes = 20;
int reader = 20;
int writer = 10;
int remover = 5;
16 years, 7 months
exo-jcr SVN: r995 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2009-12-10 12:08:23 -0500 (Thu, 10 Dec 2009)
New Revision: 995
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
Log:
EXOJCR-274 connection final
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-10 17:08:09 UTC (rev 994)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-10 17:08:23 UTC (rev 995)
@@ -219,7 +219,7 @@
throw new ReadOnlyWorkspaceException("Workspace container '" + dataContainer.getName() + "' is read-only.");
}
- ChangesLogPersister persister = new ChangesLogPersister();
+ final ChangesLogPersister persister = new ChangesLogPersister();
// whole log will be reconstructed with persisted data
ItemStateChangesLog persistedLog;
@@ -396,7 +396,7 @@
protected PlainChangesLogImpl save(PlainChangesLog changesLog) throws InvalidItemStateException,
RepositoryException, IOException
- {
+ { //LOG.info(changesLog.dump())
// copy state
PlainChangesLogImpl newLog =
new PlainChangesLogImpl(new ArrayList<ItemState>(), changesLog.getSessionId(), changesLog.getEventType(),
@@ -509,7 +509,7 @@
}
else if (itemState.isDeleted())
{
- doDelete(data, conn);
+ doDelete(data, conn); //conn.getChildNodesData((NodeData)conn.getItemData("7986bb30c0a800cb1610f7a03958e641"))
}
else if (itemState.isRenamed())
{
@@ -525,7 +525,6 @@
}
return newLog;
}
-
}
/**
16 years, 7 months