exo-jcr SVN: r668 - in jcr/branches/1.12.0-JBC/component/core/src/test: resources/conf/standalone and 1 other directory.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2009-11-15 09:29:46 -0500 (Sun, 15 Nov 2009)
New Revision: 668
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/CacheLoaderParameter.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyInterceptor.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InjectionTest.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InterceptorParameter.java
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-custom-interceptor.xml
Log:
EXOJCR-199 : injection test
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/CacheLoaderParameter.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/CacheLoaderParameter.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/CacheLoaderParameter.java 2009-11-15 14:29:46 UTC (rev 668)
@@ -0,0 +1,31 @@
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import org.jboss.cache.factories.annotations.NonVolatile;
+
+@NonVolatile
+public class CacheLoaderParameter
+{
+ private boolean injected = false;
+
+ public CacheLoaderParameter()
+ {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the injected
+ */
+ public boolean isInjected()
+ {
+ return injected;
+ }
+
+ /**
+ * @param injected the injected to set
+ */
+ public void setInjected(boolean injected)
+ {
+ this.injected = injected;
+ }
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/CacheLoaderParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyCacheLoader.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyCacheLoader.java 2009-11-15 14:29:46 UTC (rev 668)
@@ -0,0 +1,86 @@
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.loader.AbstractCacheLoader;
+
+import java.util.Map;
+import java.util.Set;
+
+public class DummyCacheLoader extends AbstractCacheLoader
+{
+ private IndividualCacheLoaderConfig config;
+
+ private CacheLoaderParameter dummyParameter;
+
+ public boolean exists(Fqn name) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public Map<Object, Object> get(Fqn name) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<?> getChildrenNames(Fqn fqn) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IndividualCacheLoaderConfig getConfig()
+ {
+ return config;
+ }
+
+ @Inject
+ public void inject(CacheLoaderParameter dummyParameter) throws RepositoryConfigurationException
+ {
+ this.dummyParameter = dummyParameter;
+ //set injected flag
+ dummyParameter.setInjected(true);
+ }
+
+ public void put(Fqn name, Map<Object, Object> attributes) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Object put(Fqn name, Object key, Object value) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void remove(Fqn fqn) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public Object remove(Fqn fqn, Object key) throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void removeData(Fqn fqn) throws Exception
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setConfig(IndividualCacheLoaderConfig config)
+ {
+ this.config = config;
+
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyCacheLoader.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyInterceptor.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyInterceptor.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyInterceptor.java 2009-11-15 14:29:46 UTC (rev 668)
@@ -0,0 +1,34 @@
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
+import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
+
+public class DummyInterceptor extends CommandInterceptor
+{
+
+ private InterceptorParameter dummyParameter;
+
+ public DummyInterceptor()
+ {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the dummyParameter
+ */
+ public InterceptorParameter getDummyParameter()
+ {
+ return dummyParameter;
+ }
+
+ @Inject
+ public void inject(InterceptorParameter dummyParameter) throws RepositoryConfigurationException
+ {
+ this.dummyParameter = dummyParameter;
+ //set injected flag
+ dummyParameter.setInjected(true);
+ }
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/DummyInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InjectionTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InjectionTest.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InjectionTest.java 2009-11-15 14:29:46 UTC (rev 668)
@@ -0,0 +1,47 @@
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import junit.framework.TestCase;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
+
+import java.io.Serializable;
+
+public class InjectionTest extends TestCase
+{
+ /**
+ * Test injection of run time objects
+ * @throws Exception
+ */
+ public void testCustomInterceptorInjection() throws Exception
+ {
+ CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
+
+ // create cache
+ Cache<Serializable, Object> cache =
+ factory.createCache(InjectionTest.class.getResourceAsStream("/conf/standalone/test-custom-interceptor.xml"), false);
+ //create interceptor parameter
+ InterceptorParameter interceptorParameter = new InterceptorParameter();
+ assertFalse(interceptorParameter.isInjected());
+ //create cache loader parameter
+ CacheLoaderParameter cacheLoaderParameter = new CacheLoaderParameter();
+ assertFalse(cacheLoaderParameter.isInjected());
+
+
+ //register in component registry
+ ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().registerComponent(interceptorParameter,
+ InterceptorParameter.class);
+ ((CacheSPI<Serializable, Object>)cache).getComponentRegistry().registerComponent(cacheLoaderParameter,
+ CacheLoaderParameter.class);
+
+ cache.create();
+ cache.start();
+
+ //expect what all parameter woud be injected
+ assertTrue(cacheLoaderParameter.isInjected());
+ assertTrue(interceptorParameter.isInjected());
+
+ }
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InjectionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InterceptorParameter.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InterceptorParameter.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InterceptorParameter.java 2009-11-15 14:29:46 UTC (rev 668)
@@ -0,0 +1,31 @@
+package org.exoplatform.services.jcr.impl.storage.jbosscache;
+
+import org.jboss.cache.factories.annotations.NonVolatile;
+
+@NonVolatile
+public class InterceptorParameter
+{
+ private boolean injected = false;
+
+ public InterceptorParameter()
+ {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return the injected
+ */
+ public boolean isInjected()
+ {
+ return injected;
+ }
+
+ /**
+ * @param injected the injected to set
+ */
+ public void setInjected(boolean injected)
+ {
+ this.injected = injected;
+ }
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/InterceptorParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-custom-interceptor.xml
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-custom-interceptor.xml (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-custom-interceptor.xml 2009-11-15 14:29:46 UTC (rev 668)
@@ -0,0 +1,41 @@
+<?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" />
+ <loaders passivation="false" shared="false">
+
+ <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.DummyCacheLoader" async="false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ </properties>
+ </loader>
+ </loaders>
+ <customInterceptors>
+ <interceptor after="org.jboss.cache.interceptors.CacheStoreInterceptor"
+ class="org.exoplatform.services.jcr.impl.storage.jbosscache.DummyInterceptor" >
+ </interceptor>
+ </customInterceptors>
+ <!-- Enable batching -->
+ <invocationBatching enabled="true"/>
+</jbosscache>
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-custom-interceptor.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 8 months
exo-jcr SVN: r667 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-13 12:31:00 -0500 (Fri, 13 Nov 2009)
New Revision: 667
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-201 : The JDBCCacheLoader was changed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 17:17:55 UTC (rev 666)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 17:31:00 UTC (rev 667)
@@ -85,6 +85,7 @@
*/
public void put(List<Modification> modifications) throws Exception
{
+ LOG.info("Modifications list size = " + modifications.size());
// Prepare modifications list.
// Will be added oldValueData to modification for UPDATE.
prepareModifications(modifications);
@@ -95,7 +96,6 @@
{
for (Modification m : modifications)
{
- LOG.info(m);
switch (m.getType())
{
case PUT_DATA:
16 years, 8 months
exo-jcr SVN: r666 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-13 12:17:55 -0500 (Fri, 13 Nov 2009)
New Revision: 666
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-201 : The JDBCCacheLoader was changed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 16:54:22 UTC (rev 665)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 17:17:55 UTC (rev 666)
@@ -18,14 +18,20 @@
*/
package org.exoplatform.services.jcr.impl.storage.jbosscache;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+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.IllegalNameException;
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.QPathEntry;
-import org.exoplatform.services.jcr.impl.Constants;
-import org.exoplatform.services.jcr.impl.storage.jbosscache.ModificationEx.JCROperaionType;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnection;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
@@ -39,14 +45,6 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.loader.AbstractCacheLoader;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jcr.RepositoryException;
-
/**
* Created by The eXo Platform SAS.
*
@@ -244,51 +242,56 @@
*/
private void prepareModifications(List<Modification> modifications) throws RepositoryException
{
-
JDBCStorageConnection jdbcConnection = (JDBCStorageConnection) dataContainer.openConnection();
- for (int i = 0; i < modifications.size(); i++)
- {
- Modification m = modifications.get(i);
- if (m.getType() == ModificationType.PUT_KEY_VALUE)
+ try {
+ for (int i = 0; i < modifications.size(); i++)
{
- ItemData itemData = null;
-
- //Check add or update node data.
- if (m.getValue() instanceof NodeData)
+ Modification m = modifications.get(i);
+ if (m.getType() == ModificationType.PUT_KEY_VALUE)
{
- NodeData nodeData = (NodeData) m.getValue();
- itemData = jdbcConnection.getItemData(nodeData.getIdentifier());
-
- // Set oldValueData for update node.
- if (itemData != null)
- modifications.get(i).setOldValue(itemData);
+ ItemData itemData = null;
+
+ //Check add or update node data.
+ if (m.getValue() instanceof NodeData)
+ {
+ NodeData nodeData = (NodeData) m.getValue();
+ itemData = jdbcConnection.getItemData(nodeData.getIdentifier());
+
+ // Set oldValueData for update node.
+ if (itemData != null)
+ modifications.get(i).setOldValue(itemData);
+ }
+ else if (m.getValue() instanceof PropertyData)
+ {
+ PropertyData propertyData = (PropertyData) m.getValue();
+ itemData = jdbcConnection.getItemData(propertyData.getIdentifier());
+
+ // Set oldValueData for update property.
+ if (itemData != null)
+ modifications.get(i).setOldValue(itemData);
+ }
}
- else if (m.getValue() instanceof PropertyData)
+ else if (m.getType() == ModificationType.REMOVE_NODE)
{
- PropertyData propertyData = (PropertyData) m.getValue();
- itemData = jdbcConnection.getItemData(propertyData.getIdentifier());
-
- // Set oldValueData for update property.
- if (itemData != null)
- modifications.get(i).setOldValue(itemData);
- }
- }
- else if (m.getType() == ModificationType.REMOVE_NODE)
- {
- if (m.getFqn().size() == 2
- && (m.getFqn().get(0).equals(JBossCacheStorage.NODES)
- || m.getFqn().get(0).equals(JBossCacheStorage.PROPS)))
- {
- String id = (String) m.getFqn().get(1);
- ItemData removedItemData = jdbcConnection.getItemData(id);
-
- // Set valueData for update property or node.
- if (removedItemData != null)
- modifications.get(i).setValue(removedItemData);
+ if (m.getFqn().size() == 2
+ && (m.getFqn().get(0).equals(JBossCacheStorage.NODES)
+ || m.getFqn().get(0).equals(JBossCacheStorage.PROPS)))
+ {
+ String id = (String) m.getFqn().get(1);
+ ItemData removedItemData = jdbcConnection.getItemData(id);
+
+ // Set valueData for update property or node.
+ if (removedItemData != null)
+ modifications.get(i).setValue(removedItemData);
+ }
}
}
}
+ finally
+ {
+ jdbcConnection.close();
+ }
}
protected QPathEntry[] makeNodePath(Fqn<String> nodeFqn) throws NumberFormatException, IllegalNameException
@@ -339,7 +342,7 @@
}
finally
{
- conn.close();
+ conn.close();
}
}
// /$NODES/<NODE_ID>/<SUB_NODE_NAME>
16 years, 8 months
exo-jcr SVN: r665 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-13 11:54:22 -0500 (Fri, 13 Nov 2009)
New Revision: 665
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-201 : The JBossCacheWorkspaceDataManager.java was changed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-13 15:45:47 UTC (rev 664)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-13 16:54:22 UTC (rev 665)
@@ -187,10 +187,11 @@
LOG.debug(ItemState.nameFromValue(itemState.getState()) + " " + (System.currentTimeMillis() - start)
+ "ms, " + data.getQPath().getAsString());
}
- if (thisConnection != null)
+ //TODO rainf0x
+ /*if (thisConnection != null)
thisConnection.removeSessionInfo();
if (systemConnection != null && !systemConnection.equals(thisConnection))
- systemConnection.removeSessionInfo();
+ systemConnection.removeSessionInfo();*/
}
if (thisConnection != null)
thisConnection.commit();
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 15:45:47 UTC (rev 664)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 16:54:22 UTC (rev 665)
@@ -97,6 +97,7 @@
{
for (Modification m : modifications)
{
+ LOG.info(m);
switch (m.getType())
{
case PUT_DATA:
@@ -353,8 +354,9 @@
{
NodeData parentNodeData = (NodeData) conn.getItemData((String)name.get(1));
- if (parentNodeData == null)
- throw new JDBCCacheLoaderException("The parent node with ID = " + (String)name.get(1) + " not exis, FQN = '" + name + "'.");
+ //TODO rainf0x
+ /*if (parentNodeData == null)
+ throw new JDBCCacheLoaderException("The parent node with ID = " + (String)name.get(1) + " not exis, FQN = '" + name + "'.");*/
if (parentNodeData != null)
{
16 years, 8 months
exo-jcr SVN: r664 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-11-13 10:45:47 -0500 (Fri, 13 Nov 2009)
New Revision: 664
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/monitor/
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
Log:
EXOJCR-240 org.exoplatform.services.jcr.impl.storage.jdbc.monitor package removed
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2009-11-13 15:32:27 UTC (rev 663)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2009-11-13 15:45:47 UTC (rev 664)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.jcr.impl.storage.jdbc.db;
-import org.exoplatform.services.jcr.impl.storage.jdbc.monitor.ManagedConnection;
import org.exoplatform.services.jcr.impl.util.io.FileCleaner;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
@@ -43,7 +42,29 @@
*/
public class GenericConnectionFactory implements WorkspaceStorageConnectionFactory
{
+
+ public static final String JCR_JDBC_CONNECTION_MONITOR = "org.exoplatform.jcr.monitor.jdbcMonitor";
+ public static final String PREPARE_INTREST_NAME = "PREPARE";
+
+ public static final String COMMIT_INTEREST_NAME = "COMMIT";
+
+ public static final String CLOSE_INTEREST_NAME = "CLOSE";
+
+ public static final String OPEN_INTEREST_NAME = "OPEN";
+
+ public static final String EXECUTE_INTEREST_NAME = "EXECUTE";
+
+ public static final int PREPARE_INTREST = 1;
+
+ public static final int COMMIT_INTREST = 2;
+
+ public static final int CLOSE_INTREST = 4;
+
+ public static final int OPEN_INTREST = 8;
+
+ public static final int EXECUTE_INTREST = 16;
+
protected final Log log = ExoLogger.getLogger("jcr.GenericConnectionFactory");
protected final DataSource dbDataSource;
@@ -239,7 +260,7 @@
if (readOnly) // set this feature only if it asked
conn.setReadOnly(readOnly);
- return monitorInterest == 0 ? conn : new ManagedConnection(conn, monitorInterest);
+ return monitorInterest == 0 ? conn : null;
}
catch (SQLException e)
{
@@ -264,7 +285,7 @@
*/
private void initMonitor()
{
- String monitor = System.getProperty(ManagedConnection.JCR_JDBC_CONNECTION_MONITOR);
+ String monitor = System.getProperty(JCR_JDBC_CONNECTION_MONITOR);
if (monitor != null)
{
// parse
@@ -273,14 +294,14 @@
for (String s : ints)
{
s = s.trim();
- if (s.equalsIgnoreCase(ManagedConnection.EXECUTE_INTEREST_NAME))
- interest |= ManagedConnection.EXECUTE_INTREST;
- else if (s.equalsIgnoreCase(ManagedConnection.COMMIT_INTEREST_NAME))
- interest |= ManagedConnection.COMMIT_INTREST;
- else if (s.equalsIgnoreCase(ManagedConnection.CLOSE_INTEREST_NAME))
- interest |= ManagedConnection.CLOSE_INTREST;
- else if (s.equalsIgnoreCase(ManagedConnection.OPEN_INTEREST_NAME))
- interest |= ManagedConnection.OPEN_INTREST;
+ if (s.equalsIgnoreCase(EXECUTE_INTEREST_NAME))
+ interest |= EXECUTE_INTREST;
+ else if (s.equalsIgnoreCase(COMMIT_INTEREST_NAME))
+ interest |= COMMIT_INTREST;
+ else if (s.equalsIgnoreCase(CLOSE_INTEREST_NAME))
+ interest |= CLOSE_INTREST;
+ else if (s.equalsIgnoreCase(OPEN_INTEREST_NAME))
+ interest |= OPEN_INTREST;
}
this.monitorInterest = interest;
16 years, 8 months
exo-jcr SVN: r663 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-13 10:32:27 -0500 (Fri, 13 Nov 2009)
New Revision: 663
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
Log:
EXOJCR-201 : The JBossCacheWorkspaceDataContainer.java was changed.
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-11-13 15:12:09 UTC (rev 662)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 2009-11-13 15:32:27 UTC (rev 663)
@@ -120,9 +120,11 @@
//Node<Serializable, Object> wsRoot = cacheRoot.addChild(Fqn.fromElements(repositoryName, containerName));
// prepare cache structures
+ cache.startBatch();
this.nodes = cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage.NODES));
this.properties = cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage.PROPS));
this.session = cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage.SESSION));
+ cache.endBatch(true);
}
public void start()
16 years, 8 months
exo-jcr SVN: r662 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-13 10:12:09 -0500 (Fri, 13 Nov 2009)
New Revision: 662
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml
Log:
EXOJCR-201 : The test-jcr-config.xml was changed.
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-11-13 15:01:15 UTC (rev 661)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone/test-jcr-config.xml 2009-11-13 15:12:09 UTC (rev 662)
@@ -32,7 +32,7 @@
<!-- for system storage -->
<container class="org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheWorkspaceDataContainer">
<properties>
- <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config-jdbcloader.xml" />
+ <property name="jbosscache-configuration" value="conf/standalone/test-jbosscache-config-exoloader.xml" />
<property name="source-name" value="jdbcjcr" />
<property name="dialect" value="hsqldb" />
<property name="multi-db" value="true" />
16 years, 8 months
exo-jcr SVN: r661 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-13 10:01:15 -0500 (Fri, 13 Nov 2009)
New Revision: 661
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
Log:
EXOJCR-201 : The JDBCCacheLoader was changed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:53:41 UTC (rev 660)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 15:01:15 UTC (rev 661)
@@ -163,9 +163,11 @@
modification.getFqn().get(0).equals(JBossCacheStorage.PROPS)))
{
- String identifier = (String) modification.getFqn().get(1);
-
- ItemData itemData = jdbcConnection.getItemData(identifier);
+// String identifier = (String) modification.getFqn().get(1);
+// ItemData itemData = jdbcConnection.getItemData(identifier);
+
+ // TODO the removed ItemData is setting in value in prepareModifications();
+ ItemData itemData = (ItemData) modification.getValue();
if (itemData instanceof NodeData)
jdbcConnection.delete((NodeData) itemData);
@@ -271,8 +273,7 @@
modifications.get(i).setOldValue(itemData);
}
}
- //TODO for REMOVE is not need removed ItemData
- /*else if (m.getType() == ModificationType.REMOVE_NODE)
+ else if (m.getType() == ModificationType.REMOVE_NODE)
{
if (m.getFqn().size() == 2
&& (m.getFqn().get(0).equals(JBossCacheStorage.NODES)
@@ -285,7 +286,7 @@
if (removedItemData != null)
modifications.get(i).setValue(removedItemData);
}
- }*/
+ }
}
}
16 years, 8 months
exo-jcr SVN: r660 - 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: areshetnyak
Date: 2009-11-13 09:53:41 -0500 (Fri, 13 Nov 2009)
New Revision: 660
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
Log:
EXOJCR-201 : The JDBCCacheLoader was changed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:18:36 UTC (rev 659)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:53:41 UTC (rev 660)
@@ -118,6 +118,7 @@
case REMOVE_NODE:
doRemove(m, jdbcConnection);
+
break;
case MOVE:
break;
@@ -158,8 +159,8 @@
throws IllegalStateException, RepositoryException
{
- if (modification.getFqn().get(0).equals(JBossCacheStorage.NODES) ||
- modification.getFqn().get(0).equals(JBossCacheStorage.PROPS))
+ if ( modification.getFqn().size() == 2 && (modification.getFqn().get(0).equals(JBossCacheStorage.NODES) ||
+ modification.getFqn().get(0).equals(JBossCacheStorage.PROPS)))
{
String identifier = (String) modification.getFqn().get(1);
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 14:18:36 UTC (rev 659)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 14:53:41 UTC (rev 660)
@@ -455,10 +455,13 @@
// prepare
WorkspaceStorageConnection conn = persistentContainer.openConnection();
-
+ QPath baseNodePath = QPath.makeChildPath(Constants.ROOT_PATH, InternalQName.parse("[]baseNode"));
+ String baseNodeId = IdGenerator.generate();
+ addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID);
+
+ // add child nodes [node1]
String nodeId = IdGenerator.generate();
- addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQName.parse("[]node")), nodeId,
- Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID);
+ addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.parse("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId);
conn.commit();
List<Modification> modifications = new ArrayList<Modification>();
16 years, 8 months
exo-jcr SVN: r659 - in ws/trunk: exo.ws.commons and 6 other directories.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-11-13 09:18:36 -0500 (Fri, 13 Nov 2009)
New Revision: 659
Modified:
ws/trunk/exo.ws.commons/pom.xml
ws/trunk/exo.ws.frameworks.json/pom.xml
ws/trunk/exo.ws.frameworks.servlet/pom.xml
ws/trunk/exo.ws.rest.core/pom.xml
ws/trunk/exo.ws.rest.ext/pom.xml
ws/trunk/exo.ws.testframework/pom.xml
ws/trunk/packaging/module/pom.xml
ws/trunk/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: ws/trunk/exo.ws.commons/pom.xml
===================================================================
--- ws/trunk/exo.ws.commons/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/exo.ws.commons/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.commons</artifactId>
Modified: ws/trunk/exo.ws.frameworks.json/pom.xml
===================================================================
--- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.frameworks.json</artifactId>
Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml
===================================================================
--- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.frameworks.servlet</artifactId>
Modified: ws/trunk/exo.ws.rest.core/pom.xml
===================================================================
--- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.rest.core</artifactId>
Modified: ws/trunk/exo.ws.rest.ext/pom.xml
===================================================================
--- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.rest.ext</artifactId>
Modified: ws/trunk/exo.ws.testframework/pom.xml
===================================================================
--- ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.testframework</artifactId>
Modified: ws/trunk/packaging/module/pom.xml
===================================================================
--- ws/trunk/packaging/module/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/packaging/module/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: ws/trunk/pom.xml
===================================================================
--- ws/trunk/pom.xml 2009-11-13 14:17:52 UTC (rev 658)
+++ ws/trunk/pom.xml 2009-11-13 14:18:36 UTC (rev 659)
@@ -30,15 +30,15 @@
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03</version>
+ <version>2.1.0-Beta04-SNAPSHOT</version>
<packaging>pom</packaging>
<name>eXo WS</name>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2.1.0-Beta03</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/tags/2.1.0-Beta03</developerConnection>
- <url>http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.0-Beta03</url>
+ <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>
</scm>
<properties>
16 years, 8 months