exo-jcr SVN: r1324 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-01-08 07:58:59 -0500 (Fri, 08 Jan 2010)
New Revision: 1324
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java
Log:
EXOJCR-371: added few missing cache.commitTransaction()
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java 2010-01-08 12:38:14 UTC (rev 1323)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java 2010-01-08 12:58:59 UTC (rev 1324)
@@ -343,6 +343,7 @@
properties1.add(propertyData11);
properties1.add(propertyData12);
cache.addChildProperties(nodeData1, properties1);
+ cache.commitTransaction();
}
catch (Exception e)
{
@@ -435,6 +436,7 @@
properties1.add(propertyData11);
properties1.add(propertyData12);
cache.addChildProperties(nodeData1, properties1);
+ cache.commitTransaction();
}
catch (Exception e)
{
@@ -473,7 +475,9 @@
assertEquals("Cached child properties count is wrong", cache.getChildProperties(nodeData2).size(), 2);
// remove
+ cache.beginTransaction();
cache.remove(propertyData12);
+ cache.commitTransaction();
// check
assertEquals("Cached child property " + propertyData11.getQPath().getAsString() + " is not equals", cache.get(
@@ -546,6 +550,7 @@
// remove
cache.remove(nodeData3); // remove node3 and its childs (31, 32)
+ cache.commitTransaction();
}
catch (Exception e)
{
@@ -583,6 +588,7 @@
// remove
cache.remove(nodeData2); // remove node2 and its childs (21, 22)
+ cache.commitTransaction();
}
catch (Exception e)
{
@@ -634,6 +640,7 @@
chlog.add(ItemState.createDeletedState(nodeData2));
// cache.remove(nodeData2); // remove node2 and its childs and properties (21, 22)
cache.onSaveItems(chlog);
+ cache.commitTransaction();
}
catch (Exception e)
{
16 years, 4 months
exo-jcr SVN: r1323 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main: java/org/exoplatform/services/jcr/impl/core and 1 other directories.
by do-not-reply@jboss.org
Author: pnedonosko
Date: 2010-01-08 07:38:14 -0500 (Fri, 08 Jan 2010)
New Revision: 1323
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/WorkspaceEntry.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/resources/binding.xml
Log:
EXOJCR-338 lazy load for childs items with thresold parameter (100 default).
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/WorkspaceEntry.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/WorkspaceEntry.java 2010-01-08 12:03:33 UTC (rev 1322)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/WorkspaceEntry.java 2010-01-08 12:38:14 UTC (rev 1323)
@@ -29,6 +29,8 @@
{
protected String name;
+
+ protected int lazyReadThreshold = 0;
@Deprecated
protected String autoInitializedRootNt;
@@ -192,5 +194,15 @@
{
this.initializer = initializer;
}
+
+ public int getLazyReadThreshold()
+ {
+ return lazyReadThreshold;
+ }
+ public void setLazyReadThreshold(int lazyReadThreshold)
+ {
+ this.lazyReadThreshold = lazyReadThreshold;
+ }
+
}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-01-08 12:03:33 UTC (rev 1322)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-01-08 12:38:14 UTC (rev 1323)
@@ -1035,11 +1035,29 @@
checkValid();
try
{
- // TODO full iterator code
- // return new EntityCollection(childNodes());
+ List<NodeData> childs = childNodesData();
- // lazy childs
- return new LazyNodeIterator(childNodesData());
+ if (childs.size() < session.getLazyReadThreshold())
+ {
+ // full iterator
+ List<NodeImpl> nodes = new ArrayList<NodeImpl>();
+ for (NodeData child : childs)
+ {
+ if (session.getAccessManager().hasPermission(child.getACL(), new String[]{PermissionType.READ},
+ session.getUserState().getIdentity()))
+ {
+ NodeImpl item = (NodeImpl)dataManager.readItem(child, nodeData(), true, false);
+ session.getActionHandler().postRead(item);
+ nodes.add(item);
+ }
+ }
+ return new EntityCollection(nodes);
+ }
+ else
+ {
+ // lazy iterator
+ return new LazyNodeIterator(childs);
+ }
}
finally
{
@@ -1066,20 +1084,32 @@
try
{
- // TODO full iterator code
- // ItemFilter filter = new NamePatternFilter(namePattern);
- // ArrayList<NodeImpl> list = new ArrayList<NodeImpl>();
- // for (NodeImpl item : childNodes())
- // {
- // if (filter.accept(item))
- // {
- // list.add(item);
- // }
- // }
- // return new EntityCollection(list);
+ List<NodeData> childs = childNodesData();
- // lazy childs
- return new LazyNodeIterator(childNodesData(), new ItemDataNamePatternFilter(namePattern, session));
+ ItemDataFilter filter = new ItemDataNamePatternFilter(namePattern, session);
+
+ if (childs.size() < session.getLazyReadThreshold())
+ {
+ // full iterator
+ List<NodeImpl> nodes = new ArrayList<NodeImpl>();
+ for (NodeData child : childs)
+ {
+ if (filter.accept(child)
+ && session.getAccessManager().hasPermission(child.getACL(), new String[]{PermissionType.READ},
+ session.getUserState().getIdentity()))
+ {
+ NodeImpl item = (NodeImpl)dataManager.readItem(child, nodeData(), true, false);
+ session.getActionHandler().postRead(item);
+ nodes.add(item);
+ }
+ }
+ return new EntityCollection(nodes);
+ }
+ else
+ {
+ // lazy iterator
+ return new LazyNodeIterator(childNodesData(), filter);
+ }
}
finally
{
@@ -1149,11 +1179,35 @@
try
{
- // TODO full iterator code
- // return new EntityCollection(childProperties());
+ List<PropertyData> childs = childPropertiesData();
- // lazy childs
- return new LazyPropertyIterator(childPropertiesData());
+ if (session.getAccessManager().hasPermission(nodeData().getACL(), new String[]{PermissionType.READ},
+ session.getUserState().getIdentity()))
+ {
+ if (childs.size() < session.getLazyReadThreshold())
+ {
+ // full iterator
+ List<PropertyImpl> props = new ArrayList<PropertyImpl>();
+ for (PropertyData child : childs)
+ {
+ PropertyImpl item = (PropertyImpl)dataManager.readItem(child, nodeData(), true, false);
+ session.getActionHandler().postRead(item);
+ props.add(item);
+
+ }
+ return new EntityCollection(props);
+ }
+ else
+ {
+ // lazy iterator
+ return new LazyPropertyIterator(childs);
+ }
+ }
+ else
+ {
+ // return empty
+ return new EntityCollection();
+ }
}
finally
{
@@ -1169,28 +1223,50 @@
*/
public PropertyIterator getProperties(String namePattern) throws RepositoryException
{
-
long start = System.currentTimeMillis();
if (LOG.isDebugEnabled())
+ {
LOG.debug("getProperties(String) >>>>>");
+ }
checkValid();
try
{
- // TODO full iterator code
- // ItemFilter filter = new NamePatternFilter(namePattern);
- // ArrayList<PropertyImpl> list = new ArrayList<PropertyImpl>();
- // for (PropertyImpl item : childProperties())
- // {
- // if (filter.accept(item))
- // list.add(item);
- // }
- //
- // return new EntityCollection(list);
+ List<PropertyData> childs = childPropertiesData();
- // lazy childs
- return new LazyPropertyIterator(childPropertiesData(), new ItemDataNamePatternFilter(namePattern, session));
+ ItemDataFilter filter = new ItemDataNamePatternFilter(namePattern, session);
+
+ if (session.getAccessManager().hasPermission(nodeData().getACL(), new String[]{PermissionType.READ},
+ session.getUserState().getIdentity()))
+ {
+ if (childs.size() < session.getLazyReadThreshold())
+ {
+ // full iterator
+ List<PropertyImpl> props = new ArrayList<PropertyImpl>();
+ for (PropertyData child : childs)
+ {
+ if (filter.accept(child))
+ {
+ PropertyImpl item = (PropertyImpl)dataManager.readItem(child, nodeData(), true, false);
+ session.getActionHandler().postRead(item);
+ props.add(item);
+ }
+
+ }
+ return new EntityCollection(props);
+ }
+ else
+ {
+ // lazy iterator
+ return new LazyPropertyIterator(childPropertiesData(), filter);
+ }
+ }
+ else
+ {
+ // return empty
+ return new EntityCollection();
+ }
}
finally
{
@@ -2672,39 +2748,9 @@
*/
private List<NodeData> childNodesData() throws RepositoryException, AccessDeniedException
{
-
- //List<NodeData> storedNodes = dataManager.getChildNodesData(nodeData());
List<NodeData> storedNodes = new ArrayList<NodeData>(dataManager.getChildNodesData(nodeData()));
-
- // TODO we should not sort here!
Collections.sort(storedNodes, new NodeDataOrderComparator());
-
return storedNodes;
-
- // TODO cleanup
- // List<Object> results = new ArrayList<Object>(storedNodes.size());
- //
- // Iterator<NodeData> it = storedNodes.iterator();
- // while (it.hasNext())
- // {
- // NodeData node = it.next();
- //
- // if (session.getAccessManager().hasPermission(node.getACL(), new String[]{PermissionType.READ},
- // session.getUserState().getIdentity()))
- // {
- // ItemImpl pooled = dataManager.reloadItem(node);
- // if (pooled != null)
- // {
- // results.add(pooled);
- // }
- // else
- // {
- // results.add(node);
- // }
- // }
- // }
- //
- // return results;
}
private EntityCollection createMergeFailed(Map<String, String> failed, SessionChangesLog changes)
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2010-01-08 12:03:33 UTC (rev 1322)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2010-01-08 12:38:14 UTC (rev 1323)
@@ -592,7 +592,6 @@
{
PropertyData data = refDatas.get(i);
// check for permission for read
- // [PN] 21.12.07 use item data
NodeData parent = (NodeData)getItemData(data.getParentIdentifier());
// skip not permitted
if (accessManager.hasPermission(parent.getACL(), new String[]{PermissionType.READ}, session.getUserState()
@@ -609,12 +608,10 @@
}
item = (PropertyImpl)readItem(state.getData(), null, true, false);
- // TODO item = (PropertyImpl)itemFactory.createItem(state.getData());
}
else
{
item = (PropertyImpl)readItem(data, null, true, false);
- // TODO item = (PropertyImpl)itemFactory.createItem(data);
}
refs.add(item);
@@ -643,7 +640,9 @@
long start = System.currentTimeMillis();
if (log.isDebugEnabled())
+ {
log.debug("getChildNodes(" + parent.getQPath().getAsString() + ") >>>>>");
+ }
try
{
@@ -657,13 +656,8 @@
if (accessManager.hasPermission(data.getACL(), new String[]{PermissionType.READ}, session.getUserState()
.getIdentity()))
{
- //NodeImpl item = itemFactory.createNode(data, parent.getPrimaryTypeName(), parent.getMixinTypeNames());
NodeImpl item = (NodeImpl)readItem(data, parent, pool, false);
session.getActionHandler().postRead(item);
-
- //TODO if (pool)
- // item = (NodeImpl)itemsPool.get(item);
-
nodes.add(item);
}
}
@@ -672,8 +666,10 @@
finally
{
if (log.isDebugEnabled())
+ {
log.debug("getChildNodes(" + parent.getQPath().getAsString() + ") <<<<< "
+ ((System.currentTimeMillis() - start) / 1000d) + "sec");
+ }
}
}
@@ -708,15 +704,11 @@
for (int i = 0, length = propDatas.size(); i < length; i++)
{
PropertyData data = propDatas.get(i);
- //ItemImpl item = itemFactory.createItem(data);
if (accessManager.hasPermission(parent.getACL(), new String[]{PermissionType.READ}, session.getUserState()
.getIdentity()))
{
- // TODO if (pool)
- // item = itemsPool.get(item);
ItemImpl item = readItem(data, parent, pool, false);
session.getActionHandler().postRead(item);
-
props.add((PropertyImpl)item);
}
}
@@ -725,8 +717,10 @@
finally
{
if (log.isDebugEnabled())
+ {
log.debug("getChildProperties(" + parent.getQPath().getAsString() + ") <<<<< "
+ ((System.currentTimeMillis() - start) / 1000d) + "sec");
+ }
}
}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java 2010-01-08 12:03:33 UTC (rev 1322)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionImpl.java 2010-01-08 12:38:14 UTC (rev 1323)
@@ -98,6 +98,8 @@
public class SessionImpl implements ExtendedSession, NamespaceAccessor
{
+ public static final int DEFAULT_LAZY_READ_THRESHOLD = 100;
+
private final RepositoryImpl repository;
private final ConversationState userState;
@@ -132,6 +134,8 @@
private long lastAccessTime;
+ private final int lazyReadThreshold;
+
private final SessionRegistry sessionRegistry;
protected final SessionDataManager dataManager;
@@ -154,6 +158,10 @@
this.accessManager = (AccessManager)container.getComponentInstanceOfType(AccessManager.class);
this.lockManager = (LockManagerImpl)container.getComponentInstanceOfType(LockManagerImpl.class);
WorkspaceEntry wsConfig = (WorkspaceEntry)container.getComponentInstanceOfType(WorkspaceEntry.class);
+
+ this.lazyReadThreshold =
+ wsConfig.getLazyReadThreshold() > 0 ? wsConfig.getLazyReadThreshold() : DEFAULT_LAZY_READ_THRESHOLD;
+
WorkspaceFileCleanerHolder cleanerHolder =
(WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(WorkspaceFileCleanerHolder.class);
@@ -620,7 +628,7 @@
{
return getNamespaceURI(prefix);
}
-
+
/**
* {@inheritDoc}
*/
@@ -961,5 +969,10 @@
{
return this.userState;
}
+
+ int getLazyReadThreshold()
+ {
+ return lazyReadThreshold;
+ }
}
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/resources/binding.xml
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/resources/binding.xml 2010-01-08 12:03:33 UTC (rev 1322)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/resources/binding.xml 2010-01-08 12:38:14 UTC (rev 1323)
@@ -23,7 +23,8 @@
<value name="name" field="name" style="attribute" />
<value name="auto-init-root-nodetype" field="autoInitializedRootNt" style="attribute" usage="optional" />
<value name="auto-init-permissions" field="autoInitPermissions" style="attribute" usage="optional" />
-
+ <value name="lazy-read-threshold" field="lazyReadThreshold" usage="optional" />
+
<structure name="container" field="container">
<value name="class" field="type" style="attribute" />
<collection name="properties" field="parameters" usage="optional"
16 years, 4 months
exo-jcr SVN: r1322 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-08 07:03:33 -0500 (Fri, 08 Jan 2010)
New Revision: 1322
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java
Log:
EXOJCR-325: TestLoadIndexerWriter with the 2 modes provided which are: 1. do nothing 2. load data
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestLoadIndexerWriterWithModes.java 2010-01-08 12:03:33 UTC (rev 1322)
@@ -0,0 +1,227 @@
+/*
+ * 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.lab.cluster.prepare;
+
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+import org.exoplatform.services.jcr.core.CredentialsImpl;
+import org.exoplatform.services.jcr.impl.core.SessionImpl;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.Random;
+import java.util.concurrent.CountDownLatch;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id: TestLoadIndexerWriter.java 34360 2009-07-22 23:58:59Z nzamosenchuk $
+ *
+ */
+public class TestLoadIndexerWriterWithModes extends JcrAPIBaseTest
+{
+ public static final String COUNT = "count";
+
+ public static final String CONTENT = "Content";
+
+ public static final String STATISTIC = "Statistic";
+
+ private volatile boolean stop = false;
+
+ private int threadCount = 1;
+
+ // private int threadCount = 50;
+
+ private final CountDownLatch startSignal = new CountDownLatch(1);
+
+ private final CountDownLatch doneSignal = new CountDownLatch(threadCount);
+
+ private static final String[] words =
+ new String[]{"private", "branch", "final", "string", "logging", "bottle", "property", "node", "repository",
+ "exception", "cycle", "value", "index", "meaning", "strange", "words", "hello", "outline", "finest",
+ "basetest", "writer"};
+
+ public void testWrite() throws Exception
+ {
+ System.out.println("Skip (y/n) :");
+ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
+ String line = reader.readLine();
+ if (!line.equals("y"))
+ {
+ log.info("Creating threads...");
+ for (int i = 0; i < threadCount; i++)
+ {
+ // create new thread and start it
+ new Thread(new WriterTask(i)).start();
+ log.info("Thread#" + i + " created and started.");
+ }
+ startSignal.countDown();
+ // wait 5 minutes
+ try
+ {
+ Thread.sleep(60000 * 5);
+ }
+ catch (InterruptedException e)
+ {
+ log.error(e);
+ }
+
+ stop = true;
+ }
+ else
+ {
+ log.info("Wait for data");
+ }
+
+ doneSignal.await();
+ System.exit(0);
+ }
+
+ private class WriterTask implements Runnable
+ {
+
+ private int id;
+
+ private SessionImpl sessionLocal;
+
+ private Node statisticNode;
+
+ private Node contentNode;
+
+ private Random random;
+
+ public WriterTask(int id) throws RepositoryException
+ {
+ this.id = id;
+ // login
+ CredentialsImpl credentials = new CredentialsImpl("admin", "admin".toCharArray());
+ sessionLocal = (SessionImpl)repository.login(credentials, "ws");
+ // prepare nodes
+ Node root = sessionLocal.getRootNode();
+ Node threadNode = root.addNode("Thread" + id);
+ statisticNode = threadNode.addNode(STATISTIC);
+ contentNode = threadNode.addNode(CONTENT);
+ random = new Random();
+ sessionLocal.save();
+ }
+
+ /**
+ * @see java.lang.Runnable#run()
+ */
+ public void run()
+ {
+ try
+ {
+ startSignal.await();
+ while (!stop)
+ {
+ long time = System.currentTimeMillis();
+ // get any word
+ int i = random.nextInt(words.length);
+ String word = words[i] + id; // "hello12" if thread#12 is creating it
+ // update statistic
+ updateStatistic(word);
+ // add actual node
+ createTree().addNode(word);
+ sessionLocal.save();
+ System.out.println(Thread.currentThread() + " time : " + (System.currentTimeMillis() - time));
+
+ try
+ {
+ Thread.sleep(300);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("An unexpected error happens", e);
+ }
+ finally
+ {
+ doneSignal.countDown();
+ }
+ }
+
+ /**
+ * increments property in JCR: "./statistic/[word].count"
+ *
+ * @param word
+ * @throws RepositoryException
+ */
+ private void updateStatistic(String word) throws RepositoryException
+ {
+ Node wordNode;
+ long count = 0;
+ if (statisticNode.hasNode(word))
+ {
+ wordNode = statisticNode.getNode(word);
+ count = wordNode.getProperty(COUNT).getLong();
+ }
+ else
+ {
+ wordNode = statisticNode.addNode(word);
+ }
+ wordNode.setProperty(COUNT, count + 1);
+ }
+
+ /**
+ * Created node tree like: "./content/n123456/n1234567/n12345678"
+ * based on current time
+ *
+ * @return
+ * @throws RepositoryException
+ */
+ private Node createTree() throws RepositoryException
+ {
+ // created node tree like: "./content/n123456/n1234567/n12345678"
+ Node end;
+ long time = System.currentTimeMillis();
+ long child1 = time / 100000; // each 100s new node
+ long child2 = time / 10000; // each 10s new node
+ long child3 = time / 1000; // each 1s new node
+ end = addOrCreate("n" + child1, contentNode);
+ end = addOrCreate("n" + child2, end);
+ end = addOrCreate("n" + child3, end);
+ return end;
+ }
+
+ /**
+ * Gets or creates node
+ *
+ * @param name
+ * @param parent
+ * @return
+ * @throws RepositoryException
+ */
+ private Node addOrCreate(String name, Node parent) throws RepositoryException
+ {
+ if (parent.hasNode(name))
+ {
+ return parent.getNode(name);
+ }
+ else
+ return parent.addNode(name);
+ }
+ }
+
+}
16 years, 4 months
exo-jcr SVN: r1321 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-08 05:32:08 -0500 (Fri, 08 Jan 2010)
New Revision: 1321
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java
Removed:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
Log:
EXOJCR-371 : BufferedJbossCache renamed BufferedJBossCache
Copied: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java (from rev 1319, jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java)
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java 2010-01-08 10:32:08 UTC (rev 1321)
@@ -0,0 +1,663 @@
+package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.CacheStatus;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.Node;
+import org.jboss.cache.NodeNotExistsException;
+import org.jboss.cache.Region;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
+import org.jgroups.Address;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.transaction.TransactionManager;
+
+@SuppressWarnings("unchecked")
+public class BufferedJBossCache implements Cache<Serializable, Object>
+{
+// private final Log log = ExoLogger.getLogger(BufferedJbossCache.class);
+
+ /**
+ * Parent cache.
+ */
+ private final Cache<Serializable, Object> parentCache;
+
+ private ThreadLocal<List<ChangesContainer>> changesList = new ThreadLocal<List<ChangesContainer>>();
+
+ public BufferedJBossCache(Cache<Serializable, Object> parentCache)
+ {
+ super();
+ this.parentCache = parentCache;
+ }
+
+ /**
+ * Start buffering process.
+ */
+ public void beginTransaction()
+ {
+ changesList.set(new ArrayList<ChangesContainer>());
+ }
+
+ /**
+ * Sort changes and commit data to the cache.
+ */
+ public void commitTransaction()
+ {
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer should not be empty");
+ }
+ try
+ {
+ //log.info("Before=" + changesContainer.toString());
+ Collections.sort(changesContainer);
+ //log.info("After=" + changesContainer.toString());
+ for (ChangesContainer cacheChange : changesContainer)
+ {
+ cacheChange.apply();
+ }
+ }
+ finally
+ {
+ changesList.set(null);
+ }
+ }
+
+ /**
+ * Forget about changes
+ */
+ public void rollbackTransaction()
+ {
+ changesList.set(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#addCacheListener(java.lang.Object)
+ */
+ public void addCacheListener(Object listener)
+ {
+ parentCache.addCacheListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#addInterceptor(org.jboss.cache.interceptors.base.CommandInterceptor, java.lang.Class)
+ */
+ public void addInterceptor(CommandInterceptor i, Class<? extends CommandInterceptor> afterInterceptor)
+ {
+ parentCache.addInterceptor(i, afterInterceptor);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#addInterceptor(org.jboss.cache.interceptors.base.CommandInterceptor, int)
+ */
+ public void addInterceptor(CommandInterceptor i, int position)
+ {
+ parentCache.addInterceptor(i, position);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#clearData(org.jboss.cache.Fqn)
+ */
+ public void clearData(Fqn fqn)
+ {
+ parentCache.clearData(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#clearData(java.lang.String)
+ */
+ public void clearData(String fqn)
+ {
+ parentCache.clearData(fqn);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#create()
+ */
+ public void create() throws CacheException
+ {
+ parentCache.create();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#destroy()
+ */
+ public void destroy()
+ {
+ parentCache.destroy();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#endBatch(boolean)
+ */
+ public void endBatch(boolean successful)
+ {
+ parentCache.endBatch(successful);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#evict(org.jboss.cache.Fqn, boolean)
+ */
+ public void evict(Fqn fqn, boolean recursive)
+ {
+ parentCache.evict(fqn, recursive);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#evict(org.jboss.cache.Fqn)
+ */
+ public void evict(Fqn fqn)
+ {
+ parentCache.evict(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#get(org.jboss.cache.Fqn, java.lang.Object)
+ */
+ public Object get(Fqn fqn, Serializable key)
+ {
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#get(java.lang.String, java.lang.Object)
+ */
+ public Object get(String fqn, Serializable key)
+ {
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getCacheListeners()
+ */
+ public Set<Object> getCacheListeners()
+ {
+ return parentCache.getCacheListeners();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getCacheStatus()
+ */
+ public CacheStatus getCacheStatus()
+ {
+ return parentCache.getCacheStatus();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getChildrenNames(org.jboss.cache.Fqn)
+ */
+ public Set<Object> getChildrenNames(Fqn fqn)
+ {
+ return parentCache.getChildrenNames(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getChildrenNames(java.lang.String)
+ */
+ public Set<String> getChildrenNames(String fqn)
+ {
+ return parentCache.getChildrenNames(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getConfiguration()
+ */
+ public Configuration getConfiguration()
+ {
+ return parentCache.getConfiguration();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getData(org.jboss.cache.Fqn)
+ */
+ public Map<Serializable, Object> getData(Fqn fqn)
+ {
+ return parentCache.getData(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getInvocationContext()
+ */
+ public InvocationContext getInvocationContext()
+ {
+ return parentCache.getInvocationContext();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getKeys(org.jboss.cache.Fqn)
+ */
+ public Set<Serializable> getKeys(Fqn fqn)
+ {
+ return parentCache.getKeys(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getKeys(java.lang.String)
+ */
+ public Set<Serializable> getKeys(String fqn)
+ {
+ return parentCache.getKeys(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getLocalAddress()
+ */
+ public Address getLocalAddress()
+ {
+ return parentCache.getLocalAddress();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getMembers()
+ */
+ public List<Address> getMembers()
+ {
+ return parentCache.getMembers();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getNode(org.jboss.cache.Fqn)
+ */
+ public Node<Serializable, Object> getNode(Fqn fqn)
+ {
+ return parentCache.getNode(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getNode(java.lang.String)
+ */
+ public Node<Serializable, Object> getNode(String fqn)
+ {
+ return parentCache.getNode(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getRegion(org.jboss.cache.Fqn, boolean)
+ */
+ public Region getRegion(Fqn fqn, boolean createIfAbsent)
+ {
+ return parentCache.getRegion(fqn, createIfAbsent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getRoot()
+ */
+ public Node<Serializable, Object> getRoot()
+ {
+ return parentCache.getRoot();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getVersion()
+ */
+ public String getVersion()
+ {
+ return parentCache.getVersion();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#isLeaf(org.jboss.cache.Fqn)
+ */
+ public boolean isLeaf(Fqn fqn)
+ {
+ return parentCache.isLeaf(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#isLeaf(java.lang.String)
+ */
+ public boolean isLeaf(String fqn)
+ {
+ return parentCache.isLeaf(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#move(org.jboss.cache.Fqn, org.jboss.cache.Fqn)
+ */
+ public void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException
+ {
+ parentCache.move(nodeToMove, newParent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#move(java.lang.String, java.lang.String)
+ */
+ public void move(String nodeToMove, String newParent) throws NodeNotExistsException
+ {
+ parentCache.move(nodeToMove, newParent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(org.jboss.cache.Fqn, java.util.Map)
+ */
+ public void put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)
+ {
+ //parentCache.put(fqn, data);
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer should not be empty");
+ }
+ changesContainer.add(new PutObjectContainer(fqn, data, parentCache));
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
+ */
+ public Object put(Fqn fqn, Serializable key, Object value)
+ {
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer should not be empty");
+ }
+ changesContainer.add(new PutKeyValueContainer(fqn, key, value, parentCache));
+
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(java.lang.String, java.util.Map)
+ */
+ public void put(String fqn, Map<? extends Serializable, ? extends Object> data)
+ {
+ throw new UnsupportedOperationException(
+ "Unexpected method call use put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ public Object put(String fqn, Serializable key, Object value)
+ {
+ throw new UnsupportedOperationException("Unexpected method call use put(Fqn fqn, Serializable key, Object value)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#putForExternalRead(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
+ */
+ public void putForExternalRead(Fqn fqn, Serializable key, Object value)
+ {
+ throw new UnsupportedOperationException("Unexpected method call ");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#remove(org.jboss.cache.Fqn, java.lang.Object)
+ */
+ public Object remove(Fqn fqn, Serializable key)
+ {
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer should not be empty");
+ }
+ changesContainer.add(new RemoveKeyContainer(fqn, key, parentCache));
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#remove(java.lang.String, java.lang.Object)
+ */
+ public Object remove(String fqn, Serializable key)
+ {
+ throw new UnsupportedOperationException("Unexpected method call. Use remove(Fqn fqn, Serializable key)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeCacheListener(java.lang.Object)
+ */
+ public void removeCacheListener(Object listener)
+ {
+ parentCache.removeCacheListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeInterceptor(java.lang.Class)
+ */
+ public void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
+ {
+ parentCache.removeInterceptor(interceptorType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeInterceptor(int)
+ */
+ public void removeInterceptor(int position)
+ {
+ parentCache.removeInterceptor(position);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeNode(org.jboss.cache.Fqn)
+ */
+ public boolean removeNode(Fqn fqn)
+ {
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer should not be empty");
+ }
+ changesContainer.add(new RemoveNodeContainer(fqn, parentCache));
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeNode(java.lang.String)
+ */
+ public boolean removeNode(String fqn)
+ {
+ throw new UnsupportedOperationException("Unexpected method call. Use remove removeNode(Fqn fqn)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeRegion(org.jboss.cache.Fqn)
+ */
+ public boolean removeRegion(Fqn fqn)
+ {
+ return parentCache.removeRegion(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#setInvocationContext(org.jboss.cache.InvocationContext)
+ */
+ public void setInvocationContext(InvocationContext ctx)
+ {
+ parentCache.setInvocationContext(ctx);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#start()
+ */
+ public void start() throws CacheException
+ {
+ parentCache.start();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#startBatch()
+ */
+ public void startBatch()
+ {
+ parentCache.startBatch();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#stop()
+ */
+ public void stop()
+ {
+ parentCache.stop();
+ }
+
+ public TransactionManager getTransactionManager()
+ {
+ return ((CacheSPI<Serializable, Object>)parentCache).getTransactionManager();
+ }
+
+ private static enum ChangesType
+ {
+ REMOVED, ADDED;
+ }
+
+ /**
+ * Container for changes
+ * @author sj
+ *
+ */
+ private static abstract class ChangesContainer implements Comparable<ChangesContainer>
+ {
+ protected final Fqn fqn;
+
+ protected final ChangesType changesType;
+
+ protected final Cache<Serializable, Object> cache;
+
+ public ChangesContainer(Fqn fqn, ChangesType changesType, Cache<Serializable, Object> cache)
+ {
+ super();
+ this.fqn = fqn;
+ this.changesType = changesType;
+ this.cache = cache;
+ }
+
+ /**
+ * @return the fqn
+ */
+ public Fqn getFqn()
+ {
+ return fqn;
+ }
+
+ /**
+ * @return the changesType
+ */
+ public ChangesType getChangesType()
+ {
+ return changesType;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return fqn + " type=" + changesType;
+ }
+
+ public int compareTo(ChangesContainer o)
+ {
+ int result = fqn.compareTo(o.getFqn());
+ return result == 0 ? -1 : result;
+ }
+
+ public abstract void apply();
+ }
+
+ /**
+ * Put object container;
+ * @author sj
+ *
+ */
+ private static class PutObjectContainer extends ChangesContainer
+ {
+ private final Map<? extends Serializable, ? extends Object> data;
+
+ public PutObjectContainer(Fqn fqn, Map<? extends Serializable, ? extends Object> data,
+ Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.ADDED, cache);
+
+ this.data = data;
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.put(fqn, data);
+ }
+ }
+
+ /**
+ * Put container.
+ * @author sj
+ *
+ */
+ private static class PutKeyValueContainer extends ChangesContainer
+ {
+ private final Serializable key;
+
+ private final Object value;
+
+ public PutKeyValueContainer(Fqn fqn, Serializable key, Object value, Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.ADDED, cache);
+ this.key = key;
+ this.value = value;
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.put(fqn, key, value);
+ }
+ }
+
+ /**
+ * Remove container.
+ * @author sj
+ *
+ */
+ private static class RemoveKeyContainer extends ChangesContainer
+ {
+ private final Serializable key;
+
+ public RemoveKeyContainer(Fqn fqn, Serializable key, Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.REMOVED, cache);
+ this.key = key;
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.remove(fqn, key);
+
+ }
+
+ }
+
+ /**
+ * Remove container.
+ * @author sj
+ *
+ */
+ private static class RemoveNodeContainer extends ChangesContainer
+ {
+
+ public RemoveNodeContainer(Fqn fqn, Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.REMOVED, cache);
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.removeNode(fqn);
+ }
+ }
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java 2010-01-08 10:30:56 UTC (rev 1320)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java 2010-01-08 10:32:08 UTC (rev 1321)
@@ -1,663 +0,0 @@
-package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
-
-import org.jboss.cache.Cache;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.CacheStatus;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeNotExistsException;
-import org.jboss.cache.Region;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.interceptors.base.CommandInterceptor;
-import org.jgroups.Address;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.transaction.TransactionManager;
-
-@SuppressWarnings("unchecked")
-public class BufferedJbossCache implements Cache<Serializable, Object>
-{
-// private final Log log = ExoLogger.getLogger(BufferedJbossCache.class);
-
- /**
- * Parent cache.
- */
- private final Cache<Serializable, Object> parentCache;
-
- private ThreadLocal<List<ChangesContainer>> changesList = new ThreadLocal<List<ChangesContainer>>();
-
- public BufferedJbossCache(Cache<Serializable, Object> parentCache)
- {
- super();
- this.parentCache = parentCache;
- }
-
- /**
- * Start buffering process.
- */
- public void beginTransaction()
- {
- changesList.set(new ArrayList<ChangesContainer>());
- }
-
- /**
- * Sort changes and commit data to the cache.
- */
- public void commitTransaction()
- {
- List<ChangesContainer> changesContainer = changesList.get();
- if (changesContainer == null)
- {
- throw new IllegalStateException("changesContainer should not be empty");
- }
- try
- {
- //log.info("Before=" + changesContainer.toString());
- Collections.sort(changesContainer);
- //log.info("After=" + changesContainer.toString());
- for (ChangesContainer cacheChange : changesContainer)
- {
- cacheChange.apply();
- }
- }
- finally
- {
- changesList.set(null);
- }
- }
-
- /**
- * Forget about changes
- */
- public void rollbackTransaction()
- {
- changesList.set(null);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#addCacheListener(java.lang.Object)
- */
- public void addCacheListener(Object listener)
- {
- parentCache.addCacheListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#addInterceptor(org.jboss.cache.interceptors.base.CommandInterceptor, java.lang.Class)
- */
- public void addInterceptor(CommandInterceptor i, Class<? extends CommandInterceptor> afterInterceptor)
- {
- parentCache.addInterceptor(i, afterInterceptor);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#addInterceptor(org.jboss.cache.interceptors.base.CommandInterceptor, int)
- */
- public void addInterceptor(CommandInterceptor i, int position)
- {
- parentCache.addInterceptor(i, position);
-
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#clearData(org.jboss.cache.Fqn)
- */
- public void clearData(Fqn fqn)
- {
- parentCache.clearData(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#clearData(java.lang.String)
- */
- public void clearData(String fqn)
- {
- parentCache.clearData(fqn);
-
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#create()
- */
- public void create() throws CacheException
- {
- parentCache.create();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#destroy()
- */
- public void destroy()
- {
- parentCache.destroy();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#endBatch(boolean)
- */
- public void endBatch(boolean successful)
- {
- parentCache.endBatch(successful);
-
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#evict(org.jboss.cache.Fqn, boolean)
- */
- public void evict(Fqn fqn, boolean recursive)
- {
- parentCache.evict(fqn, recursive);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#evict(org.jboss.cache.Fqn)
- */
- public void evict(Fqn fqn)
- {
- parentCache.evict(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#get(org.jboss.cache.Fqn, java.lang.Object)
- */
- public Object get(Fqn fqn, Serializable key)
- {
- return parentCache.get(fqn, key);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#get(java.lang.String, java.lang.Object)
- */
- public Object get(String fqn, Serializable key)
- {
- return parentCache.get(fqn, key);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getCacheListeners()
- */
- public Set<Object> getCacheListeners()
- {
- return parentCache.getCacheListeners();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getCacheStatus()
- */
- public CacheStatus getCacheStatus()
- {
- return parentCache.getCacheStatus();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getChildrenNames(org.jboss.cache.Fqn)
- */
- public Set<Object> getChildrenNames(Fqn fqn)
- {
- return parentCache.getChildrenNames(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getChildrenNames(java.lang.String)
- */
- public Set<String> getChildrenNames(String fqn)
- {
- return parentCache.getChildrenNames(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getConfiguration()
- */
- public Configuration getConfiguration()
- {
- return parentCache.getConfiguration();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getData(org.jboss.cache.Fqn)
- */
- public Map<Serializable, Object> getData(Fqn fqn)
- {
- return parentCache.getData(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getInvocationContext()
- */
- public InvocationContext getInvocationContext()
- {
- return parentCache.getInvocationContext();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getKeys(org.jboss.cache.Fqn)
- */
- public Set<Serializable> getKeys(Fqn fqn)
- {
- return parentCache.getKeys(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getKeys(java.lang.String)
- */
- public Set<Serializable> getKeys(String fqn)
- {
- return parentCache.getKeys(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getLocalAddress()
- */
- public Address getLocalAddress()
- {
- return parentCache.getLocalAddress();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getMembers()
- */
- public List<Address> getMembers()
- {
- return parentCache.getMembers();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getNode(org.jboss.cache.Fqn)
- */
- public Node<Serializable, Object> getNode(Fqn fqn)
- {
- return parentCache.getNode(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getNode(java.lang.String)
- */
- public Node<Serializable, Object> getNode(String fqn)
- {
- return parentCache.getNode(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getRegion(org.jboss.cache.Fqn, boolean)
- */
- public Region getRegion(Fqn fqn, boolean createIfAbsent)
- {
- return parentCache.getRegion(fqn, createIfAbsent);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getRoot()
- */
- public Node<Serializable, Object> getRoot()
- {
- return parentCache.getRoot();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#getVersion()
- */
- public String getVersion()
- {
- return parentCache.getVersion();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#isLeaf(org.jboss.cache.Fqn)
- */
- public boolean isLeaf(Fqn fqn)
- {
- return parentCache.isLeaf(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#isLeaf(java.lang.String)
- */
- public boolean isLeaf(String fqn)
- {
- return parentCache.isLeaf(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#move(org.jboss.cache.Fqn, org.jboss.cache.Fqn)
- */
- public void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException
- {
- parentCache.move(nodeToMove, newParent);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#move(java.lang.String, java.lang.String)
- */
- public void move(String nodeToMove, String newParent) throws NodeNotExistsException
- {
- parentCache.move(nodeToMove, newParent);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#put(org.jboss.cache.Fqn, java.util.Map)
- */
- public void put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)
- {
- //parentCache.put(fqn, data);
- List<ChangesContainer> changesContainer = changesList.get();
- if (changesContainer == null)
- {
- throw new IllegalStateException("changesContainer should not be empty");
- }
- changesContainer.add(new PutObjectContainer(fqn, data, parentCache));
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#put(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
- */
- public Object put(Fqn fqn, Serializable key, Object value)
- {
- List<ChangesContainer> changesContainer = changesList.get();
- if (changesContainer == null)
- {
- throw new IllegalStateException("changesContainer should not be empty");
- }
- changesContainer.add(new PutKeyValueContainer(fqn, key, value, parentCache));
-
- return parentCache.get(fqn, key);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#put(java.lang.String, java.util.Map)
- */
- public void put(String fqn, Map<? extends Serializable, ? extends Object> data)
- {
- throw new UnsupportedOperationException(
- "Unexpected method call use put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)");
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#put(java.lang.String, java.lang.Object, java.lang.Object)
- */
- public Object put(String fqn, Serializable key, Object value)
- {
- throw new UnsupportedOperationException("Unexpected method call use put(Fqn fqn, Serializable key, Object value)");
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#putForExternalRead(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
- */
- public void putForExternalRead(Fqn fqn, Serializable key, Object value)
- {
- throw new UnsupportedOperationException("Unexpected method call ");
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#remove(org.jboss.cache.Fqn, java.lang.Object)
- */
- public Object remove(Fqn fqn, Serializable key)
- {
- List<ChangesContainer> changesContainer = changesList.get();
- if (changesContainer == null)
- {
- throw new IllegalStateException("changesContainer should not be empty");
- }
- changesContainer.add(new RemoveKeyContainer(fqn, key, parentCache));
- return parentCache.get(fqn, key);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#remove(java.lang.String, java.lang.Object)
- */
- public Object remove(String fqn, Serializable key)
- {
- throw new UnsupportedOperationException("Unexpected method call. Use remove(Fqn fqn, Serializable key)");
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#removeCacheListener(java.lang.Object)
- */
- public void removeCacheListener(Object listener)
- {
- parentCache.removeCacheListener(listener);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#removeInterceptor(java.lang.Class)
- */
- public void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
- {
- parentCache.removeInterceptor(interceptorType);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#removeInterceptor(int)
- */
- public void removeInterceptor(int position)
- {
- parentCache.removeInterceptor(position);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#removeNode(org.jboss.cache.Fqn)
- */
- public boolean removeNode(Fqn fqn)
- {
- List<ChangesContainer> changesContainer = changesList.get();
- if (changesContainer == null)
- {
- throw new IllegalStateException("changesContainer should not be empty");
- }
- changesContainer.add(new RemoveNodeContainer(fqn, parentCache));
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#removeNode(java.lang.String)
- */
- public boolean removeNode(String fqn)
- {
- throw new UnsupportedOperationException("Unexpected method call. Use remove removeNode(Fqn fqn)");
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#removeRegion(org.jboss.cache.Fqn)
- */
- public boolean removeRegion(Fqn fqn)
- {
- return parentCache.removeRegion(fqn);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#setInvocationContext(org.jboss.cache.InvocationContext)
- */
- public void setInvocationContext(InvocationContext ctx)
- {
- parentCache.setInvocationContext(ctx);
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#start()
- */
- public void start() throws CacheException
- {
- parentCache.start();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#startBatch()
- */
- public void startBatch()
- {
- parentCache.startBatch();
- }
-
- /* (non-Javadoc)
- * @see org.jboss.cache.Cache#stop()
- */
- public void stop()
- {
- parentCache.stop();
- }
-
- public TransactionManager getTransactionManager()
- {
- return ((CacheSPI<Serializable, Object>)parentCache).getTransactionManager();
- }
-
- private static enum ChangesType
- {
- REMOVED, ADDED;
- }
-
- /**
- * Container for changes
- * @author sj
- *
- */
- private static abstract class ChangesContainer implements Comparable<ChangesContainer>
- {
- protected final Fqn fqn;
-
- protected final ChangesType changesType;
-
- protected final Cache<Serializable, Object> cache;
-
- public ChangesContainer(Fqn fqn, ChangesType changesType, Cache<Serializable, Object> cache)
- {
- super();
- this.fqn = fqn;
- this.changesType = changesType;
- this.cache = cache;
- }
-
- /**
- * @return the fqn
- */
- public Fqn getFqn()
- {
- return fqn;
- }
-
- /**
- * @return the changesType
- */
- public ChangesType getChangesType()
- {
- return changesType;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString()
- {
- return fqn + " type=" + changesType;
- }
-
- public int compareTo(ChangesContainer o)
- {
- int result = fqn.compareTo(o.getFqn());
- return result == 0 ? -1 : result;
- }
-
- public abstract void apply();
- }
-
- /**
- * Put object container;
- * @author sj
- *
- */
- private static class PutObjectContainer extends ChangesContainer
- {
- private final Map<? extends Serializable, ? extends Object> data;
-
- public PutObjectContainer(Fqn fqn, Map<? extends Serializable, ? extends Object> data,
- Cache<Serializable, Object> cache)
- {
- super(fqn, ChangesType.ADDED, cache);
-
- this.data = data;
- }
-
- @Override
- public void apply()
- {
- cache.put(fqn, data);
- }
- }
-
- /**
- * Put container.
- * @author sj
- *
- */
- private static class PutKeyValueContainer extends ChangesContainer
- {
- private final Serializable key;
-
- private final Object value;
-
- public PutKeyValueContainer(Fqn fqn, Serializable key, Object value, Cache<Serializable, Object> cache)
- {
- super(fqn, ChangesType.ADDED, cache);
- this.key = key;
- this.value = value;
- }
-
- @Override
- public void apply()
- {
- cache.put(fqn, key, value);
- }
- }
-
- /**
- * Remove container.
- * @author sj
- *
- */
- private static class RemoveKeyContainer extends ChangesContainer
- {
- private final Serializable key;
-
- public RemoveKeyContainer(Fqn fqn, Serializable key, Cache<Serializable, Object> cache)
- {
- super(fqn, ChangesType.REMOVED, cache);
- this.key = key;
- }
-
- @Override
- public void apply()
- {
- cache.remove(fqn, key);
-
- }
-
- }
-
- /**
- * Remove container.
- * @author sj
- *
- */
- private static class RemoveNodeContainer extends ChangesContainer
- {
-
- public RemoveNodeContainer(Fqn fqn, Cache<Serializable, Object> cache)
- {
- super(fqn, ChangesType.REMOVED, cache);
- }
-
- @Override
- public void apply()
- {
- cache.removeNode(fqn);
- }
- }
-}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-08 10:30:56 UTC (rev 1320)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-08 10:32:08 UTC (rev 1321)
@@ -120,7 +120,7 @@
public static final Set<String> NO_CHILDS = Collections.emptySet();
- protected final BufferedJbossCache cache;
+ protected final BufferedJBossCache cache;
protected final Fqn<String> itemsRoot;
@@ -270,7 +270,7 @@
{
CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
LOG.info("JBoss Cache configuration used: " + jbcConfig);
- this.cache = new BufferedJbossCache(factory.createCache(jbcConfig, false));
+ this.cache = new BufferedJBossCache(factory.createCache(jbcConfig, false));
this.cache.create();
this.cache.start();
16 years, 4 months
exo-jcr SVN: r1320 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 2 other directories.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-08 05:30:56 -0500 (Fri, 08 Jan 2010)
New Revision: 1320
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java
Log:
EXOJCR-371 : enabled BufferedJbossCache in main code. TCK ok. exo test 1015 7 0 expected
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java 2010-01-08 09:53:53 UTC (rev 1319)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/WorkspaceStorageCache.java 2010-01-08 10:30:56 UTC (rev 1320)
@@ -136,5 +136,23 @@
* @return long value
*/
long getSize();
+
+ /**
+ * Start buffering process.
+ */
+ public void beginTransaction();
+
+ /**
+ * Sort changes and commit data to the cache.
+ */
+ public void commitTransaction();
+
+
+ /**
+ * Forget about changes
+ */
+ public void rollbackTransaction();
+
+
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-08 09:53:53 UTC (rev 1319)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-01-08 10:30:56 UTC (rev 1320)
@@ -198,8 +198,12 @@
{
try
{
+
transactionManager.begin();
+ transactionManager.setTransactionTimeout(900000);
+ cache.beginTransaction();
super.save(changesLog);
+ cache.commitTransaction();
transactionManager.commit();
}
catch (RollbackException e)
@@ -211,6 +215,7 @@
{
try
{
+ cache.rollbackTransaction();
transactionManager.rollback();
}
catch (Exception e1)
@@ -224,6 +229,7 @@
{
try
{
+ cache.rollbackTransaction();
transactionManager.rollback();
}
catch (Exception e1)
@@ -231,12 +237,35 @@
// Treat the exception
throw new RepositoryException(e1.getLocalizedMessage(), e1.getCause());
}
+ e.printStackTrace();
throw new RepositoryException(e.getLocalizedMessage(), e.getCause());
}
}
}
+ /**
+ * Start buffering process.
+ */
+ public void beginTransaction()
+ {
+ }
+
/**
+ * Sort changes and commit data to the cache.
+ */
+ public void commitTransaction()
+ {
+
+ }
+
+ /**
+ * Forget about changes
+ */
+ public void rollbackTransaction()
+ {
+
+ }
+ /**
* Get cached ItemData.
*
* @param parentData
@@ -322,7 +351,9 @@
else
{
transactionManager.begin();
+ cache.beginTransaction();
cache.addChildNodes(parentData, childNodes);
+ cache.commitTransaction();
transactionManager.commit();
}
}
@@ -335,6 +366,7 @@
{
try
{
+ cache.rollbackTransaction();
transactionManager.rollback();
}
catch (Exception e1)
@@ -411,7 +443,9 @@
else
{
transactionManager.begin();
+ cache.beginTransaction();
cache.addChildProperties(parentData, childProperties);
+ cache.commitTransaction();
transactionManager.commit();
}
}
@@ -424,6 +458,7 @@
{
try
{
+ cache.rollbackTransaction();
transactionManager.rollback();
}
catch (Exception e1)
@@ -476,7 +511,9 @@
else
{
transactionManager.begin();
+ cache.beginTransaction();
cache.put(data);
+ cache.commitTransaction();
transactionManager.commit();
}
}
@@ -489,6 +526,7 @@
{
try
{
+ cache.rollbackTransaction();
transactionManager.rollback();
}
catch (Exception e1)
@@ -530,7 +568,9 @@
else
{
transactionManager.begin();
+ cache.beginTransaction();
cache.put(data);
+ cache.commitTransaction();
transactionManager.commit();
}
}
@@ -543,6 +583,7 @@
{
try
{
+ cache.rollbackTransaction();
transactionManager.rollback();
}
catch (Exception e1)
@@ -610,7 +651,9 @@
else
{
transactionManager.begin();
+ cache.beginTransaction();
cache.addChildPropertiesList(parentData, propertiesList);
+ cache.commitTransaction();
transactionManager.commit();
}
}
@@ -623,6 +666,7 @@
{
try
{
+ cache.rollbackTransaction();
transactionManager.rollback();
}
catch (Exception e1)
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2010-01-08 09:53:53 UTC (rev 1319)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2010-01-08 10:30:56 UTC (rev 1320)
@@ -1877,4 +1877,22 @@
return res.toString();
}
+
+ public void beginTransaction()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void commitTransaction()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void rollbackTransaction()
+ {
+ // TODO Auto-generated method stub
+
+ }
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-08 09:53:53 UTC (rev 1319)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-01-08 10:30:56 UTC (rev 1320)
@@ -120,7 +120,7 @@
public static final Set<String> NO_CHILDS = Collections.emptySet();
- protected final Cache<Serializable, Object> cache;
+ protected final BufferedJbossCache cache;
protected final Fqn<String> itemsRoot;
@@ -270,7 +270,7 @@
{
CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
LOG.info("JBoss Cache configuration used: " + jbcConfig);
- this.cache = factory.createCache(jbcConfig, false);
+ this.cache = new BufferedJbossCache(factory.createCache(jbcConfig, false));
this.cache.create();
this.cache.start();
@@ -347,7 +347,7 @@
*/
public TransactionManager getTransactionManager()
{
- return ((CacheSPI<Serializable, Object>)cache).getTransactionManager();
+ return cache.getTransactionManager();
}
/**
@@ -822,7 +822,7 @@
if (prevData != null)
{
// do update ACL if needed
- if (!prevData.getACL().equals(node.getACL()))
+ if (prevData.getACL() == null || !prevData.getACL().equals(node.getACL()))
{
updateChildsACL(node.getIdentifier(), node.getACL());
}
@@ -959,4 +959,22 @@
}
}
+ public void beginTransaction()
+ {
+ cache.beginTransaction();
+
+ }
+
+ public void commitTransaction()
+ {
+ cache.commitTransaction();
+
+ }
+
+ public void rollbackTransaction()
+ {
+ cache.rollbackTransaction();
+
+ }
+
}
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java 2010-01-08 09:53:53 UTC (rev 1319)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspaceStorageCacheBaseCase.java 2010-01-08 10:30:56 UTC (rev 1320)
@@ -289,10 +289,19 @@
initNodesData();
initDataAsPersisted();
- cache.put(nodeData1);
- cache.put(nodeData2);
- cache.put(propertyData12);
-
+ try
+ {
+ cache.beginTransaction();
+ cache.put(nodeData1);
+ cache.put(nodeData2);
+ cache.put(propertyData12);
+ cache.commitTransaction();
+ }
+ catch (Exception e)
+ {
+ cache.rollbackTransaction();
+ throw e;
+ }
assertEquals("Cached node " + nodeData1.getQPath().getAsString() + " is not equals", cache.get(rootUuid,
nodePath1.getEntries()[nodePath1.getEntries().length - 1]), nodeData1);
assertEquals("Cached node " + nodeData2.getQPath().getAsString() + " is not equals", cache.get(rootUuid,
@@ -316,22 +325,30 @@
List<NodeData> nodes = new ArrayList<NodeData>();
nodes.add(nodeData31);
nodes.add(nodeData32);
- cache.addChildNodes(nodeData3, nodes);
+ try
+ {
+ cache.beginTransaction();
+ cache.addChildNodes(nodeData3, nodes);
- cache.put(nodeData1);
- cache.put(nodeData2);
- cache.put(propertyData12);
+ cache.put(nodeData1);
+ cache.put(nodeData2);
+ cache.put(propertyData12);
- List<PropertyData> properties2 = new ArrayList<PropertyData>();
- properties2.add(propertyData21);
- properties2.add(propertyData22);
- cache.addChildProperties(nodeData2, properties2);
+ List<PropertyData> properties2 = new ArrayList<PropertyData>();
+ properties2.add(propertyData21);
+ properties2.add(propertyData22);
+ cache.addChildProperties(nodeData2, properties2);
- List<PropertyData> properties1 = new ArrayList<PropertyData>();
- properties1.add(propertyData11);
- properties1.add(propertyData12);
- cache.addChildProperties(nodeData1, properties1);
-
+ List<PropertyData> properties1 = new ArrayList<PropertyData>();
+ properties1.add(propertyData11);
+ properties1.add(propertyData12);
+ cache.addChildProperties(nodeData1, properties1);
+ }
+ catch (Exception e)
+ {
+ cache.rollbackTransaction();
+ throw e;
+ }
// prev stuff
assertEquals("Cached " + nodeData1.getQPath().getAsString() + " is not equals", cache.get(rootUuid, nodePath1
.getEntries()[nodePath1.getEntries().length - 1]), nodeData1);
@@ -400,22 +417,30 @@
List<NodeData> nodes = new ArrayList<NodeData>();
nodes.add(nodeData31);
nodes.add(nodeData32);
- cache.addChildNodes(nodeData3, nodes);
+ try
+ {
+ cache.beginTransaction();
+ cache.addChildNodes(nodeData3, nodes);
- cache.put(nodeData1);
- cache.put(nodeData2);
- cache.put(propertyData12);
+ cache.put(nodeData1);
+ cache.put(nodeData2);
+ cache.put(propertyData12);
- List<PropertyData> properties2 = new ArrayList<PropertyData>();
- properties2.add(propertyData21);
- properties2.add(propertyData22);
- cache.addChildProperties(nodeData2, properties2);
+ List<PropertyData> properties2 = new ArrayList<PropertyData>();
+ properties2.add(propertyData21);
+ properties2.add(propertyData22);
+ cache.addChildProperties(nodeData2, properties2);
- List<PropertyData> properties1 = new ArrayList<PropertyData>();
- properties1.add(propertyData11);
- properties1.add(propertyData12);
- cache.addChildProperties(nodeData1, properties1);
-
+ List<PropertyData> properties1 = new ArrayList<PropertyData>();
+ properties1.add(propertyData11);
+ properties1.add(propertyData12);
+ cache.addChildProperties(nodeData1, properties1);
+ }
+ catch (Exception e)
+ {
+ cache.rollbackTransaction();
+ throw e;
+ }
// props, prev stuff
assertEquals("Cached child property " + propertyData11.getQPath().getAsString() + " is not equals", cache.get(
nodeUuid1, propertyPath11.getEntries()[propertyPath11.getEntries().length - 1]), propertyData11);
@@ -494,32 +519,39 @@
initNodesData();
initDataAsPersisted();
+ try
+ {
+ cache.beginTransaction();
+ // the case here
+ cache.put(nodeData3);
+ List<NodeData> n3childNodes = new ArrayList<NodeData>();
+ n3childNodes.add(nodeData31);
+ n3childNodes.add(nodeData32);
+ cache.addChildNodes(nodeData3, n3childNodes);
- // the case here
- cache.put(nodeData3);
- List<NodeData> n3childNodes = new ArrayList<NodeData>();
- n3childNodes.add(nodeData31);
- n3childNodes.add(nodeData32);
- cache.addChildNodes(nodeData3, n3childNodes);
+ // any stuff
+ cache.put(nodeData1);
+ cache.put(nodeData2);
+ cache.put(propertyData12);
- // any stuff
- cache.put(nodeData1);
- cache.put(nodeData2);
- cache.put(propertyData12);
+ List<PropertyData> properties2 = new ArrayList<PropertyData>();
+ properties2.add(propertyData21);
+ properties2.add(propertyData22);
+ cache.addChildProperties(nodeData2, properties2);
- List<PropertyData> properties2 = new ArrayList<PropertyData>();
- properties2.add(propertyData21);
- properties2.add(propertyData22);
- cache.addChildProperties(nodeData2, properties2);
+ List<PropertyData> properties1 = new ArrayList<PropertyData>();
+ properties1.add(propertyData11);
+ properties1.add(propertyData12);
+ cache.addChildProperties(nodeData1, properties1);
- List<PropertyData> properties1 = new ArrayList<PropertyData>();
- properties1.add(propertyData11);
- properties1.add(propertyData12);
- cache.addChildProperties(nodeData1, properties1);
-
- // remove
- cache.remove(nodeData3); // remove node3 and its childs (31, 32)
-
+ // remove
+ cache.remove(nodeData3); // remove node3 and its childs (31, 32)
+ }
+ catch (Exception e)
+ {
+ cache.rollbackTransaction();
+ throw e;
+ }
// check
assertNull("Node " + nodeData3.getQPath().getAsString() + " in the cache", cache.get(nodeUuid3));
assertNull("Node " + nodeData3.getQPath().getAsString() + " childs in the cache", cache.getChildNodes(nodeData3));
@@ -535,20 +567,28 @@
List<PropertyData> properties2 = new ArrayList<PropertyData>();
properties2.add(propertyData21);
properties2.add(propertyData22);
- cache.addChildProperties(nodeData2, properties2);
+ try
+ {
+ cache.beginTransaction();
+ cache.addChildProperties(nodeData2, properties2);
- // any stuff
- cache.put(nodeData3);
- cache.put(nodeData31);
+ // any stuff
+ cache.put(nodeData3);
+ cache.put(nodeData31);
- List<PropertyData> properties1 = new ArrayList<PropertyData>();
- properties1.add(propertyData11);
- properties1.add(propertyData12);
- cache.addChildProperties(nodeData1, properties1);
+ List<PropertyData> properties1 = new ArrayList<PropertyData>();
+ properties1.add(propertyData11);
+ properties1.add(propertyData12);
+ cache.addChildProperties(nodeData1, properties1);
- // remove
- cache.remove(nodeData2); // remove node2 and its childs (21, 22)
-
+ // remove
+ cache.remove(nodeData2); // remove node2 and its childs (21, 22)
+ }
+ catch (Exception e)
+ {
+ cache.rollbackTransaction();
+ throw e;
+ }
// check
assertNull("Node " + nodeData2.getQPath().getAsString() + " in the cache", cache.get(nodeUuid2));
assertNull("Node " + nodeData2.getQPath().getAsString() + " properties in the cache", cache
@@ -565,33 +605,41 @@
List<PropertyData> properties2 = new ArrayList<PropertyData>();
properties2.add(propertyData21);
properties2.add(propertyData22);
- cache.addChildProperties(nodeData2, properties2);
+ try
+ {
+ cache.beginTransaction();
+ cache.addChildProperties(nodeData2, properties2);
- List<NodeData> nodes2 = new ArrayList<NodeData>();
- nodes2.add(nodeData21);
- nodes2.add(nodeData22);
- cache.addChildNodes(nodeData2, nodes2);
+ List<NodeData> nodes2 = new ArrayList<NodeData>();
+ nodes2.add(nodeData21);
+ nodes2.add(nodeData22);
+ cache.addChildNodes(nodeData2, nodes2);
- // any stuff
- cache.put(nodeData3);
- cache.put(nodeData31);
- cache.put(nodeData32);
+ // any stuff
+ cache.put(nodeData3);
+ cache.put(nodeData31);
+ cache.put(nodeData32);
- List<PropertyData> properties1 = new ArrayList<PropertyData>();
- properties1.add(propertyData11);
- properties1.add(propertyData12);
- cache.addChildProperties(nodeData1, properties1);
+ List<PropertyData> properties1 = new ArrayList<PropertyData>();
+ properties1.add(propertyData11);
+ properties1.add(propertyData12);
+ cache.addChildProperties(nodeData1, properties1);
- // remove
- PlainChangesLog chlog = new PlainChangesLogImpl();
- chlog.add(ItemState.createDeletedState(propertyData21));
- chlog.add(ItemState.createDeletedState(propertyData22));
- chlog.add(ItemState.createDeletedState(nodeData21));
- chlog.add(ItemState.createDeletedState(nodeData22));
- chlog.add(ItemState.createDeletedState(nodeData2));
- // cache.remove(nodeData2); // remove node2 and its childs and properties (21, 22)
- cache.onSaveItems(chlog);
-
+ // remove
+ PlainChangesLog chlog = new PlainChangesLogImpl();
+ chlog.add(ItemState.createDeletedState(propertyData21));
+ chlog.add(ItemState.createDeletedState(propertyData22));
+ chlog.add(ItemState.createDeletedState(nodeData21));
+ chlog.add(ItemState.createDeletedState(nodeData22));
+ chlog.add(ItemState.createDeletedState(nodeData2));
+ // cache.remove(nodeData2); // remove node2 and its childs and properties (21, 22)
+ cache.onSaveItems(chlog);
+ }
+ catch (Exception e)
+ {
+ cache.rollbackTransaction();
+ throw e;
+ }
// check
assertNull("Node " + nodeData2.getQPath().getAsString() + " in the cache", cache.get(nodeUuid2));
16 years, 4 months
exo-jcr SVN: r1319 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-01-08 04:53:53 -0500 (Fri, 08 Jan 2010)
New Revision: 1319
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java
Log:
EXOJCR-371: Apply some remarks such as:
1. Instead of using "IllegalStateException", we use UnsupportedOperationException since it is more appropriate
2. ChangesContainer.compareTo should be implemented this way. We first compare the FQN (as you do) if they are equals, we return always -1
3. In commitTransaction, we make it safer with a try/finally block
4. We use an enumeration instead of an Interface for the ChangesType
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java 2010-01-07 21:14:03 UTC (rev 1318)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java 2010-01-08 09:53:53 UTC (rev 1319)
@@ -1,7 +1,5 @@
package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
import org.jboss.cache.Cache;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
@@ -24,9 +22,10 @@
import javax.transaction.TransactionManager;
+@SuppressWarnings("unchecked")
public class BufferedJbossCache implements Cache<Serializable, Object>
{
- private final Log log = ExoLogger.getLogger(BufferedJbossCache.class);
+// private final Log log = ExoLogger.getLogger(BufferedJbossCache.class);
/**
* Parent cache.
@@ -54,20 +53,25 @@
*/
public void commitTransaction()
{
-
List<ChangesContainer> changesContainer = changesList.get();
if (changesContainer == null)
{
- throw new IllegalStateException("changesContainer == null");
+ throw new IllegalStateException("changesContainer should not be empty");
}
- //log.info("Before=" + changesContainer.toString());
- Collections.sort(changesContainer);
- //log.info("After=" + changesContainer.toString());
- for (ChangesContainer cacheChange : changesContainer)
+ try
{
- cacheChange.apply();
+ //log.info("Before=" + changesContainer.toString());
+ Collections.sort(changesContainer);
+ //log.info("After=" + changesContainer.toString());
+ for (ChangesContainer cacheChange : changesContainer)
+ {
+ cacheChange.apply();
+ }
}
- changesList.set(null);
+ finally
+ {
+ changesList.set(null);
+ }
}
/**
@@ -83,7 +87,6 @@
*/
public void addCacheListener(Object listener)
{
-
parentCache.addCacheListener(listener);
}
@@ -93,7 +96,6 @@
public void addInterceptor(CommandInterceptor i, Class<? extends CommandInterceptor> afterInterceptor)
{
parentCache.addInterceptor(i, afterInterceptor);
-
}
/* (non-Javadoc)
@@ -111,7 +113,6 @@
public void clearData(Fqn fqn)
{
parentCache.clearData(fqn);
-
}
/* (non-Javadoc)
@@ -129,7 +130,6 @@
public void create() throws CacheException
{
parentCache.create();
-
}
/* (non-Javadoc)
@@ -138,7 +138,6 @@
public void destroy()
{
parentCache.destroy();
-
}
/* (non-Javadoc)
@@ -146,7 +145,6 @@
*/
public void endBatch(boolean successful)
{
-
parentCache.endBatch(successful);
}
@@ -157,7 +155,6 @@
public void evict(Fqn fqn, boolean recursive)
{
parentCache.evict(fqn, recursive);
-
}
/* (non-Javadoc)
@@ -166,7 +163,6 @@
public void evict(Fqn fqn)
{
parentCache.evict(fqn);
-
}
/* (non-Javadoc)
@@ -174,7 +170,6 @@
*/
public Object get(Fqn fqn, Serializable key)
{
-
return parentCache.get(fqn, key);
}
@@ -183,7 +178,6 @@
*/
public Object get(String fqn, Serializable key)
{
-
return parentCache.get(fqn, key);
}
@@ -192,7 +186,6 @@
*/
public Set<Object> getCacheListeners()
{
-
return parentCache.getCacheListeners();
}
@@ -201,7 +194,6 @@
*/
public CacheStatus getCacheStatus()
{
-
return parentCache.getCacheStatus();
}
@@ -210,7 +202,6 @@
*/
public Set<Object> getChildrenNames(Fqn fqn)
{
-
return parentCache.getChildrenNames(fqn);
}
@@ -219,7 +210,6 @@
*/
public Set<String> getChildrenNames(String fqn)
{
-
return parentCache.getChildrenNames(fqn);
}
@@ -228,7 +218,6 @@
*/
public Configuration getConfiguration()
{
-
return parentCache.getConfiguration();
}
@@ -237,7 +226,6 @@
*/
public Map<Serializable, Object> getData(Fqn fqn)
{
-
return parentCache.getData(fqn);
}
@@ -246,7 +234,6 @@
*/
public InvocationContext getInvocationContext()
{
-
return parentCache.getInvocationContext();
}
@@ -255,7 +242,6 @@
*/
public Set<Serializable> getKeys(Fqn fqn)
{
-
return parentCache.getKeys(fqn);
}
@@ -264,7 +250,6 @@
*/
public Set<Serializable> getKeys(String fqn)
{
-
return parentCache.getKeys(fqn);
}
@@ -273,7 +258,6 @@
*/
public Address getLocalAddress()
{
-
return parentCache.getLocalAddress();
}
@@ -282,7 +266,6 @@
*/
public List<Address> getMembers()
{
-
return parentCache.getMembers();
}
@@ -291,7 +274,6 @@
*/
public Node<Serializable, Object> getNode(Fqn fqn)
{
-
return parentCache.getNode(fqn);
}
@@ -300,7 +282,6 @@
*/
public Node<Serializable, Object> getNode(String fqn)
{
-
return parentCache.getNode(fqn);
}
@@ -309,7 +290,6 @@
*/
public Region getRegion(Fqn fqn, boolean createIfAbsent)
{
-
return parentCache.getRegion(fqn, createIfAbsent);
}
@@ -318,7 +298,6 @@
*/
public Node<Serializable, Object> getRoot()
{
-
return parentCache.getRoot();
}
@@ -327,7 +306,6 @@
*/
public String getVersion()
{
-
return parentCache.getVersion();
}
@@ -336,7 +314,6 @@
*/
public boolean isLeaf(Fqn fqn)
{
-
return parentCache.isLeaf(fqn);
}
@@ -345,7 +322,6 @@
*/
public boolean isLeaf(String fqn)
{
-
return parentCache.isLeaf(fqn);
}
@@ -355,7 +331,6 @@
public void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException
{
parentCache.move(nodeToMove, newParent);
-
}
/* (non-Javadoc)
@@ -363,7 +338,6 @@
*/
public void move(String nodeToMove, String newParent) throws NodeNotExistsException
{
-
parentCache.move(nodeToMove, newParent);
}
@@ -376,7 +350,7 @@
List<ChangesContainer> changesContainer = changesList.get();
if (changesContainer == null)
{
- throw new IllegalStateException("changesContainer == null");
+ throw new IllegalStateException("changesContainer should not be empty");
}
changesContainer.add(new PutObjectContainer(fqn, data, parentCache));
}
@@ -389,7 +363,7 @@
List<ChangesContainer> changesContainer = changesList.get();
if (changesContainer == null)
{
- throw new IllegalStateException("changesContainer == null");
+ throw new IllegalStateException("changesContainer should not be empty");
}
changesContainer.add(new PutKeyValueContainer(fqn, key, value, parentCache));
@@ -401,9 +375,8 @@
*/
public void put(String fqn, Map<? extends Serializable, ? extends Object> data)
{
- throw new IllegalStateException(
- "Unexpected method call use put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)");
- //parentCache.put(fqn, data);
+ throw new UnsupportedOperationException(
+ "Unexpected method call use put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)");
}
/* (non-Javadoc)
@@ -411,8 +384,7 @@
*/
public Object put(String fqn, Serializable key, Object value)
{
-
- throw new IllegalStateException("Unexpected method call use put(Fqn fqn, Serializable key, Object value)");
+ throw new UnsupportedOperationException("Unexpected method call use put(Fqn fqn, Serializable key, Object value)");
}
/* (non-Javadoc)
@@ -420,8 +392,7 @@
*/
public void putForExternalRead(Fqn fqn, Serializable key, Object value)
{
-
- throw new IllegalStateException("Unexpected method call ");
+ throw new UnsupportedOperationException("Unexpected method call ");
}
/* (non-Javadoc)
@@ -432,7 +403,7 @@
List<ChangesContainer> changesContainer = changesList.get();
if (changesContainer == null)
{
- throw new IllegalStateException("changesContainer == null");
+ throw new IllegalStateException("changesContainer should not be empty");
}
changesContainer.add(new RemoveKeyContainer(fqn, key, parentCache));
return parentCache.get(fqn, key);
@@ -443,8 +414,7 @@
*/
public Object remove(String fqn, Serializable key)
{
-
- throw new IllegalStateException("Unexpected method call. Use remove(Fqn fqn, Serializable key)");
+ throw new UnsupportedOperationException("Unexpected method call. Use remove(Fqn fqn, Serializable key)");
}
/* (non-Javadoc)
@@ -452,7 +422,6 @@
*/
public void removeCacheListener(Object listener)
{
-
parentCache.removeCacheListener(listener);
}
@@ -461,7 +430,6 @@
*/
public void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
{
-
parentCache.removeInterceptor(interceptorType);
}
@@ -470,7 +438,6 @@
*/
public void removeInterceptor(int position)
{
-
parentCache.removeInterceptor(position);
}
@@ -482,7 +449,7 @@
List<ChangesContainer> changesContainer = changesList.get();
if (changesContainer == null)
{
- throw new IllegalStateException("changesContainer == null");
+ throw new IllegalStateException("changesContainer should not be empty");
}
changesContainer.add(new RemoveNodeContainer(fqn, parentCache));
return true;
@@ -493,8 +460,7 @@
*/
public boolean removeNode(String fqn)
{
-
- throw new IllegalStateException("Unexpected method call. Use remove removeNode(Fqn fqn)");
+ throw new UnsupportedOperationException("Unexpected method call. Use remove removeNode(Fqn fqn)");
}
/* (non-Javadoc)
@@ -502,8 +468,7 @@
*/
public boolean removeRegion(Fqn fqn)
{
-
- throw new IllegalStateException("Unexpected method call ");
+ return parentCache.removeRegion(fqn);
}
/* (non-Javadoc)
@@ -512,7 +477,6 @@
public void setInvocationContext(InvocationContext ctx)
{
parentCache.setInvocationContext(ctx);
-
}
/* (non-Javadoc)
@@ -520,7 +484,6 @@
*/
public void start() throws CacheException
{
-
parentCache.start();
}
@@ -530,7 +493,6 @@
public void startBatch()
{
parentCache.startBatch();
-
}
/* (non-Javadoc)
@@ -539,7 +501,6 @@
public void stop()
{
parentCache.stop();
-
}
public TransactionManager getTransactionManager()
@@ -547,12 +508,9 @@
return ((CacheSPI<Serializable, Object>)parentCache).getTransactionManager();
}
- interface ChangesType
+ private static enum ChangesType
{
- int REMOVED = 0;
-
- int ADDED = 1;
-
+ REMOVED, ADDED;
}
/**
@@ -560,15 +518,15 @@
* @author sj
*
*/
- private abstract class ChangesContainer implements Comparable<ChangesContainer>
+ private static abstract class ChangesContainer implements Comparable<ChangesContainer>
{
protected final Fqn fqn;
- protected final int changesType;
+ protected final ChangesType changesType;
protected final Cache<Serializable, Object> cache;
- public ChangesContainer(Fqn fqn, int changesType, Cache<Serializable, Object> cache)
+ public ChangesContainer(Fqn fqn, ChangesType changesType, Cache<Serializable, Object> cache)
{
super();
this.fqn = fqn;
@@ -587,7 +545,7 @@
/**
* @return the changesType
*/
- public int getChangesType()
+ public ChangesType getChangesType()
{
return changesType;
}
@@ -598,19 +556,13 @@
@Override
public String toString()
{
-
return fqn + " type=" + changesType;
}
public int compareTo(ChangesContainer o)
{
-// if (changesType != o.getChangesType())
-// {
-// //removed first
-// return changesType == ChangesType.REMOVED ? -1 : 1;
-// }
-
- return fqn.compareTo(o.getFqn());
+ int result = fqn.compareTo(o.getFqn());
+ return result == 0 ? -1 : result;
}
public abstract void apply();
@@ -621,7 +573,7 @@
* @author sj
*
*/
- private class PutObjectContainer extends ChangesContainer
+ private static class PutObjectContainer extends ChangesContainer
{
private final Map<? extends Serializable, ? extends Object> data;
@@ -645,7 +597,7 @@
* @author sj
*
*/
- private class PutKeyValueContainer extends ChangesContainer
+ private static class PutKeyValueContainer extends ChangesContainer
{
private final Serializable key;
@@ -654,7 +606,6 @@
public PutKeyValueContainer(Fqn fqn, Serializable key, Object value, Cache<Serializable, Object> cache)
{
super(fqn, ChangesType.ADDED, cache);
- // TODO Auto-generated constructor stub
this.key = key;
this.value = value;
}
@@ -671,7 +622,7 @@
* @author sj
*
*/
- private class RemoveKeyContainer extends ChangesContainer
+ private static class RemoveKeyContainer extends ChangesContainer
{
private final Serializable key;
@@ -695,22 +646,18 @@
* @author sj
*
*/
- private class RemoveNodeContainer extends ChangesContainer
+ private static class RemoveNodeContainer extends ChangesContainer
{
public RemoveNodeContainer(Fqn fqn, Cache<Serializable, Object> cache)
{
super(fqn, ChangesType.REMOVED, cache);
-
}
@Override
public void apply()
{
cache.removeNode(fqn);
-
}
-
}
-
}
16 years, 4 months
exo-jcr SVN: r1318 - in kernel/trunk/exo.kernel.container/src: test/resources/xsd_1_0 and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-07 16:14:03 -0500 (Thu, 07 Jan 2010)
New Revision: 1318
Modified:
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml
Log:
EXOJCR-374 : Wrong type declaration for map in kernel XSD
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2010-01-07 20:38:29 UTC (rev 1317)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2010-01-07 21:14:03 UTC (rev 1318)
@@ -39,16 +39,16 @@
<xsd:complexType name="mapType">
<xsd:sequence>
- <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="entry" type="entryType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
+ <xsd:attribute name="type" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="collectionType">
<xsd:sequence>
<xsd:element name="value" type="valueType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
- <xsd:attribute name="type" type="xsd:string"/>
+ <xsd:attribute name="type" type="xsd:string" use="required"/>
<xsd:attribute name="item-type" type="xsd:string"/>
</xsd:complexType>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2010-01-07 20:38:29 UTC (rev 1317)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2010-01-07 21:14:03 UTC (rev 1318)
@@ -37,9 +37,9 @@
<xsd:complexType name="mapType">
<xsd:sequence>
- <xsd:element name="type" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="entry" type="entryType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
+ <xsd:attribute name="type" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType name="collectionType">
@@ -54,7 +54,7 @@
</xsd:complexType>
</xsd:element>
</xsd:sequence>
- <xsd:attribute name="type" type="xsd:string"/>
+ <xsd:attribute name="type" type="xsd:string" use="required"/>
<xsd:attribute name="item-type" type="xsd:string"/>
</xsd:complexType>
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml 2010-01-07 20:38:29 UTC (rev 1317)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml 2010-01-07 21:14:03 UTC (rev 1318)
@@ -32,8 +32,7 @@
<name>configuration</name>
<object type="org.exoplatform.services.organization.idm.Config">
<field name="typeMappings">
- <map>
- <type>java.util.HashMap</type>
+ <map type="java">
<entry>
<key><string>/</string></key>
<value><string>root</string></value>
@@ -45,4 +44,44 @@
</init-params>
</component>
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="package.name">
+ <field name="string"><string>This is a string</string></field>
+ <field name="int"><int>1234</int></field>
+ <field name="long"><long>123456</long></field>
+ <field name="double"><double>1.1234</double></field>
+ <field name="boolean"><boolean>true</boolean></field>
+ <field name="name">
+ <object type="package.name">
+ <field name="nested 1"><string>value</string></field>
+ <field name="nested 2"><int>1234</int></field>
+ </object>
+ </field>
+ <field name="map">
+ <map type="java.util.HashMap">
+ <entry>
+ <key><string>akey</string></key>
+ <value><string>a value</string></value>
+ </entry>
+ <entry>
+ <key><int>1234</int></key>
+ <value><string>a value</string></value>
+ </entry>
+ </map>
+ </field>
+ <field name="list">
+ <collection type="java.util.ArrayList">
+ <value><string>a value</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+</component>
+
</configuration>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml 2010-01-07 20:38:29 UTC (rev 1317)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml 2010-01-07 21:14:03 UTC (rev 1318)
@@ -24,25 +24,64 @@
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
- <component>
- <key>org.exoplatform.services.naming.InitialContextInitializer</key>
- <type>org.exoplatform.services.naming.InitialContextInitializer</type>
- <init-params>
- <object-param>
- <name>configuration</name>
- <object type="org.exoplatform.services.organization.idm.Config">
- <field name="typeMappings">
- <map>
- <type>java.util.HashMap</type>
- <entry>
- <key><string>/</string></key>
- <value><string>root</string></value>
- </entry>
- </map>
- </field>
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <field name="typeMappings">
+ <map type="java">
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root</string></value>
+ </entry>
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+</component>
+
+<component>
+<key>org.exoplatform.services.naming.InitialContextInitializer</key>
+<type>org.exoplatform.services.naming.InitialContextInitializer</type>
+<init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="package.name">
+ <field name="string"><string>This is a string</string></field>
+ <field name="int"><int>1234</int></field>
+ <field name="long"><long>123456</long></field>
+ <field name="double"><double>1.1234</double></field>
+ <field name="boolean"><boolean>true</boolean></field>
+ <field name="name">
+ <object type="package.name">
+ <field name="nested 1"><string>value</string></field>
+ <field name="nested 2"><int>1234</int></field>
</object>
- </object-param>
- </init-params>
- </component>
+ </field>
+ <field name="map">
+ <map type="java.util.HashMap">
+ <entry>
+ <key><string>akey</string></key>
+ <value><string>a value</string></value>
+ </entry>
+ <entry>
+ <key><int>1234</int></key>
+ <value><string>a value</string></value>
+ </entry>
+ </map>
+ </field>
+ <field name="list">
+ <collection type="java.util.ArrayList">
+ <value><string>a value</string></value>
+ </collection>
+ </field>
+ </object>
+ </object-param>
+</init-params>
+</component>
</configuration>
\ No newline at end of file
16 years, 4 months
exo-jcr SVN: r1317 - in kernel/trunk/exo.kernel.container/src: test/java/org/exoplatform/container/configuration and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-01-07 15:38:29 -0500 (Thu, 07 Jan 2010)
New Revision: 1317
Added:
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml
Modified:
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java
kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml
Log:
EXOJCR-373 : BaseObjectType XSD type should not be abstract
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2010-01-07 20:29:34 UTC (rev 1316)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_0.xsd 2010-01-07 20:38:29 UTC (rev 1317)
@@ -9,7 +9,7 @@
<xsd:element name="configuration" type="configurationType"/>
- <xsd:complexType abstract="true" name="baseObjectType">
+ <xsd:complexType name="baseObjectType">
<xsd:choice>
<xsd:element name="string" type="xsd:string"/>
<xsd:element name="int" type="xsd:int"/>
Modified: kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2010-01-07 20:29:34 UTC (rev 1316)
+++ kernel/trunk/exo.kernel.container/src/main/resources/org/exoplatform/container/configuration/kernel-configuration_1_1.xsd 2010-01-07 20:38:29 UTC (rev 1317)
@@ -13,7 +13,7 @@
<xsd:attribute name="profiles" type="xsd:string"/>
</xsd:complexType>
- <xsd:complexType abstract="true" name="baseObjectType">
+ <xsd:complexType name="baseObjectType">
<xsd:choice>
<xsd:element name="string" type="xsd:string"/>
<xsd:element name="int" type="xsd:int"/>
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java 2010-01-07 20:29:34 UTC (rev 1316)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_0.java 2010-01-07 20:38:29 UTC (rev 1317)
@@ -58,6 +58,6 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(16, count);
+ assertEquals(17, count);
}
}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java 2010-01-07 20:29:34 UTC (rev 1316)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/configuration/TestXSD_1_1.java 2010-01-07 20:38:29 UTC (rev 1317)
@@ -58,6 +58,6 @@
fail("Was not expecting such exception " + e.getMessage());
}
}
- assertEquals(17, count);
+ assertEquals(18, count);
}
}
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_0/sample-configuration-17.xml 2010-01-07 20:38:29 UTC (rev 1317)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<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.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <init-params>
+ <object-param>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <field name="typeMappings">
+ <map>
+ <type>java.util.HashMap</type>
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root</string></value>
+ </entry>
+ </map>
+ </field>
+ </object>
+ </object-param>
+ </init-params>
+ </component>
+
+</configuration>
\ No newline at end of file
Modified: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml 2010-01-07 20:29:34 UTC (rev 1316)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-17.xml 2010-01-07 20:38:29 UTC (rev 1317)
@@ -24,72 +24,25 @@
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
- <component>
+ <component>
<key>org.exoplatform.services.naming.InitialContextInitializer</key>
<type>org.exoplatform.services.naming.InitialContextInitializer</type>
- </component>
-
- <component profiles="a">
- <key>org.exoplatform.services.naming.InitialContextInitializer</key>
- <type>org.exoplatform.services.naming.InitialContextInitializer</type>
- </component>
-
- <component profiles="a,b">
- <key>org.exoplatform.services.naming.InitialContextInitializer</key>
- <type>org.exoplatform.services.naming.InitialContextInitializer</type>
- </component>
-
- <component>
- <key>org.exoplatform.services.naming.InitialContextInitializer</key>
- <type>org.exoplatform.services.naming.InitialContextInitializer</type>
<init-params>
<object-param>
- <name>object</name>
- <object type="object"></object>
+ <name>configuration</name>
+ <object type="org.exoplatform.services.organization.idm.Config">
+ <field name="typeMappings">
+ <map>
+ <type>java.util.HashMap</type>
+ <entry>
+ <key><string>/</string></key>
+ <value><string>root</string></value>
+ </entry>
+ </map>
+ </field>
+ </object>
</object-param>
- <object-param profiles="a">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <object-param profiles="a,b">
- <name>object</name>
- <object type="object"></object>
- </object-param>
- <properties-param>
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a">
- <name>properties</name>
- </properties-param>
- <properties-param profiles="a,b">
- <name>properties</name>
- </properties-param>
- <value-param>
- <name>value</name>
- <value>value</value>
- </value-param>
- <value-param profiles="a">
- <name>value</name>
- <value>value</value>
- </value-param>
- <value-param profiles="a,b">
- <name>value</name>
- <value>value</value>
- </value-param>
- <values-param>
- <name>values</name>
- </values-param>
- <values-param profiles="a">
- <name>values</name>
- </values-param>
- <values-param profiles="a,b">
- <name>values</name>
- </values-param>
</init-params>
</component>
- <import>import_1</import>
- <import profiles="a">import_1</import>
- <import profiles="a,b">import_1</import>
-
</configuration>
\ No newline at end of file
Added: kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml (rev 0)
+++ kernel/trunk/exo.kernel.container/src/test/resources/xsd_1_1/sample-configuration-18.xml 2010-01-07 20:38:29 UTC (rev 1317)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<configuration
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
+
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ </component>
+
+ <component profiles="a">
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ </component>
+
+ <component profiles="a,b">
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ </component>
+
+ <component>
+ <key>org.exoplatform.services.naming.InitialContextInitializer</key>
+ <type>org.exoplatform.services.naming.InitialContextInitializer</type>
+ <init-params>
+ <object-param>
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <object-param profiles="a,b">
+ <name>object</name>
+ <object type="object"></object>
+ </object-param>
+ <properties-param>
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a">
+ <name>properties</name>
+ </properties-param>
+ <properties-param profiles="a,b">
+ <name>properties</name>
+ </properties-param>
+ <value-param>
+ <name>value</name>
+ <value>value</value>
+ </value-param>
+ <value-param profiles="a">
+ <name>value</name>
+ <value>value</value>
+ </value-param>
+ <value-param profiles="a,b">
+ <name>value</name>
+ <value>value</value>
+ </value-param>
+ <values-param>
+ <name>values</name>
+ </values-param>
+ <values-param profiles="a">
+ <name>values</name>
+ </values-param>
+ <values-param profiles="a,b">
+ <name>values</name>
+ </values-param>
+ </init-params>
+ </component>
+
+ <import>import_1</import>
+ <import profiles="a">import_1</import>
+ <import profiles="a,b">import_1</import>
+
+</configuration>
\ No newline at end of file
16 years, 4 months
exo-jcr SVN: r1316 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-01-07 15:29:34 -0500 (Thu, 07 Jan 2010)
New Revision: 1316
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
Log:
EXOJCR-302: getProperties without value updated
Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-07 16:38:57 UTC (rev 1315)
+++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-01-07 20:29:34 UTC (rev 1316)
@@ -619,11 +619,15 @@
do
{
int orderNum = resultSet.getInt(COLUMN_VORDERNUM);
- final String storageId = resultSet.getString(COLUMN_VSTORAGE_DESC);
- ValueData vdata =
- resultSet.wasNull() ? readValueData(cid, orderNum, cversion, resultSet.getBinaryStream(COLUMN_VDATA))
- : readValueData(identifier, orderNum, storageId);
- data.add(vdata);
+ //check is there value columns
+ if (!resultSet.wasNull())
+ {
+ final String storageId = resultSet.getString(COLUMN_VSTORAGE_DESC);
+ ValueData vdata =
+ resultSet.wasNull() ? readValueData(cid, orderNum, cversion, resultSet.getBinaryStream(COLUMN_VDATA))
+ : readValueData(identifier, orderNum, storageId);
+ data.add(vdata);
+ }
}
while (resultSet.next() && resultSet.getString(COLUMN_ID).equals(cid));
16 years, 4 months
exo-jcr SVN: r1315 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2010-01-07 11:38:57 -0500 (Thu, 07 Jan 2010)
New Revision: 1315
Added:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java
Log:
EXOJCR-371: initial implementation of Buffered cache
Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java 2010-01-07 16:38:57 UTC (rev 1315)
@@ -0,0 +1,716 @@
+package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.CacheStatus;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.Node;
+import org.jboss.cache.NodeNotExistsException;
+import org.jboss.cache.Region;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
+import org.jgroups.Address;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.transaction.TransactionManager;
+
+public class BufferedJbossCache implements Cache<Serializable, Object>
+{
+ private final Log log = ExoLogger.getLogger(BufferedJbossCache.class);
+
+ /**
+ * Parent cache.
+ */
+ private final Cache<Serializable, Object> parentCache;
+
+ private ThreadLocal<List<ChangesContainer>> changesList = new ThreadLocal<List<ChangesContainer>>();
+
+ public BufferedJbossCache(Cache<Serializable, Object> parentCache)
+ {
+ super();
+ this.parentCache = parentCache;
+ }
+
+ /**
+ * Start buffering process.
+ */
+ public void beginTransaction()
+ {
+ changesList.set(new ArrayList<ChangesContainer>());
+ }
+
+ /**
+ * Sort changes and commit data to the cache.
+ */
+ public void commitTransaction()
+ {
+
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer == null");
+ }
+ //log.info("Before=" + changesContainer.toString());
+ Collections.sort(changesContainer);
+ //log.info("After=" + changesContainer.toString());
+ for (ChangesContainer cacheChange : changesContainer)
+ {
+ cacheChange.apply();
+ }
+ changesList.set(null);
+ }
+
+ /**
+ * Forget about changes
+ */
+ public void rollbackTransaction()
+ {
+ changesList.set(null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#addCacheListener(java.lang.Object)
+ */
+ public void addCacheListener(Object listener)
+ {
+
+ parentCache.addCacheListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#addInterceptor(org.jboss.cache.interceptors.base.CommandInterceptor, java.lang.Class)
+ */
+ public void addInterceptor(CommandInterceptor i, Class<? extends CommandInterceptor> afterInterceptor)
+ {
+ parentCache.addInterceptor(i, afterInterceptor);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#addInterceptor(org.jboss.cache.interceptors.base.CommandInterceptor, int)
+ */
+ public void addInterceptor(CommandInterceptor i, int position)
+ {
+ parentCache.addInterceptor(i, position);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#clearData(org.jboss.cache.Fqn)
+ */
+ public void clearData(Fqn fqn)
+ {
+ parentCache.clearData(fqn);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#clearData(java.lang.String)
+ */
+ public void clearData(String fqn)
+ {
+ parentCache.clearData(fqn);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#create()
+ */
+ public void create() throws CacheException
+ {
+ parentCache.create();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#destroy()
+ */
+ public void destroy()
+ {
+ parentCache.destroy();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#endBatch(boolean)
+ */
+ public void endBatch(boolean successful)
+ {
+
+ parentCache.endBatch(successful);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#evict(org.jboss.cache.Fqn, boolean)
+ */
+ public void evict(Fqn fqn, boolean recursive)
+ {
+ parentCache.evict(fqn, recursive);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#evict(org.jboss.cache.Fqn)
+ */
+ public void evict(Fqn fqn)
+ {
+ parentCache.evict(fqn);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#get(org.jboss.cache.Fqn, java.lang.Object)
+ */
+ public Object get(Fqn fqn, Serializable key)
+ {
+
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#get(java.lang.String, java.lang.Object)
+ */
+ public Object get(String fqn, Serializable key)
+ {
+
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getCacheListeners()
+ */
+ public Set<Object> getCacheListeners()
+ {
+
+ return parentCache.getCacheListeners();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getCacheStatus()
+ */
+ public CacheStatus getCacheStatus()
+ {
+
+ return parentCache.getCacheStatus();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getChildrenNames(org.jboss.cache.Fqn)
+ */
+ public Set<Object> getChildrenNames(Fqn fqn)
+ {
+
+ return parentCache.getChildrenNames(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getChildrenNames(java.lang.String)
+ */
+ public Set<String> getChildrenNames(String fqn)
+ {
+
+ return parentCache.getChildrenNames(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getConfiguration()
+ */
+ public Configuration getConfiguration()
+ {
+
+ return parentCache.getConfiguration();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getData(org.jboss.cache.Fqn)
+ */
+ public Map<Serializable, Object> getData(Fqn fqn)
+ {
+
+ return parentCache.getData(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getInvocationContext()
+ */
+ public InvocationContext getInvocationContext()
+ {
+
+ return parentCache.getInvocationContext();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getKeys(org.jboss.cache.Fqn)
+ */
+ public Set<Serializable> getKeys(Fqn fqn)
+ {
+
+ return parentCache.getKeys(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getKeys(java.lang.String)
+ */
+ public Set<Serializable> getKeys(String fqn)
+ {
+
+ return parentCache.getKeys(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getLocalAddress()
+ */
+ public Address getLocalAddress()
+ {
+
+ return parentCache.getLocalAddress();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getMembers()
+ */
+ public List<Address> getMembers()
+ {
+
+ return parentCache.getMembers();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getNode(org.jboss.cache.Fqn)
+ */
+ public Node<Serializable, Object> getNode(Fqn fqn)
+ {
+
+ return parentCache.getNode(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getNode(java.lang.String)
+ */
+ public Node<Serializable, Object> getNode(String fqn)
+ {
+
+ return parentCache.getNode(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getRegion(org.jboss.cache.Fqn, boolean)
+ */
+ public Region getRegion(Fqn fqn, boolean createIfAbsent)
+ {
+
+ return parentCache.getRegion(fqn, createIfAbsent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getRoot()
+ */
+ public Node<Serializable, Object> getRoot()
+ {
+
+ return parentCache.getRoot();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#getVersion()
+ */
+ public String getVersion()
+ {
+
+ return parentCache.getVersion();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#isLeaf(org.jboss.cache.Fqn)
+ */
+ public boolean isLeaf(Fqn fqn)
+ {
+
+ return parentCache.isLeaf(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#isLeaf(java.lang.String)
+ */
+ public boolean isLeaf(String fqn)
+ {
+
+ return parentCache.isLeaf(fqn);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#move(org.jboss.cache.Fqn, org.jboss.cache.Fqn)
+ */
+ public void move(Fqn nodeToMove, Fqn newParent) throws NodeNotExistsException
+ {
+ parentCache.move(nodeToMove, newParent);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#move(java.lang.String, java.lang.String)
+ */
+ public void move(String nodeToMove, String newParent) throws NodeNotExistsException
+ {
+
+ parentCache.move(nodeToMove, newParent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(org.jboss.cache.Fqn, java.util.Map)
+ */
+ public void put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)
+ {
+ //parentCache.put(fqn, data);
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer == null");
+ }
+ changesContainer.add(new PutObjectContainer(fqn, data, parentCache));
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
+ */
+ public Object put(Fqn fqn, Serializable key, Object value)
+ {
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer == null");
+ }
+ changesContainer.add(new PutKeyValueContainer(fqn, key, value, parentCache));
+
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(java.lang.String, java.util.Map)
+ */
+ public void put(String fqn, Map<? extends Serializable, ? extends Object> data)
+ {
+ throw new IllegalStateException(
+ "Unexpected method call use put(Fqn fqn, Map<? extends Serializable, ? extends Object> data)");
+ //parentCache.put(fqn, data);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#put(java.lang.String, java.lang.Object, java.lang.Object)
+ */
+ public Object put(String fqn, Serializable key, Object value)
+ {
+
+ throw new IllegalStateException("Unexpected method call use put(Fqn fqn, Serializable key, Object value)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#putForExternalRead(org.jboss.cache.Fqn, java.lang.Object, java.lang.Object)
+ */
+ public void putForExternalRead(Fqn fqn, Serializable key, Object value)
+ {
+
+ throw new IllegalStateException("Unexpected method call ");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#remove(org.jboss.cache.Fqn, java.lang.Object)
+ */
+ public Object remove(Fqn fqn, Serializable key)
+ {
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer == null");
+ }
+ changesContainer.add(new RemoveKeyContainer(fqn, key, parentCache));
+ return parentCache.get(fqn, key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#remove(java.lang.String, java.lang.Object)
+ */
+ public Object remove(String fqn, Serializable key)
+ {
+
+ throw new IllegalStateException("Unexpected method call. Use remove(Fqn fqn, Serializable key)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeCacheListener(java.lang.Object)
+ */
+ public void removeCacheListener(Object listener)
+ {
+
+ parentCache.removeCacheListener(listener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeInterceptor(java.lang.Class)
+ */
+ public void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
+ {
+
+ parentCache.removeInterceptor(interceptorType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeInterceptor(int)
+ */
+ public void removeInterceptor(int position)
+ {
+
+ parentCache.removeInterceptor(position);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeNode(org.jboss.cache.Fqn)
+ */
+ public boolean removeNode(Fqn fqn)
+ {
+ List<ChangesContainer> changesContainer = changesList.get();
+ if (changesContainer == null)
+ {
+ throw new IllegalStateException("changesContainer == null");
+ }
+ changesContainer.add(new RemoveNodeContainer(fqn, parentCache));
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeNode(java.lang.String)
+ */
+ public boolean removeNode(String fqn)
+ {
+
+ throw new IllegalStateException("Unexpected method call. Use remove removeNode(Fqn fqn)");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#removeRegion(org.jboss.cache.Fqn)
+ */
+ public boolean removeRegion(Fqn fqn)
+ {
+
+ throw new IllegalStateException("Unexpected method call ");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#setInvocationContext(org.jboss.cache.InvocationContext)
+ */
+ public void setInvocationContext(InvocationContext ctx)
+ {
+ parentCache.setInvocationContext(ctx);
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#start()
+ */
+ public void start() throws CacheException
+ {
+
+ parentCache.start();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#startBatch()
+ */
+ public void startBatch()
+ {
+ parentCache.startBatch();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.cache.Cache#stop()
+ */
+ public void stop()
+ {
+ parentCache.stop();
+
+ }
+
+ public TransactionManager getTransactionManager()
+ {
+ return ((CacheSPI<Serializable, Object>)parentCache).getTransactionManager();
+ }
+
+ interface ChangesType
+ {
+ int REMOVED = 0;
+
+ int ADDED = 1;
+
+ }
+
+ /**
+ * Container for changes
+ * @author sj
+ *
+ */
+ private abstract class ChangesContainer implements Comparable<ChangesContainer>
+ {
+ protected final Fqn fqn;
+
+ protected final int changesType;
+
+ protected final Cache<Serializable, Object> cache;
+
+ public ChangesContainer(Fqn fqn, int changesType, Cache<Serializable, Object> cache)
+ {
+ super();
+ this.fqn = fqn;
+ this.changesType = changesType;
+ this.cache = cache;
+ }
+
+ /**
+ * @return the fqn
+ */
+ public Fqn getFqn()
+ {
+ return fqn;
+ }
+
+ /**
+ * @return the changesType
+ */
+ public int getChangesType()
+ {
+ return changesType;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+
+ return fqn + " type=" + changesType;
+ }
+
+ public int compareTo(ChangesContainer o)
+ {
+// if (changesType != o.getChangesType())
+// {
+// //removed first
+// return changesType == ChangesType.REMOVED ? -1 : 1;
+// }
+
+ return fqn.compareTo(o.getFqn());
+ }
+
+ public abstract void apply();
+ }
+
+ /**
+ * Put object container;
+ * @author sj
+ *
+ */
+ private class PutObjectContainer extends ChangesContainer
+ {
+ private final Map<? extends Serializable, ? extends Object> data;
+
+ public PutObjectContainer(Fqn fqn, Map<? extends Serializable, ? extends Object> data,
+ Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.ADDED, cache);
+
+ this.data = data;
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.put(fqn, data);
+ }
+ }
+
+ /**
+ * Put container.
+ * @author sj
+ *
+ */
+ private class PutKeyValueContainer extends ChangesContainer
+ {
+ private final Serializable key;
+
+ private final Object value;
+
+ public PutKeyValueContainer(Fqn fqn, Serializable key, Object value, Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.ADDED, cache);
+ // TODO Auto-generated constructor stub
+ this.key = key;
+ this.value = value;
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.put(fqn, key, value);
+ }
+ }
+
+ /**
+ * Remove container.
+ * @author sj
+ *
+ */
+ private class RemoveKeyContainer extends ChangesContainer
+ {
+ private final Serializable key;
+
+ public RemoveKeyContainer(Fqn fqn, Serializable key, Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.REMOVED, cache);
+ this.key = key;
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.remove(fqn, key);
+
+ }
+
+ }
+
+ /**
+ * Remove container.
+ * @author sj
+ *
+ */
+ private class RemoveNodeContainer extends ChangesContainer
+ {
+
+ public RemoveNodeContainer(Fqn fqn, Cache<Serializable, Object> cache)
+ {
+ super(fqn, ChangesType.REMOVED, cache);
+
+ }
+
+ @Override
+ public void apply()
+ {
+ cache.removeNode(fqn);
+
+ }
+
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/BufferedJbossCache.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 4 months