From do-not-reply at jboss.org Sun Nov 1 17:06:48 2009 Content-Type: multipart/mixed; boundary="===============6692315803463131077==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r461 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Sun, 01 Nov 2009 17:06:48 -0500 Message-ID: <200911012206.nA1M6mJ3001920@svn01.web.mwc.hst.phx2.redhat.com> --===============6692315803463131077== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-01 17:06:48 -0500 (Sun, 01 Nov 2009) New Revision: 461 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java Log: EXOJCR-200: connection new hierarchy; paths fixes Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-01 22:06:= 48 UTC (rev 461) @@ -0,0 +1,104 @@ +/* + * 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. + */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.jboss.cache.Fqn; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 31.10.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public abstract class JBossCacheStorage +{ + + public static final String TREE =3D "$TREE".intern(); + + public static final String ITEMS =3D "$ITEMS".intern(); + + public static final String ITEM_DATA =3D "$data".intern(); + + public static final String ITEM_ID =3D "$id".intern(); + + protected final Fqn treeRoot; + + protected final Fqn itemsRoot; + + protected JBossCacheStorage(Fqn treeRoot, Fqn itemsRoot) + { + this.treeRoot =3D treeRoot; + this.itemsRoot =3D itemsRoot; + } + + protected Fqn makeNodeFqn(QPath nodePath) + { + QPathEntry[] path =3D nodePath.getEntries(); + String[] fqns =3D new String[path.length]; + + for (int i =3D 0; i < path.length; i++) + { + fqns[i] =3D path[i].getAsString(true); + } + + return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); + } + + protected Fqn makeParentFqn(QPath propertyPath) + { + QPathEntry[] path =3D propertyPath.getEntries(); + int pathLen =3D path.length - 1; + String[] fqns =3D new String[pathLen]; + + for (int i =3D 0; i < pathLen; i++) + { + fqns[i] =3D path[i].getAsString(true); + } + + return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); + } + + protected Fqn makeIdFqn(String itemId) + { + return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromString(itemId)); + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-10= -30 22:03:54 UTC (rev 460) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -01 22:06:48 UTC (rev 461) @@ -18,12 +18,18 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -31,42 +37,29 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Node; = -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. * = *
Date: 23.10.2009
* * Cache contains several regions:
- * Workspace tree. /$repo_name/$ws_name/$ROOT: On each leaf (JBossCache No= de) an JCR Item Id stored.
- * Items map. /$repo_name/$ws_name/$ITEMS: Key=3DId, Value =3D ItemData. - * References map ??? /$repo_name/$ws_name/$REFS: Key=3DNodeId, Value =3D = PropertyId.
+ * Workspace tree. /$ROOT: On each leaf (JBossCache Node) an JCR Item Id s= tored.
+ * Items map. /$ITEMS: Key=3DId, Value =3D ItemData.
+ * References map ??? /$REFS: Key=3DNodeId, Value =3D PropertyId.
* * @author Peter N= edonosko = * @version $Id$ */ -public class JBossCacheStorageConnection extends DBConstants implements Wo= rkspaceStorageConnection +public class JBossCacheStorageConnection extends JBossCacheStorage impleme= nts WorkspaceStorageConnection { = protected static final Log LOG =3D ExoLogger.getLogger("jcr.JBossCacheS= torageConnection"); = - //public static final InternalQName NODE =3D new InternalQName(Constant= s.NS_DEFAULT_URI, "$node"); - public static final String ITEM_DATA =3D "$idata".intern(); - - public static final String ITEM_ID =3D "$id".intern(); - private final Cache cache; = - private final Node treeRoot; + //private final Node treeRoot; = - private final Node itemsRoot; + //private final Node itemsRoot; = /** * Start batching flag. 'true' if batching was started, 'false' if bat= ching is not start. = @@ -81,46 +74,13 @@ public JBossCacheStorageConnection(Cache cache, N= ode treeRoot, Node itemsRoot) { + super(treeRoot.getFqn(), itemsRoot.getFqn()); + = this.cache =3D cache; - this.itemsRoot =3D itemsRoot; - this.treeRoot =3D treeRoot; + //this.itemsRoot =3D itemsRoot; + //this.treeRoot =3D treeRoot; } = - private Fqn makeNodeFqn(QPath nodePath) - { - QPathEntry[] path =3D nodePath.getEntries(); - String[] fqns =3D new String[path.length]; - - for (int i =3D 0; i < path.length; i++) - { - fqns[i] =3D path[i].getAsString(true); - } - - // TODO make Fqn generation clearer = - return Fqn.fromRelativeFqn(treeRoot.getFqn(), Fqn.fromElements(fqns)= ); - } - - private Fqn makeParentFqn(QPath propertyPath) - { - QPathEntry[] path =3D propertyPath.getEntries(); - int pathLen =3D path.length - 1; - String[] fqns =3D new String[pathLen]; - - for (int i =3D 0; i < pathLen; i++) - { - fqns[i] =3D path[i].getAsString(true); - } - - // TODO make Fqn generation clearer = - return Fqn.fromRelativeFqn(treeRoot.getFqn(), Fqn.fromElements(fqns)= ); - } - - private Fqn makeIdFqn(String itemId) - { - // TODO make Fqn generation clearer = - return Fqn.fromRelativeFqn(itemsRoot.getFqn(), Fqn.fromString(itemId= )); - } - /** * {@inheritDoc} */ @@ -192,7 +152,6 @@ NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_DA= TA); if (node =3D=3D null) { - treePrint(treeRoot); throw new RepositoryException("One of childs is null. Parent "= + parent.getQPath().getAsString()); } childs.add(node); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-10-30 22:03:54 UTC (rev 460) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-01 22:06:48 UTC (rev 461) @@ -57,10 +57,6 @@ = public static final String JBOSSCACHE_CONFIG =3D "jbosscache-configurat= ion"; = - public static final String ROOT =3D "$ROOT".intern(); - - public static final String ITEMS =3D "$ITEMS".intern(); - protected static final Log LOG =3D ExoLogger.getLogger("jcr.JBossCacheW= orkspaceDataContainer"); = protected final String repositoryName; @@ -117,8 +113,8 @@ //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); = // prepare cache structures - this.tree =3D cacheRoot.addChild(Fqn.fromString(ROOT)); - this.items =3D cacheRoot.addChild(Fqn.fromString(ITEMS)); + this.tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.TR= EE)); + this.items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.I= TEMS)); } = public void start() --===============6692315803463131077==-- From do-not-reply at jboss.org Sun Nov 1 17:10:06 2009 Content-Type: multipart/mixed; boundary="===============5531758877548610168==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r462 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Sun, 01 Nov 2009 17:10:06 -0500 Message-ID: <200911012210.nA1MA6RP002424@svn01.web.mwc.hst.phx2.redhat.com> --===============5531758877548610168== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-01 17:10:06 -0500 (Sun, 01 Nov 2009) New Revision: 462 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader1.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java Log: EXOJCR-201: new loader: get, getChilds impls Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-11-01 22:06:= 48 UTC (rev 461) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-11-01 22:10:= 06 UTC (rev 462) @@ -3,7 +3,7 @@ * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 3 of + * 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, @@ -16,51 +16,59 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -import org.jboss.cache.CacheSPI; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.jboss.cache.Fqn; -import org.jboss.cache.Modification; -import org.jboss.cache.RegionManager; import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; import org.jboss.cache.factories.annotations.Inject; -import org.jboss.cache.loader.CacheLoader; +import org.jboss.cache.loader.AbstractCacheLoader; = -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. * = - *
Date: 23.10.2009 + *
Date: 31.10.2009 * * @author Peter N= edonosko = * @version $Id$ */ -public class ExoJCRCacheLoader implements CacheLoader +public class ExoJCRCacheLoader extends AbstractCacheLoader { - //private CacheSPI cache; = - //private RegionManager regionManager; - - private IndividualCacheLoaderConfig config; - private WorkspaceDataContainer dataContainer; = - private HashMap> transactions =3D new HashMa= p>(); - /** * Init the loader DataContainer with given WorkspaceDataContainer inst= ance. * @@ -77,25 +85,17 @@ this.dataContainer =3D dataContainer; } = - /** - * {@inheritDoc} - */ - public void commit(Object tx) throws Exception + protected QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberF= ormatException, IllegalNameException { - List modifications =3D transactions.remove(tx); - if (modifications !=3D null) - doModified(modifications); - else - throw new ExoJCRCacheLoaderException("Transaction " + tx + " not = exist in transaction table"); - } + List elements =3D nodeFqn.peekElements(); + QPathEntry[] path =3D new QPathEntry[elements.size()]; = - /** - * {@inheritDoc} - */ - public boolean exists(Fqn name) throws Exception - { - // TODO use get(Fqn), i.e. get Node!=3Dnull = - return false; + for (int i =3D 0; i < elements.size(); i++) + { + path[i] =3D QPathEntry.parse(elements.get(i)); + } + + return path; } = /** @@ -103,182 +103,182 @@ */ public Map get(Fqn name) throws Exception { - // TODO get Node - return null; - } = - /** - * {@inheritDoc} - */ - public Set getChildrenNames(Fqn fqn) throws Exception - { - // TODO get child nodes names - return null; - } + Map attrs =3D new LinkedHashMap(); + if (name.size() > 1) + { + if (name.get(1).equals(JBossCacheStorage.TREE)) + { + // return Node + if (name.size() > 3) + { + QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); = - /** - * {@inheritDoc} - */ - public IndividualCacheLoaderConfig getConfig() - { - return config; - } + // TODO non effective, in this way 1) all subtree will be c= ached + // 2) all subtree will be read from DB (with allprops) for = only Ids. + // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = + String parentId =3D (String)cache.get(name.getParent(), JBo= ssCacheStorage.ITEM_ID); = - /** - * {@inheritDoc} - */ - public void loadEntireState(ObjectOutputStream os) throws Exception - { - // TODO Auto-generated method stub + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + try + { + NodeData parent =3D (NodeData)conn.getItemData(parentId); = - } + ItemData item =3D conn.getItemData(parent, nodeName); = - /** - * {@inheritDoc} - */ - public void loadState(Fqn subtree, ObjectOutputStream os) throws Except= ion - { - // TODO Auto-generated method stub + // item Id + attrs.put(JBossCacheStorage.ITEM_ID, item.getIdentifier(= )); = + // if Node (Property cannot due to logic of StorageConne= ction) add props + for (PropertyData prop : conn.getChildPropertiesData(par= ent)) + { + attrs.put(prop.getQPath().getName().getAsString(), pr= op.getIdentifier()); + } + } + finally + { + conn.close(); + } + } + else + { + // root Node (/$TREE/[]:1) + attrs.put(JBossCacheStorage.ITEM_ID, Constants.ROOT_UUID); + } + } + else if (name.get(1).equals(JBossCacheStorage.ITEMS)) + { + // we have all data on thrid level = + if (name.size() =3D=3D 3) + { + // return Node or Property + String itemId =3D name.getLastElementAsString(); + + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + try + { + attrs.put(JBossCacheStorage.ITEM_DATA, conn.getItemData(= itemId)); + } + finally + { + conn.close(); + } + } + } + } + return attrs; } = /** * {@inheritDoc} */ - public void prepare(Object tx, List modifications, boolea= n onePhase) throws Exception + public boolean exists(Fqn name) throws Exception { - if (onePhase) - { - doModified(modifications); - } - else - { - transactions.put(tx, modifications); - } + // TODO do it with less cost + return get(name) !=3D null; } = /** - * Will be added data to DB. = - * = - * @param modifications - * @throws Exception + * {@inheritDoc} */ - private void doModified(List modifications) throws Except= ion + public Set getChildrenNames(Fqn fqn) throws Exception { - JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection)data= Container.openConnection(); + // return child nodes names = - try + Set childs =3D new LinkedHashSet(); + if (fqn.size() > 2) { - for (int modificatinIndex =3D 0; modificatinIndex < modifications= .size(); modificatinIndex++) + if (fqn.get(2).equals(JBossCacheStorage.TREE)) { - Modification md =3D modifications.get(modificatinIndex); - switch (md.getType()) + // return Node + if (fqn.size() > 3) { - case PUT_KEY_VALUE : - doAddOrUpdate(md, jdbcConnection); - break; - case REMOVE_NODE : - doRemove(md, jdbcConnection, "TODO $"); - break; - } - } + QPathEntry nodeName =3D QPathEntry.parse(fqn.getLastElement= AsString()); = - if (jdbcConnection !=3D null) - jdbcConnection.commit(); - } - finally - { - if (jdbcConnection !=3D null && jdbcConnection.isOpened()) - jdbcConnection.rollback(); - } - } + // TODO non effective, in this way 1) all subtree will be c= ached + // 2) all subtree will be read from DB (with allprops) for = only Ids. + // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = + String parentId =3D (String)cache.get(fqn.getParent(), JBos= sCacheStorage.ITEM_ID); = - private void doRemove(Modification modification, JDBCStorageConnection = jdbcConnection, String identifier) - throws IllegalStateException, RepositoryException - { + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + try + { + NodeData parent =3D (NodeData)conn.getItemData(parentId); = - ItemData itemData =3D jdbcConnection.getItemData(identifier); + NodeData node =3D (NodeData)conn.getItemData(parent, nod= eName); = - if (itemData instanceof NodeData) - jdbcConnection.delete((NodeData)itemData); - if (itemData instanceof PropertyData) - jdbcConnection.delete((PropertyData)itemData); - } - - /** - * Performs ADD and UPDATE to NodeData and PropertyData. - * @param modification - * @param jdbcConnection - * @throws IllegalStateException - * @throws RepositoryException - */ - private void doAddOrUpdate(Modification modification, JDBCStorageConnec= tion jdbcConnection) - throws IllegalStateException, RepositoryException - { - if (modification.getValue() instanceof NodeData) - { - //add or update node data - NodeData nodeData =3D (NodeData)modification.getValue(); - - ItemData itemData =3D jdbcConnection.getItemData(nodeData.getIden= tifier()); - - if (itemData =3D=3D null) - { - //add - jdbcConnection.add(nodeData); + // get child nodes by parent Id + for (NodeData prop : conn.getChildNodesData(node)) + { + childs + .add(node.getQPath().getEntries()[node.getQPath().= getEntries().length - 1].getAsString(true)); + } + } + finally + { + conn.close(); + } + } + else + { + // root Node (/$TREE/[]:1) + childs.add(Constants.ROOT_PATH.getEntries()[Constants.ROOT_= PATH.getEntries().length - 1] + .getAsString(true)); + } } - else + else if (fqn.get(2).equals(JBossCacheStorage.ITEMS)) { - //update - jdbcConnection.update(nodeData); + // we have all data on thrid level = + if (fqn.size() =3D=3D 3) + { + // return all Nodes and Properties Ids + +// WorkspaceStorageConnection conn =3D dataContainer.openCon= nection(); +// try +// { +// for (String itemId : conn.getAllItemIdentifiers()) +// { +// childs.add(itemId); +// } +// } +// finally +// { +// conn.close(); +// } + } } } - else if (modification.getValue() instanceof PropertyData) + else if (fqn.equals(Fqn.ROOT)) { - //add or update property data - PropertyData propertyData =3D (PropertyData)modification.getValue= (); - - ItemData itemData =3D jdbcConnection.getItemData(propertyData.get= Identifier()); - - if (itemData =3D=3D null) - { - //add - jdbcConnection.add(propertyData); - } - else - { - //update - jdbcConnection.update(propertyData); - } + childs.add(JBossCacheStorage.TREE); + childs.add(JBossCacheStorage.ITEMS); } + return childs; } = /** * {@inheritDoc} */ - public Object put(Fqn name, Object key, Object value) throws Exception + public IndividualCacheLoaderConfig getConfig() { - // i.e. put Property + // TODO Auto-generated method stub return null; } = /** * {@inheritDoc} */ - public void put(Fqn name, Map attributes) throws Except= ion + public Object put(Fqn name, Object key, Object value) throws Exception { - // i.e. put set of Properties = - = // TODO Auto-generated method stub - + return null; } = /** * {@inheritDoc} */ - public void put(List modifications) throws Exception + public void put(Fqn name, Map attributes) throws Except= ion { - = // TODO Auto-generated method stub = } @@ -288,7 +288,6 @@ */ public Object remove(Fqn fqn, Object key) throws Exception { - // i.e. remove Property // TODO Auto-generated method stub return null; } @@ -298,8 +297,6 @@ */ public void remove(Fqn fqn) throws Exception { - // i.e. remove Node - = // TODO Auto-generated method stub = } @@ -309,8 +306,6 @@ */ public void removeData(Fqn fqn) throws Exception { - // i.e. remove all Properties of Node = - = // TODO Auto-generated method stub = } @@ -318,88 +313,10 @@ /** * {@inheritDoc} */ - public void rollback(Object tx) - { - transactions.remove(tx); - } - - /** - * {@inheritDoc} - */ - public void setCache(CacheSPI c) - { - //this.cache =3D c; - } - - /** - * {@inheritDoc} - */ public void setConfig(IndividualCacheLoaderConfig config) { - this.config =3D config; - - } - - /** - * {@inheritDoc} - */ - public void setRegionManager(RegionManager manager) - { - //this.regionManager =3D manager; - } - - /** - * {@inheritDoc} - */ - public void storeEntireState(ObjectInputStream is) throws Exception - { // TODO Auto-generated method stub = } = - /** - * {@inheritDoc} - */ - public void storeState(Fqn subtree, ObjectInputStream is) throws Except= ion - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void create() throws Exception - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void destroy() - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void start() throws Exception - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void stop() - { - // TODO Auto-generated method stub - - } - } Copied: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfor= m/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader1.java (from rev 46= 0, jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader1.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader1.java 2009-11-01 22:10= :06 UTC (rev 462) @@ -0,0 +1,408 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.jboss.cache.CacheSPI; +import org.jboss.cache.Fqn; +import org.jboss.cache.Modification; +import org.jboss.cache.RegionManager; +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; +import org.jboss.cache.factories.annotations.Inject; +import org.jboss.cache.loader.CacheLoader; + +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.jcr.RepositoryException; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 23.10.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class ExoJCRCacheLoader1 implements CacheLoader +{ + //private CacheSPI cache; + + //private RegionManager regionManager; + + private IndividualCacheLoaderConfig config; + + private WorkspaceDataContainer dataContainer; + + private HashMap> transactions =3D new HashMa= p>(); + + /** + * Init the loader DataContainer with given WorkspaceDataContainer inst= ance. + * + * @param dataContainer WorkspaceDataContainer + */ + @Inject + public void initDataContainer(WorkspaceDataContainer dataContainer) thr= ows RepositoryConfigurationException + { + if (this.dataContainer !=3D null) + { + throw new RepositoryConfigurationException("Cannot set WorkspaceD= ataContainer twice"); + } + + this.dataContainer =3D dataContainer; + } + + /** + * {@inheritDoc} + */ + public void commit(Object tx) throws Exception + { + List modifications =3D transactions.remove(tx); + if (modifications !=3D null) + doModified(modifications); + else + throw new ExoJCRCacheLoaderException("Transaction " + tx + " not = exist in transaction table"); + } + + /** + * {@inheritDoc} + */ + public boolean exists(Fqn name) throws Exception + { + // TODO use get(Fqn), i.e. get Node!=3Dnull = + return false; + } + + /** + * {@inheritDoc} + */ + public Map get(Fqn name) throws Exception + { + // TODO get Node or Property + // e.g. + // if $TREE/[]:1 - return $ITEM_ID attribute and all JCR Node Proper= ties IDs = + // if $ITEM/idxxx - return $ITEM_DATA of JCR Node or Property = + return null; + } + + /** + * {@inheritDoc} + */ + public Set getChildrenNames(Fqn fqn) throws Exception + { + // TODO get child nodes names + return null; + } + + /** + * {@inheritDoc} + */ + public IndividualCacheLoaderConfig getConfig() + { + return config; + } + + /** + * {@inheritDoc} + */ + public void loadEntireState(ObjectOutputStream os) throws Exception + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void loadState(Fqn subtree, ObjectOutputStream os) throws Except= ion + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void prepare(Object tx, List modifications, boolea= n onePhase) throws Exception + { + if (onePhase) + { + doModified(modifications); + } + else + { + transactions.put(tx, modifications); + } + } + + /** + * Will be added data to DB. = + * = + * @param modifications + * @throws Exception + */ + private void doModified(List modifications) throws Except= ion + { + JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection)data= Container.openConnection(); + + try + { + for (int modificatinIndex =3D 0; modificatinIndex < modifications= .size(); modificatinIndex++) + { + Modification md =3D modifications.get(modificatinIndex); + switch (md.getType()) + { + case PUT_KEY_VALUE : + doAddOrUpdate(md, jdbcConnection); + break; + case REMOVE_NODE : + doRemove(md, jdbcConnection, "TODO $"); + break; + } + } + + if (jdbcConnection !=3D null) + jdbcConnection.commit(); + } + finally + { + if (jdbcConnection !=3D null && jdbcConnection.isOpened()) + jdbcConnection.rollback(); + } + } + + private void doRemove(Modification modification, JDBCStorageConnection = jdbcConnection, String identifier) + throws IllegalStateException, RepositoryException + { + + ItemData itemData =3D jdbcConnection.getItemData(identifier); + + if (itemData instanceof NodeData) + jdbcConnection.delete((NodeData)itemData); + if (itemData instanceof PropertyData) + jdbcConnection.delete((PropertyData)itemData); + } + + /** + * Performs ADD and UPDATE to NodeData and PropertyData. + * @param modification + * @param jdbcConnection + * @throws IllegalStateException + * @throws RepositoryException + */ + private void doAddOrUpdate(Modification modification, JDBCStorageConnec= tion jdbcConnection) + throws IllegalStateException, RepositoryException + { + if (modification.getValue() instanceof NodeData) + { + //add or update node data + NodeData nodeData =3D (NodeData)modification.getValue(); + + ItemData itemData =3D jdbcConnection.getItemData(nodeData.getIden= tifier()); + + if (itemData =3D=3D null) + { + //add + jdbcConnection.add(nodeData); + } + else + { + //update + jdbcConnection.update(nodeData); + } + } + else if (modification.getValue() instanceof PropertyData) + { + //add or update property data + PropertyData propertyData =3D (PropertyData)modification.getValue= (); + + ItemData itemData =3D jdbcConnection.getItemData(propertyData.get= Identifier()); + + if (itemData =3D=3D null) + { + //add + jdbcConnection.add(propertyData); + } + else + { + //update + jdbcConnection.update(propertyData); + } + } + } + + /** + * {@inheritDoc} + */ + public Object put(Fqn name, Object key, Object value) throws Exception + { + // i.e. put Property + return null; + } + + /** + * {@inheritDoc} + */ + public void put(Fqn name, Map attributes) throws Except= ion + { + // i.e. put set of Properties = + = + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void put(List modifications) throws Exception + { + = + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public Object remove(Fqn fqn, Object key) throws Exception + { + // i.e. remove Property + // TODO Auto-generated method stub + return null; + } + + /** + * {@inheritDoc} + */ + public void remove(Fqn fqn) throws Exception + { + // i.e. remove Node + = + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void removeData(Fqn fqn) throws Exception + { + // i.e. remove all Properties of Node = + = + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void rollback(Object tx) + { + transactions.remove(tx); + } + + /** + * {@inheritDoc} + */ + public void setCache(CacheSPI c) + { + //this.cache =3D c; + } + + /** + * {@inheritDoc} + */ + public void setConfig(IndividualCacheLoaderConfig config) + { + this.config =3D config; + + } + + /** + * {@inheritDoc} + */ + public void setRegionManager(RegionManager manager) + { + //this.regionManager =3D manager; + } + + /** + * {@inheritDoc} + */ + public void storeEntireState(ObjectInputStream is) throws Exception + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void storeState(Fqn subtree, ObjectInputStream is) throws Except= ion + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void create() throws Exception + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void destroy() + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void start() throws Exception + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void stop() + { + // TODO Auto-generated method stub + + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader1.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-01 22= :06:48 UTC (rev 461) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-01 22= :10:06 UTC (rev 462) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 eXo Platform SAS. + * 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 --===============5531758877548610168==-- From do-not-reply at jboss.org Mon Nov 2 10:00:39 2009 Content-Type: multipart/mixed; boundary="===============8629328809960262458==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r463 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container. Date: Mon, 02 Nov 2009 10:00:39 -0500 Message-ID: <200911021500.nA2F0dbO005244@svn01.web.mwc.hst.phx2.redhat.com> --===============8629328809960262458== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2009-11-02 10:00:38 -0500 (Mon, 02 Nov 2009) New Revision: 463 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/PortalContainer.java Log: EXOJCR-166: Support separated ear delivery The variable currentContainer_ has been removed from the PortalContainer si= nce it is error prone as it duplicates the ThreaLocal in ExoContainerContex= t, only the type change (i.e. ExoContainer in ExoContainerContext and Porta= lContainer in PortalContainer). Now, everything relies on the TL of ExoCont= ainerContext. = Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/PortalContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/PortalContainer.java 2009-11-01 22:10:06 UTC (rev 462) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/PortalContainer.java 2009-11-02 15:00:38 UTC (rev 463) @@ -93,8 +93,6 @@ } } = - private static ThreadLocal currentContainer_ =3D new T= hreadLocal(); - private volatile boolean started_; = private PortalContainerInfo pinfo_; @@ -323,38 +321,24 @@ if (container =3D=3D null) { container =3D RootContainer.getInstance().getPortalContainer(DEFA= ULT_PORTAL_CONTAINER_NAME); - currentContainer_.set(container); + PortalContainer.setInstance(container); } return container; } = /** - * @return the current instance of {@link PortalContainer} that has bee= n stored into the related - * {@link ThreadLocal}. If no value has been set, it will return = null + * @return the current instance of {@link ExoContainer} that has been s= tored into the + * {@link ThreadLocal} of {@link ExoContainerContext}. If no {@link Por= talContainer} has been set, = + * it will return null */ public static PortalContainer getInstanceIfPresent() { - PortalContainer pc =3D currentContainer_.get(); - if (pc !=3D null) = + ExoContainer container =3D ExoContainerContext.getCurrentContainerIf= Present(); + if (container instanceof PortalContainer) = { - ExoContainer container =3D ExoContainerContext.getCurrentContaine= rIfPresent(); - if (container !=3D pc) - { - // Clean the value of currentContainer_ since it should be equ= als to = - // ExoContainerContext.getCurrentContainerIfPresent() - if (container instanceof PortalContainer) - { - // The current container is a PortalContainer, this value w= ill replace the old one - currentContainer_.set(pc =3D (PortalContainer)container); - } - else - { - // The current container is not a PortalContainer, the old = value must be removed - currentContainer_.set(pc =3D null); - } - } + return (PortalContainer)container; } - return pc; + return null; } = /** @@ -436,17 +420,12 @@ */ public static PortalContainer getCurrentInstance(ServletContext context) { - final ExoContainer container =3D ExoContainerContext.getCurrentConta= iner(); - if (container instanceof PortalContainer) + final PortalContainer container =3D getInstanceIfPresent(); + if (container =3D=3D null) { - if (log.isDebugEnabled()) - log.debug("A portal container has been set in the ThreadLocal = of ExoContainerContext"); - return (PortalContainer)container; - } - else - { return PortalContainer.getInstance(context); } + return container; } = /** @@ -567,7 +546,6 @@ = public static void setInstance(PortalContainer instance) { - currentContainer_.set(instance); ExoContainerContext.setCurrentContainer(instance); } = --===============8629328809960262458==-- From do-not-reply at jboss.org Mon Nov 2 11:32:35 2009 Content-Type: multipart/mixed; boundary="===============4180025638377409726==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r464 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/impl/core and 1 other directories. Date: Mon, 02 Nov 2009 11:32:35 -0500 Message-ID: <200911021632.nA2GWZxt018189@svn01.web.mwc.hst.phx2.redhat.com> --===============4180025638377409726== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-02 11:32:35 -0500 (Mon, 02 Nov 2009) New Revision: 464 Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/core/TestSVNodeDataOptimization.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SysViewWorkspaceInitializer.java jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test= -configuration.xml Log: EXOJCR-219 : The method SysViewWorkspaceinitializer.SVNodeData.addChildNode= (InternalQName childName) was optimized. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SysViewWorkspaceInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SysViewWorkspaceInitializer.java 2009-11-02 15:00:38 UTC (re= v 463) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SysViewWorkspaceInitializer.java 2009-11-02 16:32:35 UTC (re= v 464) @@ -55,6 +55,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Stack; @@ -299,11 +300,14 @@ } } = - protected class SVNodeData extends TransientNodeData + protected class SVNodeData + extends TransientNodeData { = - List childNodes =3D new LinkedList(); + int orderNumber =3D 0; = + HashMap childNodesMap =3D new HashMap(); + SVNodeData(QPath path, String identifier, String parentIdentifier, i= nt version, int orderNum) { super(path, identifier, version, null, null, orderNum, parentIden= tifier, null); @@ -321,15 +325,16 @@ */ int[] addChildNode(InternalQName childName) { - int orderNumber =3D childNodes.size(); - int index =3D 1; - for (int i =3D 0; i < childNodes.size(); i++) + Integer count =3D childNodesMap.get(childName); + if (count !=3D null) { - if (childName.equals(childNodes.get(i))) - index++; + childNodesMap.put(childName, count + 1); } - childNodes.add(childName); - return new int[]{orderNumber, index}; + else + childNodesMap.put(childName, 1); + + int index =3D childNodesMap.get(childName); + return new int[] {orderNumber++, index}; } } = Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/servi= ces/jcr/impl/core/TestSVNodeDataOptimization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestSVNodeDataOptimization.java (rev= 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestSVNodeDataOptimization.java 2009-11-02 16:32:35 UTC (rev= 464) @@ -0,0 +1,263 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.core; + +import java.io.File; +import java.io.FileOutputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.jcr.Node; +import javax.jcr.NodeIterator; + +import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.config.ContainerEntry; +import org.exoplatform.services.jcr.config.QueryHandlerEntry; +import org.exoplatform.services.jcr.config.SimpleParameterEntry; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.config.WorkspaceInitializerEntry; +import org.exoplatform.services.jcr.datamodel.NodeData; + +/** + * Created by The eXo Platform SAS. + * = + *
+ * Date: 02.11.2009 + * = + * @author Alex Re= shetnyak + * @version $Id$ + */ +public class TestSVNodeDataOptimization + extends JcrImplBaseTest +{ + = + @Override + public void setUp() throws Exception + { + super.setUp(); + SessionImpl ses =3D (SessionImpl) repository.login(credentials, "ws1= "); + if (ses !=3D null) + { + try + { + ses.refresh(false); + Node rootNode =3D ses.getRootNode(); + if (rootNode.hasNodes()) + { + // clean test root + for (NodeIterator children =3D rootNode.getNodes(); childre= n.hasNext();) + { + Node node =3D children.nextNode(); + if (!node.getPath().startsWith("/jcr:system")) + { + // log.info("DELETing ------------- "+node.getPath()); + node.remove(); + } + } + ses.save(); + } + } + catch (Exception e) + { + log.error("tearDown() ERROR " + getClass().getName() + "." + g= etName() + " " + e, e); + } + finally + { + ses.logout(); + } + } + } + + @Override + protected void tearDown() throws Exception + { + SessionImpl ses =3D (SessionImpl) repository.login(credentials, "ws1= "); + if (ses !=3D null) + { + try + { + ses.refresh(false); + Node rootNode =3D ses.getRootNode(); + if (rootNode.hasNodes()) + { + // clean test root + for (NodeIterator children =3D rootNode.getNodes(); childre= n.hasNext();) + { + Node node =3D children.nextNode(); + if (!node.getPath().startsWith("/jcr:system")) + { + // log.info("DELETing ------------- "+node.getPath()); + node.remove(); + } + } + ses.save(); + } + } + catch (Exception e) + { + log.error("tearDown() ERROR " + getClass().getName() + "." + g= etName() + " " + e, e); + } + finally + { + ses.logout(); + } + } + super.tearDown(); + } + + public void testSVNodeData() throws Exception + { + + //ADD content + SessionImpl ses =3D (SessionImpl) repository.login(credentials, "ws1= "); + + //Add node with sub name sibling + Node nodeSNS =3D ses.getRootNode().addNode("node_with_sns"); + for (int i =3D 0; i < 100; i++) + { + nodeSNS.addNode("node_sns_"); + } + + //Add node without sub name sibling + Node nodeWOSNS =3D ses.getRootNode().addNode("node_without_sns"); + for (int i =3D 0; i < 100; i++) + { + nodeSNS.addNode("node_" + i); + } + + ses.save(); + + // Cereate backup + File backup =3D File.createTempFile("full-backup", ".xml"); + backup.deleteOnExit(); + + ses.exportWorkspaceSystemView(new FileOutputStream(backup), false, f= alse); + + // restore to ws1_restored + WorkspaceEntry ws1_restore =3D + makeWorkspaceEntry("ws1_restored", isMultiDB(session) ? "jd= bcjcr2export3" : "jdbcjcr", backup, ses); + repository.configWorkspace(ws1_restore); + repository.createWorkspace(ws1_restore.getName()); + + // check + SessionImpl backupSession =3D (SessionImpl) repository.login(credent= ials, "ws1_restored"); + + assertNotNull(backupSession); + + checkEquals(ses, backupSession); + } + + private void checkEquals(SessionImpl expected, SessionImpl actual) thro= ws Exception + { + NodeImpl srcNode =3D (NodeImpl) expected.getRootNode(); + NodeImpl destNode =3D (NodeImpl) actual.getRootNode(); + + checkNodeEquals(srcNode, destNode); + } + + private void checkNodeEquals(NodeImpl src, NodeImpl dest) throws Except= ion + { + assertTrue(dest.equals(src)); + assertEquals(src.getIndex(), dest.getIndex()); + assertEquals(((NodeData) src.getData()).getOrderNumber(), ((NodeData= ) dest.getData()).getOrderNumber()); + + NodeIterator srcIterator =3D src.getNodes(); + NodeIterator destIterator =3D dest.getNodes(); + + assertEquals(srcIterator.getSize(), destIterator.getSize()); + + while (srcIterator.hasNext()) + checkNodeEquals((NodeImpl) srcIterator.nextNode(), (NodeImpl) des= tIterator.nextNode()); + } + + private WorkspaceEntry makeWorkspaceEntry(String name, String sourceNam= e, File sysViewFile, SessionImpl ses) + { + WorkspaceEntry ws1e =3D (WorkspaceEntry) ses.getContainer().getCompo= nentInstanceOfType(WorkspaceEntry.class); + + WorkspaceEntry ws1back =3D new WorkspaceEntry(); + ws1back.setName(name); + ws1back.setUniqueName(((RepositoryImpl) ses.getRepository()).getName= () + "_" + ws1back.getName()); + + ws1back.setAccessManager(ws1e.getAccessManager()); + ws1back.setAutoInitializedRootNt(ws1e.getAutoInitializedRootNt()); + ws1back.setAutoInitPermissions(ws1e.getAutoInitPermissions()); + ws1back.setCache(ws1e.getCache()); + ws1back.setContainer(ws1e.getContainer()); + ws1back.setLockManager(ws1e.getLockManager()); + + // Initializer + WorkspaceInitializerEntry wiEntry =3D new WorkspaceInitializerEntry(= ); + wiEntry.setType(SysViewWorkspaceInitializer.class.getCanonicalName()= ); + + List wieParams =3D new ArrayList(); + wieParams + .add(new SimpleParameterEntry(SysViewWorkspaceInitializer.R= ESTORE_PATH_PARAMETER, sysViewFile.getPath())); + + wiEntry.setParameters(wieParams); + + ws1back.setInitializer(wiEntry); + + // Indexer + ArrayList qParams =3D new ArrayList(); + qParams.add(new SimpleParameterEntry("indexDir", "target" + File.sep= arator + name)); + QueryHandlerEntry qEntry =3D + new QueryHandlerEntry("org.exoplatform.services.jcr.impl.co= re.query.lucene.SearchIndex", qParams); + + ws1back.setQueryHandler(qEntry); + + ArrayList params =3D new ArrayList(); + for (Iterator i =3D ws1back.getContainer().getParameters().iterator(= ); i.hasNext();) + { + SimpleParameterEntry p =3D (SimpleParameterEntry) i.next(); + SimpleParameterEntry newp =3D new SimpleParameterEntry(p.getName(= ), p.getValue()); + + if (isMultiDB(ses) && newp.getName().equals("source-name")) + newp.setValue(sourceName); + else if (newp.getName().equals("swap-directory")) + newp.setValue("target/temp/swap/" + name); + else if (isMultiDB(ses) && newp.getName().equals("dialect")) + newp.setValue("hsqldb"); + + params.add(newp); + } + + ContainerEntry ce =3D + new ContainerEntry("org.exoplatform.services.jcr.impl.stora= ge.jdbc.JDBCWorkspaceDataContainer", params); + ws1back.setContainer(ce); + + return ws1back; + } + + private boolean isMultiDB(SessionImpl session) + { + WorkspaceEntry ws1e =3D (WorkspaceEntry) session.getContainer().getC= omponentInstanceOfType(WorkspaceEntry.class); + + for (Iterator i =3D ws1e.getContainer().getParameters().iterator(); = i.hasNext();) + { + SimpleParameterEntry p =3D (SimpleParameterEntry) i.next(); + SimpleParameterEntry newp =3D new SimpleParameterEntry(p.getName(= ), p.getValue()); + + if (newp.getName().equals("multi-db")) + return Boolean.valueOf(newp.getValue()); + } + + throw new RuntimeException("Can not get property 'multi-db' in confi= guration on workspace '" + ws1e.getName() + + "'"); + } + +} Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/impl/core/TestSVNodeDataOptimization.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration.xml 2009-11-02 15:00:38 UTC (rev 463) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration.xml 2009-11-02 16:32:35 UTC (rev 464) @@ -478,6 +478,33 @@ + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcr2export3 + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + --===============4180025638377409726==-- From do-not-reply at jboss.org Wed Nov 4 03:36:43 2009 Content-Type: multipart/mixed; boundary="===============5821704868744375117==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r465 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container. Date: Wed, 04 Nov 2009 03:36:43 -0500 Message-ID: <200911040836.nA48ah6E022540@svn01.web.mwc.hst.phx2.redhat.com> --===============5821704868744375117== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-04 03:36:42 -0500 (Wed, 04 Nov 2009) New Revision: 465 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/RootContainer.java Log: EXOJCR-194 log message level changed to log.info (line 431) Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/RootContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/RootContainer.java 2009-11-02 16:32:35 UTC (rev 464) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/RootContainer.java 2009-11-04 08:36:42 UTC (rev 465) @@ -428,7 +428,7 @@ else { booting =3D true; - log.error("Booting root container with id " + RootContai= ner.class.hashCode() + ""); + log.info("Booting root container with id " + RootContain= er.class.hashCode() + ""); log.info("Building root container"); long time =3D -System.currentTimeMillis(); result =3D buildRootContainer(); --===============5821704868744375117==-- From do-not-reply at jboss.org Wed Nov 4 04:10:22 2009 Content-Type: multipart/mixed; boundary="===============7955580164048238118==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r466 - in kernel/trunk: exo.kernel.container/src/main/java/org/exoplatform/container/configuration and 1 other directory. Date: Wed, 04 Nov 2009 04:10:21 -0500 Message-ID: <200911040910.nA49ALLM029133@svn01.web.mwc.hst.phx2.redhat.com> --===============7955580164048238118== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-04 04:10:21 -0500 (Wed, 04 Nov 2009) New Revision: 466 Modified: kernel/trunk/exo.kernel.component.command/src/main/java/org/exoplatform/= services/command/impl/CommonsXMLConfigurationPlugin.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/configuration/ConfigurationUnmarshaller.java Log: System.out.println changed to logger.info Modified: kernel/trunk/exo.kernel.component.command/src/main/java/org/exopl= atform/services/command/impl/CommonsXMLConfigurationPlugin.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/src/main/java/org/exoplatform= /services/command/impl/CommonsXMLConfigurationPlugin.java 2009-11-04 08:36:= 42 UTC (rev 465) +++ kernel/trunk/exo.kernel.component.command/src/main/java/org/exoplatform= /services/command/impl/CommonsXMLConfigurationPlugin.java 2009-11-04 09:10:= 21 UTC (rev 466) @@ -23,6 +23,8 @@ import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.ValueParam; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; = import java.net.URL; = @@ -40,6 +42,8 @@ { = // protected Catalog defaultCatalog; + = + private static Log log =3D ExoLogger.getLogger(CommonsXMLConfigurationP= lugin.class); = public CommonsXMLConfigurationPlugin(InitParams params, ConfigurationMa= nager configurationManager) throws Exception { @@ -56,7 +60,7 @@ res =3D configurationManager.getResource(path); if (res =3D=3D null) throw new Exception("Resource not found " + path); - System.out.println("Catalog configuration found at " + res); + log.info("Catalog configuration found at " + res); parser.parse(res); } = Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/configuration/ConfigurationUnmarshaller.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/configuration/ConfigurationUnmarshaller.java 2009-11-04 08:36:42 UTC (re= v 465) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/configuration/ConfigurationUnmarshaller.java 2009-11-04 09:10:21 UTC (re= v 466) @@ -71,23 +71,16 @@ this.valid =3D true; } = - private void log(String prefix, SAXParseException e) - { - System.err.println(prefix + " in document " + url + " at (" + e.= getLineNumber() + "," + e.getColumnNumber() - + ") :" + e.getMessage()); - } - public void warning(SAXParseException exception) throws SAXException { - log("Warning", exception); + log.warn(exception.getMessage(), exception); } = public void error(SAXParseException exception) throws SAXException { if (exception.getMessage().equals("cvc-elt.1: Cannot find the dec= laration of element 'configuration'.")) { - System.out - .println("The document " + log.info("The document " + url + " does not contain a schema declaration, it should hav= e an " + "XML declaration similar to\n" @@ -98,14 +91,16 @@ } else { - log("Error", exception); + log.error("In document " + url + " at (" + exception.getLineN= umber() + "," + exception.getColumnNumber() + + ") :" + exception.getMessage()); } valid =3D false; } = public void fatalError(SAXParseException exception) throws SAXExcept= ion { - log("Fatal error", exception); + log.fatal("In document " + url + " at (" + exception.getLineNumb= er() + "," + exception.getColumnNumber() + + ") :" + exception.getMessage()); valid =3D false; } } @@ -138,7 +133,7 @@ } catch (SAXException e) { - System.err.print("Got a sax exception when doing XSD validatio= n"); + log.error("Got a sax exception when doing XSD validation"); e.printStackTrace(System.err); return false; } @@ -160,14 +155,14 @@ out.write(bytes, 0, s); } String s =3D out.toString(); - System.out.println("s =3D " + s); + log.info("s =3D " + s); */ = // boolean valid =3D isValid(url); if (!valid) { - System.out.println("The configuration file " + url + " was not fo= und valid according to its XSD"); + log.info("The configuration file " + url + " was not found valid = according to its XSD"); } = // The buffer --===============7955580164048238118==-- From do-not-reply at jboss.org Wed Nov 4 09:10:22 2009 Content-Type: multipart/mixed; boundary="===============3434645520336432554==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r467 - jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core. Date: Wed, 04 Nov 2009 09:10:22 -0500 Message-ID: <200911041410.nA4EAMIo015425@svn01.web.mwc.hst.phx2.redhat.com> --===============3434645520336432554== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-04 09:10:22 -0500 (Wed, 04 Nov 2009) New Revision: 467 Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/core/TestSessionDataManager.java Log: EXOJCR-197: remove incorrect test Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/TestSessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestSessionDataManager.java 2009-11-04 09:10:21 UTC (rev 466) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestSessionDataManager.java 2009-11-04 14:10:22 UTC (rev 467) @@ -336,25 +336,4 @@ assertNotNull(modificationManager.getItemData(QPath.makeChildPath(((= NodeImpl)root).getData().getQPath(), new InternalQName("", "testgetitemNode")))); } - = - public void testRemove() throws Exception - { - Node n =3D session.getRootNode().addNode("node", "nt:unstructured"); - n.addMixin("mix:referenceable"); - session.save(); - String uuid =3D n.getUUID(); = - Node p =3D n.getParent(); - n.remove(); - p.save(); - try - { - modificationManager.getItemByIdentifier(uuid, true); -// session.getNodeByUUID(uuid); - fail("Node must be removed."); - } - catch(ItemNotFoundException e) - { - = - } - } } --===============3434645520336432554==-- From do-not-reply at jboss.org Wed Nov 4 09:33:11 2009 Content-Type: multipart/mixed; boundary="===============3437065618869316599==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r468 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 04 Nov 2009 09:33:10 -0500 Message-ID: <200911041433.nA4EXAKb021087@svn01.web.mwc.hst.phx2.redhat.com> --===============3437065618869316599== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-04 09:33:10 -0500 (Wed, 04 Nov 2009) New Revision: 468 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-201: test for loader Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-04 14= :10:22 UTC (rev 467) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-04 14= :33:10 UTC (rev 468) @@ -18,15 +18,7 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import org.jboss.cache.Cache; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; = -import java.io.Serializable; - -import junit.framework.TestCase; - /** * Created by The eXo Platform SAS. * = @@ -35,49 +27,15 @@ * @author Peter N= edonosko = * @version $Id$ */ -public class ExoJCRCacheLoaderTest extends TestCase +public class ExoJCRCacheLoaderTest extends JBossCacheStorageConnectionTest { = - private Cache cache; - - private Node tree; - - private Node items; - - /** - * {@inheritDoc} - */ - protected void setUp() throws Exception + @Override + protected void initJBCConfig() { - super.setUp(); - - // JBossCache = - String jbcConfig =3D "conf/standalone/test-jbosscache-config-exoload= er.xml"; - - cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); - - Node cacheRoot =3D cache.getRoot(); - Node wsRoot =3D cacheRoot.addChild(Fqn.fromEle= ments("repo", "ws")); - - // prepare cache structures - tree =3D wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataConta= iner.ROOT)); - items =3D wsRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataCont= ainer.ITEMS)); - - // run cache - cache.create(); - cache.start(); - - // JCR connection - //conn =3D new JBossCacheStorageConnection(cache, tree, items); - + jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; } = - /** - * {@inheritDoc} - */ - protected void tearDown() throws Exception - { - super.tearDown(); - } - + = + = } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-04 14:10:22 UTC (rev 467) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-04 14:33:10 UTC (rev 468) @@ -68,13 +68,15 @@ public class JBossCacheStorageConnectionTest extends TestCase { = - private JBossCacheStorageConnection conn; + protected JBossCacheStorageConnection conn; = - private Cache cache; + protected Cache cache; = - private Node tree; + protected Node tree; = - private Node items; + protected Node items; + = + protected String jbcConfig; = = /** * {@inheritDoc} @@ -84,16 +86,16 @@ super.setUp(); = // JBossCache = - String jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloa= der.xml"; - + initJBCConfig(); + = cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); = Node cacheRoot =3D cache.getRoot(); //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements("repo", "ws")); = // prepare cache structures - tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataCo= ntainer.ROOT)); - items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheWorkspaceDataC= ontainer.ITEMS)); + tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.TREE)); + items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.ITEMS)= ); = // run cache cache.create(); @@ -102,6 +104,10 @@ // JCR connection conn =3D new JBossCacheStorageConnection(cache, tree, items); } + = + protected void initJBCConfig() { + jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; + } = /** * {@inheritDoc} --===============3437065618869316599==-- From do-not-reply at jboss.org Wed Nov 4 09:57:59 2009 Content-Type: multipart/mixed; boundary="===============1467717702183019910==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r469 - jcr/branches/1.12.0-JBC. Date: Wed, 04 Nov 2009 09:57:59 -0500 Message-ID: <200911041457.nA4EvxGV025999@svn01.web.mwc.hst.phx2.redhat.com> --===============1467717702183019910== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-04 09:57:59 -0500 (Wed, 04 Nov 2009) New Revision: 469 Modified: jcr/branches/1.12.0-JBC/pom.xml Log: EXOJCR-199: JBossCache 3.2.0.GA Modified: jcr/branches/1.12.0-JBC/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/pom.xml 2009-11-04 14:33:10 UTC (rev 468) +++ jcr/branches/1.12.0-JBC/pom.xml 2009-11-04 14:57:59 UTC (rev 469) @@ -396,7 +396,7 @@ org.jboss.cache jbosscache-core - 3.1.0.GA + 3.2.0.GA = --===============1467717702183019910==-- From do-not-reply at jboss.org Wed Nov 4 11:05:19 2009 Content-Type: multipart/mixed; boundary="===============7820944236690949556==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r470 - in jcr/branches/1.12.0-JBC/component/core: src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Wed, 04 Nov 2009 11:05:18 -0500 Message-ID: <200911041605.nA4G5Iev010601@svn01.web.mwc.hst.phx2.redhat.com> --===============7820944236690949556== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-04 11:05:15 -0500 (Wed, 04 Nov 2009) New Revision: 470 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java Removed: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java Log: EXOJCR-200: tree-based connection deprecated, but still works if needed Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-04 14:57:59 UTC = (rev 469) +++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-04 16:05:15 UTC = (rev 470) @@ -569,9 +569,9 @@ **/**/JBossCacheServiceTest__.java - **/**/TestItem_.java + **/**/TestItem__.java = - **/**/JBossCacheStorageConnectionTest.jav= a + **/**/JBossCacheTreeStorageConnectionTest= .java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-11-04 14:57:= 59 UTC (rev 469) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-11-04 16:05:= 15 UTC (rev 470) @@ -114,7 +114,7 @@ { QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); = - // TODO non effective, in this way 1) all subtree will be c= ached + // 1) all subtree will be cached // 2) all subtree will be read from DB (with allprops) for = only Ids. // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = String parentId =3D (String)cache.get(name.getParent(), JBo= ssCacheStorage.ITEM_ID); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-04 14:57:= 59 UTC (rev 469) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-04 16:05:= 15 UTC (rev 470) @@ -59,13 +59,13 @@ = public static final String ITEM_ID =3D "$id".intern(); = - protected final Fqn treeRoot; + protected final Fqn namesRoot; = protected final Fqn itemsRoot; = - protected JBossCacheStorage(Fqn treeRoot, Fqn itemsRoot) + protected JBossCacheStorage(Fqn namesRoot, Fqn itemsRoo= t) { - this.treeRoot =3D treeRoot; + this.namesRoot =3D namesRoot; this.itemsRoot =3D itemsRoot; } = @@ -79,7 +79,7 @@ fqns[i] =3D path[i].getAsString(true); } = - return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); + return Fqn.fromRelativeFqn(namesRoot, Fqn.fromElements(fqns)); } = protected Fqn makeParentFqn(QPath propertyPath) @@ -93,7 +93,7 @@ fqns[i] =3D path[i].getAsString(true); } = - return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); + return Fqn.fromRelativeFqn(namesRoot, Fqn.fromElements(fqns)); } = protected Fqn makeIdFqn(String itemId) Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -04 14:57:59 UTC (rev 469) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -04 16:05:15 UTC (rev 470) @@ -1,404 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.cache.Cache; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 23.10.2009
- * - * Cache contains several regions:
- * Workspace tree. /$ROOT: On each leaf (JBossCache Node) an JCR Item Id s= tored.
- * Items map. /$ITEMS: Key=3DId, Value =3D ItemData.
- * References map ??? /$REFS: Key=3DNodeId, Value =3D PropertyId.
- * - * @author Peter N= edonosko = - * @version $Id$ - */ -public class JBossCacheStorageConnection extends JBossCacheStorage impleme= nts WorkspaceStorageConnection -{ - - protected static final Log LOG =3D ExoLogger.getLogger("jcr.JBossCacheS= torageConnection"); - - private final Cache cache; - - //private final Node treeRoot; - - //private final Node itemsRoot; - - /** - * Start batching flag. 'true' if batching was started, 'false' if bat= ching is not start. = - */ - private boolean batchStarted =3D false; - - /** - * JBossCacheStorageConnection constructor. - * - * @param cache Cache - */ - public JBossCacheStorageConnection(Cache cache, N= ode treeRoot, - Node itemsRoot) - { - super(treeRoot.getFqn(), itemsRoot.getFqn()); - = - this.cache =3D cache; - //this.itemsRoot =3D itemsRoot; - //this.treeRoot =3D treeRoot; - } - - /** - * {@inheritDoc} - */ - public void add(NodeData data) throws RepositoryException, UnsupportedO= perationException, InvalidItemStateException, - IllegalStateException - { - startBatch(); - cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier(= )); - cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); // tree= Print(treeRoot); - } - - /** - * {@inheritDoc} - */ - public void add(PropertyData data) throws RepositoryException, Unsuppor= tedOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - Fqn parentFqn =3D makeParentFqn(data.getQPath()); - - // add an attr to the parent node as key=3DPropertyName value=3DProp= ertyId - cache.put(parentFqn, data.getQPath().getName().getAsString(), data.g= etIdentifier()); - cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); - } - - /** - * {@inheritDoc} - */ - public void delete(NodeData data) throws RepositoryException, Unsupport= edOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - cache.removeNode(makeNodeFqn(data.getQPath())); - cache.removeNode(makeIdFqn(data.getIdentifier())); - } - - /** - * {@inheritDoc} - */ - public void delete(PropertyData data) throws RepositoryException, Unsup= portedOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - // delete attr on parent by key=3DPropertyName - cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getName= ().getAsString()); - cache.removeNode(makeIdFqn(data.getIdentifier())); - } - - /** - * {@inheritDoc} - */ - public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException - { - //Set childNames =3D cache.getChildrenNames(makeNodeFqn(pare= nt.getQPath())); - Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); - } - - Set> childNodes =3D parentNode.getChildre= n(); - - List childs =3D new ArrayList(); - for (Node child : childNodes) - { - String childId =3D (String)child.get(ITEM_ID); - - // TODO NodeData or PropertyData? As ItemData check then and cast. - NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_DA= TA); - if (node =3D=3D null) - { - throw new RepositoryException("One of childs is null. Parent "= + parent.getQPath().getAsString()); - } - childs.add(node); - } - - return childs; - } - - private void treePrint(Node node) - { - for (Node child : node.getChildren()) - { - System.out.println(child.toString()); - for (Serializable key : child.getKeys()) - { - System.out.println("\t" + key + "=3D" + child.get(key)); - } - if (!child.isLeaf()) - { - treePrint(child); - } - } - } - - /** - * {@inheritDoc} - */ - public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException - { - // TODO treeRoot.getChild(f) possible if f not a direct child??? = - Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); - } - - List childs =3D new ArrayList(); - - for (Serializable key : parentNode.getKeys()) - { - if (!key.equals(ITEM_ID)) - { - String propId =3D (String)parentNode.get(key); - // TODO NodeData or PropertyData? As ItemData check then and c= ast. = - PropertyData property =3D (PropertyData)cache.get(makeIdFqn(pr= opId), ITEM_DATA); - if (property =3D=3D null) - { - throw new RepositoryException("One of childs is null. Paren= t " + parent.getQPath().getAsString()); - } - childs.add(property); - } - } - - return childs; - } - - /** - * {@inheritDoc} - */ - public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException, IllegalStateException - { - // TODO it's same as getChild... now - return getChildPropertiesData(parent); - } - - /** - * {@inheritDoc} - */ - public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException, IllegalStateException - { - Node parentNode =3D cache.getNode(makeNodeFqn(= parentData.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get Item data error: parent not = found " + parentData.getQPath().getAsString()); - } - - // TODO check performance of Node vs Property get - - String propertyId =3D (String)parentNode.get(name.getAsString()); - if (propertyId !=3D null) - { - // it's Property Item - return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA); - } - else - { - // it's Node Item - Node node =3D parentNode.getChild(name.getA= sString(true)); // TODO String not Fqn? - if (node !=3D null) - { - String nodeId =3D (String)node.get(ITEM_ID); - if (nodeId !=3D null) - { - return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA); - } - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException - { - return (ItemData)cache.get(makeIdFqn(identifier), ITEM_DATA); - } - - /** - * {@inheritDoc} - */ - public List getReferencesData(String nodeIdentifier) thro= ws RepositoryException, - IllegalStateException, UnsupportedOperationException - { - // TODO refs impl - return new ArrayList(); - } - - /** - * {@inheritDoc} - */ - public void rename(NodeData data) throws RepositoryException, Unsupport= edOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - // TODO move Node to a new position at the tree, - // but prev location was in prev DELETE. - } - - /** - * {@inheritDoc} - */ - public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - - // TODO it's put anyway.. but with check? - Object prev =3D cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, dat= a.getIdentifier()); - if (prev =3D=3D null) - { - throw new IllegalStateException("Node was deleted (tree)"); - } - - prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); - if (prev =3D=3D null) - { - throw new IllegalStateException("Node was deleted (items)"); - } - } - - /** - * {@inheritDoc} - */ - public void update(PropertyData data) throws RepositoryException, Unsup= portedOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - - // TODO it's put anyway.. but with check? - Fqn parentFqn =3D makeParentFqn(data.getQPath()); - Object prev =3D cache.put(parentFqn, data.getQPath().getName().getAs= String(), data.getIdentifier()); - if (prev =3D=3D null) - { - throw new IllegalStateException("Property was deleted (tree)"); - } - - prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); - if (prev =3D=3D null) - { - throw new IllegalStateException("Property was deleted (items)"); - } - } - - /** - * {@inheritDoc} - */ - public void commit() throws IllegalStateException, RepositoryException - { - if (LOG.isDebugEnabled()) - { - LOG.debug("commit " + batchStarted); - } - - // end batch - if (batchStarted) - { - this.cache.endBatch(true); // treePrint(treeRoot); - batchStarted =3D false; - } - else - { - // TODO - LOG.warn("Commit call without changes made."); - } - } - - /** - * {@inheritDoc} - */ - public void rollback() throws IllegalStateException, RepositoryException - { - if (LOG.isDebugEnabled()) - { - LOG.debug("rollback " + batchStarted); - } - - // rollback batch - if (batchStarted) - { - this.cache.endBatch(false); - batchStarted =3D false; - } - else - { - // TODO - LOG.warn("Rollback call without changes made."); - } - } - - /** - * {@inheritDoc} - */ - public boolean isOpened() - { - return true; - } - - /** - * {@inheritDoc} - */ - public void close() throws IllegalStateException, RepositoryException - { - // TODO Auto-generated method stub - } - - /** - * Start batching. - */ - private void startBatch() - { - if (!batchStarted) - { - batchStarted =3D true; - this.cache.startBatch(); - } - } - -} Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -04 16:05:15 UTC (rev 470) @@ -0,0 +1,404 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.cache.Cache; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 23.10.2009
+ * + * Cache contains several regions:
+ * Workspace tree. /$ROOT: On each leaf (JBossCache Node) an JCR Item Id s= tored.
+ * Items map. /$ITEMS: Key=3DId, Value =3D ItemData.
+ * References map ??? /$REFS: Key=3DNodeId, Value =3D PropertyId.
+ * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class JBossCacheStorageConnection extends JBossCacheStorage impleme= nts WorkspaceStorageConnection +{ + + protected static final Log LOG =3D ExoLogger.getLogger("jcr.JBossCacheS= torageConnection"); + + private final Cache cache; + + //private final Node treeRoot; + + //private final Node itemsRoot; + + /** + * Start batching flag. 'true' if batching was started, 'false' if bat= ching is not start. = + */ + private boolean batchStarted =3D false; + + /** + * JBossCacheStorageConnection constructor. + * + * @param cache Cache + */ + public JBossCacheStorageConnection(Cache cache, N= ode treeRoot, + Node itemsRoot) + { + super(treeRoot.getFqn(), itemsRoot.getFqn()); + = + this.cache =3D cache; + //this.itemsRoot =3D itemsRoot; + //this.treeRoot =3D treeRoot; + } + + /** + * {@inheritDoc} + */ + public void add(NodeData data) throws RepositoryException, UnsupportedO= perationException, InvalidItemStateException, + IllegalStateException + { + startBatch(); + cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier(= )); + cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); // tree= Print(treeRoot); + } + + /** + * {@inheritDoc} + */ + public void add(PropertyData data) throws RepositoryException, Unsuppor= tedOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + Fqn parentFqn =3D makeParentFqn(data.getQPath()); + + // add an attr to the parent node as key=3DPropertyName value=3DProp= ertyId + cache.put(parentFqn, data.getQPath().getName().getAsString(), data.g= etIdentifier()); + cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + } + + /** + * {@inheritDoc} + */ + public void delete(NodeData data) throws RepositoryException, Unsupport= edOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + cache.removeNode(makeNodeFqn(data.getQPath())); + cache.removeNode(makeIdFqn(data.getIdentifier())); + } + + /** + * {@inheritDoc} + */ + public void delete(PropertyData data) throws RepositoryException, Unsup= portedOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + // delete attr on parent by key=3DPropertyName + cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getName= ().getAsString()); + cache.removeNode(makeIdFqn(data.getIdentifier())); + } + + /** + * {@inheritDoc} + */ + public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException + { + //Set childNames =3D cache.getChildrenNames(makeNodeFqn(pare= nt.getQPath())); + Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); + } + + Set> childNodes =3D parentNode.getChildre= n(); + + List childs =3D new ArrayList(); + for (Node child : childNodes) + { + String childId =3D (String)child.get(ITEM_ID); + + // TODO NodeData or PropertyData? As ItemData check then and cast. + NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_DA= TA); + if (node =3D=3D null) + { + throw new RepositoryException("One of childs is null. Parent "= + parent.getQPath().getAsString()); + } + childs.add(node); + } + + return childs; + } + + private void treePrint(Node node) + { + for (Node child : node.getChildren()) + { + System.out.println(child.toString()); + for (Serializable key : child.getKeys()) + { + System.out.println("\t" + key + "=3D" + child.get(key)); + } + if (!child.isLeaf()) + { + treePrint(child); + } + } + } + + /** + * {@inheritDoc} + */ + public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException + { + // TODO treeRoot.getChild(f) possible if f not a direct child??? = + Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); + } + + List childs =3D new ArrayList(); + + for (Serializable key : parentNode.getKeys()) + { + if (!key.equals(ITEM_ID)) + { + String propId =3D (String)parentNode.get(key); + // TODO NodeData or PropertyData? As ItemData check then and c= ast. = + PropertyData property =3D (PropertyData)cache.get(makeIdFqn(pr= opId), ITEM_DATA); + if (property =3D=3D null) + { + throw new RepositoryException("One of childs is null. Paren= t " + parent.getQPath().getAsString()); + } + childs.add(property); + } + } + + return childs; + } + + /** + * {@inheritDoc} + */ + public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException, IllegalStateException + { + // TODO it's same as getChild... now + return getChildPropertiesData(parent); + } + + /** + * {@inheritDoc} + */ + public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException, IllegalStateException + { + Node parentNode =3D cache.getNode(makeNodeFqn(= parentData.getQPath())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get Item data error: parent not = found " + parentData.getQPath().getAsString()); + } + + // TODO check performance of Node vs Property get + + String propertyId =3D (String)parentNode.get(name.getAsString()); + if (propertyId !=3D null) + { + // it's Property Item + return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA); + } + else + { + // it's Node Item + Node node =3D parentNode.getChild(name.getA= sString(true)); // TODO String not Fqn? + if (node !=3D null) + { + String nodeId =3D (String)node.get(ITEM_ID); + if (nodeId !=3D null) + { + return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA); + } + } + } + + return null; + } + + /** + * {@inheritDoc} + */ + public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException + { + return (ItemData)cache.get(makeIdFqn(identifier), ITEM_DATA); + } + + /** + * {@inheritDoc} + */ + public List getReferencesData(String nodeIdentifier) thro= ws RepositoryException, + IllegalStateException, UnsupportedOperationException + { + // TODO refs impl + return new ArrayList(); + } + + /** + * {@inheritDoc} + */ + public void rename(NodeData data) throws RepositoryException, Unsupport= edOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + // TODO move Node to a new position at the tree, + // but prev location was in prev DELETE. + } + + /** + * {@inheritDoc} + */ + public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + + // TODO it's put anyway.. but with check? + Object prev =3D cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, dat= a.getIdentifier()); + if (prev =3D=3D null) + { + throw new IllegalStateException("Node was deleted (tree)"); + } + + prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + if (prev =3D=3D null) + { + throw new IllegalStateException("Node was deleted (items)"); + } + } + + /** + * {@inheritDoc} + */ + public void update(PropertyData data) throws RepositoryException, Unsup= portedOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + + // TODO it's put anyway.. but with check? + Fqn parentFqn =3D makeParentFqn(data.getQPath()); + Object prev =3D cache.put(parentFqn, data.getQPath().getName().getAs= String(), data.getIdentifier()); + if (prev =3D=3D null) + { + throw new IllegalStateException("Property was deleted (tree)"); + } + + prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + if (prev =3D=3D null) + { + throw new IllegalStateException("Property was deleted (items)"); + } + } + + /** + * {@inheritDoc} + */ + public void commit() throws IllegalStateException, RepositoryException + { + if (LOG.isDebugEnabled()) + { + LOG.debug("commit " + batchStarted); + } + + // end batch + if (batchStarted) + { + this.cache.endBatch(true); // treePrint(treeRoot); + batchStarted =3D false; + } + else + { + // TODO + LOG.warn("Commit call without changes made."); + } + } + + /** + * {@inheritDoc} + */ + public void rollback() throws IllegalStateException, RepositoryException + { + if (LOG.isDebugEnabled()) + { + LOG.debug("rollback " + batchStarted); + } + + // rollback batch + if (batchStarted) + { + this.cache.endBatch(false); + batchStarted =3D false; + } + else + { + // TODO + LOG.warn("Rollback call without changes made."); + } + } + + /** + * {@inheritDoc} + */ + public boolean isOpened() + { + return true; + } + + /** + * {@inheritDoc} + */ + public void close() throws IllegalStateException, RepositoryException + { + // TODO Auto-generated method stub + } + + /** + * Start batching. + */ + private void startBatch() + { + if (!batchStarted) + { + batchStarted =3D true; + this.cache.startBatch(); + } + } + +} Copied: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfor= m/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java= (from rev 465, jcr/branches/1.12.0-JBC/component/core/src/main/java/org/ex= oplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.= java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-04 16:05:15 UTC (rev 470) @@ -0,0 +1,408 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.cache.Cache; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; + +/** + * DEPRECATED - DO NOT USE! + * = + * Created by The eXo Platform SAS. + * = + *
Date: 23.10.2009
+ * + * Cache contains several regions:
+ * Workspace tree. /$ROOT: On each leaf (JBossCache Node) an JCR Item Id s= tored.
+ * Items map. /$ITEMS: Key=3DId, Value =3D ItemData.
+ * References map ??? /$REFS: Key=3DNodeId, Value =3D PropertyId.
+ * + * @author Peter N= edonosko = + * @version $Id$ + */ +(a)Deprecated +public class JBossCacheTreeStorageConnection extends JBossCacheStorage imp= lements WorkspaceStorageConnection +{ + + protected static final Log LOG =3D ExoLogger.getLogger("jcr.JBossCacheS= torageConnection"); + + private final Cache cache; + + //private final Node treeRoot; + + //private final Node itemsRoot; + + /** + * Start batching flag. 'true' if batching was started, 'false' if bat= ching is not start. = + */ + private boolean batchStarted =3D false; + + /** + * JBossCacheStorageConnection constructor. + * + * @param cache Cache + */ + @Deprecated + public JBossCacheTreeStorageConnection(Cache cach= e, Node treeRoot, + Node itemsRoot) + { + super(treeRoot.getFqn(), itemsRoot.getFqn()); + = + this.cache =3D cache; + //this.itemsRoot =3D itemsRoot; + //this.treeRoot =3D treeRoot; + } + + /** + * {@inheritDoc} + */ + public void add(NodeData data) throws RepositoryException, UnsupportedO= perationException, InvalidItemStateException, + IllegalStateException + { + startBatch(); + cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier(= )); + cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); // tree= Print(treeRoot); + } + + /** + * {@inheritDoc} + */ + public void add(PropertyData data) throws RepositoryException, Unsuppor= tedOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + Fqn parentFqn =3D makeParentFqn(data.getQPath()); + + // add an attr to the parent node as key=3DPropertyName value=3DProp= ertyId + cache.put(parentFqn, data.getQPath().getName().getAsString(), data.g= etIdentifier()); + cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + } + + /** + * {@inheritDoc} + */ + public void delete(NodeData data) throws RepositoryException, Unsupport= edOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + cache.removeNode(makeNodeFqn(data.getQPath())); + cache.removeNode(makeIdFqn(data.getIdentifier())); + } + + /** + * {@inheritDoc} + */ + public void delete(PropertyData data) throws RepositoryException, Unsup= portedOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + // delete attr on parent by key=3DPropertyName + cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getName= ().getAsString()); + cache.removeNode(makeIdFqn(data.getIdentifier())); + } + + /** + * {@inheritDoc} + */ + public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException + { + //Set childNames =3D cache.getChildrenNames(makeNodeFqn(pare= nt.getQPath())); + Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); + } + + Set> childNodes =3D parentNode.getChildre= n(); + + List childs =3D new ArrayList(); + for (Node child : childNodes) + { + String childId =3D (String)child.get(ITEM_ID); + + // TODO NodeData or PropertyData? As ItemData check then and cast. + NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_DA= TA); + if (node =3D=3D null) + { + throw new RepositoryException("One of childs is null. Parent "= + parent.getQPath().getAsString()); + } + childs.add(node); + } + + return childs; + } + + private void treePrint(Node node) + { + for (Node child : node.getChildren()) + { + System.out.println(child.toString()); + for (Serializable key : child.getKeys()) + { + System.out.println("\t" + key + "=3D" + child.get(key)); + } + if (!child.isLeaf()) + { + treePrint(child); + } + } + } + + /** + * {@inheritDoc} + */ + public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException + { + // TODO treeRoot.getChild(f) possible if f not a direct child??? = + Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); + } + + List childs =3D new ArrayList(); + + for (Serializable key : parentNode.getKeys()) + { + if (!key.equals(ITEM_ID)) + { + String propId =3D (String)parentNode.get(key); + // TODO NodeData or PropertyData? As ItemData check then and c= ast. = + PropertyData property =3D (PropertyData)cache.get(makeIdFqn(pr= opId), ITEM_DATA); + if (property =3D=3D null) + { + throw new RepositoryException("One of childs is null. Paren= t " + parent.getQPath().getAsString()); + } + childs.add(property); + } + } + + return childs; + } + + /** + * {@inheritDoc} + */ + public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException, IllegalStateException + { + // TODO it's same as getChild... now + return getChildPropertiesData(parent); + } + + /** + * {@inheritDoc} + */ + public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException, IllegalStateException + { + Node parentNode =3D cache.getNode(makeNodeFqn(= parentData.getQPath())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get Item data error: parent not = found " + parentData.getQPath().getAsString()); + } + + // TODO check performance of Node vs Property get + + String propertyId =3D (String)parentNode.get(name.getAsString()); + if (propertyId !=3D null) + { + // it's Property Item + return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA); + } + else + { + // it's Node Item + Node node =3D parentNode.getChild(name.getA= sString(true)); // TODO String not Fqn? + if (node !=3D null) + { + String nodeId =3D (String)node.get(ITEM_ID); + if (nodeId !=3D null) + { + return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA); + } + } + } + + return null; + } + + /** + * {@inheritDoc} + */ + public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException + { + return (ItemData)cache.get(makeIdFqn(identifier), ITEM_DATA); + } + + /** + * {@inheritDoc} + */ + public List getReferencesData(String nodeIdentifier) thro= ws RepositoryException, + IllegalStateException, UnsupportedOperationException + { + // TODO refs impl + return new ArrayList(); + } + + /** + * {@inheritDoc} + */ + public void rename(NodeData data) throws RepositoryException, Unsupport= edOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + // TODO move Node to a new position at the tree, + // but prev location was in prev DELETE. + } + + /** + * {@inheritDoc} + */ + public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + + // TODO it's put anyway.. but with check? + Object prev =3D cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, dat= a.getIdentifier()); + if (prev =3D=3D null) + { + throw new IllegalStateException("Node was deleted (tree)"); + } + + prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + if (prev =3D=3D null) + { + throw new IllegalStateException("Node was deleted (items)"); + } + } + + /** + * {@inheritDoc} + */ + public void update(PropertyData data) throws RepositoryException, Unsup= portedOperationException, + InvalidItemStateException, IllegalStateException + { + startBatch(); + + // TODO it's put anyway.. but with check? + Fqn parentFqn =3D makeParentFqn(data.getQPath()); + Object prev =3D cache.put(parentFqn, data.getQPath().getName().getAs= String(), data.getIdentifier()); + if (prev =3D=3D null) + { + throw new IllegalStateException("Property was deleted (tree)"); + } + + prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + if (prev =3D=3D null) + { + throw new IllegalStateException("Property was deleted (items)"); + } + } + + /** + * {@inheritDoc} + */ + public void commit() throws IllegalStateException, RepositoryException + { + if (LOG.isDebugEnabled()) + { + LOG.debug("commit " + batchStarted); + } + + // end batch + if (batchStarted) + { + this.cache.endBatch(true); // treePrint(treeRoot); + batchStarted =3D false; + } + else + { + // TODO + LOG.warn("Commit call without changes made."); + } + } + + /** + * {@inheritDoc} + */ + public void rollback() throws IllegalStateException, RepositoryException + { + if (LOG.isDebugEnabled()) + { + LOG.debug("rollback " + batchStarted); + } + + // rollback batch + if (batchStarted) + { + this.cache.endBatch(false); + batchStarted =3D false; + } + else + { + // TODO + LOG.warn("Rollback call without changes made."); + } + } + + /** + * {@inheritDoc} + */ + public boolean isOpened() + { + return true; + } + + /** + * {@inheritDoc} + */ + public void close() throws IllegalStateException, RepositoryException + { + // TODO Auto-generated method stub + } + + /** + * Start batching. + */ + private void startBatch() + { + if (!batchStarted) + { + batchStarted =3D true; + this.cache.startBatch(); + } + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageCo= nnection.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-04 14= :57:59 UTC (rev 469) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java 2009-11-04 16= :05:15 UTC (rev 470) @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 30.10.2009 - * - * @author Peter N= edonosko = - * @version $Id$ - */ -public class ExoJCRCacheLoaderTest extends JBossCacheStorageConnectionTest -{ - - @Override - protected void initJBCConfig() - { - jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; - } - - = - = -} Copied: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfor= m/services/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java (from= rev 468, jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderTest.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java 2009-11-0= 4 16:05:15 UTC (rev 470) @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 30.10.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class ExoJCRTreeCacheLoaderTest extends JBossCacheTreeStorageConnec= tionTest +{ + + @Override + protected void initJBCConfig() + { + jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; + } + + = + = +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTe= st.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-04 14:57:59 UTC (rev 469) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-04 16:05:15 UTC (rev 470) @@ -1,685 +0,0 @@ -/* - * 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. - */ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import junit.framework.TestCase; - -import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; -import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.jboss.cache.Cache; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; - -import java.io.Serializable; -import java.util.List; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 25.10.2009 - * - * @author Peter N= edonosko = - * @version $Id$ - */ -public class JBossCacheStorageConnectionTest extends TestCase -{ - - protected JBossCacheStorageConnection conn; - - protected Cache cache; - - protected Node tree; - - protected Node items; - = - protected String jbcConfig; = - - /** - * {@inheritDoc} - */ - protected void setUp() throws Exception - { - super.setUp(); - - // JBossCache = - initJBCConfig(); - = - cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); - - Node cacheRoot =3D cache.getRoot(); - //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements("repo", "ws")); - - // prepare cache structures - tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.TREE)); - items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.ITEMS)= ); - - // run cache - cache.create(); - cache.start(); - - // JCR connection - conn =3D new JBossCacheStorageConnection(cache, tree, items); - } - = - protected void initJBCConfig() { - jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; - } - - /** - * {@inheritDoc} - */ - protected void tearDown() throws Exception - { - - cache.stop(); - cache.destroy(); - - super.tearDown(); - } - - private void treePrint(Node node) - { - for (Node child : node.getChildren()) - { - System.out.println(child.toString()); - for (Serializable key : child.getKeys()) - { - System.out.println("\t" + key + "=3D" + child.get(key)); - } - if (!child.isLeaf()) - { - treePrint(child); - } - } - } - - private Fqn makeFqn(Node root, QPath node= Path) - { - QPathEntry[] path =3D nodePath.getEntries(); - String[] fqns =3D new String[path.length]; - - for (int i =3D 0; i < path.length; i++) - { - fqns[i] =3D path[i].getAsString(true); - } - - return Fqn.fromRelativeFqn(root.getFqn(), Fqn.fromElements(fqns)); - } - - public void testAddNode() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check in tree - treePrint(tree); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertNotNull("Node expected", rootNode); - - assertEquals("Childs expected", 2, rootNode.getChildren().size()); - - for (Node child : rootNode.getChildren()) - { - String nodeName =3D child.getFqn().getLastElementAsString(); - String nodeId =3D (String)child.get(JBossCacheStorageConnection.I= TEM_ID); - if (nodeName.equals(node1path.getEntries()[node1path.getEntries()= .length - 1].getAsString(true))) - { - assertEquals("Node id wrong", node1id, nodeId); - } - else if (nodeName - .equals(Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_S= YSTEM_PATH.getEntries().length - 1] - .getAsString(true))) - { - assertEquals("Node id wrong", Constants.SYSTEM_UUID, nodeId); - } - else - { - fail("Wrong Node name " + nodeName); - } - } - - // check in items - treePrint(items); - - Node itemsNode =3D items.getChild(Fqn.fromElem= ents(node1id)); - assertNotNull("Node item data should exists", itemsNode); - - Object dataObject =3D itemsNode.get(JBossCacheStorageConnection.ITEM= _DATA); - assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); - - NodeData data =3D (NodeData)dataObject; - assertEquals("Node id wrong", node1id, data.getIdentifier()); - assertEquals("Node path wrong", node1path, data.getQPath()); - } - - public void testAddProperty() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); - String propValue1 =3D "Property value #1"; - propData1.setValue(new TransientValueData(propValue1)); - conn.add(propData1); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); - TransientPropertyData propData2 =3D new TransientPropertyData(propPa= th2, propId2, 1, 1, Constants.ROOT_UUID, false); - String propValue2 =3D "Property value #2"; - propData2.setValue(new TransientValueData(propValue2)); - conn.add(propData2); - - // check in tree - treePrint(tree); - - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertEquals("Attributes ammount wrong", 3, rootNode.getKeys().size(= )); - - String pid1 =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAs= String()); - assertNotNull("Property ID should exists", pid1); - assertEquals("Property ID wrong", propId1, pid1); - - String pid2 =3D (String)rootNode.get(Constants.JCR_MIXINTYPES.getAsS= tring()); - assertNotNull("Property ID should exists", pid2); - assertEquals("Property ID wrong", propId2, pid2); - - // TODO check order - int index =3D 0; - for (Serializable key : rootNode.getKeys()) - { - //System.out.println(key); - //index++; - } - - // check in items - treePrint(items); - - Node itemsProp1 =3D items.getChild(Fqn.fromEle= ments(propId1)); - Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data1Object); - assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); - - PropertyData data1 =3D (PropertyData)data1Object; - assertEquals("Property id wrong", propId1, data1.getIdentifier()); - assertEquals("Property path wrong", propPath1, data1.getQPath()); - assertEquals("Property Value wrong", propValue1, new String(data1.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - - Node itemsProp2 =3D items.getChild(Fqn.fromEle= ments(propId2)); - Object data2Object =3D itemsProp2.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data2Object); - assertTrue("Property item data is not a Property", data2Object insta= nceof PropertyData); - - PropertyData data2 =3D (PropertyData)data2Object; - assertEquals("Property id wrong", propId2, data2.getIdentifier()); - assertEquals("Property path wrong", propPath2, data2.getQPath()); - assertEquals("Property Value wrong", propValue2, new String(data2.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - } - - public void testDeleteNode() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertEquals("Number of childs wrong", 2, rootNode.getChildren().siz= e()); - - // delete /node - conn.delete(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // check in tree - treePrint(tree); - - Node node =3D - rootNode.getChild(Fqn - .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); - - assertNull("Node should be deleted", node); - - assertEquals("Childs expected", 1, rootNode.getChildren().size()); - - Node child =3D rootNode.getChildren().iterator= ().next(); - assertEquals("Node name wrong", - Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_SYSTEM_PATH.= getEntries().length - 1].getAsString(true), - child.getFqn().getLastElementAsString()); - - assertEquals("Node id wrong", Constants.SYSTEM_UUID, (String)child.g= et(JBossCacheStorageConnection.ITEM_ID)); - - // check in items - treePrint(items); - - assertNull("Node item data should not exists", items.getChild(Fqn.fr= omElements(node1id))); - assertNotNull("Node item data should exists", items.getChild(Fqn.fro= mElements(Constants.SYSTEM_UUID))); - } - - public void testDeleteProperty() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, - 1, 1, Constants.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, - 1, 1, Constants.ROOT_UUID, false)); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - // delete /jcr:primaryType - conn.delete(new TransientPropertyData(QPath.makeChildPath(Constants.= ROOT_PATH, Constants.JCR_PRIMARYTYPE), - propId1, 1, 1, Constants.ROOT_UUID, false)); - - // check in tree - treePrint(tree); - - assertEquals("Number of childs wrong", 2, rootNode.getKeys().size()); - - assertNull("Property should be deleted", rootNode.get(Constants.JCR_= PRIMARYTYPE.getAsString())); - - assertNotNull("Property should exists", rootNode.get(Constants.JCR_M= IXINTYPES.getAsString())); - - // check in items - treePrint(items); - - assertNull("Property item data should not exists", items.getChild(Fq= n.fromElements(propId1))); - assertNotNull("Property item data should exists", items.getChild(Fqn= .fromElements(propId2))); - } - - public void testUpdateNode() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - // update /node (order number) - int nodeOrderNumb =3D 1; - conn.update(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], - nodeOrderNumb, Constants.ROOT_UUID, new AccessControlList())); - - // check in tree - treePrint(tree); - - Node node =3D - rootNode.getChild(Fqn - .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); - - assertNotNull("Node should exists", node); - assertEquals("Child expected", 1, rootNode.getChildren().size()); - - // check in items - treePrint(items); - - Node itemNode =3D items.getChild(Fqn.fromEleme= nts(node1id)); - assertNotNull("Node item data should exists", itemNode); - - Object dataObject =3D itemNode.get(JBossCacheStorageConnection.ITEM_= DATA); - assertTrue("Node item data should be a NodeData", dataObject instanc= eof NodeData); - assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getIde= ntifier()); - assertEquals("Node path wrong", node1path, ((NodeData)dataObject).ge= tQPath()); - assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)da= taObject).getOrderNumber()); - } - - public void testUpdateProperty() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/prop1) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); - String propValue1 =3D "Property value #1"; - propData1.setValue(new TransientValueData(propValue1)); - conn.add(propData1); - - // update property (/prop1) with new value - TransientPropertyData propDataU =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); - String propValueU =3D "Updated Property value #1"; - propDataU.setValue(new TransientValueData(propValueU)); - conn.update(propDataU); - - // check in tree - treePrint(tree); - - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertEquals("Attributes ammount wrong", 2, rootNode.getKeys().size(= )); - - String pid =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsS= tring()); - assertEquals("Property ID wrong", propId1, pid); - - // check in items - treePrint(items); - - Node itemsProp1 =3D items.getChild(Fqn.fromEle= ments(propId1)); - Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data1Object); - assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); - - PropertyData data1 =3D (PropertyData)data1Object; - assertEquals("Property id wrong", propId1, data1.getIdentifier()); - assertEquals("Property path wrong", propPath1, data1.getQPath()); - assertEquals("Property Value wrong", propValueU, new String(data1.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - } - - public void testGetNodeByName() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check = - ItemData nodeItem =3D - conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), - node1path.getEntries()[node1path.getEntries().length - 1]); - - assertTrue("Node expected", nodeItem.isNode()); - assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); - assertEquals("Node path wrong", node1path, nodeItem.getQPath()); - } - - public void testGetPropertyByName() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); - conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); - - // check = - ItemData propItem =3D - conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), - propPath1.getEntries()[propPath1.getEntries().length - 1]); - - assertFalse("Proeprty expected", propItem.isNode()); - assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); - assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); - } - - public void testGetNodeById() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check = - ItemData nodeItem =3D conn.getItemData(node1id); - - assertTrue("Node expected", nodeItem.isNode()); - assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); - assertEquals("Node path wrong", node1path, nodeItem.getQPath()); - } - - public void testGetPropertyById() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); - conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); - - // check = - ItemData propItem =3D conn.getItemData(propId1); - - assertFalse("Proeprty expected", propItem.isNode()); - assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); - assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); - } - - public void testGetChildNodes() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check in tree - treePrint(tree); - - List childs =3D - conn.getChildNodesData(new TransientNodeData(Constants.ROOT_PATH,= Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); - - assertEquals("Childs amount wrong", 2, childs.size()); - - for (NodeData child : childs) - { - if (child.getQPath().equals(node1path)) - { - assertEquals("Node id wrong", node1id, child.getIdentifier()); - } - else if (child.getQPath().equals(Constants.JCR_SYSTEM_PATH)) - { - assertEquals("Node id wrong", Constants.SYSTEM_UUID, child.get= Identifier()); - } - else - { - fail("Wrong Node found"); - } - } - } - - public void testGetChildProperties() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, - 1, 1, Constants.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, - 1, 1, Constants.ROOT_UUID, false)); - - // add property (/a) - String propId3 =3D "3"; - InternalQName propName3 =3D InternalQName.parse("[]a"); - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName3), propId3, 1, 1, - Constants.ROOT_UUID, false)); - - // add property (/b) - String propId4 =3D "4"; - InternalQName propName4 =3D InternalQName.parse("[]b"); - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName4), propId4, 1, 1, - Constants.ROOT_UUID, false)); - - // check - treePrint(tree); - - List childs =3D - conn.getChildPropertiesData(new TransientNodeData(Constants.ROOT_= PATH, Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); - - assertEquals("Childs amount wrong", 4, childs.size()); - - for (PropertyData child : childs) - { - if (child.getQPath().getName().equals(Constants.JCR_PRIMARYTYPE)) - { - assertEquals("Property id wrong", propId1, child.getIdentifier= ()); - } - else if (child.getQPath().getName().equals(Constants.JCR_MIXINTYP= ES)) - { - assertEquals("Property id wrong", propId2, child.getIdentifier= ()); - } - else if (child.getQPath().getName().equals(propName3)) - { - assertEquals("Property id wrong", propId3, child.getIdentifier= ()); - } - else if (child.getQPath().getName().equals(propName4)) - { - assertEquals("Property id wrong", propId4, child.getIdentifier= ()); - } - else - { - fail("Wrong Property found"); - } - } - } - -} Copied: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfor= m/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.= java (from rev 468, jcr/branches/1.12.0-JBC/component/core/src/test/java/or= g/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnect= ionTest.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java= (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java= 2009-11-04 16:05:15 UTC (rev 470) @@ -0,0 +1,685 @@ +/* + * 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. + */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.jboss.cache.Cache; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; + +import java.io.Serializable; +import java.util.List; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 25.10.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class JBossCacheTreeStorageConnectionTest extends TestCase +{ + + protected JBossCacheTreeStorageConnection conn; + + protected Cache cache; + + protected Node tree; + + protected Node items; + = + protected String jbcConfig; = + + /** + * {@inheritDoc} + */ + protected void setUp() throws Exception + { + super.setUp(); + + // JBossCache = + initJBCConfig(); + = + cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); + + Node cacheRoot =3D cache.getRoot(); + //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements("repo", "ws")); + + // prepare cache structures + tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.TREE)); + items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.ITEMS)= ); + + // run cache + cache.create(); + cache.start(); + + // JCR connection + conn =3D new JBossCacheTreeStorageConnection(cache, tree, items); + } + = + protected void initJBCConfig() { + jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; + } + + /** + * {@inheritDoc} + */ + protected void tearDown() throws Exception + { + + cache.stop(); + cache.destroy(); + + super.tearDown(); + } + + private void treePrint(Node node) + { + for (Node child : node.getChildren()) + { + System.out.println(child.toString()); + for (Serializable key : child.getKeys()) + { + System.out.println("\t" + key + "=3D" + child.get(key)); + } + if (!child.isLeaf()) + { + treePrint(child); + } + } + } + + private Fqn makeFqn(Node root, QPath node= Path) + { + QPathEntry[] path =3D nodePath.getEntries(); + String[] fqns =3D new String[path.length]; + + for (int i =3D 0; i < path.length; i++) + { + fqns[i] =3D path[i].getAsString(true); + } + + return Fqn.fromRelativeFqn(root.getFqn(), Fqn.fromElements(fqns)); + } + + public void testAddNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check in tree + treePrint(tree); + + // get root node ([]:1) + Node rootNode =3D + tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] + .getAsString(true))); + + assertNotNull("Node expected", rootNode); + + assertEquals("Childs expected", 2, rootNode.getChildren().size()); + + for (Node child : rootNode.getChildren()) + { + String nodeName =3D child.getFqn().getLastElementAsString(); + String nodeId =3D (String)child.get(JBossCacheStorageConnection.I= TEM_ID); + if (nodeName.equals(node1path.getEntries()[node1path.getEntries()= .length - 1].getAsString(true))) + { + assertEquals("Node id wrong", node1id, nodeId); + } + else if (nodeName + .equals(Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_S= YSTEM_PATH.getEntries().length - 1] + .getAsString(true))) + { + assertEquals("Node id wrong", Constants.SYSTEM_UUID, nodeId); + } + else + { + fail("Wrong Node name " + nodeName); + } + } + + // check in items + treePrint(items); + + Node itemsNode =3D items.getChild(Fqn.fromElem= ents(node1id)); + assertNotNull("Node item data should exists", itemsNode); + + Object dataObject =3D itemsNode.get(JBossCacheStorageConnection.ITEM= _DATA); + assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); + + NodeData data =3D (NodeData)dataObject; + assertEquals("Node id wrong", node1id, data.getIdentifier()); + assertEquals("Node path wrong", node1path, data.getQPath()); + } + + public void testAddProperty() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValue1 =3D "Property value #1"; + propData1.setValue(new TransientValueData(propValue1)); + conn.add(propData1); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); + TransientPropertyData propData2 =3D new TransientPropertyData(propPa= th2, propId2, 1, 1, Constants.ROOT_UUID, false); + String propValue2 =3D "Property value #2"; + propData2.setValue(new TransientValueData(propValue2)); + conn.add(propData2); + + // check in tree + treePrint(tree); + + Node rootNode =3D + tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] + .getAsString(true))); + + assertEquals("Attributes ammount wrong", 3, rootNode.getKeys().size(= )); + + String pid1 =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAs= String()); + assertNotNull("Property ID should exists", pid1); + assertEquals("Property ID wrong", propId1, pid1); + + String pid2 =3D (String)rootNode.get(Constants.JCR_MIXINTYPES.getAsS= tring()); + assertNotNull("Property ID should exists", pid2); + assertEquals("Property ID wrong", propId2, pid2); + + // TODO check order + int index =3D 0; + for (Serializable key : rootNode.getKeys()) + { + //System.out.println(key); + //index++; + } + + // check in items + treePrint(items); + + Node itemsProp1 =3D items.getChild(Fqn.fromEle= ments(propId1)); + Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); + assertNotNull("Property item data should exists", data1Object); + assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); + + PropertyData data1 =3D (PropertyData)data1Object; + assertEquals("Property id wrong", propId1, data1.getIdentifier()); + assertEquals("Property path wrong", propPath1, data1.getQPath()); + assertEquals("Property Value wrong", propValue1, new String(data1.ge= tValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + + Node itemsProp2 =3D items.getChild(Fqn.fromEle= ments(propId2)); + Object data2Object =3D itemsProp2.get(JBossCacheStorageConnection.IT= EM_DATA); + assertNotNull("Property item data should exists", data2Object); + assertTrue("Property item data is not a Property", data2Object insta= nceof PropertyData); + + PropertyData data2 =3D (PropertyData)data2Object; + assertEquals("Property id wrong", propId2, data2.getIdentifier()); + assertEquals("Property path wrong", propPath2, data2.getQPath()); + assertEquals("Property Value wrong", propValue2, new String(data2.ge= tValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + } + + public void testDeleteNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // get root node ([]:1) + Node rootNode =3D + tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] + .getAsString(true))); + + assertEquals("Number of childs wrong", 2, rootNode.getChildren().siz= e()); + + // delete /node + conn.delete(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // check in tree + treePrint(tree); + + Node node =3D + rootNode.getChild(Fqn + .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); + + assertNull("Node should be deleted", node); + + assertEquals("Childs expected", 1, rootNode.getChildren().size()); + + Node child =3D rootNode.getChildren().iterator= ().next(); + assertEquals("Node name wrong", + Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_SYSTEM_PATH.= getEntries().length - 1].getAsString(true), + child.getFqn().getLastElementAsString()); + + assertEquals("Node id wrong", Constants.SYSTEM_UUID, (String)child.g= et(JBossCacheStorageConnection.ITEM_ID)); + + // check in items + treePrint(items); + + assertNull("Node item data should not exists", items.getChild(Fqn.fr= omElements(node1id))); + assertNotNull("Node item data should exists", items.getChild(Fqn.fro= mElements(Constants.SYSTEM_UUID))); + } + + public void testDeleteProperty() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, + 1, 1, Constants.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, + 1, 1, Constants.ROOT_UUID, false)); + + // get root node ([]:1) + Node rootNode =3D + tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] + .getAsString(true))); + + // delete /jcr:primaryType + conn.delete(new TransientPropertyData(QPath.makeChildPath(Constants.= ROOT_PATH, Constants.JCR_PRIMARYTYPE), + propId1, 1, 1, Constants.ROOT_UUID, false)); + + // check in tree + treePrint(tree); + + assertEquals("Number of childs wrong", 2, rootNode.getKeys().size()); + + assertNull("Property should be deleted", rootNode.get(Constants.JCR_= PRIMARYTYPE.getAsString())); + + assertNotNull("Property should exists", rootNode.get(Constants.JCR_M= IXINTYPES.getAsString())); + + // check in items + treePrint(items); + + assertNull("Property item data should not exists", items.getChild(Fq= n.fromElements(propId1))); + assertNotNull("Property item data should exists", items.getChild(Fqn= .fromElements(propId2))); + } + + public void testUpdateNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // get root node ([]:1) + Node rootNode =3D + tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] + .getAsString(true))); + + // update /node (order number) + int nodeOrderNumb =3D 1; + conn.update(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], + nodeOrderNumb, Constants.ROOT_UUID, new AccessControlList())); + + // check in tree + treePrint(tree); + + Node node =3D + rootNode.getChild(Fqn + .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); + + assertNotNull("Node should exists", node); + assertEquals("Child expected", 1, rootNode.getChildren().size()); + + // check in items + treePrint(items); + + Node itemNode =3D items.getChild(Fqn.fromEleme= nts(node1id)); + assertNotNull("Node item data should exists", itemNode); + + Object dataObject =3D itemNode.get(JBossCacheStorageConnection.ITEM_= DATA); + assertTrue("Node item data should be a NodeData", dataObject instanc= eof NodeData); + assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getIde= ntifier()); + assertEquals("Node path wrong", node1path, ((NodeData)dataObject).ge= tQPath()); + assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)da= taObject).getOrderNumber()); + } + + public void testUpdateProperty() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/prop1) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValue1 =3D "Property value #1"; + propData1.setValue(new TransientValueData(propValue1)); + conn.add(propData1); + + // update property (/prop1) with new value + TransientPropertyData propDataU =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValueU =3D "Updated Property value #1"; + propDataU.setValue(new TransientValueData(propValueU)); + conn.update(propDataU); + + // check in tree + treePrint(tree); + + Node rootNode =3D + tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] + .getAsString(true))); + + assertEquals("Attributes ammount wrong", 2, rootNode.getKeys().size(= )); + + String pid =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsS= tring()); + assertEquals("Property ID wrong", propId1, pid); + + // check in items + treePrint(items); + + Node itemsProp1 =3D items.getChild(Fqn.fromEle= ments(propId1)); + Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); + assertNotNull("Property item data should exists", data1Object); + assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); + + PropertyData data1 =3D (PropertyData)data1Object; + assertEquals("Property id wrong", propId1, data1.getIdentifier()); + assertEquals("Property path wrong", propPath1, data1.getQPath()); + assertEquals("Property Value wrong", propValueU, new String(data1.ge= tValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + } + + public void testGetNodeByName() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check = + ItemData nodeItem =3D + conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), + node1path.getEntries()[node1path.getEntries().length - 1]); + + assertTrue("Node expected", nodeItem.isNode()); + assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); + assertEquals("Node path wrong", node1path, nodeItem.getQPath()); + } + + public void testGetPropertyByName() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); + conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); + + // check = + ItemData propItem =3D + conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), + propPath1.getEntries()[propPath1.getEntries().length - 1]); + + assertFalse("Proeprty expected", propItem.isNode()); + assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); + assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); + } + + public void testGetNodeById() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check = + ItemData nodeItem =3D conn.getItemData(node1id); + + assertTrue("Node expected", nodeItem.isNode()); + assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); + assertEquals("Node path wrong", node1path, nodeItem.getQPath()); + } + + public void testGetPropertyById() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); + conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); + + // check = + ItemData propItem =3D conn.getItemData(propId1); + + assertFalse("Proeprty expected", propItem.isNode()); + assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); + assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); + } + + public void testGetChildNodes() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check in tree + treePrint(tree); + + List childs =3D + conn.getChildNodesData(new TransientNodeData(Constants.ROOT_PATH,= Constants.ROOT_UUID, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); + + assertEquals("Childs amount wrong", 2, childs.size()); + + for (NodeData child : childs) + { + if (child.getQPath().equals(node1path)) + { + assertEquals("Node id wrong", node1id, child.getIdentifier()); + } + else if (child.getQPath().equals(Constants.JCR_SYSTEM_PATH)) + { + assertEquals("Node id wrong", Constants.SYSTEM_UUID, child.get= Identifier()); + } + else + { + fail("Wrong Node found"); + } + } + } + + public void testGetChildProperties() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, + 1, 1, Constants.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, + 1, 1, Constants.ROOT_UUID, false)); + + // add property (/a) + String propId3 =3D "3"; + InternalQName propName3 =3D InternalQName.parse("[]a"); + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName3), propId3, 1, 1, + Constants.ROOT_UUID, false)); + + // add property (/b) + String propId4 =3D "4"; + InternalQName propName4 =3D InternalQName.parse("[]b"); + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName4), propId4, 1, 1, + Constants.ROOT_UUID, false)); + + // check + treePrint(tree); + + List childs =3D + conn.getChildPropertiesData(new TransientNodeData(Constants.ROOT_= PATH, Constants.ROOT_UUID, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); + + assertEquals("Childs amount wrong", 4, childs.size()); + + for (PropertyData child : childs) + { + if (child.getQPath().getName().equals(Constants.JCR_PRIMARYTYPE)) + { + assertEquals("Property id wrong", propId1, child.getIdentifier= ()); + } + else if (child.getQPath().getName().equals(Constants.JCR_MIXINTYP= ES)) + { + assertEquals("Property id wrong", propId2, child.getIdentifier= ()); + } + else if (child.getQPath().getName().equals(propName3)) + { + assertEquals("Property id wrong", propId3, child.getIdentifier= ()); + } + else if (child.getQPath().getName().equals(propName4)) + { + assertEquals("Property id wrong", propId4, child.getIdentifier= ()); + } + else + { + fail("Wrong Property found"); + } + } + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageCo= nnectionTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id --===============7820944236690949556==-- From do-not-reply at jboss.org Wed Nov 4 11:11:40 2009 Content-Type: multipart/mixed; boundary="===============7629265361752837652==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r471 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container. Date: Wed, 04 Nov 2009 11:11:39 -0500 Message-ID: <200911041611.nA4GBdPf012431@svn01.web.mwc.hst.phx2.redhat.com> --===============7629265361752837652== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-04 11:11:38 -0500 (Wed, 04 Nov 2009) New Revision: 471 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/RootContainer.java Log: EXOJCR-223 Unnecessary message removed Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/RootContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/RootContainer.java 2009-11-04 16:05:15 UTC (rev 470) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/RootContainer.java 2009-11-04 16:11:38 UTC (rev 471) @@ -428,7 +428,6 @@ else { booting =3D true; - log.info("Booting root container with id " + RootContain= er.class.hashCode() + ""); log.info("Building root container"); long time =3D -System.currentTimeMillis(); result =3D buildRootContainer(); --===============7629265361752837652==-- From do-not-reply at jboss.org Wed Nov 4 11:33:27 2009 Content-Type: multipart/mixed; boundary="===============3749620708128567051==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r472 - core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security. Date: Wed, 04 Nov 2009 11:33:27 -0500 Message-ID: <200911041633.nA4GXRTA018804@svn01.web.mwc.hst.phx2.redhat.com> --===============3749620708128567051== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-04 11:33:27 -0500 (Wed, 04 Nov 2009) New Revision: 472 Modified: core/trunk/exo.core.component.security.core/src/main/java/org/exoplatfor= m/services/security/IdentityRegistry.java Log: EXOJCR-224 logging level changed Modified: core/trunk/exo.core.component.security.core/src/main/java/org/exo= platform/services/security/IdentityRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/src/main/java/org/exoplatfo= rm/services/security/IdentityRegistry.java 2009-11-04 16:11:38 UTC (rev 471) +++ core/trunk/exo.core.component.security.core/src/main/java/org/exoplatfo= rm/services/security/IdentityRegistry.java 2009-11-04 16:33:27 UTC (rev 472) @@ -73,7 +73,7 @@ } catch (NullPointerException e) { - LOG.warn("Parameter " + INIT_PARAM_CONCURRENCY_LEVEL + " was not = found in configuration, default " + LOG.info("Parameter " + INIT_PARAM_CONCURRENCY_LEVEL + " was not = found in configuration, default " + DEFAULT_CONCURRENCY_LEVEL + "will be used."); return DEFAULT_CONCURRENCY_LEVEL; } --===============3749620708128567051==-- From do-not-reply at jboss.org Wed Nov 4 11:39:06 2009 Content-Type: multipart/mixed; boundary="===============6454067229350227784==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r473 - core/trunk/exo.core.component.security.core/src/main/java/org/exoplatform/services/security. Date: Wed, 04 Nov 2009 11:39:06 -0500 Message-ID: <200911041639.nA4Gd6I0020107@svn01.web.mwc.hst.phx2.redhat.com> --===============6454067229350227784== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-04 11:39:05 -0500 (Wed, 04 Nov 2009) New Revision: 473 Modified: core/trunk/exo.core.component.security.core/src/main/java/org/exoplatfor= m/services/security/ConversationRegistry.java Log: EXOJCR-225 logging level changed Modified: core/trunk/exo.core.component.security.core/src/main/java/org/exo= platform/services/security/ConversationRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/src/main/java/org/exoplatfo= rm/services/security/ConversationRegistry.java 2009-11-04 16:33:27 UTC (rev= 472) +++ core/trunk/exo.core.component.security.core/src/main/java/org/exoplatfo= rm/services/security/ConversationRegistry.java 2009-11-04 16:39:05 UTC (rev= 473) @@ -85,7 +85,7 @@ } catch (NullPointerException e) { - LOG.warn("Parameter " + INIT_PARAM_CONCURRENCY_LEVEL + " was not = found in configuration, default " + LOG.info("Parameter " + INIT_PARAM_CONCURRENCY_LEVEL + " was not = found in configuration, default " + DEFAULT_CONCURRENCY_LEVEL + " will be used."); return DEFAULT_CONCURRENCY_LEVEL; } --===============6454067229350227784==-- From do-not-reply at jboss.org Wed Nov 4 11:44:38 2009 Content-Type: multipart/mixed; boundary="===============1201467813624139154==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r474 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/access. Date: Wed, 04 Nov 2009 11:44:38 -0500 Message-ID: <200911041644.nA4Gicjj021300@svn01.web.mwc.hst.phx2.redhat.com> --===============1201467813624139154== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-04 11:44:38 -0500 (Wed, 04 Nov 2009) New Revision: 474 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/access/BaseAuthenticator.java Log: EXOJCR-226 logging level changed Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/access/BaseAuthenticator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/access/BaseAuthenticator.java 2009-11-04 16:39:05 UTC (rev 4= 73) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/access/BaseAuthenticator.java 2009-11-04 16:44:38 UTC (rev 4= 74) @@ -64,7 +64,7 @@ = if (state =3D=3D null) { - log.warn("No current identity found, ANONYMOUS one will be used"); + log.debug("No current identity found, ANONYMOUS one will be used"= ); return new ConversationState(new Identity(SystemIdentity.ANONIM, = new HashSet())); } = --===============1201467813624139154==-- From do-not-reply at jboss.org Wed Nov 4 11:52:10 2009 Content-Type: multipart/mixed; boundary="===============1093414821630362454==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r475 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 04 Nov 2009 11:52:10 -0500 Message-ID: <200911041652.nA4GqAX5023313@svn01.web.mwc.hst.phx2.redhat.com> --===============1093414821630362454== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-04 11:52:09 -0500 (Wed, 04 Nov 2009) New Revision: 475 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-200: reorg for new storage arch Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-04 16:44:= 38 UTC (rev 474) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-04 16:52:= 09 UTC (rev 475) @@ -59,16 +59,17 @@ = public static final String ITEM_ID =3D "$id".intern(); = - protected final Fqn namesRoot; + protected final Fqn treeRoot; = protected final Fqn itemsRoot; = - protected JBossCacheStorage(Fqn namesRoot, Fqn itemsRoo= t) + protected JBossCacheStorage(Fqn treeRoot, Fqn itemsRoot) { - this.namesRoot =3D namesRoot; + this.treeRoot =3D treeRoot; this.itemsRoot =3D itemsRoot; } = + @Deprecated protected Fqn makeNodeFqn(QPath nodePath) { QPathEntry[] path =3D nodePath.getEntries(); @@ -79,9 +80,10 @@ fqns[i] =3D path[i].getAsString(true); } = - return Fqn.fromRelativeFqn(namesRoot, Fqn.fromElements(fqns)); + return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); } = + @Deprecated protected Fqn makeParentFqn(QPath propertyPath) { QPathEntry[] path =3D propertyPath.getEntries(); @@ -93,9 +95,14 @@ fqns[i] =3D path[i].getAsString(true); } = - return Fqn.fromRelativeFqn(namesRoot, Fqn.fromElements(fqns)); + return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); } = + protected Fqn makeTreeFqn(String parentId, QPathEntry itemName) + { + return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(parentId, item= Name.getAsString(true))); + } + protected Fqn makeIdFqn(String itemId) { return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromString(itemId)); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -04 16:44:38 UTC (rev 474) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -04 16:52:09 UTC (rev 475) @@ -43,8 +43,10 @@ *
Date: 23.10.2009
* * Cache contains several regions:
- * Workspace tree. /$ROOT: On each leaf (JBossCache Node) an JCR Item Id s= tored.
- * Items map. /$ITEMS: Key=3DId, Value =3D ItemData.
+ * Items stored in /$ITEMS: one level ItemId, ItemData in attrs
= + * Hierarchy in /$ITEMS: two level subtree,
+ * first ItemId (+attr=3DProperties Ids,ItemData),
+ * second JCR Node names with Node id in attr.

* References map ??? /$REFS: Key=3DNodeId, Value =3D PropertyId.
* * @author Peter N= edonosko = @@ -57,10 +59,6 @@ = private final Cache cache; = - //private final Node treeRoot; - - //private final Node itemsRoot; - /** * Start batching flag. 'true' if batching was started, 'false' if bat= ching is not start. = */ --===============1093414821630362454==-- From do-not-reply at jboss.org Fri Nov 6 04:36:42 2009 Content-Type: multipart/mixed; boundary="===============4279519825478849055==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r476 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 06 Nov 2009 04:36:42 -0500 Message-ID: <200911060936.nA69ag1N023542@svn01.web.mwc.hst.phx2.redhat.com> --===============4279519825478849055== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-06 04:36:42 -0500 (Fri, 06 Nov 2009) New Revision: 476 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/WriteOnlyCacheLoaderException.java Log: EXOJCR-201 : AbstractWriteOnlyCasheLoader was added. Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 09:36:42 UTC (rev 476) @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.jboss.cache.Fqn; +import org.jboss.cache.Modification; +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; +import org.jboss.cache.loader.AbstractCacheLoader; + +/** + * Created by The eXo Platform SAS. + * = + *
+ * Date: 06.11.2009 + * = + * @author Alex Re= shetnyak + * @version $Id$ + */ +public abstract class AbstractWriteOnlyCacheLoader + extends AbstractCacheLoader +{ + private IndividualCacheLoaderConfig config; + + /** + * {@inheritDoc} + */ + public boolean exists(Fqn arg0) throws Exception + { + return false; + } + + /** + * {@inheritDoc} + */ + public Map get(Fqn arg0) throws Exception + { + throw new WriteOnlyCacheLoaderException("The method 'Map get(Fqn arg0)' should not be called."); + } + + /** + * {@inheritDoc} + */ + public Set getChildrenNames(Fqn arg0) throws Exception + { + return new HashSet(); + } + + /** + * {@inheritDoc} + */ + public IndividualCacheLoaderConfig getConfig() + { + return config; + } + + /** + * {@inheritDoc} + */ + public void put(Fqn arg0, Map arg1) throws Exception + { + throw new WriteOnlyCacheLoaderException("The method 'put(Fqn arg0, M= ap arg1))' should not be called."); + } + + /** + * {@inheritDoc} + */ + public Object put(Fqn arg0, Object arg1, Object arg2) throws Exception + { + throw new WriteOnlyCacheLoaderException("The method 'put(Fqn arg0, O= bject arg1, Object arg2)' should not be called."); + } + + /** + * {@inheritDoc} + */ + public void remove(Fqn arg0) throws Exception + { + throw new WriteOnlyCacheLoaderException("The method 'remove(Fqn arg0= )' should not be called."); + } + + /** + * {@inheritDoc} + */ + public Object remove(Fqn arg0, Object arg1) throws Exception + { + throw new WriteOnlyCacheLoaderException("The method 'remove(Fqn arg0= , Object arg1)' should not be called."); + } + + /** + * {@inheritDoc} + */ + public void removeData(Fqn arg0) throws Exception + { + throw new WriteOnlyCacheLoaderException("The method 'removeData(Fqn = arg0)' should not be called."); + } + + /** + * {@inheritDoc} + */ + public void setConfig(IndividualCacheLoaderConfig config) + { + this.config =3D config; + } + = + /** + * That method should be override in other loaders (indexer, lock, obse= rvation). = + */ + public abstract void put(List modifications) throws Excep= tion ; + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheL= oader.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/WriteOnlyCacheLoaderException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/WriteOnlyCacheLoaderException.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/WriteOnlyCacheLoaderException.java 2009-= 11-06 09:36:42 UTC (rev 476) @@ -0,0 +1,48 @@ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +public class WriteOnlyCacheLoaderException + extends Exception +{ + /** + * Constructs an Exception without a message. + */ + public WriteOnlyCacheLoaderException() + { + super(); + } + + /** + * Constructs an Exception with a detailed message. + * = + * @param Message + * The message associated with the exception. + */ + public WriteOnlyCacheLoaderException(String message) + { + super(message); + } + + /** + * Constructs an Exception with a detailed message and base exception. + * = + * @param Message + * The message associated with the exception. + * @param cause + * Throwable, the base exception. + */ + public WriteOnlyCacheLoaderException(String message, Throwable cause) + { + super(message, cause); + } + + /** + * WriteOnlyCacheLoaderException constructor. + * + * @param cause + * Throwable, the base exception. + */ + public WriteOnlyCacheLoaderException(Throwable cause) + { + super(cause); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/WriteOnlyCacheLoaderExc= eption.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============4279519825478849055==-- From do-not-reply at jboss.org Fri Nov 6 04:39:34 2009 Content-Type: multipart/mixed; boundary="===============8083035942384843767==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r477 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 06 Nov 2009 04:39:34 -0500 Message-ID: <200911060939.nA69dYBY023703@svn01.web.mwc.hst.phx2.redhat.com> --===============8083035942384843767== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-06 04:39:33 -0500 (Fri, 06 Nov 2009) New Revision: 477 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java Log: EXOJCR-201 : AbstractWriteOnlyCasheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 09:36:42 UTC (rev 476) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 09:39:33 UTC (rev 477) @@ -55,7 +55,7 @@ */ public Map get(Fqn arg0) throws Exception { - throw new WriteOnlyCacheLoaderException("The method 'Map get(Fqn arg0)' should not be called."); + return Collections.emptyMap(); } = /** --===============8083035942384843767==-- From do-not-reply at jboss.org Fri Nov 6 05:00:29 2009 Content-Type: multipart/mixed; boundary="===============0440635970000448506==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r478 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 06 Nov 2009 05:00:29 -0500 Message-ID: <200911061000.nA6A0TJa026527@svn01.web.mwc.hst.phx2.redhat.com> --===============0440635970000448506== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-06 05:00:28 -0500 (Fri, 06 Nov 2009) New Revision: 478 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java Log: EXOJCR-201 : AbstractWriteOnlyCasheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 09:39:33 UTC (rev 477) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 10:00:28 UTC (rev 478) @@ -63,7 +63,7 @@ */ public Set getChildrenNames(Fqn arg0) throws Exception { - return new HashSet(); + return null; } = /** --===============0440635970000448506==-- From do-not-reply at jboss.org Fri Nov 6 05:06:19 2009 Content-Type: multipart/mixed; boundary="===============9216259754656248168==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r479 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 06 Nov 2009 05:06:19 -0500 Message-ID: <200911061006.nA6A6JkO028189@svn01.web.mwc.hst.phx2.redhat.com> --===============9216259754656248168== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-06 05:06:18 -0500 (Fri, 06 Nov 2009) New Revision: 479 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java Log: EXOJCR-201 : AbstractWriteOnlyCasheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 10:00:28 UTC (rev 478) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 10:06:18 UTC (rev 479) @@ -16,9 +16,7 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -123,7 +121,7 @@ } = /** - * That method should be override in other loaders (indexer, lock, obse= rvation). = + * {@inheritDoc} */ public abstract void put(List modifications) throws Excep= tion ; = --===============9216259754656248168==-- From do-not-reply at jboss.org Fri Nov 6 05:17:08 2009 Content-Type: multipart/mixed; boundary="===============6797996022200113941==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r480 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 06 Nov 2009 05:17:07 -0500 Message-ID: <200911061017.nA6AH7Uq029950@svn01.web.mwc.hst.phx2.redhat.com> --===============6797996022200113941== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-06 05:17:07 -0500 (Fri, 06 Nov 2009) New Revision: 480 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Removed: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java Log: EXOJCR-200: reorg for new storage arch Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 10:06:18 UTC (rev 479) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractWriteOnlyCacheLoader.java 2009-1= 1-06 10:17:07 UTC (rev 480) @@ -16,16 +16,16 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.jboss.cache.Fqn; +import org.jboss.cache.Modification; +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; +import org.jboss.cache.loader.AbstractCacheLoader; + import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; = -import org.jboss.cache.Fqn; -import org.jboss.cache.Modification; -import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; -import org.jboss.cache.loader.AbstractCacheLoader; - /** * Created by The eXo Platform SAS. * = Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-11-06 10:06:= 18 UTC (rev 479) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java 2009-11-06 10:17:= 07 UTC (rev 480) @@ -1,322 +0,0 @@ -/* - * 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. - */ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.datamodel.IllegalNameException; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; -import org.jboss.cache.Fqn; -import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; -import org.jboss.cache.factories.annotations.Inject; -import org.jboss.cache.loader.AbstractCacheLoader; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 31.10.2009 - * - * @author Peter N= edonosko = - * @version $Id$ - */ -public class ExoJCRCacheLoader extends AbstractCacheLoader -{ - - private WorkspaceDataContainer dataContainer; - - /** - * Init the loader DataContainer with given WorkspaceDataContainer inst= ance. - * - * @param dataContainer WorkspaceDataContainer - */ - @Inject - public void initDataContainer(WorkspaceDataContainer dataContainer) thr= ows RepositoryConfigurationException - { - if (this.dataContainer !=3D null) - { - throw new RepositoryConfigurationException("Cannot set WorkspaceD= ataContainer twice"); - } - - this.dataContainer =3D dataContainer; - } - - protected QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberF= ormatException, IllegalNameException - { - List elements =3D nodeFqn.peekElements(); - QPathEntry[] path =3D new QPathEntry[elements.size()]; - - for (int i =3D 0; i < elements.size(); i++) - { - path[i] =3D QPathEntry.parse(elements.get(i)); - } - - return path; - } - - /** - * {@inheritDoc} - */ - public Map get(Fqn name) throws Exception - { - - Map attrs =3D new LinkedHashMap(); - if (name.size() > 1) - { - if (name.get(1).equals(JBossCacheStorage.TREE)) - { - // return Node - if (name.size() > 3) - { - QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); - - // 1) all subtree will be cached - // 2) all subtree will be read from DB (with allprops) for = only Ids. - // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = - String parentId =3D (String)cache.get(name.getParent(), JBo= ssCacheStorage.ITEM_ID); - - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - try - { - NodeData parent =3D (NodeData)conn.getItemData(parentId); - - ItemData item =3D conn.getItemData(parent, nodeName); - - // item Id - attrs.put(JBossCacheStorage.ITEM_ID, item.getIdentifier(= )); - - // if Node (Property cannot due to logic of StorageConne= ction) add props - for (PropertyData prop : conn.getChildPropertiesData(par= ent)) - { - attrs.put(prop.getQPath().getName().getAsString(), pr= op.getIdentifier()); - } - } - finally - { - conn.close(); - } - } - else - { - // root Node (/$TREE/[]:1) - attrs.put(JBossCacheStorage.ITEM_ID, Constants.ROOT_UUID); - } - } - else if (name.get(1).equals(JBossCacheStorage.ITEMS)) - { - // we have all data on thrid level = - if (name.size() =3D=3D 3) - { - // return Node or Property - String itemId =3D name.getLastElementAsString(); - - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - try - { - attrs.put(JBossCacheStorage.ITEM_DATA, conn.getItemData(= itemId)); - } - finally - { - conn.close(); - } - } - } - } - return attrs; - } - - /** - * {@inheritDoc} - */ - public boolean exists(Fqn name) throws Exception - { - // TODO do it with less cost - return get(name) !=3D null; - } - - /** - * {@inheritDoc} - */ - public Set getChildrenNames(Fqn fqn) throws Exception - { - // return child nodes names - - Set childs =3D new LinkedHashSet(); - if (fqn.size() > 2) - { - if (fqn.get(2).equals(JBossCacheStorage.TREE)) - { - // return Node - if (fqn.size() > 3) - { - QPathEntry nodeName =3D QPathEntry.parse(fqn.getLastElement= AsString()); - - // TODO non effective, in this way 1) all subtree will be c= ached - // 2) all subtree will be read from DB (with allprops) for = only Ids. - // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = - String parentId =3D (String)cache.get(fqn.getParent(), JBos= sCacheStorage.ITEM_ID); - - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - try - { - NodeData parent =3D (NodeData)conn.getItemData(parentId); - - NodeData node =3D (NodeData)conn.getItemData(parent, nod= eName); - - // get child nodes by parent Id - for (NodeData prop : conn.getChildNodesData(node)) - { - childs - .add(node.getQPath().getEntries()[node.getQPath().= getEntries().length - 1].getAsString(true)); - } - } - finally - { - conn.close(); - } - } - else - { - // root Node (/$TREE/[]:1) - childs.add(Constants.ROOT_PATH.getEntries()[Constants.ROOT_= PATH.getEntries().length - 1] - .getAsString(true)); - } - } - else if (fqn.get(2).equals(JBossCacheStorage.ITEMS)) - { - // we have all data on thrid level = - if (fqn.size() =3D=3D 3) - { - // return all Nodes and Properties Ids - -// WorkspaceStorageConnection conn =3D dataContainer.openCon= nection(); -// try -// { -// for (String itemId : conn.getAllItemIdentifiers()) -// { -// childs.add(itemId); -// } -// } -// finally -// { -// conn.close(); -// } - } - } - } - else if (fqn.equals(Fqn.ROOT)) - { - childs.add(JBossCacheStorage.TREE); - childs.add(JBossCacheStorage.ITEMS); - } - return childs; - } - - /** - * {@inheritDoc} - */ - public IndividualCacheLoaderConfig getConfig() - { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object put(Fqn name, Object key, Object value) throws Exception - { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public void put(Fqn name, Map attributes) throws Except= ion - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public Object remove(Fqn fqn, Object key) throws Exception - { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public void remove(Fqn fqn) throws Exception - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void removeData(Fqn fqn) throws Exception - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setConfig(IndividualCacheLoaderConfig config) - { - // TODO Auto-generated method stub - - } - -} Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-06 10:06:= 18 UTC (rev 479) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-06 10:17:= 07 UTC (rev 480) @@ -51,6 +51,7 @@ public abstract class JBossCacheStorage { = + @Deprecated public static final String TREE =3D "$TREE".intern(); = public static final String ITEMS =3D "$ITEMS".intern(); @@ -59,14 +60,24 @@ = public static final String ITEM_ID =3D "$id".intern(); = + @Deprecated protected final Fqn treeRoot; = protected final Fqn itemsRoot; = + @Deprecated protected JBossCacheStorage(Fqn treeRoot, Fqn itemsRoot) { + this.itemsRoot =3D itemsRoot; + = this.treeRoot =3D treeRoot; + } + = + protected JBossCacheStorage(Fqn itemsRoot) + { this.itemsRoot =3D itemsRoot; + = + this.treeRoot =3D null; } = @Deprecated @@ -97,13 +108,26 @@ = return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); } - - protected Fqn makeTreeFqn(String parentId, QPathEntry itemName) + = + /** + * Make Child Node Fqn, i.e. /IDxxx/NAMExxx. + * + * @param parentId String = + * @param itemName QPathEntry + * @return Fqn + */ + protected Fqn makeChildNodeFqn(String parentId, QPathEntry item= Name) { - return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(parentId, item= Name.getAsString(true))); + return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromElements(parentId, ite= mName.getAsString(true))); } = - protected Fqn makeIdFqn(String itemId) + /** + * Make Item Fqn, i.e. /IDxxx. + * + * @param itemId String + * @return Fqn + */ + protected Fqn makeItemFqn(String itemId) { return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromString(itemId)); } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 10:06:18 UTC (rev 479) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 10:17:07 UTC (rev 480) @@ -69,14 +69,11 @@ * * @param cache Cache */ - public JBossCacheStorageConnection(Cache cache, N= ode treeRoot, - Node itemsRoot) + public JBossCacheStorageConnection(Cache cache, N= ode itemsRoot) { - super(treeRoot.getFqn(), itemsRoot.getFqn()); - = + super(itemsRoot.getFqn()); + this.cache =3D cache; - //this.itemsRoot =3D itemsRoot; - //this.treeRoot =3D treeRoot; } = /** @@ -86,8 +83,8 @@ IllegalStateException { startBatch(); - cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier(= )); - cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); // tree= Print(treeRoot); + //cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifie= r()); + //cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); // tr= eePrint(treeRoot); } = /** @@ -97,11 +94,11 @@ InvalidItemStateException, IllegalStateException { startBatch(); - Fqn parentFqn =3D makeParentFqn(data.getQPath()); + //Fqn parentFqn =3D makeParentFqn(data.getQPath()); = // add an attr to the parent node as key=3DPropertyName value=3DProp= ertyId - cache.put(parentFqn, data.getQPath().getName().getAsString(), data.g= etIdentifier()); - cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + //cache.put(parentFqn, data.getQPath().getName().getAsString(), data= .getIdentifier()); + //cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); } = /** @@ -111,8 +108,8 @@ InvalidItemStateException, IllegalStateException { startBatch(); - cache.removeNode(makeNodeFqn(data.getQPath())); - cache.removeNode(makeIdFqn(data.getIdentifier())); + //cache.removeNode(makeNodeFqn(data.getQPath())); + //cache.removeNode(makeIdFqn(data.getIdentifier())); } = /** @@ -123,8 +120,8 @@ { startBatch(); // delete attr on parent by key=3DPropertyName - cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getName= ().getAsString()); - cache.removeNode(makeIdFqn(data.getIdentifier())); + //cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getNa= me().getAsString()); + //cache.removeNode(makeIdFqn(data.getIdentifier())); } = /** @@ -133,29 +130,31 @@ public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException { //Set childNames =3D cache.getChildrenNames(makeNodeFqn(pare= nt.getQPath())); - Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); - } - - Set> childNodes =3D parentNode.getChildre= n(); - - List childs =3D new ArrayList(); - for (Node child : childNodes) - { - String childId =3D (String)child.get(ITEM_ID); - - // TODO NodeData or PropertyData? As ItemData check then and cast. - NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_DA= TA); - if (node =3D=3D null) - { - throw new RepositoryException("One of childs is null. Parent "= + parent.getQPath().getAsString()); - } - childs.add(node); - } - - return childs; +// Node parentNode =3D cache.getNode(makeNodeFq= n(parent.getQPath())); +// if (parentNode =3D=3D null) +// { +// throw new IllegalStateException("Get child Nodes error: parent = not found " + parent.getQPath().getAsString()); +// } +// +// Set> childNodes =3D parentNode.getChild= ren(); +// +// List childs =3D new ArrayList(); +// for (Node child : childNodes) +// { +// String childId =3D (String)child.get(ITEM_ID); +// +// // TODO NodeData or PropertyData? As ItemData check then and ca= st. +// NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_= DATA); +// if (node =3D=3D null) +// { +// throw new RepositoryException("One of childs is null. Parent= " + parent.getQPath().getAsString()); +// } +// childs.add(node); +// } +// +// return childs; + = + return null; } = private void treePrint(Node node) @@ -180,30 +179,32 @@ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException { // TODO treeRoot.getChild(f) possible if f not a direct child??? = - Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); - } - - List childs =3D new ArrayList(); - - for (Serializable key : parentNode.getKeys()) - { - if (!key.equals(ITEM_ID)) - { - String propId =3D (String)parentNode.get(key); - // TODO NodeData or PropertyData? As ItemData check then and c= ast. = - PropertyData property =3D (PropertyData)cache.get(makeIdFqn(pr= opId), ITEM_DATA); - if (property =3D=3D null) - { - throw new RepositoryException("One of childs is null. Paren= t " + parent.getQPath().getAsString()); - } - childs.add(property); - } - } - - return childs; +// Node parentNode =3D cache.getNode(makeNodeFq= n(parent.getQPath())); +// if (parentNode =3D=3D null) +// { +// throw new IllegalStateException("Get child Nodes error: parent = not found " + parent.getQPath().getAsString()); +// } +// +// List childs =3D new ArrayList(); +// +// for (Serializable key : parentNode.getKeys()) +// { +// if (!key.equals(ITEM_ID)) +// { +// String propId =3D (String)parentNode.get(key); +// // TODO NodeData or PropertyData? As ItemData check then and= cast. = +// PropertyData property =3D (PropertyData)cache.get(makeIdFqn(= propId), ITEM_DATA); +// if (property =3D=3D null) +// { +// throw new RepositoryException("One of childs is null. Par= ent " + parent.getQPath().getAsString()); +// } +// childs.add(property); +// } +// } +// +// return childs; + = + return null; } = /** @@ -220,34 +221,34 @@ */ public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException, IllegalStateException { - Node parentNode =3D cache.getNode(makeNodeFqn(= parentData.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get Item data error: parent not = found " + parentData.getQPath().getAsString()); - } +// Node parentNode =3D cache.getNode(makeNodeFq= n(parentData.getQPath())); +// if (parentNode =3D=3D null) +// { +// throw new IllegalStateException("Get Item data error: parent no= t found " + parentData.getQPath().getAsString()); +// } +// +// // TODO check performance of Node vs Property get +// +// String propertyId =3D (String)parentNode.get(name.getAsString()); +// if (propertyId !=3D null) +// { +// // it's Property Item +// return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA= ); +// } +// else +// { +// // it's Node Item +// Node node =3D parentNode.getChild(name.ge= tAsString(true)); // TODO String not Fqn? +// if (node !=3D null) +// { +// String nodeId =3D (String)node.get(ITEM_ID); +// if (nodeId !=3D null) +// { +// return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA); +// } +// } +// } = - // TODO check performance of Node vs Property get - - String propertyId =3D (String)parentNode.get(name.getAsString()); - if (propertyId !=3D null) - { - // it's Property Item - return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA); - } - else - { - // it's Node Item - Node node =3D parentNode.getChild(name.getA= sString(true)); // TODO String not Fqn? - if (node !=3D null) - { - String nodeId =3D (String)node.get(ITEM_ID); - if (nodeId !=3D null) - { - return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA); - } - } - } - return null; } = @@ -256,7 +257,7 @@ */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException { - return (ItemData)cache.get(makeIdFqn(identifier), ITEM_DATA); + return (ItemData)cache.get(makeItemFqn(identifier), ITEM_DATA); } = /** @@ -295,7 +296,7 @@ throw new IllegalStateException("Node was deleted (tree)"); } = - prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + prev =3D cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, dat= a); if (prev =3D=3D null) { throw new IllegalStateException("Node was deleted (items)"); @@ -311,18 +312,18 @@ startBatch(); = // TODO it's put anyway.. but with check? - Fqn parentFqn =3D makeParentFqn(data.getQPath()); - Object prev =3D cache.put(parentFqn, data.getQPath().getName().getAs= String(), data.getIdentifier()); - if (prev =3D=3D null) - { - throw new IllegalStateException("Property was deleted (tree)"); - } - - prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); - if (prev =3D=3D null) - { - throw new IllegalStateException("Property was deleted (items)"); - } +// Fqn parentFqn =3D makeParentFqn(data.getQPath()); +// Object prev =3D cache.put(parentFqn, data.getQPath().getName().get= AsString(), data.getIdentifier()); +// if (prev =3D=3D null) +// { +// throw new IllegalStateException("Property was deleted (tree)"); +// } +// +// prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, dat= a); +// if (prev =3D=3D null) +// { +// throw new IllegalStateException("Property was deleted (items)"); +// } } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-06 10:06:18 UTC (rev 479) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-06 10:17:07 UTC (rev 480) @@ -93,7 +93,7 @@ { startBatch(); cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier(= )); - cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); // tree= Print(treeRoot); + cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, data); // tr= eePrint(treeRoot); } = /** @@ -107,7 +107,7 @@ = // add an attr to the parent node as key=3DPropertyName value=3DProp= ertyId cache.put(parentFqn, data.getQPath().getName().getAsString(), data.g= etIdentifier()); - cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, data); } = /** @@ -118,7 +118,7 @@ { startBatch(); cache.removeNode(makeNodeFqn(data.getQPath())); - cache.removeNode(makeIdFqn(data.getIdentifier())); + cache.removeNode(makeItemFqn(data.getIdentifier())); } = /** @@ -130,7 +130,7 @@ startBatch(); // delete attr on parent by key=3DPropertyName cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getName= ().getAsString()); - cache.removeNode(makeIdFqn(data.getIdentifier())); + cache.removeNode(makeItemFqn(data.getIdentifier())); } = /** @@ -153,7 +153,7 @@ String childId =3D (String)child.get(ITEM_ID); = // TODO NodeData or PropertyData? As ItemData check then and cast. - NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_DA= TA); + NodeData node =3D (NodeData)cache.get(makeItemFqn(childId), ITEM_= DATA); if (node =3D=3D null) { throw new RepositoryException("One of childs is null. Parent "= + parent.getQPath().getAsString()); @@ -200,7 +200,7 @@ { String propId =3D (String)parentNode.get(key); // TODO NodeData or PropertyData? As ItemData check then and c= ast. = - PropertyData property =3D (PropertyData)cache.get(makeIdFqn(pr= opId), ITEM_DATA); + PropertyData property =3D (PropertyData)cache.get(makeItemFqn(= propId), ITEM_DATA); if (property =3D=3D null) { throw new RepositoryException("One of childs is null. Paren= t " + parent.getQPath().getAsString()); @@ -238,7 +238,7 @@ if (propertyId !=3D null) { // it's Property Item - return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA); + return (PropertyData)cache.get(makeItemFqn(propertyId), ITEM_DATA= ); } else { @@ -249,7 +249,7 @@ String nodeId =3D (String)node.get(ITEM_ID); if (nodeId !=3D null) { - return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA); + return (NodeData)cache.get(makeItemFqn(nodeId), ITEM_DATA); } } } @@ -262,7 +262,7 @@ */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException { - return (ItemData)cache.get(makeIdFqn(identifier), ITEM_DATA); + return (ItemData)cache.get(makeItemFqn(identifier), ITEM_DATA); } = /** @@ -301,7 +301,7 @@ throw new IllegalStateException("Node was deleted (tree)"); } = - prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + prev =3D cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, dat= a); if (prev =3D=3D null) { throw new IllegalStateException("Node was deleted (items)"); @@ -324,7 +324,7 @@ throw new IllegalStateException("Property was deleted (tree)"); } = - prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + prev =3D cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, dat= a); if (prev =3D=3D null) { throw new IllegalStateException("Property was deleted (items)"); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-06 10:06:18 UTC (rev 479) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-06 10:17:07 UTC (rev 480) @@ -67,8 +67,6 @@ = private final Cache cache; = - private final Node tree; - private final Node items; = /** @@ -113,7 +111,6 @@ //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); = // prepare cache structures - this.tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.TR= EE)); this.items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.I= TEMS)); } = @@ -146,7 +143,7 @@ */ public WorkspaceStorageConnection openConnection() throws RepositoryExc= eption { - return new JBossCacheStorageConnection(cache, tree, items); + return new JBossCacheStorageConnection(cache, items); } = /** @@ -154,7 +151,7 @@ */ public WorkspaceStorageConnection openConnection(boolean readOnly) thro= ws RepositoryException { - return new JBossCacheStorageConnection(cache, tree, items); + return new JBossCacheStorageConnection(cache, items); } = /** Copied: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfor= m/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java (from rev 479, = jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/servic= es/jcr/impl/storage/jbosscache/ExoJCRCacheLoader.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-06 10:17:07= UTC (rev 480) @@ -0,0 +1,333 @@ +/* + * 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. + */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.datamodel.IllegalNameException; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.jboss.cache.Fqn; +import org.jboss.cache.Modification; +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; +import org.jboss.cache.factories.annotations.Inject; +import org.jboss.cache.loader.AbstractCacheLoader; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 31.10.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class JDBCCacheLoader extends AbstractCacheLoader +{ + + private WorkspaceDataContainer dataContainer; + + /** + * Init the loader DataContainer with given WorkspaceDataContainer inst= ance. + * + * @param dataContainer WorkspaceDataContainer + */ + @Inject + public void initDataContainer(WorkspaceDataContainer dataContainer) thr= ows RepositoryConfigurationException + { + if (this.dataContainer !=3D null) + { + throw new RepositoryConfigurationException("Cannot set WorkspaceD= ataContainer twice"); + } + + this.dataContainer =3D dataContainer; + } + = + = + /** + * {@inheritDoc} + */ + public void put(List modifications) throws Exception + { + = + + } + + protected QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberF= ormatException, IllegalNameException + { + List elements =3D nodeFqn.peekElements(); + QPathEntry[] path =3D new QPathEntry[elements.size()]; + + for (int i =3D 0; i < elements.size(); i++) + { + path[i] =3D QPathEntry.parse(elements.get(i)); + } + + return path; + } + + /** + * {@inheritDoc} + */ + public Map get(Fqn name) throws Exception + { + + Map attrs =3D new LinkedHashMap(); + if (name.size() > 1) + { + if (name.get(1).equals(JBossCacheStorage.TREE)) + { + // return Node + if (name.size() > 3) + { + QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); + + // 1) all subtree will be cached + // 2) all subtree will be read from DB (with allprops) for = only Ids. + // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = + String parentId =3D (String)cache.get(name.getParent(), JBo= ssCacheStorage.ITEM_ID); + + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + try + { + NodeData parent =3D (NodeData)conn.getItemData(parentId); + + ItemData item =3D conn.getItemData(parent, nodeName); + + // item Id + attrs.put(JBossCacheStorage.ITEM_ID, item.getIdentifier(= )); + + // if Node (Property cannot due to logic of StorageConne= ction) add props + for (PropertyData prop : conn.getChildPropertiesData(par= ent)) + { + attrs.put(prop.getQPath().getName().getAsString(), pr= op.getIdentifier()); + } + } + finally + { + conn.close(); + } + } + else + { + // root Node (/$TREE/[]:1) + attrs.put(JBossCacheStorage.ITEM_ID, Constants.ROOT_UUID); + } + } + else if (name.get(1).equals(JBossCacheStorage.ITEMS)) + { + // we have all data on thrid level = + if (name.size() =3D=3D 3) + { + // return Node or Property + String itemId =3D name.getLastElementAsString(); + + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + try + { + attrs.put(JBossCacheStorage.ITEM_DATA, conn.getItemData(= itemId)); + } + finally + { + conn.close(); + } + } + } + } + return attrs; + } + + /** + * {@inheritDoc} + */ + public boolean exists(Fqn name) throws Exception + { + // TODO do it with less cost + return get(name) !=3D null; + } + + /** + * {@inheritDoc} + */ + public Set getChildrenNames(Fqn fqn) throws Exception + { + // return child nodes names + + Set childs =3D new LinkedHashSet(); + if (fqn.size() > 2) + { + if (fqn.get(2).equals(JBossCacheStorage.TREE)) + { + // return Node + if (fqn.size() > 3) + { + QPathEntry nodeName =3D QPathEntry.parse(fqn.getLastElement= AsString()); + + // TODO non effective, in this way 1) all subtree will be c= ached + // 2) all subtree will be read from DB (with allprops) for = only Ids. + // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = + String parentId =3D (String)cache.get(fqn.getParent(), JBos= sCacheStorage.ITEM_ID); + + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + try + { + NodeData parent =3D (NodeData)conn.getItemData(parentId); + + NodeData node =3D (NodeData)conn.getItemData(parent, nod= eName); + + // get child nodes by parent Id + for (NodeData prop : conn.getChildNodesData(node)) + { + childs + .add(node.getQPath().getEntries()[node.getQPath().= getEntries().length - 1].getAsString(true)); + } + } + finally + { + conn.close(); + } + } + else + { + // root Node (/$TREE/[]:1) + childs.add(Constants.ROOT_PATH.getEntries()[Constants.ROOT_= PATH.getEntries().length - 1] + .getAsString(true)); + } + } + else if (fqn.get(2).equals(JBossCacheStorage.ITEMS)) + { + // we have all data on thrid level = + if (fqn.size() =3D=3D 3) + { + // return all Nodes and Properties Ids + +// WorkspaceStorageConnection conn =3D dataContainer.openCon= nection(); +// try +// { +// for (String itemId : conn.getAllItemIdentifiers()) +// { +// childs.add(itemId); +// } +// } +// finally +// { +// conn.close(); +// } + } + } + } + else if (fqn.equals(Fqn.ROOT)) + { + childs.add(JBossCacheStorage.TREE); + childs.add(JBossCacheStorage.ITEMS); + } + return childs; + } + + /** + * {@inheritDoc} + */ + public IndividualCacheLoaderConfig getConfig() + { + // TODO Auto-generated method stub + return null; + } + + /** + * {@inheritDoc} + */ + public Object put(Fqn name, Object key, Object value) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + /** + * {@inheritDoc} + */ + public void put(Fqn name, Map attributes) throws Except= ion + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public Object remove(Fqn fqn, Object key) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + /** + * {@inheritDoc} + */ + public void remove(Fqn fqn) throws Exception + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void removeData(Fqn fqn) throws Exception + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public void setConfig(IndividualCacheLoaderConfig config) + { + // TODO Auto-generated method stub + + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id --===============6797996022200113941==-- From do-not-reply at jboss.org Fri Nov 6 05:17:56 2009 Content-Type: multipart/mixed; boundary="===============4746013279789437073==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r481 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone. Date: Fri, 06 Nov 2009 05:17:56 -0500 Message-ID: <200911061017.nA6AHulr030035@svn01.web.mwc.hst.phx2.redhat.com> --===============4746013279789437073== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-06 05:17:56 -0500 (Fri, 06 Nov 2009) New Revision: 481 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader.xml Log: EXOJCR-200: reorg for new storage arch (config) Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-exoloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-06 10:17:07 UTC (rev 480) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-06 10:17:56 UTC (rev 481) @@ -60,7 +60,7 @@ = - --===============4746013279789437073==-- From do-not-reply at jboss.org Fri Nov 6 05:19:12 2009 Content-Type: multipart/mixed; boundary="===============7372904875493672402==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r482 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 06 Nov 2009 05:19:12 -0500 Message-ID: <200911061019.nA6AJC60030176@svn01.web.mwc.hst.phx2.redhat.com> --===============7372904875493672402== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-06 05:19:12 -0500 (Fri, 06 Nov 2009) New Revision: 482 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java Log: EXOJCR-205: add new class Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-06 10:19:12= UTC (rev 482) @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.jboss.cache.CacheException; +import org.jboss.cache.Modification; + +import java.util.List; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Anatoliy= Bazko = + * @version $Id$ + */ +public class LockCacheLoader extends AbstractWriteOnlyCacheLoader +{ + + /** + * {@inheritDoc} + */ + @Override + public void put(List modifications) throws Exception + { + for (Modification m : modifications) + { + switch (m.getType()) + { + case PUT_DATA : + // put(m.getFqn(), m.getData()); + break; + case PUT_DATA_ERASE : + // removeData(m.getFqn()); + // put(m.getFqn(), m.getData()); + break; + case PUT_KEY_VALUE : + // put(m.getFqn(), m.getKey(), m.getValue()); + break; + case REMOVE_DATA : + // removeData(m.getFqn()); + break; + case REMOVE_KEY_VALUE : + // remove(m.getFqn(), m.getKey()); + break; + case REMOVE_NODE : + // remove(m.getFqn()); + break; + case MOVE : + // involve moving all children too + // move(m.getFqn(), m.getFqn2()); + break; + default : + throw new CacheException("Unknown modification " + m.getTyp= e()); + } + } + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/LockCacheLoader.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============7372904875493672402==-- From do-not-reply at jboss.org Fri Nov 6 05:21:09 2009 Content-Type: multipart/mixed; boundary="===============3193207713592217141==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r483 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query: cacheloader and 1 other directory. Date: Fri, 06 Nov 2009 05:21:09 -0500 Message-ID: <200911061021.nA6AL9fb030688@svn01.web.mwc.hst.phx2.redhat.com> --===============3193207713592217141== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-06 05:21:09 -0500 (Fri, 06 Nov 2009) New Revision: 483 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java Log: EXOJCR-202: empty IndexerCacheLoader class added Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-06 1= 0:21:09 UTC (rev 483) @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.core.query.cacheloader; + +import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; +import org.jboss.cache.CacheException; +import org.jboss.cache.Modification; + +import java.util.List; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author Karpenko Sergiy = + * @version $Id: CacheIndexer.java 111 2008-11-11 11:11:11Z serg $ + */ +public class IndexerCacheLoader extends AbstractWriteOnlyCacheLoader +{ + + @Override + public void put(List modifications) throws Exception + { + for (Modification m : modifications) + { + switch (m.getType()) + { + case PUT_DATA : + put(m.getFqn(), m.getData()); + break; + case PUT_DATA_ERASE : + removeData(m.getFqn()); + put(m.getFqn(), m.getData()); + break; + case PUT_KEY_VALUE : + put(m.getFqn(), m.getKey(), m.getValue()); + break; + case REMOVE_DATA : + removeData(m.getFqn()); + break; + case REMOVE_KEY_VALUE : + remove(m.getFqn(), m.getKey()); + break; + case REMOVE_NODE : + remove(m.getFqn()); + break; + case MOVE : + // involve moving all children too + move(m.getFqn(), m.getFqn2()); + break; + default : + throw new CacheException("Unknown modification " + m.getTyp= e()); + } + } + } + +} --===============3193207713592217141==-- From do-not-reply at jboss.org Fri Nov 6 09:47:59 2009 Content-Type: multipart/mixed; boundary="===============3018055297623125588==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r484 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core and 1 other directory. Date: Fri, 06 Nov 2009 09:47:59 -0500 Message-ID: <200911061447.nA6ElxBm018535@svn01.web.mwc.hst.phx2.redhat.com> --===============3018055297623125588== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2009-11-06 09:47:58 -0500 (Fri, 06 Nov 2009) New Revision: 484 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/core/ExtendedNode.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/NodeImpl.java Log: EXOJCR-227 : add method = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/core/ExtendedNode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/ExtendedNode.java 2009-11-06 10:21:09 UTC (rev 483) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/ExtendedNode.java 2009-11-06 14:47:58 UTC (rev 484) @@ -55,6 +55,14 @@ * @return Access Control List */ AccessControlList getACL() throws RepositoryException; + = + /** + * Get unique node identifier. + * = + * @return node identifier + * @throws RepositoryException if any repository errors occurs + */ + String getIdentifier() throws RepositoryException; = /** * Clears Access Control List. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2009-11-06 10:21:09 UTC (rev 483) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2009-11-06 14:47:58 UTC (rev 484) @@ -956,6 +956,15 @@ + itemPath.getAsString(false)); return (NodeImpl)node; } + = + /** + * {@inheritDoc} + */ + public String getIdentifier() throws RepositoryException + { + checkValid(); + return this.getInternalIdentifier(); + } = /** * {@inheritDoc} --===============3018055297623125588==-- From do-not-reply at jboss.org Fri Nov 6 09:49:55 2009 Content-Type: multipart/mixed; boundary="===============6608711999328796230==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r485 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core and 1 other directory. Date: Fri, 06 Nov 2009 09:49:55 -0500 Message-ID: <200911061449.nA6EntUt018585@svn01.web.mwc.hst.phx2.redhat.com> --===============6608711999328796230== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2009-11-06 09:49:54 -0500 (Fri, 06 Nov 2009) New Revision: 485 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/core/ExtendedSession.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionImpl.java Log: EXOJCR-228 : add method Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/core/ExtendedSession.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/ExtendedSession.java 2009-11-06 14:47:58 UTC (rev 484) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/ExtendedSession.java 2009-11-06 14:49:54 UTC (rev 485) @@ -26,6 +26,8 @@ = import javax.jcr.InvalidSerializedDataException; import javax.jcr.ItemExistsException; +import javax.jcr.ItemNotFoundException; +import javax.jcr.Node; import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; import javax.jcr.Session; @@ -52,6 +54,16 @@ LocationFactory getLocationFactory(); = /** + * Get node by unique identifier. + * = + * @param identifier node identifier + * @return node with specified identifier + * @throws ItemNotFoundException id node with supplied identifier not f= ound + * @throws RepositoryException if any repository errors occurs + */ + Node getNodeByIdentifier(String identifier) throws ItemNotFoundExceptio= n, RepositoryException; + = + /** * Deserialize an XML document and adds the resulting item subtree as a= child of the node at * parentAbsPath. * = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionImpl.java 2009-11-06 14:47:58 UTC (rev 484) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionImpl.java 2009-11-06 14:49:54 UTC (rev 485) @@ -622,7 +622,19 @@ { return getNamespaceURI(prefix); } + = + /** + * {@inheritDoc} + */ + public Node getNodeByIdentifier(String identifier) throws ItemNotFoundE= xception, RepositoryException + { + Item item =3D dataManager.getItemByIdentifier(identifier, true); + if (item !=3D null && item.isNode()) + return (Node)item; = + throw new ItemNotFoundException("Node not found " + identifier + " a= t " + workspaceName); + } + /** * {@inheritDoc} */ --===============6608711999328796230==-- From do-not-reply at jboss.org Fri Nov 6 09:57:07 2009 Content-Type: multipart/mixed; boundary="===============1597451524290824821==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r486 - in jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav: command and 1 other directories. Date: Fri, 06 Nov 2009 09:57:07 -0500 Message-ID: <200911061457.nA6Ev7fI019402@svn01.web.mwc.hst.phx2.redhat.com> --===============1597451524290824821== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-06 09:57:07 -0500 (Fri, 06 Nov 2009) New Revision: 486 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/WebDavServiceImpl.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/CopyCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/DeleteCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/GetCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/HeadCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/LockCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/MkColCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/MoveCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/OrderPatchCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/PropFindCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/PropPatchCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/PutCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/SearchCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/UnLockCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/deltav/CheckInCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/deltav/CheckOutCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/deltav/ReportCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/deltav/UnCheckOutCommand.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/deltav/VersionControlCommand.java Log: EXOJCR-220 Status messages added Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/WebDavServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/WebDavServiceImpl.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/WebDavServiceImpl.java 2009-11-06 14:57:07 UTC (rev 486) @@ -310,7 +310,7 @@ catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -339,7 +339,7 @@ catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -370,7 +370,7 @@ = if (!destinationHeader.startsWith(serverURI)) { - return Response.status(HTTPStatus.BAD_GATEWAY).build(); + return Response.status(HTTPStatus.BAD_GATEWAY).entity("Bad Gat= eway").build(); } = String srcWorkspace =3D workspaceName(repoPath); @@ -397,8 +397,7 @@ Response prpfind =3D new PropFindCommand().propfind(session, d= estNodePath, body, depth.getIntValue(), uri); if (prpfind.getStatus() !=3D HTTPStatus.NOT_FOUND) { - - return Response.status(HTTPStatus.PRECON_FAILED).build(); + return Response.status(HTTPStatus.PRECON_FAILED).entity("No= t Found").build(); } } = @@ -429,18 +428,18 @@ } else { - return Response.status(HTTPStatus.BAD_REQUEST).build(); + return Response.status(HTTPStatus.BAD_REQUEST).entity("Bad Req= uest").build(); } = } catch (PreconditionException exc) { - return Response.status(HTTPStatus.BAD_REQUEST).build(); + return Response.status(HTTPStatus.BAD_REQUEST).entity(exc.getMess= age()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -472,12 +471,12 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -525,7 +524,7 @@ int dash =3D token.indexOf("-"); if (dash =3D=3D -1) { - return Response.status(HTTPStatus.REQUESTED_RANGE_NOT= _SATISFIABLE).build(); + return Response.status(HTTPStatus.REQUESTED_RANGE_NOT= _SATISFIABLE).entity("Requested Range Not Satisfiable").build(); } else if (dash =3D=3D 0) { @@ -553,12 +552,12 @@ catch (PathNotFoundException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -589,12 +588,12 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -624,19 +623,19 @@ catch (PreconditionException exc) { log.error("PreconditionException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.PRECON_FAILED).build(); + return Response.status(HTTPStatus.PRECON_FAILED).entity(exc.getMe= ssage()).build(); = } catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -667,12 +666,12 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -709,12 +708,12 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -745,7 +744,7 @@ = if (!destinationHeader.startsWith(serverURI)) { - return Response.status(HTTPStatus.BAD_GATEWAY).build(); + return Response.status(HTTPStatus.BAD_GATEWAY).entity("Bad Gat= eway").build(); } = String destPath =3D destinationHeader.substring(serverURI.length(= ) + 1); @@ -774,7 +773,7 @@ Response prpfind =3D new PropFindCommand().propfind(session, d= estNodePath, body, depth.getIntValue(), uri); if (prpfind.getStatus() !=3D HTTPStatus.NOT_FOUND) { - return Response.status(HTTPStatus.PRECON_FAILED).build(); + return Response.status(HTTPStatus.PRECON_FAILED).entity("Pr= econditions Failed").build(); } } = @@ -792,14 +791,14 @@ } else { - return Response.status(HTTPStatus.BAD_REQUEST).build(); + return Response.status(HTTPStatus.BAD_REQUEST).entity("Bad Req= uest").build(); } = } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } @@ -855,7 +854,7 @@ catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -885,16 +884,16 @@ } catch (NoSuchWorkspaceException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (PreconditionException exc) { - return Response.status(HTTPStatus.BAD_REQUEST).build(); + return Response.status(HTTPStatus.BAD_REQUEST).entity(exc.getMess= age()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -926,12 +925,12 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspace. " + exc.getMessage()); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -994,18 +993,18 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (NoSuchNodeTypeException exc) { log.error("NoSuchNodeTypeException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.BAD_REQUEST).build(); + return Response.status(HTTPStatus.BAD_REQUEST).entity(exc.getMess= age()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -1037,12 +1036,12 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -1074,12 +1073,12 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = @@ -1108,13 +1107,13 @@ catch (NoSuchWorkspaceException exc) { log.error("NoSuchWorkspaceException " + exc.getMessage(), exc); - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/CopyCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/CopyCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/CopyCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -62,24 +62,24 @@ } catch (ItemExistsException e) { - return Response.status(HTTPStatus.METHOD_NOT_ALLOWED).build(); + return Response.status(HTTPStatus.METHOD_NOT_ALLOWED).entity(e.ge= tMessage()).build(); } catch (PathNotFoundException e) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(e.getMessage()= ).build(); } catch (AccessDeniedException e) { - return Response.status(HTTPStatus.FORBIDDEN).build(); + return Response.status(HTTPStatus.FORBIDDEN).entity(e.getMessage(= )).build(); } catch (LockException e) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(e.getMessage()).= build(); } catch (RepositoryException e) { log.error(e.getMessage(), e); - return Response.serverError().build(); + return Response.serverError().entity(e.getMessage()).build(); } } = @@ -101,23 +101,23 @@ } catch (ItemExistsException e) { - return Response.status(HTTPStatus.METHOD_NOT_ALLOWED).build(); + return Response.status(HTTPStatus.METHOD_NOT_ALLOWED).entity(e.ge= tMessage()).build(); } catch (PathNotFoundException e) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(e.getMessage()= ).build(); } catch (AccessDeniedException e) { - return Response.status(HTTPStatus.FORBIDDEN).build(); + return Response.status(HTTPStatus.FORBIDDEN).entity(e.getMessage(= )).build(); } catch (LockException e) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(e.getMessage()).= build(); } catch (RepositoryException e) { - return Response.serverError().build(); + return Response.serverError().entity(e.getMessage()).build(); } } } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/DeleteCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/DeleteCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/DeleteCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -76,12 +76,12 @@ } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (RepositoryException exc) { - return Response.status(HTTPStatus.FORBIDDEN).build(); + return Response.status(HTTPStatus.FORBIDDEN).entity(exc.getMessag= e()).build(); } } = Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/GetCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/GetCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/GetCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -129,7 +129,7 @@ HierarchicalProperty lastModifiedProperty =3D fileResource.get= Property(FileResource.GETLASTMODIFIED); = if((ifModifiedSince !=3D null) && (ifModifiedSince.equals(last= ModifiedProperty.getValue()))){ - return Response.notModified().build(); + return Response.notModified().entity("Not Modified").build(= ); } = // content length is not present @@ -202,16 +202,16 @@ } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (RepositoryException exc) { - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/HeadCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/HeadCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/HeadCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -84,12 +84,12 @@ } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/LockCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/LockCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/LockCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -125,16 +125,16 @@ } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); } catch (AccessDeniedException exc) { - return Response.status(HTTPStatus.FORBIDDEN).build(); + return Response.status(HTTPStatus.FORBIDDEN).entity(exc.getMessag= e()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/MkColCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/MkColCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/MkColCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -92,27 +92,27 @@ } catch (ItemExistsException exc) { - return Response.status(HTTPStatus.METHOD_NOT_ALLOWED).build(); + return Response.status(HTTPStatus.METHOD_NOT_ALLOWED).entity(exc.= getMessage()).build(); = } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage= ()).build(); = } catch (AccessDeniedException exc) { - return Response.status(HTTPStatus.FORBIDDEN).build(); + return Response.status(HTTPStatus.FORBIDDEN).entity(exc.getMessag= e()).build(); = } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } catch (RepositoryException exc) { - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = return Response.status(HTTPStatus.CREATED).build(); Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/MoveCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/MoveCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/MoveCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -88,18 +88,18 @@ } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage= ()).build(); = } catch (RepositoryException exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } @@ -127,18 +127,18 @@ } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage= ()).build(); = } catch (RepositoryException exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/OrderPatchCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/OrderPatchCommand.java 2009-11-06 14:49:54 UTC (rev 4= 85) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/OrderPatchCommand.java 2009-11-06 14:57:07 UTC (rev 4= 86) @@ -92,16 +92,16 @@ } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/PropFindCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PropFindCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PropFindCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -82,12 +82,12 @@ } catch (PathNotFoundException e) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(e.getMessage(= )).build(); } catch (RepositoryException exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = WebDavNamespaceContext nsContext; @@ -154,7 +154,7 @@ } else { - return Response.status(HTTPStatus.BAD_REQUEST).build(); + return Response.status(HTTPStatus.BAD_REQUEST).entity("Bad Reques= t").build(); } = return Response.status(HTTPStatus.MULTISTATUS).entity(response).head= er(ExtHttpHeaders.CONTENT_TYPE, Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/PropPatchCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PropPatchCommand.java 2009-11-06 14:49:54 UTC (rev 48= 5) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PropPatchCommand.java 2009-11-06 14:57:07 UTC (rev 48= 6) @@ -111,16 +111,16 @@ } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/PutCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PutCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PutCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -139,17 +139,17 @@ } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } - catch (AccessDeniedException e) + catch (AccessDeniedException exc) { - return Response.status(HTTPStatus.FORBIDDEN).build(); + return Response.status(HTTPStatus.FORBIDDEN).entity(exc.getMessag= e()).build(); = } catch (RepositoryException exc) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage= ()).build(); } = return Response.status(HTTPStatus.CREATED).build(); Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/SearchCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/SearchCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/SearchCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -74,18 +74,18 @@ } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (UnsupportedQueryException exc) { - return Response.status(HTTPStatus.BAD_REQUEST).build(); + return Response.status(HTTPStatus.BAD_REQUEST).entity(exc.getMess= age()).build(); = } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/UnLockCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/UnLockCommand.java 2009-11-06 14:49:54 UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/UnLockCommand.java 2009-11-06 14:57:07 UTC (rev 486) @@ -94,18 +94,18 @@ return Response.status(HTTPStatus.NO_CONTENT).build(); } = - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMes= sage()).build(); } = } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/deltav/CheckInCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/CheckInCommand.java 2009-11-06 14:49:54 UTC (r= ev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/CheckInCommand.java 2009-11-06 14:57:07 UTC (r= ev 486) @@ -63,25 +63,25 @@ return Response.ok().header(HttpHeaders.CACHE_CONTROL, "no-cache"= ).build(); = } - catch (UnsupportedRepositoryOperationException e) + catch (UnsupportedRepositoryOperationException exc) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage= ()).build(); = } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (RepositoryException exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/deltav/CheckOutCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/CheckOutCommand.java 2009-11-06 14:49:54 UTC (= rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/CheckOutCommand.java 2009-11-06 14:57:07 UTC (= rev 486) @@ -62,25 +62,25 @@ node.checkout(); return Response.ok().header(HttpHeaders.CACHE_CONTROL, "no-cache"= ).build(); } - catch (UnsupportedRepositoryOperationException e) + catch (UnsupportedRepositoryOperationException exc) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage= ()).build(); = } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } catch (RepositoryException exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/deltav/ReportCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/ReportCommand.java 2009-11-06 14:49:54 UTC (re= v 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/ReportCommand.java 2009-11-06 14:57:07 UTC (re= v 486) @@ -100,17 +100,17 @@ } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); } catch (RepositoryException exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/deltav/UnCheckOutCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/UnCheckOutCommand.java 2009-11-06 14:49:54 UTC= (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/UnCheckOutCommand.java 2009-11-06 14:57:07 UTC= (rev 486) @@ -68,25 +68,25 @@ return Response.ok().header(HttpHeaders.CACHE_CONTROL, "no-cache"= ).build(); = } - catch (UnsupportedRepositoryOperationException e) + catch (UnsupportedRepositoryOperationException exc) { - return Response.status(HTTPStatus.CONFLICT).build(); + return Response.status(HTTPStatus.CONFLICT).entity(exc.getMessage= ()).build(); = } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (RepositoryException exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/deltav/VersionControlCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/VersionControlCommand.java 2009-11-06 14:49:54= UTC (rev 485) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/VersionControlCommand.java 2009-11-06 14:57:07= UTC (rev 486) @@ -66,12 +66,12 @@ } catch (LockException exc) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity(exc.getMessage()= ).build(); = } catch (PathNotFoundException exc) { - return Response.status(HTTPStatus.NOT_FOUND).build(); + return Response.status(HTTPStatus.NOT_FOUND).entity(exc.getMessag= e()).build(); = } catch (Exception exc) --===============1597451524290824821==-- From do-not-reply at jboss.org Fri Nov 6 10:01:46 2009 Content-Type: multipart/mixed; boundary="===============7871142105205060523==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r487 - in jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav: command/deltav and 1 other directory. Date: Fri, 06 Nov 2009 10:01:45 -0500 Message-ID: <200911061501.nA6F1jxI019982@svn01.web.mwc.hst.phx2.redhat.com> --===============7871142105205060523== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-06 10:01:45 -0500 (Fri, 06 Nov 2009) New Revision: 487 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/WebDavServiceImpl.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/deltav/VersionControlCommand.java Log: EXOJCR-220 Status messages added Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/WebDavServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/WebDavServiceImpl.java 2009-11-06 14:57:07 UTC (rev 486) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/WebDavServiceImpl.java 2009-11-06 15:01:45 UTC (rev 487) @@ -1141,7 +1141,7 @@ catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } return new VersionControlCommand().versionControl(session, path(repo= Path)); } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/deltav/VersionControlCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/VersionControlCommand.java 2009-11-06 14:57:07= UTC (rev 486) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/deltav/VersionControlCommand.java 2009-11-06 15:01:45= UTC (rev 487) @@ -77,7 +77,7 @@ catch (Exception exc) { log.error(exc.getMessage(), exc); - return Response.serverError().build(); + return Response.serverError().entity(exc.getMessage()).build(); } } = --===============7871142105205060523==-- From do-not-reply at jboss.org Fri Nov 6 10:51:13 2009 Content-Type: multipart/mixed; boundary="===============1477513282527980657==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r488 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Fri, 06 Nov 2009 10:51:12 -0500 Message-ID: <200911061551.nA6FpCTl027382@svn01.web.mwc.hst.phx2.redhat.com> --===============1477513282527980657== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-06 10:51:12 -0500 (Fri, 06 Nov 2009) New Revision: 488 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java Log: EXOJCR-200: new impl of ADD, REMOVE, UPDATE and GETs Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-06 15:01:= 45 UTC (rev 487) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-06 15:51:= 12 UTC (rev 488) @@ -39,7 +39,10 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.jboss.cache.Fqn; +import org.jboss.cache.Node; = +import java.io.Serializable; + /** * Created by The eXo Platform SAS. * = @@ -51,85 +54,74 @@ public abstract class JBossCacheStorage { = - @Deprecated - public static final String TREE =3D "$TREE".intern(); + public static final String NODES =3D "$NODES".intern(); + = + public static final String PROPS =3D "$PROPS".intern(); = - public static final String ITEMS =3D "$ITEMS".intern(); - public static final String ITEM_DATA =3D "$data".intern(); = public static final String ITEM_ID =3D "$id".intern(); = - @Deprecated - protected final Fqn treeRoot; + protected final Node nodesRoot; + = + protected final Node propsRoot; = - protected final Fqn itemsRoot; - - @Deprecated - protected JBossCacheStorage(Fqn treeRoot, Fqn itemsRoot) + protected JBossCacheStorage(Node nodesRoot, Node<= Serializable, Object> propsRoot) { - this.itemsRoot =3D itemsRoot; + this.nodesRoot =3D nodesRoot; = - this.treeRoot =3D treeRoot; + this.propsRoot =3D propsRoot; } = - protected JBossCacheStorage(Fqn itemsRoot) + /** + * Make Child Node relative Fqn, i.e. ./NIDxxx/NAMExxx. + * + * @param parentId String = + * @param nodeName QPathEntry + * @return Fqn + */ + protected Fqn makeChildNodeFqn(String parentId, QPathEntry node= Name) { - this.itemsRoot =3D itemsRoot; - = - this.treeRoot =3D null; + //return Fqn.fromRelativeFqn(nodesRoot, Fqn.fromElements(parentId, i= temName.getAsString(true))); + //return Fqn.fromRelativeFqn(nodesRoot.getFqn(), Fqn.fromElements(pa= rentId, nodeName.getAsString(true))); + return Fqn.fromElements(parentId, nodeName.getAsString(true)); } - - @Deprecated - protected Fqn makeNodeFqn(QPath nodePath) + = + /** + * Make Child Node relative Fqn. i.e. ./NAMExxx. + * + * @param nodeName QPathEntry = + * @return Fqn + */ + protected Fqn makeChildNodeFqn(QPathEntry nodeName) { - QPathEntry[] path =3D nodePath.getEntries(); - String[] fqns =3D new String[path.length]; - - for (int i =3D 0; i < path.length; i++) - { - fqns[i] =3D path[i].getAsString(true); - } - - return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); + return Fqn.fromElements(nodeName.getAsString(true)); } = - @Deprecated - protected Fqn makeParentFqn(QPath propertyPath) - { - QPathEntry[] path =3D propertyPath.getEntries(); - int pathLen =3D path.length - 1; - String[] fqns =3D new String[pathLen]; = - for (int i =3D 0; i < pathLen; i++) - { - fqns[i] =3D path[i].getAsString(true); - } = - return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); - } - = /** - * Make Child Node Fqn, i.e. /IDxxx/NAMExxx. + * Make Node relative Fqn, i.e. ./NIDxxx. * - * @param parentId String = - * @param itemName QPathEntry + * @param nodeId String * @return Fqn */ - protected Fqn makeChildNodeFqn(String parentId, QPathEntry item= Name) + protected Fqn makeNodeFqn(String nodeId) { - return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromElements(parentId, ite= mName.getAsString(true))); + //return Fqn.fromRelativeFqn(nodesRoot, Fqn.fromElements(nodeId)); + return Fqn.fromElements(nodeId); } = /** - * Make Item Fqn, i.e. /IDxxx. + * Make Property relative Fqn, i.e. ./PIDxxx. * - * @param itemId String + * @param propId String * @return Fqn */ - protected Fqn makeItemFqn(String itemId) + protected Fqn makePropFqn(String propId) { - return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromString(itemId)); + //return Fqn.fromRelativeFqn(propsRoot, Fqn.fromElements(propId)); + return Fqn.fromElements(propId); } - + = } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 15:01:45 UTC (rev 487) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 15:51:12 UTC (rev 488) @@ -18,17 +18,10 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -37,6 +30,13 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Node; = +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + /** * Created by The eXo Platform SAS. * = @@ -69,9 +69,10 @@ * * @param cache Cache */ - public JBossCacheStorageConnection(Cache cache, N= ode itemsRoot) + public JBossCacheStorageConnection(Cache cache, N= ode nodesRoot, + Node propsRoot) { - super(itemsRoot.getFqn()); + super(nodesRoot, propsRoot); = this.cache =3D cache; } @@ -83,8 +84,29 @@ IllegalStateException { startBatch(); - //cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifie= r()); - //cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); // tr= eePrint(treeRoot); + + if (data.getParentIdentifier() !=3D null) + { + // check if parent is cached + Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); + + Node parent =3D cache.getNode(parentFqn); + if (parent =3D=3D null) + { + throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); + } + + // add child to Parent = + Node childNode =3D + parent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[= data.getQPath().getEntries().length - 1])); + + // set child id attr = + childNode.put(ITEM_ID, data.getIdentifier()); + } + + // add in NODES + Node node =3D nodesRoot.addChild(makeNodeFqn(d= ata.getIdentifier())); + node.put(ITEM_DATA, data); } = /** @@ -94,11 +116,22 @@ InvalidItemStateException, IllegalStateException { startBatch(); - //Fqn parentFqn =3D makeParentFqn(data.getQPath()); = - // add an attr to the parent node as key=3DPropertyName value=3DProp= ertyId - //cache.put(parentFqn, data.getQPath().getName().getAsString(), data= .getIdentifier()); - //cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, data); + // check if parent is cached + Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); + + Node parent =3D cache.getNode(parentFqn); + if (parent =3D=3D null) + { + throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); + } + + // add to parent's properties attr + parent.put(data.getQPath().getName().getAsString(), data.getIdentifi= er()); + + // add in PROPERTIES + Node prop =3D propsRoot.addChild(makePropFqn(d= ata.getIdentifier())); + prop.put(ITEM_DATA, data); } = /** @@ -108,8 +141,25 @@ InvalidItemStateException, IllegalStateException { startBatch(); - //cache.removeNode(makeNodeFqn(data.getQPath())); - //cache.removeNode(makeIdFqn(data.getIdentifier())); + + if (data.getParentIdentifier() !=3D null) + { + // check if parent is cached + Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); + + Node parent =3D cache.getNode(parentFqn); + if (parent =3D=3D null) + { + throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); + } + + // remove child on Parent + boolean removed =3D + parent.removeChild(makeChildNodeFqn(data.getQPath().getEntries= ()[data.getQPath().getEntries().length - 1])); + } + + // remove from NODES + boolean removed =3D nodesRoot.removeChild(makeNodeFqn(data.getIdenti= fier())); } = /** @@ -119,9 +169,21 @@ InvalidItemStateException, IllegalStateException { startBatch(); - // delete attr on parent by key=3DPropertyName - //cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getNa= me().getAsString()); - //cache.removeNode(makeIdFqn(data.getIdentifier())); + + // check if parent is cached + Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); + + Node parent =3D cache.getNode(parentFqn); + if (parent =3D=3D null) + { + throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); + } + + // remove from parent's properties attr + Object prev =3D parent.remove(data.getQPath().getName().getAsString(= )); + + // remove from PROPERTIES + boolean removed =3D propsRoot.removeChild(makePropFqn(data.getIdenti= fier())); } = /** @@ -130,30 +192,30 @@ public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException { //Set childNames =3D cache.getChildrenNames(makeNodeFqn(pare= nt.getQPath())); -// Node parentNode =3D cache.getNode(makeNodeFq= n(parent.getQPath())); -// if (parentNode =3D=3D null) -// { -// throw new IllegalStateException("Get child Nodes error: parent = not found " + parent.getQPath().getAsString()); -// } -// -// Set> childNodes =3D parentNode.getChild= ren(); -// -// List childs =3D new ArrayList(); -// for (Node child : childNodes) -// { -// String childId =3D (String)child.get(ITEM_ID); -// -// // TODO NodeData or PropertyData? As ItemData check then and ca= st. -// NodeData node =3D (NodeData)cache.get(makeIdFqn(childId), ITEM_= DATA); -// if (node =3D=3D null) -// { -// throw new RepositoryException("One of childs is null. Parent= " + parent.getQPath().getAsString()); -// } -// childs.add(node); -// } -// -// return childs; - = + // Node parentNode =3D cache.getNode(make= NodeFqn(parent.getQPath())); + // if (parentNode =3D=3D null) + // { + // throw new IllegalStateException("Get child Nodes error: p= arent not found " + parent.getQPath().getAsString()); + // } + // + // Set> childNodes =3D parentNode.ge= tChildren(); + // + // List childs =3D new ArrayList(); + // for (Node child : childNodes) + // { + // String childId =3D (String)child.get(ITEM_ID); + // + // // TODO NodeData or PropertyData? As ItemData check then = and cast. + // NodeData node =3D (NodeData)cache.get(makeIdFqn(childId),= ITEM_DATA); + // if (node =3D=3D null) + // { + // throw new RepositoryException("One of childs is null. = Parent " + parent.getQPath().getAsString()); + // } + // childs.add(node); + // } + // + // return childs; + return null; } = @@ -179,31 +241,31 @@ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException { // TODO treeRoot.getChild(f) possible if f not a direct child??? = -// Node parentNode =3D cache.getNode(makeNodeFq= n(parent.getQPath())); -// if (parentNode =3D=3D null) -// { -// throw new IllegalStateException("Get child Nodes error: parent = not found " + parent.getQPath().getAsString()); -// } -// -// List childs =3D new ArrayList(); -// -// for (Serializable key : parentNode.getKeys()) -// { -// if (!key.equals(ITEM_ID)) -// { -// String propId =3D (String)parentNode.get(key); -// // TODO NodeData or PropertyData? As ItemData check then and= cast. = -// PropertyData property =3D (PropertyData)cache.get(makeIdFqn(= propId), ITEM_DATA); -// if (property =3D=3D null) -// { -// throw new RepositoryException("One of childs is null. Par= ent " + parent.getQPath().getAsString()); -// } -// childs.add(property); -// } -// } -// -// return childs; - = + // Node parentNode =3D cache.getNode(make= NodeFqn(parent.getQPath())); + // if (parentNode =3D=3D null) + // { + // throw new IllegalStateException("Get child Nodes error: p= arent not found " + parent.getQPath().getAsString()); + // } + // + // List childs =3D new ArrayList(); + // + // for (Serializable key : parentNode.getKeys()) + // { + // if (!key.equals(ITEM_ID)) + // { + // String propId =3D (String)parentNode.get(key); + // // TODO NodeData or PropertyData? As ItemData check th= en and cast. = + // PropertyData property =3D (PropertyData)cache.get(make= IdFqn(propId), ITEM_DATA); + // if (property =3D=3D null) + // { + // throw new RepositoryException("One of childs is nul= l. Parent " + parent.getQPath().getAsString()); + // } + // childs.add(property); + // } + // } + // + // return childs; + return null; } = @@ -221,34 +283,28 @@ */ public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException, IllegalStateException { -// Node parentNode =3D cache.getNode(makeNodeFq= n(parentData.getQPath())); -// if (parentNode =3D=3D null) -// { -// throw new IllegalStateException("Get Item data error: parent no= t found " + parentData.getQPath().getAsString()); -// } -// -// // TODO check performance of Node vs Property get -// -// String propertyId =3D (String)parentNode.get(name.getAsString()); -// if (propertyId !=3D null) -// { -// // it's Property Item -// return (PropertyData)cache.get(makeIdFqn(propertyId), ITEM_DATA= ); -// } -// else -// { -// // it's Node Item -// Node node =3D parentNode.getChild(name.ge= tAsString(true)); // TODO String not Fqn? -// if (node !=3D null) -// { -// String nodeId =3D (String)node.get(ITEM_ID); -// if (nodeId !=3D null) -// { -// return (NodeData)cache.get(makeIdFqn(nodeId), ITEM_DATA); -// } -// } -// } = + // try as Node = + Node item =3D nodesRoot.getChild(makeChildNode= Fqn(parentData.getIdentifier(), name)); + if (item !=3D null) + { + return (NodeData)item.get(ITEM_DATA); + } + else + { + // try as Property = + Node parent =3D nodesRoot.getChild(makeNode= Fqn(parentData.getIdentifier())); + if (parent !=3D null) + { + // get property id + String propId =3D (String)parent.get(name.getAsString(false)); + if (propId !=3D null) + { + return (PropertyData)propsRoot.get(makePropFqn(propId)); + } + } + } + return null; } = @@ -257,7 +313,29 @@ */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException { - return (ItemData)cache.get(makeItemFqn(identifier), ITEM_DATA); + + Node item =3D nodesRoot.getChild(makeNodeFqn(i= dentifier)); + if (item =3D=3D null) + { + item =3D propsRoot.getChild(makePropFqn(identifier)); + } + + if (item !=3D null) + { + Object itemData =3D item.get(ITEM_DATA); + if (itemData !=3D null) + { + return (ItemData)itemData; + } + else + { + throw new RepositoryException("FATAL ItemData empty " + item.g= etFqn()); + } + } + else + { + return null; + } } = /** @@ -289,18 +367,57 @@ { startBatch(); = - // TODO it's put anyway.. but with check? - Object prev =3D cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, dat= a.getIdentifier()); - if (prev =3D=3D null) + // TODO recheck the logic + + Node node =3D nodesRoot.getChild(makeNodeFqn(d= ata.getIdentifier())); + if (node =3D=3D null) { - throw new IllegalStateException("Node was deleted (tree)"); + throw new InvalidItemStateException("Node was updated previously = or removed " + data.getQPath().getAsString()); } = - prev =3D cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, dat= a); - if (prev =3D=3D null) + QPath prevPath; + + Object itemData =3D node.get(ITEM_DATA); + if (itemData =3D=3D null) { - throw new IllegalStateException("Node was deleted (items)"); + throw new RepositoryException("FATAL NodeData empty " + node.getF= qn()); } + + if (itemData instanceof NodeData) + { + prevPath =3D ((NodeData)itemData).getQPath(); + } + else + { + throw new RepositoryException("FATAL Node data is not NodeData " = + node.getFqn()); + } + + if (data.getParentIdentifier() !=3D null) + { + // check if parent is cached + Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); + + Node parent =3D cache.getNode(parentFqn); + if (parent =3D=3D null) + { + throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); + } + + // update child on Parent (remove prev, add new) + + // get previously cached NodeData and using its name remove child= on the parent + boolean removed =3D + parent.removeChild(makeChildNodeFqn(prevPath.getEntries()[prev= Path.getEntries().length - 1])); + + Node childNode =3D + parent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[= data.getQPath().getEntries().length - 1])); + + // set child id attr = + childNode.put(ITEM_ID, data.getIdentifier()); + } + + // update in NODES + node.put(ITEM_DATA, data); } = /** @@ -311,19 +428,14 @@ { startBatch(); = - // TODO it's put anyway.. but with check? -// Fqn parentFqn =3D makeParentFqn(data.getQPath()); -// Object prev =3D cache.put(parentFqn, data.getQPath().getName().get= AsString(), data.getIdentifier()); -// if (prev =3D=3D null) -// { -// throw new IllegalStateException("Property was deleted (tree)"); -// } -// -// prev =3D cache.put(makeIdFqn(data.getIdentifier()), ITEM_DATA, dat= a); -// if (prev =3D=3D null) -// { -// throw new IllegalStateException("Property was deleted (items)"); -// } + // update in PROPERTIES + Node prop =3D propsRoot.getChild(makePropFqn(d= ata.getIdentifier())); + if (prop =3D=3D null) + { + throw new IllegalStateException("Property was deleted " + data.ge= tQPath().getAsString()); + } + + prop.put(ITEM_DATA, data); } = /** Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java 2009-11-06 15= :51:12 UTC (rev 488) @@ -0,0 +1,112 @@ +/* + * 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. + */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.jboss.cache.Fqn; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 31.10.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +(a)Deprecated +public abstract class JBossCacheTreeStorage +{ + + @Deprecated + public static final String TREE =3D "$TREE".intern(); + + @Deprecated + public static final String ITEMS =3D "$ITEMS".intern(); + = + public static final String ITEM_DATA =3D "$data".intern(); + + public static final String ITEM_ID =3D "$id".intern(); + + @Deprecated + protected final Fqn treeRoot; + + protected final Fqn itemsRoot; + + @Deprecated + protected JBossCacheTreeStorage(Fqn treeRoot, Fqn items= Root) + { + this.itemsRoot =3D itemsRoot; + = + this.treeRoot =3D treeRoot; + } + + @Deprecated + protected Fqn makeNodeFqn(QPath nodePath) + { + QPathEntry[] path =3D nodePath.getEntries(); + String[] fqns =3D new String[path.length]; + + for (int i =3D 0; i < path.length; i++) + { + fqns[i] =3D path[i].getAsString(true); + } + + return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); + } + + @Deprecated + protected Fqn makeParentFqn(QPath propertyPath) + { + QPathEntry[] path =3D propertyPath.getEntries(); + int pathLen =3D path.length - 1; + String[] fqns =3D new String[pathLen]; + + for (int i =3D 0; i < pathLen; i++) + { + fqns[i] =3D path[i].getAsString(true); + } + + return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); + } + = + protected Fqn makeItemFqn(String nodeId) + { + return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromString(nodeId)); + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.j= ava ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-06 15:01:45 UTC (rev 487) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-06 15:51:12 UTC (rev 488) @@ -53,7 +53,7 @@ * @version $Id$ */ @Deprecated -public class JBossCacheTreeStorageConnection extends JBossCacheStorage imp= lements WorkspaceStorageConnection +public class JBossCacheTreeStorageConnection extends JBossCacheTreeStorage= implements WorkspaceStorageConnection { = protected static final Log LOG =3D ExoLogger.getLogger("jcr.JBossCacheS= torageConnection"); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-06 15:01:45 UTC (rev 487) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-06 15:51:12 UTC (rev 488) @@ -67,7 +67,8 @@ = private final Cache cache; = - private final Node items; + private final Node nodes; + private final Node properties; = /** * JBossWorkspaceDataContainer constructor. @@ -111,7 +112,8 @@ //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); = // prepare cache structures - this.items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.I= TEMS)); + this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .NODES)); + this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheSt= orage.PROPS)); } = public void start() @@ -143,7 +145,7 @@ */ public WorkspaceStorageConnection openConnection() throws RepositoryExc= eption { - return new JBossCacheStorageConnection(cache, items); + return new JBossCacheStorageConnection(cache, nodes, properties); } = /** @@ -151,7 +153,7 @@ */ public WorkspaceStorageConnection openConnection(boolean readOnly) thro= ws RepositoryException { - return new JBossCacheStorageConnection(cache, items); + return new JBossCacheStorageConnection(cache, nodes, properties); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-06 15:01:45= UTC (rev 487) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-06 15:51:12= UTC (rev 488) @@ -36,12 +36,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.ItemData; @@ -57,6 +51,12 @@ import org.jboss.cache.factories.annotations.Inject; import org.jboss.cache.loader.AbstractCacheLoader; = +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Created by The eXo Platform SAS. * = @@ -92,7 +92,7 @@ */ public void put(List modifications) throws Exception { - = + // TODO = } = @@ -118,7 +118,7 @@ Map attrs =3D new LinkedHashMap(); if (name.size() > 1) { - if (name.get(1).equals(JBossCacheStorage.TREE)) + if (name.get(1).equals(JBossCacheStorage.NODES)) { // return Node if (name.size() > 3) @@ -157,7 +157,7 @@ attrs.put(JBossCacheStorage.ITEM_ID, Constants.ROOT_UUID); } } - else if (name.get(1).equals(JBossCacheStorage.ITEMS)) + else if (name.get(1).equals(JBossCacheStorage.NODES)) { // we have all data on thrid level = if (name.size() =3D=3D 3) @@ -199,7 +199,7 @@ Set childs =3D new LinkedHashSet(); if (fqn.size() > 2) { - if (fqn.get(2).equals(JBossCacheStorage.TREE)) + if (fqn.get(2).equals(JBossCacheStorage.NODES)) { // return Node if (fqn.size() > 3) @@ -237,7 +237,7 @@ .getAsString(true)); } } - else if (fqn.get(2).equals(JBossCacheStorage.ITEMS)) + else if (fqn.get(2).equals(JBossCacheStorage.NODES)) { // we have all data on thrid level = if (fqn.size() =3D=3D 3) @@ -261,8 +261,8 @@ } else if (fqn.equals(Fqn.ROOT)) { - childs.add(JBossCacheStorage.TREE); - childs.add(JBossCacheStorage.ITEMS); + childs.add(JBossCacheStorage.NODES); + childs.add(JBossCacheStorage.PROPS); } return childs; } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTes= t.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java= 2009-11-06 15:01:45 UTC (rev 487) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java= 2009-11-06 15:51:12 UTC (rev 488) @@ -94,8 +94,8 @@ //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements("repo", "ws")); = // prepare cache structures - tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.TREE)); - items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.ITEMS)= ); + tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheTreeStorage.TRE= E)); + items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheTreeStorage.IT= EMS)); = // run cache cache.create(); --===============1477513282527980657==-- From do-not-reply at jboss.org Fri Nov 6 10:54:46 2009 Content-Type: multipart/mixed; boundary="===============2138293107544941402==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r489 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 06 Nov 2009 10:54:46 -0500 Message-ID: <200911061554.nA6Fskg4027608@svn01.web.mwc.hst.phx2.redhat.com> --===============2138293107544941402== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-06 10:54:46 -0500 (Fri, 06 Nov 2009) New Revision: 489 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-200: new impl Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 15:51:12 UTC (rev 488) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 15:54:46 UTC (rev 489) @@ -88,9 +88,7 @@ if (data.getParentIdentifier() !=3D null) { // check if parent is cached - Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); - - Node parent =3D cache.getNode(parentFqn); + Node parent =3D cache.getNode(makeNodeFqn(d= ata.getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); @@ -118,9 +116,7 @@ startBatch(); = // check if parent is cached - Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); - - Node parent =3D cache.getNode(parentFqn); + Node parent =3D cache.getNode(makeNodeFqn(data= .getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); @@ -145,9 +141,7 @@ if (data.getParentIdentifier() !=3D null) { // check if parent is cached - Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); - - Node parent =3D cache.getNode(parentFqn); + Node parent =3D cache.getNode(makeNodeFqn(d= ata.getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); @@ -171,9 +165,7 @@ startBatch(); = // check if parent is cached - Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); - - Node parent =3D cache.getNode(parentFqn); + Node parent =3D cache.getNode(makeNodeFqn(data= .getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); --===============2138293107544941402==-- From do-not-reply at jboss.org Fri Nov 6 11:02:43 2009 Content-Type: multipart/mixed; boundary="===============2405855066866590415==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r490 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory. Date: Fri, 06 Nov 2009 11:02:43 -0500 Message-ID: <200911061602.nA6G2hbM029186@svn01.web.mwc.hst.phx2.redhat.com> --===============2405855066866590415== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-06 11:02:42 -0500 (Fri, 06 Nov 2009) New Revision: 490 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ActionLauncher.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ListenerCriteria.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ObservationManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ObservationManagerRegistry.java Log: EXOJCR-204:Observation manager refactored Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ActionLauncher.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ActionLauncher.java 2009-11-06 15:54:46 UT= C (rev 489) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ActionLauncher.java 2009-11-06 16:02:42 UT= C (rev 490) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.core.observation; = +import org.exoplatform.services.jcr.core.NamespaceAccessor; import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; @@ -64,12 +65,16 @@ = private final SessionRegistry sessionRegistry; = + private final NodeTypeDataManager ntManager; + = + public ActionLauncher(ObservationManagerRegistry registry, WorkspacePer= sistentDataManager workspaceDataManager, - SessionRegistry sessionRegistry) + NodeTypeDataManager ntManager, SessionRegistry sessionRegistry) { this.observationRegistry =3D registry; this.workspaceDataManager =3D workspaceDataManager; this.sessionRegistry =3D sessionRegistry; + this.ntManager =3D ntManager; this.workspaceDataManager.addItemPersistenceListener(this); } = @@ -104,9 +109,8 @@ try { int eventType =3D eventType(itemState); - if (eventType !=3D SKIP_EVENT && isTypeMatch(crite= ria, eventType) - && isPathMatch(criteria, item, userSession) && = isIdentifierMatch(criteria, item) - && isNodeTypeMatch(criteria, item, userSession,= subLog) + if (eventType !=3D SKIP_EVENT && isTypeMatch(crite= ria, eventType) && isPathMatch(criteria, item) + && isIdentifierMatch(criteria, item) && isNodeT= ypeMatch(criteria, item, subLog) && isSessionMatch(criteria, sessionId)) { = @@ -146,25 +150,15 @@ return true; } = - private boolean isPathMatch(ListenerCriteria criteria, ItemData item, S= essionImpl userSession) + private boolean isPathMatch(ListenerCriteria criteria, ItemData item) { if (criteria.getAbsPath() =3D=3D null) return true; - try - { - QPath cLoc =3D userSession.getLocationFactory().parseAbsPath(crit= eria.getAbsPath()).getInternalPath(); + // 8.3.3 Only events whose associated parent node is at absPath (or + // within its subtree, if isDeep is true) will be received. + QPath itemPath =3D item.getQPath(); = - // 8.3.3 Only events whose associated parent node is at absPath (= or - // within its subtree, if isDeep is true) will be received. - - QPath itemPath =3D item.getQPath(); - - return itemPath.isDescendantOf(cLoc, !criteria.isDeep()); - } - catch (RepositoryException e) - { - return false; - } + return itemPath.isDescendantOf(criteria.getAbsPath(), !criteria.isDe= ep()); } = private boolean isIdentifierMatch(ListenerCriteria criteria, ItemData i= tem) @@ -185,8 +179,8 @@ = } = - private boolean isNodeTypeMatch(ListenerCriteria criteria, ItemData ite= m, SessionImpl userSession, - PlainChangesLog changesLog) throws RepositoryException + private boolean isNodeTypeMatch(ListenerCriteria criteria, ItemData ite= m, PlainChangesLog changesLog) + throws RepositoryException { if (criteria.getNodeTypeName() =3D=3D null) return true; @@ -214,12 +208,9 @@ } } = - NodeTypeDataManager ntManager =3D userSession.getWorkspace().getNode= TypesHolder(); - LocationFactory locationFactory =3D userSession.getLocationFactory(); for (int i =3D 0; i < criteria.getNodeTypeName().length; i++) { - InternalQName name =3D locationFactory.parseJCRName(criteria.getN= odeTypeName()[i]).getInternalName(); - NodeTypeData criteriaNT =3D ntManager.getNodeType(name); + NodeTypeData criteriaNT =3D ntManager.getNodeType(criteria.getNod= eTypeName()[i]); InternalQName[] testQNames; if (criteriaNT.isMixin()) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ListenerCriteria.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ListenerCriteria.java 2009-11-06 15:54:46 = UTC (rev 489) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ListenerCriteria.java 2009-11-06 16:02:42 = UTC (rev 490) @@ -18,7 +18,8 @@ */ package org.exoplatform.services.jcr.impl.core.observation; = -import javax.jcr.RepositoryException; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.QPath; = /** * Created by The eXo Platform SAS. @@ -32,20 +33,20 @@ = private int eventTypes; = - private String absPath; + private QPath absPath; = private boolean deep; = private String[] identifier; = - private String[] nodeTypeName; + private InternalQName[] nodeTypeName; = private boolean noLocal; = private String sessionId; = - public ListenerCriteria(int eventTypes, String absPath, boolean isDeep,= String[] identifier, String[] nodeTypeName, - boolean noLocal, String sessionId) throws RepositoryException + public ListenerCriteria(int eventTypes, QPath absPath, boolean isDeep, = String[] identifier, InternalQName[] nodeTypeName, + boolean noLocal, String sessionId) { this.eventTypes =3D eventTypes; this.absPath =3D absPath; @@ -61,7 +62,7 @@ return this.eventTypes; } = - public String getAbsPath() + public QPath getAbsPath() { return this.absPath; } @@ -76,7 +77,7 @@ return this.identifier; } = - public String[] getNodeTypeName() + public InternalQName[] getNodeTypeName() { return this.nodeTypeName; } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ObservationManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerImpl.java 2009-11-06 15:= 54:46 UTC (rev 489) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerImpl.java 2009-11-06 16:= 02:42 UTC (rev 490) @@ -20,6 +20,10 @@ = import org.exoplatform.services.jcr.core.ExtendedSession; import org.exoplatform.services.jcr.core.SessionLifecycleListener; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.util.EntityCollection; = import java.util.ArrayList; @@ -46,15 +50,19 @@ = private ObservationManagerRegistry registry; = + private SessionRegistry sessionRegistry; + /** * Protected constructor for subclasses * = * @param session */ - ObservationManagerImpl(ObservationManagerRegistry registry, String sess= ionId) + ObservationManagerImpl(ObservationManagerRegistry registry, String sess= ionId, SessionRegistry sessionRegistry) { this.sessionId =3D sessionId; this.registry =3D registry; + + this.sessionRegistry =3D sessionRegistry; } = /** @@ -64,7 +72,23 @@ String[] nodeTypeName, boolean noLocal) throws RepositoryException { = - registry.addEventListener(listener, new ListenerCriteria(eventTypes,= absPath, isDeep, uuid, nodeTypeName, + // Convert all strings to internal view + QPath absQPath =3D + sessionRegistry.getSession(sessionId).getLocationFactory().parseA= bsPath(absPath).getInternalPath(); + + InternalQName[] nodeTypeNames =3D null; + + if (nodeTypeName !=3D null && nodeTypeName.length > 0) + { + nodeTypeNames =3D new InternalQName[nodeTypeName.length]; + LocationFactory locationFactory =3D sessionRegistry.getSession(se= ssionId).getLocationFactory(); + for (int i =3D 0; i < nodeTypeNames.length; i++) + { + nodeTypeNames[i] =3D locationFactory.parseJCRName(nodeTypeName= [i]).getInternalName(); + } + } + + registry.addEventListener(listener, new ListenerCriteria(eventTypes,= absQPath, isDeep, uuid, nodeTypeNames, noLocal, sessionId)); = sessionListeners.add(listener); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ObservationManagerRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-06= 15:54:46 UTC (rev 489) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-06= 16:02:42 UTC (rev 490) @@ -18,6 +18,8 @@ */ package org.exoplatform.services.jcr.impl.core.observation; = +import org.exoplatform.services.jcr.core.NamespaceAccessor; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; @@ -49,17 +51,26 @@ = protected ActionLauncher launcher; = + + protected SessionRegistry sessionRegistry; + + protected NamespaceAccessor namespaceAccessor; + + protected NodeTypeDataManager nodeTypeDataManager; + public ObservationManagerRegistry(WorkspacePersistentDataManager worksp= aceDataManager, - SessionRegistry sessionRegistry) + SessionRegistry sessionRegistry, NamespaceAccessor namespaceAccessor) { - + this.sessionRegistry =3D sessionRegistry; this.listenersMap =3D new HashMap(); - this.launcher =3D new ActionLauncher(this, workspaceDataManager, ses= sionRegistry); + this.namespaceAccessor =3D namespaceAccessor; + //this.nodeTypeDataManager =3D nodeTypeDataManager; + this.launcher =3D new ActionLauncher(this, workspaceDataManager, nod= eTypeDataManager, sessionRegistry); } = public ObservationManagerImpl createObservationManager(SessionImpl sess= ion) { - return new ObservationManagerImpl(this, session.getId()); + return new ObservationManagerImpl(this, session.getId(), sessionRegi= stry); } = public void addEventListener(EventListener listener, ListenerCriteria f= ilter) @@ -100,5 +111,11 @@ listenersMap.remove(listener); } } + = = + public ActionLauncher getLauncher() + { + return launcher; + } + = } Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-06 1= 6:02:42 UTC (rev 490) @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; +import org.jboss.cache.Modification; + +import java.util.List; + +/** + * @author Nikolay Zamosenchuk + * @version $Id: ObservationCacheLoader.java 34360 2009-07-22 23:58:59Z ah= eritier $ + * + */ +public class ObservationCacheLoader extends AbstractWriteOnlyCacheLoader +{ + private final ObservationManagerRegistry observationManagerRegistry; + + /** + * = + */ + public ObservationCacheLoader(ObservationManagerRegistry observationMan= agerRegistry) + { + this.observationManagerRegistry =3D observationManagerRegistry; + } + + /** + * @see org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWr= iteOnlyCacheLoader#put(java.util.List) + */ + @Override + public void put(List modifications) throws Exception + { + // TODO Auto-generated method stub + + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.= java ___________________________________________________________________ Name: svn:mime-type + text/plain --===============2405855066866590415==-- From do-not-reply at jboss.org Fri Nov 6 11:14:01 2009 Content-Type: multipart/mixed; boundary="===============1946072979826557455==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r491 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory. Date: Fri, 06 Nov 2009 11:14:01 -0500 Message-ID: <200911061614.nA6GE1p5031346@svn01.web.mwc.hst.phx2.redhat.com> --===============1946072979826557455== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-06 11:14:01 -0500 (Fri, 06 Nov 2009) New Revision: 491 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java Log: EXOJCR-205: first implementation LockCacheLoader Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-06 16:02:42 UTC (rev= 490) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-06 16:14:01 UTC (rev= 491) @@ -375,6 +375,7 @@ * @seeorg.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenc= eListener#onSaveItems(org. * exoplatform.services.jcr.dataflow.ItemStateChangesLog) */ + @Deprecated public void onSaveItems(ItemStateChangesLog changesLog) { List chengesLogList =3D new ArrayList(); @@ -680,8 +681,10 @@ * = * @param nodeIdentifier * @throws LockException + * = + * TODO: Changed from private to public. Need for LockCacheLoader. */ - private synchronized void internalLock(String nodeIdentifier) throws Lo= ckException + public synchronized void internalLock(String nodeIdentifier) throws Loc= kException { LockData ldata =3D pendingLocks.get(nodeIdentifier); if (ldata !=3D null) @@ -741,8 +744,10 @@ * @param owner * String * @return LockData + * = + * TODO: Changed from private to public. Need for LockCacheLoader. */ - private synchronized LockData createRemoteLock(String sessionId, String= nodeIdentifier, String lockToken, + public synchronized LockData createRemoteLock(String sessionId, String = nodeIdentifier, String lockToken, boolean isDeep, boolean sessionScoped, String owner) { LockData lData =3D new LockData(nodeIdentifier, lockToken, isDeep, s= essionScoped, owner, lockTimeOut); @@ -799,4 +804,12 @@ { removeExpired(); } + + /** + * TODO: Added. Need for LockCacheLoader.. + */ + public boolean hasPendingLocks(String nodeIdentifier) + { + return pendingLocks.containsKey(nodeIdentifier); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-06 16:02:42= UTC (rev 490) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-06 16:14:01= UTC (rev 491) @@ -16,9 +16,15 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.lock.LockManager; +import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.jboss.cache.CacheException; import org.jboss.cache.Modification; = +import java.util.ArrayList; import java.util.List; = /** @@ -32,43 +38,78 @@ public class LockCacheLoader extends AbstractWriteOnlyCacheLoader { = + private LockManagerImpl lockManager; + /** * {@inheritDoc} */ @Override public void put(List modifications) throws Exception { + LockChanges lockChanges =3D new LockChanges(); + for (Modification m : modifications) { - switch (m.getType()) + // TODO $properties + if (m.getFqn().hasElement(JBossCacheStorage.PROPS)) { - case PUT_DATA : - // put(m.getFqn(), m.getData()); - break; - case PUT_DATA_ERASE : - // removeData(m.getFqn()); - // put(m.getFqn(), m.getData()); - break; - case PUT_KEY_VALUE : - // put(m.getFqn(), m.getKey(), m.getValue()); - break; - case REMOVE_DATA : - // removeData(m.getFqn()); - break; - case REMOVE_KEY_VALUE : - // remove(m.getFqn(), m.getKey()); - break; - case REMOVE_NODE : - // remove(m.getFqn()); - break; - case MOVE : - // involve moving all children too - // move(m.getFqn(), m.getFqn2()); - break; - default : - throw new CacheException("Unknown modification " + m.getTyp= e()); + switch (m.getType()) + { + case PUT_DATA : + break; + case PUT_KEY_VALUE : + if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) + { + PropertyData propertyData =3D (PropertyData)m.getValu= e(); + InternalQName propertyName =3D propertyData.getQPath(= ).getName(); + + if (propertyName.equals(Constants.JCR_LOCKISDEEP) || = propertyName.equals(Constants.JCR_LOCKOWNER)) + { + } + } + break; + case REMOVE_DATA : + break; + case REMOVE_KEY_VALUE : + break; + case REMOVE_NODE : + break; + case MOVE : + break; + default : + throw new CacheException("Unknown modification " + m.get= Type()); + } } } } = + private void processLock() + { + // String nodeIdentifier =3D data.getParentIdentifier(); + // if (lockManager.hasPendingLocks(nodeIdentifier)) + // { + // lockManager.internalLock(nodeIdentifier); + // } + // else + // { + // + // } + } + + private void processUnLock() + { + + } + + /** + * = + */ + private class LockChanges + { + PropertyData lockIsDeepData; + + PropertyData lockOwnerData; + + } + } --===============1946072979826557455==-- From do-not-reply at jboss.org Fri Nov 6 11:16:58 2009 Content-Type: multipart/mixed; boundary="===============6573613596747794106==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r492 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/dataflow and 1 other directory. Date: Fri, 06 Nov 2009 11:16:58 -0500 Message-ID: <200911061616.nA6GGwdQ032469@svn01.web.mwc.hst.phx2.redhat.com> --===============6573613596747794106== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-06 11:16:58 -0500 (Fri, 06 Nov 2009) New Revision: 492 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/dataflow/TestTransientValueDataSerialization.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/TransientValueData.java Log: EXOJCR-201 : In TransientValueData was changed serialization mechanism and= added test TestTransientVAlueDataSerialization. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/TransientValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TransientValueData.java 2009-11-06 16:14:01 UTC (r= ev 491) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TransientValueData.java 2009-11-06 16:16:58 UTC (r= ev 492) @@ -928,8 +928,26 @@ } else { + // write streams out.writeInt(2); + //TODO Need optimization in backup service. + byte[] buf =3D new byte[4*1024]; + = + if (!spooled) = + spoolInputStream(); + InputStream in =3D (spoolFile =3D=3D null ? new ByteArrayInputStr= eam(data) : new FileInputStream(spoolFile)); + long dataLength =3D (spoolFile =3D=3D null ? data.length : spoolF= ile.length()); + int len; + = + //write length of spoolFile + out.writeLong(dataLength); + = + while ((len =3D in.read(buf)) > 0) + out.write(buf, 0, len); + = + in.close(); } + = out.writeInt(orderNumber); out.writeInt(maxBufferSize); } @@ -946,6 +964,37 @@ data =3D new byte[in.readInt()]; in.readFully(data); } + else + { + //read file form stream + long lengthSpoolFile =3D in.readLong(); = + = + //TODO May be optimization. + SpoolFile sf =3D SpoolFile.createTempFile("jcrvd", null, tempDire= ctory); + sf.acquire(this); + OutputStream outStream =3D new FileOutputStream(sf); = + = + byte[] buf =3D new byte[4*1024]; + = + while (lengthSpoolFile > 0) { + if (lengthSpoolFile - buf.length > 0) + { + in.readFully(buf); + outStream.write(buf); + } + else + { + in.readFully(buf, 0, (int) lengthSpoolFile); + outStream.write(buf, 0, (int) lengthSpoolFile); + } + lengthSpoolFile-=3Dbuf.length; + } + outStream.flush(); + outStream.close(); + spoolFile =3D sf; + spooled =3D true; + } + = orderNumber =3D in.readInt(); maxBufferSize =3D in.readInt(); } Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/dataflow/TestTransientValueDataSerialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TestTransientValueDataSerialization.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TestTransientValueDataSerialization.java 2009-11-0= 6 16:16:58 UTC (rev 492) @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.dataflow; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + +/** + * Created by The eXo Platform SAS. + * = + *
+ * Date: 06.11.2009 + * = + * @author
Alex Re= shetnyak + * @version $Id$ + */ +public class TestTransientValueDataSerialization + extends JcrImplBaseTest +{ + + public void testTVDSerialization() throws Exception + { + File f =3D createBLOBTempFile(145); + f.deleteOnExit(); + + // Create TransientValueData instants + TransientValueData tvd =3D new TransientValueData(new FileInputStrea= m(f), 10); + tvd.setMaxBufferSize(200*1024); + tvd.setFileCleaner(new FileCleaner()); + = + + File out =3D File.createTempFile("test", ".data"); + f.deleteOnExit(); + + //serialize + ObjectOutputStream oos =3D new ObjectOutputStream(new FileOutputStre= am(out)); + oos.writeObject(tvd); + oos.flush(); + oos.close(); + + //deserialize + ObjectInputStream ois =3D new ObjectInputStream(new FileInputStream(= out)); + TransientValueData deserializedTransientValueData =3D (TransientValu= eData) ois.readObject(); + + //check + assertNotNull(deserializedTransientValueData); + assertEquals(tvd.getLength(), deserializedTransientValueData.getLeng= th()); + assertEquals(tvd.getOrderNumber(), deserializedTransientValueData.ge= tOrderNumber()); + compareStream(tvd.getAsStream(), deserializedTransientValueData.getA= sStream()); + } + = + public void testTVDSerialization2M() throws Exception + { + File f =3D createBLOBTempFile(2145); + f.deleteOnExit(); + + // Create TransientValueData instants + TransientValueData tvd =3D new TransientValueData(new FileInputStrea= m(f), 10); + tvd.setMaxBufferSize(200*1024); + tvd.setFileCleaner(new FileCleaner()); + + File out =3D File.createTempFile("test", ".data"); + f.deleteOnExit(); + + //serialize + ObjectOutputStream oos =3D new ObjectOutputStream(new FileOutputStre= am(out)); + oos.writeObject(tvd); + oos.flush(); + oos.close(); + + //deserialize + ObjectInputStream ois =3D new ObjectInputStream(new FileInputStream(= out)); + TransientValueData deserializedTransientValueData =3D (TransientValu= eData) ois.readObject(); + + //check + assertNotNull(deserializedTransientValueData); + assertEquals(tvd.getLength(), deserializedTransientValueData.getLeng= th()); + assertEquals(tvd.getOrderNumber(), deserializedTransientValueData.ge= tOrderNumber()); + compareStream(tvd.getAsStream(), deserializedTransientValueData.getA= sStream()); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/dataflow/TestTransientValueDataSerializati= on.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============6573613596747794106==-- From do-not-reply at jboss.org Fri Nov 6 11:18:12 2009 Content-Type: multipart/mixed; boundary="===============6813118167373235375==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r493 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query: cacheloader and 1 other directory. Date: Fri, 06 Nov 2009 11:18:11 -0500 Message-ID: <200911061618.nA6GIBYa032583@svn01.web.mwc.hst.phx2.redhat.com> --===============6813118167373235375== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-06 11:18:11 -0500 (Fri, 06 Nov 2009) New Revision: 493 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManagerImpl.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SystemSearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java Log: EXOJCR-202: IndexerCacheLoader updated = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-06 16:16:58 UTC (rev = 492) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-06 16:18:11 UTC (rev = 493) @@ -16,163 +16,23 @@ */ package org.exoplatform.services.jcr.impl.core.query; = -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.Term; -import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.WildcardQuery; -import org.apache.lucene.search.BooleanClause.Occur; -import org.exoplatform.container.configuration.ConfigurationManager; -import org.exoplatform.services.document.DocumentReaderService; -import org.exoplatform.services.jcr.config.QueryHandlerEntry; -import org.exoplatform.services.jcr.config.QueryHandlerParams; -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; -import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; -import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; -import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPers= istenceListener; import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.ValueData; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.LocationFactory; -import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; -import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; -import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; -import org.exoplatform.services.jcr.impl.core.query.lucene.ScoreNode; -import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; -import org.exoplatform.services.jcr.impl.core.value.NameValue; -import org.exoplatform.services.jcr.impl.core.value.PathValue; -import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; -import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.picocontainer.Startable; = -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; import java.util.Set; -import java.util.StringTokenizer; = import javax.jcr.Node; -import javax.jcr.PropertyType; import javax.jcr.RepositoryException; -import javax.jcr.Value; import javax.jcr.query.InvalidQueryException; import javax.jcr.query.Query; = /** * Acts as a global entry point to execute queries and index nodes. */ -public class SearchManager implements Startable, MandatoryItemsPersistence= Listener +public interface SearchManager { - /** - * Logger instance for this class - */ - private static final Log log =3D ExoLogger.getLogger(SearchManager.clas= s); - - protected final QueryHandlerEntry config; - - /** - * Text extractor for extracting text content of binary properties. - */ - protected final DocumentReaderService extractor; - - /** - * QueryHandler where query execution is delegated to - */ - protected QueryHandler handler; - - /** - * The shared item state manager instance for the workspace. - */ - protected final ItemDataConsumer itemMgr; - - /** - * The namespace registry of the repository. - */ - protected final NamespaceRegistryImpl nsReg; - - /** - * The node type registry. - */ - protected final NodeTypeDataManager nodeTypeDataManager; - - /** - * QueryHandler of the parent search manager or null if th= ere - * is none. - */ - protected final SearchManager parentSearchManager; - - // protected QPath indexingRoot; - // - // protected List excludedPaths =3D new ArrayList(); - - protected IndexingTree indexingTree; - - private final ConfigurationManager cfm; - - protected LuceneVirtualTableResolver virtualTableResolver; - - /** - * Creates a new SearchManager. - * = - * @param config - * the search configuration. - * @param nsReg - * the namespace registry. - * @param ntReg - * the node type registry. - * @param itemMgr - * the shared item state manager. - * @param rootNodeId - * the id of the root node. - * @param parentMgr - * the parent search manager or null if there i= s no - * parent search manager. - * @param excludedNodeId - * id of the node that should be excluded from indexing. Any - * descendant of that node will also be excluded from indexi= ng. - * @throws RepositoryException - * if the search manager cannot be initialized - * @throws RepositoryConfigurationException - */ - public SearchManager(QueryHandlerEntry config, NamespaceRegistryImpl ns= Reg, NodeTypeDataManager ntReg, - WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, - DocumentReaderService extractor, ConfigurationManager cfm, final Rep= ositoryIndexSearcherHolder indexSearcherHolder) - throws RepositoryException, RepositoryConfigurationException - { - - this.extractor =3D extractor; - indexSearcherHolder.addIndexSearcher(this); - this.config =3D config; - this.nodeTypeDataManager =3D ntReg; - this.nsReg =3D nsReg; - this.itemMgr =3D itemMgr; - this.cfm =3D cfm; - this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); - this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; - itemMgr.addItemPersistenceListener(this); - } - - /** * Creates a query object from a node that can be executed on the works= pace. * = * @param session @@ -189,13 +49,8 @@ * @throws RepositoryException * if any other error occurs. */ - public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, Node node) - throws InvalidQueryException, RepositoryException - { - AbstractQueryImpl query =3D createQueryInstance(); - query.init(session, sessionDataManager, handler, node); - return query; - } + Query createQuery(SessionImpl session, SessionDataManager sessionDataMa= nager, Node node) + throws InvalidQueryException, RepositoryException; = /** * Creates a query object that can be executed on the workspace. @@ -216,645 +71,23 @@ * @throws RepositoryException * if any other error occurs. */ - public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, String statement, - String language) throws InvalidQueryException, RepositoryException - { - AbstractQueryImpl query =3D createQueryInstance(); - query.init(session, sessionDataManager, handler, statement, language= ); - return query; - } + Query createQuery(SessionImpl session, SessionDataManager sessionDataMa= nager, String statement, String language) + throws InvalidQueryException, RepositoryException; = - /** - * just for test use only - */ - public QueryHandler getHandler() - { + Set getFieldNames() throws IndexException; = - return handler; - } + QueryHandler getHandler(); = - public void onSaveItems(ItemStateChangesLog changesLog) - { - if (handler =3D=3D null) - return; + Set getNodesByNodeType(final InternalQName nodeType) throws Rep= ositoryException; = - long time =3D System.currentTimeMillis(); - - // nodes that need to be removed from the index. - final Set removedNodes =3D new HashSet(); - // nodes that need to be added to the index. - final Set addedNodes =3D new HashSet(); - - final Map> updatedNodes =3D new HashMap>(); - - for (Iterator iter =3D changesLog.getAllStates().iterator= (); iter.hasNext();) - { - ItemState itemState =3D iter.next(); - - if (!indexingTree.isExcluded(itemState)) - { - String uuid =3D - itemState.isNode() ? itemState.getData().getIdentifier() : = itemState.getData().getParentIdentifier(); - - if (itemState.isAdded()) - { - if (itemState.isNode()) - { - addedNodes.add(uuid); - } - else - { - if (!addedNodes.contains(uuid)) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - } - } - else if (itemState.isRenamed()) - { - if (itemState.isNode()) - { - addedNodes.add(uuid); - } - else - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - } - else if (itemState.isUpdated()) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - else if (itemState.isMixinChanged()) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - else if (itemState.isDeleted()) - { - if (itemState.isNode()) - { - if (addedNodes.contains(uuid)) - { - addedNodes.remove(uuid); - removedNodes.remove(uuid); - } - else - { - removedNodes.add(uuid); - } - // remove all changes after node remove - updatedNodes.remove(uuid); - } - else - { - if (!removedNodes.contains(uuid) && !addedNodes.contains= (uuid)) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - } - } - } - } - // TODO make quick changes - for (String uuid : updatedNodes.keySet()) - { - removedNodes.add(uuid); - addedNodes.add(uuid); - } - - Iterator addedStates =3D new Iterator() - { - private final Iterator iter =3D addedNodes.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public NodeData next() - { - - // cycle till find a next or meet the end of set - do - { - String id =3D iter.next(); - try - { - ItemData item =3D itemMgr.getItemData(id); - if (item !=3D null) - { - if (item.isNode()) - return (NodeData)item; // return node - else - log.warn("Node not found, but property " + id + ",= " + item.getQPath().getAsString() - + " found. "); - } - else - log.warn("Unable to index node with id " + id + ", no= de does not exist."); - - } - catch (RepositoryException e) - { - log.error("Can't read next node data " + id, e); - } - } - while (iter.hasNext()); // get next if error or node not found - - return null; // we met the end of iterator set - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - - Iterator removedIds =3D new Iterator() - { - private final Iterator iter =3D removedNodes.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public String next() - { - return nextNodeId(); - } - - public String nextNodeId() throws NoSuchElementException - { - return iter.next(); - } - - public void remove() - { - throw new UnsupportedOperationException(); - - } - }; - - if (removedNodes.size() > 0 || addedNodes.size() > 0) - { - try - { - handler.updateNodes(removedIds, addedStates); - } - catch (RepositoryException e) - { - log.error("Error indexing changes " + e, e); - } - catch (IOException e) - { - log.error("Error indexing changes " + e, e); - try - { - handler.logErrorChanges(removedNodes, addedNodes); - } - catch (IOException ioe) - { - log.warn("Exception occure when errorLog writed. Error log = is not complete. " + ioe, ioe); - } - } - } - - if (log.isDebugEnabled()) - { - log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); - } - } - - public void createNewOrAdd(String key, ItemState state, Map> updatedNodes) - { - List list =3D updatedNodes.get(key); - if (list =3D=3D null) - { - list =3D new ArrayList(); - updatedNodes.put(key, list); - } - list.add(state); - - } - - public void start() - { - - if (log.isDebugEnabled()) - log.debug("start"); - try - { - if (indexingTree =3D=3D null) - { - List excludedPath =3D new ArrayList(); - // Calculating excluded node identifiers - excludedPath.add(Constants.JCR_SYSTEM_PATH); - - //if (config.getExcludedNodeIdentifers() !=3D null) - String excludedNodeIdentifer =3D - config.getParameterValue(QueryHandlerParams.PARAM_EXCLUDED_= NODE_IDENTIFERS, null); - if (excludedNodeIdentifer !=3D null) - { - StringTokenizer stringTokenizer =3D new StringTokenizer(exc= ludedNodeIdentifer); - while (stringTokenizer.hasMoreTokens()) - { - - try - { - ItemData excludeData =3D itemMgr.getItemData(stringTo= kenizer.nextToken()); - if (excludeData !=3D null) - excludedPath.add(excludeData.getQPath()); - } - catch (RepositoryException e) - { - log.warn(e.getLocalizedMessage()); - } - } - } - - NodeData indexingRootData =3D null; - String rootNodeIdentifer =3D config.getParameterValue(QueryHan= dlerParams.PARAM_ROOT_NODE_ID, null); - if (rootNodeIdentifer !=3D null) - { - try - { - ItemData indexingRootDataItem =3D itemMgr.getItemData(ro= otNodeIdentifer); - if (indexingRootDataItem !=3D null && indexingRootDataIt= em.isNode()) - indexingRootData =3D (NodeData)indexingRootDataItem; - } - catch (RepositoryException e) - { - log.warn(e.getLocalizedMessage() + " Indexing root set t= o " + Constants.ROOT_PATH.getAsString()); - - } - - } - else - { - try - { - indexingRootData =3D (NodeData)itemMgr.getItemData(Const= ants.ROOT_UUID); - } - catch (RepositoryException e) - { - log.error("Fail to load root node data"); - } - } - - indexingTree =3D new IndexingTree(indexingRootData, excludedPa= th); - } - - initializeQueryHandler(); - } - catch (RepositoryException e) - { - log.error(e.getLocalizedMessage()); - handler =3D null; - throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); - } - catch (RepositoryConfigurationException e) - { - log.error(e.getLocalizedMessage()); - handler =3D null; - throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); - } - } - - public void stop() - { - handler.close(); - log.info("Search manager stopped"); - } - - // /** - // * Checks if the given event should be excluded based on the - // * {@link #excludePath} setting. - // * - // * @param event - // * observation event - // * @return true if the event should be excluded, - // * false otherwise - // */ - // protected boolean isExcluded(ItemState event) { - // - // for (QPath excludedPath : excludedPaths) { - // if (event.getData().getQPath().isDescendantOf(excludedPath) - // || event.getData().getQPath().equals(excludedPath)) - // return true; - // } - // - // return !event.getData().getQPath().isDescendantOf(indexingRoot) - // && !event.getData().getQPath().equals(indexingRoot); - // } - - protected QueryHandlerContext createQueryHandlerContext(QueryHandler pa= rentHandler) - throws RepositoryConfigurationException - { - - QueryHandlerContext context =3D - new QueryHandlerContext(itemMgr, indexingTree, nodeTypeDataManage= r, nsReg, parentHandler, getIndexDir(), - extractor, true, virtualTableResolver); - return context; - } - - protected String getIndexDir() throws RepositoryConfigurationException - { - String dir =3D config.getParameterValue(QueryHandlerParams.PARAM_IND= EX_DIR, null); - if (dir =3D=3D null) - { - log.warn(QueryHandlerParams.PARAM_INDEX_DIR + " parameter not fou= nd. Using outdated parameter name " - + QueryHandlerParams.OLD_PARAM_INDEX_DIR); - dir =3D config.getParameterValue(QueryHandlerParams.OLD_PARAM_IND= EX_DIR); - } - return dir; - } - /** - * Initializes the query handler. - * = - * @throws RepositoryException - * if the query handler cannot be initialized. - * @throws RepositoryConfigurationException - * @throws ClassNotFoundException - */ - protected void initializeQueryHandler() throws RepositoryException, Rep= ositoryConfigurationException - { - // initialize query handler - String className =3D config.getType(); - if (className =3D=3D null) - throw new RepositoryConfigurationException("Content hanler = configuration fail"); - - try - { - Class qHandlerClass =3D Class.forName(className, true, this.getCl= ass().getClassLoader()); - Constructor constuctor =3D qHandlerClass.getConstructor(QueryHand= lerEntry.class, ConfigurationManager.class); - handler =3D (QueryHandler)constuctor.newInstance(config, cfm); - QueryHandler parentHandler =3D (this.parentSearchManager !=3D nul= l) ? parentSearchManager.getHandler() : null; - QueryHandlerContext context =3D createQueryHandlerContext(parentH= andler); - handler.init(context); - - } - catch (SecurityException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IllegalArgumentException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (ClassNotFoundException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (NoSuchMethodException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (InstantiationException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IllegalAccessException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (InvocationTargetException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IOException e) - { - throw new RepositoryException(e.getMessage(), e); - } - } - - /** - * Creates a new instance of an {@link AbstractQueryImpl} which is not - * initialized. - * = - * @return an new query instance. - * @throws RepositoryException - * if an error occurs while creating a new query instance. - */ - protected AbstractQueryImpl createQueryInstance() throws RepositoryExce= ption - { - try - { - String queryImplClassName =3D handler.getQueryClass(); - Object obj =3D Class.forName(queryImplClassName).newInstance(); - if (obj instanceof AbstractQueryImpl) - { - return (AbstractQueryImpl)obj; - } - else - { - throw new IllegalArgumentException(queryImplClassName + " is n= ot of type " - + AbstractQueryImpl.class.getName()); - } - } - catch (Throwable t) - { - throw new RepositoryException("Unable to create query: " + t.toSt= ring(), t); - } - } - - /** - * {@inheritDoc} - */ - public Set getFieldNames() throws IndexException - { - final Set fildsSet =3D new HashSet(); - if (handler instanceof SearchIndex) - { - IndexReader reader =3D null; - try - { - reader =3D ((SearchIndex)handler).getIndexReader(); - final Collection fields =3D reader.getFieldNames(IndexReader.F= ieldOption.ALL); - for (final Object field : fields) - { - fildsSet.add((String)field); - } - } - catch (IOException e) - { - throw new IndexException(e.getLocalizedMessage(), e); - } - finally - { - try - { - if (reader !=3D null) - reader.close(); - } - catch (IOException e) - { - throw new IndexException(e.getLocalizedMessage(), e); - } - } - - } - return fildsSet; - } - - public Set getNodesByNodeType(final InternalQName nodeType) thr= ows RepositoryException - { - - return getNodes(virtualTableResolver.resolve(nodeType, true)); - } - - /** - * Return set of uuid of nodes. Contains in names prefixes maped to the + * Return set of uuid of nodes. Contains in names prefixes mapped to the * given uri * = * @param prefix * @return * @throws RepositoryException */ - public Set getNodesByUri(final String uri) throws RepositoryExc= eption - { - Set result; - final int defaultClauseCount =3D BooleanQuery.getMaxClauseCount(); - try - { + Set getNodesByUri(final String uri) throws RepositoryException; = - // final LocationFactory locationFactory =3D new - // LocationFactory(this); - final ValueFactoryImpl valueFactory =3D new ValueFactoryImpl(new = LocationFactory(nsReg)); - BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE); - BooleanQuery query =3D new BooleanQuery(); - - final String prefix =3D nsReg.getNamespacePrefixByURI(uri); - query.add(new WildcardQuery(new Term(FieldNames.LABEL, prefix + "= :*")), Occur.SHOULD); - // name of the property - query.add(new WildcardQuery(new Term(FieldNames.PROPERTIES_SET, p= refix + ":*")), Occur.SHOULD); - - result =3D getNodes(query); - - // value of the property - - try - { - final Set props =3D getFieldNames(); - - query =3D new BooleanQuery(); - for (final String fieldName : props) - { - if (!FieldNames.PROPERTIES_SET.equals(fieldName)) - { - query.add(new WildcardQuery(new Term(fieldName, "*" + pr= efix + ":*")), Occur.SHOULD); - } - } - } - catch (final IndexException e) - { - throw new RepositoryException(e.getLocalizedMessage(), e); - } - - final Set propSet =3D getNodes(query); - // Manually check property values; - for (final String uuid : propSet) - { - if (isPrefixMatch(valueFactory, uuid, prefix)) - { - result.add(uuid); - } - } - } - finally - { - BooleanQuery.setMaxClauseCount(defaultClauseCount); - } - - return result; - } - - private boolean isPrefixMatch(final InternalQName value, final String p= refix) throws RepositoryException - { - return value.getNamespace().equals(nsReg.getNamespaceURIByPrefix(pre= fix)); - } - - private boolean isPrefixMatch(final QPath value, final String prefix) t= hrows RepositoryException - { - for (int i =3D 0; i < value.getEntries().length; i++) - { - if (isPrefixMatch(value.getEntries()[i], prefix)) - { - return true; - } - } - return false; - } - - /** - * @param valueFactory - * @param dm - * @param uuid - * @param prefix - * @throws RepositoryException - */ - private boolean isPrefixMatch(final ValueFactoryImpl valueFactory, fina= l String uuid, final String prefix) - throws RepositoryException - { - - final ItemData node =3D itemMgr.getItemData(uuid); - if (node !=3D null && node.isNode()) - { - final List props =3D itemMgr.getChildPropertiesData= ((NodeData)node); - for (final PropertyData propertyData : props) - { - if (propertyData.getType() =3D=3D PropertyType.PATH || propert= yData.getType() =3D=3D PropertyType.NAME) - { - for (final ValueData vdata : propertyData.getValues()) - { - final Value val =3D - valueFactory.loadValue(((AbstractValueData)vdata).cre= ateTransientCopy(), propertyData.getType()); - if (propertyData.getType() =3D=3D PropertyType.PATH) - { - if (isPrefixMatch(((PathValue)val).getQPath(), prefix= )) - { - return true; - } - } - else if (propertyData.getType() =3D=3D PropertyType.NAME) - { - if (isPrefixMatch(((NameValue)val).getQName(), prefix= )) - { - return true; - } - } - } - } - } - } - return false; - } - - /** - * @param query - * @return - * @throws RepositoryException - */ - private Set getNodes(final org.apache.lucene.search.Query query= ) throws RepositoryException - { - Set result =3D new HashSet(); - try - { - QueryHits hits =3D handler.executeQuery(query); - - ScoreNode sn; - - while ((sn =3D hits.nextScoreNode()) !=3D null) - { - // Node node =3D session.getNodeById(sn.getNodeId()); - result.add(sn.getNodeId()); - } - } - catch (IOException e) - { - throw new RepositoryException(e.getLocalizedMessage(), e); - } - return result; - } - } Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/query/SearchManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java (= rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java 2009-11-06 16:18:11 UTC (= rev 493) @@ -0,0 +1,865 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.core.query; + +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.WildcardQuery; +import org.apache.lucene.search.BooleanClause.Occur; +import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.services.document.DocumentReaderService; +import org.exoplatform.services.jcr.config.QueryHandlerEntry; +import org.exoplatform.services.jcr.config.QueryHandlerParams; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPers= istenceListener; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.ValueData; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; +import org.exoplatform.services.jcr.impl.core.SessionDataManager; +import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; +import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; +import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; +import org.exoplatform.services.jcr.impl.core.query.lucene.ScoreNode; +import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; +import org.exoplatform.services.jcr.impl.core.value.NameValue; +import org.exoplatform.services.jcr.impl.core.value.PathValue; +import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; +import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.picocontainer.Startable; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.StringTokenizer; + +import javax.jcr.Node; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.jcr.Value; +import javax.jcr.query.InvalidQueryException; +import javax.jcr.query.Query; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author Karpenko Sergiy = + * @version $Id: SearchManagerImpl.java 111 2008-11-11 11:11:11Z serg $ + */ +public class SearchManagerImpl implements SearchManager, Startable, Mandat= oryItemsPersistenceListener +{ + + /** + * Logger instance for this class + */ + private static final Log log =3D ExoLogger.getLogger(SearchManagerImpl.= class); + + protected final QueryHandlerEntry config; + + /** + * Text extractor for extracting text content of binary properties. + */ + protected final DocumentReaderService extractor; + + /** + * QueryHandler where query execution is delegated to + */ + protected QueryHandler handler; + + /** + * The shared item state manager instance for the workspace. + */ + protected final ItemDataConsumer itemMgr; + + /** + * The namespace registry of the repository. + */ + protected final NamespaceRegistryImpl nsReg; + + /** + * The node type registry. + */ + protected final NodeTypeDataManager nodeTypeDataManager; + + /** + * QueryHandler of the parent search manager or null if th= ere + * is none. + */ + protected final SearchManager parentSearchManager; + + // protected QPath indexingRoot; + // + // protected List excludedPaths =3D new ArrayList(); + + protected IndexingTree indexingTree; + + private final ConfigurationManager cfm; + + protected LuceneVirtualTableResolver virtualTableResolver; + + /** + * Creates a new SearchManager. + * = + * @param config + * the search configuration. + * @param nsReg + * the namespace registry. + * @param ntReg + * the node type registry. + * @param itemMgr + * the shared item state manager. + * @param rootNodeId + * the id of the root node. + * @param parentMgr + * the parent search manager or null if there i= s no + * parent search manager. + * @param excludedNodeId + * id of the node that should be excluded from indexing. Any + * descendant of that node will also be excluded from indexi= ng. + * @throws RepositoryException + * if the search manager cannot be initialized + * @throws RepositoryConfigurationException + */ + public SearchManagerImpl(QueryHandlerEntry config, NamespaceRegistryImp= l nsReg, NodeTypeDataManager ntReg, + WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, + DocumentReaderService extractor, ConfigurationManager cfm, final Rep= ositoryIndexSearcherHolder indexSearcherHolder) + throws RepositoryException, RepositoryConfigurationException + { + + this.extractor =3D extractor; + indexSearcherHolder.addIndexSearcher(this); + this.config =3D config; + this.nodeTypeDataManager =3D ntReg; + this.nsReg =3D nsReg; + this.itemMgr =3D itemMgr; + this.cfm =3D cfm; + this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); + this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; + itemMgr.addItemPersistenceListener(this); + } + + /** + * Creates a query object from a node that can be executed on the works= pace. + * = + * @param session + * the session of the user executing the query. + * @param itemMgr + * the item manager of the user executing the query. Needed = to + * return Node instances in the result set. + * @param node + * a node of type nt:query. + * @return a Query instance to execute. + * @throws InvalidQueryException + * if absPath is not a valid persisted query (= that + * is, a node of type nt:query) + * @throws RepositoryException + * if any other error occurs. + */ + public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, Node node) + throws InvalidQueryException, RepositoryException + { + AbstractQueryImpl query =3D createQueryInstance(); + query.init(session, sessionDataManager, handler, node); + return query; + } + + /** + * Creates a query object that can be executed on the workspace. + * = + * @param session + * the session of the user executing the query. + * @param itemMgr + * the item manager of the user executing the query. Needed = to + * return Node instances in the result set. + * @param statement + * the actual query statement. + * @param language + * the syntax of the query statement. + * @return a Query instance to execute. + * @throws InvalidQueryException + * if the query is malformed or the language is + * unknown. + * @throws RepositoryException + * if any other error occurs. + */ + public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, String statement, + String language) throws InvalidQueryException, RepositoryException + { + AbstractQueryImpl query =3D createQueryInstance(); + query.init(session, sessionDataManager, handler, statement, language= ); + return query; + } + + /** + * just for test use only + */ + public QueryHandler getHandler() + { + + return handler; + } + + public void onSaveItems(ItemStateChangesLog changesLog) + { + if (handler =3D=3D null) + return; + + long time =3D System.currentTimeMillis(); + + // nodes that need to be removed from the index. + final Set removedNodes =3D new HashSet(); + // nodes that need to be added to the index. + final Set addedNodes =3D new HashSet(); + + final Map> updatedNodes =3D new HashMap>(); + + for (Iterator iter =3D changesLog.getAllStates().iterator= (); iter.hasNext();) + { + ItemState itemState =3D iter.next(); + + if (!indexingTree.isExcluded(itemState)) + { + String uuid =3D + itemState.isNode() ? itemState.getData().getIdentifier() : = itemState.getData().getParentIdentifier(); + + if (itemState.isAdded()) + { + if (itemState.isNode()) + { + addedNodes.add(uuid); + } + else + { + if (!addedNodes.contains(uuid)) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + } + } + else if (itemState.isRenamed()) + { + if (itemState.isNode()) + { + addedNodes.add(uuid); + } + else + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + } + else if (itemState.isUpdated()) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + else if (itemState.isMixinChanged()) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + else if (itemState.isDeleted()) + { + if (itemState.isNode()) + { + if (addedNodes.contains(uuid)) + { + addedNodes.remove(uuid); + removedNodes.remove(uuid); + } + else + { + removedNodes.add(uuid); + } + // remove all changes after node remove + updatedNodes.remove(uuid); + } + else + { + if (!removedNodes.contains(uuid) && !addedNodes.contains= (uuid)) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + } + } + } + } + // TODO make quick changes + for (String uuid : updatedNodes.keySet()) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } + + Iterator addedStates =3D new Iterator() + { + private final Iterator iter =3D addedNodes.iterator(); + + public boolean hasNext() + { + return iter.hasNext(); + } + + public NodeData next() + { + + // cycle till find a next or meet the end of set + do + { + String id =3D iter.next(); + try + { + ItemData item =3D itemMgr.getItemData(id); + if (item !=3D null) + { + if (item.isNode()) + return (NodeData)item; // return node + else + log.warn("Node not found, but property " + id + ",= " + item.getQPath().getAsString() + + " found. "); + } + else + log.warn("Unable to index node with id " + id + ", no= de does not exist."); + + } + catch (RepositoryException e) + { + log.error("Can't read next node data " + id, e); + } + } + while (iter.hasNext()); // get next if error or node not found + + return null; // we met the end of iterator set + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + }; + + Iterator removedIds =3D new Iterator() + { + private final Iterator iter =3D removedNodes.iterator(); + + public boolean hasNext() + { + return iter.hasNext(); + } + + public String next() + { + return nextNodeId(); + } + + public String nextNodeId() throws NoSuchElementException + { + return iter.next(); + } + + public void remove() + { + throw new UnsupportedOperationException(); + + } + }; + + if (removedNodes.size() > 0 || addedNodes.size() > 0) + { + try + { + handler.updateNodes(removedIds, addedStates); + } + catch (RepositoryException e) + { + log.error("Error indexing changes " + e, e); + } + catch (IOException e) + { + log.error("Error indexing changes " + e, e); + try + { + handler.logErrorChanges(removedNodes, addedNodes); + } + catch (IOException ioe) + { + log.warn("Exception occure when errorLog writed. Error log = is not complete. " + ioe, ioe); + } + } + } + + if (log.isDebugEnabled()) + { + log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); + } + } + + public void createNewOrAdd(String key, ItemState state, Map> updatedNodes) + { + List list =3D updatedNodes.get(key); + if (list =3D=3D null) + { + list =3D new ArrayList(); + updatedNodes.put(key, list); + } + list.add(state); + + } + + public void start() + { + + if (log.isDebugEnabled()) + log.debug("start"); + try + { + if (indexingTree =3D=3D null) + { + List excludedPath =3D new ArrayList(); + // Calculating excluded node identifiers + excludedPath.add(Constants.JCR_SYSTEM_PATH); + + //if (config.getExcludedNodeIdentifers() !=3D null) + String excludedNodeIdentifer =3D + config.getParameterValue(QueryHandlerParams.PARAM_EXCLUDED_= NODE_IDENTIFERS, null); + if (excludedNodeIdentifer !=3D null) + { + StringTokenizer stringTokenizer =3D new StringTokenizer(exc= ludedNodeIdentifer); + while (stringTokenizer.hasMoreTokens()) + { + + try + { + ItemData excludeData =3D itemMgr.getItemData(stringTo= kenizer.nextToken()); + if (excludeData !=3D null) + excludedPath.add(excludeData.getQPath()); + } + catch (RepositoryException e) + { + log.warn(e.getLocalizedMessage()); + } + } + } + + NodeData indexingRootData =3D null; + String rootNodeIdentifer =3D config.getParameterValue(QueryHan= dlerParams.PARAM_ROOT_NODE_ID, null); + if (rootNodeIdentifer !=3D null) + { + try + { + ItemData indexingRootDataItem =3D itemMgr.getItemData(ro= otNodeIdentifer); + if (indexingRootDataItem !=3D null && indexingRootDataIt= em.isNode()) + indexingRootData =3D (NodeData)indexingRootDataItem; + } + catch (RepositoryException e) + { + log.warn(e.getLocalizedMessage() + " Indexing root set t= o " + Constants.ROOT_PATH.getAsString()); + + } + + } + else + { + try + { + indexingRootData =3D (NodeData)itemMgr.getItemData(Const= ants.ROOT_UUID); + } + catch (RepositoryException e) + { + log.error("Fail to load root node data"); + } + } + + indexingTree =3D new IndexingTree(indexingRootData, excludedPa= th); + } + + initializeQueryHandler(); + } + catch (RepositoryException e) + { + log.error(e.getLocalizedMessage()); + handler =3D null; + throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); + } + catch (RepositoryConfigurationException e) + { + log.error(e.getLocalizedMessage()); + handler =3D null; + throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); + } + } + + public void stop() + { + handler.close(); + log.info("Search manager stopped"); + } + + // /** + // * Checks if the given event should be excluded based on the + // * {@link #excludePath} setting. + // * + // * @param event + // * observation event + // * @return true if the event should be excluded, + // * false otherwise + // */ + // protected boolean isExcluded(ItemState event) { + // + // for (QPath excludedPath : excludedPaths) { + // if (event.getData().getQPath().isDescendantOf(excludedPath) + // || event.getData().getQPath().equals(excludedPath)) + // return true; + // } + // + // return !event.getData().getQPath().isDescendantOf(indexingRoot) + // && !event.getData().getQPath().equals(indexingRoot); + // } + + protected QueryHandlerContext createQueryHandlerContext(QueryHandler pa= rentHandler) + throws RepositoryConfigurationException + { + + QueryHandlerContext context =3D + new QueryHandlerContext(itemMgr, indexingTree, nodeTypeDataManage= r, nsReg, parentHandler, getIndexDir(), + extractor, true, virtualTableResolver); + return context; + } + + protected String getIndexDir() throws RepositoryConfigurationException + { + String dir =3D config.getParameterValue(QueryHandlerParams.PARAM_IND= EX_DIR, null); + if (dir =3D=3D null) + { + log.warn(QueryHandlerParams.PARAM_INDEX_DIR + " parameter not fou= nd. Using outdated parameter name " + + QueryHandlerParams.OLD_PARAM_INDEX_DIR); + dir =3D config.getParameterValue(QueryHandlerParams.OLD_PARAM_IND= EX_DIR); + } + return dir; + } + + /** + * Initializes the query handler. + * = + * @throws RepositoryException + * if the query handler cannot be initialized. + * @throws RepositoryConfigurationException + * @throws ClassNotFoundException + */ + protected void initializeQueryHandler() throws RepositoryException, Rep= ositoryConfigurationException + { + // initialize query handler + String className =3D config.getType(); + if (className =3D=3D null) + throw new RepositoryConfigurationException("Content hanler = configuration fail"); + + try + { + Class qHandlerClass =3D Class.forName(className, true, this.getCl= ass().getClassLoader()); + Constructor constuctor =3D qHandlerClass.getConstructor(QueryHand= lerEntry.class, ConfigurationManager.class); + handler =3D (QueryHandler)constuctor.newInstance(config, cfm); + QueryHandler parentHandler =3D (this.parentSearchManager !=3D nul= l) ? parentSearchManager.getHandler() : null; + QueryHandlerContext context =3D createQueryHandlerContext(parentH= andler); + handler.init(context); + + } + catch (SecurityException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IllegalArgumentException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (ClassNotFoundException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (NoSuchMethodException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (InstantiationException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IllegalAccessException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (InvocationTargetException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + throw new RepositoryException(e.getMessage(), e); + } + } + + /** + * Creates a new instance of an {@link AbstractQueryImpl} which is not + * initialized. + * = + * @return an new query instance. + * @throws RepositoryException + * if an error occurs while creating a new query instance. + */ + protected AbstractQueryImpl createQueryInstance() throws RepositoryExce= ption + { + try + { + String queryImplClassName =3D handler.getQueryClass(); + Object obj =3D Class.forName(queryImplClassName).newInstance(); + if (obj instanceof AbstractQueryImpl) + { + return (AbstractQueryImpl)obj; + } + else + { + throw new IllegalArgumentException(queryImplClassName + " is n= ot of type " + + AbstractQueryImpl.class.getName()); + } + } + catch (Throwable t) + { + throw new RepositoryException("Unable to create query: " + t.toSt= ring(), t); + } + } + + /** + * {@inheritDoc} + */ + public Set getFieldNames() throws IndexException + { + final Set fildsSet =3D new HashSet(); + if (handler instanceof SearchIndex) + { + IndexReader reader =3D null; + try + { + reader =3D ((SearchIndex)handler).getIndexReader(); + final Collection fields =3D reader.getFieldNames(IndexReader.F= ieldOption.ALL); + for (final Object field : fields) + { + fildsSet.add((String)field); + } + } + catch (IOException e) + { + throw new IndexException(e.getLocalizedMessage(), e); + } + finally + { + try + { + if (reader !=3D null) + reader.close(); + } + catch (IOException e) + { + throw new IndexException(e.getLocalizedMessage(), e); + } + } + + } + return fildsSet; + } + + public Set getNodesByNodeType(final InternalQName nodeType) thr= ows RepositoryException + { + + return getNodes(virtualTableResolver.resolve(nodeType, true)); + } + + /** + * Return set of uuid of nodes. Contains in names prefixes maped to the + * given uri + * = + * @param prefix + * @return + * @throws RepositoryException + */ + public Set getNodesByUri(final String uri) throws RepositoryExc= eption + { + Set result; + final int defaultClauseCount =3D BooleanQuery.getMaxClauseCount(); + try + { + + // final LocationFactory locationFactory =3D new + // LocationFactory(this); + final ValueFactoryImpl valueFactory =3D new ValueFactoryImpl(new = LocationFactory(nsReg)); + BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE); + BooleanQuery query =3D new BooleanQuery(); + + final String prefix =3D nsReg.getNamespacePrefixByURI(uri); + query.add(new WildcardQuery(new Term(FieldNames.LABEL, prefix + "= :*")), Occur.SHOULD); + // name of the property + query.add(new WildcardQuery(new Term(FieldNames.PROPERTIES_SET, p= refix + ":*")), Occur.SHOULD); + + result =3D getNodes(query); + + // value of the property + + try + { + final Set props =3D getFieldNames(); + + query =3D new BooleanQuery(); + for (final String fieldName : props) + { + if (!FieldNames.PROPERTIES_SET.equals(fieldName)) + { + query.add(new WildcardQuery(new Term(fieldName, "*" + pr= efix + ":*")), Occur.SHOULD); + } + } + } + catch (final IndexException e) + { + throw new RepositoryException(e.getLocalizedMessage(), e); + } + + final Set propSet =3D getNodes(query); + // Manually check property values; + for (final String uuid : propSet) + { + if (isPrefixMatch(valueFactory, uuid, prefix)) + { + result.add(uuid); + } + } + } + finally + { + BooleanQuery.setMaxClauseCount(defaultClauseCount); + } + + return result; + } + + private boolean isPrefixMatch(final InternalQName value, final String p= refix) throws RepositoryException + { + return value.getNamespace().equals(nsReg.getNamespaceURIByPrefix(pre= fix)); + } + + private boolean isPrefixMatch(final QPath value, final String prefix) t= hrows RepositoryException + { + for (int i =3D 0; i < value.getEntries().length; i++) + { + if (isPrefixMatch(value.getEntries()[i], prefix)) + { + return true; + } + } + return false; + } + + /** + * @param valueFactory + * @param dm + * @param uuid + * @param prefix + * @throws RepositoryException + */ + private boolean isPrefixMatch(final ValueFactoryImpl valueFactory, fina= l String uuid, final String prefix) + throws RepositoryException + { + + final ItemData node =3D itemMgr.getItemData(uuid); + if (node !=3D null && node.isNode()) + { + final List props =3D itemMgr.getChildPropertiesData= ((NodeData)node); + for (final PropertyData propertyData : props) + { + if (propertyData.getType() =3D=3D PropertyType.PATH || propert= yData.getType() =3D=3D PropertyType.NAME) + { + for (final ValueData vdata : propertyData.getValues()) + { + final Value val =3D + valueFactory.loadValue(((AbstractValueData)vdata).cre= ateTransientCopy(), propertyData.getType()); + if (propertyData.getType() =3D=3D PropertyType.PATH) + { + if (isPrefixMatch(((PathValue)val).getQPath(), prefix= )) + { + return true; + } + } + else if (propertyData.getType() =3D=3D PropertyType.NAME) + { + if (isPrefixMatch(((NameValue)val).getQName(), prefix= )) + { + return true; + } + } + } + } + } + } + return false; + } + + /** + * @param query + * @return + * @throws RepositoryException + */ + private Set getNodes(final org.apache.lucene.search.Query query= ) throws RepositoryException + { + Set result =3D new HashSet(); + try + { + QueryHits hits =3D handler.executeQuery(query); + + ScoreNode sn; + + while ((sn =3D hits.nextScoreNode()) !=3D null) + { + // Node node =3D session.getNodeById(sn.getNodeId()); + result.add(sn.getNodeId()); + } + } + catch (IOException e) + { + throw new RepositoryException(e.getLocalizedMessage(), e); + } + return result; + } + +} Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SystemSearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-06 16:16:58 UTC= (rev 492) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-06 16:18:11 UTC= (rev 493) @@ -42,7 +42,7 @@ * @version $Id: SystemSearchManager.java 13891 2008-05-05 16:02:30Z pnedo= nosko * $ */ -public class SystemSearchManager extends SearchManager +public class SystemSearchManager extends SearchManagerImpl { = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-06 1= 6:16:58 UTC (rev 492) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-06 1= 6:18:11 UTC (rev 493) @@ -16,12 +16,76 @@ */ package org.exoplatform.services.jcr.impl.core.query.cacheloader; = +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.WildcardQuery; +import org.apache.lucene.search.BooleanClause.Occur; +import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.services.document.DocumentReaderService; +import org.exoplatform.services.jcr.config.QueryHandlerEntry; +import org.exoplatform.services.jcr.config.QueryHandlerParams; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.ValueData; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; +import org.exoplatform.services.jcr.impl.core.SessionDataManager; +import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.query.AbstractQueryImpl; +import org.exoplatform.services.jcr.impl.core.query.IndexException; +import org.exoplatform.services.jcr.impl.core.query.IndexingTree; +import org.exoplatform.services.jcr.impl.core.query.QueryHandler; +import org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext; +import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; +import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; +import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; +import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; +import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; +import org.exoplatform.services.jcr.impl.core.query.lucene.ScoreNode; +import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; +import org.exoplatform.services.jcr.impl.core.value.NameValue; +import org.exoplatform.services.jcr.impl.core.value.PathValue; +import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; +import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; import org.jboss.cache.CacheException; +import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.StringTokenizer; = +import javax.jcr.Node; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.jcr.Value; +import javax.jcr.query.InvalidQueryException; +import javax.jcr.query.Query; + /** * Created by The eXo Platform SAS. * = @@ -30,43 +94,886 @@ * @author Karpenko Sergiy = * @version $Id: CacheIndexer.java 111 2008-11-11 11:11:11Z serg $ */ -public class IndexerCacheLoader extends AbstractWriteOnlyCacheLoader +public class IndexerCacheLoader extends AbstractWriteOnlyCacheLoader imple= ments SearchManager { + /** + * Logger instance for this class + */ + private static final Log log =3D ExoLogger.getLogger(IndexerCacheLoader= .class); = + protected QueryHandlerEntry config; + + /** + * Text extractor for extracting text content of binary properties. + */ + protected DocumentReaderService extractor; + + /** + * QueryHandler where query execution is delegated to + */ + protected QueryHandler handler; + + /** + * The shared item state manager instance for the workspace. + */ + protected ItemDataConsumer itemMgr; + + /** + * The namespace registry of the repository. + */ + protected NamespaceRegistryImpl nsReg; + + /** + * The node type registry. + */ + protected NodeTypeDataManager nodeTypeDataManager; + + /** + * QueryHandler of the parent search manager or null if th= ere + * is none. + */ + protected SearchManager parentSearchManager; + + // protected QPath indexingRoot; + // + // protected List excludedPaths =3D new ArrayList(); + + protected IndexingTree indexingTree; + + private ConfigurationManager cfm; + + protected LuceneVirtualTableResolver virtualTableResolver; + + public IndexerCacheLoader() + { + int i =3D 0; + i++; + } + + /** + * Creates a new SearchManager. + * = + * @param config + * the search configuration. + * @param nsReg + * the namespace registry. + * @param ntReg + * the node type registry. + * @param itemMgr + * the shared item state manager. + * @param rootNodeId + * the id of the root node. + * @param parentMgr + * the parent search manager or null if there i= s no + * parent search manager. + * @param excludedNodeId + * id of the node that should be excluded from indexing. Any + * descendant of that node will also be excluded from indexi= ng. + * @throws RepositoryException + * if the search manager cannot be initialized + * @throws RepositoryConfigurationException + */ + public IndexerCacheLoader(QueryHandlerEntry config, NamespaceRegistryIm= pl nsReg, NodeTypeDataManager ntReg, + WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, + DocumentReaderService extractor, ConfigurationManager cfm, final Rep= ositoryIndexSearcherHolder indexSearcherHolder) + throws RepositoryException, RepositoryConfigurationException + { + + this.extractor =3D extractor; + indexSearcherHolder.addIndexSearcher(this); + this.config =3D config; + this.nodeTypeDataManager =3D ntReg; + this.nsReg =3D nsReg; + this.itemMgr =3D itemMgr; + this.cfm =3D cfm; + this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); + this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; + } + + private String parseUUID(Fqn fqn) + { + // TODO check is zero element not ROOT = + // get just uuid + Fqn uuid =3D (Fqn)fqn.get(1); + //remove slash + return uuid.toString().substring(1); + } + + private boolean isNode(Fqn fqn) + { + Fqn items =3D (Fqn)fqn.get(0); + String s =3D items.toString(); + //TODO check Constants + return s.equals("/$NODES"); + } + @Override public void put(List modifications) throws Exception { + if (handler =3D=3D null) + return; + + long time =3D System.currentTimeMillis(); + + // nodes that need to be removed from the index. + final Set removedNodes =3D new HashSet(); + // nodes that need to be added to the index. + final Set addedNodes =3D new HashSet(); + final Map> updatedNodes =3D new HashMap>(); + for (Modification m : modifications) { + + String uuid =3D parseUUID(m.getFqn()); + switch (m.getType()) { case PUT_DATA : - put(m.getFqn(), m.getData()); + // add node + // TODO do we need there update for property? + // if this is property ignore = + if (isNode(m.getFqn())) + { + addedNodes.add(uuid); + } + break; case PUT_DATA_ERASE : - removeData(m.getFqn()); - put(m.getFqn(), m.getData()); + // must be never called + // update node + if (isNode(m.getFqn())) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } break; case PUT_KEY_VALUE : - put(m.getFqn(), m.getKey(), m.getValue()); + // must be never called + // update node + if (isNode(m.getFqn())) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } break; case REMOVE_DATA : - removeData(m.getFqn()); + // must be never called + // update node + if (isNode(m.getFqn())) + { + addedNodes.add(uuid); + removedNodes.add(uuid); + } break; case REMOVE_KEY_VALUE : - remove(m.getFqn(), m.getKey()); + // must be never called + // removed property what to do + if (isNode(m.getFqn())) + { + addedNodes.add(uuid); + removedNodes.add(uuid); + } break; case REMOVE_NODE : - remove(m.getFqn()); + // if node - remove it, otherwise ignore it + if (isNode(m.getFqn())) + { + removedNodes.add(uuid); + } + break; case MOVE : // involve moving all children too move(m.getFqn(), m.getFqn2()); + if (isNode(m.getFqn())) + { + //remove first + removedNodes.add(parseUUID(m.getFqn())); + //add second + addedNodes.add(parseUUID(m.getFqn2())); + } + else + { + // must be never happen + // TODO update both nodes + } + break; default : throw new CacheException("Unknown modification " + m.getTyp= e()); } } + + // for (Iterator iter =3D changesLog.getAllStates().= iterator(); iter.hasNext();) + // { + // ItemState itemState =3D iter.next(); + // + // if (!indexingTree.isExcluded(itemState)) + // { + // String uuid =3D + // itemState.isNode() ? itemState.getData().getIdentif= ier() : itemState.getData().getParentIdentifier(); + // + // if (itemState.isAdded()) + // { + // if (itemState.isNode()) + // { + // addedNodes.add(uuid); + // } + // else + // { + // if (!addedNodes.contains(uuid)) + // { + // createNewOrAdd(uuid, itemState, updatedNodes); + // } + // } + // } + // else if (itemState.isRenamed()) + // { + // if (itemState.isNode()) + // { + // addedNodes.add(uuid); + // } + // else + // { + // createNewOrAdd(uuid, itemState, updatedNodes); + // } + // } + // else if (itemState.isUpdated()) + // { + // createNewOrAdd(uuid, itemState, updatedNodes); + // } + // else if (itemState.isMixinChanged()) + // { + // createNewOrAdd(uuid, itemState, updatedNodes); + // } + // else if (itemState.isDeleted()) + // { + // if (itemState.isNode()) + // { + // if (addedNodes.contains(uuid)) + // { + // addedNodes.remove(uuid); + // removedNodes.remove(uuid); + // } + // else + // { + // removedNodes.add(uuid); + // } + // // remove all changes after node remove + // updatedNodes.remove(uuid); + // } + // else + // { + // if (!removedNodes.contains(uuid) && !addedNodes.= contains(uuid)) + // { + // createNewOrAdd(uuid, itemState, updatedNodes); + // } + // } + // } + // } + // } + + // TODO make quick changes + for (String uuid : updatedNodes.keySet()) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } + + Iterator addedStates =3D new Iterator() + { + private final Iterator iter =3D addedNodes.iterator(); + + public boolean hasNext() + { + return iter.hasNext(); + } + + public NodeData next() + { + + // cycle till find a next or meet the end of set + do + { + String id =3D iter.next(); + try + { + ItemData item =3D itemMgr.getItemData(id); + if (item !=3D null) + { + if (item.isNode()) + return (NodeData)item; // return node + else + log.warn("Node not found, but property " + id + ",= " + item.getQPath().getAsString() + + " found. "); + } + else + log.warn("Unable to index node with id " + id + ", no= de does not exist."); + + } + catch (RepositoryException e) + { + log.error("Can't read next node data " + id, e); + } + } + while (iter.hasNext()); // get next if error or node not found + + return null; // we met the end of iterator set + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + }; + + Iterator removedIds =3D new Iterator() + { + private final Iterator iter =3D removedNodes.iterator(); + + public boolean hasNext() + { + return iter.hasNext(); + } + + public String next() + { + return nextNodeId(); + } + + public String nextNodeId() throws NoSuchElementException + { + return iter.next(); + } + + public void remove() + { + throw new UnsupportedOperationException(); + + } + }; + + if (removedNodes.size() > 0 || addedNodes.size() > 0) + { + try + { + handler.updateNodes(removedIds, addedStates); + } + catch (RepositoryException e) + { + log.error("Error indexing changes " + e, e); + } + catch (IOException e) + { + log.error("Error indexing changes " + e, e); + try + { + handler.logErrorChanges(removedNodes, addedNodes); + } + catch (IOException ioe) + { + log.warn("Exception occure when errorLog writed. Error log = is not complete. " + ioe, ioe); + } + } + } + + if (log.isDebugEnabled()) + { + log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); + } + } = + /** + * Creates a query object from a node that can be executed on the works= pace. + * = + * @param session + * the session of the user executing the query. + * @param itemMgr + * the item manager of the user executing the query. Needed = to + * return Node instances in the result set. + * @param node + * a node of type nt:query. + * @return a Query instance to execute. + * @throws InvalidQueryException + * if absPath is not a valid persisted query (= that + * is, a node of type nt:query) + * @throws RepositoryException + * if any other error occurs. + */ + public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, Node node) + throws InvalidQueryException, RepositoryException + { + AbstractQueryImpl query =3D createQueryInstance(); + query.init(session, sessionDataManager, handler, node); + return query; + } + + /** + * Creates a query object that can be executed on the workspace. + * = + * @param session + * the session of the user executing the query. + * @param itemMgr + * the item manager of the user executing the query. Needed = to + * return Node instances in the result set. + * @param statement + * the actual query statement. + * @param language + * the syntax of the query statement. + * @return a Query instance to execute. + * @throws InvalidQueryException + * if the query is malformed or the language is + * unknown. + * @throws RepositoryException + * if any other error occurs. + */ + public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, String statement, + String language) throws InvalidQueryException, RepositoryException + { + AbstractQueryImpl query =3D createQueryInstance(); + query.init(session, sessionDataManager, handler, statement, language= ); + return query; + } + + /** + * just for test use only + */ + public QueryHandler getHandler() + { + return handler; + } + + public void createNewOrAdd(String key, ItemState state, Map> updatedNodes) + { + List list =3D updatedNodes.get(key); + if (list =3D=3D null) + { + list =3D new ArrayList(); + updatedNodes.put(key, list); + } + list.add(state); + + } + + public void start() + { + + if (log.isDebugEnabled()) + log.debug("start"); + try + { + if (indexingTree =3D=3D null) + { + List excludedPath =3D new ArrayList(); + // Calculating excluded node identifiers + excludedPath.add(Constants.JCR_SYSTEM_PATH); + + //if (config.getExcludedNodeIdentifers() !=3D null) + String excludedNodeIdentifer =3D + config.getParameterValue(QueryHandlerParams.PARAM_EXCLUDED_= NODE_IDENTIFERS, null); + if (excludedNodeIdentifer !=3D null) + { + StringTokenizer stringTokenizer =3D new StringTokenizer(exc= ludedNodeIdentifer); + while (stringTokenizer.hasMoreTokens()) + { + + try + { + ItemData excludeData =3D itemMgr.getItemData(stringTo= kenizer.nextToken()); + if (excludeData !=3D null) + excludedPath.add(excludeData.getQPath()); + } + catch (RepositoryException e) + { + log.warn(e.getLocalizedMessage()); + } + } + } + + NodeData indexingRootData =3D null; + String rootNodeIdentifer =3D config.getParameterValue(QueryHan= dlerParams.PARAM_ROOT_NODE_ID, null); + if (rootNodeIdentifer !=3D null) + { + try + { + ItemData indexingRootDataItem =3D itemMgr.getItemData(ro= otNodeIdentifer); + if (indexingRootDataItem !=3D null && indexingRootDataIt= em.isNode()) + indexingRootData =3D (NodeData)indexingRootDataItem; + } + catch (RepositoryException e) + { + log.warn(e.getLocalizedMessage() + " Indexing root set t= o " + Constants.ROOT_PATH.getAsString()); + + } + + } + else + { + try + { + indexingRootData =3D (NodeData)itemMgr.getItemData(Const= ants.ROOT_UUID); + } + catch (RepositoryException e) + { + log.error("Fail to load root node data"); + } + } + + indexingTree =3D new IndexingTree(indexingRootData, excludedPa= th); + } + + initializeQueryHandler(); + } + catch (RepositoryException e) + { + log.error(e.getLocalizedMessage()); + handler =3D null; + throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); + } + catch (RepositoryConfigurationException e) + { + log.error(e.getLocalizedMessage()); + handler =3D null; + throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); + } + } + + public void stop() + { + handler.close(); + log.info("Search manager stopped"); + } + + // /** + // * Checks if the given event should be excluded based on the + // * {@link #excludePath} setting. + // * + // * @param event + // * observation event + // * @return true if the event should be excluded, + // * false otherwise + // */ + // protected boolean isExcluded(ItemState event) { + // + // for (QPath excludedPath : excludedPaths) { + // if (event.getData().getQPath().isDescendantOf(excludedPath) + // || event.getData().getQPath().equals(excludedPath)) + // return true; + // } + // + // return !event.getData().getQPath().isDescendantOf(indexingRoot) + // && !event.getData().getQPath().equals(indexingRoot); + // } + + protected QueryHandlerContext createQueryHandlerContext(QueryHandler pa= rentHandler) + throws RepositoryConfigurationException + { + + QueryHandlerContext context =3D + new QueryHandlerContext(itemMgr, indexingTree, nodeTypeDataManage= r, nsReg, parentHandler, getIndexDir(), + extractor, true, virtualTableResolver); + return context; + } + + protected String getIndexDir() throws RepositoryConfigurationException + { + String dir =3D config.getParameterValue(QueryHandlerParams.PARAM_IND= EX_DIR, null); + if (dir =3D=3D null) + { + log.warn(QueryHandlerParams.PARAM_INDEX_DIR + " parameter not fou= nd. Using outdated parameter name " + + QueryHandlerParams.OLD_PARAM_INDEX_DIR); + dir =3D config.getParameterValue(QueryHandlerParams.OLD_PARAM_IND= EX_DIR); + } + return dir; + } + + /** + * Initializes the query handler. + * = + * @throws RepositoryException + * if the query handler cannot be initialized. + * @throws RepositoryConfigurationException + * @throws ClassNotFoundException + */ + protected void initializeQueryHandler() throws RepositoryException, Rep= ositoryConfigurationException + { + // initialize query handler + String className =3D config.getType(); + if (className =3D=3D null) + throw new RepositoryConfigurationException("Content hanler = configuration fail"); + + try + { + Class qHandlerClass =3D Class.forName(className, true, this.getCl= ass().getClassLoader()); + Constructor constuctor =3D qHandlerClass.getConstructor(QueryHand= lerEntry.class, ConfigurationManager.class); + handler =3D (QueryHandler)constuctor.newInstance(config, cfm); + QueryHandler parentHandler =3D (this.parentSearchManager !=3D nul= l) ? parentSearchManager.getHandler() : null; + QueryHandlerContext context =3D createQueryHandlerContext(parentH= andler); + handler.init(context); + + } + catch (SecurityException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IllegalArgumentException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (ClassNotFoundException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (NoSuchMethodException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (InstantiationException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IllegalAccessException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (InvocationTargetException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + throw new RepositoryException(e.getMessage(), e); + } + } + + /** + * Creates a new instance of an {@link AbstractQueryImpl} which is not + * initialized. + * = + * @return an new query instance. + * @throws RepositoryException + * if an error occurs while creating a new query instance. + */ + protected AbstractQueryImpl createQueryInstance() throws RepositoryExce= ption + { + try + { + String queryImplClassName =3D handler.getQueryClass(); + Object obj =3D Class.forName(queryImplClassName).newInstance(); + if (obj instanceof AbstractQueryImpl) + { + return (AbstractQueryImpl)obj; + } + else + { + throw new IllegalArgumentException(queryImplClassName + " is n= ot of type " + + AbstractQueryImpl.class.getName()); + } + } + catch (Throwable t) + { + throw new RepositoryException("Unable to create query: " + t.toSt= ring(), t); + } + } + + /** + * {@inheritDoc} + */ + public Set getFieldNames() throws IndexException + { + final Set fildsSet =3D new HashSet(); + if (handler instanceof SearchIndex) + { + IndexReader reader =3D null; + try + { + reader =3D ((SearchIndex)handler).getIndexReader(); + final Collection fields =3D reader.getFieldNames(IndexReader.F= ieldOption.ALL); + for (final Object field : fields) + { + fildsSet.add((String)field); + } + } + catch (IOException e) + { + throw new IndexException(e.getLocalizedMessage(), e); + } + finally + { + try + { + if (reader !=3D null) + reader.close(); + } + catch (IOException e) + { + throw new IndexException(e.getLocalizedMessage(), e); + } + } + + } + return fildsSet; + } + + public Set getNodesByNodeType(final InternalQName nodeType) thr= ows RepositoryException + { + + return getNodes(virtualTableResolver.resolve(nodeType, true)); + } + + /** + * Return set of uuid of nodes. Contains in names prefixes maped to the + * given uri + * = + * @param prefix + * @return + * @throws RepositoryException + */ + public Set getNodesByUri(final String uri) throws RepositoryExc= eption + { + Set result; + final int defaultClauseCount =3D BooleanQuery.getMaxClauseCount(); + try + { + + // final LocationFactory locationFactory =3D new + // LocationFactory(this); + final ValueFactoryImpl valueFactory =3D new ValueFactoryImpl(new = LocationFactory(nsReg)); + BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE); + BooleanQuery query =3D new BooleanQuery(); + + final String prefix =3D nsReg.getNamespacePrefixByURI(uri); + query.add(new WildcardQuery(new Term(FieldNames.LABEL, prefix + "= :*")), Occur.SHOULD); + // name of the property + query.add(new WildcardQuery(new Term(FieldNames.PROPERTIES_SET, p= refix + ":*")), Occur.SHOULD); + + result =3D getNodes(query); + + // value of the property + + try + { + final Set props =3D getFieldNames(); + + query =3D new BooleanQuery(); + for (final String fieldName : props) + { + if (!FieldNames.PROPERTIES_SET.equals(fieldName)) + { + query.add(new WildcardQuery(new Term(fieldName, "*" + pr= efix + ":*")), Occur.SHOULD); + } + } + } + catch (final IndexException e) + { + throw new RepositoryException(e.getLocalizedMessage(), e); + } + + final Set propSet =3D getNodes(query); + // Manually check property values; + for (final String uuid : propSet) + { + if (isPrefixMatch(valueFactory, uuid, prefix)) + { + result.add(uuid); + } + } + } + finally + { + BooleanQuery.setMaxClauseCount(defaultClauseCount); + } + + return result; + } + + private boolean isPrefixMatch(final InternalQName value, final String p= refix) throws RepositoryException + { + return value.getNamespace().equals(nsReg.getNamespaceURIByPrefix(pre= fix)); + } + + private boolean isPrefixMatch(final QPath value, final String prefix) t= hrows RepositoryException + { + for (int i =3D 0; i < value.getEntries().length; i++) + { + if (isPrefixMatch(value.getEntries()[i], prefix)) + { + return true; + } + } + return false; + } + + /** + * @param valueFactory + * @param dm + * @param uuid + * @param prefix + * @throws RepositoryException + */ + private boolean isPrefixMatch(final ValueFactoryImpl valueFactory, fina= l String uuid, final String prefix) + throws RepositoryException + { + + final ItemData node =3D itemMgr.getItemData(uuid); + if (node !=3D null && node.isNode()) + { + final List props =3D itemMgr.getChildPropertiesData= ((NodeData)node); + for (final PropertyData propertyData : props) + { + if (propertyData.getType() =3D=3D PropertyType.PATH || propert= yData.getType() =3D=3D PropertyType.NAME) + { + for (final ValueData vdata : propertyData.getValues()) + { + final Value val =3D + valueFactory.loadValue(((AbstractValueData)vdata).cre= ateTransientCopy(), propertyData.getType()); + if (propertyData.getType() =3D=3D PropertyType.PATH) + { + if (isPrefixMatch(((PathValue)val).getQPath(), prefix= )) + { + return true; + } + } + else if (propertyData.getType() =3D=3D PropertyType.NAME) + { + if (isPrefixMatch(((NameValue)val).getQName(), prefix= )) + { + return true; + } + } + } + } + } + } + return false; + } + + /** + * @param query + * @return + * @throws RepositoryException + */ + private Set getNodes(final org.apache.lucene.search.Query query= ) throws RepositoryException + { + Set result =3D new HashSet(); + try + { + QueryHits hits =3D handler.executeQuery(query); + + ScoreNode sn; + + while ((sn =3D hits.nextScoreNode()) !=3D null) + { + // Node node =3D session.getNodeById(sn.getNodeId()); + result.add(sn.getNodeId()); + } + } + catch (IOException e) + { + throw new RepositoryException(e.getLocalizedMessage(), e); + } + return result; + } + } --===============6813118167373235375==-- From do-not-reply at jboss.org Fri Nov 6 11:41:21 2009 Content-Type: multipart/mixed; boundary="===============5132847925636332667==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r494 - in jcr/branches/1.12.0-JBC/component/core: src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Fri, 06 Nov 2009 11:41:21 -0500 Message-ID: <200911061641.nA6GfLli004688@svn01.web.mwc.hst.phx2.redhat.com> --===============5132847925636332667== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-06 11:41:20 -0500 (Fri, 06 Nov 2009) New Revision: 494 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml Log: EXOJCR-200: new impl tests = Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-06 16:18:11 UTC = (rev 493) +++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-06 16:41:20 UTC = (rev 494) @@ -571,7 +571,7 @@ **/**/JBossCacheServiceTest__.java **/**/TestItem__.java = - **/**/JBossCacheTreeStorageConnectionTest= .java + **/**/JBossCacheStorageConnectionTest.jav= a Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-06 16:41:20 UTC (rev 494) @@ -0,0 +1,668 @@ +/* + * 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. + */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.jboss.cache.Cache; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; + +import java.io.Serializable; +import java.util.List; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 25.10.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class JBossCacheStorageConnectionTest extends TestCase +{ + + protected JBossCacheStorageConnection conn; + + protected Cache cache; + + protected Node nodes; + + protected Node props; + + protected String jbcConfig; + + /** + * {@inheritDoc} + */ + protected void setUp() throws Exception + { + super.setUp(); + + // JBossCache = + initJBCConfig(); + + cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); + + Node cacheRoot =3D cache.getRoot(); + + // prepare cache structures + nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); + props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); + + // run cache + cache.create(); + cache.start(); + + // JCR connection + conn =3D new JBossCacheStorageConnection(cache, nodes, props); + } + + protected void initJBCConfig() + { + jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; + } + + /** + * {@inheritDoc} + */ + protected void tearDown() throws Exception + { + + cache.stop(); + cache.destroy(); + + super.tearDown(); + } + + private void treePrint(Node node) + { + for (Node child : node.getChildren()) + { + System.out.println(child.toString()); + for (Serializable key : child.getKeys()) + { + System.out.println("\t" + key + "=3D" + child.get(key)); + } + if (!child.isLeaf()) + { + treePrint(child); + } + } + } + + public void testAddNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check in nodes + treePrint(nodes); + + // get root node ([]:1) + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + assertNotNull("Node expected", rootNode); + + // check root Node + Object dataObject =3D rootNode.get(JBossCacheStorageConnection.ITEM_= DATA); + assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); + + NodeData data =3D (NodeData)dataObject; + assertEquals("Node id wrong", node1id, data.getIdentifier()); + assertEquals("Node path wrong", node1path, data.getQPath()); + + // cehck childs + assertEquals("Childs expected", 2, rootNode.getChildren().size()); + + for (Node child : rootNode.getChildren()) + { + // check id and name + String nodeName =3D child.getFqn().getLastElementAsString(); + String nodeId =3D (String)child.get(JBossCacheStorageConnection.I= TEM_ID); + if (nodeName.equals(node1path.getEntries()[node1path.getEntries()= .length - 1].getAsString(true))) + { + assertEquals("Node id wrong", node1id, nodeId); + } + else if (nodeName + .equals(Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_S= YSTEM_PATH.getEntries().length - 1] + .getAsString(true))) + { + assertEquals("Node id wrong", Constants.SYSTEM_UUID, nodeId); + } + else + { + fail("Wrong Node name " + nodeName); + } + + // check data + Node childNode =3D nodes.getChild(Fqn.fromE= lements(nodeId)); + assertNotNull("Node expected", childNode); + + Object childData =3D childNode.get(JBossCacheStorageConnection.IT= EM_DATA); + assertTrue("Child Node item data is not a Node", childData instan= ceof NodeData); + + assertEquals("Node id wrong", nodeId, ((NodeData)childData).getId= entifier()); + assertEquals("Node path wrong", nodeName, + data.getQPath().getEntries()[data.getQPath().getEntries().leng= th - 1].getAsString(true)); + } + } + + public void testAddProperty() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValue1 =3D "Property value #1"; + propData1.setValue(new TransientValueData(propValue1)); + conn.add(propData1); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); + TransientPropertyData propData2 =3D new TransientPropertyData(propPa= th2, propId2, 1, 1, Constants.ROOT_UUID, false); + String propValue2 =3D "Property value #2"; + propData2.setValue(new TransientValueData(propValue2)); + conn.add(propData2); + + // check in nodes + treePrint(nodes); + treePrint(props); + + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + + assertEquals("Attributes ammount wrong", 3, rootNode.getKeys().size(= )); + + String pid1 =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAs= String()); + assertNotNull("Property ID should exists", pid1); + assertEquals("Property ID wrong", propId1, pid1); + + String pid2 =3D (String)rootNode.get(Constants.JCR_MIXINTYPES.getAsS= tring()); + assertNotNull("Property ID should exists", pid2); + assertEquals("Property ID wrong", propId2, pid2); + + // TODO check order + int index =3D 0; + for (Serializable key : rootNode.getKeys()) + { + //System.out.println(key); + //index++; + } + + // check in props + treePrint(nodes); + + Node itemsProp1 =3D props.getChild(Fqn.fromEle= ments(propId1)); + Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); + assertNotNull("Property item data should exists", data1Object); + assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); + + PropertyData data1 =3D (PropertyData)data1Object; + assertEquals("Property id wrong", propId1, data1.getIdentifier()); + assertEquals("Property path wrong", propPath1, data1.getQPath()); + assertEquals("Property Value wrong", propValue1, new String(data1.ge= tValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + + Node itemsProp2 =3D props.getChild(Fqn.fromEle= ments(propId2)); + Object data2Object =3D itemsProp2.get(JBossCacheStorageConnection.IT= EM_DATA); + assertNotNull("Property item data should exists", data2Object); + assertTrue("Property item data is not a Property", data2Object insta= nceof PropertyData); + + PropertyData data2 =3D (PropertyData)data2Object; + assertEquals("Property id wrong", propId2, data2.getIdentifier()); + assertEquals("Property path wrong", propPath2, data2.getQPath()); + assertEquals("Property Value wrong", propValue2, new String(data2.ge= tValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + } + + public void testDeleteNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // get root node ([]:1) + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + + assertEquals("Number of childs wrong", 2, rootNode.getChildren().siz= e()); + + // delete /node + conn.delete(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // check in nodes + treePrint(nodes); + + // check childs + assertEquals("Childs expected", 1, rootNode.getChildren().size()); + + assertNull("Child Node should be deleted", rootNode.getChild(Fqn.fro= mElements(node1path.getEntries()[node1path + .getEntries().length - 1].getAsString(true)))); + + assertNotNull("Child Node should be not deleted", rootNode.getChild(= Fqn.fromElements(Constants.JCR_SYSTEM_PATH + .getEntries()[Constants.JCR_SYSTEM_PATH.getEntries().length - 1].= getAsString(true)))); + + // to be sure ;) + Node child =3D rootNode.getChildren().iterator= ().next(); + assertEquals("Node name wrong", + Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_SYSTEM_PATH.= getEntries().length - 1].getAsString(true), + child.getFqn().getLastElementAsString()); + + assertEquals("Node id wrong", Constants.SYSTEM_UUID, (String)child.g= et(JBossCacheStorageConnection.ITEM_ID)); + + // check nodes = + assertNull("Node item data should not exists", nodes.getChild(Fqn.fr= omElements(node1id))); + + Node system =3D nodes.getChild(Fqn.fromElement= s(Constants.SYSTEM_UUID)); + assertNotNull("Node item data should exists", system); + } + + public void testDeleteProperty() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, + 1, 1, Constants.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, + 1, 1, Constants.ROOT_UUID, false)); + + // get root node ([]:1) + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + + // delete /jcr:primaryType + conn.delete(new TransientPropertyData(QPath.makeChildPath(Constants.= ROOT_PATH, Constants.JCR_PRIMARYTYPE), + propId1, 1, 1, Constants.ROOT_UUID, false)); + + // check in nodes + treePrint(nodes); + + assertEquals("Number of childs wrong", 2, rootNode.getKeys().size()); + assertNull("Property should be deleted", rootNode.get(Constants.JCR_= PRIMARYTYPE.getAsString())); + assertNotNull("Property should exists", rootNode.get(Constants.JCR_M= IXINTYPES.getAsString())); + + // check in props + treePrint(props); + + assertNull("Property item data should not exists", props.getChild(Fq= n.fromElements(propId1))); + assertNotNull("Property item data should exists", props.getChild(Fqn= .fromElements(propId2))); + } + + public void testUpdateNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // get root node ([]:1) + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + + // update /node (order number) + int nodeOrderNumb =3D 1; + conn.update(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], + nodeOrderNumb, Constants.ROOT_UUID, new AccessControlList())); + + // check in tree + treePrint(nodes); + + Node node =3D + rootNode.getChild(Fqn + .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); + + assertNotNull("Node should exists", node); + assertEquals("Child expected", 1, rootNode.getChildren().size()); + + // check in items + treePrint(nodes); + + Node itemNode =3D nodes.getChild(Fqn.fromEleme= nts(node1id)); + assertNotNull("Node item data should exists", itemNode); + + Object dataObject =3D itemNode.get(JBossCacheStorageConnection.ITEM_= DATA); + assertTrue("Node item data should be a NodeData", dataObject instanc= eof NodeData); + assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getIde= ntifier()); + assertEquals("Node path wrong", node1path, ((NodeData)dataObject).ge= tQPath()); + assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)da= taObject).getOrderNumber()); + } + + public void testUpdateProperty() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/prop1) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValue1 =3D "Property value #1"; + propData1.setValue(new TransientValueData(propValue1)); + conn.add(propData1); + + // update property (/prop1) with new value + TransientPropertyData propDataU =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValueU =3D "Updated Property value #1"; + propDataU.setValue(new TransientValueData(propValueU)); + conn.update(propDataU); + + // check in tree + treePrint(nodes); + + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + + assertEquals("Attributes ammount wrong", 2, rootNode.getKeys().size(= )); + + String pid =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsS= tring()); + assertEquals("Property ID wrong", propId1, pid); + + // check in items + treePrint(nodes); + + Node itemsProp1 =3D props.getChild(Fqn.fromEle= ments(propId1)); + Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); + assertNotNull("Property item data should exists", data1Object); + assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); + + PropertyData data1 =3D (PropertyData)data1Object; + assertEquals("Property id wrong", propId1, data1.getIdentifier()); + assertEquals("Property path wrong", propPath1, data1.getQPath()); + assertEquals("Property Value wrong", propValueU, new String(data1.ge= tValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + } + + public void testGetNodeByName() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check = + ItemData nodeItem =3D + conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), + node1path.getEntries()[node1path.getEntries().length - 1]); + + assertTrue("Node expected", nodeItem.isNode()); + assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); + assertEquals("Node path wrong", node1path, nodeItem.getQPath()); + } + + public void testGetPropertyByName() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); + conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); + + // check = + ItemData propItem =3D + conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), + propPath1.getEntries()[propPath1.getEntries().length - 1]); + + assertFalse("Proeprty expected", propItem.isNode()); + assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); + assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); + } + + public void testGetNodeById() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check = + ItemData nodeItem =3D conn.getItemData(node1id); + + assertTrue("Node expected", nodeItem.isNode()); + assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); + assertEquals("Node path wrong", node1path, nodeItem.getQPath()); + } + + public void testGetPropertyById() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); + conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); + + // check = + ItemData propItem =3D conn.getItemData(propId1); + + assertFalse("Proeprty expected", propItem.isNode()); + assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); + assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); + } + + public void _testGetChildNodes() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + + // check in tree + treePrint(nodes); + + List childs =3D + conn.getChildNodesData(new TransientNodeData(Constants.ROOT_PATH,= Constants.ROOT_UUID, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); + + assertEquals("Childs amount wrong", 2, childs.size()); + + for (NodeData child : childs) + { + if (child.getQPath().equals(node1path)) + { + assertEquals("Node id wrong", node1id, child.getIdentifier()); + } + else if (child.getQPath().equals(Constants.JCR_SYSTEM_PATH)) + { + assertEquals("Node id wrong", Constants.SYSTEM_UUID, child.get= Identifier()); + } + else + { + fail("Wrong Node found"); + } + } + } + + public void _testGetChildProperties() throws Exception + { + // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, + 1, 1, Constants.ROOT_UUID, false)); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, + 1, 1, Constants.ROOT_UUID, false)); + + // add property (/a) + String propId3 =3D "3"; + InternalQName propName3 =3D InternalQName.parse("[]a"); + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName3), propId3, 1, 1, + Constants.ROOT_UUID, false)); + + // add property (/b) + String propId4 =3D "4"; + InternalQName propName4 =3D InternalQName.parse("[]b"); + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName4), propId4, 1, 1, + Constants.ROOT_UUID, false)); + + // check + treePrint(nodes); + + List childs =3D + conn.getChildPropertiesData(new TransientNodeData(Constants.ROOT_= PATH, Constants.ROOT_UUID, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); + + assertEquals("Childs amount wrong", 4, childs.size()); + + for (PropertyData child : childs) + { + if (child.getQPath().getName().equals(Constants.JCR_PRIMARYTYPE)) + { + assertEquals("Property id wrong", propId1, child.getIdentifier= ()); + } + else if (child.getQPath().getName().equals(Constants.JCR_MIXINTYP= ES)) + { + assertEquals("Property id wrong", propId2, child.getIdentifier= ()); + } + else if (child.getQPath().getName().equals(propName3)) + { + assertEquals("Property id wrong", propId3, child.getIdentifier= ()); + } + else if (child.getQPath().getName().equals(propName4)) + { + assertEquals("Property id wrong", propId4, child.getIdentifier= ()); + } + else + { + fail("Wrong Property found"); + } + } + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnec= tionTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id --===============5132847925636332667==-- From do-not-reply at jboss.org Fri Nov 6 11:55:26 2009 Content-Type: multipart/mixed; boundary="===============2232930266118570666==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r495 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Fri, 06 Nov 2009 11:55:26 -0500 Message-ID: <200911061655.nA6GtQE3007821@svn01.web.mwc.hst.phx2.redhat.com> --===============2232930266118570666== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-06 11:55:26 -0500 (Fri, 06 Nov 2009) New Revision: 495 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-200: new impl testing fixes Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 16:41:20 UTC (rev 494) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -06 16:55:26 UTC (rev 495) @@ -88,7 +88,7 @@ if (data.getParentIdentifier() !=3D null) { // check if parent is cached - Node parent =3D cache.getNode(makeNodeFqn(d= ata.getParentIdentifier())); + Node parent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); @@ -116,7 +116,7 @@ startBatch(); = // check if parent is cached - Node parent =3D cache.getNode(makeNodeFqn(data= .getParentIdentifier())); + Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); @@ -141,7 +141,7 @@ if (data.getParentIdentifier() !=3D null) { // check if parent is cached - Node parent =3D cache.getNode(makeNodeFqn(d= ata.getParentIdentifier())); + Node parent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); @@ -165,7 +165,7 @@ startBatch(); = // check if parent is cached - Node parent =3D cache.getNode(makeNodeFqn(data= .getParentIdentifier())); + Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); @@ -387,9 +387,7 @@ if (data.getParentIdentifier() !=3D null) { // check if parent is cached - Fqn parentFqn =3D makeNodeFqn(data.getParentIdentifier()); - - Node parent =3D cache.getNode(parentFqn); + Node parent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); if (parent =3D=3D null) { throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-06 16:41:20 UTC (rev 494) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-06 16:55:26 UTC (rev 495) @@ -141,7 +141,7 @@ { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add node (/node) String node1id =3D "1"; @@ -208,7 +208,7 @@ { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add property (/jcr:primaryType) String propId1 =3D "1"; @@ -280,7 +280,7 @@ { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add node (/node) String node1id =3D "1"; @@ -332,7 +332,7 @@ { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add property (/jcr:primaryType) String propId1 =3D "1"; @@ -369,7 +369,7 @@ { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add node (/node) String node1id =3D "1"; @@ -412,7 +412,7 @@ { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add property (/prop1) String propId1 =3D "1"; @@ -458,7 +458,7 @@ // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add node (/node) String node1id =3D "1"; @@ -473,7 +473,7 @@ // check = ItemData nodeItem =3D conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), + new InternalQName[0], 0, null, new AccessControlList()), node1path.getEntries()[node1path.getEntries().length - 1]); = assertTrue("Node expected", nodeItem.isNode()); @@ -486,7 +486,7 @@ // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add property (/jcr:primaryType) String propId1 =3D "1"; @@ -501,7 +501,7 @@ // check = ItemData propItem =3D conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), + new InternalQName[0], 0, null, new AccessControlList()), propPath1.getEntries()[propPath1.getEntries().length - 1]); = assertFalse("Proeprty expected", propItem.isNode()); @@ -514,7 +514,7 @@ // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add node (/node) String node1id =3D "1"; @@ -539,7 +539,7 @@ // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add property (/jcr:primaryType) String propId1 =3D "1"; @@ -564,7 +564,7 @@ // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add node (/node) String node1id =3D "1"; @@ -581,7 +581,7 @@ = List childs =3D conn.getChildNodesData(new TransientNodeData(Constants.ROOT_PATH,= Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new = AccessControlList())); = assertEquals("Childs amount wrong", 2, childs.size()); = @@ -607,7 +607,7 @@ // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add property (/jcr:primaryType) String propId1 =3D "1"; @@ -636,7 +636,7 @@ = List childs =3D conn.getChildPropertiesData(new TransientNodeData(Constants.ROOT_= PATH, Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new = AccessControlList())); = assertEquals("Childs amount wrong", 4, childs.size()); = --===============2232930266118570666==-- From do-not-reply at jboss.org Fri Nov 6 12:08:39 2009 Content-Type: multipart/mixed; boundary="===============9010817570396773570==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r496 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/dataflow and 1 other directories. Date: Fri, 06 Nov 2009 12:08:39 -0500 Message-ID: <200911061708.nA6H8dUM010385@svn01.web.mwc.hst.phx2.redhat.com> --===============9010817570396773570== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-06 12:08:38 -0500 (Fri, 06 Nov 2009) New Revision: 496 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/TestByteArrayPersistedValueDataSerializa= tion.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/dataflow/TestTransientValueDataSerialization.java Log: EXOJCR-201 :Add serialization mechanism to ByteArrayPersistentValuData and = added test TestByteArrayPersistentValueDataSerialization. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java 2009-1= 1-06 16:55:26 UTC (rev 495) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java 2009-1= 1-06 17:08:38 UTC (rev 496) @@ -22,8 +22,11 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; = import java.io.ByteArrayInputStream; +import java.io.Externalizable; import java.io.IOException; import java.io.InputStream; +import java.io.ObjectInput; +import java.io.ObjectOutput; = import javax.jcr.RepositoryException; = @@ -33,10 +36,18 @@ * @author Gennady Azarenkov * @version $Id$ */ -public class ByteArrayPersistedValueData extends AbstractValueData +public class ByteArrayPersistedValueData extends AbstractValueData impleme= nts Externalizable { = protected byte[] data; + = + /** + * Empty constructor to serialization. + */ + public ByteArrayPersistedValueData() + { + super(0); + } = /** * ByteArrayPersistedValueData constructor. @@ -108,4 +119,20 @@ return false; } = + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + orderNumber =3D in.readInt(); + = + data =3D new byte[in.readInt()]; + in.readFully(data); + } + + public void writeExternal(ObjectOutput out) throws IOException + { + out.writeInt(orderNumber); + = + out.writeInt(data.length); + out.write(data); + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/dataflow/TestTransientValueDataSerialization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TestTransientValueDataSerialization.java 2009-11-0= 6 16:55:26 UTC (rev 495) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TestTransientValueDataSerialization.java 2009-11-0= 6 17:08:38 UTC (rev 496) @@ -52,7 +52,7 @@ = = File out =3D File.createTempFile("test", ".data"); - f.deleteOnExit(); + out.deleteOnExit(); = //serialize ObjectOutputStream oos =3D new ObjectOutputStream(new FileOutputStre= am(out)); @@ -82,7 +82,7 @@ tvd.setFileCleaner(new FileCleaner()); = File out =3D File.createTempFile("test", ".data"); - f.deleteOnExit(); + out.deleteOnExit(); = //serialize ObjectOutputStream oos =3D new ObjectOutputStream(new FileOutputStre= am(out)); Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/dataflow/persistent/TestByteArrayPersistedValueDataSeria= lization.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/TestByteArrayPersistedValueDataSerializ= ation.java (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/TestByteArrayPersistedValueDataSerializ= ation.java 2009-11-06 17:08:38 UTC (rev 496) @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.dataflow.persistent; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import org.exoplatform.services.jcr.JcrImplBaseTest; + +/** + * Created by The eXo Platform SAS. + * = + *
+ * Date: 06.11.2009 + * = + * @author Alex Re= shetnyak + * @version $Id$ + */ +public class TestByteArrayPersistedValueDataSerialization + extends JcrImplBaseTest +{ + public void testBAPVDSerialization() throws Exception + { + = + byte []buf =3D new byte[124578]; + = + for (int i =3D 0; i< buf.length; i++) + buf[i] =3D (byte) (Math.random()*256); + = + // Create ValueData instants + ByteArrayPersistedValueData vd =3D new ByteArrayPersistedValueData(b= uf, 11); + + File out =3D File.createTempFile("test", ".data"); + out.deleteOnExit(); + + //serialize + ObjectOutputStream oos =3D new ObjectOutputStream(new FileOutputStre= am(out)); + oos.writeObject(vd); + oos.flush(); + oos.close(); + + //deserialize + ObjectInputStream ois =3D new ObjectInputStream(new FileInputStream(= out)); + ByteArrayPersistedValueData deserializedValueData =3D (ByteArrayPers= istedValueData) ois.readObject(); + + //check + assertNotNull(deserializedValueData); + assertEquals(vd.getLength(), deserializedValueData.getLength()); + assertEquals(vd.getOrderNumber(), deserializedValueData.getOrderNumb= er()); + = + for (int j =3D 0; j < vd.getAsByteArray().length; j++) + assertEquals(vd.getAsByteArray()[j], deserializedValueData.getAsBy= teArray()[j]); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/dataflow/persistent/TestByteArrayPersisted= ValueDataSerialization.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============9010817570396773570==-- From do-not-reply at jboss.org Sun Nov 8 08:19:26 2009 Content-Type: multipart/mixed; boundary="===============5045943631578992862==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r497 - in ws/branches/2.2.x/exo.ws.rest.core/src: main/java/org/exoplatform/services/rest/tools and 4 other directories. Date: Sun, 08 Nov 2009 08:19:26 -0500 Message-ID: <200911081319.nA8DJQu3021975@svn01.web.mwc.hst.phx2.redhat.com> --===============5045943631578992862== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2009-11-08 08:19:25 -0500 (Sun, 08 Nov 2009) New Revision: 497 Added: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/service= s/rest/tools/ResourceLauncher.java Removed: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/AbstractResourceTest.java Modified: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/service= s/rest/impl/provider/MultipartFormDataEntityProvider.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/RequestDispatcherTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/RequestFilterTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/ResponseFilterTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/method/HeadMethodTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/method/MediaTypeTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/method/MethodExceptionTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/method/MethodInvokerFilterTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/method/MethodReturnTypeTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/method/OptionsMethodTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/method/ParametersInjectionTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/ContextResolverTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/ExceptionMapperTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/FormEntityTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/JAXBEntityTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/JsonEntityTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/OtherEntityTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/ProviderContextParameterInjectionTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/resource/AcceptResourceTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/resource/AnnotationInheritanceTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/resource/ApplicationTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/resource/ContextParametersInjectionTest.java ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/resource/MatchedURIsAndResourcesTest.java Log: EXOJCR-230 : = Modified: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/= services/rest/impl/provider/MultipartFormDataEntityProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/impl/provider/MultipartFormDataEntityProvider.java 2009-11-06 17:08= :38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/impl/provider/MultipartFormDataEntityProvider.java 2009-11-08 13:19= :25 UTC (rev 497) @@ -28,7 +28,6 @@ import org.exoplatform.services.rest.impl.FileCollector; import org.exoplatform.services.rest.provider.EntityProvider; = -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; Copied: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/se= rvices/rest/tools/ResourceLauncher.java (from rev 496, ws/branches/2.2.x/ex= o.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/AbstractRes= ourceTest.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/tools/ResourceLauncher.java (rev 0) +++ ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/tools/ResourceLauncher.java 2009-11-08 13:19:25 UTC (rev 497) @@ -0,0 +1,103 @@ +/* + * 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.rest.tools; + +import java.io.ByteArrayInputStream; +import java.net.URI; +import java.util.List; +import java.util.Map; + +import javax.ws.rs.core.MultivaluedMap; + +import org.exoplatform.services.rest.ContainerResponseWriter; +import org.exoplatform.services.rest.RequestHandler; +import org.exoplatform.services.rest.impl.ContainerRequest; +import org.exoplatform.services.rest.impl.ContainerResponse; +import org.exoplatform.services.rest.impl.EnvironmentContext; +import org.exoplatform.services.rest.impl.InputHeadersMap; +import org.exoplatform.services.rest.impl.MultivaluedMapImpl; + +/** + * This class may be useful for running test and should not be used for la= unching + * services in real environment, Servlet Container for example. + * = + * @author Andrey Parfonov + * @version $Id$ + */ +public class ResourceLauncher +{ + + private final RequestHandler requestHandler; + + public ResourceLauncher(RequestHandler requestHandler) + { + this.requestHandler =3D requestHandler; + } + + /** + * @param method HTTP method + * @param requestURI full requested URI + * @param baseURI base requested URI + * @param headers HTTP headers + * @param data data + * @param writer response writer + * @param env environment context + * @return response + * @throws Exception if any error occurs + */ + public ContainerResponse service(String method, String requestURI, Stri= ng baseURI, + Map> headers, byte[] data, ContainerResponseWri= ter writer, EnvironmentContext env) + throws Exception + { + + if (headers =3D=3D null) + headers =3D new MultivaluedMapImpl(); + + ByteArrayInputStream in =3D null; + if (data !=3D null) + in =3D new ByteArrayInputStream(data); + + if (env =3D=3D null) + env =3D new EnvironmentContext(); + EnvironmentContext.setCurrent(env); + = + ContainerRequest request =3D + new ContainerRequest(method, new URI(requestURI), new URI(baseURI= ), in, new InputHeadersMap(headers)); + ContainerResponse response =3D new ContainerResponse(writer); + requestHandler.handleRequest(request, response); + return response; + } + + /** + * @param method HTTP method + * @param requestURI full requested URI + * @param baseURI base requested URI + * @param headers HTTP headers + * @param data data + * @param env environment context + * @return response + * @throws Exception if any error occurs + */ + public ContainerResponse service(String method, String requestURI, Stri= ng baseURI, + MultivaluedMap headers, byte[] data, EnvironmentCont= ext env) throws Exception + { + return service(method, requestURI, baseURI, headers, data, new Dummy= ContainerResponseWriter(), env); + } + +} Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/e= xoplatform/services/rest/tools/ResourceLauncher.java ___________________________________________________________________ Name: svn:keywords + Id Deleted: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/s= ervices/rest/impl/AbstractResourceTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/AbstractResourceTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/AbstractResourceTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -1,79 +0,0 @@ -/* - * 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.rest.impl; - -import org.exoplatform.services.rest.ContainerResponseWriter; -import org.exoplatform.services.rest.impl.ContainerRequest; -import org.exoplatform.services.rest.impl.ContainerResponse; -import org.exoplatform.services.rest.impl.EnvironmentContext; -import org.exoplatform.services.rest.impl.InputHeadersMap; -import org.exoplatform.services.rest.impl.MultivaluedMapImpl; -import org.exoplatform.services.rest.tools.DummyContainerResponseWriter; -import org.exoplatform.services.test.mock.MockHttpServletRequest; - -import java.io.ByteArrayInputStream; -import java.net.URI; -import java.util.List; -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.MultivaluedMap; - -/** - * @author Andrey Parfonov - * @version $Id: $ - */ -public abstract class AbstractResourceTest extends BaseTest -{ - - // public void setUp() throws Exception { - // super.setUp(); - // } - - public ContainerResponse service(String method, String requestURI, Stri= ng baseURI, - Map> headers, byte[] data, ContainerResponseWri= ter writer) throws Exception - { - - if (headers =3D=3D null) - headers =3D new MultivaluedMapImpl(); - - ByteArrayInputStream in =3D null; - if (data !=3D null) - in =3D new ByteArrayInputStream(data); - - EnvironmentContext envctx =3D new EnvironmentContext(); - HttpServletRequest httpRequest =3D - new MockHttpServletRequest("", in, in !=3D null ? in.available() = : 0, method, headers); - envctx.put(HttpServletRequest.class, httpRequest); - EnvironmentContext.setCurrent(envctx); - ContainerRequest request =3D - new ContainerRequest(method, new URI(requestURI), new URI(baseURI= ), in, new InputHeadersMap(headers)); - ContainerResponse response =3D new ContainerResponse(writer); - requestHandler.handleRequest(request, response); - return response; - } - - public ContainerResponse service(String method, String requestURI, Stri= ng baseURI, - MultivaluedMap headers, byte[] data) throws Exception - { - return service(method, requestURI, baseURI, headers, data, new Dummy= ContainerResponseWriter()); - - } - -} Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/RequestDispatcherTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/RequestDispatcherTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/RequestDispatcherTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -18,6 +18,10 @@ */ package org.exoplatform.services.rest.impl; = +import java.io.ByteArrayInputStream; +import java.util.HashMap; +import java.util.List; + import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Encoded; import javax.ws.rs.GET; @@ -34,14 +38,18 @@ import org.exoplatform.services.rest.GenericContainerResponse; import org.exoplatform.services.rest.Inject; import org.exoplatform.services.rest.Property; +import org.exoplatform.services.rest.tools.ResourceLauncher; +import org.exoplatform.services.test.mock.MockHttpServletRequest; = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class RequestDispatcherTest extends AbstractResourceTest +public class RequestDispatcherTest extends BaseTest { = + private ResourceLauncher launcher; + public void setUp() throws Exception { resources =3D new ResourceBinderImpl(); @@ -50,12 +58,13 @@ depInjector.put(InjectableComponent2.class, new InjectableComponent2= ()); = requestHandler =3D new RequestHandlerImpl(resources, depInjector); - = + // reset providers to be sure it is clean ProviderBinder.setInstance(new ProviderBinder()); providers =3D ProviderBinder.getInstance(); + this.launcher =3D new ResourceLauncher(requestHandler); } - = + @Path("/a") public static class Resource1 { @@ -121,12 +130,12 @@ { Resource1 r1 =3D new Resource1(); registry(r1); - assertEquals("m0", service("POST", "/a", "", null, null).getEntity()= ); - assertEquals("m1", service("POST", "/a/b", "", null, null).getEntity= ()); - assertEquals("m2.0", service("POST", "/a/b/c", "", null, null).getEn= tity()); - assertEquals("m2.1", service("POST", "/a/b/c/d", "", null, null).get= Entity()); - assertEquals("m3.0", service("POST", "/a/b/c/d/e", "", null, null).g= etEntity()); - assertEquals("m3.1", service("POST", "/a/b/c/d/e/f", "", null, null)= .getEntity()); + assertEquals("m0", launcher.service("POST", "/a", "", null, null, nu= ll).getEntity()); + assertEquals("m1", launcher.service("POST", "/a/b", "", null, null, = null).getEntity()); + assertEquals("m2.0", launcher.service("POST", "/a/b/c", "", null, nu= ll, null).getEntity()); + assertEquals("m2.1", launcher.service("POST", "/a/b/c/d", "", null, = null, null).getEntity()); + assertEquals("m3.0", launcher.service("POST", "/a/b/c/d/e", "", null= , null, null).getEntity()); + assertEquals("m3.1", launcher.service("POST", "/a/b/c/d/e/f", "", nu= ll, null, null).getEntity()); unregistry(r1); } = @@ -167,10 +176,11 @@ { Resource2 r2 =3D new Resource2(); registry(r2); - assertEquals("m0", service("POST", "/", "", null, null).getEntity()); - assertEquals("m1", service("POST", "/a", "", null, null).getEntity()= ); - assertEquals("#x y", service("POST", "/1/a/b%20/c/%23x%20y", "", nul= l, null).getEntity()); - assertEquals("%23x%20y", service("POST", "/2/a/b%20/c/%23x%20y", "",= null, null).getEntity()); + assertEquals("m0", launcher.service("POST", "/", "", null, null, nul= l).getEntity()); + assertEquals("m1", launcher.service("POST", "/a", "", null, null, nu= ll).getEntity()); + assertEquals("#x y", launcher.service("POST", "/1/a/b%20/c/%23x%20y"= , "", null, null, null).getEntity()); + assertEquals("%23x%20y", launcher.service("POST", "/2/a/b%20/c/%23x%= 20y", "", null, null, null) + .getEntity()); unregistry(r2); } = @@ -222,9 +232,9 @@ public void testResourceConstructorAndFields() throws Exception { registry(Resource3.class); - assertEquals("/a/b/c/d/m0", service("GET", "/a/b/c/d/m0", "", null, = null).getEntity()); - assertEquals("c", service("GET", "/a/b/c/d/m1", "", null, null).getE= ntity()); - assertEquals("d", service("GET", "/a/b/c/d/m2", "", null, null).getE= ntity()); + assertEquals("/a/b/c/d/m0", launcher.service("GET", "/a/b/c/d/m0", "= ", null, null, null).getEntity()); + assertEquals("c", launcher.service("GET", "/a/b/c/d/m1", "", null, n= ull, null).getEntity()); + assertEquals("d", launcher.service("GET", "/a/b/c/d/m2", "", null, n= ull, null).getEntity()); unregistry(Resource3.class); } = @@ -248,7 +258,7 @@ private HttpServletRequest request; = private InjectableComponent1 ic1; - = + @Inject private InjectableComponent2 ic2; = @@ -279,7 +289,10 @@ public void testResourceConstructorsDependencyInjection() throws Except= ion { registry(Resource4.class); - assertEquals(204, service("GET", "/aaa/bbb", "", null, null).getStat= us()); + EnvironmentContext env =3D new EnvironmentContext(); + env.put(HttpServletRequest.class, new MockHttpServletRequest("", new= ByteArrayInputStream(new byte[0]), 0, "GET", + new HashMap>())); + assertEquals(204, launcher.service("GET", "/aaa/bbb", "", null, null= , env).getStatus()); unregistry(Resource4.class); } = @@ -308,7 +321,7 @@ public void testResourceConstructorDependencyInjectionFail() throws Exc= eption { registry(ResourceFail.class); - GenericContainerResponse resp =3D service("GET", "/_a/b/c/d/m0", "",= null, null); + GenericContainerResponse resp =3D launcher.service("GET", "/_a/b/c/d= /m0", "", null, null, null); String entity =3D (String)resp.getEntity(); assertTrue(entity.startsWith("Can't instantiate resource ")); assertEquals(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.= getStatusCode(), resp.getStatus()); @@ -350,7 +363,7 @@ public void testQuery() throws Exception { registry(Resource5.class); - service("GET", "/a/b/c/d?q1=3Dq1&q2=3Dq2", "", null, null); + launcher.service("GET", "/a/b/c/d?q1=3Dq1&q2=3Dq2", "", null, null, = null); unregistry(Resource5.class); } = @@ -359,7 +372,7 @@ public void testFieldSuperClass() throws Exception { registry(EndResource.class); - service("GET", "/a", "", null, null); + launcher.service("GET", "/a", "", null, null, null); unregistry(EndResource.class); } = @@ -412,7 +425,7 @@ registry(Resource6.class); RequestHandlerImpl.setProperty("prop1", "hello"); RequestHandlerImpl.setProperty("prop2", "test"); - service("GET", "/a", "", null, null); + launcher.service("GET", "/a", "", null, null, null); unregistry(Resource6.class); = } Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/RequestDispatcherTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/RequestFilterTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/RequestFilterTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/RequestFilterTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -18,9 +18,15 @@ */ package org.exoplatform.services.rest.impl; = +import java.io.ByteArrayInputStream; +import java.util.HashMap; +import java.util.List; + import org.exoplatform.services.rest.Filter; import org.exoplatform.services.rest.GenericContainerRequest; import org.exoplatform.services.rest.RequestFilter; +import org.exoplatform.services.rest.tools.ResourceLauncher; +import org.exoplatform.services.test.mock.MockHttpServletRequest; = import javax.servlet.http.HttpServletRequest; import javax.ws.rs.DELETE; @@ -34,11 +40,19 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class RequestFilterTest extends AbstractResourceTest +public class RequestFilterTest extends BaseTest { = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + @Filter public static class RequestFilter1 implements RequestFilter { @@ -53,18 +67,15 @@ = private HttpServletRequest httpRequest; = -// private ResourceBinder binder; // exo container component - - public RequestFilter1(@Context Providers providers, @Context HttpSer= vletRequest httpRequest/*, ResourceBinder binder*/) + public RequestFilter1(@Context Providers providers, @Context HttpSer= vletRequest httpRequest) { this.providers =3D providers; this.httpRequest =3D httpRequest; -// this.binder =3D binder; } = public void doFilter(GenericContainerRequest request) { - if (uriInfo !=3D null && httpHeaders !=3D null && providers !=3D = null && httpRequest !=3D null/* && binder !=3D null*/) + if (uriInfo !=3D null && httpHeaders !=3D null && providers !=3D = null && httpRequest !=3D null) request.setMethod("POST"); } = @@ -109,7 +120,7 @@ public void testWithoutFilter1() throws Exception { registry(Resource1.class); - ContainerResponse resp =3D service("GET", "/a", "", null, null); + ContainerResponse resp =3D launcher.service("GET", "/a", "", null, n= ull, null); assertEquals(405, resp.getStatus()); assertEquals(1, resp.getHttpHeaders().get("allow").size()); assertTrue(resp.getHttpHeaders().get("allow").get(0).toString().cont= ains("POST")); @@ -122,9 +133,12 @@ = // add filter that can change method providers.addRequestFilter(RequestFilter1.class); + EnvironmentContext env =3D new EnvironmentContext(); + env.put(HttpServletRequest.class, new MockHttpServletRequest("", new= ByteArrayInputStream(new byte[0]), 0, + "GET", new HashMap>())); = // should get status 204 - ContainerResponse resp =3D service("GET", "/a", "", null, null); + ContainerResponse resp =3D launcher.service("GET", "/a", "", null, n= ull, env); assertEquals(204, resp.getStatus()); = unregistry(Resource1.class); @@ -134,7 +148,7 @@ public void testFilter2() throws Exception { registry(Resource1.class); - ContainerResponse resp =3D service("GET", "/a/b/c/d/e", "", null, nu= ll); + ContainerResponse resp =3D launcher.service("GET", "/a/b/c/d/e", "",= null, null, null); assertEquals(405, resp.getStatus()); assertEquals(1, resp.getHttpHeaders().get("allow").size()); assertTrue(resp.getHttpHeaders().get("allow").get(0).toString().cont= ains("DELETE")); @@ -143,7 +157,7 @@ providers.addRequestFilter(new RequestFilter2()); = // not should get status 204 - resp =3D service("GET", "/a/b/c/d/e", "", null, null); + resp =3D launcher.service("GET", "/a/b/c/d/e", "", null, null, null); assertEquals(204, resp.getStatus()); = unregistry(Resource1.class); Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/RequestFilterTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/ResponseFilterTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/ResponseFilterTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/ResponseFilterTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -18,9 +18,15 @@ */ package org.exoplatform.services.rest.impl; = +import java.io.ByteArrayInputStream; +import java.util.HashMap; +import java.util.List; + import org.exoplatform.services.rest.Filter; import org.exoplatform.services.rest.GenericContainerResponse; import org.exoplatform.services.rest.ResponseFilter; +import org.exoplatform.services.rest.tools.ResourceLauncher; +import org.exoplatform.services.test.mock.MockHttpServletRequest; = import javax.servlet.http.HttpServletRequest; import javax.ws.rs.POST; @@ -34,11 +40,19 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class ResponseFilterTest extends AbstractResourceTest +public class ResponseFilterTest extends BaseTest { = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + @Filter public static class ResponseFilter1 implements ResponseFilter { @@ -53,19 +67,15 @@ = private HttpServletRequest httpRequest; = -// private ResourceBinder binder; // exo container component - - public ResponseFilter1(@Context Providers providers, @Context HttpSe= rvletRequest httpRequest/*, - ResourceBinder binder*/) + public ResponseFilter1(@Context Providers providers, @Context HttpSe= rvletRequest httpRequest) { this.providers =3D providers; this.httpRequest =3D httpRequest; -// this.binder =3D binder; } = public void doFilter(GenericContainerResponse response) { - if (uriInfo !=3D null && httpHeaders !=3D null && providers !=3D = null && httpRequest !=3D null /*&& binder !=3D null*/) + if (uriInfo !=3D null && httpHeaders !=3D null && providers !=3D = null && httpRequest !=3D null) response.setResponse(Response.status(200).entity("to be or not= to be").type("text/plain").build()); } = @@ -110,18 +120,21 @@ { Resource1 r =3D new Resource1(); registry(r); - ContainerResponse resp =3D service("POST", "/a", "", null, null); + ContainerResponse resp =3D launcher.service("POST", "/a", "", null, = null, null); assertEquals(204, resp.getStatus()); = // should not be any changes after add this providers.addResponseFilter(new ResponseFilter2()); - resp =3D service("POST", "/a", "", null, null); + resp =3D launcher.service("POST", "/a", "", null, null, null); assertEquals(204, resp.getStatus()); = // add response filter and try again providers.addResponseFilter(ResponseFilter1.class); = - resp =3D service("POST", "/a", "", null, null); + EnvironmentContext env =3D new EnvironmentContext(); + env.put(HttpServletRequest.class, new MockHttpServletRequest("", new= ByteArrayInputStream(new byte[0]), 0, + "POST", new HashMap>())); + resp =3D launcher.service("POST", "/a", "", null, null, env); assertEquals(200, resp.getStatus()); assertEquals("text/plain", resp.getContentType().toString()); assertEquals("to be or not to be", resp.getEntity()); @@ -133,7 +146,7 @@ { Resource1 r =3D new Resource1(); registry(r); - ContainerResponse resp =3D service("POST", "/a/b/c/d/e", "", null, n= ull); + ContainerResponse resp =3D launcher.service("POST", "/a/b/c/d/e", ""= , null, null, null); assertEquals(200, resp.getStatus()); assertEquals("text/plain", resp.getContentType().toString()); assertEquals("{\"name\":\"andrew\", \"password\":\"hello\"}", resp.g= etEntity()); @@ -141,7 +154,7 @@ // add response filter and try again providers.addResponseFilter(new ResponseFilter2()); = - resp =3D service("POST", "/a/b/c/d/e", "", null, null); + resp =3D launcher.service("POST", "/a/b/c/d/e", "", null, null, null= ); assertEquals(200, resp.getStatus()); assertEquals("application/json", resp.getContentType().toString()); assertEquals("{\"name\":\"andrew\", \"password\":\"hello\"}", resp.g= etEntity()); Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/ResponseFilterTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/method/HeadMethodTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/HeadMethodTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/HeadMethodTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -18,7 +18,8 @@ */ package org.exoplatform.services.rest.impl.method; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.GET; import javax.ws.rs.HEAD; @@ -31,7 +32,7 @@ * @author Dmytro Ka= tayev * @version $Id: HeadMethodTest.java */ -public class HeadMethodTest extends AbstractResourceTest +public class HeadMethodTest extends BaseTest { = @Path("/a") @@ -64,13 +65,21 @@ = } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testHeadMethod() throws Exception { Resource1 resource1 =3D new Resource1(); registry(resource1); = - assertEquals("get", service("GET", "/a", "", null, null).getEntity()= ); - assertEquals(200, service("HEAD", "/a", "", null, null).getStatus()); + assertEquals("get", launcher.service("GET", "/a", "", null, null, nu= ll).getEntity()); + assertEquals(200, launcher.service("HEAD", "/a", "", null, null, nul= l).getStatus()); = unregistry(resource1); = @@ -78,9 +87,9 @@ = registry(resource2); = - assertEquals("get", service("GET", "/b", "", null, null).getEntity()= ); - assertEquals(200, service("HEAD", "/b", "", null, null).getStatus()); - assertNull(service("HEAD", "/b", "", null, null).getEntity()); + assertEquals("get", launcher.service("GET", "/b", "", null, null, nu= ll).getEntity()); + assertEquals(200, launcher.service("HEAD", "/b", "", null, null, nul= l).getStatus()); + assertNull(launcher.service("HEAD", "/b", "", null, null, null).getE= ntity()); = unregistry(resource2); } Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/method/MediaTypeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MediaTypeTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MediaTypeTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -18,8 +18,9 @@ */ package org.exoplatform.services.rest.impl.method; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -38,9 +39,17 @@ * @author Dmytro Ka= tayev * @version $Id: MediaTypeTest.java = */ -public class MediaTypeTest extends AbstractResourceTest +public class MediaTypeTest extends BaseTest { = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + @Path("/a") public static class Resource1 { @@ -90,21 +99,25 @@ registry(resource1); registry(resource2); = - assertEquals(200, service("GET", "/a", "", null, null).getStatus()); - assertEquals("m0", service("GET", "/a", "", null, null).getEntity()); - assertEquals(MediaType.WILDCARD_TYPE, service("GET", "/a", "", null,= null).getContentType()); + assertEquals(200, launcher.service("GET", "/a", "", null, null, null= ).getStatus()); + assertEquals("m0", launcher.service("GET", "/a", "", null, null, nul= l).getEntity()); + assertEquals(MediaType.WILDCARD_TYPE, launcher.service("GET", "/a", = "", null, null, null) + .getContentType()); = - assertEquals(200, service("GET", "/b/c", "", null, null).getStatus()= ); - assertEquals(MediaType.TEXT_PLAIN_TYPE, service("GET", "/b/c", "", n= ull, null).getContentType()); + assertEquals(200, launcher.service("GET", "/b/c", "", null, null, nu= ll).getStatus()); + assertEquals(MediaType.TEXT_PLAIN_TYPE, launcher.service("GET", "/b/= c", "", null, null, null) + .getContentType()); = - assertEquals(200, service("GET", "/b/d", "", null, null).getStatus()= ); - assertEquals(MediaType.TEXT_XML_TYPE, service("GET", "/b/d", "", nul= l, null).getContentType()); + assertEquals(200, launcher.service("GET", "/b/d", "", null, null, nu= ll).getStatus()); + assertEquals(MediaType.TEXT_XML_TYPE, launcher.service("GET", "/b/d"= , "", null, null, null) + .getContentType()); = MultivaluedMap headers =3D new MultivaluedMapImpl(); headers.add(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON); = - assertEquals(406, service("GET", "/b/d", "", headers, null).getStatu= s()); - assertEquals(MediaType.TEXT_XML_TYPE, service("GET", "/b/d", "", nul= l, null).getContentType()); + assertEquals(406, launcher.service("GET", "/b/d", "", headers, null,= null).getStatus()); + assertEquals(MediaType.TEXT_XML_TYPE, launcher.service("GET", "/b/d"= , "", null, null, null) + .getContentType()); = unregistry(resource1); unregistry(resource2); @@ -144,19 +157,19 @@ MultivaluedMap headers =3D new MultivaluedMapImpl(); headers.add(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_PLAIN); = - assertEquals(200, service("GET", "/d/e", "", headers, null).getStatu= s()); - assertEquals("m0", service("GET", "/d/e", "", headers, null).getEnti= ty()); + assertEquals(200, launcher.service("GET", "/d/e", "", headers, null,= null).getStatus()); + assertEquals("m0", launcher.service("GET", "/d/e", "", headers, null= , null).getEntity()); = headers =3D new MultivaluedMapImpl(); headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); = - assertEquals(200, service("GET", "/d/f", "", headers, null).getStatu= s()); - assertEquals("m1", service("GET", "/d/f", "", headers, null).getEnti= ty()); + assertEquals(200, launcher.service("GET", "/d/f", "", headers, null,= null).getStatus()); + assertEquals("m1", launcher.service("GET", "/d/f", "", headers, null= , null).getEntity()); = headers =3D new MultivaluedMapImpl(); headers.add(HttpHeaders.CONTENT_TYPE, MediaType.TEXT_HTML); = - assertEquals(415, service("GET", "/d/f", "", headers, null).getStatu= s()); + assertEquals(415, launcher.service("GET", "/d/f", "", headers, null,= null).getStatus()); = unregistry(resource4); = Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/method/MethodExceptionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MethodExceptionTest.java 2009-11-06 17:08:38 UTC (rev 4= 96) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MethodExceptionTest.java 2009-11-08 13:19:25 UTC (rev 4= 97) @@ -18,8 +18,9 @@ */ package org.exoplatform.services.rest.impl.method; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.UnhandledException; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -33,7 +34,7 @@ * @author Dmytro Ka= tayev * @version $Id: TestMethodException.java */ -public class MethodExceptionTest extends AbstractResourceTest +public class MethodExceptionTest extends BaseTest { = @SuppressWarnings("serial") @@ -79,16 +80,24 @@ = } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testExceptionProcessing() throws Exception { Resource1 resource =3D new Resource1(); registry(resource); = - assertEquals(500, service("GET", "/a/0", "", null, null).getStatus()= ); - assertEquals(500, service("GET", "/a/1", "", null, null).getStatus()= ); + assertEquals(500, launcher.service("GET", "/a/0", "", null, null, nu= ll).getStatus()); + assertEquals(500, launcher.service("GET", "/a/1", "", null, null, nu= ll).getStatus()); try { - assertEquals(500, service("GET", "/a/2", "", null, null).getStatu= s()); + assertEquals(500, launcher.service("GET", "/a/2", "", null, null,= null).getStatus()); fail(); } catch (UnhandledException e) Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/method/MethodInvokerFilterTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MethodInvokerFilterTest.java 2009-11-06 17:08:38 UTC (r= ev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MethodInvokerFilterTest.java 2009-11-08 13:19:25 UTC (r= ev 497) @@ -18,12 +18,19 @@ */ package org.exoplatform.services.rest.impl.method; = +import java.io.ByteArrayInputStream; +import java.util.HashMap; +import java.util.List; + import org.exoplatform.services.rest.Filter; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; +import org.exoplatform.services.rest.impl.EnvironmentContext; import org.exoplatform.services.rest.method.MethodInvokerFilter; import org.exoplatform.services.rest.resource.GenericMethodResource; import org.exoplatform.services.rest.resource.ResourceMethodDescriptor; import org.exoplatform.services.rest.resource.SubResourceMethodDescriptor; +import org.exoplatform.services.rest.tools.ResourceLauncher; +import org.exoplatform.services.test.mock.MockHttpServletRequest; = import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; @@ -39,7 +46,7 @@ * @author Andrey Parfonov * @version $Id: $ */ -public class MethodInvokerFilterTest extends AbstractResourceTest +public class MethodInvokerFilterTest extends BaseTest { = @Filter @@ -56,18 +63,15 @@ @Context private HttpServletRequest httpRequest; = -// private ResourceBinder binder; // exo container component - - public MethodInvokerFilter1(@Context UriInfo uriInfo, @Context HttpH= eaders httpHeaders/*, ResourceBinder binder*/) + public MethodInvokerFilter1(@Context UriInfo uriInfo, @Context HttpH= eaders httpHeaders) { this.uriInfo =3D uriInfo; this.httpHeaders =3D httpHeaders; -// this.binder =3D binder; } = public void accept(GenericMethodResource genericMethodResource) { - if (uriInfo !=3D null && httpHeaders !=3D null && providers !=3D = null && httpRequest !=3D null/* && binder !=3D null*/) + if (uriInfo !=3D null && httpHeaders !=3D null && providers !=3D = null && httpRequest !=3D null) { if (genericMethodResource instanceof SubResourceMethodDescript= or) // not invoke sub-resource method @@ -127,15 +131,26 @@ } } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testInvokerFilter() throws Exception { Resource1 r =3D new Resource1(); registry(r); - assertEquals(204, service("GET", "/a/b", "", null, null).getStatus()= ); - assertEquals(204, service("GET", "/a", "", null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/b", "", null, null, nu= ll).getStatus()); + assertEquals(204, launcher.service("GET", "/a", "", null, null, null= ).getStatus()); providers.addMethodInvokerFilter(MethodInvokerFilter1.class); - assertEquals(400, service("GET", "/a/b", "", null, null).getStatus()= ); - assertEquals(204, service("GET", "/a", "", null, null).getStatus()); + EnvironmentContext env =3D new EnvironmentContext(); + env.put(HttpServletRequest.class, new MockHttpServletRequest("", new= ByteArrayInputStream(new byte[0]), 0, + "GET", new HashMap>())); + assertEquals(400, launcher.service("GET", "/a/b", "", null, null, en= v).getStatus()); + assertEquals(204, launcher.service("GET", "/a", "", null, null, env)= .getStatus()); unregistry(r); } = @@ -143,11 +158,11 @@ { Resource2 r =3D new Resource2(); registry(r); - assertEquals(204, service("GET", "/b/c", "", null, null).getStatus()= ); - assertEquals(204, service("GET", "/b/d", "", null, null).getStatus()= ); + assertEquals(204, launcher.service("GET", "/b/c", "", null, null, nu= ll).getStatus()); + assertEquals(204, launcher.service("GET", "/b/d", "", null, null, nu= ll).getStatus()); providers.addMethodInvokerFilter(new MethodInvokerFilter2()); - assertEquals(400, service("GET", "/b/c", "", null, null).getStatus()= ); - assertEquals(204, service("GET", "/b/d", "", null, null).getStatus()= ); + assertEquals(400, launcher.service("GET", "/b/c", "", null, null, nu= ll).getStatus()); + assertEquals(204, launcher.service("GET", "/b/d", "", null, null, nu= ll).getStatus()); unregistry(r); } = Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/method/MethodReturnTypeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MethodReturnTypeTest.java 2009-11-06 17:08:38 UTC (rev = 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/MethodReturnTypeTest.java 2009-11-08 13:19:25 UTC (rev = 497) @@ -18,7 +18,8 @@ */ package org.exoplatform.services.rest.impl.method; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import java.util.List; = @@ -34,7 +35,7 @@ * @author Dmytro Ka= tayev * @version $Id: ResourceReturnTypeTest.java */ -public class MethodReturnTypeTest extends AbstractResourceTest +public class MethodReturnTypeTest extends BaseTest { = @Path("/a") @@ -86,36 +87,44 @@ = } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testResourceMethodReturnType() throws Exception { Resource1 r =3D new Resource1(); registry(r); = // void Results in an empty entity body with a 204 status code. - assertEquals(204, service("GET", "/a/0", "", null, null).getStatus()= ); - assertNull(service("GET", "/a/o", "", null, null).getEntity()); + assertEquals(204, launcher.service("GET", "/a/0", "", null, null, nu= ll).getStatus()); + assertNull(launcher.service("GET", "/a/o", "", null, null, null).get= Entity()); = // Response Results in an entity body mapped from the entity propert= y of the // Response // with the status code specified by the status property of the Resp= onse. - assertEquals(200, service("GET", "/a/1", "", null, null).getStatus()= ); - assertEquals("body", service("GET", "/a/1", "", null, null).getEntit= y()); + assertEquals(200, launcher.service("GET", "/a/1", "", null, null, nu= ll).getStatus()); + assertEquals("body", launcher.service("GET", "/a/1", "", null, null,= null).getEntity()); = // GenericEntity Results: null return value results in a 204 status = code - assertEquals(204, service("GET", "/a/2", "", null, null).getStatus()= ); - assertNull(service("GET", "/a/2", "", null, null).getEntity()); + assertEquals(204, launcher.service("GET", "/a/2", "", null, null, nu= ll).getStatus()); + assertNull(launcher.service("GET", "/a/2", "", null, null, null).get= Entity()); = // a null return value results in a 204 status code. - assertEquals(204, service("GET", "/a/3", "", null, null).getStatus()= ); - assertNull(service("GET", "/a/3", "", null, null).getEntity()); + assertEquals(204, launcher.service("GET", "/a/3", "", null, null, nu= ll).getStatus()); + assertNull(launcher.service("GET", "/a/3", "", null, null, null).get= Entity()); = // Other Results: null return value results in a 204 status code - assertEquals(204, service("GET", "/a/5", "", null, null).getStatus()= ); - assertNull(service("GET", "/a/5", "", null, null).getEntity()); + assertEquals(204, launcher.service("GET", "/a/5", "", null, null, nu= ll).getStatus()); + assertNull(launcher.service("GET", "/a/5", "", null, null, null).get= Entity()); = // Other Results: null return value results in a 204 status code - assertEquals(200, service("GET", "/a/6", "", null, null).getStatus()= ); - assertNotNull(service("GET", "/a/6", "", null, null).getEntity()); + assertEquals(200, launcher.service("GET", "/a/6", "", null, null, nu= ll).getStatus()); + assertNotNull(launcher.service("GET", "/a/6", "", null, null, null).= getEntity()); = unregistry(r); } Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/method/OptionsMethodTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/OptionsMethodTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/OptionsMethodTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -18,7 +18,8 @@ */ package org.exoplatform.services.rest.impl.method; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -36,7 +37,7 @@ * @author Dmytro Ka= tayev * @version $Id: OptionsMethodTest.java */ -public class OptionsMethodTest extends AbstractResourceTest +public class OptionsMethodTest extends BaseTest { = @Target(ElementType.METHOD) @@ -70,17 +71,25 @@ = } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testOptionsMethod() throws Exception { Resource1 resource1 =3D new Resource1(); registry(resource1); - assertEquals("options", service("OPTIONS", "/a", "", null, null).get= Entity()); + assertEquals("options", launcher.service("OPTIONS", "/a", "", null, = null, null).getEntity()); unregistry(resource1); = Resource2 resource2 =3D new Resource2(); registry(resource2); - assertEquals(200, service("OPTIONS", "/b", "", null, null).getStatus= ()); - assertNotNull(service("OPTIONS", "/b", "", null, null).getResponse()= .getMetadata()); + assertEquals(200, launcher.service("OPTIONS", "/b", "", null, null, = null).getStatus()); + assertNotNull(launcher.service("OPTIONS", "/b", "", null, null, null= ).getResponse().getMetadata()); = } = Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/method/ParametersInjectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/ParametersInjectionTest.java 2009-11-06 17:08:38 UTC (r= ev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/method/ParametersInjectionTest.java 2009-11-08 13:19:25 UTC (r= ev 497) @@ -19,9 +19,10 @@ package org.exoplatform.services.rest.impl.method; = import org.exoplatform.services.rest.Property; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; import org.exoplatform.services.rest.impl.RequestHandlerImpl; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import java.util.List; import java.util.Set; @@ -46,7 +47,7 @@ * @author Andrey Parfonov * @version $Id: $ */ -public class ParametersInjectionTest extends AbstractResourceTest +public class ParametersInjectionTest extends BaseTest { = @Path("/a/{x}") @@ -218,50 +219,58 @@ } } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testParameterTypes() throws Exception { Resource1 r1 =3D new Resource1(); registry(r1); - assertEquals(204, service("GET", "/a/test/0/test", "", null, null).g= etStatus()); - assertEquals(204, service("GET", "/a/test/1/test", "", null, null).g= etStatus()); - assertEquals(204, service("GET", "/a/test/2/test", "", null, null).g= etStatus()); - assertEquals(204, service("GET", "/a/test/3/test", "", null, null).g= etStatus()); - assertEquals(204, service("GET", "/a/3333/4/2222", "", null, null).g= etStatus()); - assertEquals(204, service("GET", "/a/5555/5/4444", "", null, null).g= etStatus()); - assertEquals(204, service("GET", "/a/test/6/test", "", null, null).g= etStatus()); - assertEquals(204, service("GET", "/a/test/7/test?x=3D1&y=3D2&x=3D3&y= =3D4&x=3D5", "", null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/test/0/test", "", null= , null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/test/1/test", "", null= , null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/test/2/test", "", null= , null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/test/3/test", "", null= , null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/3333/4/2222", "", null= , null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/5555/5/4444", "", null= , null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/test/6/test", "", null= , null, null).getStatus()); + assertEquals(204, launcher.service("GET", "/a/test/7/test?x=3D1&y=3D= 2&x=3D3&y=3D4&x=3D5", "", null, null, null).getStatus()); = MultivaluedMap h =3D new MultivaluedMapImpl(); h.putSingle("foo", "to be or not to be"); h.putSingle("bar", "to be or not to be"); - assertEquals(204, service("GET", "/a/test/8/test", "", h, null).getS= tatus()); + assertEquals(204, launcher.service("GET", "/a/test/8/test", "", h, n= ull, null).getStatus()); = h.clear(); h.putSingle("Content-Type", "application/x-www-form-urlencoded"); - assertEquals(204, service("POST", "/a/test/9/test", "", h, - "bar=3Dto%20be%20or%20not%20to%20be&foo=3Dto%20be%20or%20not%20to= %20be".getBytes("UTF-8")).getStatus()); + assertEquals(204, launcher.service("POST", "/a/test/9/test", "", h, + "bar=3Dto%20be%20or%20not%20to%20be&foo=3Dto%20be%20or%20not%20to= %20be".getBytes("UTF-8"), null).getStatus()); = h.clear(); h.putSingle("Cookie", "$Version=3D1;foo=3Dfoo;$Domain=3Dexo.com;$Path=3D/exo,$Version= =3D1;bar=3Dar;$Domain=3Dexo.com;$Path=3D/exo"); - assertEquals(204, service("GET", "/a/test/11/test", "", h, null).get= Status()); + assertEquals(204, launcher.service("GET", "/a/test/11/test", "", h, = null, null).getStatus()); = - assertEquals(204, service("GET", "/a/111/12/222", "", null, null).ge= tStatus()); + assertEquals(204, launcher.service("GET", "/a/111/12/222", "", null,= null, null).getStatus()); = - assertEquals("111", service("GET", "/a/111/13", "", null, null).getE= ntity()); - assertEquals("222", service("GET", "/a/111/13?query=3D222", "", null= , null).getEntity()); + assertEquals("111", launcher.service("GET", "/a/111/13", "", null, n= ull, null).getEntity()); + assertEquals("222", launcher.service("GET", "/a/111/13?query=3D222",= "", null, null, null).getEntity()); = try { - assertEquals("hello", service("GET", "/a/111/14", "", null, null)= .getEntity()); + assertEquals("hello", launcher.service("GET", "/a/111/14", "", nu= ll, null, null).getEntity()); RequestHandlerImpl.setProperty("prop1", "to be or not to be"); - assertEquals("to be or not to be", service("GET", "/a/111/14", ""= , null, null).getEntity()); + assertEquals("to be or not to be", launcher.service("GET", "/a/11= 1/14", "", null, null, null).getEntity()); } finally { RequestHandlerImpl.setProperty("prop1", null); } - = + unregistry(r1); } = Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/provider/ContextResolverTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/ContextResolverTest.java 2009-11-06 17:08:38 UTC (rev= 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/ContextResolverTest.java 2009-11-08 13:19:25 UTC (rev= 497) @@ -22,11 +22,13 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.ext.Provider; = +import org.exoplatform.services.rest.impl.BaseTest; + /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class ContextResolverTest extends org.exoplatform.services.rest.imp= l.AbstractResourceTest +public class ContextResolverTest extends BaseTest { = @Provider Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/provider/ContextResolverTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/provider/ExceptionMapperTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/ExceptionMapperTest.java 2009-11-06 17:08:38 UTC (rev= 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/ExceptionMapperTest.java 2009-11-08 13:19:25 UTC (rev= 497) @@ -18,8 +18,9 @@ */ package org.exoplatform.services.rest.impl.provider; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.ContainerResponse; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -29,9 +30,9 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class ExceptionMapperTest extends AbstractResourceTest +public class ExceptionMapperTest extends BaseTest { = public static class ExceptionMapper1 implements ExceptionMapper @@ -81,6 +82,8 @@ = } = + private ResourceLauncher launcher; + public void setUp() throws Exception { super.setUp(); @@ -88,6 +91,7 @@ providers.addExceptionMapper(ExceptionMapper2.class); providers.addExceptionMapper(ExceptionMapper3.class); providers.addExceptionMapper(ExceptionMapper4.class); + this.launcher =3D new ResourceLauncher(requestHandler); } = @Path("a") @@ -136,24 +140,24 @@ { registry(Resource1.class); = - ContainerResponse resp =3D service("GET", "/a/1", "", null, null); + ContainerResponse resp =3D launcher.service("GET", "/a/1", "", null,= null, null); assertEquals(200, resp.getStatus()); assertEquals("IllegalArgumentException", resp.getEntity()); = - resp =3D service("GET", "/a/2", "", null, null); + resp =3D launcher.service("GET", "/a/2", "", null, null, null); assertEquals(200, resp.getStatus()); assertEquals("RuntimeException", resp.getEntity()); = - resp =3D service("GET", "/a/3", "", null, null); + resp =3D launcher.service("GET", "/a/3", "", null, null, null); assertEquals(200, resp.getStatus()); assertEquals("WebApplicationException", resp.getEntity()); = - resp =3D service("GET", "/a/4", "", null, null); + resp =3D launcher.service("GET", "/a/4", "", null, null, null); // WebApplicationException with entity - must not be overridden = assertEquals(500, resp.getStatus()); assertEquals("this exception must not be hidden by any ExceptionMapp= er", resp.getEntity()); = - resp =3D service("GET", "/a/5", "", null, null); + resp =3D launcher.service("GET", "/a/5", "", null, null, null); assertEquals(200, resp.getStatus()); assertEquals("MockException", resp.getEntity()); = Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/provider/ExceptionMapperTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/provider/FormEntityTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/FormEntityTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/FormEntityTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -19,15 +19,21 @@ package org.exoplatform.services.rest.impl.provider; = import org.apache.commons.fileupload.FileItem; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; +import org.exoplatform.services.rest.impl.EnvironmentContext; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; +import org.exoplatform.services.rest.tools.ResourceLauncher; +import org.exoplatform.services.test.mock.MockHttpServletRequest; = +import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Map; = +import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.FormParam; import javax.ws.rs.POST; @@ -36,11 +42,19 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class FormEntityTest extends AbstractResourceTest +public class FormEntityTest extends BaseTest { = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + @Path("/") public static class Resource1 { @@ -72,8 +86,8 @@ MultivaluedMap h =3D new MultivaluedMapImpl(); h.putSingle("content-type", "application/x-www-form-urlencoded"); h.putSingle("content-length", "" + data.length); - assertEquals(204, service("POST", "/a", "", h, data).getStatus()); - assertEquals(204, service("POST", "/b", "", h, data).getStatus()); + assertEquals(204, launcher.service("POST", "/a", "", h, data, null).= getStatus()); + assertEquals(204, launcher.service("POST", "/b", "", h, data, null).= getStatus()); unregistry(r1); } = @@ -190,7 +204,12 @@ h.putSingle("content-type", "multipart/form-data; boundary=3Dabcdef"= ); = byte[] data =3D out.toByteArray(); - assertEquals(204, service("POST", "/", "", h, data).getStatus()); + // NOTE In this test data will be red from HttpServletRequest, not f= rom = + // byte array. See MultipartFormDataEntityProvider. + EnvironmentContext env =3D new EnvironmentContext(); + env.put(HttpServletRequest.class, new MockHttpServletRequest("", new= ByteArrayInputStream(data), data.length, + "POST", (Map>)h)); + assertEquals(204, launcher.service("POST", "/", "", h, data, env).ge= tStatus()); unregistry(r2); } = Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/provider/FormEntityTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/provider/JAXBEntityTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/JAXBEntityTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/JAXBEntityTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -19,10 +19,11 @@ package org.exoplatform.services.rest.impl.provider; = import org.exoplatform.services.rest.generated.Book; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.ContainerResponse; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWrite= r; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -34,11 +35,19 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class JAXBEntityTest extends AbstractResourceTest +public class JAXBEntityTest extends BaseTest { = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + @Path("/") public static class Resource1 { @@ -111,10 +120,10 @@ h.putSingle("content-type", "application/xml"); byte[] data =3D XML_DATA.getBytes("UTF-8"); h.putSingle("content-length", "" + data.length); - assertEquals(204, service("POST", "/a", "", h, data).getStatus()); + assertEquals(204, launcher.service("POST", "/a", "", h, data, null).= getStatus()); = // Object transfered via XML (JAXB) - assertEquals(204, service("POST", "/b", "", h, data).getStatus()); + assertEquals(204, launcher.service("POST", "/b", "", h, data, null).= getStatus()); unregistry(r1); } = @@ -127,7 +136,7 @@ // Resource2#m1() h.putSingle("accept", "application/xml"); ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); - ContainerResponse response =3D service("GET", "/", "", h, null, writ= er); + ContainerResponse response =3D launcher.service("GET", "/", "", h, n= ull, writer, null); assertEquals(200, response.getStatus()); assertEquals("application/xml", response.getContentType().toString()= ); Book book =3D (Book)response.getEntity(); @@ -137,7 +146,7 @@ = // Resource2#m2() writer =3D new ByteArrayContainerResponseWriter(); - response =3D service("POST", "/", "", h, null, writer); + response =3D launcher.service("POST", "/", "", h, null, writer, null= ); assertEquals(200, response.getStatus()); assertEquals("application/xml", response.getContentType().toString()= ); book =3D (Book)response.getEntity(); Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/provider/JAXBEntityTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/provider/JsonEntityTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/JsonEntityTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/JsonEntityTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -19,10 +19,11 @@ package org.exoplatform.services.rest.impl.provider; = import org.exoplatform.services.rest.generated.Book; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.ContainerResponse; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWrite= r; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -33,9 +34,9 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class JsonEntityTest extends AbstractResourceTest +public class JsonEntityTest extends BaseTest { = @Path("/") @@ -79,11 +80,14 @@ = private byte[] jsonData; = + private ResourceLauncher launcher; + public void setUp() throws Exception { super.setUp(); jsonData =3D ("{\"title\":\"Hamlet\"," + "\"author\":\"William Shakespeare\","= + "\"sendByPost\":true}").getBytes("UTF-8"); + this.launcher =3D new ResourceLauncher(requestHandler); } = public void testJsonEntityParameter() throws Exception @@ -96,7 +100,7 @@ // with JSON transformation for Book have restriction can't pass Big= Decimal // (has not simple constructor and it is not in JSON known types) h.putSingle("content-length", "" + jsonData.length); - assertEquals(204, service("POST", "/", "", h, jsonData).getStatus()); + assertEquals(204, launcher.service("POST", "/", "", h, jsonData, nul= l).getStatus()); unregistry(r1); } = @@ -109,7 +113,7 @@ ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); = // Resource2#m1() - ContainerResponse response =3D service("GET", "/", "", h, null, writ= er); + ContainerResponse response =3D launcher.service("GET", "/", "", h, n= ull, writer, null); assertEquals(200, response.getStatus()); assertEquals("application/json", response.getContentType().toString(= )); Book book =3D (Book)response.getEntity(); @@ -118,7 +122,7 @@ assertTrue(book.isSendByPost()); = // Resource2#m2() - response =3D service("POST", "/", "", h, null, writer); + response =3D launcher.service("POST", "/", "", h, null, writer, null= ); assertEquals(200, response.getStatus()); assertEquals("application/json", response.getContentType().toString(= )); book =3D (Book)response.getEntity(); Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/provider/JsonEntityTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/provider/OtherEntityTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/OtherEntityTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/OtherEntityTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -18,10 +18,11 @@ */ package org.exoplatform.services.rest.impl.provider; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.ContainerResponse; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWrite= r; +import org.exoplatform.services.rest.tools.ResourceLauncher; import org.w3c.dom.Document; import org.xml.sax.InputSource; = @@ -50,11 +51,19 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class OtherEntityTest extends AbstractResourceTest +public class OtherEntityTest extends BaseTest { = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + @Path("/") public static class Resource1 { @@ -136,24 +145,24 @@ = // next types allowed for any content-type // h.putSingle("content-type", "application/octet-stream"); - assertEquals(204, service("POST", "/bytes", "", h, data).getStatus()= ); + assertEquals(204, launcher.service("POST", "/bytes", "", h, data, nu= ll).getStatus()); = - assertEquals(204, service("POST", "/string", "", h, data).getStatus(= )); + assertEquals(204, launcher.service("POST", "/string", "", h, data, n= ull).getStatus()); = - assertEquals(204, service("POST", "/stream", "", h, data).getStatus(= )); + assertEquals(204, launcher.service("POST", "/stream", "", h, data, n= ull).getStatus()); = - assertEquals(204, service("POST", "/reader", "", h, data).getStatus(= )); + assertEquals(204, launcher.service("POST", "/reader", "", h, data, n= ull).getStatus()); = // next types required application/xml, text/xml or // application/xhtml+xml content-type h.putSingle("content-type", "application/xml"); data =3D XML_DATA.getBytes("UTF-8"); h.putSingle("content-length", "" + data.length); - assertEquals(204, service("POST", "/dom", "", h, data).getStatus()); + assertEquals(204, launcher.service("POST", "/dom", "", h, data, null= ).getStatus()); = - assertEquals(204, service("POST", "/sax", "", h, data).getStatus()); + assertEquals(204, launcher.service("POST", "/sax", "", h, data, null= ).getStatus()); = - assertEquals(204, service("POST", "/ss", "", h, data).getStatus()); + assertEquals(204, launcher.service("POST", "/ss", "", h, data, null)= .getStatus()); = unregistry(r1); } @@ -249,24 +258,24 @@ ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); = h.putSingle("accept", "text/plain"); - ContainerResponse response =3D service("GET", "/bytes", "", h, null,= writer); + ContainerResponse response =3D launcher.service("GET", "/bytes", "",= h, null, writer, null); assertEquals(200, response.getStatus()); assertEquals("application/octet-stream", response.getContentType().t= oString()); assertEquals("to be or not to be".getBytes("UTF-8").length + "", res= ponse.getHttpHeaders().getFirst( HttpHeaders.CONTENT_LENGTH).toString()); assertEquals("to be or not to be", new String(writer.getBody())); = - response =3D service("GET", "/string", "", h, null, writer); + response =3D launcher.service("GET", "/string", "", h, null, writer,= null); assertEquals(200, response.getStatus()); assertEquals("text/plain", response.getContentType().toString()); assertEquals("to be or not to be", new String(writer.getBody())); = - response =3D service("GET", "/stream", "", h, null, writer); + response =3D launcher.service("GET", "/stream", "", h, null, writer,= null); assertEquals(200, response.getStatus()); assertEquals("application/octet-stream", response.getContentType().t= oString()); assertEquals("to be or not to be", new String(writer.getBody())); = - response =3D service("GET", "/reader", "", h, null, writer); + response =3D launcher.service("GET", "/reader", "", h, null, writer,= null); assertEquals(200, response.getStatus()); assertEquals("text/plain", response.getContentType().toString()); assertEquals("to be or not to be", new String(writer.getBody())); @@ -275,33 +284,33 @@ String xml =3D pattern.matcher(XML_DATA).replaceFirst(""); = h.putSingle("accept", "application/xml"); - response =3D service("GET", "/dom", "", h, null, writer); + response =3D launcher.service("GET", "/dom", "", h, null, writer, nu= ll); assertEquals(200, response.getStatus()); assertEquals("application/xml", response.getContentType().toString()= ); String result =3D new String(writer.getBody()); result =3D pattern.matcher(result).replaceFirst(""); assertEquals(xml, result); = - response =3D service("GET", "/sax", "", h, null, writer); + response =3D launcher.service("GET", "/sax", "", h, null, writer, nu= ll); assertEquals(200, response.getStatus()); assertEquals("application/xml", response.getContentType().toString()= ); result =3D new String(writer.getBody()); result =3D pattern.matcher(result).replaceFirst(""); assertEquals(xml, result); = - response =3D service("GET", "/ss", "", h, null, writer); + response =3D launcher.service("GET", "/ss", "", h, null, writer, nul= l); assertEquals(200, response.getStatus()); assertEquals("application/xml", response.getContentType().toString()= ); result =3D new String(writer.getBody()); result =3D pattern.matcher(result).replaceFirst(""); assertEquals(xml, result); = - response =3D service("GET", "/so", "", h, null, writer); + response =3D launcher.service("GET", "/so", "", h, null, writer, nul= l); assertEquals(200, response.getStatus()); assertEquals("application/octet-stream", response.getContentType().t= oString()); assertEquals("to be or not to be", new String(writer.getBody())); = - response =3D service("GET", "/response", "", h, null, writer); + response =3D launcher.service("GET", "/response", "", h, null, write= r, null); assertEquals(200, response.getStatus()); assertEquals("text/plain", response.getContentType().toString()); assertEquals("to be or not to be".getBytes("UTF-8").length + "", res= ponse.getHttpHeaders().getFirst( Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/provider/OtherEntityTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/provider/ProviderContextParameterInjectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/ProviderContextParameterInjectionTest.java 2009-11-06= 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/ProviderContextParameterInjectionTest.java 2009-11-08= 13:19:25 UTC (rev 497) @@ -18,15 +18,21 @@ */ package org.exoplatform.services.rest.impl.provider; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; +import org.exoplatform.services.rest.impl.EnvironmentContext; import org.exoplatform.services.rest.impl.ContainerResponse; import org.exoplatform.services.rest.provider.EntityProvider; +import org.exoplatform.services.rest.tools.ResourceLauncher; +import org.exoplatform.services.test.mock.MockHttpServletRequest; = +import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.List; = import javax.servlet.http.HttpServletRequest; import javax.ws.rs.GET; @@ -47,9 +53,9 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class ProviderContextParameterInjectionTest extends AbstractResourc= eTest +public class ProviderContextParameterInjectionTest extends BaseTest { = public static class MockEntity @@ -170,6 +176,8 @@ = } = + private ResourceLauncher launcher; + public void setUp() throws Exception { super.setUp(); @@ -177,6 +185,7 @@ providers.addMessageBodyWriter(EntityProviderChecker.class); providers.addExceptionMapper(ExceptionMapperChecker.class); providers.addContextResolver(ContextResolverChecker.class); + this.launcher =3D new ResourceLauncher(requestHandler); } = public void tearDown() throws Exception @@ -217,17 +226,20 @@ } } = - public void test0() throws Exception + public void testParameterInjection() throws Exception { registry(Resource1.class); = - ContainerResponse resp =3D service("GET", "/a/1", "", null, "to be o= r not to be".getBytes()); + EnvironmentContext env =3D new EnvironmentContext(); + env.put(HttpServletRequest.class, new MockHttpServletRequest("", new= ByteArrayInputStream(new byte[0]), 0, "GET", + new HashMap>())); + ContainerResponse resp =3D launcher.service("GET", "/a/1", "", null,= "to be or not to be".getBytes(), env); assertEquals("to be", ((MockEntity)resp.getEntity()).entity); = - resp =3D service("GET", "/a/2", "", null, null); + resp =3D launcher.service("GET", "/a/2", "", null, null, env); assertEquals(200, resp.getStatus()); = - resp =3D service("GET", "/a/3", "", null, null); + resp =3D launcher.service("GET", "/a/3", "", null, null, env); assertEquals(200, resp.getStatus()); assertEquals("to be to not to be", resp.getEntity()); = Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/provider/ProviderContextParameterInjectionTes= t.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/resource/AcceptResourceTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/AcceptResourceTest.java 2009-11-06 17:08:38 UTC (rev = 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/AcceptResourceTest.java 2009-11-08 13:19:25 UTC (rev = 497) @@ -18,8 +18,9 @@ */ package org.exoplatform.services.rest.impl.resource; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.Consumes; import javax.ws.rs.GET; @@ -30,9 +31,9 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class AcceptResourceTest extends AbstractResourceTest +public class AcceptResourceTest extends BaseTest { = @Path("/a") @@ -146,6 +147,14 @@ = } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testContentType() throws Exception { Resource1 r1 =3D new Resource1(); @@ -204,14 +213,14 @@ { MultivaluedMap h =3D new MultivaluedMapImpl(); h.putSingle("content-type", contentType); - return (String)service("POST", "/a", "", h, null).getEntity(); + return (String)launcher.service("POST", "/a", "", h, null, null).get= Entity(); } = private String testAcceptedMediaType(String acceptMediaType) throws Exc= eption { MultivaluedMap h =3D new MultivaluedMapImpl(); h.putSingle("accept", acceptMediaType); - return (String)service("GET", "/a", "", h, null).getEntity(); + return (String)launcher.service("GET", "/a", "", h, null, null).getE= ntity(); } = private String testComplex(String contentType, String acceptMediaType) = throws Exception @@ -219,6 +228,6 @@ MultivaluedMap h =3D new MultivaluedMapImpl(); h.putSingle("content-type", contentType); h.putSingle("accept", acceptMediaType); - return (String)service("POST", "/a", "", h, null).getEntity(); + return (String)launcher.service("POST", "/a", "", h, null, null).get= Entity(); } } Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/resource/AcceptResourceTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/resource/AnnotationInheritanceTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/AnnotationInheritanceTest.java 2009-11-06 17:08:38 UT= C (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/AnnotationInheritanceTest.java 2009-11-08 13:19:25 UT= C (rev 497) @@ -19,7 +19,8 @@ package org.exoplatform.services.rest.impl.resource; = import org.exoplatform.services.rest.ComponentLifecycleScope; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -33,7 +34,7 @@ * @author Dmytro Ka= tayev * @version $Id: AnnotationInheritanceTest.java */ -public class AnnotationInheritanceTest extends AbstractResourceTest +public class AnnotationInheritanceTest extends BaseTest { = public static interface ResourceInterface @@ -84,6 +85,14 @@ } } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testFailedInheritance() { try @@ -103,16 +112,18 @@ = registry(resource1); = - assertEquals(200, service("GET", "/a", "", null, null).getStatus()); - assertEquals("m0", service("GET", "/a", "", null, null).getEntity()); - assertEquals(MediaType.TEXT_XML_TYPE, service("GET", "/a", "", null,= null).getContentType()); + assertEquals(200, launcher.service("GET", "/a", "", null, null, null= ).getStatus()); + assertEquals("m0", launcher.service("GET", "/a", "", null, null, nul= l).getEntity()); + assertEquals(MediaType.TEXT_XML_TYPE, launcher.service("GET", "/a", = "", null, null, null) + .getContentType()); = unregistry(resource1); = registry(resource2); - assertEquals(200, service("GET", "/a", "", null, null).getStatus()); - assertEquals("m0", service("GET", "/a", "", null, null).getEntity()); - assertEquals(MediaType.APPLICATION_ATOM_XML_TYPE, service("GET", "/a= ", "", null, null).getContentType()); + assertEquals(200, launcher.service("GET", "/a", "", null, null, null= ).getStatus()); + assertEquals("m0", launcher.service("GET", "/a", "", null, null, nul= l).getEntity()); + assertEquals(MediaType.APPLICATION_ATOM_XML_TYPE, launcher.service("= GET", "/a", "", null, null, null) + .getContentType()); unregistry(resource2); = } Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/resource/ApplicationTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/ApplicationTest.java 2009-11-06 17:08:38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/ApplicationTest.java 2009-11-08 13:19:25 UTC (rev 497) @@ -23,11 +23,12 @@ import org.exoplatform.services.rest.GenericContainerResponse; import org.exoplatform.services.rest.RequestFilter; import org.exoplatform.services.rest.ResponseFilter; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.ApplicationPublisher; import org.exoplatform.services.rest.impl.ContainerResponse; import org.exoplatform.services.rest.method.MethodInvokerFilter; import org.exoplatform.services.rest.resource.GenericMethodResource; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import java.util.HashSet; import java.util.Set; @@ -40,9 +41,9 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class ApplicationTest extends AbstractResourceTest +public class ApplicationTest extends BaseTest { = public static class Application1 extends javax.ws.rs.core.Application @@ -202,36 +203,44 @@ private static boolean responseFilter =3D false; private static boolean invFilter =3D false; = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testAsResources() throws Exception { ApplicationPublisher deployer =3D new ApplicationPublisher(resources= , providers); deployer.publish(new Application1()); // per-request - ContainerResponse resp =3D service("GET", "/a", "", null, null); + ContainerResponse resp =3D launcher.service("GET", "/a", "", null, n= ull, null); assertEquals(200, resp.getStatus()); String hash10 =3D (String)resp.getEntity(); - resp =3D service("GET", "/a", "", null, null); + resp =3D launcher.service("GET", "/a", "", null, null, null); String hash11 =3D (String)resp.getEntity(); // new instance of resource for each request assertFalse(hash10.equals(hash11)); = // singleton - resp =3D service("GET", "/c", "", null, null); + resp =3D launcher.service("GET", "/c", "", null, null, null); assertEquals(200, resp.getStatus()); String hash20 =3D (String)resp.getEntity(); - resp =3D service("GET", "/c", "", null, null); + resp =3D launcher.service("GET", "/c", "", null, null, null); String hash21 =3D (String)resp.getEntity(); // singleton resource assertTrue(hash20.equals(hash21)); = // check per-request ExceptionMapper as example of provider - resp =3D service("GET", "/b", "", null, null); + resp =3D launcher.service("GET", "/b", "", null, null, null); // should be 200 status instead 500 if ExceptionMapper works correct assertEquals(200, resp.getStatus()); assertEquals("test Runtime Exception", resp.getEntity()); = // check singleton ExceptionMapper as example of provider - resp =3D service("GET", "/d", "", null, null); + resp =3D launcher.service("GET", "/d", "", null, null, null); // should be 200 status instead 500 if ExceptionMapper works correct assertEquals(200, resp.getStatus()); assertEquals("test Illegal State Exception", resp.getEntity()); Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/resource/ApplicationTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/resource/ContextParametersInjectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/ContextParametersInjectionTest.java 2009-11-06 17:08:= 38 UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/ContextParametersInjectionTest.java 2009-11-08 13:19:= 25 UTC (rev 497) @@ -19,9 +19,10 @@ package org.exoplatform.services.rest.impl.resource; = import org.exoplatform.services.rest.InitialProperties; -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.MultivaluedMapImpl; import org.exoplatform.services.rest.impl.header.HeaderHelper; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import java.util.List; = @@ -36,11 +37,19 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class ContextParametersInjectionTest extends AbstractResourceTest +public class ContextParametersInjectionTest extends BaseTest { = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + @Path("/a/b") public static class Resource1 { @@ -231,17 +240,19 @@ = private void injectionTest() throws Exception { - assertEquals("http://localhost/test/a/b/c", service("GET", "http://l= ocalhost/test/a/b/c", - "http://localhost/test", null, null).getEntity()); + assertEquals("http://localhost/test/a/b/c", launcher.service("GET", = "http://localhost/test/a/b/c", + "http://localhost/test", null, null, null).getEntity()); MultivaluedMap h =3D new MultivaluedMapImpl(); h.add("Accept", "text/xml"); h.add("Accept", "text/plain;q=3D0.7"); - assertEquals("text/xml,text/plain;q=3D0.7", service("GET", "http://l= ocalhost/test/a/b/d", "http://localhost/test", - h, null).getEntity()); - assertEquals("GET", service("GET", "http://localhost/test/a/b/e", "h= ttp://localhost/test", null, null) - .getEntity()); - assertEquals(204, service("GET", "http://localhost/test/a/b/f", "htt= p://localhost/test", null, null).getStatus()); - assertEquals(204, service("GET", "http://localhost/test/a/b/g", "htt= p://localhost/test", null, null).getStatus()); + assertEquals("text/xml,text/plain;q=3D0.7", launcher.service("GET", = "http://localhost/test/a/b/d", + "http://localhost/test", h, null, null).getEntity()); + assertEquals("GET", launcher.service("GET", "http://localhost/test/a= /b/e", "http://localhost/test", null, null, + null).getEntity()); + assertEquals(204, launcher.service("GET", "http://localhost/test/a/b= /f", "http://localhost/test", null, null, + null).getStatus()); + assertEquals(204, launcher.service("GET", "http://localhost/test/a/b= /g", "http://localhost/test", null, null, + null).getStatus()); } = } Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/resource/ContextParametersInjectionTest.java ___________________________________________________________________ Name: svn:keywords + Id Modified: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/= services/rest/impl/resource/MatchedURIsAndResourcesTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/MatchedURIsAndResourcesTest.java 2009-11-06 17:08:38 = UTC (rev 496) +++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/resource/MatchedURIsAndResourcesTest.java 2009-11-08 13:19:25 = UTC (rev 497) @@ -18,8 +18,9 @@ */ package org.exoplatform.services.rest.impl.resource; = -import org.exoplatform.services.rest.impl.AbstractResourceTest; +import org.exoplatform.services.rest.impl.BaseTest; import org.exoplatform.services.rest.impl.header.HeaderHelper; +import org.exoplatform.services.rest.tools.ResourceLauncher; = import java.util.ArrayList; import java.util.List; @@ -31,9 +32,9 @@ = /** * @author Andrey Parfonov - * @version $Id: $ + * @version $Id$ */ -public class MatchedURIsAndResourcesTest extends AbstractResourceTest +public class MatchedURIsAndResourcesTest extends BaseTest { = @Path("/a/b") @@ -110,14 +111,22 @@ } } = + private ResourceLauncher launcher; + + public void setUp() throws Exception + { + super.setUp(); + this.launcher =3D new ResourceLauncher(requestHandler); + } + public void testLevel1() throws Exception { Resource1 r1 =3D new Resource1(); registry(r1); - assertEquals("/1,/a/b", service("GET", "http://localhost/test/a/b/1"= , "http://localhost/test", null, null) - .getEntity()); - assertEquals("Resource1", service("GET", "http://localhost/test/a/b/= 2", "http://localhost/test", null, null) - .getEntity()); + assertEquals("/1,/a/b", launcher.service("GET", "http://localhost/te= st/a/b/1", "http://localhost/test", null, + null, null).getEntity()); + assertEquals("Resource1", launcher.service("GET", "http://localhost/= test/a/b/2", "http://localhost/test", null, + null, null).getEntity()); unregistry(r1); } = @@ -125,10 +134,10 @@ { Resource1 r1 =3D new Resource1(); registry(r1); - assertEquals("/1,/sub,/a/b", service("GET", "http://localhost/test/a= /b/sub/1", "http://localhost/test", null, - null).getEntity()); - assertEquals("SubResource1,Resource1", service("GET", "http://localh= ost/test/a/b/sub/2", "http://localhost/test", - null, null).getEntity()); + assertEquals("/1,/sub,/a/b", launcher.service("GET", "http://localho= st/test/a/b/sub/1", "http://localhost/test", + null, null, null).getEntity()); + assertEquals("SubResource1,Resource1", launcher.service("GET", "http= ://localhost/test/a/b/sub/2", + "http://localhost/test", null, null, null).getEntity()); unregistry(r1); } = @@ -136,10 +145,10 @@ { Resource1 r1 =3D new Resource1(); registry(r1); - assertEquals("/1,/sub-sub,/sub,/a/b", service("GET", "http://localho= st/test/a/b/sub/sub-sub/1", - "http://localhost/test", null, null).getEntity()); - assertEquals("SubResource2,SubResource1,Resource1", service("GET", "= http://localhost/test/a/b/sub/sub-sub/2", - "http://localhost/test", null, null).getEntity()); + assertEquals("/1,/sub-sub,/sub,/a/b", launcher.service("GET", "http:= //localhost/test/a/b/sub/sub-sub/1", + "http://localhost/test", null, null, null).getEntity()); + assertEquals("SubResource2,SubResource1,Resource1", launcher.service= ("GET", + "http://localhost/test/a/b/sub/sub-sub/2", "http://localhost/test= ", null, null, null).getEntity()); unregistry(r1); } } Property changes on: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/e= xoplatform/services/rest/impl/resource/MatchedURIsAndResourcesTest.java ___________________________________________________________________ Name: svn:keywords + Id --===============5045943631578992862==-- From do-not-reply at jboss.org Sun Nov 8 17:04:52 2009 Content-Type: multipart/mixed; boundary="===============2226072082000078431==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r498 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Sun, 08 Nov 2009 17:04:52 -0500 Message-ID: <200911082204.nA8M4qSQ028002@svn01.web.mwc.hst.phx2.redhat.com> --===============2226072082000078431== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-08 17:04:52 -0500 (Sun, 08 Nov 2009) New Revision: 498 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-200: conn tests Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-08 13:19:25 UTC (rev 497) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-08 22:04:52 UTC (rev 498) @@ -137,6 +137,53 @@ } } = + private void checkNode(Node rootNode, String node= Id, QPath nodePath) + { + Node node =3D nodes.getChild(Fqn.fromElements(= nodeId)); + + // check Node + Object dataObject =3D node.get(JBossCacheStorageConnection.ITEM_DATA= ); + assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); + + NodeData data =3D (NodeData)dataObject; + assertEquals("Node id wrong", nodeId, data.getIdentifier()); + assertEquals("Node path wrong", nodePath, data.getQPath()); + } + + private void checkChildNode(Node rootNode, String= childId, QPath childPath) + { + checkChildNode(rootNode, childId, childPath, null, null); + } + + private void checkChildNode(Node rootNode, String= childId, QPath childPath, Integer orderNum, + Integer version) + { + Node childNode =3D + rootNode.getChild(Fqn + .fromElements(childPath.getEntries()[childPath.getEntries().le= ngth - 1].getAsString(true))); + + assertNotNull("Child Node should exists", childNode); + String childNodeId =3D (String)childNode.get(JBossCacheStorage.ITEM_= ID); + Node node =3D props.getChild(Fqn.fromElements(= childNodeId)); + assertNotNull("Node by ID should exists", node); + + Object childNodeObject =3D node.get(JBossCacheStorage.ITEM_DATA); + assertTrue("Node item data is not a Node", childNodeObject instanceo= f NodeData); + NodeData childNodeData =3D (NodeData)childNodeObject; + assertEquals("Node id wrong", childId, childNodeData.getIdentifier()= ); + assertEquals("Node path wrong", childPath, childNodeData.getQPath()); + + if (orderNum !=3D null) + { + //assertEquals("Node order number wrong", orderNum, childNodeData= .getOrderNumber()); + } + + if (version !=3D null) + { + //assertEquals("Node persisted version wrong", version, childNode= Data.getPersistedVersion()); + } + } + public void testAddNode() throws Exception { // add root (/) @@ -161,47 +208,12 @@ assertNotNull("Node expected", rootNode); = // check root Node - Object dataObject =3D rootNode.get(JBossCacheStorageConnection.ITEM_= DATA); - assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); + checkNode(rootNode, Constants.ROOT_UUID, Constants.ROOT_PATH); = - NodeData data =3D (NodeData)dataObject; - assertEquals("Node id wrong", node1id, data.getIdentifier()); - assertEquals("Node path wrong", node1path, data.getQPath()); - - // cehck childs + // cechk childs assertEquals("Childs expected", 2, rootNode.getChildren().size()); - - for (Node child : rootNode.getChildren()) - { - // check id and name - String nodeName =3D child.getFqn().getLastElementAsString(); - String nodeId =3D (String)child.get(JBossCacheStorageConnection.I= TEM_ID); - if (nodeName.equals(node1path.getEntries()[node1path.getEntries()= .length - 1].getAsString(true))) - { - assertEquals("Node id wrong", node1id, nodeId); - } - else if (nodeName - .equals(Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_S= YSTEM_PATH.getEntries().length - 1] - .getAsString(true))) - { - assertEquals("Node id wrong", Constants.SYSTEM_UUID, nodeId); - } - else - { - fail("Wrong Node name " + nodeName); - } - - // check data - Node childNode =3D nodes.getChild(Fqn.fromE= lements(nodeId)); - assertNotNull("Node expected", childNode); - - Object childData =3D childNode.get(JBossCacheStorageConnection.IT= EM_DATA); - assertTrue("Child Node item data is not a Node", childData instan= ceof NodeData); - - assertEquals("Node id wrong", nodeId, ((NodeData)childData).getId= entifier()); - assertEquals("Node path wrong", nodeName, - data.getQPath().getEntries()[data.getQPath().getEntries().leng= th - 1].getAsString(true)); - } + checkChildNode(rootNode, node1id, node1path); + checkChildNode(rootNode, Constants.SYSTEM_UUID, Constants.JCR_SYSTEM= _PATH); } = public void testAddProperty() throws Exception @@ -228,7 +240,6 @@ = // check in nodes treePrint(nodes); - treePrint(props); = Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); = @@ -251,7 +262,7 @@ } = // check in props - treePrint(nodes); + treePrint(props); = Node itemsProp1 =3D props.getChild(Fqn.fromEle= ments(propId1)); Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); @@ -373,39 +384,98 @@ = // add node (/node) String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + QPath node1path =3D QPath.parse("[]:1[]snsNode:1"); + int node1OrderNumb =3D 0; + int node1version =3D 1; + conn.add(new TransientNodeData(node1path, node1id, node1version, Con= stants.NT_UNSTRUCTURED, new InternalQName[0], + node1OrderNumb, Constants.ROOT_UUID, new AccessControlList())); + + String node2id =3D "2"; + QPath node2path =3D QPath.parse("[]:1[]snsNode:2"); + int node2OrderNumb =3D 1; + conn.add(new TransientNodeData(node2path, node2id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], + node2OrderNumb, Constants.ROOT_UUID, new AccessControlList())); + + String node3id =3D "3"; + QPath node3path =3D QPath.parse("[]:1[]baseNode:1"); + int node3OrderNumb =3D 2; + conn.add(new TransientNodeData(node3path, node3id, 1, Constants.NT_B= ASE, new InternalQName[0], node3OrderNumb, Constants.ROOT_UUID, new AccessControlList())); = // get root node ([]:1) Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); = - // update /node (order number) - int nodeOrderNumb =3D 1; - conn.update(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], - nodeOrderNumb, Constants.ROOT_UUID, new AccessControlList())); - - // check in tree + // before treePrint(nodes); = - Node node =3D - rootNode.getChild(Fqn - .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); + // do Node.orderBefore("/snsNode:1", null) behaviour: order /snsNode= :1 at the end + // update /snsNode:1 (order number, version and index) to /snsNode:2 = + QPath newNode1path =3D QPath.parse("[]:1[]snsNode:2"); + int newNode1OrderNumb =3D 2; + int newNode1version =3D 2; + conn.update(new TransientNodeData(newNode1path, node1id, newNode1ver= sion, Constants.NT_UNSTRUCTURED, + new InternalQName[0], newNode1OrderNumb, Constants.ROOT_UUID, new= AccessControlList())); = - assertNotNull("Node should exists", node); - assertEquals("Child expected", 1, rootNode.getChildren().size()); + // update /snsNode:2 (order number, version and index) to /snsNode:1 = + QPath newNode2path =3D QPath.parse("[]:1[]snsNode:1"); + int newNode2OrderNumb =3D 0; + int newNode2version =3D 2; + conn.update(new TransientNodeData(newNode2path, node2id, newNode2ver= sion, Constants.NT_UNSTRUCTURED, + new InternalQName[0], newNode2OrderNumb, Constants.ROOT_UUID, new= AccessControlList())); = - // check in items + // update /baseNode:1 (order number and version) to /baseNode:1 = + int newNode3OrderNumb =3D 1; + int newNode3version =3D 2; + conn.update(new TransientNodeData(node3path, node3id, newNode3versio= n, Constants.NT_BASE, new InternalQName[0], + newNode3OrderNumb, Constants.ROOT_UUID, new AccessControlList())); + + // after treePrint(nodes); = - Node itemNode =3D nodes.getChild(Fqn.fromEleme= nts(node1id)); - assertNotNull("Node item data should exists", itemNode); + // get /snsNode:1 from childs of root / + checkChildNode(rootNode, node1id, node2path); + checkChildNode(rootNode, node2id, node1path); + checkChildNode(rootNode, node3id, node3path); = - Object dataObject =3D itemNode.get(JBossCacheStorageConnection.ITEM_= DATA); - assertTrue("Node item data should be a NodeData", dataObject instanc= eof NodeData); - assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getIde= ntifier()); - assertEquals("Node path wrong", node1path, ((NodeData)dataObject).ge= tQPath()); - assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)da= taObject).getOrderNumber()); +// Node childNode1 =3D +// rootNode.getChild(Fqn +// .fromElements(node1path.getEntries()[node1path.getEntries().= length - 1].getAsString(true))); +// +// assertNotNull("Child Node should exists", childNode1); +// String childNode1id =3D (String)childNode1.get(JBossCacheStorage.I= TEM_ID); +// Node node1 =3D props.getChild(Fqn.fromElemen= ts(childNode1id)); +// assertNotNull("Node by ID should exists", node1); +// +// Object childNode1Object =3D node1.get(JBossCacheStorage.ITEM_DATA); +// assertTrue("Node item data is not a Node", childNode1Object instan= ceof NodeData); +// assertEquals("Node id wrong", node2id, ((NodeData)childNode1Object= ).getIdentifier()); +// assertEquals("Node path wrong", node2path, ((NodeData)childNode1Ob= ject).getQPath()); +// +// // get /snsNode:2 from childs of root / +// Node childNode2 =3D +// rootNode.getChild(Fqn +// .fromElements(node2path.getEntries()[node2path.getEntries().= length - 1].getAsString(true))); +// +// assertNotNull("Child Node should exists", childNode2); +// String childNode2id =3D (String)childNode2.get(JBossCacheStorage.I= TEM_ID); +// Node node2 =3D props.getChild(Fqn.fromElemen= ts(childNode2id)); +// assertNotNull("Node by ID should exists", node2); +// +// Object childNode1Object =3D node1.get(JBossCacheStorage.ITEM_DATA); +// assertTrue("Node item data is not a Node", childNode1Object instan= ceof NodeData); +// assertEquals("Node id wrong", node2id, ((NodeData)childNode1Object= ).getIdentifier()); +// assertEquals("Node path wrong", node2path, ((NodeData)childNode1Ob= ject).getQPath()); +// +// assertEquals("Child expected", 3, rootNode.getChildren().size()); +// +// Node itemNode =3D nodes.getChild(Fqn.fromEle= ments(node1id)); +// assertNotNull("Node item data should exists", itemNode); +// +// Object dataObject =3D itemNode.get(JBossCacheStorageConnection.ITE= M_DATA); +// assertTrue("Node item data should be a NodeData", dataObject insta= nceof NodeData); +// assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getI= dentifier()); +// assertEquals("Node path wrong", node1path, ((NodeData)dataObject).= getQPath()); +// assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)= dataObject).getOrderNumber()); } = public void testUpdateProperty() throws Exception --===============2226072082000078431==-- From do-not-reply at jboss.org Mon Nov 9 02:13:07 2009 Content-Type: multipart/mixed; boundary="===============0683665838626438117==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r499 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory. Date: Mon, 09 Nov 2009 02:13:07 -0500 Message-ID: <200911090713.nA97D7nU007724@svn01.web.mwc.hst.phx2.redhat.com> --===============0683665838626438117== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-09 02:13:07 -0500 (Mon, 09 Nov 2009) New Revision: 499 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java Log: EXOJCR-205: LockManager refactored Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-08 22:04:52 UTC (rev= 498) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-09 07:13:07 UTC (rev= 499) @@ -709,8 +709,10 @@ * @param sessionId * @param nodeIdentifier * @throws LockException + * = + * TODO: Changed from private to public. Need for LockCacheLoader. */ - private synchronized void internalUnLock(String sessionId, String nodeI= dentifier) throws LockException + public synchronized void internalUnLock(String sessionId, String nodeId= entifier) throws LockException { LockData lData =3D locks.get(nodeIdentifier); = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-08 22:04:52= UTC (rev 498) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-09 07:13:07= UTC (rev 499) @@ -16,17 +16,25 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.lock.LockManager; import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.util.IdGenerator; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; import org.jboss.cache.CacheException; import org.jboss.cache.Modification; +import org.jboss.cache.Modification.ModificationType; = import java.util.ArrayList; import java.util.List; = +import javax.jcr.lock.LockException; + /** * Created by The eXo Platform SAS. * = @@ -38,25 +46,33 @@ public class LockCacheLoader extends AbstractWriteOnlyCacheLoader { = + /** + * Lock manager. + */ private LockManagerImpl lockManager; = /** + * Logger. + */ + private final Log log =3D ExoLogger.getLogger("jcr.LockCacheLoader"); + + /** * {@inheritDoc} */ @Override public void put(List modifications) throws Exception { - LockChanges lockChanges =3D new LockChanges(); + List lockChanges =3D new ArrayList(); = for (Modification m : modifications) { - // TODO $properties if (m.getFqn().hasElement(JBossCacheStorage.PROPS)) { switch (m.getType()) { case PUT_DATA : break; + case PUT_KEY_VALUE : if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) { @@ -65,51 +81,124 @@ = if (propertyName.equals(Constants.JCR_LOCKISDEEP) || = propertyName.equals(Constants.JCR_LOCKOWNER)) { + lockChanges.add(m); } } break; + case REMOVE_DATA : break; + case REMOVE_KEY_VALUE : + PropertyData propertyData =3D (PropertyData)m.getValue(); + InternalQName propertyName =3D propertyData.getQPath().g= etName(); + + if (propertyName.equals(Constants.JCR_LOCKISDEEP) || pro= pertyName.equals(Constants.JCR_LOCKOWNER)) + { + lockChanges.add(m); + } break; + case REMOVE_NODE : break; + case MOVE : break; + default : throw new CacheException("Unknown modification " + m.get= Type()); } } + + if (lockChanges.size() =3D=3D 2) + { + if (lockChanges.get(0).getType() =3D=3D ModificationType.PUT_K= EY_VALUE + && lockChanges.get(1).getType() =3D=3D ModificationType.PUT= _KEY_VALUE) + { + performLock(lockChanges); + } + else if (lockChanges.get(0).getType() =3D=3D ModificationType.= REMOVE_KEY_VALUE + && lockChanges.get(1).getType() =3D=3D ModificationType.REM= OVE_KEY_VALUE) + { + performUnLock(lockChanges); + } + else + { + + } + } + + lockChanges =3D new ArrayList(); } + + if (lockChanges.size() !=3D 0) + { + log.error("Incorrect changes log size for lock or unlock operati= on"); + } } = - private void processLock() + /** + * Perform lock operation. + * + * @param lockChanges + * @throws LockException + */ + private void performLock(List lockChanges) throws Excepti= on { - // String nodeIdentifier =3D data.getParentIdentifier(); - // if (lockManager.hasPendingLocks(nodeIdentifier)) - // { - // lockManager.internalLock(nodeIdentifier); - // } - // else - // { - // - // } + String nodeIdentifier =3D ((PropertyData)lockChanges.get(0).getValue= ()).getParentIdentifier(); + + if (lockManager.hasPendingLocks(nodeIdentifier)) + { + lockManager.internalLock(nodeIdentifier); + } + else + { + log.warn("No lock in pendingLocks for identifier " + nodeIdentifi= er + " Probably lock come from replication."); + + String lockToken =3D IdGenerator.generate(); + Modification ownerModification =3D getModification(lockChanges, C= onstants.JCR_LOCKOWNER); + Modification isDeepModification =3D getModification(lockChanges, = Constants.JCR_LOCKISDEEP); + + if (ownerModification !=3D null && isDeepModification !=3D null) + { + + String owner =3D + new String(((((TransientPropertyData)(ownerModification.get= Value())).getValues()).get(0)) + .getAsByteArray(), Constants.DEFAULT_ENCODING); + + boolean isDeep =3D + Boolean.valueOf( + new String(((((TransientPropertyData)(isDeepModification= .getValue())).getValues()).get(0)) + .getAsByteArray(), Constants.DEFAULT_ENCODING)).boole= anValue(); + + // TODO sessionId + lockManager.createRemoteLock("sessionId", nodeIdentifier, lock= Token, isDeep, false, owner); + } + } } = - private void processUnLock() + private void performUnLock(List lockChanges) throws Excep= tion { - + // TODO sessionId + // TODO nodeIdentifier + lockManager.internalUnLock("sessionId", "nodeIdentifier"); } = /** + * Search item with name itemName in modification list * = + * @param changes + * @param itemName + * @return Item */ - private class LockChanges + private Modification getModification(List changes, Intern= alQName itemName) { - PropertyData lockIsDeepData; - - PropertyData lockOwnerData; - + for (Modification m : changes) + { + if (((PropertyData)changes.get(0).getValue()).getQPath().getName(= ).equals(itemName)) + return m; + } + return null; } = } --===============0683665838626438117==-- From do-not-reply at jboss.org Mon Nov 9 04:19:01 2009 Content-Type: multipart/mixed; boundary="===============4912290166781189658==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r500 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr: impl/dataflow and 1 other directories. Date: Mon, 09 Nov 2009 04:19:01 -0500 Message-ID: <200911090919.nA99J1wv032767@svn01.web.mwc.hst.phx2.redhat.com> --===============4912290166781189658== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 04:19:00 -0500 (Mon, 09 Nov 2009) New Revision: 500 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/dataflow/persistent/PersistedItemData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/dataflow/persistent/PersistedNodeData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/dataflow/persistent/PersistedPropertyData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/EditableValueData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/CleanableFileStreamValueData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/FileStreamPersistedValueData.java Log: EXOJCR-201 :Add serialization mechanism to PersistentItemData, PersistentNo= deData, etc. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/dataflow/persistent/PersistedItemData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/persistent/PersistedItemData.java 2009-11-09 07:13:07 U= TC (rev 499) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/persistent/PersistedItemData.java 2009-11-09 09:19:00 U= TC (rev 500) @@ -18,8 +18,15 @@ */ package org.exoplatform.services.jcr.dataflow.persistent; = +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + +import org.exoplatform.services.jcr.datamodel.IllegalPathException; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; = /** * Created by The eXo Platform SAS.
@@ -30,17 +37,34 @@ * @version $Id$ */ = -public abstract class PersistedItemData implements ItemData +public abstract class PersistedItemData implements ItemData, Externalizable { = - protected final String id; + /** + * SerialVersionUID to serialization. + */ + private static final long serialVersionUID =3D -3845740801904303663L; = - protected final QPath qpath; + protected String id; = - protected final String parentId; + protected QPath qpath; = - protected final int version; + protected String parentId; = + protected int version; + = + private final int NOT_NULL_VALUE =3D 1; + + private final int NULL_VALUE =3D -1; + + = + /** + * Empty constructor to serialization. + */ + public PersistedItemData() + { + } + = public PersistedItemData(String id, QPath qpath, String parentId, int v= ersion) { this.id =3D id; @@ -104,4 +128,67 @@ = return false; } + = + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + byte[] buf; + + try + { + buf =3D new byte[in.readInt()]; + in.readFully(buf); + String sQPath =3D new String(buf, Constants.DEFAULT_ENCODING); + qpath =3D QPath.parse(sQPath); + } + catch (final IllegalPathException e) + { + throw new IOException("Deserialization error. " + e) + { + + /** + * {@inheritDoc} + */ + @Override + public Throwable getCause() + { + return e; + } + }; + } + + buf =3D new byte[in.readInt()]; + in.readFully(buf); + id =3D new String(buf); + + int isNull =3D in.readInt(); + if (isNull =3D=3D NOT_NULL_VALUE) + { + buf =3D new byte[in.readInt()]; + in.readFully(buf); + parentId =3D new String(buf); + } + + version =3D in.readInt(); + } + + public void writeExternal(ObjectOutput out) throws IOException + { + byte[] buf =3D qpath.getAsString().getBytes(Constants.DEFAULT_ENCODI= NG); + out.writeInt(buf.length); + out.write(buf); + + out.writeInt(id.getBytes().length); + out.write(id.getBytes()); + + if (parentId !=3D null) + { + out.writeInt(NOT_NULL_VALUE); + out.writeInt(parentId.getBytes().length); + out.write(parentId.getBytes()); + } + else + out.writeInt(NULL_VALUE); + + out.writeInt(version); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/dataflow/persistent/PersistedNodeData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/persistent/PersistedNodeData.java 2009-11-09 07:13:07 U= TC (rev 499) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/persistent/PersistedNodeData.java 2009-11-09 09:19:00 U= TC (rev 500) @@ -18,14 +18,21 @@ */ package org.exoplatform.services.jcr.dataflow.persistent; = +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.dataflow.ItemDataVisitor; +import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; = -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS.
* = @@ -35,15 +42,23 @@ * @version $Id$ */ = -public class PersistedNodeData extends PersistedItemData implements NodeDa= ta +public class PersistedNodeData extends PersistedItemData implements NodeDa= ta, Externalizable { = - protected final int orderNumber; + /** + * serialVersionUID to serialization. = + */ + private static final long serialVersionUID =3D 3033563403958948338L; = - protected final InternalQName primaryTypeName; + //TODO remove final + protected int orderNumber; = - protected final InternalQName[] mixinTypeNames; + //TODO remove final + protected InternalQName primaryTypeName; = + //TODO remove final + protected InternalQName[] mixinTypeNames; + protected AccessControlList acl; = public PersistedNodeData(String id, QPath qpath, String parentId, int v= ersion, int orderNumber, @@ -123,4 +138,94 @@ return true; } = + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + super.readExternal(in); + = + orderNumber =3D in.readInt(); + + // primary type + byte[] buf; + try + { + buf =3D new byte[in.readInt()]; + in.readFully(buf); + primaryTypeName =3D InternalQName.parse(new String(buf, Constants= .DEFAULT_ENCODING)); + } + catch (final IllegalNameException e) + { + throw new IOException(e.getMessage()) + { + private static final long serialVersionUID =3D 348980917923443= 5267L; + + /** + * {@inheritDoc} + */ + @Override + public Throwable getCause() + { + return e; + } + }; + } + + // mixins + int count =3D in.readInt(); + mixinTypeNames =3D new InternalQName[count]; + for (int i =3D 0; i < count; i++) + { + try + { + buf =3D new byte[in.readInt()]; + in.readFully(buf); + mixinTypeNames[i] =3D InternalQName.parse(new String(buf, Cons= tants.DEFAULT_ENCODING)); + } + catch (final IllegalNameException e) + { + throw new IOException(e.getMessage()) + { + private static final long serialVersionUID =3D 348980917923= 4435268L; // eclipse + + // gen + + /** + * {@inheritDoc} + */ + @Override + public Throwable getCause() + { + return e; + } + }; + } + } + + // acl + acl.readExternal(in); + = + } + + public void writeExternal(ObjectOutput out) throws IOException + { + super.writeExternal(out); + = + out.writeInt(orderNumber); + + // primary type + byte[] ptbuf =3D primaryTypeName.getAsString().getBytes(Constants.DE= FAULT_ENCODING); + out.writeInt(ptbuf.length); + out.write(ptbuf); + + // mixins + out.writeInt(mixinTypeNames.length); + for (int i =3D 0; i < mixinTypeNames.length; i++) + { + byte[] buf =3D mixinTypeNames[i].getAsString().getBytes(Constants= .DEFAULT_ENCODING); + out.writeInt(buf.length); + out.write(buf); + } + + acl.writeExternal(out); + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/dataflow/persistent/PersistedPropertyData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/persistent/PersistedPropertyData.java 2009-11-09 07:13:= 07 UTC (rev 499) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/persistent/PersistedPropertyData.java 2009-11-09 09:19:= 00 UTC (rev 500) @@ -23,6 +23,11 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.ValueData; = +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.ArrayList; import java.util.List; = import javax.jcr.RepositoryException; @@ -36,15 +41,30 @@ * @version $Id$ */ = -public class PersistedPropertyData extends PersistedItemData implements Pr= opertyData +public class PersistedPropertyData extends PersistedItemData implements Pr= opertyData, Externalizable { = + /** + * serialVersionUID to serialization. = + */ + private static final long serialVersionUID =3D 2035566403758848232L; + = + protected final static int NULL_VALUES =3D -1; + = protected List values; = - protected final int type; + protected int type; = - protected final boolean multiValued; + protected boolean multiValued; = + /** + * Empty constructor to serialization. + */ + public PersistedPropertyData() + { + super(); + } + = public PersistedPropertyData(String id, QPath qpath, String parentId, i= nt version, int type, boolean multiValued) { super(id, qpath, parentId, version); @@ -119,5 +139,42 @@ else throw new RuntimeException("The values can not be changed "); } + = + public void writeExternal(ObjectOutput out) throws IOException + { + super.writeExternal(out); = + out.writeInt(type); + out.writeBoolean(multiValued); + + if (values !=3D null) + { + int listSize =3D values.size(); + out.writeInt(listSize); + for (int i =3D 0; i < listSize; i++) + out.writeObject(values.get(i)); + } + else + { + out.writeInt(NULL_VALUES); + } + } + + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + super.readExternal(in); + + type =3D in.readInt(); + + multiValued =3D in.readBoolean(); + + int listSize =3D in.readInt(); + if (listSize !=3D NULL_VALUES) + { + values =3D new ArrayList(); + for (int i =3D 0; i < listSize; i++) + values.add((ValueData)in.readObject()); + } + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/EditableValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/EditableValueData.java 2009-11-09 07:13:07 UTC (re= v 499) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/EditableValueData.java 2009-11-09 09:19:00 UTC (re= v 500) @@ -18,13 +18,14 @@ */ package org.exoplatform.services.jcr.impl.dataflow; = -import org.exoplatform.services.jcr.impl.util.io.FileCleaner; - import java.io.ByteArrayInputStream; +import java.io.Externalizable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ObjectInput; +import java.io.ObjectOutput; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; @@ -34,11 +35,28 @@ = import javax.jcr.RepositoryException; = -public class EditableValueData extends TransientValueData +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + +public class EditableValueData extends TransientValueData implements Exter= nalizable { = - protected final int maxIOBuffSize; + /** + * SerialVersionUID to serialization. + */ + private static final long serialVersionUID =3D -5280857006905550884L; + = + protected int maxIOBuffSize; = + /** + * Empty constructor to serialization. + */ + public EditableValueData() = + { + super(); + maxIOBuffSize =3D 0; + } + = + = public EditableValueData(byte[] bytes, int orderNumber, FileCleaner fil= eCleaner, int maxBufferSize, File tempDirectory) throws IOException { @@ -437,4 +455,14 @@ } } } + = + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + maxIOBuffSize =3D in.readInt(); + } + + public void writeExternal(ObjectOutput out) throws IOException + { + out.writeInt(maxIOBuffSize); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java 2009-1= 1-09 07:13:07 UTC (rev 499) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ByteArrayPersistedValueData.java 2009-1= 1-09 09:19:00 UTC (rev 500) @@ -27,6 +27,7 @@ import java.io.InputStream; import java.io.ObjectInput; import java.io.ObjectOutput; +import java.io.Serializable; = import javax.jcr.RepositoryException; = @@ -39,6 +40,10 @@ public class ByteArrayPersistedValueData extends AbstractValueData impleme= nts Externalizable { = + /** + * The serialVersionUID. + */ + private static final long serialVersionUID =3D -9131328056670315388L; protected byte[] data; = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/CleanableFileStreamValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/CleanableFileStreamValueData.java 2009-= 11-09 07:13:07 UTC (rev 499) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/CleanableFileStreamValueData.java 2009-= 11-09 09:19:00 UTC (rev 500) @@ -18,15 +18,16 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = -import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.SwapFile; - +import java.io.Externalizable; import java.io.FileNotFoundException; import java.io.IOException; = import javax.jcr.RepositoryException; = +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +import org.exoplatform.services.jcr.impl.util.io.SwapFile; + /** * Created by The eXo Platform SAS. Implementation of FileStream ValueData= secures deleting file in * object finalization @@ -35,10 +36,23 @@ * @version $Id$ */ = -public class CleanableFileStreamValueData extends FileStreamPersistedValue= Data +public class CleanableFileStreamValueData extends FileStreamPersistedValue= Data implements Externalizable { = protected final FileCleaner cleaner; + = + = + /** + * Empty constructor to serialization. + * = + * @throws FileNotFoundException + */ + public CleanableFileStreamValueData() throws FileNotFoundException + { + super(); + //TODO + cleaner =3D null; + } = /** * CleanableFileStreamValueData constructor. @@ -76,7 +90,7 @@ = if (log.isDebugEnabled()) { - log.debug("=EF=BF=BDould not remove temporary file on final= ize: inUse=3D" + (((SwapFile)file).inUse()) + ", " + log.debug("=EF=BF=BDould not remove temporary file on final= ize: inUse=3D" + (((SwapFile)file).inUse()) + ", " + file.getAbsolutePath()); } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/FileStreamPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/FileStreamPersistedValueData.java 2009-= 11-09 07:13:07 UTC (rev 499) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/FileStreamPersistedValueData.java 2009-= 11-09 09:19:00 UTC (rev 500) @@ -21,10 +21,14 @@ import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; = +import java.io.Externalizable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; = import javax.jcr.RepositoryException; = @@ -35,10 +39,24 @@ * @version $Id$ */ = -public class FileStreamPersistedValueData extends AbstractValueData +public class FileStreamPersistedValueData extends AbstractValueData implem= ents Externalizable { = + /** + * The serialVersionUID = + */ + private static final long serialVersionUID =3D -2668587716865690994L; + = protected final File file; + = + /** + * Empty constructor to serialization. + */ + public FileStreamPersistedValueData() = + { + super(0); = + file =3D null; + } = /** * FileStreamPersistedValueData constructor. @@ -109,6 +127,18 @@ return false; } = + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + // TODO Auto-generated method stub + = + } + + public void writeExternal(ObjectOutput out) throws IOException + { + // TODO Auto-generated method stub + = + } + // TODO cleanup // protected void finalize() throws Throwable { // try { --===============4912290166781189658==-- From do-not-reply at jboss.org Mon Nov 9 04:44:26 2009 Content-Type: multipart/mixed; boundary="===============7642067949925320973==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r501 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 04:44:25 -0500 Message-ID: <200911090944.nA99iPL0005333@svn01.web.mwc.hst.phx2.redhat.com> --===============7642067949925320973== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-09 04:44:25 -0500 (Mon, 09 Nov 2009) New Revision: 501 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java Log: EXOJCR-204:Observation manager updated/logic excluded. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-09 0= 9:19:00 UTC (rev 500) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-09 0= 9:44:25 UTC (rev 501) @@ -18,11 +18,27 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.core.observation.EventImpl; +import org.exoplatform.services.jcr.impl.core.observation.ListenerCriteria; import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; +import org.exoplatform.services.jcr.impl.util.EntityCollection; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = import java.util.List; = +import javax.jcr.RepositoryException; +import javax.jcr.observation.Event; +import javax.jcr.observation.EventListener; +import javax.jcr.observation.EventListenerIterator; + /** * @author Nikolay Zamosenchuk * @version $Id: ObservationCacheLoader.java 34360 2009-07-22 23:58:59Z ah= eritier $ @@ -30,14 +46,21 @@ */ public class ObservationCacheLoader extends AbstractWriteOnlyCacheLoader { - private final ObservationManagerRegistry observationManagerRegistry; + public final int SKIP_EVENT =3D Integer.MIN_VALUE; = + private Log log =3D ExoLogger.getLogger(this.getClass().getName()); + + private final Fqn nodeFqn =3D Fqn.fromString(JBossCacheStorage.NODES); + + private final Fqn propFqn =3D Fqn.fromString(JBossCacheStorage.PROPS); + + private ObservationManagerRegistry observationManagerRegistry=3Dnull; + /** * = */ - public ObservationCacheLoader(ObservationManagerRegistry observationMan= agerRegistry) + public ObservationCacheLoader() { - this.observationManagerRegistry =3D observationManagerRegistry; } = /** @@ -46,8 +69,145 @@ @Override public void put(List modifications) throws Exception { - // TODO Auto-generated method stub = } = + private int eventType(Modification modification) + { + // TODO: REMOVE cache structure hardcode! + switch (modification.getType()) + { + case PUT_DATA : + if (modification.getFqn().isDirectChildOf(nodeFqn)) + { + // node added + return Event.NODE_ADDED; + } + else if (modification.getFqn().isDirectChildOf(propFqn)) + { + // property added or changed + if (modification.getOldValue() !=3D null) + { + // property changed + // TODO: possibly bad idea + return Event.PROPERTY_CHANGED; + } + else + { + // property added + return Event.PROPERTY_ADDED; + } + } + break; + case REMOVE_NODE : + if (modification.getFqn().isDirectChildOf(nodeFqn)) + { + // node removed + return Event.NODE_REMOVED; + } + else if (modification.getFqn().isDirectChildOf(propFqn)) + { + // property removed + return Event.PROPERTY_REMOVED; + } + break; + } + return SKIP_EVENT; + } + + private boolean isTypeMatch(ListenerCriteria criteria, int eventType) + { + return (criteria.getEventTypes() & eventType) > 0; + } + + private boolean isSessionMatch(ListenerCriteria criteria, String sessio= nId) + { + if (criteria.getNoLocal() && criteria.getSessionId().equals(sessionI= d)) + return false; + return true; + } + + private boolean isIdentifierMatch(ListenerCriteria criteria, ItemData i= tem) + { + + if (criteria.getIdentifier() =3D=3D null) + return true; + // for each uuid in list + for (int i =3D 0; i < criteria.getIdentifier().length; i++) + { + // if it is a direct child of nodeFqn or propertyFqn - get their = parent + if (criteria.getIdentifier()[i].equals(item.getParentIdentifier()= )) + return true; + } + return false; + + } + + private boolean isPathMatch(ListenerCriteria criteria, ItemData item) + { + if (criteria.getAbsPath() =3D=3D null) + return true; + // 8.3.3 Only events whose associated parent node is at absPath (or + // within its subtree, if isDeep is true) will be received. + QPath itemPath =3D item.getQPath(); + return itemPath.isDescendantOf(criteria.getAbsPath(), !criteria.isDe= ep()); + } + + @Deprecated + private boolean isNodeTypeMatch(ListenerCriteria criteria, ItemData ite= m, List modifications) + throws RepositoryException + { + if (criteria.getNodeTypeName() =3D=3D null) + return true; + + // TODO: IT IS IMPOSSIBLE TO ACCESS CACHE ON CACHELOADER.PUT()!!! + NodeData node =3D + (NodeData)observationManagerRegistry.getWorkspaceDataManager().ge= tItemData(item.getParentIdentifier()); + if (node =3D=3D null) + { + // check if parent exists in changes log + for (int i =3D modifications.size() - 1; i >=3D 0; i--) + { + ItemData data =3D getItemData(modifications.get(i)); + if (data.getIdentifier().equals(item.getParentIdentifier())) + { + // parent found + node =3D (NodeData)data; + break; + } + } + + if (node =3D=3D null) + { + log.warn("Item's " + item.getQPath().getAsString() + " associa= ted parent (" + item.getParentIdentifier() + + ") can't be found nor in workspace nor in current changes= . Nodetype filter is rejected."); + return false; + } + } + + for (int i =3D 0; i < criteria.getNodeTypeName().length; i++) + { + NodeTypeData criteriaNT =3D + observationManagerRegistry.getNodeTypeDataManager().getNodeTyp= e(criteria.getNodeTypeName()[i]); + InternalQName[] testQNames; + if (criteriaNT.isMixin()) + { + testQNames =3D node.getMixinTypeNames(); + } + else + { + testQNames =3D new InternalQName[1]; + testQNames[0] =3D node.getPrimaryTypeName(); + } + if (observationManagerRegistry.getNodeTypeDataManager().isNodeTyp= e(criteriaNT.getName(), testQNames)) + return true; + } + return false; + } + + protected ItemData getItemData(Modification m) + { + return (ItemData)m.getData().get(JBossCacheStorage.ITEM_DATA); + } + } --===============7642067949925320973==-- From do-not-reply at jboss.org Mon Nov 9 04:54:44 2009 Content-Type: multipart/mixed; boundary="===============7739215156009332314==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r502 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Mon, 09 Nov 2009 04:54:44 -0500 Message-ID: <200911090954.nA99si1t007399@svn01.web.mwc.hst.phx2.redhat.com> --===============7739215156009332314== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-09 04:54:44 -0500 (Mon, 09 Nov 2009) New Revision: 502 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/NamespaceDataPersister.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config.xml Log: EXOJCR-200: get childs impl, data container lifecycle rework Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/NamespaceDataPersister.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NamespaceDataPersister.java 2009-11-09 09:44:25 UTC (r= ev 501) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NamespaceDataPersister.java 2009-11-09 09:54:44 UTC (r= ev 502) @@ -402,7 +402,6 @@ changesLog.add(new ItemState(exoNamespaces, ItemState.MIXIN_CHANG= ED, false, null)); } = - nsRoot =3D exoNamespaces; dataManager.save(new TransactionChangesLog(changesLog)); } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -09 09:44:25 UTC (rev 501) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -09 09:54:44 UTC (rev 502) @@ -27,12 +27,12 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; -import org.jboss.cache.Fqn; import org.jboss.cache.Node; = import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import java.util.Set; = import javax.jcr.InvalidItemStateException; import javax.jcr.RepositoryException; @@ -183,32 +183,36 @@ */ public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException { - //Set childNames =3D cache.getChildrenNames(makeNodeFqn(pare= nt.getQPath())); - // Node parentNode =3D cache.getNode(make= NodeFqn(parent.getQPath())); - // if (parentNode =3D=3D null) - // { - // throw new IllegalStateException("Get child Nodes error: p= arent not found " + parent.getQPath().getAsString()); - // } - // - // Set> childNodes =3D parentNode.ge= tChildren(); - // - // List childs =3D new ArrayList(); - // for (Node child : childNodes) - // { - // String childId =3D (String)child.get(ITEM_ID); - // - // // TODO NodeData or PropertyData? As ItemData check then = and cast. - // NodeData node =3D (NodeData)cache.get(makeIdFqn(childId),= ITEM_DATA); - // if (node =3D=3D null) - // { - // throw new RepositoryException("One of childs is null. = Parent " + parent.getQPath().getAsString()); - // } - // childs.add(node); - // } - // - // return childs; = - return null; + Node parentNode =3D nodesRoot.getChild(makeNod= eFqn(parent.getIdentifier())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); + } + + Set> childNodes =3D parentNode.getChildre= n(); + + List childs =3D new ArrayList(); + for (Node child : childNodes) + { + String childId =3D (String)child.get(ITEM_ID); + + // TODO NodeData or PropertyData? As ItemData check then and cast. + Node node =3D nodesRoot.getChild(makeNodeFq= n(childId)); + if (node =3D=3D null) + { + throw new RepositoryException("Child node is null. Parent " + = parent.getQPath().getAsString()); + } + NodeData nodeData =3D (NodeData)node.get(ITEM_DATA); + if (nodeData =3D=3D null) + { + // TODO should not occurs by contract + throw new RepositoryException("Child node data is null. Parent= " + parent.getQPath().getAsString()); + } + childs.add(nodeData); + } + + return childs; } = private void treePrint(Node node) @@ -232,33 +236,40 @@ */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException { - // TODO treeRoot.getChild(f) possible if f not a direct child??? = - // Node parentNode =3D cache.getNode(make= NodeFqn(parent.getQPath())); - // if (parentNode =3D=3D null) - // { - // throw new IllegalStateException("Get child Nodes error: p= arent not found " + parent.getQPath().getAsString()); - // } - // - // List childs =3D new ArrayList(); - // - // for (Serializable key : parentNode.getKeys()) - // { - // if (!key.equals(ITEM_ID)) - // { - // String propId =3D (String)parentNode.get(key); - // // TODO NodeData or PropertyData? As ItemData check th= en and cast. = - // PropertyData property =3D (PropertyData)cache.get(make= IdFqn(propId), ITEM_DATA); - // if (property =3D=3D null) - // { - // throw new RepositoryException("One of childs is nul= l. Parent " + parent.getQPath().getAsString()); - // } - // childs.add(property); - // } - // } - // - // return childs; + //TODO treeRoot.getChild(f) possible if f not a direct child??? = + Node parentNode =3D nodesRoot.getChild(makeNod= eFqn(parent.getIdentifier())); + if (parentNode =3D=3D null) + { + throw new IllegalStateException("Get child Properties error: pare= nt not found " + + parent.getQPath().getAsString()); + } = - return null; + List childs =3D new ArrayList(); + + for (Serializable key : parentNode.getKeys()) + { + if (!key.equals(ITEM_ID)) + { + String propId =3D (String)parentNode.get(key); + + Node prop =3D propsRoot.getChild(makePro= pFqn(propId)); + if (prop =3D=3D null) + { + throw new RepositoryException("Child property is null. Pare= nt " + parent.getQPath().getAsString()); + } + + PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); + if (propData =3D=3D null) + { + // TODO should not occurs by contract + throw new RepositoryException("Child property data is null.= Parent " + parent.getQPath().getAsString()); + } + + childs.add(propData); + } + } + + return childs; } = /** @@ -277,10 +288,21 @@ { = // try as Node = - Node item =3D nodesRoot.getChild(makeChildNode= Fqn(parentData.getIdentifier(), name)); - if (item !=3D null) + // TODO validate ParentNotFound for both Node and Property + Node childNode =3D nodesRoot.getChild(makeChil= dNodeFqn(parentData.getIdentifier(), name)); + if (childNode !=3D null) { - return (NodeData)item.get(ITEM_DATA); + String nodeId =3D (String)childNode.get(ITEM_ID); + Node node =3D nodesRoot.getChild(makeNodeFq= n(nodeId)); + Object itemData =3D node.get(ITEM_DATA); + if (itemData !=3D null) + { + return (NodeData)itemData; + } + else + { + throw new RepositoryException("FATAL NodeData empty " + parent= Data.getQPath() + name.getAsString(true)); + } } else { @@ -295,6 +317,12 @@ return (PropertyData)propsRoot.get(makePropFqn(propId)); } } + else + { + // TODO validation of ParentNotFound for Property + throw new RepositoryException("Parent not found " + parentData= .getIdentifier() + ", " + + parentData.getQPath().getAsString()); + } } = return null; @@ -306,28 +334,37 @@ public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException { = - Node item =3D nodesRoot.getChild(makeNodeFqn(i= dentifier)); - if (item =3D=3D null) + Node node =3D nodesRoot.getChild(makeNodeFqn(i= dentifier)); + if (node !=3D null) { - item =3D propsRoot.getChild(makePropFqn(identifier)); - } - - if (item !=3D null) - { - Object itemData =3D item.get(ITEM_DATA); + Object itemData =3D node.get(ITEM_DATA); if (itemData !=3D null) { - return (ItemData)itemData; + return (NodeData)itemData; } else { - throw new RepositoryException("FATAL ItemData empty " + item.g= etFqn()); + throw new RepositoryException("FATAL NodeData empty " + identi= fier); } } else { - return null; + Node prop =3D propsRoot.getChild(makePropFq= n(identifier)); + if (prop !=3D null) + { + Object itemData =3D prop.get(ITEM_DATA); + if (itemData !=3D null) + { + return (PropertyData)itemData; + } + else + { + throw new RepositoryException("FATAL PropertyData empty " += identifier); + } + } } + + return null; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-09 09:44:25 UTC (rev 501) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-09 09:54:44 UTC (rev 502) @@ -67,15 +67,16 @@ = private final Cache cache; = - private final Node nodes; - private final Node properties; + private Node nodes; = + private Node properties; + /** * JBossWorkspaceDataContainer constructor. * */ - public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, - RepositoryEntry repConfig, InitialContextInitializer contextInit, Va= lueStoragePluginProvider valueStorageProvider) + public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, Reposi= toryEntry repConfig, + InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider) throws RepositoryConfigurationException, NamingException, Repository= Exception, IOException { this.repositoryName =3D repConfig.getName(); @@ -89,6 +90,10 @@ = // TODO hardcoded now this.persistentContainer =3D new JDBCWorkspaceDataContainer(wsConfig= , repConfig, contextInit, valueStorageProvider); + if (this.persistentContainer instanceof Startable) + { + ((Startable)this.persistentContainer).start(); + } = // TODO configure CacheLoader here with this.persistentContainer // for (IndividualCacheLoaderConfig loaderCfg : this.cache.getC= onfiguration().getCacheLoaderConfig() @@ -99,7 +104,7 @@ // ((ExoJCRCacheLoader)loaderCfg.getCacheLoader()).initDa= taContainer(this.persistentContainer); // } // } - = + // inject JDBC DC via JBC ComponentRegistry = ((CacheSPI)cache).getComponentRegistry().regis= terComponent(this.persistentContainer, WorkspaceDataContainer.class); @@ -107,7 +112,8 @@ // TODO check lifecycle, might be we have to create in start(), with= jdbc start. = // initializes configuration state, the root node, etc. this.cache.create(); - + this.cache.start(); + = Node cacheRoot =3D cache.getRoot(); //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); = @@ -118,10 +124,20 @@ = public void start() { - if (persistentContainer instanceof Startable) - { - ((Startable)persistentContainer).start(); - } + // TODO started on init, due to RepositoryContainer logic +// if (persistentContainer instanceof Startable) +// { +// ((Startable)persistentContainer).start(); +// } +// +// this.cache.start(); +// = +// Node cacheRoot =3D cache.getRoot(); +// //Node wsRoot =3D cacheRoot.addChild(Fqn.fro= mElements(repositoryName, containerName)); +// +// // prepare cache structures +// this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.NODES)); +// this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCache= Storage.PROPS)); } = public void stop() @@ -145,6 +161,12 @@ */ public WorkspaceStorageConnection openConnection() throws RepositoryExc= eption { + // TODO +// if (nodes =3D=3D null || properties =3D=3D null) +// { +// throw new RepositoryException("Container is not started"); +// } + return new JBossCacheStorageConnection(cache, nodes, properties); } = @@ -153,6 +175,12 @@ */ public WorkspaceStorageConnection openConnection(boolean readOnly) thro= ws RepositoryException { + // TODO +// if (nodes =3D=3D null || properties =3D=3D null) +// { +// throw new RepositoryException("Container is not started"); +// } + = return new JBossCacheStorageConnection(cache, nodes, properties); } = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jcr-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-09 09:44:25 UTC (rev 501) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-09 09:54:44 UTC (rev 502) @@ -32,7 +32,7 @@ - + --===============7739215156009332314==-- From do-not-reply at jboss.org Mon Nov 9 05:52:44 2009 Content-Type: multipart/mixed; boundary="===============5664904014614854817==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r503 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query: cacheloader and 1 other directory. Date: Mon, 09 Nov 2009 05:52:44 -0500 Message-ID: <200911091052.nA9Aqi2c017572@svn01.web.mwc.hst.phx2.redhat.com> --===============5664904014614854817== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-09 05:52:43 -0500 (Mon, 09 Nov 2009) New Revision: 503 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java Log: EXOJCR-202: IndexerCacheLoader updated = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-09 09:54:44 UTC (rev = 502) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-09 10:52:43 UTC (rev = 503) @@ -20,6 +20,7 @@ import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.core.SessionImpl; = +import java.io.IOException; import java.util.Set; = import javax.jcr.Node; @@ -90,4 +91,14 @@ */ Set getNodesByUri(final String uri) throws RepositoryException; = + /** + * Update Index storege for next uuid lists. + * = + * @param removedNodes - removed nodes uuid set + * @param addedNodes - added nodes uuid set + * @throws RepositoryException + * @throws IOException + */ + public void updateIndex(Set removedNodes, Set addedNode= s) throws RepositoryException, IOException; + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java 2009-11-09 09:54:44 UTC (= rev 502) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java 2009-11-09 10:52:43 UTC (= rev 503) @@ -327,6 +327,40 @@ addedNodes.add(uuid); } = + try + { + updateIndex(removedNodes, addedNodes); + } + catch (RepositoryException e) + { + log.error("Error indexing changes " + e, e); + } + catch (IOException e) + { + log.error("Error indexing changes " + e, e); + try + { + handler.logErrorChanges(removedNodes, addedNodes); + } + catch (IOException ioe) + { + log.warn("Exception occure when errorLog writed. Error log is = not complete. " + ioe, ioe); + } + } + + if (log.isDebugEnabled()) + { + log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); + } + + } + + /** + * {@inheritDoc} + */ + public void updateIndex(final Set removedNodes, final Set addedNodes) throws RepositoryException, + IOException + { Iterator addedStates =3D new Iterator() { private final Iterator iter =3D addedNodes.iterator(); @@ -402,32 +436,9 @@ = if (removedNodes.size() > 0 || addedNodes.size() > 0) { - try - { - handler.updateNodes(removedIds, addedStates); - } - catch (RepositoryException e) - { - log.error("Error indexing changes " + e, e); - } - catch (IOException e) - { - log.error("Error indexing changes " + e, e); - try - { - handler.logErrorChanges(removedNodes, addedNodes); - } - catch (IOException ioe) - { - log.warn("Exception occure when errorLog writed. Error log = is not complete. " + ioe, ioe); - } - } + handler.updateNodes(removedIds, addedStates); } = - if (log.isDebugEnabled()) - { - log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); - } } = public void createNewOrAdd(String key, ItemState state, Map> updatedNodes) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-09 0= 9:54:44 UTC (rev 502) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-09 1= 0:52:43 UTC (rev 503) @@ -16,48 +16,8 @@ */ package org.exoplatform.services.jcr.impl.core.query.cacheloader; = -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.Term; -import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.WildcardQuery; -import org.apache.lucene.search.BooleanClause.Occur; -import org.exoplatform.container.configuration.ConfigurationManager; -import org.exoplatform.services.document.DocumentReaderService; -import org.exoplatform.services.jcr.config.QueryHandlerEntry; -import org.exoplatform.services.jcr.config.QueryHandlerParams; -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; -import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.ValueData; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.LocationFactory; -import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; -import org.exoplatform.services.jcr.impl.core.SessionDataManager; -import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.core.query.AbstractQueryImpl; -import org.exoplatform.services.jcr.impl.core.query.IndexException; -import org.exoplatform.services.jcr.impl.core.query.IndexingTree; -import org.exoplatform.services.jcr.impl.core.query.QueryHandler; -import org.exoplatform.services.jcr.impl.core.query.QueryHandlerContext; -import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; -import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; -import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; -import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; -import org.exoplatform.services.jcr.impl.core.query.lucene.ScoreNode; -import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; -import org.exoplatform.services.jcr.impl.core.value.NameValue; -import org.exoplatform.services.jcr.impl.core.value.PathValue; -import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; -import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -65,27 +25,12 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.NoSuchElementException; import java.util.Set; -import java.util.StringTokenizer; = -import javax.jcr.Node; -import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; -import javax.jcr.Value; -import javax.jcr.query.InvalidQueryException; -import javax.jcr.query.Query; - /** * Created by The eXo Platform SAS. * = @@ -94,100 +39,23 @@ * @author Karpenko Sergiy = * @version $Id: CacheIndexer.java 111 2008-11-11 11:11:11Z serg $ */ -public class IndexerCacheLoader extends AbstractWriteOnlyCacheLoader imple= ments SearchManager +public class IndexerCacheLoader extends AbstractWriteOnlyCacheLoader { + /** * Logger instance for this class */ private static final Log log =3D ExoLogger.getLogger(IndexerCacheLoader= .class); = - protected QueryHandlerEntry config; + SearchManager searchManager =3D null; = - /** - * Text extractor for extracting text content of binary properties. - */ - protected DocumentReaderService extractor; - - /** - * QueryHandler where query execution is delegated to - */ - protected QueryHandler handler; - - /** - * The shared item state manager instance for the workspace. - */ - protected ItemDataConsumer itemMgr; - - /** - * The namespace registry of the repository. - */ - protected NamespaceRegistryImpl nsReg; - - /** - * The node type registry. - */ - protected NodeTypeDataManager nodeTypeDataManager; - - /** - * QueryHandler of the parent search manager or null if th= ere - * is none. - */ - protected SearchManager parentSearchManager; - - // protected QPath indexingRoot; - // - // protected List excludedPaths =3D new ArrayList(); - - protected IndexingTree indexingTree; - - private ConfigurationManager cfm; - - protected LuceneVirtualTableResolver virtualTableResolver; - public IndexerCacheLoader() { - int i =3D 0; - i++; } = - /** - * Creates a new SearchManager. - * = - * @param config - * the search configuration. - * @param nsReg - * the namespace registry. - * @param ntReg - * the node type registry. - * @param itemMgr - * the shared item state manager. - * @param rootNodeId - * the id of the root node. - * @param parentMgr - * the parent search manager or null if there i= s no - * parent search manager. - * @param excludedNodeId - * id of the node that should be excluded from indexing. Any - * descendant of that node will also be excluded from indexi= ng. - * @throws RepositoryException - * if the search manager cannot be initialized - * @throws RepositoryConfigurationException - */ - public IndexerCacheLoader(QueryHandlerEntry config, NamespaceRegistryIm= pl nsReg, NodeTypeDataManager ntReg, - WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, - DocumentReaderService extractor, ConfigurationManager cfm, final Rep= ositoryIndexSearcherHolder indexSearcherHolder) - throws RepositoryException, RepositoryConfigurationException + public void registerSearchManager(SearchManager manager) { - - this.extractor =3D extractor; - indexSearcherHolder.addIndexSearcher(this); - this.config =3D config; - this.nodeTypeDataManager =3D ntReg; - this.nsReg =3D nsReg; - this.itemMgr =3D itemMgr; - this.cfm =3D cfm; - this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); - this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; + searchManager =3D manager; } = private String parseUUID(Fqn fqn) @@ -210,11 +78,9 @@ @Override public void put(List modifications) throws Exception { - if (handler =3D=3D null) + if (searchManager =3D=3D null) return; = - long time =3D System.currentTimeMillis(); - // nodes that need to be removed from the index. final Set removedNodes =3D new HashSet(); // nodes that need to be added to the index. @@ -373,607 +239,13 @@ // } // } = - // TODO make quick changes for (String uuid : updatedNodes.keySet()) { removedNodes.add(uuid); addedNodes.add(uuid); } = - Iterator addedStates =3D new Iterator() - { - private final Iterator iter =3D addedNodes.iterator(); + searchManager.updateIndex(removedNodes, addedNodes); = - public boolean hasNext() - { - return iter.hasNext(); - } - - public NodeData next() - { - - // cycle till find a next or meet the end of set - do - { - String id =3D iter.next(); - try - { - ItemData item =3D itemMgr.getItemData(id); - if (item !=3D null) - { - if (item.isNode()) - return (NodeData)item; // return node - else - log.warn("Node not found, but property " + id + ",= " + item.getQPath().getAsString() - + " found. "); - } - else - log.warn("Unable to index node with id " + id + ", no= de does not exist."); - - } - catch (RepositoryException e) - { - log.error("Can't read next node data " + id, e); - } - } - while (iter.hasNext()); // get next if error or node not found - - return null; // we met the end of iterator set - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - - Iterator removedIds =3D new Iterator() - { - private final Iterator iter =3D removedNodes.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public String next() - { - return nextNodeId(); - } - - public String nextNodeId() throws NoSuchElementException - { - return iter.next(); - } - - public void remove() - { - throw new UnsupportedOperationException(); - - } - }; - - if (removedNodes.size() > 0 || addedNodes.size() > 0) - { - try - { - handler.updateNodes(removedIds, addedStates); - } - catch (RepositoryException e) - { - log.error("Error indexing changes " + e, e); - } - catch (IOException e) - { - log.error("Error indexing changes " + e, e); - try - { - handler.logErrorChanges(removedNodes, addedNodes); - } - catch (IOException ioe) - { - log.warn("Exception occure when errorLog writed. Error log = is not complete. " + ioe, ioe); - } - } - } - - if (log.isDebugEnabled()) - { - log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); - } - } - - /** - * Creates a query object from a node that can be executed on the works= pace. - * = - * @param session - * the session of the user executing the query. - * @param itemMgr - * the item manager of the user executing the query. Needed = to - * return Node instances in the result set. - * @param node - * a node of type nt:query. - * @return a Query instance to execute. - * @throws InvalidQueryException - * if absPath is not a valid persisted query (= that - * is, a node of type nt:query) - * @throws RepositoryException - * if any other error occurs. - */ - public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, Node node) - throws InvalidQueryException, RepositoryException - { - AbstractQueryImpl query =3D createQueryInstance(); - query.init(session, sessionDataManager, handler, node); - return query; - } - - /** - * Creates a query object that can be executed on the workspace. - * = - * @param session - * the session of the user executing the query. - * @param itemMgr - * the item manager of the user executing the query. Needed = to - * return Node instances in the result set. - * @param statement - * the actual query statement. - * @param language - * the syntax of the query statement. - * @return a Query instance to execute. - * @throws InvalidQueryException - * if the query is malformed or the language is - * unknown. - * @throws RepositoryException - * if any other error occurs. - */ - public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, String statement, - String language) throws InvalidQueryException, RepositoryException - { - AbstractQueryImpl query =3D createQueryInstance(); - query.init(session, sessionDataManager, handler, statement, language= ); - return query; - } - - /** - * just for test use only - */ - public QueryHandler getHandler() - { - return handler; - } - - public void createNewOrAdd(String key, ItemState state, Map> updatedNodes) - { - List list =3D updatedNodes.get(key); - if (list =3D=3D null) - { - list =3D new ArrayList(); - updatedNodes.put(key, list); - } - list.add(state); - - } - - public void start() - { - - if (log.isDebugEnabled()) - log.debug("start"); - try - { - if (indexingTree =3D=3D null) - { - List excludedPath =3D new ArrayList(); - // Calculating excluded node identifiers - excludedPath.add(Constants.JCR_SYSTEM_PATH); - - //if (config.getExcludedNodeIdentifers() !=3D null) - String excludedNodeIdentifer =3D - config.getParameterValue(QueryHandlerParams.PARAM_EXCLUDED_= NODE_IDENTIFERS, null); - if (excludedNodeIdentifer !=3D null) - { - StringTokenizer stringTokenizer =3D new StringTokenizer(exc= ludedNodeIdentifer); - while (stringTokenizer.hasMoreTokens()) - { - - try - { - ItemData excludeData =3D itemMgr.getItemData(stringTo= kenizer.nextToken()); - if (excludeData !=3D null) - excludedPath.add(excludeData.getQPath()); - } - catch (RepositoryException e) - { - log.warn(e.getLocalizedMessage()); - } - } - } - - NodeData indexingRootData =3D null; - String rootNodeIdentifer =3D config.getParameterValue(QueryHan= dlerParams.PARAM_ROOT_NODE_ID, null); - if (rootNodeIdentifer !=3D null) - { - try - { - ItemData indexingRootDataItem =3D itemMgr.getItemData(ro= otNodeIdentifer); - if (indexingRootDataItem !=3D null && indexingRootDataIt= em.isNode()) - indexingRootData =3D (NodeData)indexingRootDataItem; - } - catch (RepositoryException e) - { - log.warn(e.getLocalizedMessage() + " Indexing root set t= o " + Constants.ROOT_PATH.getAsString()); - - } - - } - else - { - try - { - indexingRootData =3D (NodeData)itemMgr.getItemData(Const= ants.ROOT_UUID); - } - catch (RepositoryException e) - { - log.error("Fail to load root node data"); - } - } - - indexingTree =3D new IndexingTree(indexingRootData, excludedPa= th); - } - - initializeQueryHandler(); - } - catch (RepositoryException e) - { - log.error(e.getLocalizedMessage()); - handler =3D null; - throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); - } - catch (RepositoryConfigurationException e) - { - log.error(e.getLocalizedMessage()); - handler =3D null; - throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); - } - } - - public void stop() - { - handler.close(); - log.info("Search manager stopped"); - } - - // /** - // * Checks if the given event should be excluded based on the - // * {@link #excludePath} setting. - // * - // * @param event - // * observation event - // * @return true if the event should be excluded, - // * false otherwise - // */ - // protected boolean isExcluded(ItemState event) { - // - // for (QPath excludedPath : excludedPaths) { - // if (event.getData().getQPath().isDescendantOf(excludedPath) - // || event.getData().getQPath().equals(excludedPath)) - // return true; - // } - // - // return !event.getData().getQPath().isDescendantOf(indexingRoot) - // && !event.getData().getQPath().equals(indexingRoot); - // } - - protected QueryHandlerContext createQueryHandlerContext(QueryHandler pa= rentHandler) - throws RepositoryConfigurationException - { - - QueryHandlerContext context =3D - new QueryHandlerContext(itemMgr, indexingTree, nodeTypeDataManage= r, nsReg, parentHandler, getIndexDir(), - extractor, true, virtualTableResolver); - return context; - } - - protected String getIndexDir() throws RepositoryConfigurationException - { - String dir =3D config.getParameterValue(QueryHandlerParams.PARAM_IND= EX_DIR, null); - if (dir =3D=3D null) - { - log.warn(QueryHandlerParams.PARAM_INDEX_DIR + " parameter not fou= nd. Using outdated parameter name " - + QueryHandlerParams.OLD_PARAM_INDEX_DIR); - dir =3D config.getParameterValue(QueryHandlerParams.OLD_PARAM_IND= EX_DIR); - } - return dir; - } - - /** - * Initializes the query handler. - * = - * @throws RepositoryException - * if the query handler cannot be initialized. - * @throws RepositoryConfigurationException - * @throws ClassNotFoundException - */ - protected void initializeQueryHandler() throws RepositoryException, Rep= ositoryConfigurationException - { - // initialize query handler - String className =3D config.getType(); - if (className =3D=3D null) - throw new RepositoryConfigurationException("Content hanler = configuration fail"); - - try - { - Class qHandlerClass =3D Class.forName(className, true, this.getCl= ass().getClassLoader()); - Constructor constuctor =3D qHandlerClass.getConstructor(QueryHand= lerEntry.class, ConfigurationManager.class); - handler =3D (QueryHandler)constuctor.newInstance(config, cfm); - QueryHandler parentHandler =3D (this.parentSearchManager !=3D nul= l) ? parentSearchManager.getHandler() : null; - QueryHandlerContext context =3D createQueryHandlerContext(parentH= andler); - handler.init(context); - - } - catch (SecurityException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IllegalArgumentException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (ClassNotFoundException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (NoSuchMethodException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (InstantiationException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IllegalAccessException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (InvocationTargetException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IOException e) - { - throw new RepositoryException(e.getMessage(), e); - } - } - - /** - * Creates a new instance of an {@link AbstractQueryImpl} which is not - * initialized. - * = - * @return an new query instance. - * @throws RepositoryException - * if an error occurs while creating a new query instance. - */ - protected AbstractQueryImpl createQueryInstance() throws RepositoryExce= ption - { - try - { - String queryImplClassName =3D handler.getQueryClass(); - Object obj =3D Class.forName(queryImplClassName).newInstance(); - if (obj instanceof AbstractQueryImpl) - { - return (AbstractQueryImpl)obj; - } - else - { - throw new IllegalArgumentException(queryImplClassName + " is n= ot of type " - + AbstractQueryImpl.class.getName()); - } - } - catch (Throwable t) - { - throw new RepositoryException("Unable to create query: " + t.toSt= ring(), t); - } - } - - /** - * {@inheritDoc} - */ - public Set getFieldNames() throws IndexException - { - final Set fildsSet =3D new HashSet(); - if (handler instanceof SearchIndex) - { - IndexReader reader =3D null; - try - { - reader =3D ((SearchIndex)handler).getIndexReader(); - final Collection fields =3D reader.getFieldNames(IndexReader.F= ieldOption.ALL); - for (final Object field : fields) - { - fildsSet.add((String)field); - } - } - catch (IOException e) - { - throw new IndexException(e.getLocalizedMessage(), e); - } - finally - { - try - { - if (reader !=3D null) - reader.close(); - } - catch (IOException e) - { - throw new IndexException(e.getLocalizedMessage(), e); - } - } - - } - return fildsSet; - } - - public Set getNodesByNodeType(final InternalQName nodeType) thr= ows RepositoryException - { - - return getNodes(virtualTableResolver.resolve(nodeType, true)); - } - - /** - * Return set of uuid of nodes. Contains in names prefixes maped to the - * given uri - * = - * @param prefix - * @return - * @throws RepositoryException - */ - public Set getNodesByUri(final String uri) throws RepositoryExc= eption - { - Set result; - final int defaultClauseCount =3D BooleanQuery.getMaxClauseCount(); - try - { - - // final LocationFactory locationFactory =3D new - // LocationFactory(this); - final ValueFactoryImpl valueFactory =3D new ValueFactoryImpl(new = LocationFactory(nsReg)); - BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE); - BooleanQuery query =3D new BooleanQuery(); - - final String prefix =3D nsReg.getNamespacePrefixByURI(uri); - query.add(new WildcardQuery(new Term(FieldNames.LABEL, prefix + "= :*")), Occur.SHOULD); - // name of the property - query.add(new WildcardQuery(new Term(FieldNames.PROPERTIES_SET, p= refix + ":*")), Occur.SHOULD); - - result =3D getNodes(query); - - // value of the property - - try - { - final Set props =3D getFieldNames(); - - query =3D new BooleanQuery(); - for (final String fieldName : props) - { - if (!FieldNames.PROPERTIES_SET.equals(fieldName)) - { - query.add(new WildcardQuery(new Term(fieldName, "*" + pr= efix + ":*")), Occur.SHOULD); - } - } - } - catch (final IndexException e) - { - throw new RepositoryException(e.getLocalizedMessage(), e); - } - - final Set propSet =3D getNodes(query); - // Manually check property values; - for (final String uuid : propSet) - { - if (isPrefixMatch(valueFactory, uuid, prefix)) - { - result.add(uuid); - } - } - } - finally - { - BooleanQuery.setMaxClauseCount(defaultClauseCount); - } - - return result; - } - - private boolean isPrefixMatch(final InternalQName value, final String p= refix) throws RepositoryException - { - return value.getNamespace().equals(nsReg.getNamespaceURIByPrefix(pre= fix)); - } - - private boolean isPrefixMatch(final QPath value, final String prefix) t= hrows RepositoryException - { - for (int i =3D 0; i < value.getEntries().length; i++) - { - if (isPrefixMatch(value.getEntries()[i], prefix)) - { - return true; - } - } - return false; - } - - /** - * @param valueFactory - * @param dm - * @param uuid - * @param prefix - * @throws RepositoryException - */ - private boolean isPrefixMatch(final ValueFactoryImpl valueFactory, fina= l String uuid, final String prefix) - throws RepositoryException - { - - final ItemData node =3D itemMgr.getItemData(uuid); - if (node !=3D null && node.isNode()) - { - final List props =3D itemMgr.getChildPropertiesData= ((NodeData)node); - for (final PropertyData propertyData : props) - { - if (propertyData.getType() =3D=3D PropertyType.PATH || propert= yData.getType() =3D=3D PropertyType.NAME) - { - for (final ValueData vdata : propertyData.getValues()) - { - final Value val =3D - valueFactory.loadValue(((AbstractValueData)vdata).cre= ateTransientCopy(), propertyData.getType()); - if (propertyData.getType() =3D=3D PropertyType.PATH) - { - if (isPrefixMatch(((PathValue)val).getQPath(), prefix= )) - { - return true; - } - } - else if (propertyData.getType() =3D=3D PropertyType.NAME) - { - if (isPrefixMatch(((NameValue)val).getQName(), prefix= )) - { - return true; - } - } - } - } - } - } - return false; - } - - /** - * @param query - * @return - * @throws RepositoryException - */ - private Set getNodes(final org.apache.lucene.search.Query query= ) throws RepositoryException - { - Set result =3D new HashSet(); - try - { - QueryHits hits =3D handler.executeQuery(query); - - ScoreNode sn; - - while ((sn =3D hits.nextScoreNode()) !=3D null) - { - // Node node =3D session.getNodeById(sn.getNodeId()); - result.add(sn.getNodeId()); - } - } - catch (IOException e) - { - throw new RepositoryException(e.getLocalizedMessage(), e); - } - return result; - } - } --===============5664904014614854817==-- From do-not-reply at jboss.org Mon Nov 9 06:17:37 2009 Content-Type: multipart/mixed; boundary="===============5967330136173719364==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r504 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Mon, 09 Nov 2009 06:17:37 -0500 Message-ID: <200911091117.nA9BHb1R023247@svn01.web.mwc.hst.phx2.redhat.com> --===============5967330136173719364== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-09 06:17:36 -0500 (Mon, 09 Nov 2009) New Revision: 504 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ObservationManagerRegistry.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java Log: EXOJCR-204:Observation cache loader update, test added. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ObservationManagerRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-09= 10:52:43 UTC (rev 503) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-09= 11:17:36 UTC (rev 504) @@ -20,6 +20,7 @@ = import org.exoplatform.services.jcr.core.NamespaceAccessor; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; @@ -51,21 +52,22 @@ = protected ActionLauncher launcher; = - protected SessionRegistry sessionRegistry; = protected NamespaceAccessor namespaceAccessor; = protected NodeTypeDataManager nodeTypeDataManager; = + protected WorkspacePersistentDataManager workspaceDataManager; + public ObservationManagerRegistry(WorkspacePersistentDataManager worksp= aceDataManager, SessionRegistry sessionRegistry, NamespaceAccessor namespaceAccessor) { this.sessionRegistry =3D sessionRegistry; this.listenersMap =3D new HashMap(); - this.namespaceAccessor =3D namespaceAccessor; - //this.nodeTypeDataManager =3D nodeTypeDataManager; - this.launcher =3D new ActionLauncher(this, workspaceDataManager, nod= eTypeDataManager, sessionRegistry); + this.nodeTypeDataManager =3D nodeTypeDataManager; + this.workspaceDataManager =3D workspaceDataManager; + //this.launcher =3D new ActionLauncher(this, workspaceDataManager, n= odeTypeDataManager, sessionRegistry); } = public ObservationManagerImpl createObservationManager(SessionImpl sess= ion) @@ -111,11 +113,23 @@ listenersMap.remove(listener); } } - = = - public ActionLauncher getLauncher() + // TODO: remove hardcode + public NodeTypeDataManager getNodeTypeDataManager() { - return launcher; + return nodeTypeDataManager; } + + // TODO: remove hardcode + public WorkspacePersistentDataManager getWorkspaceDataManager() + { + return workspaceDataManager; + } + + // TODO: remove hardcode + public LocationFactory getLocationFactory() + { + return new LocationFactory(namespaceAccessor); + } = } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-09 1= 0:52:43 UTC (rev 503) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-09 1= 1:17:36 UTC (rev 504) @@ -31,6 +31,7 @@ import org.exoplatform.services.log.Log; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; +import org.jboss.cache.factories.annotations.Inject; = import java.util.List; = @@ -54,7 +55,7 @@ = private final Fqn propFqn =3D Fqn.fromString(JBossCacheStorage.PROPS); = - private ObservationManagerRegistry observationManagerRegistry=3Dnull; + private ObservationManagerRegistry observationManagerRegistry =3D null; = /** * = @@ -63,6 +64,12 @@ { } = + @Inject + public void insertObservationRegistry(ObservationManagerRegistry observ= ationManagerRegistry) + { + this.observationManagerRegistry =3D observationManagerRegistry; + } + /** * @see org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWr= iteOnlyCacheLoader#put(java.util.List) */ @@ -70,6 +77,72 @@ public void put(List modifications) throws Exception { = + // get SessionID from list + // TODO: get real user ID + String userId =3D "admin-dummy-id"; + + // get UserID from list + // TODO: get real session ID + String sessionId =3D "user-session-dummy-id"; + + // extract real list from list of modification + // real - means list with out fake modifications containing UserID &= etc + + // for each listener + // for each element from real list post and event, if filtering ok = + + if (observationManagerRegistry !=3D null) + { + + EventListenerIterator eventListeners =3D observationManagerRegist= ry.getEventListeners(); + while (eventListeners.hasNext()) + { + EventListener listener =3D eventListeners.nextEventListener(); + ListenerCriteria criteria =3D observationManagerRegistry.getLi= stenerFilter(listener); + + EntityCollection events =3D new EntityCollection(); + + for (Modification m : modifications) + { + + if (m.getFqn().isDirectChildOf(nodeFqn) || m.getFqn().isDir= ectChildOf(propFqn)) + { + ItemData item =3D getItemData(m); + // TODO: remove hardcode + if (item =3D=3D null) + { + break; + } // it wasn't able to retrive item's data + int eventType =3D eventType(m); + boolean result =3D true; + // check event type + result &=3D isTypeMatch(criteria, eventType); + // check Path + result &=3D isPathMatch(criteria, item); + // check UUID + result &=3D isIdentifierMatch(criteria, item); + // check NodeType + // TODO: FIX nodetype checks + //result &=3D isNodeTypeMatch(criteria, item, changesLog= ); + // check session + result &=3D isSessionMatch(criteria, sessionId); + if (result) + { + String path =3D + observationManagerRegistry.getLocationFactory().cr= eateJCRPath(item.getQPath()).getAsString( + false); + events.add(new EventImpl(eventType, path, userId)); + } + } + } + + if (events.size() > 0) + { + // no events - no onEvent() action + listener.onEvent(events); + } + } + } } = private int eventType(Modification modification) @@ -77,28 +150,32 @@ // TODO: REMOVE cache structure hardcode! switch (modification.getType()) { - case PUT_DATA : - if (modification.getFqn().isDirectChildOf(nodeFqn)) + case PUT_KEY_VALUE : + // put something to /$node/IDxxxx.ITEMDATA = + if (modification.getKey().equals(JBossCacheStorage.ITEM_DATA)) { - // node added - return Event.NODE_ADDED; - } - else if (modification.getFqn().isDirectChildOf(propFqn)) - { - // property added or changed - if (modification.getOldValue() !=3D null) + if (modification.getFqn().isDirectChildOf(nodeFqn)) { - // property changed - // TODO: possibly bad idea - return Event.PROPERTY_CHANGED; + // node added + return Event.NODE_ADDED; } - else + else if (modification.getFqn().isDirectChildOf(propFqn)) { - // property added - return Event.PROPERTY_ADDED; + // property added or changed + if (modification.getOldValue() !=3D null) + { + // property changed + return Event.PROPERTY_CHANGED; + } + else + { + // property added + return Event.PROPERTY_ADDED; + } } } break; + case REMOVE_NODE : if (modification.getFqn().isDirectChildOf(nodeFqn)) { @@ -207,7 +284,7 @@ = protected ItemData getItemData(Modification m) { - return (ItemData)m.getData().get(JBossCacheStorage.ITEM_DATA); + return (ItemData)m.getValue(); } = } Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 09 11:17:36 UTC (rev 504) @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.core.NamespaceAccessor; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.observation.ListenerCriteria; +import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.jboss.cache.Fqn; +import org.jboss.cache.Modification; +import org.jboss.cache.Modification.ModificationType; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.jcr.NamespaceException; +import javax.jcr.RepositoryException; +import javax.jcr.observation.Event; +import javax.jcr.observation.EventIterator; +import javax.jcr.observation.EventListener; + +/** + * @author Nikolay Zamosenchuk + * @version $Id: ObservationCacheLoaderTest.java 34360 2009-07-22 23:58:59= Z aheritier $ + * + */ +public class ObservationCacheLoaderTest extends TestCase +{ + + private ObservationCacheLoader loader; + + private ObservationManagerRegistry registry; + + private LocationFactory lf; + + @Override + protected void setUp() throws Exception + { + super.setUp(); + loader =3D new ObservationCacheLoader(); + registry =3D new DummyObservationRegistry(); + loader.insertObservationRegistry(registry); + + final Map ns =3D new HashMap(); + + final Map nss =3D new HashMap(); + + ns.put("jcr", "http:jcr"); + ns.put("", ""); + nss.put("http:jcr", "jcr"); + nss.put("", ""); + + this.lf =3D new LocationFactory(new NamespaceAccessor() + { + + public String getNamespaceURIByPrefix(String prefix) throws Names= paceException, RepositoryException + { + return ns.get(prefix); + } + + public String getNamespacePrefixByURI(String uri) throws Namespac= eException, RepositoryException + { + return nss.get(uri); + } + + public String[] getAllNamespacePrefixes() throws RepositoryExcept= ion + { + return ns.keySet().toArray(new String[ns.keySet().size()]); + } + }); + } + + public void testAddNode() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + NodeData newNode =3D + new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Consta= nts.NT_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + DummyListener listener =3D new DummyListener(); + registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, + lf.parseAbsPath("/").getInternalPath(), true, null, null, false, = "asd")); + + List modifications =3D new ArrayList(); + modifications.add(addNode(newNode)); + loader.put(modifications); + assertEquals(1, listener.eventList.size()); + Event event =3D listener.eventList.get(0); + assertEquals(Event.NODE_ADDED, event.getType()); + assertEquals(lf.createJCRPath(node1path).getAsString(false), event.g= etPath()); + } + + public Modification addNode(NodeData data) + { + // add in NODES + String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); + return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + //node.put(ITEM_DATA, data); = + } + + @Override + protected void tearDown() throws Exception + { + super.tearDown(); + } + + class DummyObservationRegistry extends ObservationManagerRegistry + { + public DummyObservationRegistry() + { + super(null, null, null); + } + + // TODO: remove hardcode + public LocationFactory getLocationFactory() + { + return lf; + } + + } + + class DummyListener implements EventListener + { + + public List eventList =3D new ArrayList(); + + public void onEvent(EventIterator events) + { + while (events.hasNext()) + { + eventList.add(events.nextEvent()); + } + } + + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderT= est.java ___________________________________________________________________ Name: svn:mime-type + text/plain --===============5967330136173719364==-- From do-not-reply at jboss.org Mon Nov 9 06:37:43 2009 Content-Type: multipart/mixed; boundary="===============1395412271789541277==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r505 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 06:37:43 -0500 Message-ID: <200911091137.nA9BbhIx027552@svn01.web.mwc.hst.phx2.redhat.com> --===============1395412271789541277== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-09 06:37:43 -0500 (Mon, 09 Nov 2009) New Revision: 505 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202 : base cache loader test Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-09 = 11:37:43 UTC (rev 505) @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.jboss.cache.Cache; +import org.jboss.cache.CacheFactory; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; +import org.jboss.cache.config.CacheLoaderConfig; +import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; + +import java.io.Serializable; + +/** + * @author Sergey K= abashnyuk + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ + * + */ +public abstract class AbstractCacheLoaderTest extends TestCase +{ + protected Cache cache; + + protected JBossCacheStorageConnection jBossCacheStorageConnection; + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception + { + super.setUp(); + CacheFactory factory =3D new DefaultCacheFacto= ry(); + cache =3D factory.createCache(createCacheConfiguration()); + + Node cacheRoot =3D cache.getRoot(); + + // run cache + cache.create(); + cache.start(); + cache.startBatch(); + // prepare cache structures + Node nodes =3D cacheRoot.addChild(Fqn.fromStri= ng(JBossCacheStorage.NODES)); + Node props =3D cacheRoot.addChild(Fqn.fromStri= ng(JBossCacheStorage.PROPS)); + + this.cache.endBatch(true); + + // JCR connection + jBossCacheStorageConnection =3D new JBossCacheStorageConnection(cach= e, nodes, props); + } + + /** + * Create cache configuration. + * @return + */ + protected Configuration createCacheConfiguration() + { + Configuration config =3D new Configuration(); + config.setInvocationBatchingEnabled(true); + config.setCacheLoaderConfig(createCacheLoaderConfig()); + return config; + } + + /** + * Create cache configuration. + * @return + */ + protected CacheLoaderConfig createCacheLoaderConfig() + { + CacheLoaderConfig cacheLoaderConfig =3D new CacheLoaderConfig(); + cacheLoaderConfig.setPassivation(false); + cacheLoaderConfig.setShared(false); + cacheLoaderConfig.addIndividualCacheLoaderConfig(createIndividualCac= heLoaderConfig()); + return cacheLoaderConfig; + }; + + protected abstract IndividualCacheLoaderConfig createIndividualCacheLoa= derConfig(); + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest= .java ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 1:37:43 UTC (rev 505) @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.cache.Modification; +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; + +import java.util.List; + +/** + * @author Sergey K= abashnyuk + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ + * + */ +public class IndexerCacheLoaderTest extends AbstractCacheLoaderTest +{ + private final Log log =3D ExoLogger.getLogger(IndexerCacheLoaderTest.cl= ass.getName()); + + public void testAddRoot() throws Exception + { + // add root (/) + jBossCacheStorageConnection.add(new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new Acc= essControlList())); + jBossCacheStorageConnection.commit(); + } + + /** + * @see org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractCa= cheLoaderTest#createIndividualCacheLoaderConfig() + */ + @Override + protected IndividualCacheLoaderConfig createIndividualCacheLoaderConfig= () + { + IndividualCacheLoaderConfig individualCacheLoaderConfig =3D new Indi= vidualCacheLoaderConfig(); + individualCacheLoaderConfig.setCacheLoader(new DummyCacheLoader()); + return individualCacheLoaderConfig; + } + + private class DummyCacheLoader extends AbstractWriteOnlyCacheLoader + { + + /** + * @see org.exoplatform.services.jcr.impl.storage.jbosscache.Abstrac= tWriteOnlyCacheLoader#put(java.util.List) + */ + @Override + public void put(List modifications) throws Exception + { + log.info("put:" + modifications); + + } + + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.= java ___________________________________________________________________ Name: svn:mime-type + text/plain --===============1395412271789541277==-- From do-not-reply at jboss.org Mon Nov 9 07:16:49 2009 Content-Type: multipart/mixed; boundary="===============2329829365712155531==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r506 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 07:16:49 -0500 Message-ID: <200911091216.nA9CGnEj003679@svn01.web.mwc.hst.phx2.redhat.com> --===============2329829365712155531== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-09 07:16:49 -0500 (Mon, 09 Nov 2009) New Revision: 506 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202: IndexerCacheLoaderTest updated = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 1:37:43 UTC (rev 505) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 2:16:49 UTC (rev 506) @@ -21,14 +21,27 @@ import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.SessionDataManager; +import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.query.IndexException; +import org.exoplatform.services.jcr.impl.core.query.QueryHandler; +import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Modification; import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; = +import java.io.IOException; import java.util.List; +import java.util.Set; = +import javax.jcr.Node; +import javax.jcr.RepositoryException; +import javax.jcr.query.InvalidQueryException; +import javax.jcr.query.Query; + /** * @author Sergey K= abashnyuk * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ @@ -38,12 +51,76 @@ { private final Log log =3D ExoLogger.getLogger(IndexerCacheLoaderTest.cl= ass.getName()); = + private IndexerCacheLoader loader; + + private FakeSearchManager manager; + + class FakeSearchManager implements SearchManager + { + + private Set removedNodes; + + private Set addedNodes; + + public Query createQuery(SessionImpl session, SessionDataManager ses= sionDataManager, Node node) + throws InvalidQueryException, RepositoryException + { + return null; + } + + public Query createQuery(SessionImpl session, SessionDataManager ses= sionDataManager, String statement, + String language) throws InvalidQueryException, RepositoryException + { + return null; + } + + public Set getFieldNames() throws IndexException + { + return null; + } + + public QueryHandler getHandler() + { + return null; + } + + public Set getNodesByNodeType(InternalQName nodeType) throws= RepositoryException + { + return null; + } + + public Set getNodesByUri(String uri) throws RepositoryExcept= ion + { + return null; + } + + public void updateIndex(Set removedNodes, Set addedN= odes) throws RepositoryException, IOException + { + this.removedNodes =3D removedNodes; + this.addedNodes =3D addedNodes; + } + + public Set getRemovedNodes() + { + return removedNodes; + } + + public Set getAddedNodes() + { + return addedNodes; + } + } + public void testAddRoot() throws Exception { // add root (/) jBossCacheStorageConnection.add(new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new Acc= essControlList())); jBossCacheStorageConnection.commit(); + + assertTrue(manager.getRemovedNodes().isEmpty()); + assertFalse(manager.getAddedNodes().isEmpty()); + } = /** @@ -53,7 +130,10 @@ protected IndividualCacheLoaderConfig createIndividualCacheLoaderConfig= () { IndividualCacheLoaderConfig individualCacheLoaderConfig =3D new Indi= vidualCacheLoaderConfig(); - individualCacheLoaderConfig.setCacheLoader(new DummyCacheLoader()); + loader =3D new IndexerCacheLoader(); + manager =3D new FakeSearchManager(); + loader.registerSearchManager(manager); + individualCacheLoaderConfig.setCacheLoader(loader); return individualCacheLoaderConfig; } = @@ -71,4 +151,9 @@ } = } + + public void testAddNode() throws Exception + { + + } } --===============2329829365712155531==-- From do-not-reply at jboss.org Mon Nov 9 07:19:15 2009 Content-Type: multipart/mixed; boundary="===============0877600423072310919==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r507 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 07:19:15 -0500 Message-ID: <200911091219.nA9CJFET004020@svn01.web.mwc.hst.phx2.redhat.com> --===============0877600423072310919== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-09 07:19:15 -0500 (Mon, 09 Nov 2009) New Revision: 507 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202 : sort members Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 2:16:49 UTC (rev 506) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 2:19:15 UTC (rev 507) @@ -55,6 +55,37 @@ = private FakeSearchManager manager; = + public void testAddNode() throws Exception + { + + } + + public void testAddRoot() throws Exception + { + // add root (/) + jBossCacheStorageConnection.add(new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new Acc= essControlList())); + jBossCacheStorageConnection.commit(); + + assertTrue(manager.getRemovedNodes().isEmpty()); + assertFalse(manager.getAddedNodes().isEmpty()); + + } + + /** + * @see org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractCa= cheLoaderTest#createIndividualCacheLoaderConfig() + */ + @Override + protected IndividualCacheLoaderConfig createIndividualCacheLoaderConfig= () + { + IndividualCacheLoaderConfig individualCacheLoaderConfig =3D new Indi= vidualCacheLoaderConfig(); + loader =3D new IndexerCacheLoader(); + manager =3D new FakeSearchManager(); + loader.registerSearchManager(manager); + individualCacheLoaderConfig.setCacheLoader(loader); + return individualCacheLoaderConfig; + } + class FakeSearchManager implements SearchManager { = @@ -74,6 +105,11 @@ return null; } = + public Set getAddedNodes() + { + return addedNodes; + } + public Set getFieldNames() throws IndexException { return null; @@ -94,49 +130,18 @@ return null; } = - public void updateIndex(Set removedNodes, Set addedN= odes) throws RepositoryException, IOException - { - this.removedNodes =3D removedNodes; - this.addedNodes =3D addedNodes; - } - public Set getRemovedNodes() { return removedNodes; } = - public Set getAddedNodes() + public void updateIndex(Set removedNodes, Set addedN= odes) throws RepositoryException, IOException { - return addedNodes; + this.removedNodes =3D removedNodes; + this.addedNodes =3D addedNodes; } } = - public void testAddRoot() throws Exception - { - // add root (/) - jBossCacheStorageConnection.add(new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new Acc= essControlList())); - jBossCacheStorageConnection.commit(); - - assertTrue(manager.getRemovedNodes().isEmpty()); - assertFalse(manager.getAddedNodes().isEmpty()); - - } - - /** - * @see org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractCa= cheLoaderTest#createIndividualCacheLoaderConfig() - */ - @Override - protected IndividualCacheLoaderConfig createIndividualCacheLoaderConfig= () - { - IndividualCacheLoaderConfig individualCacheLoaderConfig =3D new Indi= vidualCacheLoaderConfig(); - loader =3D new IndexerCacheLoader(); - manager =3D new FakeSearchManager(); - loader.registerSearchManager(manager); - individualCacheLoaderConfig.setCacheLoader(loader); - return individualCacheLoaderConfig; - } - private class DummyCacheLoader extends AbstractWriteOnlyCacheLoader { = @@ -149,11 +154,5 @@ log.info("put:" + modifications); = } - } - - public void testAddNode() throws Exception - { - - } } --===============0877600423072310919==-- From do-not-reply at jboss.org Mon Nov 9 08:04:57 2009 Content-Type: multipart/mixed; boundary="===============4545710200809224668==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r508 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader. Date: Mon, 09 Nov 2009 08:04:57 -0500 Message-ID: <200911091304.nA9D4vMj013321@svn01.web.mwc.hst.phx2.redhat.com> --===============4545710200809224668== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-09 08:04:57 -0500 (Mon, 09 Nov 2009) New Revision: 508 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java Log: EXOJCR-202: IndexerCacheLoader updated = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-09 1= 2:19:15 UTC (rev 507) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-09 1= 3:04:57 UTC (rev 508) @@ -19,6 +19,7 @@ import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; +import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= age; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.CacheException; @@ -58,21 +59,27 @@ searchManager =3D manager; } = - private String parseUUID(Fqn fqn) + private String parseUUID(Fqn fqn) { - // TODO check is zero element not ROOT = - // get just uuid - Fqn uuid =3D (Fqn)fqn.get(1); - //remove slash - return uuid.toString().substring(1); + if (fqn.size() > 1) + { + + // get only uuid + String uuid =3D (String)fqn.get(1); + //remove slash + return uuid; + } + else + { + return null; + } } = - private boolean isNode(Fqn fqn) + private boolean isNode(Fqn fqn) { - Fqn items =3D (Fqn)fqn.get(0); + String items =3D (String)fqn.get(0); String s =3D items.toString(); - //TODO check Constants - return s.equals("/$NODES"); + return s.equals(JBossCacheStorage.NODES); } = @Override @@ -92,81 +99,84 @@ = String uuid =3D parseUUID(m.getFqn()); = - switch (m.getType()) + if (uuid !=3D null) { - case PUT_DATA : - // add node - // TODO do we need there update for property? - // if this is property ignore = - if (isNode(m.getFqn())) - { - addedNodes.add(uuid); - } + switch (m.getType()) + { + case PUT_DATA : + // add node + // TODO do we need there update for property? + // if this is property ignore = + if (isNode(m.getFqn())) + { + addedNodes.add(uuid); + } = - break; - case PUT_DATA_ERASE : - // must be never called - // update node - if (isNode(m.getFqn())) - { - removedNodes.add(uuid); - addedNodes.add(uuid); - } - break; - case PUT_KEY_VALUE : - // must be never called - // update node - if (isNode(m.getFqn())) - { - removedNodes.add(uuid); - addedNodes.add(uuid); - } - break; - case REMOVE_DATA : - // must be never called - // update node - if (isNode(m.getFqn())) - { - addedNodes.add(uuid); - removedNodes.add(uuid); - } - break; - case REMOVE_KEY_VALUE : - // must be never called - // removed property what to do - if (isNode(m.getFqn())) - { - addedNodes.add(uuid); - removedNodes.add(uuid); - } - break; - case REMOVE_NODE : - // if node - remove it, otherwise ignore it - if (isNode(m.getFqn())) - { - removedNodes.add(uuid); - } + break; + case PUT_DATA_ERASE : + // must be never called + // update node + if (isNode(m.getFqn())) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } + break; + case PUT_KEY_VALUE : + // must be never called + // update node + if (isNode(m.getFqn())) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } + break; + case REMOVE_DATA : + // must be never called + // update node + if (isNode(m.getFqn())) + { + addedNodes.add(uuid); + removedNodes.add(uuid); + } + break; + case REMOVE_KEY_VALUE : + // must be never called + // removed property what to do + if (isNode(m.getFqn())) + { + addedNodes.add(uuid); + removedNodes.add(uuid); + } + break; + case REMOVE_NODE : + // if node - remove it, otherwise ignore it + if (isNode(m.getFqn())) + { + removedNodes.add(uuid); + } = - break; - case MOVE : - // involve moving all children too - move(m.getFqn(), m.getFqn2()); - if (isNode(m.getFqn())) - { - //remove first - removedNodes.add(parseUUID(m.getFqn())); - //add second - addedNodes.add(parseUUID(m.getFqn2())); - } - else - { - // must be never happen - // TODO update both nodes - } + break; + case MOVE : + // involve moving all children too + move(m.getFqn(), m.getFqn2()); + if (isNode(m.getFqn())) + { + //remove first + removedNodes.add(parseUUID(m.getFqn())); + //add second + addedNodes.add(parseUUID(m.getFqn2())); + } + else + { + // must be never happen + // TODO update both nodes + } = - break; - default : - throw new CacheException("Unknown modification " + m.getTyp= e()); + break; + default : + throw new CacheException("Unknown modification " + m.get= Type()); + } } } = --===============4545710200809224668==-- From do-not-reply at jboss.org Mon Nov 9 09:04:46 2009 Content-Type: multipart/mixed; boundary="===============9169968676707951980==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r509 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Mon, 09 Nov 2009 09:04:46 -0500 Message-ID: <200911091404.nA9E4kD0025271@svn01.web.mwc.hst.phx2.redhat.com> --===============9169968676707951980== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-09 09:04:45 -0500 (Mon, 09 Nov 2009) New Revision: 509 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-200: get childs impls Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -09 13:04:57 UTC (rev 508) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -09 14:04:45 UTC (rev 509) @@ -148,6 +148,7 @@ } = // remove child on Parent + // TODO validate does deleted boolean removed =3D parent.removeChild(makeChildNodeFqn(data.getQPath().getEntries= ()[data.getQPath().getEntries().length - 1])); } @@ -172,6 +173,7 @@ } = // remove from parent's properties attr + // TODO validate does deleted Object prev =3D parent.remove(data.getQPath().getName().getAsString(= )); = // remove from PROPERTIES @@ -187,7 +189,7 @@ Node parentNode =3D nodesRoot.getChild(makeNod= eFqn(parent.getIdentifier())); if (parentNode =3D=3D null) { - throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); + throw new IllegalStateException("FATAL Get child Nodes: parent no= t found " + parent.getQPath().getAsString()); } = Set> childNodes =3D parentNode.getChildre= n(); @@ -195,13 +197,18 @@ List childs =3D new ArrayList(); for (Node child : childNodes) { - String childId =3D (String)child.get(ITEM_ID); + String nodeId =3D (String)child.get(ITEM_ID); + if (nodeId =3D=3D null) + { + throw new RepositoryException("FATAL Child Node Id key is null= . Parent " + parent.getQPath().getAsString()); + } = // TODO NodeData or PropertyData? As ItemData check then and cast. - Node node =3D nodesRoot.getChild(makeNodeFq= n(childId)); + Node node =3D nodesRoot.getChild(makeNodeFq= n(nodeId)); if (node =3D=3D null) { - throw new RepositoryException("Child node is null. Parent " + = parent.getQPath().getAsString()); + throw new RepositoryException("FATAL Node record not found(" += nodeId + "), but listed in proprties of " + + parent.getQPath().getAsString()); } NodeData nodeData =3D (NodeData)node.get(ITEM_DATA); if (nodeData =3D=3D null) @@ -236,11 +243,10 @@ */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException { - //TODO treeRoot.getChild(f) possible if f not a direct child??? = Node parentNode =3D nodesRoot.getChild(makeNod= eFqn(parent.getIdentifier())); if (parentNode =3D=3D null) { - throw new IllegalStateException("Get child Properties error: pare= nt not found " + throw new IllegalStateException("FATAL Get child Properties: pare= nt not found " + parent.getQPath().getAsString()); } = @@ -248,21 +254,26 @@ = for (Serializable key : parentNode.getKeys()) { - if (!key.equals(ITEM_ID)) + if (!key.equals(ITEM_DATA)) { String propId =3D (String)parentNode.get(key); + if (propId =3D=3D null) = + { + throw new RepositoryException("FATAL Child Property Id key = is null. Parent " + + parent.getQPath().getAsString()); + } = Node prop =3D propsRoot.getChild(makePro= pFqn(propId)); if (prop =3D=3D null) { - throw new RepositoryException("Child property is null. Pare= nt " + parent.getQPath().getAsString()); + throw new RepositoryException("FATAL Property record not fo= und(" + propId + + "), but listed in proprties of " + parent.getQPath().g= etAsString()); } = PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); if (propData =3D=3D null) { - // TODO should not occurs by contract - throw new RepositoryException("Child property data is null.= Parent " + parent.getQPath().getAsString()); + throw new RepositoryException("FATAL Property data is null.= Parent " + parent.getQPath().getAsString()); } = childs.add(propData); @@ -293,15 +304,31 @@ if (childNode !=3D null) { String nodeId =3D (String)childNode.get(ITEM_ID); - Node node =3D nodesRoot.getChild(makeNodeFq= n(nodeId)); - Object itemData =3D node.get(ITEM_DATA); - if (itemData !=3D null) + if (nodeId !=3D null) { - return (NodeData)itemData; + Node node =3D nodesRoot.getChild(makeNod= eFqn(nodeId)); + if (node !=3D null) + { + Object itemData =3D node.get(ITEM_DATA); + if (itemData !=3D null) + { + return (NodeData)itemData; + } + else + { + throw new RepositoryException("FATAL NodeData empty " + = parentData.getQPath() + + name.getAsString(true)); + } + } + else + { + throw new RepositoryException("FATAL Node record not found = (" + name.getAsString(true) + + "), but listed in childs of " + parentData.getQPath()); + } } else { - throw new RepositoryException("FATAL NodeData empty " + parent= Data.getQPath() + name.getAsString(true)); + throw new RepositoryException("FATAL Node Id empty " + parentD= ata.getQPath() + name.getAsString(true)); } } else @@ -314,14 +341,31 @@ String propId =3D (String)parent.get(name.getAsString(false)); if (propId !=3D null) { - return (PropertyData)propsRoot.get(makePropFqn(propId)); + Node prop =3D propsRoot.getChild(make= PropFqn(propId)); + if (prop !=3D null) + { + Object itemData =3D prop.get(ITEM_DATA); + if (itemData !=3D null) + { + return (PropertyData)itemData; + } + else + { + throw new RepositoryException("FATAL PropertyData emp= ty " + parentData.getQPath() + + name.getAsString(true)); + } + } + else + { + throw new RepositoryException("FATAL Property record not= found(" + name.getAsString(true) + + "), but listed in proprties of " + parentData.getQP= ath().getAsString()); + } } } else { - // TODO validation of ParentNotFound for Property - throw new RepositoryException("Parent not found " + parentData= .getIdentifier() + ", " - + parentData.getQPath().getAsString()); + throw new RepositoryException("FATAL Parent not found " + pare= ntData.getQPath().getAsString() + " for " + + name.getAsString(true)); } } = @@ -404,38 +448,20 @@ throw new InvalidItemStateException("Node was updated previously = or removed " + data.getQPath().getAsString()); } = - QPath prevPath; - - Object itemData =3D node.get(ITEM_DATA); - if (itemData =3D=3D null) - { - throw new RepositoryException("FATAL NodeData empty " + node.getF= qn()); - } - - if (itemData instanceof NodeData) - { - prevPath =3D ((NodeData)itemData).getQPath(); - } - else - { - throw new RepositoryException("FATAL Node data is not NodeData " = + node.getFqn()); - } - if (data.getParentIdentifier() !=3D null) { // check if parent is cached Node parent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); if (parent =3D=3D null) { - throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); + throw new RepositoryException("FATAL Node's parent not found "= + data.getQPath().getAsString()); } = - // update child on Parent (remove prev, add new) + // update child on Parent + // TODO (wrong logic) get previously cached NodeData and using it= s name remove child on the parent + //boolean removed =3D + // parent.removeChild(makeChildNodeFqn(prevPath.getEntries()[pr= evPath.getEntries().length - 1])); = - // get previously cached NodeData and using its name remove child= on the parent - boolean removed =3D - parent.removeChild(makeChildNodeFqn(prevPath.getEntries()[prev= Path.getEntries().length - 1])); - Node childNode =3D parent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[= data.getQPath().getEntries().length - 1])); = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 13:04:57 UTC (rev 508) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 14:04:45 UTC (rev 509) @@ -54,7 +54,9 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Node; = +import java.io.IOException; import java.io.Serializable; +import java.io.UnsupportedEncodingException; import java.util.List; = /** @@ -90,16 +92,16 @@ = cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); = + // run cache + cache.create(); + cache.start(); + Node cacheRoot =3D cache.getRoot(); = // prepare cache structures nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); = - // run cache - cache.create(); - cache.start(); - // JCR connection conn =3D new JBossCacheStorageConnection(cache, nodes, props); } @@ -150,13 +152,39 @@ assertEquals("Node path wrong", nodePath, data.getQPath()); } = + private void checkProp(String propId, QPath propPath, Object propValue)= throws UnsupportedEncodingException, + IllegalStateException, IOException + { + Node prop =3D props.getChild(Fqn.fromElements(= propId)); + Object dataObject =3D prop.get(JBossCacheStorage.ITEM_DATA); + assertNotNull("Property item data should exists", dataObject); + assertTrue("Property item data is not a Property", dataObject instan= ceof PropertyData); + + PropertyData propData =3D (PropertyData)dataObject; + assertEquals("Property id wrong", propId, propData.getIdentifier()); + assertEquals("Property path wrong", propPath, propData.getQPath()); + assertEquals("Property Value wrong", propValue, new String(propData.= getValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + } + + private void checkChildProp(Node node, InternalQN= ame propName, String propId, QPath propPath, + Object propValue) throws UnsupportedEncodingException, IllegalStateE= xception, IOException + { + String pid =3D (String)node.get(propName.getAsString()); + = + assertNotNull("Property ID should exists", pid); + assertEquals("Property ID wrong", propId, pid); + + checkProp(propId, propPath, propValue); + } + private void checkChildNode(Node rootNode, String= childId, QPath childPath) { - checkChildNode(rootNode, childId, childPath, null, null); + checkChildNode(rootNode, childId, childPath, -1, -1); } = - private void checkChildNode(Node rootNode, String= childId, QPath childPath, Integer orderNum, - Integer version) + private void checkChildNode(Node rootNode, String= childId, QPath childPath, int orderNum, + int version) { Node childNode =3D rootNode.getChild(Fqn @@ -164,7 +192,7 @@ = assertNotNull("Child Node should exists", childNode); String childNodeId =3D (String)childNode.get(JBossCacheStorage.ITEM_= ID); - Node node =3D props.getChild(Fqn.fromElements(= childNodeId)); + Node node =3D nodes.getChild(Fqn.fromElements(= childNodeId)); assertNotNull("Node by ID should exists", node); = Object childNodeObject =3D node.get(JBossCacheStorage.ITEM_DATA); @@ -173,14 +201,14 @@ assertEquals("Node id wrong", childId, childNodeData.getIdentifier()= ); assertEquals("Node path wrong", childPath, childNodeData.getQPath()); = - if (orderNum !=3D null) + if (orderNum >=3D 0) { - //assertEquals("Node order number wrong", orderNum, childNodeData= .getOrderNumber()); + assertEquals("Node order number wrong", orderNum, childNodeData.g= etOrderNumber()); } = - if (version !=3D null) + if (version >=3D 0) { - //assertEquals("Node persisted version wrong", version, childNode= Data.getPersistedVersion()); + assertEquals("Node persisted version wrong", version, childNodeDa= ta.getPersistedVersion()); } } = @@ -238,21 +266,16 @@ propData2.setValue(new TransientValueData(propValue2)); conn.add(propData2); = - // check in nodes - treePrint(nodes); + // check in props + treePrint(props); = Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); = assertEquals("Attributes ammount wrong", 3, rootNode.getKeys().size(= )); = - String pid1 =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAs= String()); - assertNotNull("Property ID should exists", pid1); - assertEquals("Property ID wrong", propId1, pid1); - - String pid2 =3D (String)rootNode.get(Constants.JCR_MIXINTYPES.getAsS= tring()); - assertNotNull("Property ID should exists", pid2); - assertEquals("Property ID wrong", propId2, pid2); - + checkChildProp(rootNode, Constants.JCR_PRIMARYTYPE, propId1, propPat= h1, propValue1); + checkChildProp(rootNode, Constants.JCR_MIXINTYPES, propId2, propPath= 2, propValue2); + = // TODO check order int index =3D 0; for (Serializable key : rootNode.getKeys()) @@ -260,31 +283,6 @@ //System.out.println(key); //index++; } - - // check in props - treePrint(props); - - Node itemsProp1 =3D props.getChild(Fqn.fromEle= ments(propId1)); - Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data1Object); - assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); - - PropertyData data1 =3D (PropertyData)data1Object; - assertEquals("Property id wrong", propId1, data1.getIdentifier()); - assertEquals("Property path wrong", propPath1, data1.getQPath()); - assertEquals("Property Value wrong", propValue1, new String(data1.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - - Node itemsProp2 =3D props.getChild(Fqn.fromEle= ments(propId2)); - Object data2Object =3D itemsProp2.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data2Object); - assertTrue("Property item data is not a Property", data2Object insta= nceof PropertyData); - - PropertyData data2 =3D (PropertyData)data2Object; - assertEquals("Property id wrong", propId2, data2.getIdentifier()); - assertEquals("Property path wrong", propPath2, data2.getQPath()); - assertEquals("Property Value wrong", propValue2, new String(data2.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); } = public void testDeleteNode() throws Exception @@ -437,45 +435,45 @@ checkChildNode(rootNode, node2id, node1path); checkChildNode(rootNode, node3id, node3path); = -// Node childNode1 =3D -// rootNode.getChild(Fqn -// .fromElements(node1path.getEntries()[node1path.getEntries().= length - 1].getAsString(true))); -// -// assertNotNull("Child Node should exists", childNode1); -// String childNode1id =3D (String)childNode1.get(JBossCacheStorage.I= TEM_ID); -// Node node1 =3D props.getChild(Fqn.fromElemen= ts(childNode1id)); -// assertNotNull("Node by ID should exists", node1); -// -// Object childNode1Object =3D node1.get(JBossCacheStorage.ITEM_DATA); -// assertTrue("Node item data is not a Node", childNode1Object instan= ceof NodeData); -// assertEquals("Node id wrong", node2id, ((NodeData)childNode1Object= ).getIdentifier()); -// assertEquals("Node path wrong", node2path, ((NodeData)childNode1Ob= ject).getQPath()); -// -// // get /snsNode:2 from childs of root / -// Node childNode2 =3D -// rootNode.getChild(Fqn -// .fromElements(node2path.getEntries()[node2path.getEntries().= length - 1].getAsString(true))); -// -// assertNotNull("Child Node should exists", childNode2); -// String childNode2id =3D (String)childNode2.get(JBossCacheStorage.I= TEM_ID); -// Node node2 =3D props.getChild(Fqn.fromElemen= ts(childNode2id)); -// assertNotNull("Node by ID should exists", node2); -// -// Object childNode1Object =3D node1.get(JBossCacheStorage.ITEM_DATA); -// assertTrue("Node item data is not a Node", childNode1Object instan= ceof NodeData); -// assertEquals("Node id wrong", node2id, ((NodeData)childNode1Object= ).getIdentifier()); -// assertEquals("Node path wrong", node2path, ((NodeData)childNode1Ob= ject).getQPath()); -// -// assertEquals("Child expected", 3, rootNode.getChildren().size()); -// -// Node itemNode =3D nodes.getChild(Fqn.fromEle= ments(node1id)); -// assertNotNull("Node item data should exists", itemNode); -// -// Object dataObject =3D itemNode.get(JBossCacheStorageConnection.ITE= M_DATA); -// assertTrue("Node item data should be a NodeData", dataObject insta= nceof NodeData); -// assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getI= dentifier()); -// assertEquals("Node path wrong", node1path, ((NodeData)dataObject).= getQPath()); -// assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)= dataObject).getOrderNumber()); + // Node childNode1 =3D + // rootNode.getChild(Fqn + // .fromElements(node1path.getEntries()[node1path.getEntr= ies().length - 1].getAsString(true))); + // + // assertNotNull("Child Node should exists", childNode1); + // String childNode1id =3D (String)childNode1.get(JBossCacheSto= rage.ITEM_ID); + // Node node1 =3D props.getChild(Fqn.from= Elements(childNode1id)); + // assertNotNull("Node by ID should exists", node1); + // + // Object childNode1Object =3D node1.get(JBossCacheStorage.ITEM= _DATA); + // assertTrue("Node item data is not a Node", childNode1Object = instanceof NodeData); + // assertEquals("Node id wrong", node2id, ((NodeData)childNode1= Object).getIdentifier()); + // assertEquals("Node path wrong", node2path, ((NodeData)childN= ode1Object).getQPath()); + // + // // get /snsNode:2 from childs of root / + // Node childNode2 =3D + // rootNode.getChild(Fqn + // .fromElements(node2path.getEntries()[node2path.getEntr= ies().length - 1].getAsString(true))); + // + // assertNotNull("Child Node should exists", childNode2); + // String childNode2id =3D (String)childNode2.get(JBossCacheSto= rage.ITEM_ID); + // Node node2 =3D props.getChild(Fqn.from= Elements(childNode2id)); + // assertNotNull("Node by ID should exists", node2); + // + // Object childNode1Object =3D node1.get(JBossCacheStorage.ITEM= _DATA); + // assertTrue("Node item data is not a Node", childNode1Object = instanceof NodeData); + // assertEquals("Node id wrong", node2id, ((NodeData)childNode1= Object).getIdentifier()); + // assertEquals("Node path wrong", node2path, ((NodeData)childN= ode1Object).getQPath()); + // + // assertEquals("Child expected", 3, rootNode.getChildren().siz= e()); + // + // Node itemNode =3D nodes.getChild(Fqn.f= romElements(node1id)); + // assertNotNull("Node item data should exists", itemNode); + // + // Object dataObject =3D itemNode.get(JBossCacheStorageConnecti= on.ITEM_DATA); + // assertTrue("Node item data should be a NodeData", dataObject= instanceof NodeData); + // assertEquals("Node id wrong", node1id, ((NodeData)dataObject= ).getIdentifier()); + // assertEquals("Node path wrong", node1path, ((NodeData)dataOb= ject).getQPath()); + // assertEquals("Node order number wrong", nodeOrderNumb, ((Nod= eData)dataObject).getOrderNumber()); } = public void testUpdateProperty() throws Exception @@ -498,29 +496,14 @@ propDataU.setValue(new TransientValueData(propValueU)); conn.update(propDataU); = - // check in tree - treePrint(nodes); - + // check = + treePrint(props); + = Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); = assertEquals("Attributes ammount wrong", 2, rootNode.getKeys().size(= )); - - String pid =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsS= tring()); - assertEquals("Property ID wrong", propId1, pid); - - // check in items - treePrint(nodes); - - Node itemsProp1 =3D props.getChild(Fqn.fromEle= ments(propId1)); - Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data1Object); - assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); - - PropertyData data1 =3D (PropertyData)data1Object; - assertEquals("Property id wrong", propId1, data1.getIdentifier()); - assertEquals("Property path wrong", propPath1, data1.getQPath()); - assertEquals("Property Value wrong", propValueU, new String(data1.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); + = + checkChildProp(rootNode, Constants.JCR_PRIMARYTYPE, propId1, propPat= h1, propValueU); } = public void testGetNodeByName() throws Exception @@ -569,6 +552,9 @@ conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); = // check = + treePrint(props); + = + // check = ItemData propItem =3D conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new AccessControlList()), @@ -629,7 +615,7 @@ assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); } = - public void _testGetChildNodes() throws Exception + public void testGetChildNodes() throws Exception { // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) @@ -672,7 +658,7 @@ } } = - public void _testGetChildProperties() throws Exception + public void testGetChildProperties() throws Exception { // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) // add root (/) @@ -703,6 +689,7 @@ = // check treePrint(nodes); + treePrint(props); = List childs =3D conn.getChildPropertiesData(new TransientNodeData(Constants.ROOT_= PATH, Constants.ROOT_UUID, 1, --===============9169968676707951980==-- From do-not-reply at jboss.org Mon Nov 9 09:20:47 2009 Content-Type: multipart/mixed; boundary="===============1360172752699728043==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r510 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 09:20:47 -0500 Message-ID: <200911091420.nA9EKlrO028700@svn01.web.mwc.hst.phx2.redhat.com> --===============1360172752699728043== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 09:20:47 -0500 (Mon, 09 Nov 2009) New Revision: 510 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 :Add test JDBCCacheLoaderTest. Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:2= 0:47 UTC (rev 510) @@ -0,0 +1,133 @@ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import java.io.Serializable; + +import javax.jcr.RepositoryException; + +import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBas= e; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.jboss.cache.CacheSPI; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; +import org.jboss.cache.factories.annotations.NonVolatile; +import org.picocontainer.Startable; + + +public class JDBCCacheLoaderTest extends JBossCacheStorageConnectionTest +{ + + /** + * {@inheritDoc} + */ + protected void setUp() throws Exception + { + try { + = + // JBossCache = + initJBCConfig(); + + cache =3D new DefaultCacheFactory().createCach= e(jbcConfig ,false); + = + = + = + = + WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceData= ContainerTester(); + = + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, WorkspaceDataContainer.class); + + // run cache + cache.create(); + cache.start(); + + Node cacheRoot =3D cache.getRoot(); + + // prepare cache structures + nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); + props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); + + // JCR connection + conn =3D new JBossCacheStorageConnection(cache, nodes, props); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } + } + = + protected void initJBCConfig() + { + jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; + } + = + public void testAddNode() throws Exception + { + super.testAddNode(); + conn.commit(); + } +} +(a)NonVolatile +class JDBCWorkspaceDataContainerTester extends WorkspaceDataContainerBase = implements Startable = +{ + + public JDBCWorkspaceDataContainerTester() + { + } + + public void start() + { + // TODO Auto-generated method stub + = + } + + public void stop() + { + // TODO Auto-generated method stub + = + } + + public boolean isSame(WorkspaceDataContainer another) + { + // TODO Auto-generated method stub + return false; + } + + public WorkspaceStorageConnection openConnection() throws RepositoryExc= eption + { + // TODO Auto-generated method stub + return null; + } + + public WorkspaceStorageConnection openConnection(boolean readOnly) thro= ws RepositoryException + { + // TODO Auto-generated method stub + return null; + } + + public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConne= ction original) throws RepositoryException + { + // TODO Auto-generated method stub + return null; + } + + public String getInfo() + { + // TODO Auto-generated method stub + return null; + } + + public String getName() + { + // TODO Auto-generated method stub + return null; + } + + public String getStorageVersion() + { + // TODO Auto-generated method stub + return null; + } + = + = +} + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============1360172752699728043==-- From do-not-reply at jboss.org Mon Nov 9 09:25:46 2009 Content-Type: multipart/mixed; boundary="===============4465887487277934327==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r511 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 09:25:45 -0500 Message-ID: <200911091425.nA9EPjdH029553@svn01.web.mwc.hst.phx2.redhat.com> --===============4465887487277934327== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-09 09:25:45 -0500 (Mon, 09 Nov 2009) New Revision: 511 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-204:Observation loader test updated. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 09 14:20:47 UTC (rev 510) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 09 14:25:45 UTC (rev 511) @@ -24,12 +24,14 @@ import org.exoplatform.services.jcr.core.NamespaceAccessor; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.observation.ListenerCriteria; import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; import org.jboss.cache.Modification.ModificationType; @@ -40,6 +42,7 @@ import java.util.Map; = import javax.jcr.NamespaceException; +import javax.jcr.PropertyType; import javax.jcr.RepositoryException; import javax.jcr.observation.Event; import javax.jcr.observation.EventIterator; @@ -115,15 +118,123 @@ assertEquals(lf.createJCRPath(node1path).getAsString(false), event.g= etPath()); } = + public void testRemoveNode() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + NodeData newNode =3D + new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Consta= nts.NT_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + DummyListener listener =3D new DummyListener(); + registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= REMOVED, lf.parseAbsPath("/") + .getInternalPath(), true, null, null, false, "asd")); + + List modifications =3D new ArrayList(); + modifications.add(removeNode(newNode)); + loader.put(modifications); + assertEquals(1, listener.eventList.size()); + Event event =3D listener.eventList.get(0); + assertEquals(Event.NODE_REMOVED, event.getType()); + assertEquals(lf.createJCRPath(node1path).getAsString(false), event.g= etPath()); + } + + public void testAddProperty() throws Exception + { + QPath prop1path =3D QPath.parse("[]:1[]node:1[]property:1"); + PropertyData newProperty =3D + new TransientPropertyData(prop1path, "PropertyUUID", 0, PropertyT= ype.UNDEFINED, Constants.SYSTEM_UUID, false); + + DummyListener listener =3D new DummyListener(); + registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_ADDED, lf.parseAbsPath("/") + .getInternalPath(), true, null, null, false, "asd")); + + List modifications =3D new ArrayList(); + modifications.add(addProperty(newProperty)); + loader.put(modifications); + assertEquals(1, listener.eventList.size()); + Event event =3D listener.eventList.get(0); + assertEquals(Event.PROPERTY_ADDED, event.getType()); + assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); + } + + public void testUpdateProperty() throws Exception + { + QPath prop1path =3D QPath.parse("[]:1[]node:1[]property:1"); + PropertyData newProperty =3D + new TransientPropertyData(prop1path, "PropertyUUID", 0, PropertyT= ype.UNDEFINED, Constants.SYSTEM_UUID, false); + + DummyListener listener =3D new DummyListener(); + registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_CHANGED, lf.parseAbsPath("/") + .getInternalPath(), true, null, null, false, "asd")); + + List modifications =3D new ArrayList(); + modifications.add(updateProperty(newProperty)); + loader.put(modifications); + assertEquals(1, listener.eventList.size()); + Event event =3D listener.eventList.get(0); + assertEquals(Event.PROPERTY_CHANGED, event.getType()); + assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); + } + = + public void testRemoveProperty() throws Exception + { + QPath prop1path =3D QPath.parse("[]:1[]node:1[]property:1"); + PropertyData newProperty =3D + new TransientPropertyData(prop1path, "PropertyUUID", 0, PropertyT= ype.UNDEFINED, Constants.SYSTEM_UUID, false); + + DummyListener listener =3D new DummyListener(); + registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_REMOVED, lf.parseAbsPath("/") + .getInternalPath(), true, null, null, false, "asd")); + + List modifications =3D new ArrayList(); + modifications.add(removeProperty(newProperty)); + loader.put(modifications); + assertEquals(1, listener.eventList.size()); + Event event =3D listener.eventList.get(0); + assertEquals(Event.PROPERTY_REMOVED, event.getType()); + assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); + } + public Modification addNode(NodeData data) { - // add in NODES String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, (Object)data); - //node.put(ITEM_DATA, data); = } = + public Modification removeNode(NodeData data) + { + String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); + return new Modification(ModificationType.REMOVE_NODE, Fqn.fromString= (fqn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + } + + public Modification addProperty(PropertyData data) + { + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); + return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + } + + public Modification updateProperty(PropertyData data) + { + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); + Modification modification =3D + new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromString(f= qn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + modification.setOldValue(data); + return modification; + } + + public Modification removeProperty(PropertyData data) + { + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); + Modification modification =3D + new Modification(ModificationType.REMOVE_NODE, Fqn.fromString(fqn= ), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + modification.setOldValue(data); + return modification; + } + = @Override protected void tearDown() throws Exception { --===============4465887487277934327==-- From do-not-reply at jboss.org Mon Nov 9 09:25:48 2009 Content-Type: multipart/mixed; boundary="===============1583490263056112462==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r512 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 09:25:48 -0500 Message-ID: <200911091425.nA9EPmxI029570@svn01.web.mwc.hst.phx2.redhat.com> --===============1583490263056112462== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-09 09:25:48 -0500 (Mon, 09 Nov 2009) New Revision: 512 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for loader update Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 14:25:45 UTC (rev 511) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 14:25:48 UTC (rev 512) @@ -92,6 +92,8 @@ = cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); = + initJBC(); + = // run cache cache.create(); cache.start(); @@ -110,6 +112,11 @@ { jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; } + = + protected void initJBC() + { + // empty here + } = /** * {@inheritDoc} Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:2= 5:45 UTC (rev 511) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:2= 5:48 UTC (rev 512) @@ -14,7 +14,6 @@ import org.jboss.cache.factories.annotations.NonVolatile; import org.picocontainer.Startable; = - public class JDBCCacheLoaderTest extends JBossCacheStorageConnectionTest { = @@ -23,51 +22,41 @@ */ protected void setUp() throws Exception { - try { - = - // JBossCache = - initJBCConfig(); - - cache =3D new DefaultCacheFactory().createCach= e(jbcConfig ,false); - = - = - = - = - WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceData= ContainerTester(); - = - ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, WorkspaceDataContainer.class); - - // run cache - cache.create(); - cache.start(); - - Node cacheRoot =3D cache.getRoot(); - - // prepare cache structures - nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); - props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); - - // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props); - } catch (Exception e) { + try + { + super.setUp(); + } + catch (Exception e) + { e.printStackTrace(); throw e; } } - = + + @Override + protected void initJBC() + { + WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceData= ContainerTester(); + + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, + WorkspaceDataContainer.class); + } + + @Override protected void initJBCConfig() { jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; } - = + public void testAddNode() throws Exception { super.testAddNode(); conn.commit(); } } + @NonVolatile -class JDBCWorkspaceDataContainerTester extends WorkspaceDataContainerBase = implements Startable = +class JDBCWorkspaceDataContainerTester extends WorkspaceDataContainerBase = implements Startable { = public JDBCWorkspaceDataContainerTester() @@ -77,13 +66,13 @@ public void start() { // TODO Auto-generated method stub - = + } = public void stop() { // TODO Auto-generated method stub - = + } = public boolean isSame(WorkspaceDataContainer another) @@ -127,7 +116,5 @@ // TODO Auto-generated method stub return null; } - = - = -} = +} --===============1583490263056112462==-- From do-not-reply at jboss.org Mon Nov 9 09:29:33 2009 Content-Type: multipart/mixed; boundary="===============7215471002720321638==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r513 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 09:29:33 -0500 Message-ID: <200911091429.nA9ETXAr030018@svn01.web.mwc.hst.phx2.redhat.com> --===============7215471002720321638== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-09 09:29:33 -0500 (Mon, 09 Nov 2009) New Revision: 513 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java Log: EXOJCR-204: Added constants to determine Observation's sub-tree. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-09 14:25:= 48 UTC (rev 512) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-09 14:29:= 33 UTC (rev 513) @@ -57,10 +57,16 @@ public static final String NODES =3D "$NODES".intern(); = public static final String PROPS =3D "$PROPS".intern(); + = + public static final String OBSERVATION =3D "$OBSERVATION".intern(); = public static final String ITEM_DATA =3D "$data".intern(); = public static final String ITEM_ID =3D "$id".intern(); + = + public static final String SESSION_ID =3D "$sessionId".intern(); + = + public static final String USER_ID =3D "$userId".intern(); = protected final Node nodesRoot; = --===============7215471002720321638==-- From do-not-reply at jboss.org Mon Nov 9 09:38:12 2009 Content-Type: multipart/mixed; boundary="===============8960961994068569093==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r514 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory. Date: Mon, 09 Nov 2009 09:38:12 -0500 Message-ID: <200911091438.nA9EcC6R032137@svn01.web.mwc.hst.phx2.redhat.com> --===============8960961994068569093== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-09 09:38:12 -0500 (Mon, 09 Nov 2009) New Revision: 514 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java Log: EXOJCR-205: refactoring LockCacheLoader Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-09 14:29:33 UTC (rev= 513) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-09 14:38:12 UTC (rev= 514) @@ -814,4 +814,12 @@ { return pendingLocks.containsKey(nodeIdentifier); } + + /** + * TODO: Added. Need for LockCacheLoader.. + */ + public boolean hasLockNode(String nodeIdentifier) + { + return locks.containsKey(nodeIdentifier); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-09 14:29:= 33 UTC (rev 513) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-09 14:38:= 12 UTC (rev 514) @@ -16,24 +16,6 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.datamodel.QPath; @@ -54,31 +36,33 @@ public abstract class JBossCacheStorage { = + public static final String SESSION =3D "$SESSION".intern(); + public static final String NODES =3D "$NODES".intern(); - = + public static final String PROPS =3D "$PROPS".intern(); - = + public static final String OBSERVATION =3D "$OBSERVATION".intern(); = public static final String ITEM_DATA =3D "$data".intern(); = public static final String ITEM_ID =3D "$id".intern(); - = + public static final String SESSION_ID =3D "$sessionId".intern(); - = + public static final String USER_ID =3D "$userId".intern(); = protected final Node nodesRoot; - = + protected final Node propsRoot; = protected JBossCacheStorage(Node nodesRoot, Node<= Serializable, Object> propsRoot) { this.nodesRoot =3D nodesRoot; - = + this.propsRoot =3D propsRoot; } - = + /** * Make Child Node relative Fqn, i.e. ./NIDxxx/NAMExxx. * @@ -92,7 +76,7 @@ //return Fqn.fromRelativeFqn(nodesRoot.getFqn(), Fqn.fromElements(pa= rentId, nodeName.getAsString(true))); return Fqn.fromElements(parentId, nodeName.getAsString(true)); } - = + /** * Make Child Node relative Fqn. i.e. ./NAMExxx. * @@ -104,8 +88,6 @@ return Fqn.fromElements(nodeName.getAsString(true)); } = - - /** * Make Node relative Fqn, i.e. ./NIDxxx. * @@ -129,5 +111,5 @@ //return Fqn.fromRelativeFqn(propsRoot, Fqn.fromElements(propId)); return Fqn.fromElements(propId); } - = + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-09 14:29:33= UTC (rev 513) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-09 14:38:12= UTC (rev 514) @@ -16,8 +16,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.impl.Constants; @@ -27,10 +25,14 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.CacheException; +import org.jboss.cache.Fqn; import org.jboss.cache.Modification; import org.jboss.cache.Modification.ModificationType; = +import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; = import javax.jcr.lock.LockException; @@ -62,17 +64,76 @@ @Override public void put(List modifications) throws Exception { + String sessionId =3D null; + HashSet removedLock =3D new HashSet(); List lockChanges =3D new ArrayList(); = for (Modification m : modifications) { - if (m.getFqn().hasElement(JBossCacheStorage.PROPS)) + if (m.getFqn().hasElement(JBossCacheStorage.SESSION)) { switch (m.getType()) { + case PUT_DATA_ERASE : + break; case PUT_DATA : + // changesLog begin + int pos =3D getElementPosition(m.getFqn(), JBossCacheSto= rage.SESSION); + sessionId =3D (String)m.getFqn().get(pos + 1); break; + case PUT_KEY_VALUE : + break; + case REMOVE_DATA : + break; + case REMOVE_KEY_VALUE : + break; + case REMOVE_NODE : + // perform lock or unlock operation + if (lockChanges.size() =3D=3D 2) + { + if (lockChanges.get(0).getType() =3D=3D ModificationT= ype.PUT_KEY_VALUE + && lockChanges.get(1).getType() =3D=3D Modificatio= nType.PUT_KEY_VALUE) + { + performLock(lockChanges, sessionId); + } + else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_KEY_VALUE + && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_KEY_VALUE) + { + performUnLock(lockChanges, sessionId); + } + else + { + log.error("Incorrect changes log contains lock and= unlock operation simultaneously"); + } + } + else if (lockChanges.size() !=3D 0) + { + log.error("Incorrect changes log size for lock or un= lock operation"); + } = + // changesLog end + for (String identifier : removedLock) + { + lockManager.internalUnLock(sessionId, identifier); + } + + lockChanges =3D new ArrayList(); + sessionId =3D null; + break; + case MOVE : + break; + default : + throw new CacheException("Unknown modification " + m.get= Type()); + } + } + else if (m.getFqn().hasElement(JBossCacheStorage.PROPS)) + { + switch (m.getType()) + { + case PUT_DATA_ERASE : + break; + case PUT_DATA : + break; case PUT_KEY_VALUE : if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) { @@ -85,56 +146,63 @@ } } break; - case REMOVE_DATA : break; - case REMOVE_KEY_VALUE : - PropertyData propertyData =3D (PropertyData)m.getValue(); - InternalQName propertyName =3D propertyData.getQPath().g= etName(); + if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) + { + PropertyData propertyData =3D (PropertyData)m.getValu= e(); + InternalQName propertyName =3D propertyData.getQPath(= ).getName(); = - if (propertyName.equals(Constants.JCR_LOCKISDEEP) || pro= pertyName.equals(Constants.JCR_LOCKOWNER)) - { - lockChanges.add(m); + if (propertyName.equals(Constants.JCR_LOCKISDEEP) || = propertyName.equals(Constants.JCR_LOCKOWNER)) + { + lockChanges.add(m); + } } break; - case REMOVE_NODE : break; - case MOVE : break; - default : throw new CacheException("Unknown modification " + m.get= Type()); } } - - if (lockChanges.size() =3D=3D 2) + else if (m.getFqn().hasElement(JBossCacheStorage.NODES)) { - if (lockChanges.get(0).getType() =3D=3D ModificationType.PUT_K= EY_VALUE - && lockChanges.get(1).getType() =3D=3D ModificationType.PUT= _KEY_VALUE) + int nodesPos =3D getElementPosition(m.getFqn(), JBossCacheStor= age.NODES); + if (m.getFqn().size() =3D=3D nodesPos + 1) { - performLock(lockChanges); + // this is a node and node is locked + String nodeIdentifier =3D (String)m.getFqn().get(nodesPos += 1); + if (lockManager.hasLockNode(nodeIdentifier)) + { + switch (m.getType()) + { + case PUT_DATA_ERASE : + break; + case PUT_DATA : + removedLock.remove(nodeIdentifier); + break; + case PUT_KEY_VALUE : + break; + case REMOVE_DATA : + break; + case REMOVE_KEY_VALUE : + break; + case REMOVE_NODE : + removedLock.add(nodeIdentifier); + break; + case MOVE : + removedLock.remove(nodeIdentifier); + break; + default : + throw new CacheException("Unknown modification " += m.getType()); + } + } } - else if (lockChanges.get(0).getType() =3D=3D ModificationType.= REMOVE_KEY_VALUE - && lockChanges.get(1).getType() =3D=3D ModificationType.REM= OVE_KEY_VALUE) - { - performUnLock(lockChanges); - } - else - { - - } } - - lockChanges =3D new ArrayList(); } - - if (lockChanges.size() !=3D 0) - { - log.error("Incorrect changes log size for lock or unlock operati= on"); - } } = /** @@ -143,45 +211,70 @@ * @param lockChanges * @throws LockException */ - private void performLock(List lockChanges) throws Excepti= on + private void performLock(List lockChanges, String session= Id) { String nodeIdentifier =3D ((PropertyData)lockChanges.get(0).getValue= ()).getParentIdentifier(); = - if (lockManager.hasPendingLocks(nodeIdentifier)) + try { - lockManager.internalLock(nodeIdentifier); - } - else - { - log.warn("No lock in pendingLocks for identifier " + nodeIdentifi= er + " Probably lock come from replication."); + if (lockManager.hasPendingLocks(nodeIdentifier)) + { + lockManager.internalLock(nodeIdentifier); + } + else + { + log.warn("No lock in pendingLocks for identifier " + nodeIdent= ifier + + " Probably lock come from replication."); = - String lockToken =3D IdGenerator.generate(); - Modification ownerModification =3D getModification(lockChanges, C= onstants.JCR_LOCKOWNER); - Modification isDeepModification =3D getModification(lockChanges, = Constants.JCR_LOCKISDEEP); + String lockToken =3D IdGenerator.generate(); + Modification ownerModification =3D getModification(lockChanges= , Constants.JCR_LOCKOWNER); + Modification isDeepModification =3D getModification(lockChange= s, Constants.JCR_LOCKISDEEP); = - if (ownerModification !=3D null && isDeepModification !=3D null) - { + if (ownerModification !=3D null && isDeepModification !=3D nul= l) + { = - String owner =3D - new String(((((TransientPropertyData)(ownerModification.get= Value())).getValues()).get(0)) - .getAsByteArray(), Constants.DEFAULT_ENCODING); + String owner =3D + new String(((((TransientPropertyData)(ownerModification.= getValue())).getValues()).get(0)) + .getAsByteArray(), Constants.DEFAULT_ENCODING); = - boolean isDeep =3D - Boolean.valueOf( - new String(((((TransientPropertyData)(isDeepModification= .getValue())).getValues()).get(0)) - .getAsByteArray(), Constants.DEFAULT_ENCODING)).boole= anValue(); + boolean isDeep =3D + Boolean.valueOf( + new String(((((TransientPropertyData)(isDeepModificat= ion.getValue())).getValues()).get(0)) + .getAsByteArray(), Constants.DEFAULT_ENCODING)).bo= oleanValue(); = - // TODO sessionId - lockManager.createRemoteLock("sessionId", nodeIdentifier, lock= Token, isDeep, false, owner); + lockManager.createRemoteLock(sessionId, nodeIdentifier, loc= kToken, isDeep, false, owner); + } } } + catch (LockException e) + { + log.error(e.getLocalizedMessage(), e); + } + catch (UnsupportedEncodingException e) + { + log.error(e.getLocalizedMessage(), e); + } + catch (IllegalStateException e) + { + log.error(e.getLocalizedMessage(), e); + } + catch (IOException e) + { + log.error(e.getLocalizedMessage(), e); + } } = - private void performUnLock(List lockChanges) throws Excep= tion + private void performUnLock(List lockChanges, String sessi= onId) { - // TODO sessionId - // TODO nodeIdentifier - lockManager.internalUnLock("sessionId", "nodeIdentifier"); + // TODO parent nodeIdentifier + try + { + lockManager.internalUnLock(sessionId, "nodeIdentifier"); + } + catch (LockException e) + { + log.error(e.getLocalizedMessage(), e); + } } = /** @@ -201,4 +294,13 @@ return null; } = + private int getElementPosition(Fqn fqn, String element) + { + for (int i =3D 0; i < fqn.size(); i++) + if (fqn.get(i).equals(element)) + return i; + + return -1; + } + } --===============8960961994068569093==-- From do-not-reply at jboss.org Mon Nov 9 09:43:14 2009 Content-Type: multipart/mixed; boundary="===============6271821528475507207==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r515 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 09:43:13 -0500 Message-ID: <200911091443.nA9EhDKk000432@svn01.web.mwc.hst.phx2.redhat.com> --===============6271821528475507207== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 09:43:13 -0500 (Mon, 09 Nov 2009) New Revision: 515 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.java Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : test JDBCCacheLoadetTest. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:3= 8:12 UTC (rev 514) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:4= 3:13 UTC (rev 515) @@ -1,3 +1,21 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import java.io.Serializable; @@ -2,13 +20,4 @@ = -import javax.jcr.RepositoryException; - -import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBas= e; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.jboss.cache.CacheSPI; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; -import org.jboss.cache.factories.annotations.NonVolatile; -import org.picocontainer.Startable; = @@ -55,66 +64,3 @@ } } = -(a)NonVolatile -class JDBCWorkspaceDataContainerTester extends WorkspaceDataContainerBase = implements Startable -{ - - public JDBCWorkspaceDataContainerTester() - { - } - - public void start() - { - // TODO Auto-generated method stub - - } - - public void stop() - { - // TODO Auto-generated method stub - - } - - public boolean isSame(WorkspaceDataContainer another) - { - // TODO Auto-generated method stub - return false; - } - - public WorkspaceStorageConnection openConnection() throws RepositoryExc= eption - { - // TODO Auto-generated method stub - return null; - } - - public WorkspaceStorageConnection openConnection(boolean readOnly) thro= ws RepositoryException - { - // TODO Auto-generated method stub - return null; - } - - public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConne= ction original) throws RepositoryException - { - // TODO Auto-generated method stub - return null; - } - - public String getInfo() - { - // TODO Auto-generated method stub - return null; - } - - public String getName() - { - // TODO Auto-generated method stub - return null; - } - - public String getStorageVersion() - { - // TODO Auto-generated method stub - return null; - } - -} Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.java 20= 09-11-09 14:43:13 UTC (rev 515) @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import javax.jcr.RepositoryException; + +import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBas= e; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.jboss.cache.factories.annotations.NonVolatile; +import org.picocontainer.Startable; + +(a)NonVolatile +class JDBCWorkspaceDataContainerTester extends WorkspaceDataContainerBase = implements Startable +{ + + public JDBCWorkspaceDataContainerTester() + { + } + + public void start() + { + // TODO Auto-generated method stub + + } + + public void stop() + { + // TODO Auto-generated method stub + + } + + public boolean isSame(WorkspaceDataContainer another) + { + // TODO Auto-generated method stub + return false; + } + + public WorkspaceStorageConnection openConnection() throws RepositoryExc= eption + { + // TODO Auto-generated method stub + return null; + } + + public WorkspaceStorageConnection openConnection(boolean readOnly) thro= ws RepositoryException + { + // TODO Auto-generated method stub + return null; + } + + public WorkspaceStorageConnection reuseConnection(WorkspaceStorageConne= ction original) throws RepositoryException + { + // TODO Auto-generated method stub + return null; + } + + public String getInfo() + { + // TODO Auto-generated method stub + return null; + } + + public String getName() + { + // TODO Auto-generated method stub + return null; + } + + public String getStorageVersion() + { + // TODO Auto-generated method stub + return null; + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContai= nerTester.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============6271821528475507207==-- From do-not-reply at jboss.org Mon Nov 9 09:50:45 2009 Content-Type: multipart/mixed; boundary="===============0841758674775509915==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r516 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 09:50:44 -0500 Message-ID: <200911091450.nA9EoiH9001862@svn01.web.mwc.hst.phx2.redhat.com> --===============0841758674775509915== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-09 09:50:44 -0500 (Mon, 09 Nov 2009) New Revision: 516 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for loader update Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:4= 3:13 UTC (rev 515) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:5= 0:44 UTC (rev 516) @@ -18,14 +18,10 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.io.Serializable; = -import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -import org.jboss.cache.CacheSPI; - public class JDBCCacheLoaderTest extends JBossCacheStorageConnectionTest { - + = /** * {@inheritDoc} */ @@ -45,10 +41,12 @@ @Override protected void initJBC() { - WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceData= ContainerTester(); + = + // persistence container + //WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceDa= taContainerTester(); = - ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, - WorkspaceDataContainer.class); + //((CacheSPI)cache).getComponentRegistry().reg= isterComponent(persistentContainer, + // WorkspaceDataContainer.class); } = @Override @@ -59,8 +57,11 @@ = public void testAddNode() throws Exception { + // prepare super.testAddNode(); conn.commit(); + = + // tests it } } = --===============0841758674775509915==-- From do-not-reply at jboss.org Mon Nov 9 09:55:25 2009 Content-Type: multipart/mixed; boundary="===============2070913333066840959==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r517 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 09:55:25 -0500 Message-ID: <200911091455.nA9EtP1s002457@svn01.web.mwc.hst.phx2.redhat.com> --===============2070913333066840959== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 09:55:24 -0500 (Mon, 09 Nov 2009) New Revision: 517 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.java Log: EXOJCR-201 : test JDBCCacheLoadetTest. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:5= 0:44 UTC (rev 516) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 14:5= 5:24 UTC (rev 517) @@ -19,6 +19,11 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = = +/** + * @author Alex Reshetnyak<= /a> + * @version $Id$ + * + */ public class JDBCCacheLoaderTest extends JBossCacheStorageConnectionTest { = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.java 20= 09-11-09 14:50:44 UTC (rev 516) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCWorkspaceDataContainerTester.java 20= 09-11-09 14:55:24 UTC (rev 517) @@ -26,6 +26,11 @@ import org.jboss.cache.factories.annotations.NonVolatile; import org.picocontainer.Startable; = +/** + * @author Alex Reshetnyak<= /a> + * @version $Id$ + * + */ @NonVolatile class JDBCWorkspaceDataContainerTester extends WorkspaceDataContainerBase = implements Startable { --===============2070913333066840959==-- From do-not-reply at jboss.org Mon Nov 9 10:07:10 2009 Content-Type: multipart/mixed; boundary="===============3034360043870749417==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r518 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 10:07:10 -0500 Message-ID: <200911091507.nA9F7AAf004413@svn01.web.mwc.hst.phx2.redhat.com> --===============3034360043870749417== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-09 10:07:10 -0500 (Mon, 09 Nov 2009) New Revision: 518 Removed: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202 : removed test Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-09 = 14:55:24 UTC (rev 517) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-09 = 15:07:10 UTC (rev 518) @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import junit.framework.TestCase; - -import org.jboss.cache.Cache; -import org.jboss.cache.CacheFactory; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; -import org.jboss.cache.config.CacheLoaderConfig; -import org.jboss.cache.config.Configuration; -import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; - -import java.io.Serializable; - -/** - * @author Sergey K= abashnyuk - * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ - * - */ -public abstract class AbstractCacheLoaderTest extends TestCase -{ - protected Cache cache; - - protected JBossCacheStorageConnection jBossCacheStorageConnection; - - /** - * @see junit.framework.TestCase#setUp() - */ - @Override - protected void setUp() throws Exception - { - super.setUp(); - CacheFactory factory =3D new DefaultCacheFacto= ry(); - cache =3D factory.createCache(createCacheConfiguration()); - - Node cacheRoot =3D cache.getRoot(); - - // run cache - cache.create(); - cache.start(); - cache.startBatch(); - // prepare cache structures - Node nodes =3D cacheRoot.addChild(Fqn.fromStri= ng(JBossCacheStorage.NODES)); - Node props =3D cacheRoot.addChild(Fqn.fromStri= ng(JBossCacheStorage.PROPS)); - - this.cache.endBatch(true); - - // JCR connection - jBossCacheStorageConnection =3D new JBossCacheStorageConnection(cach= e, nodes, props); - } - - /** - * Create cache configuration. - * @return - */ - protected Configuration createCacheConfiguration() - { - Configuration config =3D new Configuration(); - config.setInvocationBatchingEnabled(true); - config.setCacheLoaderConfig(createCacheLoaderConfig()); - return config; - } - - /** - * Create cache configuration. - * @return - */ - protected CacheLoaderConfig createCacheLoaderConfig() - { - CacheLoaderConfig cacheLoaderConfig =3D new CacheLoaderConfig(); - cacheLoaderConfig.setPassivation(false); - cacheLoaderConfig.setShared(false); - cacheLoaderConfig.addIndividualCacheLoaderConfig(createIndividualCac= heLoaderConfig()); - return cacheLoaderConfig; - }; - - protected abstract IndividualCacheLoaderConfig createIndividualCacheLoa= derConfig(); - -} Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 4:55:24 UTC (rev 517) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 5:07:10 UTC (rev 518) @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.SessionDataManager; -import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.core.query.IndexException; -import org.exoplatform.services.jcr.impl.core.query.QueryHandler; -import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.cache.Modification; -import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; - -import java.io.IOException; -import java.util.List; -import java.util.Set; - -import javax.jcr.Node; -import javax.jcr.RepositoryException; -import javax.jcr.query.InvalidQueryException; -import javax.jcr.query.Query; - -/** - * @author Sergey K= abashnyuk - * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ - * - */ -public class IndexerCacheLoaderTest extends AbstractCacheLoaderTest -{ - private final Log log =3D ExoLogger.getLogger(IndexerCacheLoaderTest.cl= ass.getName()); - - private IndexerCacheLoader loader; - - private FakeSearchManager manager; - - public void testAddNode() throws Exception - { - - } - - public void testAddRoot() throws Exception - { - // add root (/) - jBossCacheStorageConnection.add(new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, null, new Acc= essControlList())); - jBossCacheStorageConnection.commit(); - - assertTrue(manager.getRemovedNodes().isEmpty()); - assertFalse(manager.getAddedNodes().isEmpty()); - - } - - /** - * @see org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractCa= cheLoaderTest#createIndividualCacheLoaderConfig() - */ - @Override - protected IndividualCacheLoaderConfig createIndividualCacheLoaderConfig= () - { - IndividualCacheLoaderConfig individualCacheLoaderConfig =3D new Indi= vidualCacheLoaderConfig(); - loader =3D new IndexerCacheLoader(); - manager =3D new FakeSearchManager(); - loader.registerSearchManager(manager); - individualCacheLoaderConfig.setCacheLoader(loader); - return individualCacheLoaderConfig; - } - - class FakeSearchManager implements SearchManager - { - - private Set removedNodes; - - private Set addedNodes; - - public Query createQuery(SessionImpl session, SessionDataManager ses= sionDataManager, Node node) - throws InvalidQueryException, RepositoryException - { - return null; - } - - public Query createQuery(SessionImpl session, SessionDataManager ses= sionDataManager, String statement, - String language) throws InvalidQueryException, RepositoryException - { - return null; - } - - public Set getAddedNodes() - { - return addedNodes; - } - - public Set getFieldNames() throws IndexException - { - return null; - } - - public QueryHandler getHandler() - { - return null; - } - - public Set getNodesByNodeType(InternalQName nodeType) throws= RepositoryException - { - return null; - } - - public Set getNodesByUri(String uri) throws RepositoryExcept= ion - { - return null; - } - - public Set getRemovedNodes() - { - return removedNodes; - } - - public void updateIndex(Set removedNodes, Set addedN= odes) throws RepositoryException, IOException - { - this.removedNodes =3D removedNodes; - this.addedNodes =3D addedNodes; - } - } - - private class DummyCacheLoader extends AbstractWriteOnlyCacheLoader - { - - /** - * @see org.exoplatform.services.jcr.impl.storage.jbosscache.Abstrac= tWriteOnlyCacheLoader#put(java.util.List) - */ - @Override - public void put(List modifications) throws Exception - { - log.info("put:" + modifications); - - } - } -} --===============3034360043870749417==-- From do-not-reply at jboss.org Mon Nov 9 10:30:09 2009 Content-Type: multipart/mixed; boundary="===============0996539421387648284==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r519 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 10:30:09 -0500 Message-ID: <200911091530.nA9FU9i6007186@svn01.web.mwc.hst.phx2.redhat.com> --===============0996539421387648284== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-09 10:30:08 -0500 (Mon, 09 Nov 2009) New Revision: 519 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java Log: EXOJCR-204: Added abstract test-class Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-09 = 15:30:08 UTC (rev 519) @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.jboss.cache.Fqn; +import org.jboss.cache.Modification; +import org.jboss.cache.Modification.ModificationType; + +import java.util.ArrayList; +import java.util.List; + +/** + * This abstract class contains only methods for creating a fake {@link Mo= dification} instances. It doesn't use real cache. + * = + * @author Nikolay Zamosenchuk + * @version $Id: AbstractCacheLoaderClass.java 34360 2009-07-22 23:58:59Z = aheritier $ + * + */ +public abstract class AbstractCacheLoaderTest extends TestCase +{ + + /** + * Returns {@link Modification} like as node added. NodeData is written= to /$NODE/IDxxxx as an attribute by key ITEM_DATA. + * = + * @param data + * @return + */ + public Modification addNode(NodeData data) + { + String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); + return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + } + + /** + * Returns {@link Modification} like as node removed. But it is thought= , that list is already modified by JDBC loader, + * so {@link Modification} instance contains additional data: Key=3DITE= M_DATA, value=3DNodeData - data of already removed + * node. + * = + * @param data + * @return + */ + public Modification removeNode(NodeData data) + { + String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); + return new Modification(ModificationType.REMOVE_NODE, Fqn.fromString= (fqn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + } + + /** + * Returns {@link Modification} like as property added. PropertyData is= written to /$PROPERTY/IDxxxx as an attribute by key ITEM_DATA. + * = + * @param data + * @return + */ + public Modification addProperty(PropertyData data) + { + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); + return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + } + + /** + * Returns {@link Modification} like as property updated. PropertyData = is written to /$PROPERTY/IDxxxx as an attribute by key ITEM_DATA. + * But it is thought, that list is already modified by JDBC loader,so {= @link Modification} instance contains additional data: Old_Value + * filed of {@link Modification} instance contains same PropertyData (m= eaning that there was an old value, so this is an update, no add + * action) + * = + * @param data + * @return + */ + public Modification updateProperty(PropertyData data) + { + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); + Modification modification =3D + new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromString(f= qn), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + modification.setOldValue(data); + return modification; + } + + /** + * Returns {@link Modification} like as property removed. But it is tho= ught, that list is already modified by JDBC loader, + * so {@link Modification} instance contains additional data: Key=3DITE= M_DATA, value=3DPropertyData - data of already removed + * node. + * = + * @param data + * @return + */ + public Modification removeProperty(PropertyData data) + { + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); + Modification modification =3D + new Modification(ModificationType.REMOVE_NODE, Fqn.fromString(fqn= ), (Object)JBossCacheStorage.ITEM_DATA, + (Object)data); + modification.setOldValue(data); + return modification; + } + + /** + * Generates list of {@link Modification}-s, containing add to /$SESSIO= N attribute sessionId and userId with corresponding values. + * This imitates situation when WorkspaceDataManager walks thought tran= saction changes log, and on the beginning of each plain + * changes log, such sequence is generated. + * = + * @param sessionId + * @param userId + * @return + */ + public List setSession(String sessionId, String userId) + { + List list =3D new ArrayList(); + // add SessionID by the key SESSION_ID + list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring("/" + JBossCacheStorage.SESSION), + JBossCacheStorage.SESSION_ID, sessionId)); + // add UserID by the key USER_ID + list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring("/" + JBossCacheStorage.SESSION), + JBossCacheStorage.USER_ID, userId)); + // remove all the attributes from /$SESSION + list.add(new Modification(ModificationType.REMOVE_DATA, Fqn.fromStri= ng("/" + JBossCacheStorage.SESSION))); + // return + return list; + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest= .java ___________________________________________________________________ Name: svn:mime-type + text/plain --===============0996539421387648284==-- From do-not-reply at jboss.org Mon Nov 9 10:34:13 2009 Content-Type: multipart/mixed; boundary="===============1969582139595867470==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r520 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 10:34:12 -0500 Message-ID: <200911091534.nA9FYCha008250@svn01.web.mwc.hst.phx2.redhat.com> --===============1969582139595867470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-09 10:34:11 -0500 (Mon, 09 Nov 2009) New Revision: 520 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202 : indexer cache loader test Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 5:34:11 UTC (rev 520) @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +/** + * @author Sergey K= abashnyuk + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ + * + */ +public class IndexerCacheLoaderTest extends AbstractCacheLoaderTest +{ + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.= java ___________________________________________________________________ Name: svn:mime-type + text/plain --===============1969582139595867470==-- From do-not-reply at jboss.org Mon Nov 9 10:36:10 2009 Content-Type: multipart/mixed; boundary="===============3481138384800679255==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r521 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 10:36:10 -0500 Message-ID: <200911091536.nA9FaARd008685@svn01.web.mwc.hst.phx2.redhat.com> --===============3481138384800679255== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-09 10:36:10 -0500 (Mon, 09 Nov 2009) New Revision: 521 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-204: Test in now based on abstract class Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 09 15:34:11 UTC (rev 520) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 09 15:36:10 UTC (rev 521) @@ -18,8 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import junit.framework.TestCase; - import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.core.NamespaceAccessor; import org.exoplatform.services.jcr.datamodel.InternalQName; @@ -32,9 +30,7 @@ import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.jboss.cache.Fqn; import org.jboss.cache.Modification; -import org.jboss.cache.Modification.ModificationType; = import java.util.ArrayList; import java.util.HashMap; @@ -53,7 +49,7 @@ * @version $Id: ObservationCacheLoaderTest.java 34360 2009-07-22 23:58:59= Z aheritier $ * */ -public class ObservationCacheLoaderTest extends TestCase +public class ObservationCacheLoaderTest extends AbstractCacheLoaderTest { = private ObservationCacheLoader loader; @@ -99,6 +95,25 @@ }); } = + public void testFilterByUUID() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + NodeData newNode =3D + new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Consta= nts.NT_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + DummyListener listener =3D new DummyListener(); + registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, null, true, + new String[]{Constants.ROOT_UUID}, null, false, "asd")); + + List modifications =3D new ArrayList(); + modifications.add(addNode(newNode)); + loader.put(modifications); + assertEquals(1, listener.eventList.size()); + Event event =3D listener.eventList.get(0); + assertEquals(Event.NODE_ADDED, event.getType()); + assertEquals(lf.createJCRPath(node1path).getAsString(false), event.g= etPath()); + } + public void testAddNode() throws Exception { QPath node1path =3D QPath.parse("[]:1[]node:1"); @@ -174,7 +189,7 @@ assertEquals(Event.PROPERTY_CHANGED, event.getType()); assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); } - = + public void testRemoveProperty() throws Exception { QPath prop1path =3D QPath.parse("[]:1[]node:1[]property:1"); @@ -194,47 +209,6 @@ assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); } = - public Modification addNode(NodeData data) - { - String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); - return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); - } - - public Modification removeNode(NodeData data) - { - String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); - return new Modification(ModificationType.REMOVE_NODE, Fqn.fromString= (fqn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); - } - - public Modification addProperty(PropertyData data) - { - String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); - return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); - } - - public Modification updateProperty(PropertyData data) - { - String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); - Modification modification =3D - new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromString(f= qn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); - modification.setOldValue(data); - return modification; - } - - public Modification removeProperty(PropertyData data) - { - String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); - Modification modification =3D - new Modification(ModificationType.REMOVE_NODE, Fqn.fromString(fqn= ), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); - modification.setOldValue(data); - return modification; - } - = @Override protected void tearDown() throws Exception { --===============3481138384800679255==-- From do-not-reply at jboss.org Mon Nov 9 10:36:43 2009 Content-Type: multipart/mixed; boundary="===============6290756178406037201==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r522 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader. Date: Mon, 09 Nov 2009 10:36:43 -0500 Message-ID: <200911091536.nA9Fahci008736@svn01.web.mwc.hst.phx2.redhat.com> --===============6290756178406037201== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-09 10:36:43 -0500 (Mon, 09 Nov 2009) New Revision: 522 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java Log: EXOJCR-202: IndexerCacheLoader updated = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-09 1= 5:36:10 UTC (rev 521) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-09 1= 5:36:43 UTC (rev 522) @@ -16,7 +16,6 @@ */ package org.exoplatform.services.jcr.impl.core.query.cacheloader; = -import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= age; @@ -26,10 +25,8 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; = /** @@ -92,8 +89,12 @@ final Set removedNodes =3D new HashSet(); // nodes that need to be added to the index. final Set addedNodes =3D new HashSet(); - final Map> updatedNodes =3D new HashMap>(); = + // node thst must be updated + final Set updateNodes =3D new HashSet(); + + //final Map> updatedNodes =3D new HashMap>(); + for (Modification m : modifications) { = @@ -104,50 +105,71 @@ switch (m.getType()) { case PUT_DATA : - // add node - // TODO do we need there update for property? - // if this is property ignore = if (isNode(m.getFqn())) { + // add node addedNodes.add(uuid); } - + else + { + // this is property + // TODO do update of node - need uuid of owner node + } break; case PUT_DATA_ERASE : - // must be never called // update node if (isNode(m.getFqn())) { removedNodes.add(uuid); addedNodes.add(uuid); } + else + { + // TODO do update of node - need uuid of owner node + } + break; case PUT_KEY_VALUE : // must be never called // update node if (isNode(m.getFqn())) { - removedNodes.add(uuid); - addedNodes.add(uuid); + if (addedNodes.contains(uuid)) + { + // do nothing - node by uuid will be indexed + } + else + { + // update document by this uuid + updateNodes.add(uuid); + } } break; case REMOVE_DATA : - // must be never called // update node if (isNode(m.getFqn())) { addedNodes.add(uuid); removedNodes.add(uuid); } + else + { + //TODO do update of owner node + //updateNodes.add(owner_uuid); + } break; case REMOVE_KEY_VALUE : - // must be never called - // removed property what to do + // removed property - do update node if (isNode(m.getFqn())) { - addedNodes.add(uuid); - removedNodes.add(uuid); + updateNodes.add(uuid); } + else + { + //TODO do update of owner node + //updateNodes.add(owner_uuid); + } + break; case REMOVE_NODE : // if node - remove it, otherwise ignore it @@ -155,6 +177,11 @@ { removedNodes.add(uuid); } + else + { + //TODO do update of owner node + //updateNodes.add(owner_uuid); + } = break; case MOVE : @@ -249,7 +276,7 @@ // } // } = - for (String uuid : updatedNodes.keySet()) + for (String uuid : updateNodes) { removedNodes.add(uuid); addedNodes.add(uuid); --===============6290756178406037201==-- From do-not-reply at jboss.org Mon Nov 9 10:53:08 2009 Content-Type: multipart/mixed; boundary="===============1153021112822333424==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r523 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 10:53:08 -0500 Message-ID: <200911091553.nA9Fr8mc010672@svn01.web.mwc.hst.phx2.redhat.com> --===============1153021112822333424== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-09 10:53:08 -0500 (Mon, 09 Nov 2009) New Revision: 523 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202 : add node test Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 5:36:43 UTC (rev 522) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-09 1= 5:53:08 UTC (rev 523) @@ -18,6 +18,33 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.SessionDataManager; +import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.query.IndexException; +import org.exoplatform.services.jcr.impl.core.query.QueryHandler; +import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.jboss.cache.Modification; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.jcr.Node; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.jcr.query.InvalidQueryException; +import javax.jcr.query.Query; + /** * @author Sergey K= abashnyuk * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ @@ -25,5 +52,135 @@ */ public class IndexerCacheLoaderTest extends AbstractCacheLoaderTest { + private IndexerCacheLoader indexerCacheLoader; = + private DummySearchManager searchManager; + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception + { + // TODO Auto-generated method stub + super.setUp(); + searchManager =3D new DummySearchManager(); + indexerCacheLoader =3D new IndexerCacheLoader(); + indexerCacheLoader.registerSearchManager(searchManager); + } + + /** + * Add new Node + */ + public void testAddNode() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + NodeData newNode =3D + new TransientNodeData(node1path, "n123456", 1, Constants.NT_UNSTR= UCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + + QPath prop1path =3D QPath.makeChildPath(node1path, Constants.JCR_PRI= MARYTYPE); + PropertyData newProperty =3D + new TransientPropertyData(prop1path, "p123456", 0, PropertyType.N= AME, "n123456", false); + + List modification =3D new ArrayList(); + + modification.add(addNode(newNode)); + modification.add(addProperty(newProperty)); + indexerCacheLoader.put(modification); + assertNotNull(searchManager.getAddedNodes()); + assertNotNull(searchManager.getRemovedNodes()); + } + + private class DummySearchManager implements SearchManager + { + + private Set removedNodes; + + private Set addedNodes; + + /** + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#c= reateQuery(org.exoplatform.services.jcr.impl.core.SessionImpl, org.exoplatf= orm.services.jcr.impl.core.SessionDataManager, javax.jcr.Node) + */ + public Query createQuery(SessionImpl session, SessionDataManager ses= sionDataManager, Node node) + throws InvalidQueryException, RepositoryException + { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#c= reateQuery(org.exoplatform.services.jcr.impl.core.SessionImpl, org.exoplatf= orm.services.jcr.impl.core.SessionDataManager, java.lang.String, java.lang.= String) + */ + public Query createQuery(SessionImpl session, SessionDataManager ses= sionDataManager, String statement, + String language) throws InvalidQueryException, RepositoryException + { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#g= etFieldNames() + */ + public Set getFieldNames() throws IndexException + { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#g= etHandler() + */ + public QueryHandler getHandler() + { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#g= etNodesByNodeType(org.exoplatform.services.jcr.datamodel.InternalQName) + */ + public Set getNodesByNodeType(InternalQName nodeType) throws= RepositoryException + { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#g= etNodesByUri(java.lang.String) + */ + public Set getNodesByUri(String uri) throws RepositoryExcept= ion + { + // TODO Auto-generated method stub + return null; + } + + /** + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#u= pdateIndex(java.util.Set, java.util.Set) + */ + public void updateIndex(Set removedNodes, Set addedN= odes) throws RepositoryException, IOException + { + this.removedNodes =3D removedNodes; + // TODO Auto-generated method stub + this.addedNodes =3D addedNodes; + + } + + /** + * @return the removedNodes + */ + public Set getRemovedNodes() + { + return removedNodes; + } + + /** + * @return the addedNodes + */ + public Set getAddedNodes() + { + return addedNodes; + } + + } } --===============1153021112822333424==-- From do-not-reply at jboss.org Mon Nov 9 10:54:36 2009 Content-Type: multipart/mixed; boundary="===============0806052558426584402==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r524 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jdbc and 1 other directories. Date: Mon, 09 Nov 2009 10:54:36 -0500 Message-ID: <200911091554.nA9FsavU010820@svn01.web.mwc.hst.phx2.redhat.com> --===============0806052558426584402== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 10:54:36 -0500 (Mon, 09 Nov 2009) New Revision: 524 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : test JDBCCacheLoadetTest. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-09 15:53:08= UTC (rev 523) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-09 15:54:36= UTC (rev 524) @@ -49,6 +49,7 @@ import org.jboss.cache.Modification; import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; import org.jboss.cache.factories.annotations.Inject; +import org.jboss.cache.factories.annotations.NonVolatile; import org.jboss.cache.loader.AbstractCacheLoader; = import java.util.LinkedHashMap; @@ -67,16 +68,18 @@ */ public class JDBCCacheLoader extends AbstractCacheLoader { - private WorkspaceDataContainer dataContainer; = + public JDBCCacheLoader() { + } + = /** * Init the loader DataContainer with given WorkspaceDataContainer inst= ance. * * @param dataContainer WorkspaceDataContainer */ @Inject - public void initDataContainer(WorkspaceDataContainer dataContainer) thr= ows RepositoryConfigurationException + public void injectDependencies(WorkspaceDataContainer dataContainer) th= rows RepositoryConfigurationException { if (this.dataContainer !=3D null) { @@ -86,13 +89,13 @@ this.dataContainer =3D dataContainer; } = - = /** * {@inheritDoc} */ public void put(List modifications) throws Exception { // TODO + System.out.println(modifications); = } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2009-11-09 15:= 53:08 UTC (rev 523) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2009-11-09 15:= 54:36 UTC (rev 524) @@ -40,6 +40,7 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.naming.InitialContextInitializer; +import org.jboss.cache.factories.annotations.NonVolatile; import org.picocontainer.Startable; = import java.io.File; @@ -57,6 +58,7 @@ * @author Peter N= edonosko * @version $Id:GenericWorkspaceDataContainer.java 13433 2007-03-15 16:07:= 23Z peterit $ */ +(a)NonVolatile public class JDBCWorkspaceDataContainer extends WorkspaceDataContainerBase= implements Startable { = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 15:53:08 UTC (rev 523) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 15:54:36 UTC (rev 524) @@ -85,27 +85,32 @@ */ protected void setUp() throws Exception { - super.setUp(); - - // JBossCache = - initJBCConfig(); - - cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); - - initJBC(); - = - // run cache - cache.create(); - cache.start(); - - Node cacheRoot =3D cache.getRoot(); - - // prepare cache structures - nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); - props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); - - // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props); + try { + super.setUp(); + = + // JBossCache = + initJBCConfig(); + = + cache =3D new DefaultCacheFactory().createC= ache(jbcConfig, false); + = + initJBC(); + = + // run cache + cache.create(); + cache.start(); + = + Node cacheRoot =3D cache.getRoot(); + = + // prepare cache structures + nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NOD= ES)); + props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PRO= PS)); + = + // JCR connection + conn =3D new JBossCacheStorageConnection(cache, nodes, props); + } catch (Exception e) { + e.printStackTrace(); + throw e; + } } = protected void initJBCConfig() @@ -113,7 +118,7 @@ jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; } = - protected void initJBC() + protected void initJBC() throws Exception { // empty here } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 15:5= 3:08 UTC (rev 523) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 15:5= 4:36 UTC (rev 524) @@ -18,7 +18,25 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; = +import org.exoplatform.services.jcr.config.ContainerEntry; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.SimpleParameterEntry; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; +import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; +import org.exoplatform.services.jcr.util.ConfigurationHelper; +import org.jboss.cache.CacheSPI; + + /** * @author Alex Reshetnyak<= /a> * @version $Id$ @@ -44,14 +62,32 @@ } = @Override - protected void initJBC() + protected void initJBC() throws Exception { = // persistence container //WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceDa= taContainerTester(); + = + // Create WorkspaceEntry + ConfigurationHelper configurationHelper =3D ConfigurationHelper.getI= nstence(); + = + ContainerEntry containerEntry =3D new ContainerEntry(); + List params =3D new ArrayList(); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); + containerEntry.setParameters(params); + = + WorkspaceEntry ws =3D configurationHelper.getNewWs("ws_to_jbdc_cache= _loader", true, "data-source", "/target/temp/ws_to_jbdc_cache_loader/lalues= ", containerEntry); + = + RepositoryEntry re =3D new RepositoryEntry(); + re.addWorkspace(ws); + = + ValueStoragePluginProvider valueStoragePluginProvider =3D new Stand= aloneStoragePluginProvider(ws); = + = + JDBCWorkspaceDataContainer persistentContainer =3D new JDBCWorkspace= DataContainer(ws, re, null, valueStoragePluginProvider); = - //((CacheSPI)cache).getComponentRegistry().reg= isterComponent(persistentContainer, - // WorkspaceDataContainer.class); + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, + WorkspaceDataContainer.class); } = @Override --===============0806052558426584402==-- From do-not-reply at jboss.org Mon Nov 9 11:00:48 2009 Content-Type: multipart/mixed; boundary="===============6046548146862847784==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r525 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 11:00:48 -0500 Message-ID: <200911091600.nA9G0m7s012269@svn01.web.mwc.hst.phx2.redhat.com> --===============6046548146862847784== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 11:00:47 -0500 (Mon, 09 Nov 2009) New Revision: 525 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : test JDBCCacheLoadetTest. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 15:54:36 UTC (rev 524) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-09 16:00:47 UTC (rev 525) @@ -85,32 +85,27 @@ */ protected void setUp() throws Exception { - try { - super.setUp(); - = - // JBossCache = - initJBCConfig(); - = - cache =3D new DefaultCacheFactory().createC= ache(jbcConfig, false); - = - initJBC(); - = - // run cache - cache.create(); - cache.start(); - = - Node cacheRoot =3D cache.getRoot(); - = - // prepare cache structures - nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NOD= ES)); - props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PRO= PS)); - = - // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } + super.setUp(); + + // JBossCache = + initJBCConfig(); + + cache =3D new DefaultCacheFactory().createCach= e(jbcConfig, false); + + initJBC(); + + // run cache + cache.create(); + cache.start(); + + Node cacheRoot =3D cache.getRoot(); + + // prepare cache structures + nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); + props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); + + // JCR connection + conn =3D new JBossCacheStorageConnection(cache, nodes, props); } = protected void initJBCConfig() Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 15:5= 4:36 UTC (rev 524) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 16:0= 0:47 UTC (rev 525) @@ -20,10 +20,7 @@ = import java.io.Serializable; import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; import java.util.List; -import java.util.ListIterator; = import org.exoplatform.services.jcr.config.ContainerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; --===============6046548146862847784==-- From do-not-reply at jboss.org Mon Nov 9 11:03:31 2009 Content-Type: multipart/mixed; boundary="===============7220812070660253716==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r526 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Mon, 09 Nov 2009 11:03:31 -0500 Message-ID: <200911091603.nA9G3VtG012799@svn01.web.mwc.hst.phx2.redhat.com> --===============7220812070660253716== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-09 11:03:30 -0500 (Mon, 09 Nov 2009) New Revision: 526 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java Log: EXOJCR-205: base test added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-09 16:00:47= UTC (rev 525) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-09 16:03:30= UTC (rev 526) @@ -51,7 +51,7 @@ /** * Lock manager. */ - private LockManagerImpl lockManager; + private final LockManagerImpl lockManager; = /** * Logger. @@ -59,6 +59,16 @@ private final Log log =3D ExoLogger.getLogger("jcr.LockCacheLoader"); = /** + * LockCacheLoader constructor. + * + * @param lockManager + */ + public LockCacheLoader(LockManagerImpl lockManager) + { + this.lockManager =3D lockManager; + } + + /** * {@inheritDoc} */ @Override @@ -77,11 +87,12 @@ case PUT_DATA_ERASE : break; case PUT_DATA : - // changesLog begin - int pos =3D getElementPosition(m.getFqn(), JBossCacheSto= rage.SESSION); - sessionId =3D (String)m.getFqn().get(pos + 1); break; case PUT_KEY_VALUE : + if (m.getKey().equals(JBossCacheStorage.SESSION_ID)) + { + sessionId =3D (String)m.getValue(); + } break; case REMOVE_DATA : break; Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-09 16:0= 3:30 UTC (rev 526) @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import com.sun.tools.corba.se.idl.toJavaPortable.ValueFactory; + +import com.thoughtworks.xstream.core.ReferenceByIdMarshaller.IDGenerator; + +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.ValueData; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; +import org.exoplatform.services.jcr.impl.core.lock.LockManager; +import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; +import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.util.IdGenerator; +import org.jboss.cache.Modification; + +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.PropertyType; + +import junit.framework.TestCase; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author
Anatoliy= Bazko = + * @version $Id$ + */ +public class LockCacheLoaderTest extends AbstractCacheLoaderTest +{ + + private LockManagerImpl lockManager; + + private LockCacheLoader lockCacheLoader; + + private ValueFactoryImpl valueFactory; + + private final QPath testRoot =3D QPath.makeChildPath(Constants.ROOT_PAT= H, new InternalQName("", "testRoot")); + + public void setUp() throws Exception + { + + this.valueFactory =3D new ValueFactoryImpl(new LocationFactory(new N= amespaceRegistryImpl())); + this.lockManager =3D new TesterLockManagerImpl(); + this.lockCacheLoader =3D new LockCacheLoader(lockManager); + } + + public void testLock() throws Exception + { + List modifcations =3D new ArrayList(); + String parentIdentifier =3D IdGenerator.generate(); + + TransientPropertyData propertyData =3D + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), IdGenerator.generate(), 1, + PropertyType.BOOLEAN, parentIdentifier, false); + + propertyData =3D + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), IdGenerator.generate(), 1, + PropertyType.BOOLEAN, parentIdentifier, false); + + modifcations.add(addProperty(propertyData)); + } + + public void testUnLock() throws Exception + { + + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-09 16= :03:30 UTC (rev 526) @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Anatoliy= Bazko = + * @version $Id$ + */ +public class TesterLockManagerImpl extends LockManagerImpl +{ + + public TesterLockManagerImpl(WorkspacePersistentDataManager dataManager= , WorkspaceEntry config) + { + super(dataManager, config); + } + + public TesterLockManagerImpl() + { + this(null, null); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.j= ava ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============7220812070660253716==-- From do-not-reply at jboss.org Mon Nov 9 11:36:33 2009 Content-Type: multipart/mixed; boundary="===============3810702064973861534==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r527 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 11:36:33 -0500 Message-ID: <200911091636.nA9GaX3f021251@svn01.web.mwc.hst.phx2.redhat.com> --===============3810702064973861534== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 11:36:32 -0500 (Mon, 09 Nov 2009) New Revision: 527 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : test JDBCCacheLoadetTest. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 16:0= 3:30 UTC (rev 526) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 16:3= 6:32 UTC (rev 527) @@ -22,6 +22,8 @@ import java.util.ArrayList; import java.util.List; = +import org.exoplatform.services.idgenerator.IDGeneratorService; +import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.config.ContainerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.SimpleParameterEntry; @@ -31,6 +33,7 @@ import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jcr.util.ConfigurationHelper; +import org.exoplatform.services.jcr.util.IdGenerator; import org.jboss.cache.CacheSPI; = = @@ -73,6 +76,9 @@ params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); containerEntry.setParameters(params); + = + // Initialize id generator. + new IdGenerator(new IDGeneratorServiceImpl()); = WorkspaceEntry ws =3D configurationHelper.getNewWs("ws_to_jbdc_cache= _loader", true, "data-source", "/target/temp/ws_to_jbdc_cache_loader/lalues= ", containerEntry); = @@ -101,5 +107,15 @@ = // tests it } + = + public void testDeleteNode() throws Exception { + = + // prepare + super.testDeleteNode(); + conn.commit(); + = + // tests it + = + } } = --===============3810702064973861534==-- From do-not-reply at jboss.org Mon Nov 9 12:22:56 2009 Content-Type: multipart/mixed; boundary="===============1289647735153039873==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r528 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 12:22:55 -0500 Message-ID: <200911091722.nA9HMtd2032315@svn01.web.mwc.hst.phx2.redhat.com> --===============1289647735153039873== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 12:22:55 -0500 (Mon, 09 Nov 2009) New Revision: 528 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-09 16:36:32= UTC (rev 527) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-09 17:22:55= UTC (rev 528) @@ -43,8 +43,10 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.jboss.cache.CacheException; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; @@ -58,6 +60,8 @@ import java.util.Map; import java.util.Set; = +import javax.jcr.RepositoryException; + /** * Created by The eXo Platform SAS. * = @@ -94,11 +98,118 @@ */ public void put(List modifications) throws Exception { - // TODO System.out.println(modifications); + = + JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection)dataC= ontainer.openConnection(); + = + try + { + for (Modification m : modifications) + { + switch (m.getType()) + { + case PUT_DATA: + System.out.println(m); + break; + case PUT_DATA_ERASE: + System.out.println(m); + break; + case PUT_KEY_VALUE: + System.out.println(m); + doAddOrUpdate(m, jdbcConnection); + break; + case REMOVE_DATA: + System.out.println(m); + break; + case REMOVE_KEY_VALUE: + System.out.println(m); + break; + case REMOVE_NODE: + System.out.println(m); + break; + case MOVE: + System.out.println(m); + break; + default: + throw new CacheException("Unknown modification " + m.getT= ype()); + } + } + = + if (jdbcConnection !=3D null) + jdbcConnection.commit(); + } + finally + { + if (jdbcConnection !=3D null && jdbcConnection.isOpened()) + jdbcConnection.rollback(); + } + } = + private void doRemove(Modification modification, JDBCStorageConnection = jdbcConnection, String identifier) + throws IllegalStateException, RepositoryException + { + + ItemData itemData =3D jdbcConnection.getItemData(identifier); + + if (itemData instanceof NodeData) + jdbcConnection.delete((NodeData) itemData); + if (itemData instanceof PropertyData) + jdbcConnection.delete((PropertyData) itemData); } + = + private boolean isNodeData(Fqn fqn) + { + return fqn.toString().startsWith("/" +JBossCacheStorage.NODES); + } + = + /** + * Performs ADD and UPDATE to NodeData and PropertyData. + * @param modification + * @param jdbcConnection + * @throws IllegalStateException + * @throws RepositoryException + */ + private void doAddOrUpdate(Modification modification, JDBCStorageConnec= tion jdbcConnection) + throws IllegalStateException, RepositoryException + { + if (modification.getValue() instanceof NodeData) + { + //add or update node data + NodeData nodeData =3D (NodeData)modification.getValue(); = + ItemData itemData =3D jdbcConnection.getItemData(nodeData.getIden= tifier()); + + if (itemData =3D=3D null) + { + //add + jdbcConnection.add(nodeData); + } + else + { + //update + jdbcConnection.update(nodeData); + } + } + else if (modification.getValue() instanceof PropertyData) + { + //add or update property data + PropertyData propertyData =3D (PropertyData)modification.getValue= (); + + ItemData itemData =3D jdbcConnection.getItemData(propertyData.get= Identifier()); + + if (itemData =3D=3D null) + { + //add + jdbcConnection.add(propertyData); + } + else + { + //update + jdbcConnection.update(propertyData); + } + } + } + protected QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberF= ormatException, IllegalNameException { List elements =3D nodeFqn.peekElements(); --===============1289647735153039873==-- From do-not-reply at jboss.org Mon Nov 9 12:35:16 2009 Content-Type: multipart/mixed; boundary="===============0809031449865653133==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r529 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 12:35:16 -0500 Message-ID: <200911091735.nA9HZGP2002110@svn01.web.mwc.hst.phx2.redhat.com> --===============0809031449865653133== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 12:35:16 -0500 (Mon, 09 Nov 2009) New Revision: 529 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-09 17:22:55= UTC (rev 528) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-09 17:35:16= UTC (rev 529) @@ -126,6 +126,7 @@ break; case REMOVE_NODE: System.out.println(m); + doRemove(m, jdbcConnection, getID(m.getFqn())); break; case MOVE: System.out.println(m); @@ -145,6 +146,26 @@ } } = + /** + * Get ID from Fqn. + * @param fqn + * @return + */ + private String getID(Fqn fqn) + { + //TODO + return fqn.toString().split("/")[2]; + } + + /** + * Remove NodeData or PropertyData. + * = + * @param modification + * @param jdbcConnection + * @param identifier + * @throws IllegalStateException + * @throws RepositoryException + */ private void doRemove(Modification modification, JDBCStorageConnection = jdbcConnection, String identifier) throws IllegalStateException, RepositoryException { --===============0809031449865653133==-- From do-not-reply at jboss.org Mon Nov 9 12:45:28 2009 Content-Type: multipart/mixed; boundary="===============8644515372157046983==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r530 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 09 Nov 2009 12:45:28 -0500 Message-ID: <200911091745.nA9HjS2M004487@svn01.web.mwc.hst.phx2.redhat.com> --===============8644515372157046983== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-09 12:45:28 -0500 (Mon, 09 Nov 2009) New Revision: 530 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoader. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 17:3= 5:16 UTC (rev 529) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-09 17:4= 5:28 UTC (rev 530) @@ -22,15 +22,16 @@ import java.util.ArrayList; import java.util.List; = -import org.exoplatform.services.idgenerator.IDGeneratorService; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.config.ContainerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.SimpleParameterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jcr.util.ConfigurationHelper; import org.exoplatform.services.jcr.util.IdGenerator; @@ -44,6 +45,7 @@ */ public class JDBCCacheLoaderTest extends JBossCacheStorageConnectionTest { + JDBCWorkspaceDataContainer persistentContainer; = /** * {@inheritDoc} @@ -87,7 +89,7 @@ = ValueStoragePluginProvider valueStoragePluginProvider =3D new Stand= aloneStoragePluginProvider(ws); = = - JDBCWorkspaceDataContainer persistentContainer =3D new JDBCWorkspace= DataContainer(ws, re, null, valueStoragePluginProvider); + persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); = ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, WorkspaceDataContainer.class); @@ -106,6 +108,11 @@ conn.commit(); = // tests it + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + = + NodeData nd =3D (NodeData) connection.getItemData("1"); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); } = public void testDeleteNode() throws Exception { --===============8644515372157046983==-- From do-not-reply at jboss.org Tue Nov 10 02:27:28 2009 Content-Type: multipart/mixed; boundary="===============0093703453013077152==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r531 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Tue, 10 Nov 2009 02:27:28 -0500 Message-ID: <200911100727.nAA7RS21006421@svn01.web.mwc.hst.phx2.redhat.com> --===============0093703453013077152== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 02:27:27 -0500 (Tue, 10 Nov 2009) New Revision: 531 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java Log: EXOJCR-205: test added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-09 17:45:28= UTC (rev 530) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-10 07:27:27= UTC (rev 531) @@ -110,7 +110,8 @@ else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_KEY_VALUE && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_KEY_VALUE) { - performUnLock(lockChanges, sessionId); + PropertyData propertyData =3D (PropertyData)lockCh= anges.get(0).getOldValue(); + performUnLock(lockChanges, sessionId, propertyData= .getParentIdentifier()); } else { @@ -275,12 +276,11 @@ } } = - private void performUnLock(List lockChanges, String sessi= onId) + private void performUnLock(List lockChanges, String sessi= onId, String nodeIdentifier) { - // TODO parent nodeIdentifier try { - lockManager.internalUnLock(sessionId, "nodeIdentifier"); + lockManager.internalUnLock(sessionId, nodeIdentifier); } catch (LockException e) { Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-09 = 17:45:28 UTC (rev 530) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 07:27:27 UTC (rev 531) @@ -141,4 +141,8 @@ return list; } = + public Modification removeSession() + { + return new Modification(ModificationType.REMOVE_DATA, Fqn.fromString= ("/" + JBossCacheStorage.SESSION)); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-09 17:4= 5:28 UTC (rev 530) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 07:2= 7:27 UTC (rev 531) @@ -32,6 +32,7 @@ import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.util.IdGenerator; import org.jboss.cache.Modification; = @@ -53,7 +54,7 @@ public class LockCacheLoaderTest extends AbstractCacheLoaderTest { = - private LockManagerImpl lockManager; + private TesterLockManagerImpl lockManager; = private LockCacheLoader lockCacheLoader; = @@ -64,29 +65,62 @@ public void setUp() throws Exception { = - this.valueFactory =3D new ValueFactoryImpl(new LocationFactory(new N= amespaceRegistryImpl())); this.lockManager =3D new TesterLockManagerImpl(); this.lockCacheLoader =3D new LockCacheLoader(lockManager); } = public void testLock() throws Exception { - List modifcations =3D new ArrayList(); - String parentIdentifier =3D IdGenerator.generate(); + List modifications =3D new ArrayList(); + String nodeIdentifier =3D IdGenerator.generate(); + String sessionId =3D IdGenerator.generate(); = - TransientPropertyData propertyData =3D + TransientPropertyData lockIsDeepData =3D new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), IdGenerator.generate(), 1, - PropertyType.BOOLEAN, parentIdentifier, false); + PropertyType.BOOLEAN, nodeIdentifier, false); + TransientValueData lockIsDeepValue =3D new TransientValueData(false); + lockIsDeepData.setValue(lockIsDeepValue); = - propertyData =3D + TransientPropertyData lockOwnerData =3D new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), IdGenerator.generate(), 1, - PropertyType.BOOLEAN, parentIdentifier, false); + PropertyType.BOOLEAN, nodeIdentifier, false); + TransientValueData lockOwner =3D new TransientValueData("__system"); + lockOwnerData.setValue(lockOwner); = - modifcations.add(addProperty(propertyData)); + modifications.addAll(setSession(sessionId, "userId")); + modifications.add(addProperty(lockIsDeepData)); + modifications.add(addProperty(lockOwnerData)); + modifications.add(removeSession()); + lockCacheLoader.put(modifications); + + assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); } = public void testUnLock() throws Exception { + List modifications =3D new ArrayList(); + String nodeIdentifier =3D IdGenerator.generate(); + String sessionId =3D IdGenerator.generate(); = + TransientPropertyData lockIsDeepData =3D + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), IdGenerator.generate(), 1, + PropertyType.BOOLEAN, nodeIdentifier, false); + TransientValueData lockIsDeepValue =3D new TransientValueData(false); + lockIsDeepData.setValue(lockIsDeepValue); + + TransientPropertyData lockOwnerData =3D + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), IdGenerator.generate(), 1, + PropertyType.BOOLEAN, nodeIdentifier, false); + TransientValueData lockOwner =3D new TransientValueData("__system"); + lockOwnerData.setValue(lockOwner); + + modifications.addAll(setSession(sessionId, "userId")); + modifications.add(removeProperty(lockIsDeepData)); + modifications.add(removeProperty(lockOwnerData)); + modifications.add(removeSession()); + lockCacheLoader.put(modifications); + + assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); + assertEquals(sessionId, lockManager.getSessionid()); } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-09 17= :45:28 UTC (rev 530) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-10 07= :27:27 UTC (rev 531) @@ -20,6 +20,8 @@ import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; = +import javax.jcr.lock.LockException; + /** * Created by The eXo Platform SAS. * = @@ -31,6 +33,10 @@ public class TesterLockManagerImpl extends LockManagerImpl { = + private String nodeIdentifier; + + private String sessionId; + public TesterLockManagerImpl(WorkspacePersistentDataManager dataManager= , WorkspaceEntry config) { super(dataManager, config); @@ -40,4 +46,32 @@ { this(null, null); } + + /** + * Internal lock + */ + public synchronized void internalLock(String nodeIdentifier) throws Loc= kException + { + this.nodeIdentifier =3D nodeIdentifier; + } + + /** + * Internal lock + */ + public synchronized void internalUnLock(String nodeIdentifier, String s= essionId) throws LockException + { + this.nodeIdentifier =3D nodeIdentifier; + this.sessionId =3D sessionId; + } + + public String getNodeIdentifier() + { + return nodeIdentifier; + } + + public String getSessionid() + { + return sessionId; + } + } --===============0093703453013077152==-- From do-not-reply at jboss.org Tue Nov 10 02:53:00 2009 Content-Type: multipart/mixed; boundary="===============5389051495523816327==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r532 - in jcr/branches/1.12.0-JBC/component/core: src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Tue, 10 Nov 2009 02:53:00 -0500 Message-ID: <200911100753.nAA7r0A7010937@svn01.web.mwc.hst.phx2.redhat.com> --===============5389051495523816327== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 02:53:00 -0500 (Tue, 10 Nov 2009) New Revision: 532 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterSystemDataContainerHolder.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterWorkspaceEntry.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterWorkspacePersistedDataManager.java Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java Log: EXOJCR-205: add dummy classes Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-10 07:27:27 UTC = (rev 531) +++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-10 07:53:00 UTC = (rev 532) @@ -569,8 +569,8 @@ **/**/JBossCacheServiceTest__.java - **/**/TestItem__.java - = + **/**/TestItem__.java + **/**/LockCacheLoaderTest.java = **/**/JBossCacheStorageConnectionTest.jav= a Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 07:2= 7:27 UTC (rev 531) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 07:5= 3:00 UTC (rev 532) @@ -16,21 +16,10 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import com.sun.tools.corba.se.idl.toJavaPortable.ValueFactory; - -import com.thoughtworks.xstream.core.ReferenceByIdMarshaller.IDGenerator; - import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.LocationFactory; -import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; -import org.exoplatform.services.jcr.impl.core.lock.LockManager; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.util.IdGenerator; @@ -41,8 +30,6 @@ = import javax.jcr.PropertyType; = -import junit.framework.TestCase; - /** * Created by The eXo Platform SAS. * = @@ -72,8 +59,8 @@ public void testLock() throws Exception { List modifications =3D new ArrayList(); - String nodeIdentifier =3D IdGenerator.generate(); - String sessionId =3D IdGenerator.generate(); + String nodeIdentifier =3D "node1"; + String sessionId =3D "session1"; = TransientPropertyData lockIsDeepData =3D new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), IdGenerator.generate(), 1, @@ -99,8 +86,8 @@ public void testUnLock() throws Exception { List modifications =3D new ArrayList(); - String nodeIdentifier =3D IdGenerator.generate(); - String sessionId =3D IdGenerator.generate(); + String nodeIdentifier =3D "node1"; + String sessionId =3D "session1"; = TransientPropertyData lockIsDeepData =3D new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), IdGenerator.generate(), 1, Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-10 07= :27:27 UTC (rev 531) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-10 07= :53:00 UTC (rev 532) @@ -44,7 +44,7 @@ = public TesterLockManagerImpl() { - this(null, null); + this(new TesterWorkspacePersistedDataManager(null, null), new Tester= WorkspaceEntry()); } = /** Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/TesterSystemDataContainerHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterSystemDataContainerHolder.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterSystemDataContainerHolder.java 200= 9-11-10 07:53:00 UTC (rev 532) @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Anatoliy= Bazko = + * @version $Id$ + */ +public class TesterSystemDataContainerHolder extends SystemDataContain= erHolder +{ + + /** + * TesterSystemDataContainerHolder constructor. + * + * @param dataContainer + */ + public TesterSystemDataContainerHolder(WorkspaceDataContainer dataConta= iner) + { + super(dataContainer); + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/TesterSystemDataContain= erHolder.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/TesterWorkspaceEntry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterWorkspaceEntry.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterWorkspaceEntry.java 2009-11-10 07:= 53:00 UTC (rev 532) @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.config.WorkspaceEntry; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Anatoliy= Bazko = + * @version $Id$ + */ +public class TesterWorkspaceEntry extends WorkspaceEntry +{ + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/TesterWorkspaceEntry.ja= va ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/TesterWorkspacePersistedDataManager.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterWorkspacePersistedDataManager.java= (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterWorkspacePersistedDataManager.java= 2009-11-10 07:53:00 UTC (rev 532) @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Anatoliy= Bazko = + * @version $Id$ + */ +public class TesterWorkspacePersistedDataManager extends WorkspacePersiste= ntDataManager +{ + + /** + * TesterWorkspacePersistedDataManager constructor. + * + * @param dataContainer + * @param systemDataContainerHolder + */ + public TesterWorkspacePersistedDataManager(WorkspaceDataContainer dataC= ontainer, + SystemDataContainerHolder systemDataContaine= rHolder) + { + super(dataContainer, new TesterSystemDataContainerHolder(null)); + } + + /** + * {@inheritDoc} + */ + public void addItemPersistenceListener(ItemsPersistenceListener listene= r) + { + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/TesterWorkspacePersiste= dDataManager.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============5389051495523816327==-- From do-not-reply at jboss.org Tue Nov 10 03:12:16 2009 Content-Type: multipart/mixed; boundary="===============1786521235851399817==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r533 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 03:12:16 -0500 Message-ID: <200911100812.nAA8CGiE015104@svn01.web.mwc.hst.phx2.redhat.com> --===============1786521235851399817== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 03:12:16 -0500 (Tue, 10 Nov 2009) New Revision: 533 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java Log: EXOJCR-205: test fix Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 07:53:00 UTC (rev 532) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 08:12:16 UTC (rev 533) @@ -135,14 +135,12 @@ // add UserID by the key USER_ID list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring("/" + JBossCacheStorage.SESSION), JBossCacheStorage.USER_ID, userId)); - // remove all the attributes from /$SESSION - list.add(new Modification(ModificationType.REMOVE_DATA, Fqn.fromStri= ng("/" + JBossCacheStorage.SESSION))); // return return list; } = public Modification removeSession() { - return new Modification(ModificationType.REMOVE_DATA, Fqn.fromString= ("/" + JBossCacheStorage.SESSION)); + return new Modification(ModificationType.REMOVE_NODE, Fqn.fromString= ("/" + JBossCacheStorage.SESSION)); } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 07:5= 3:00 UTC (rev 532) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 08:1= 2:16 UTC (rev 533) @@ -51,7 +51,6 @@ = public void setUp() throws Exception { - this.lockManager =3D new TesterLockManagerImpl(); this.lockCacheLoader =3D new LockCacheLoader(lockManager); } @@ -63,13 +62,13 @@ String sessionId =3D "session1"; = TransientPropertyData lockIsDeepData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), IdGenerator.generate(), 1, + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), "prop1", 1, PropertyType.BOOLEAN, nodeIdentifier, false); TransientValueData lockIsDeepValue =3D new TransientValueData(false); lockIsDeepData.setValue(lockIsDeepValue); = TransientPropertyData lockOwnerData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), IdGenerator.generate(), 1, + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), "prop2", 1, PropertyType.BOOLEAN, nodeIdentifier, false); TransientValueData lockOwner =3D new TransientValueData("__system"); lockOwnerData.setValue(lockOwner); @@ -90,13 +89,13 @@ String sessionId =3D "session1"; = TransientPropertyData lockIsDeepData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), IdGenerator.generate(), 1, + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), "prop1", 1, PropertyType.BOOLEAN, nodeIdentifier, false); TransientValueData lockIsDeepValue =3D new TransientValueData(false); lockIsDeepData.setValue(lockIsDeepValue); = TransientPropertyData lockOwnerData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), IdGenerator.generate(), 1, + new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), "prop2", 1, PropertyType.BOOLEAN, nodeIdentifier, false); TransientValueData lockOwner =3D new TransientValueData("__system"); lockOwnerData.setValue(lockOwner); --===============1786521235851399817==-- From do-not-reply at jboss.org Tue Nov 10 03:54:54 2009 Content-Type: multipart/mixed; boundary="===============3713192823077403619==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r534 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 03:54:54 -0500 Message-ID: <200911100854.nAA8sstG023120@svn01.web.mwc.hst.phx2.redhat.com> --===============3713192823077403619== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-10 03:54:53 -0500 (Tue, 10 Nov 2009) New Revision: 534 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java Log: EXOJCR-204: Updated abstract test-class Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 08:12:16 UTC (rev 533) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 08:54:53 UTC (rev 534) @@ -39,17 +39,46 @@ public abstract class AbstractCacheLoaderTest extends TestCase { = + protected static boolean addPUTDATA =3D true; + /** * Returns {@link Modification} like as node added. NodeData is written= to /$NODE/IDxxxx as an attribute by key ITEM_DATA. * = + * PUT_DATA /$NODES/ParentId/ChildName + * PUT_KEY_VALUE /$NODES/ParentId/ChildName.Id + * PUT_DATA /$NODES/Id + * PUT_KEY_VALUE /$NODES/Id.Item_data + * = * @param data * @return */ - public Modification addNode(NodeData data) + public List addNode(NodeData data) { - String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); - return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); + List list =3D new ArrayList(); + + if (data.getParentIdentifier() !=3D null) + { + // if not root: + // write to : /$NODES/ParentID/ChildName + // key=3DITEM_ID val =3D uuid + String childFqn =3D + "/" + JBossCacheStorage.NODES + "/" + data.getParentIdentifier= () + "/" + + data.getQPath().getEntries()[data.getQPath().getEntries()= .length - 1].getAsString(); + // Fire modification child added + if (addPUTDATA) + list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromS= tring(childFqn))); + // add modification that value is written by key ITEM_ID + list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fro= mString(childFqn), JBossCacheStorage.ITEM_ID, + data.getIdentifier())); + } + String nodeFqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIde= ntifier(); + // add PUT_DATA modification + if (addPUTDATA) + list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromStri= ng(nodeFqn))); + + list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring(nodeFqn), JBossCacheStorage.ITEM_DATA, + data)); + return list; } = /** @@ -57,27 +86,54 @@ * so {@link Modification} instance contains additional data: Key=3DITE= M_DATA, value=3DNodeData - data of already removed * node. * = + * REMOVE_NODE /$NODES/ParentId/ChildName + * REMOVE_NODE /$NODES/Id + * = * @param data * @return */ - public Modification removeNode(NodeData data) + public List removeNode(NodeData data) { + List list =3D new ArrayList(); + if (data.getParentIdentifier() !=3D null) + { + // remove child from parent + String childFqn =3D + "/" + JBossCacheStorage.NODES + "/" + data.getParentIdentifier= () + "/" + + data.getQPath().getEntries()[data.getQPath().getEntries()= .length - 1].getAsString(); + list.add(new Modification(ModificationType.REMOVE_NODE, Fqn.fromS= tring(childFqn))); + } String fqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIdentif= ier(); - return new Modification(ModificationType.REMOVE_NODE, Fqn.fromString= (fqn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); + list.add(new Modification(ModificationType.REMOVE_NODE, Fqn.fromStri= ng(fqn), JBossCacheStorage.ITEM_DATA, data)); + return list; } = /** * Returns {@link Modification} like as property added. PropertyData is= written to /$PROPERTY/IDxxxx as an attribute by key ITEM_DATA. * = + * PUT_KEY_VALUE /$NODES/ParentId.propertyName + * PUT_DATA /$PROPERTIES/Id + * PUT_KEY_VALUE /$PROPERTIES/Id.Item_data + * = * @param data * @return */ - public Modification addProperty(PropertyData data) + public List addProperty(PropertyData data) { + List list =3D new ArrayList(); + String parentFqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getP= arentIdentifier(); + // write attribute to parent's map + list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring(parentFqn), data.getQPath().getName() + .getAsString(), data.getIdentifier())); + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); - return new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStri= ng(fqn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); + // add modification PUT_DATA if enabled = + if (addPUTDATA) + list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromStri= ng(fqn))); + // put property data + list + .add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStr= ing(fqn), JBossCacheStorage.ITEM_DATA, data)); + return list; } = /** @@ -86,17 +142,20 @@ * filed of {@link Modification} instance contains same PropertyData (m= eaning that there was an old value, so this is an update, no add * action) * = + * PUT_KEY_VALUE /$PROPERTIES/Id.Item_data + * = * @param data * @return */ - public Modification updateProperty(PropertyData data) + public List updateProperty(PropertyData data) { + List list =3D new ArrayList(); String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); Modification modification =3D - new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromString(f= qn), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); + new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromString(f= qn), JBossCacheStorage.ITEM_DATA, data); modification.setOldValue(data); - return modification; + list.add(modification); + return list; } = /** @@ -104,17 +163,26 @@ * so {@link Modification} instance contains additional data: Key=3DITE= M_DATA, value=3DPropertyData - data of already removed * node. * = + * REMOVE_KEY_VALUE /$NODES/ParentId.propertyName + * REMOVE_NODE /$PROPERTIES/Id + * = * @param data * @return */ - public Modification removeProperty(PropertyData data) + public List removeProperty(PropertyData data) { + List list =3D new ArrayList(); + String parentFqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getP= arentIdentifier(); + // write attribute to parent's map + list.add(new Modification(ModificationType.REMOVE_KEY_VALUE, Fqn.fro= mString(parentFqn), data.getQPath().getName() + .getAsString())); + String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); Modification modification =3D - new Modification(ModificationType.REMOVE_NODE, Fqn.fromString(fqn= ), (Object)JBossCacheStorage.ITEM_DATA, - (Object)data); + new Modification(ModificationType.REMOVE_NODE, Fqn.fromString(fqn= ), JBossCacheStorage.ITEM_DATA, data); modification.setOldValue(data); - return modification; + list.add(modification); + return list; } = /** @@ -122,6 +190,9 @@ * This imitates situation when WorkspaceDataManager walks thought tran= saction changes log, and on the beginning of each plain * changes log, such sequence is generated. * = + * PUT_KEY_VALUE /$SESSION.sessionId + * PUT_KEY_VALUE /$SESSION.userId + * = * @param sessionId * @param userId * @return @@ -139,8 +210,17 @@ return list; } = - public Modification removeSession() + /** + * Removes Session inforamtion. + * = + * REMOVE_NODE /$SESSION + * = + * @return + */ + public List removeSession() { - return new Modification(ModificationType.REMOVE_NODE, Fqn.fromString= ("/" + JBossCacheStorage.SESSION)); + List list =3D new ArrayList(); + list.add(new Modification(ModificationType.REMOVE_NODE, Fqn.fromStri= ng("/" + JBossCacheStorage.SESSION))); + return list; } } --===============3713192823077403619==-- From do-not-reply at jboss.org Tue Nov 10 03:56:46 2009 Content-Type: multipart/mixed; boundary="===============4356403379531178320==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r535 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 03:56:46 -0500 Message-ID: <200911100856.nAA8ukhX023635@svn01.web.mwc.hst.phx2.redhat.com> --===============4356403379531178320== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-10 03:56:46 -0500 (Tue, 10 Nov 2009) New Revision: 535 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202: IndexerCacheLoaderTest updated = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 0= 8:54:53 UTC (rev 534) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 0= 8:56:46 UTC (rev 535) @@ -90,8 +90,30 @@ indexerCacheLoader.put(modification); assertNotNull(searchManager.getAddedNodes()); assertNotNull(searchManager.getRemovedNodes()); + assertTrue(searchManager.getRemovedNodes().isEmpty()); } = + public void testRemoveNode() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + NodeData node =3D + new TransientNodeData(node1path, "n123456", 1, Constants.NT_UNSTR= UCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + + QPath prop1path =3D QPath.makeChildPath(node1path, Constants.JCR_PRI= MARYTYPE); + PropertyData prop =3D new TransientPropertyData(prop1path, "p123456"= , 0, PropertyType.NAME, "n123456", false); + + List modification =3D new ArrayList(); + + modification.add(removeNode(node)); + modification.add(removeProperty(prop)); + indexerCacheLoader.put(modification); + assertTrue(searchManager.getAddedNodes().isEmpty()); + assertNotNull(searchManager.getRemovedNodes()); + assertFalse(searchManager.getRemovedNodes().isEmpty()); + + } + private class DummySearchManager implements SearchManager { = --===============4356403379531178320==-- From do-not-reply at jboss.org Tue Nov 10 04:00:00 2009 Content-Type: multipart/mixed; boundary="===============4794993888971936101==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r536 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Tue, 10 Nov 2009 04:00:00 -0500 Message-ID: <200911100900.nAA900cM023949@svn01.web.mwc.hst.phx2.redhat.com> --===============4794993888971936101== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 04:00:00 -0500 (Tue, 10 Nov 2009) New Revision: 536 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java Log: EXOJCR-205: test fix Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-10 08:56:46 UTC (rev= 535) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-10 09:00:00 UTC (rev= 536) @@ -117,8 +117,10 @@ = /** * Map NodeIdentifier -- lockData + * = + * TODO: changed from private to protected */ - private final Map pendingLocks; + protected final Map pendingLocks; = /** * Map lockToken --lockData Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 0= 8:56:46 UTC (rev 535) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 0= 9:00:00 UTC (rev 536) @@ -85,8 +85,8 @@ = List modification =3D new ArrayList(); = - modification.add(addNode(newNode)); - modification.add(addProperty(newProperty)); + modification.addAll(addNode(newNode)); + modification.addAll(addProperty(newProperty)); indexerCacheLoader.put(modification); assertNotNull(searchManager.getAddedNodes()); assertNotNull(searchManager.getRemovedNodes()); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 08:5= 6:46 UTC (rev 535) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 09:0= 0:00 UTC (rev 536) @@ -17,9 +17,13 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.NodeImpl; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.util.IdGenerator; @@ -73,10 +77,12 @@ TransientValueData lockOwner =3D new TransientValueData("__system"); lockOwnerData.setValue(lockOwner); = + lockManager.addPendingLock(nodeIdentifier, new LockData(nodeIdentifi= er, "token", false, false, "__system", -1)); + modifications.addAll(setSession(sessionId, "userId")); - modifications.add(addProperty(lockIsDeepData)); - modifications.add(addProperty(lockOwnerData)); - modifications.add(removeSession()); + modifications.addAll(addProperty(lockIsDeepData)); + modifications.addAll(addProperty(lockOwnerData)); + modifications.addAll(removeSession()); lockCacheLoader.put(modifications); = assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); @@ -101,9 +107,9 @@ lockOwnerData.setValue(lockOwner); = modifications.addAll(setSession(sessionId, "userId")); - modifications.add(removeProperty(lockIsDeepData)); - modifications.add(removeProperty(lockOwnerData)); - modifications.add(removeSession()); + modifications.addAll(removeProperty(lockIsDeepData)); + modifications.addAll(removeProperty(lockOwnerData)); + modifications.addAll(removeSession()); lockCacheLoader.put(modifications); = assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 10 08:56:46 UTC (rev 535) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 10 09:00:00 UTC (rev 536) @@ -106,7 +106,7 @@ new String[]{Constants.ROOT_UUID}, null, false, "asd")); = List modifications =3D new ArrayList(); - modifications.add(addNode(newNode)); + modifications.addAll(addNode(newNode)); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); @@ -125,7 +125,7 @@ lf.parseAbsPath("/").getInternalPath(), true, null, null, false, = "asd")); = List modifications =3D new ArrayList(); - modifications.add(addNode(newNode)); + modifications.addAll(addNode(newNode)); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); @@ -144,7 +144,7 @@ .getInternalPath(), true, null, null, false, "asd")); = List modifications =3D new ArrayList(); - modifications.add(removeNode(newNode)); + modifications.addAll(removeNode(newNode)); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); @@ -163,7 +163,7 @@ .getInternalPath(), true, null, null, false, "asd")); = List modifications =3D new ArrayList(); - modifications.add(addProperty(newProperty)); + modifications.addAll(addProperty(newProperty)); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); @@ -182,7 +182,7 @@ .getInternalPath(), true, null, null, false, "asd")); = List modifications =3D new ArrayList(); - modifications.add(updateProperty(newProperty)); + modifications.addAll(updateProperty(newProperty)); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); @@ -201,7 +201,7 @@ .getInternalPath(), true, null, null, false, "asd")); = List modifications =3D new ArrayList(); - modifications.add(removeProperty(newProperty)); + modifications.addAll(removeProperty(newProperty)); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-10 08= :56:46 UTC (rev 535) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-10 09= :00:00 UTC (rev 536) @@ -16,10 +16,15 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import sun.security.util.PendingException; + import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; = +import java.util.Map; + import javax.jcr.lock.LockException; = /** @@ -74,4 +79,9 @@ return sessionId; } = + public void addPendingLock(String nodeIdentifier, LockData lData) + { + pendingLocks.put(nodeIdentifier, lData); + } + } --===============4794993888971936101==-- From do-not-reply at jboss.org Tue Nov 10 04:00:36 2009 Content-Type: multipart/mixed; boundary="===============8940563024183621963==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r537 - jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command. Date: Tue, 10 Nov 2009 04:00:36 -0500 Message-ID: <200911100900.nAA90aSw024338@svn01.web.mwc.hst.phx2.redhat.com> --===============8940563024183621963== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-10 04:00:35 -0500 (Tue, 10 Nov 2009) New Revision: 537 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/PutCommand.java Log: EXOJCR-28 save added to updateContent() method Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/PutCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PutCommand.java 2009-11-10 09:00:00 UTC (rev 536) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PutCommand.java 2009-11-10 09:00:35 UTC (rev 537) @@ -219,8 +219,8 @@ { content.addMixin(mixinName); } - } + node.getSession().save(); = } = --===============8940563024183621963==-- From do-not-reply at jboss.org Tue Nov 10 04:00:51 2009 Content-Type: multipart/mixed; boundary="===============1366493046118839756==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r538 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 04:00:51 -0500 Message-ID: <200911100900.nAA90p4r024436@svn01.web.mwc.hst.phx2.redhat.com> --===============1366493046118839756== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 04:00:50 -0500 (Tue, 10 Nov 2009) New Revision: 538 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-205: test fix Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 0= 9:00:35 UTC (rev 537) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 0= 9:00:50 UTC (rev 538) @@ -105,8 +105,8 @@ = List modification =3D new ArrayList(); = - modification.add(removeNode(node)); - modification.add(removeProperty(prop)); + modification.addAll(removeNode(node)); + modification.addAll(removeProperty(prop)); indexerCacheLoader.put(modification); assertTrue(searchManager.getAddedNodes().isEmpty()); assertNotNull(searchManager.getRemovedNodes()); --===============1366493046118839756==-- From do-not-reply at jboss.org Tue Nov 10 04:03:51 2009 Content-Type: multipart/mixed; boundary="===============4675517645821678449==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r539 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Tue, 10 Nov 2009 04:03:50 -0500 Message-ID: <200911100903.nAA93o26025103@svn01.web.mwc.hst.phx2.redhat.com> --===============4675517645821678449== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-10 04:03:50 -0500 (Tue, 10 Nov 2009) New Revision: 539 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-204: Updated test and cache loader Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-10 0= 9:00:50 UTC (rev 538) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-10 0= 9:03:50 UTC (rev 539) @@ -31,6 +31,7 @@ import org.exoplatform.services.log.Log; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; +import org.jboss.cache.Modification.ModificationType; import org.jboss.cache.factories.annotations.Inject; = import java.util.List; @@ -53,8 +54,10 @@ = private final Fqn nodeFqn =3D Fqn.fromString(JBossCacheStorage.NODES); = - private final Fqn propFqn =3D Fqn.fromString(JBossCacheStorage.PROPS); + private final Fqn propertyFqn =3D Fqn.fromString(JBossCacheStorage.PROP= S); = + private final Fqn sessionFqn =3D Fqn.fromString(JBossCacheStorage.SESSI= ON); + private ObservationManagerRegistry observationManagerRegistry =3D null; = /** @@ -78,12 +81,9 @@ { = // get SessionID from list - // TODO: get real user ID - String userId =3D "admin-dummy-id"; - + String userId =3D ""; // get UserID from list - // TODO: get real session ID - String sessionId =3D "user-session-dummy-id"; + String sessionId =3D ""; = // extract real list from list of modification // real - means list with out fake modifications containing UserID &= etc @@ -105,35 +105,47 @@ for (Modification m : modifications) { = - if (m.getFqn().isDirectChildOf(nodeFqn) || m.getFqn().isDir= ectChildOf(propFqn)) + if (isItemSubtree(m)) { ItemData item =3D getItemData(m); // TODO: remove hardcode - if (item =3D=3D null) + if (item !=3D null) { - break; + int eventType =3D eventType(m); + boolean result =3D true; + // check event type + result &=3D isTypeMatch(criteria, eventType); + // check Path + result &=3D isPathMatch(criteria, item); + // check UUID + result &=3D isIdentifierMatch(criteria, item); + // check NodeType + // TODO: FIX nodetype checks + //result &=3D isNodeTypeMatch(criteria, item, changes= Log); + // check session + result &=3D isSessionMatch(criteria, sessionId); + if (result) + { + String path =3D + observationManagerRegistry.getLocationFactory()= .createJCRPath(item.getQPath()).getAsString( + false); + events.add(new EventImpl(eventType, path, userId)); + } } // it wasn't able to retrive item's data - int eventType =3D eventType(m); - boolean result =3D true; - // check event type - result &=3D isTypeMatch(criteria, eventType); - // check Path - result &=3D isPathMatch(criteria, item); - // check UUID - result &=3D isIdentifierMatch(criteria, item); - // check NodeType - // TODO: FIX nodetype checks - //result &=3D isNodeTypeMatch(criteria, item, changesLog= ); - // check session - result &=3D isSessionMatch(criteria, sessionId); - if (result) - { - String path =3D - observationManagerRegistry.getLocationFactory().cr= eateJCRPath(item.getQPath()).getAsString( - false); - events.add(new EventImpl(eventType, path, userId)); - } } + // if this is session + else if (isSessionSubtree(m)) + { + if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE){ + if (m.getKey().equals(JBossCacheStorage.SESSION_ID)) + sessionId =3D (String)m.getValue(); + else if (m.getKey().equals(JBossCacheStorage.USER_ID)) + userId =3D (String)m.getValue();} + else if (m.getType() =3D=3D ModificationType.REMOVE_N= ODE){ + sessionId =3D ""; + userId =3D ""; + } + } } = if (events.size() > 0) @@ -159,7 +171,7 @@ // node added return Event.NODE_ADDED; } - else if (modification.getFqn().isDirectChildOf(propFqn)) + else if (modification.getFqn().isDirectChildOf(propertyFqn)) { // property added or changed if (modification.getOldValue() !=3D null) @@ -182,7 +194,7 @@ // node removed return Event.NODE_REMOVED; } - else if (modification.getFqn().isDirectChildOf(propFqn)) + else if (modification.getFqn().isDirectChildOf(propertyFqn)) { // property removed return Event.PROPERTY_REMOVED; @@ -206,7 +218,6 @@ = private boolean isIdentifierMatch(ListenerCriteria criteria, ItemData i= tem) { - if (criteria.getIdentifier() =3D=3D null) return true; // for each uuid in list @@ -217,19 +228,24 @@ return true; } return false; - } = + /** + * Check associated parent node path. + * = + * @param criteria + * @param item + * @return + */ private boolean isPathMatch(ListenerCriteria criteria, ItemData item) { if (criteria.getAbsPath() =3D=3D null) return true; - // 8.3.3 Only events whose associated parent node is at absPath (or - // within its subtree, if isDeep is true) will be received. QPath itemPath =3D item.getQPath(); return itemPath.isDescendantOf(criteria.getAbsPath(), !criteria.isDe= ep()); } = + // shoud be changed in order to obtain parent's data elsewhere. Cache i= s not accessible from cacheloader.put(List) @Deprecated private boolean isNodeTypeMatch(ListenerCriteria criteria, ItemData ite= m, List modifications) throws RepositoryException @@ -282,9 +298,23 @@ return false; } = + protected boolean isItemSubtree(Modification modification) + { + return modification.getFqn().isDirectChildOf(nodeFqn) || modificatio= n.getFqn().isDirectChildOf(propertyFqn); + } + + protected boolean isSessionSubtree(Modification modification) + { + return modification.getFqn().isDirectChildOf(sessionFqn) || modifica= tion.getFqn().isChildOrEquals(sessionFqn); + } + protected ItemData getItemData(Modification m) { - return (ItemData)m.getValue(); + if (m.getValue() instanceof ItemData) + { + return (ItemData)m.getValue(); + } + return null; } = } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 10 09:00:50 UTC (rev 538) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 10 09:03:50 UTC (rev 539) @@ -103,15 +103,17 @@ Constants.ROOT_UUID, new AccessControlList()); DummyListener listener =3D new DummyListener(); registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, null, true, - new String[]{Constants.ROOT_UUID}, null, false, "asd")); + new String[]{Constants.ROOT_UUID}, null, false, "session1")); = - List modifications =3D new ArrayList(); + List modifications =3D new ArrayList(set= Session("session1", "admin")); modifications.addAll(addNode(newNode)); + modifications.addAll(removeSession()); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); assertEquals(Event.NODE_ADDED, event.getType()); assertEquals(lf.createJCRPath(node1path).getAsString(false), event.g= etPath()); + assertEquals("admin", event.getUserID()); } = public void testAddNode() throws Exception @@ -122,15 +124,14 @@ Constants.ROOT_UUID, new AccessControlList()); DummyListener listener =3D new DummyListener(); registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, - lf.parseAbsPath("/").getInternalPath(), true, null, null, false, = "asd")); + lf.parseAbsPath("/").getInternalPath(), true, null, null, false, = "session1")); = - List modifications =3D new ArrayList(); + List modifications =3D new ArrayList(set= Session("session1", "admin")); modifications.addAll(addNode(newNode)); + modifications.addAll(removeSession()); loader.put(modifications); - assertEquals(1, listener.eventList.size()); - Event event =3D listener.eventList.get(0); - assertEquals(Event.NODE_ADDED, event.getType()); - assertEquals(lf.createJCRPath(node1path).getAsString(false), event.g= etPath()); + + assertEvent(Event.NODE_ADDED, node1path, listener, "admin"); } = public void testRemoveNode() throws Exception @@ -141,15 +142,14 @@ Constants.ROOT_UUID, new AccessControlList()); DummyListener listener =3D new DummyListener(); registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= REMOVED, lf.parseAbsPath("/") - .getInternalPath(), true, null, null, false, "asd")); + .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(); + List modifications =3D new ArrayList(set= Session("session1", "admin")); modifications.addAll(removeNode(newNode)); + modifications.addAll(removeSession()); loader.put(modifications); - assertEquals(1, listener.eventList.size()); - Event event =3D listener.eventList.get(0); - assertEquals(Event.NODE_REMOVED, event.getType()); - assertEquals(lf.createJCRPath(node1path).getAsString(false), event.g= etPath()); + + assertEvent(Event.NODE_REMOVED, node1path, listener, "admin"); } = public void testAddProperty() throws Exception @@ -160,15 +160,14 @@ = DummyListener listener =3D new DummyListener(); registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_ADDED, lf.parseAbsPath("/") - .getInternalPath(), true, null, null, false, "asd")); + .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(); + List modifications =3D new ArrayList(set= Session("session1", "admin")); modifications.addAll(addProperty(newProperty)); + modifications.addAll(removeSession()); loader.put(modifications); - assertEquals(1, listener.eventList.size()); - Event event =3D listener.eventList.get(0); - assertEquals(Event.PROPERTY_ADDED, event.getType()); - assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); + + assertEvent(Event.PROPERTY_ADDED, prop1path, listener, "admin"); } = public void testUpdateProperty() throws Exception @@ -179,15 +178,14 @@ = DummyListener listener =3D new DummyListener(); registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_CHANGED, lf.parseAbsPath("/") - .getInternalPath(), true, null, null, false, "asd")); + .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(); + List modifications =3D new ArrayList(set= Session("session1", "admin")); modifications.addAll(updateProperty(newProperty)); + modifications.addAll(removeSession()); loader.put(modifications); - assertEquals(1, listener.eventList.size()); - Event event =3D listener.eventList.get(0); - assertEquals(Event.PROPERTY_CHANGED, event.getType()); - assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); + + assertEvent(Event.PROPERTY_CHANGED, prop1path, listener, "admin"); } = public void testRemoveProperty() throws Exception @@ -198,15 +196,24 @@ = DummyListener listener =3D new DummyListener(); registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_REMOVED, lf.parseAbsPath("/") - .getInternalPath(), true, null, null, false, "asd")); + .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(); + List modifications =3D new ArrayList(set= Session("session1", "admin")); modifications.addAll(removeProperty(newProperty)); + modifications.addAll(removeSession()); loader.put(modifications); + + assertEvent(Event.PROPERTY_REMOVED, prop1path, listener, "admin"); + } + + protected void assertEvent(int eventType, QPath prop1path, DummyListene= r listener, String userId) + throws RepositoryException + { assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); - assertEquals(Event.PROPERTY_REMOVED, event.getType()); + assertEquals(eventType, event.getType()); assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); + assertEquals(userId, event.getUserID()); } = @Override @@ -222,17 +229,14 @@ super(null, null, null); } = - // TODO: remove hardcode public LocationFactory getLocationFactory() { return lf; } - } = class DummyListener implements EventListener { - public List eventList =3D new ArrayList(); = public void onEvent(EventIterator events) --===============4675517645821678449==-- From do-not-reply at jboss.org Tue Nov 10 05:01:37 2009 Content-Type: multipart/mixed; boundary="===============7687190805222406446==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r540 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 05:01:37 -0500 Message-ID: <200911101001.nAAA1bkq004109@svn01.web.mwc.hst.phx2.redhat.com> --===============7687190805222406446== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-10 05:01:36 -0500 (Tue, 10 Nov 2009) New Revision: 540 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-204: Updated test Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 10 09:03:50 UTC (rev 539) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 10 10:01:36 UTC (rev 540) @@ -70,10 +70,12 @@ = final Map nss =3D new HashMap(); = - ns.put("jcr", "http:jcr"); + ns.put("jcr", "http://jcr"); + nss.put("http://jcr", "jcr"); ns.put("", ""); - nss.put("http:jcr", "jcr"); nss.put("", ""); + ns.put("nt", "http://nt"); + nss.put("http://nt", "nt"); = this.lf =3D new LocationFactory(new NamespaceAccessor() { @@ -216,6 +218,29 @@ assertEquals(userId, event.getUserID()); } = + public void testFilterByNodeType() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + NodeData newNode =3D + new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Consta= nts.NT_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + NodeData newNode2 =3D + new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Consta= nts.NT_RESOURCE, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + DummyListener listener =3D new DummyListener(); + // listening only to NT_RESOURCE nodes + registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, + lf.parseAbsPath("/").getInternalPath(), true, null, new InternalQ= Name[]{Constants.NT_RESOURCE}, false, "session1")); + + List modifications =3D new ArrayList(set= Session("session1", "admin")); + modifications.addAll(addNode(newNode)); + modifications.addAll(addNode(newNode2)); + modifications.addAll(removeSession()); + loader.put(modifications); + // one event expected + assertEvent(Event.NODE_ADDED, node1path, listener, "admin"); + } + = @Override protected void tearDown() throws Exception { --===============7687190805222406446==-- From do-not-reply at jboss.org Tue Nov 10 05:14:41 2009 Content-Type: multipart/mixed; boundary="===============0809380104330146787==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r541 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 05:14:41 -0500 Message-ID: <200911101014.nAAAEfbe006686@svn01.web.mwc.hst.phx2.redhat.com> --===============0809380104330146787== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 05:14:41 -0500 (Tue, 10 Nov 2009) New Revision: 541 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java Log: EXOJCR-205: fix test Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-10 10:01:36= UTC (rev 540) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-10 10:14:41= UTC (rev 541) @@ -107,11 +107,11 @@ { performLock(lockChanges, sessionId); } - else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_KEY_VALUE - && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_KEY_VALUE) + else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_NODE + && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_NODE) { PropertyData propertyData =3D (PropertyData)lockCh= anges.get(0).getOldValue(); - performUnLock(lockChanges, sessionId, propertyData= .getParentIdentifier()); + performUnLock(lockChanges, propertyData.getParentI= dentifier(), sessionId); } else { @@ -161,6 +161,8 @@ case REMOVE_DATA : break; case REMOVE_KEY_VALUE : + break; + case REMOVE_NODE : if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) { PropertyData propertyData =3D (PropertyData)m.getValu= e(); @@ -172,8 +174,6 @@ } } break; - case REMOVE_NODE : - break; case MOVE : break; default : @@ -183,34 +183,41 @@ else if (m.getFqn().hasElement(JBossCacheStorage.NODES)) { int nodesPos =3D getElementPosition(m.getFqn(), JBossCacheStor= age.NODES); - if (m.getFqn().size() =3D=3D nodesPos + 1) + if (m.getFqn().size() =3D=3D nodesPos + 2) { // this is a node and node is locked String nodeIdentifier =3D (String)m.getFqn().get(nodesPos += 1); - if (lockManager.hasLockNode(nodeIdentifier)) + + switch (m.getType()) { - switch (m.getType()) - { - case PUT_DATA_ERASE : - break; - case PUT_DATA : + case PUT_DATA_ERASE : + break; + case PUT_DATA : + if (lockManager.hasLockNode(nodeIdentifier)) + { removedLock.remove(nodeIdentifier); - break; - case PUT_KEY_VALUE : - break; - case REMOVE_DATA : - break; - case REMOVE_KEY_VALUE : - break; - case REMOVE_NODE : + } + break; + case PUT_KEY_VALUE : + break; + case REMOVE_DATA : + break; + case REMOVE_KEY_VALUE : + break; + case REMOVE_NODE : + if (lockManager.hasLockNode(nodeIdentifier)) + { removedLock.add(nodeIdentifier); - break; - case MOVE : + } + break; + case MOVE : + if (lockManager.hasLockNode(nodeIdentifier)) + { removedLock.remove(nodeIdentifier); - break; - default : - throw new CacheException("Unknown modification " += m.getType()); - } + } + break; + default : + throw new CacheException("Unknown modification " + m.= getType()); } } } @@ -231,6 +238,7 @@ { if (lockManager.hasPendingLocks(nodeIdentifier)) { + log.info("Perform lock operation nodeIdentifier=3D" + nodeIden= tifier); lockManager.internalLock(nodeIdentifier); } else @@ -276,11 +284,12 @@ } } = - private void performUnLock(List lockChanges, String sessi= onId, String nodeIdentifier) + private void performUnLock(List lockChanges, String nodeI= dentifier, String sessionId) { try { - lockManager.internalUnLock(sessionId, nodeIdentifier); + log.info("Perform lock operation nodeIdentifier=3D" + nodeIdentif= ier + " sessionId=3D" + sessionId); + lockManager.internalUnLock(nodeIdentifier, sessionId); } catch (LockException e) { --===============0809380104330146787==-- From do-not-reply at jboss.org Tue Nov 10 05:17:01 2009 Content-Type: multipart/mixed; boundary="===============3299775424350380446==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r542 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 05:17:00 -0500 Message-ID: <200911101017.nAAAH07E007268@svn01.web.mwc.hst.phx2.redhat.com> --===============3299775424350380446== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 05:17:00 -0500 (Tue, 10 Nov 2009) New Revision: 542 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java Log: EXOJCR-205: add print debug information Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-10 10:14:41= UTC (rev 541) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-10 10:17:00= UTC (rev 542) @@ -238,7 +238,7 @@ { if (lockManager.hasPendingLocks(nodeIdentifier)) { - log.info("Perform lock operation nodeIdentifier=3D" + nodeIden= tifier); + System.out.println("Perform lock operation nodeIdentifier=3D" = + nodeIdentifier); lockManager.internalLock(nodeIdentifier); } else @@ -288,7 +288,7 @@ { try { - log.info("Perform lock operation nodeIdentifier=3D" + nodeIdentif= ier + " sessionId=3D" + sessionId); + System.out.println("Perform unlock operation nodeIdentifier=3D" += nodeIdentifier + " sessionId=3D" + sessionId); lockManager.internalUnLock(nodeIdentifier, sessionId); } catch (LockException e) --===============3299775424350380446==-- From do-not-reply at jboss.org Tue Nov 10 05:32:39 2009 Content-Type: multipart/mixed; boundary="===============3357730150407722583==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r543 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 05:32:39 -0500 Message-ID: <200911101032.nAAAWdU4009260@svn01.web.mwc.hst.phx2.redhat.com> --===============3357730150407722583== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-10 05:32:38 -0500 (Tue, 10 Nov 2009) New Revision: 543 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java Log: EXOJCR-204: Updated abstract test-class Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 10:17:00 UTC (rev 542) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 10:32:38 UTC (rev 543) @@ -180,7 +180,6 @@ String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); Modification modification =3D new Modification(ModificationType.REMOVE_NODE, Fqn.fromString(fqn= ), JBossCacheStorage.ITEM_DATA, data); - modification.setOldValue(data); list.add(modification); return list; } --===============3357730150407722583==-- From do-not-reply at jboss.org Tue Nov 10 05:46:45 2009 Content-Type: multipart/mixed; boundary="===============1497101726060010958==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r544 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 05:46:45 -0500 Message-ID: <200911101046.nAAAkj5n011499@svn01.web.mwc.hst.phx2.redhat.com> --===============1497101726060010958== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-10 05:46:45 -0500 (Tue, 10 Nov 2009) New Revision: 544 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : test JDBCCacheLoadetTest. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-10 10:3= 2:38 UTC (rev 543) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-10 10:4= 6:45 UTC (rev 544) @@ -19,13 +19,28 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import java.io.Serializable; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import java.util.Properties; = +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + +import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; +import org.exoplatform.services.jcr.config.CacheEntry; import org.exoplatform.services.jcr.config.ContainerEntry; +import org.exoplatform.services.jcr.config.LockManagerEntry; +import org.exoplatform.services.jcr.config.LockPersisterEntry; +import org.exoplatform.services.jcr.config.QueryHandlerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.SimpleParameterEntry; +import org.exoplatform.services.jcr.config.ValueStorageEntry; +import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; @@ -35,6 +50,7 @@ import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jcr.util.ConfigurationHelper; import org.exoplatform.services.jcr.util.IdGenerator; +import org.exoplatform.services.naming.InitialContextInitializer; import org.jboss.cache.CacheSPI; = = @@ -71,8 +87,6 @@ //WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceDa= taContainerTester(); = // Create WorkspaceEntry - ConfigurationHelper configurationHelper =3D ConfigurationHelper.getI= nstence(); - = ContainerEntry containerEntry =3D new ContainerEntry(); List params =3D new ArrayList(); params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); @@ -81,13 +95,20 @@ = // Initialize id generator. new IdGenerator(new IDGeneratorServiceImpl()); + = + // Set system property Context.INITIAL_CONTEXT_FACTORY to initial co= ntext. = + System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); + = + // Create data source. Will be created new data source to new test. = + String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); + createNewDataSource(dataSourceName); = - WorkspaceEntry ws =3D configurationHelper.getNewWs("ws_to_jbdc_cache= _loader", true, "data-source", "/target/temp/ws_to_jbdc_cache_loader/lalues= ", containerEntry); + WorkspaceEntry ws =3D getNewWs("ws_to_jbdc_cache_loader", true, data= SourceName, "/target/temp/ws_to_jbdc_cache_loader/lalues", containerEntry); = RepositoryEntry re =3D new RepositoryEntry(); re.addWorkspace(ws); = - ValueStoragePluginProvider valueStoragePluginProvider =3D new Stand= aloneStoragePluginProvider(ws); = + ValueStoragePluginProvider valueStoragePluginProvider =3D new Stand= aloneStoragePluginProvider(ws); = persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); = @@ -124,5 +145,121 @@ // tests it = } + = + public WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, String= dsName, String vsPath, ContainerEntry entry) + throws Exception + { + + List params =3D new ArrayList(); + + params.add(new SimpleParameterEntry("sourceName", dsName)); + params.add(new SimpleParameterEntry("db-type", "generic")); + params.add(new SimpleParameterEntry("multi-db", isMultiDb ? "true" := "false")); + params.add(new SimpleParameterEntry("update-storage", "true")); + params.add(new SimpleParameterEntry("max-buffer-size", "204800")); + + if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != =3D null) + { + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB= _DIALECT, entry + .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT= ))); + } + + String oldSwap =3D entry.getParameterValue("swap-directory"); + String newSwap =3D oldSwap.substring(0, oldSwap.lastIndexOf('/')) + = '/' + wsName; + + params.add(new SimpleParameterEntry("swap-directory", newSwap)); + + ContainerEntry containerEntry =3D + new ContainerEntry("org.exoplatform.services.jcr.impl.stora= ge.jdbc.JDBCWorkspaceDataContainer", + (ArrayList) params); + containerEntry.setParameters(params); + + if (vsPath !=3D null) + { + + ArrayList vsparams =3D new ArrayList(); + ValueStorageFilterEntry filterEntry =3D new ValueStorageFilterEnt= ry(); + filterEntry.setPropertyType("Binary"); + vsparams.add(filterEntry); + + ValueStorageEntry valueStorageEntry =3D + new ValueStorageEntry("org.exoplatform.services.jcr.impl= .storage.value.fs.SimpleFileValueStorage", + vsparams); + ArrayList spe =3D new ArrayList(); + spe.add(new SimpleParameterEntry("path", vsPath)); + valueStorageEntry.setId(IdGenerator.generate()); + valueStorageEntry.setParameters(spe); + valueStorageEntry.setFilters(vsparams); + + // containerEntry.setValueStorages(); + containerEntry.setParameters(params); + ArrayList list =3D new ArrayList(1); + list.add(valueStorageEntry); + + containerEntry.setValueStorages(list); + + } + + // Indexer + ArrayList qParams =3D new ArrayList(); + qParams.add(new SimpleParameterEntry("indexDir", "../temp/index/" + = IdGenerator.generate())); + QueryHandlerEntry qEntry =3D + new QueryHandlerEntry("org.exoplatform.services.jcr.impl.co= re.query.lucene.SearchIndex", qParams); + + WorkspaceEntry workspaceEntry =3D + new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.= generate(), "nt:unstructured"); + workspaceEntry.setContainer(containerEntry); + + ArrayList cacheParams =3D new ArrayList(); + + cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); + cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); + CacheEntry cacheEntry =3D new CacheEntry(cacheParams); + cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persi= stent.LinkedWorkspaceStorageCacheImpl"); + + workspaceEntry.setCache(cacheEntry); + + workspaceEntry.setQueryHandler(qEntry); + + LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); + lockManagerEntry.setTimeout(900000); + LockPersisterEntry persisterEntry =3D new LockPersisterEntry(); + persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.= FileSystemLockPersister"); + ArrayList lpParams =3D new ArrayList(); + lpParams.add(new SimpleParameterEntry("path", "../temp/lock")); + persisterEntry.setParameters(lpParams); + lockManagerEntry.setPersister(persisterEntry); + workspaceEntry.setLockManager(lockManagerEntry); + + // workspaceEntry + return workspaceEntry; + } + = + public void createNewDataSource(String dataSourceName) throws Exception + { + + Properties properties =3D new Properties(); + + properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); + String newurl =3D "jdbc:hsqldb:file:target/temp/data/" + dataSourceN= ame; + + properties.setProperty("url", newurl); + properties.setProperty("username", "sa"); + properties.setProperty("password", ""); + DataSource bds =3D BasicDataSourceFactory.createDataSource(propertie= s); + if (!newurl.contains("hsqldb")) + { + createDatabase(bds, dataSourceName); + } + + new InitialContext().rebind(dataSourceName, bds); + } + = + private void createDatabase(DataSource ds, String dbName) throws SQLExc= eption + { + Connection connection =3D ds.getConnection(); + PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); + st.executeQuery(); + } } = --===============1497101726060010958==-- From do-not-reply at jboss.org Tue Nov 10 05:53:28 2009 Content-Type: multipart/mixed; boundary="===============3588344058794838999==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r545 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Tue, 10 Nov 2009 05:53:28 -0500 Message-ID: <200911101053.nAAArSFM011948@svn01.web.mwc.hst.phx2.redhat.com> --===============3588344058794838999== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-10 05:53:27 -0500 (Tue, 10 Nov 2009) New Revision: 545 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202: IndexerCacheLoaderTest tests updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-10 1= 0:46:45 UTC (rev 544) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-10 1= 0:53:27 UTC (rev 545) @@ -98,10 +98,13 @@ for (Modification m : modifications) { = - String uuid =3D parseUUID(m.getFqn()); + // check do we need skip modification + // $NODES ,$PROPS cache-node modification and child cache-node (/= $NODES/nodeUUID/[]childNodeName) are skipped + // we process only modifications with Fqn like /[$NODES | $PROPS]= /UUID + if (m.getFqn().size() =3D=3D 2) + { + String uuid =3D parseUUID(m.getFqn()); = - if (uuid !=3D null) - { switch (m.getType()) { case PUT_DATA : @@ -130,7 +133,6 @@ = break; case PUT_KEY_VALUE : - // must be never called // update node if (isNode(m.getFqn())) { @@ -149,7 +151,6 @@ // update node if (isNode(m.getFqn())) { - addedNodes.add(uuid); removedNodes.add(uuid); } else @@ -162,7 +163,10 @@ // removed property - do update node if (isNode(m.getFqn())) { - updateNodes.add(uuid); + if (!removedNodes.contains(uuid)) + { + updateNodes.add(uuid); + } } else { Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 1= 0:46:45 UTC (rev 544) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-10 1= 0:53:27 UTC (rev 545) @@ -36,6 +36,7 @@ = import java.io.IOException; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Set; = @@ -88,9 +89,15 @@ modification.addAll(addNode(newNode)); modification.addAll(addProperty(newProperty)); indexerCacheLoader.put(modification); - assertNotNull(searchManager.getAddedNodes()); - assertNotNull(searchManager.getRemovedNodes()); + + //check + assertFalse(searchManager.getAddedNodes().isEmpty()); assertTrue(searchManager.getRemovedNodes().isEmpty()); + + Set expectedAddUUID =3D new HashSet(); + expectedAddUUID.add("n123456"); + assertEquals(expectedAddUUID.size(), searchManager.getAddedNodes().s= ize()); + assertTrue(expectedAddUUID.containsAll(searchManager.getAddedNodes()= )); } = public void testRemoveNode() throws Exception @@ -109,11 +116,144 @@ modification.addAll(removeProperty(prop)); indexerCacheLoader.put(modification); assertTrue(searchManager.getAddedNodes().isEmpty()); - assertNotNull(searchManager.getRemovedNodes()); assertFalse(searchManager.getRemovedNodes().isEmpty()); = + Set expectedRemUUID =3D new HashSet(); + expectedRemUUID.add("n123456"); + assertEquals(searchManager.getRemovedNodes().size(), expectedRemUUID= .size()); + assertTrue(expectedRemUUID.containsAll(searchManager.getRemovedNodes= ())); } = + public void testUpdateProperty() throws Exception + { + // two updates on same node + QPath node1path =3D QPath.parse("[]:1[]node:1"); + QPath prop1path =3D QPath.makeChildPath(node1path, Constants.JCR_PRI= MARYTYPE); + QPath prop2path =3D QPath.makeChildPath(node1path, new InternalQName= (Constants.NS_JCR_URI, "myType")); + PropertyData prop1 =3D new TransientPropertyData(prop1path, "p111123= 456", 0, PropertyType.NAME, "n123456", false); + PropertyData prop2 =3D new TransientPropertyData(prop2path, "p222123= 456", 0, PropertyType.STRING, "n123456", false); + + // one update on another node + QPath node2path =3D QPath.parse("[]:1[]node:1"); + QPath prop3path =3D QPath.makeChildPath(node1path, Constants.JCR_PRI= MARYTYPE); + PropertyData prop3 =3D new TransientPropertyData(prop1path, "p333123= 456", 0, PropertyType.NAME, "n2123456", false); + List modification =3D new ArrayList(); + + modification.addAll(updateProperty(prop1)); + modification.addAll(updateProperty(prop2)); + modification.addAll(updateProperty(prop3)); + indexerCacheLoader.put(modification); + assertFalse(searchManager.getAddedNodes().isEmpty()); + assertFalse(searchManager.getRemovedNodes().isEmpty()); + + Set expectedRemUUID =3D new HashSet(); + expectedRemUUID.add("n123456"); + expectedRemUUID.add("n2123456"); + assertEquals(searchManager.getRemovedNodes().size(), expectedRemUUID= .size()); + assertTrue(expectedRemUUID.containsAll(searchManager.getRemovedNodes= ())); + + Set expectedAddUUID =3D new HashSet(); + expectedAddUUID.add("n123456"); + expectedAddUUID.add("n2123456"); + assertEquals(searchManager.getAddedNodes().size(), expectedAddUUID.s= ize()); + assertTrue(expectedAddUUID.containsAll(searchManager.getAddedNodes()= )); + } + + public void testAddNewPropertyUpdate() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + + QPath prop1path =3D QPath.makeChildPath(node1path, new InternalQName= (Constants.NS_JCR_URI, "myProp")); + PropertyData prop1 =3D new TransientPropertyData(prop1path, "p222123= 456", 0, PropertyType.STRING, "n123456", false); + + List modification =3D new ArrayList(); + + modification.addAll(addProperty(prop1)); + indexerCacheLoader.put(modification); + + assertFalse(searchManager.getAddedNodes().isEmpty()); + assertFalse(searchManager.getRemovedNodes().isEmpty()); + + Set expectedRemUUID =3D new HashSet(); + expectedRemUUID.add("n123456"); + assertEquals(searchManager.getRemovedNodes().size(), expectedRemUUID= .size()); + assertTrue(expectedRemUUID.containsAll(searchManager.getRemovedNodes= ())); + + Set expectedAddUUID =3D new HashSet(); + expectedAddUUID.add("n123456"); + assertEquals(searchManager.getAddedNodes().size(), expectedAddUUID.s= ize()); + assertTrue(expectedAddUUID.containsAll(searchManager.getAddedNodes()= )); + } + + public void testRemovePropertyUpdate() throws Exception + { + QPath node1path =3D QPath.parse("[]:1[]node:1"); + + QPath prop1path =3D QPath.makeChildPath(node1path, new InternalQName= (Constants.NS_JCR_URI, "myProp")); + PropertyData prop1 =3D new TransientPropertyData(prop1path, "p222123= 456", 0, PropertyType.STRING, "n123456", false); + + List modification =3D new ArrayList(); + + modification.addAll(this.removeProperty(prop1)); + indexerCacheLoader.put(modification); + + assertFalse(searchManager.getAddedNodes().isEmpty()); + assertFalse(searchManager.getRemovedNodes().isEmpty()); + + Set expectedRemUUID =3D new HashSet(); + expectedRemUUID.add("n123456"); + assertEquals(searchManager.getRemovedNodes().size(), expectedRemUUID= .size()); + assertTrue(expectedRemUUID.containsAll(searchManager.getRemovedNodes= ())); + + Set expectedAddUUID =3D new HashSet(); + expectedAddUUID.add("n123456"); + assertEquals(searchManager.getAddedNodes().size(), expectedAddUUID.s= ize()); + assertTrue(expectedAddUUID.containsAll(searchManager.getAddedNodes()= )); + } + + public void testMoveNode() throws Exception + { + QPath srcpath =3D QPath.parse("[]:1[]node:1"); + QPath destpath =3D QPath.parse("[]:1[]nodeDest:1"); + NodeData srcNode =3D + new TransientNodeData(srcpath, "n123456", 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + + QPath prop1path =3D QPath.makeChildPath(srcpath, Constants.JCR_PRIMA= RYTYPE); + PropertyData srcProperty =3D + new TransientPropertyData(prop1path, "p123456", 0, PropertyType.N= AME, "n123456", false); + + NodeData destNode =3D + new TransientNodeData(destpath, "n222222", 1, Constants.NT_UNSTRU= CTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + + QPath prop2path =3D QPath.makeChildPath(destpath, Constants.JCR_PRIM= ARYTYPE); + PropertyData destProperty =3D + new TransientPropertyData(prop2path, "p222222", 0, PropertyType.N= AME, "n222222", false); + + List modification =3D new ArrayList(); + + modification.addAll(addNode(destNode)); + modification.addAll(addProperty(destProperty)); + modification.addAll(removeNode(srcNode)); + modification.addAll(removeProperty(srcProperty)); + indexerCacheLoader.put(modification); + + //check + assertFalse(searchManager.getAddedNodes().isEmpty()); + assertFalse(searchManager.getRemovedNodes().isEmpty()); + + Set expectedAddUUID =3D new HashSet(); + expectedAddUUID.add("n222222"); + assertEquals(searchManager.getAddedNodes().size(), expectedAddUUID.s= ize()); + assertTrue(expectedAddUUID.containsAll(searchManager.getAddedNodes()= )); + + Set expectedRemoveUUID =3D new HashSet(); + expectedRemoveUUID.add("n123456"); + assertEquals(searchManager.getRemovedNodes().size(), expectedRemoveU= UID.size()); + assertTrue(expectedRemoveUUID.containsAll(searchManager.getRemovedNo= des())); + } + private class DummySearchManager implements SearchManager { = --===============3588344058794838999==-- From do-not-reply at jboss.org Tue Nov 10 07:07:27 2009 Content-Type: multipart/mixed; boundary="===============8408167912640371269==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r546 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 07:07:26 -0500 Message-ID: <200911101207.nAAC7Qox023296@svn01.web.mwc.hst.phx2.redhat.com> --===============8408167912640371269== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-10 07:07:26 -0500 (Tue, 10 Nov 2009) New Revision: 546 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java Log: EXOJCR-199: simple test on JCR core Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java 2009-11-10 12:07= :26 UTC (rev 546) @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.JcrImplBaseTest; + +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.Property; +import javax.jcr.PropertyIterator; +import javax.jcr.Value; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 10.11.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class SimpleNodeReadTest extends JcrImplBaseTest +{ + + public void testReadRootNode() throws Exception + { + Node root =3D session.getRootNode(); + + log.info(session.getWorkspace().getName() + " " + root.getPath()); + log.info("Properties: "); + try + { + for (PropertyIterator pi =3D root.getProperties(); pi.hasNext();) + { + Property p =3D pi.nextProperty(); + String values =3D ""; + if (p.getDefinition().isMultiple()) + { + for (Value v : p.getValues()) + { + values +=3D v.getString() + " "; + } + } + else + { + values +=3D p.getString(); + } + log.info(p.getPath() + " : " + values); + } + } + catch (Exception e) + { + log.error("Error: ", e); + } + + log.info("Child nodes: "); + try + { + for (NodeIterator ni =3D root.getNodes(); ni.hasNext();) + { + Node n =3D ni.nextNode(); + log.info(n.getPath() + " : " + n.getPrimaryNodeType().getName(= )); + } + } + catch (Exception e) + { + log.error("Error: ", e); + } + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/SimpleNodeReadTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id --===============8408167912640371269==-- From do-not-reply at jboss.org Tue Nov 10 08:32:21 2009 Content-Type: multipart/mixed; boundary="===============1094343508272571817==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r547 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader. Date: Tue, 10 Nov 2009 08:32:20 -0500 Message-ID: <200911101332.nAADWKxh011025@svn01.web.mwc.hst.phx2.redhat.com> --===============1094343508272571817== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-10 08:32:20 -0500 (Tue, 10 Nov 2009) New Revision: 547 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java Log: EXOJCR-202: IndexerCacheLoaderTest updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-10 1= 2:07:26 UTC (rev 546) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-10 1= 3:32:20 UTC (rev 547) @@ -16,6 +16,7 @@ */ package org.exoplatform.services.jcr.impl.core.query.cacheloader; = +import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= age; @@ -115,8 +116,7 @@ } else { - // this is property - // TODO do update of node - need uuid of owner node + // this is property - do nothing } break; case PUT_DATA_ERASE : @@ -128,24 +128,26 @@ } else { - // TODO do update of node - need uuid of owner node + // this is property - do nothing } - break; case PUT_KEY_VALUE : - // update node - if (isNode(m.getFqn())) + + if (!isNode(m.getFqn())) { - if (addedNodes.contains(uuid)) - { - // do nothing - node by uuid will be indexed - } - else - { - // update document by this uuid - updateNodes.add(uuid); - } + PropertyData property =3D (PropertyData)m.getValue(); + uuid =3D property.getParentIdentifier(); } + + if (addedNodes.contains(uuid)) + { + // do nothing - node by uuid will be indexed + } + else + { + // update document by this uuid + updateNodes.add(uuid); + } break; case REMOVE_DATA : // update node @@ -155,8 +157,7 @@ } else { - //TODO do update of owner node - //updateNodes.add(owner_uuid); + // this is a property - do nothing } break; case REMOVE_KEY_VALUE : @@ -170,8 +171,7 @@ } else { - //TODO do update of owner node - //updateNodes.add(owner_uuid); + // this is a property - do nothing } = break; @@ -183,8 +183,7 @@ } else { - //TODO do update of owner node - //updateNodes.add(owner_uuid); + // this is a property - do nothing } = break; @@ -201,9 +200,8 @@ else { // must be never happen - // TODO update both nodes + throw new UnsupportedOperationException("Moving of pr= operties is unsupported."); } - break; default : throw new CacheException("Unknown modification " + m.get= Type()); --===============1094343508272571817==-- From do-not-reply at jboss.org Tue Nov 10 09:53:55 2009 Content-Type: multipart/mixed; boundary="===============4237992329164512318==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r548 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/inmemory and 4 other directories. Date: Tue, 10 Nov 2009 09:53:54 -0500 Message-ID: <200911101453.nAAErs1A026394@svn01.web.mwc.hst.phx2.redhat.com> --===============4237992329164512318== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-10 09:53:54 -0500 (Tue, 10 Nov 2009) New Revision: 548 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/storage/WorkspaceStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java Log: EXOJCR-201: implementation sessionId support Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-10 13:32:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-10 14:53:54 UTC (rev 548) @@ -18,10 +18,14 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; +import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; import org.exoplatform.services.jcr.dataflow.PersistentDataManager; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; +import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stenerFilter; import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPers= istenceListener; @@ -128,85 +132,103 @@ WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; = + // prepare changes log list + List chengesLogList =3D new ArrayList(); + if (changesLog instanceof PlainChangesLog) + { + chengesLogList.add((PlainChangesLog)changesLog); + } + else if (changesLog instanceof CompositeChangesLog) + { + for (ChangesLogIterator iter =3D ((CompositeChangesLog)changesLog= ).getLogIterator(); iter.hasNextLog();) + { + chengesLogList.add(iter.nextLog()); + } + } + try { - for (Iterator iter =3D changesLog.getAllStates().itera= tor(); iter.hasNext();) + for (PlainChangesLog currChangesLog : chengesLogList) { - ItemState itemState =3D iter.next(); + for (Iterator iter =3D currChangesLog.getAllStates(= ).iterator(); iter.hasNext();) + { + ItemState itemState =3D iter.next(); = - if (!itemState.isPersisted()) - continue; + if (!itemState.isPersisted()) + continue; = - long start =3D System.currentTimeMillis(); + long start =3D System.currentTimeMillis(); = - TransientItemData data =3D (TransientItemData)itemState.getDat= a(); + TransientItemData data =3D (TransientItemData)itemState.get= Data(); = - WorkspaceStorageConnection conn =3D null; - if (isSystemDescendant(data.getQPath())) - { - conn =3D systemConnection =3D=3D null - // we need system connection but it's not exist - ? systemConnection =3D (systemDataContainer !=3D dataCon= tainer - // if it's different container instances - ? systemDataContainer.equals(dataContainer) && thisCo= nnection !=3D null - // but container confugrations are same and non-syste= m connnection open - // reuse this connection as system - ? systemDataContainer.reuseConnection(thisConnecti= on) - // or open one new system - : systemDataContainer.openConnection() - // else if it's same container instances (system and = this) - : thisConnection =3D=3D null - // and non-system connection doens't exist - open it - ? thisConnection =3D dataContainer.openConnection() - // if already open - use it - : thisConnection) - // system connection opened - use it - : systemConnection; - } - else - { - conn =3D thisConnection =3D=3D null - // we need this conatiner conection - ? thisConnection =3D (systemDataContainer !=3D dataConta= iner - // if it's different container instances - ? dataContainer.equals(systemDataContainer) && system= Connection !=3D null - // but container confugrations are same and system co= nnnection open - // reuse system connection as this - ? dataContainer.reuseConnection(systemConnection) - // or open one new - : dataContainer.openConnection() - // else if it's same container instances (system and = this) - : systemConnection =3D=3D null - // and system connection doens't exist - open it - ? systemConnection =3D dataContainer.openConnectio= n() - // if already open - use it - : systemConnection) - // this connection opened - use it - : thisConnection; - } + WorkspaceStorageConnection conn =3D null; + if (isSystemDescendant(data.getQPath())) + { + conn =3D systemConnection =3D=3D null + // we need system connection but it's not exist + ? systemConnection =3D (systemDataContainer !=3D data= Container + // if it's different container instances + ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null + // but container confugrations are same and non-sy= stem connnection open + // reuse this connection as system + ? systemDataContainer.reuseConnection(thisConne= ction) + // or open one new system + : systemDataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : thisConnection =3D=3D null + // and non-system connection doens't exist - open = it + ? thisConnection =3D dataContainer.openConnecti= on() + // if already open - use it + : thisConnection) + // system connection opened - use it + : systemConnection; + } + else + { + conn =3D thisConnection =3D=3D null + // we need this conatiner conection + ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null + // but container confugrations are same and system= connnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnectio= n) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openConnec= tion() + // if already open - use it + : systemConnection) + // this connection opened - use it + : thisConnection; + } = - data.increasePersistedVersion(); + data.increasePersistedVersion(); = - if (itemState.isAdded()) - { - doAdd(data, conn, addedNodes); + if (itemState.isAdded()) + { + doAdd(data, conn, addedNodes); + } + else if (itemState.isUpdated()) + { + doUpdate(data, conn); + } + else if (itemState.isDeleted()) + { + doDelete(data, conn); + } + else if (itemState.isRenamed()) + { + doRename(data, conn, addedNodes); + } + + if (LOG.isDebugEnabled()) + LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) + + "ms, " + data.getQPath().getAsString()); } - else if (itemState.isUpdated()) - { - doUpdate(data, conn); - } - else if (itemState.isDeleted()) - { - doDelete(data, conn); - } - else if (itemState.isRenamed()) - { - doRename(data, conn, addedNodes); - } - - if (LOG.isDebugEnabled()) - LOG.debug(ItemState.nameFromValue(itemState.getState()) + "= " + (System.currentTimeMillis() - start) - + "ms, " + data.getQPath().getAsString()); + // conn.removeSessionInfo(); } if (thisConnection !=3D null) thisConnection.commit(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-10 = 13:32:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-10 = 14:53:54 UTC (rev 548) @@ -211,6 +211,20 @@ { } = + /** + * {@inheritDoc} + */ + public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + { + } + + /** + * {@inheritDoc} + */ + public void removeSessionInfo() throws RepositoryException + { + } + public boolean isOpened() { return false; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-10 13:32:= 20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-10 14:53:= 54 UTC (rev 548) @@ -56,11 +56,16 @@ = protected final Node propsRoot; = - protected JBossCacheStorage(Node nodesRoot, Node<= Serializable, Object> propsRoot) + protected final Node sessionRoot; + + protected JBossCacheStorage(Node nodesRoot, Node<= Serializable, Object> propsRoot, + Node sessionRoot) { this.nodesRoot =3D nodesRoot; = this.propsRoot =3D propsRoot; + + this.sessionRoot =3D sessionRoot; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -10 13:32:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -10 14:53:54 UTC (rev 548) @@ -70,9 +70,9 @@ * @param cache Cache */ public JBossCacheStorageConnection(Cache cache, N= ode nodesRoot, - Node propsRoot) + Node propsRoot, Node ses= sionRoot) { - super(nodesRoot, propsRoot); + super(nodesRoot, propsRoot, sessionRoot); = this.cache =3D cache; } @@ -257,7 +257,7 @@ if (!key.equals(ITEM_DATA)) { String propId =3D (String)parentNode.get(key); - if (propId =3D=3D null) = + if (propId =3D=3D null) { throw new RepositoryException("FATAL Child Property Id key = is null. Parent " + parent.getQPath().getAsString()); @@ -554,6 +554,39 @@ } = /** + * {@inheritDoc} + */ + public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + { + startBatch(); + + if (sessionRoot.getData().size() !=3D 0) + { + throw new RepositoryException("Session attributes already exists = in cache storage."); + } + + // add attributes + sessionRoot.put(JBossCacheStorage.SESSION_ID, sessionId); + sessionRoot.put(JBossCacheStorage.USER_ID, userId); + } + + /** + * {@inheritDoc} + */ + public void removeSessionInfo() throws InvalidItemStateException, Repos= itoryException + { + startBatch(); + + if (sessionRoot.getData().size() =3D=3D 0) + { + throw new RepositoryException("Session attributes not exists in c= ache storage."); + } + + // remove attributes + sessionRoot.clearData(); + } + + /** * Start batching. */ private void startBatch() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-10 13:32:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-10 14:53:54 UTC (rev 548) @@ -79,7 +79,7 @@ Node itemsRoot) { super(treeRoot.getFqn(), itemsRoot.getFqn()); - = + this.cache =3D cache; //this.itemsRoot =3D itemsRoot; //this.treeRoot =3D treeRoot; @@ -394,6 +394,20 @@ } = /** + * {@inheritDoc} + */ + public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + { + } + + /** + * {@inheritDoc} + */ + public void removeSessionInfo() throws InvalidItemStateException, Repos= itoryException + { + } + + /** * Start batching. */ private void startBatch() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-10 13:32:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-10 14:53:54 UTC (rev 548) @@ -71,6 +71,8 @@ = private Node properties; = + private Node session; + /** * JBossWorkspaceDataContainer constructor. * @@ -113,31 +115,32 @@ // initializes configuration state, the root node, etc. this.cache.create(); this.cache.start(); - = + Node cacheRoot =3D cache.getRoot(); //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); = // prepare cache structures this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .NODES)); this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheSt= orage.PROPS)); + this.session =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.SESSION)); } = public void start() { // TODO started on init, due to RepositoryContainer logic -// if (persistentContainer instanceof Startable) -// { -// ((Startable)persistentContainer).start(); -// } -// -// this.cache.start(); -// = -// Node cacheRoot =3D cache.getRoot(); -// //Node wsRoot =3D cacheRoot.addChild(Fqn.fro= mElements(repositoryName, containerName)); -// -// // prepare cache structures -// this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.NODES)); -// this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCache= Storage.PROPS)); + // if (persistentContainer instanceof Startable) + // { + // ((Startable)persistentContainer).start(); + // } + // + // this.cache.start(); + // = + // Node cacheRoot =3D cache.getRoot(); + // //Node wsRoot =3D cacheRoot.addChild(F= qn.fromElements(repositoryName, containerName)); + // + // // prepare cache structures + // this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCach= eStorage.NODES)); + // this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBos= sCacheStorage.PROPS)); } = public void stop() @@ -162,12 +165,12 @@ public WorkspaceStorageConnection openConnection() throws RepositoryExc= eption { // TODO -// if (nodes =3D=3D null || properties =3D=3D null) -// { -// throw new RepositoryException("Container is not started"); -// } + // if (nodes =3D=3D null || properties =3D=3D null) + // { + // throw new RepositoryException("Container is not started"); + // } = - return new JBossCacheStorageConnection(cache, nodes, properties); + return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion); } = /** @@ -176,12 +179,12 @@ public WorkspaceStorageConnection openConnection(boolean readOnly) thro= ws RepositoryException { // TODO -// if (nodes =3D=3D null || properties =3D=3D null) -// { -// throw new RepositoryException("Container is not started"); -// } - = - return new JBossCacheStorageConnection(cache, nodes, properties); + // if (nodes =3D=3D null || properties =3D=3D null) + // { + // throw new RepositoryException("Container is not started"); + // } + + return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-10 13:32:20= UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-10 14:53:54= UTC (rev 548) @@ -95,10 +95,6 @@ } break; case REMOVE_DATA : - break; - case REMOVE_KEY_VALUE : - break; - case REMOVE_NODE : // perform lock or unlock operation if (lockChanges.size() =3D=3D 2) { @@ -132,6 +128,10 @@ lockChanges =3D new ArrayList(); sessionId =3D null; break; + case REMOVE_KEY_VALUE : + break; + case REMOVE_NODE : + break; case MOVE : break; default : @@ -187,37 +187,30 @@ { // this is a node and node is locked String nodeIdentifier =3D (String)m.getFqn().get(nodesPos += 1); - - switch (m.getType()) + if (lockManager.hasLockNode(nodeIdentifier)) { - case PUT_DATA_ERASE : - break; - case PUT_DATA : - if (lockManager.hasLockNode(nodeIdentifier)) - { + switch (m.getType()) + { + case PUT_DATA_ERASE : + break; + case PUT_DATA : removedLock.remove(nodeIdentifier); - } - break; - case PUT_KEY_VALUE : - break; - case REMOVE_DATA : - break; - case REMOVE_KEY_VALUE : - break; - case REMOVE_NODE : - if (lockManager.hasLockNode(nodeIdentifier)) - { + break; + case PUT_KEY_VALUE : + break; + case REMOVE_DATA : + break; + case REMOVE_KEY_VALUE : + break; + case REMOVE_NODE : removedLock.add(nodeIdentifier); - } - break; - case MOVE : - if (lockManager.hasLockNode(nodeIdentifier)) - { + break; + case MOVE : removedLock.remove(nodeIdentifier); - } - break; - default : - throw new CacheException("Unknown modification " + m.= getType()); + break; + default : + throw new CacheException("Unknown modification " += m.getType()); + } } } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-10 13:32:20= UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-10 14:53:54= UTC (rev 548) @@ -697,6 +697,20 @@ } } = + /** + * {@inheritDoc} + */ + public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + { + } + + /** + * {@inheritDoc} + */ + public void removeSessionInfo() throws RepositoryException + { + } + // ------------------ Private methods --------------- = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-10 13:32:20 UTC = (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-10 14:53:54 UTC = (rev 548) @@ -309,6 +309,28 @@ void close() throws IllegalStateException, RepositoryException; = /** + * Add session information to cache storage. = + * + * @param sessionId + * the session identifier to be added = + * = + * @param userId + * the user identifier to be added + * = + * @throws RepositoryException + * if some exception occured + */ + void addSessionInfo(String sessionId, String userId) throws RepositoryE= xception; + + /** + * Remove session information from cache storage. = + * + * @throws RepositoryException + * if some exception occured + */ + void removeSessionInfo() throws RepositoryException; + + /** * Returns true if connection can be used. * = * @return boolean, true if connection is open and ready, false - other= wise Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 13:32:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-10 = 14:53:54 UTC (rev 548) @@ -219,7 +219,7 @@ public List removeSession() { List list =3D new ArrayList(); - list.add(new Modification(ModificationType.REMOVE_NODE, Fqn.fromStri= ng("/" + JBossCacheStorage.SESSION))); + list.add(new Modification(ModificationType.REMOVE_DATA, Fqn.fromStri= ng("/" + JBossCacheStorage.SESSION))); return list; } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-10 13:32:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-10 14:53:54 UTC (rev 548) @@ -16,24 +16,6 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import junit.framework.TestCase; @@ -78,6 +60,8 @@ = protected Node props; = + protected Node session; + protected String jbcConfig; = /** @@ -103,16 +87,17 @@ // prepare cache structures nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); + session =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.SESS= ION)); = // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props); + conn =3D new JBossCacheStorageConnection(cache, nodes, props, sessio= n); } = protected void initJBCConfig() { jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; } - = + protected void initJBC() throws Exception { // empty here @@ -178,7 +163,7 @@ Object propValue) throws UnsupportedEncodingException, IllegalStateE= xception, IOException { String pid =3D (String)node.get(propName.getAsString()); - = + assertNotNull("Property ID should exists", pid); assertEquals("Property ID wrong", propId, pid); = @@ -282,7 +267,7 @@ = checkChildProp(rootNode, Constants.JCR_PRIMARYTYPE, propId1, propPat= h1, propValue1); checkChildProp(rootNode, Constants.JCR_MIXINTYPES, propId2, propPath= 2, propValue2); - = + // TODO check order int index =3D 0; for (Serializable key : rootNode.getKeys()) @@ -505,11 +490,11 @@ = // check = treePrint(props); - = + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); = assertEquals("Attributes ammount wrong", 2, rootNode.getKeys().size(= )); - = + checkChildProp(rootNode, Constants.JCR_PRIMARYTYPE, propId1, propPat= h1, propValueU); } = @@ -560,7 +545,7 @@ = // check = treePrint(props); - = + // check = ItemData propItem =3D conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 13:3= 2:20 UTC (rev 547) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-10 14:5= 3:54 UTC (rev 548) @@ -17,16 +17,13 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.NodeImpl; import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.util.IdGenerator; + import org.jboss.cache.Modification; = import java.util.ArrayList; --===============4237992329164512318==-- From do-not-reply at jboss.org Tue Nov 10 10:25:11 2009 Content-Type: multipart/mixed; boundary="===============0239620429137872112==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r549 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration. Date: Tue, 10 Nov 2009 10:25:11 -0500 Message-ID: <200911101525.nAAFPBfK031667@svn01.web.mwc.hst.phx2.redhat.com> --===============0239620429137872112== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-10 10:25:10 -0500 (Tue, 10 Nov 2009) New Revision: 549 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProvi= der.java Log: EXOJCR-232 : fix is multiple flag Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/nodetype/registration/AbstractItemDefinitionAcce= ssProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProv= ider.java 2009-11-10 14:53:54 UTC (rev 548) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProv= ider.java 2009-11-10 15:25:10 UTC (rev 549) @@ -361,7 +361,7 @@ InternalQName[] value) { TransientPropertyData propertyData =3D - TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.NAME, false); + TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.NAME, true); = List parents =3D new ArrayList(); for (InternalQName nt : value) @@ -383,7 +383,7 @@ String[] value) { TransientPropertyData propertyData =3D - TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.STRING, false); + TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.STRING, true); List valueDatas =3D new ArrayList(); for (String vc : value) { --===============0239620429137872112==-- From do-not-reply at jboss.org Tue Nov 10 10:42:05 2009 Content-Type: multipart/mixed; boundary="===============3171684002874371659==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r550 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 10:42:05 -0500 Message-ID: <200911101542.nAAFg59L001970@svn01.web.mwc.hst.phx2.redhat.com> --===============3171684002874371659== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-10 10:42:05 -0500 (Tue, 10 Nov 2009) New Revision: 550 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ModificationEx.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The class ModificationEx was added. The JDBCCacheLoader was ch= anged. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-10 15:25:10= UTC (rev 549) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-10 15:42:05= UTC (rev 550) @@ -16,24 +16,6 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; @@ -43,12 +25,14 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.storage.jbosscache.ModificationEx= .JCROperaionType; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.jboss.cache.CacheException; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; +import org.jboss.cache.Modification.ModificationType; import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; import org.jboss.cache.factories.annotations.Inject; import org.jboss.cache.factories.annotations.NonVolatile; @@ -72,6 +56,8 @@ */ public class JDBCCacheLoader extends AbstractCacheLoader { + private IndividualCacheLoaderConfig config; + = private WorkspaceDataContainer dataContainer; = public JDBCCacheLoader() { @@ -100,12 +86,17 @@ { System.out.println(modifications); = + // Prepare modifications list. + // Will be changed Modification to ModificationEx and set operation t= ype (ADD or UPDATE). = + prepareModifications(modifications); + = JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection)dataC= ontainer.openConnection(); = try { - for (Modification m : modifications) + for (int i=3D0; i modifications) thr= ows RepositoryException + { = - if (itemData =3D=3D null) + JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection) dat= aContainer.openConnection(); + + for (int i =3D 0; i < modifications.size(); i++) + { + if (modifications.get(i).getType() =3D=3D ModificationType.PUT_KE= Y_VALUE + && + modifications.get(i).getValue() instanceof ItemData) { - //add - jdbcConnection.add(propertyData); + ItemData itemData =3D null; + + //Check add or update node data + if (modifications.get(i).getValue() instanceof NodeData) + { + NodeData nodeData =3D (NodeData) modifications.get(i).getVa= lue(); + itemData =3D jdbcConnection.getItemData(nodeData.getIdentif= ier()); + } + else if (modifications.get(i).getValue() instanceof PropertyDa= ta) + { + PropertyData propertyData =3D (PropertyData) modifications.= get(i).getValue(); + itemData =3D jdbcConnection.getItemData(propertyData.getIde= ntifier()); + } else + + // Set ModificationEx to list with type UPDATE or ADD. + if (itemData =3D=3D null) + modifications.set(i, new ModificationEx(modifications.get(i= ), JCROperaionType.ADD)); + else + modifications.set(i, new ModificationEx(modifications.get(i= ), JCROperaionType.UPDATE)); } else { - //update - jdbcConnection.update(propertyData); + modifications.set(i, new ModificationEx(modifications.get(i))); } } } @@ -407,8 +453,7 @@ */ public IndividualCacheLoaderConfig getConfig() { - // TODO Auto-generated method stub - return null; + return config; } = /** @@ -461,7 +506,7 @@ */ public void setConfig(IndividualCacheLoaderConfig config) { - // TODO Auto-generated method stub + this.config =3D config; = } = Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/ModificationEx.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ModificationEx.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ModificationEx.java 2009-11-10 15:42:05 = UTC (rev 550) @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + +import org.jboss.cache.Modification; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Alex Re= shetnyak = + * @version $Id$ + */ +public class ModificationEx + extends Modification implements Externalizable +{ + + private static final long serialVersionUID =3D 4362354437203996117L; + + public static enum JCROperaionType + { + ADD, + UPDATE, + UNKNOWN + } + = + /** + * The type of JCR operation (update or add). = + */ + private JCROperaionType operaionType =3D JCROperaionType.UNKNOWN; + = + /** + * Empty constructor to serialization. + */ + public ModificationEx() + { + } + = + /** + * The constructor with JCROperaionType. + * = + * @param modification + * the original of modification. + * @param operaionType + * the JCR operation type. + */ + public ModificationEx(Modification modification, JCROperaionType operai= onType) { + this.setType(modification.getType()); + this.setFqn(modification.getFqn()); + this.setFqn2(modification.getFqn2()); + this.setValue(modification.getValue()); + this.setOldValue(modification.getOldValue()); + this.setKey(modification.getKey()); + this.setData(modification.getData()); + = + this.operaionType =3D operaionType; + } + = + /** + * The constructor without JCROperaionType. + * = + * @param modification + * the original of modification. + */ + public ModificationEx(Modification modification) { + this.setType(modification.getType()); + this.setFqn(modification.getFqn()); + this.setFqn2(modification.getFqn2()); + this.setValue(modification.getValue()); + this.setOldValue(modification.getOldValue()); + this.setKey(modification.getKey()); + this.setData(modification.getData()); + = + this.operaionType =3D JCROperaionType.UNKNOWN; + } + = + /** + * Getter to property operaionType. + * = + * @return JCROperaionType + * the operation type + */ + public JCROperaionType getOperaionType() { + return operaionType; + } + = + /** + * {@inheritDoc} + */ + public void writeExternal(ObjectOutput out) throws IOException + { + super.writeExternal(out); + = + out.writeObject(operaionType); + } + + /** + * {@inheritDoc} + */ + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + super.readExternal(in); + + operaionType =3D (JCROperaionType) in.readObject(); + } + = + = + /** + * {@inheritDoc} + */ + public String toString() + { + return super.toString() + " : " + operaionType.toString(); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/ModificationEx.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============3171684002874371659==-- From do-not-reply at jboss.org Tue Nov 10 11:49:51 2009 Content-Type: multipart/mixed; boundary="===============0667384728700618445==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r551 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/registration. Date: Tue, 10 Nov 2009 11:49:51 -0500 Message-ID: <200911101649.nAAGnpDt017523@svn01.web.mwc.hst.phx2.redhat.com> --===============0667384728700618445== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-10 11:49:51 -0500 (Tue, 10 Nov 2009) New Revision: 551 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProvider.ja= va Log: EXOJCR-232 : fix is multiple flag Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProv= ider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProvider.j= ava 2009-11-10 15:42:05 UTC (rev 550) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/registration/AbstractItemDefinitionAccessProvider.j= ava 2009-11-10 16:49:51 UTC (rev 551) @@ -47,7 +47,7 @@ * Created by The eXo Platform SAS. * = * @author Sergey Kabashn= yuk - * @version $Id: $ + * @version $Id: AbstractItemDefinitionAccessProvider.java 549 2009-11-10 = 15:25:10Z skabashnyuk $ */ public abstract class AbstractItemDefinitionAccessProvider { @@ -361,7 +361,7 @@ InternalQName[] value) { TransientPropertyData propertyData =3D - TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.NAME, false); + TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.NAME, true); = List parents =3D new ArrayList(); for (InternalQName nt : value) @@ -383,7 +383,7 @@ String[] value) { TransientPropertyData propertyData =3D - TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.STRING, false); + TransientPropertyData.createPropertyData(parentNode, propertyName= , PropertyType.STRING, true); List valueDatas =3D new ArrayList(); for (String vc : value) { --===============0667384728700618445==-- From do-not-reply at jboss.org Tue Nov 10 12:04:00 2009 Content-Type: multipart/mixed; boundary="===============0924333947369182657==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r552 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 10 Nov 2009 12:03:59 -0500 Message-ID: <200911101703.nAAH3xiv020735@svn01.web.mwc.hst.phx2.redhat.com> --===============0924333947369182657== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-10 12:03:59 -0500 (Tue, 10 Nov 2009) New Revision: 552 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-10 16:49:51= UTC (rev 551) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-10 17:03:59= UTC (rev 552) @@ -29,6 +29,8 @@ import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; import org.jboss.cache.CacheException; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; @@ -56,6 +58,8 @@ */ public class JDBCCacheLoader extends AbstractCacheLoader { + protected static final Log LOG =3D ExoLogger.getLogger("jcr.JDBCCacheLo= ader"); + = private IndividualCacheLoaderConfig config; = private WorkspaceDataContainer dataContainer; @@ -132,8 +136,15 @@ } } = - if (jdbcConnection !=3D null) + if (jdbcConnection !=3D null) { jdbcConnection.commit(); + jdbcConnection =3D null; + } + } = + catch (Exception e) + { + LOG.error("Can not put data to DB", e); + throw e; } finally { @@ -246,9 +257,7 @@ = for (int i =3D 0; i < modifications.size(); i++) { - if (modifications.get(i).getType() =3D=3D ModificationType.PUT_KE= Y_VALUE - && - modifications.get(i).getValue() instanceof ItemData) + if (modifications.get(i).getType() =3D=3D ModificationType.PUT_KE= Y_VALUE) { ItemData itemData =3D null; = @@ -262,7 +271,10 @@ { PropertyData propertyData =3D (PropertyData) modifications.= get(i).getValue(); itemData =3D jdbcConnection.getItemData(propertyData.getIde= ntifier()); - } else + } else { + modifications.set(i, new ModificationEx(modifications.get(i= ))); + continue; + } = // Set ModificationEx to list with type UPDATE or ADD. if (itemData =3D=3D null) --===============0924333947369182657==-- From do-not-reply at jboss.org Wed Nov 11 03:05:59 2009 Content-Type: multipart/mixed; boundary="===============4606549973830248981==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r553 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 11 Nov 2009 03:05:59 -0500 Message-ID: <200911110805.nAB85xxv007332@svn01.web.mwc.hst.phx2.redhat.com> --===============4606549973830248981== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-11 03:05:59 -0500 (Wed, 11 Nov 2009) New Revision: 553 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java Log: EXOJCR-201: sessionId support Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-10 17:03:59 UTC (rev 552) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 08:05:59 UTC (rev 553) @@ -164,45 +164,61 @@ WorkspaceStorageConnection conn =3D null; if (isSystemDescendant(data.getQPath())) { - conn =3D systemConnection =3D=3D null - // we need system connection but it's not exist - ? systemConnection =3D (systemDataContainer !=3D data= Container - // if it's different container instances - ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null - // but container confugrations are same and non-sy= stem connnection open - // reuse this connection as system - ? systemDataContainer.reuseConnection(thisConne= ction) - // or open one new system - : systemDataContainer.openConnection() - // else if it's same container instances (system a= nd this) - : thisConnection =3D=3D null - // and non-system connection doens't exist - open = it - ? thisConnection =3D dataContainer.openConnecti= on() - // if already open - use it - : thisConnection) + if (systemConnection =3D=3D null) + { + conn =3D + // we need system connection but it's not exist + systemConnection =3D (systemDataContainer !=3D dat= aContainer + // if it's different container instances + ? systemDataContainer.equals(dataContainer) && = thisConnection !=3D null + // but container confugrations are same and non= -system connnection open + // reuse this connection as system + ? systemDataContainer.reuseConnection(thisCo= nnection) + // or open one new system + : systemDataContainer.openConnection() + // else if it's same container instances (syste= m and this) + : thisConnection =3D=3D null + // and non-system connection doens't exist - op= en it + ? thisConnection =3D dataContainer.openConne= ction() + // if already open - use it + : thisConnection); + if (!systemConnection.equals(thisConnection)) + systemConnection.addSessionInfo(currChangesLog.get= SessionId(), "userId"); + } + else + { // system connection opened - use it - : systemConnection; + conn =3D systemConnection; + } } else { - conn =3D thisConnection =3D=3D null - // we need this conatiner conection - ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer - // if it's different container instances - ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null - // but container confugrations are same and system= connnection open - // reuse system connection as this - ? dataContainer.reuseConnection(systemConnectio= n) - // or open one new - : dataContainer.openConnection() - // else if it's same container instances (system a= nd this) - : systemConnection =3D=3D null - // and system connection doens't exist - open it - ? systemConnection =3D dataContainer.openConnec= tion() - // if already open - use it - : systemConnection) + if (thisConnection =3D=3D null) + { + conn =3D + // we need this conatiner conection + thisConnection =3D (systemDataContainer !=3D dataC= ontainer + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && = systemConnection !=3D null + // but container confugrations are same and sys= tem connnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnec= tion) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (syste= m and this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openCon= nection() + // if already open - use it + : systemConnection); + if (!thisConnection.equals(systemConnection)) + thisConnection.addSessionInfo(currChangesLog.getSe= ssionId(), "userId"); + } + else + { // this connection opened - use it - : thisConnection; + conn =3D thisConnection; + } } = data.increasePersistedVersion(); @@ -228,7 +244,10 @@ LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) + "ms, " + data.getQPath().getAsString()); } - // conn.removeSessionInfo(); + if (thisConnection !=3D null) + thisConnection.removeSessionInfo(); + if (systemConnection !=3D null && !systemConnection.equals(thi= sConnection)) + systemConnection.removeSessionInfo(); } if (thisConnection !=3D null) thisConnection.commit(); --===============4606549973830248981==-- From do-not-reply at jboss.org Wed Nov 11 03:20:33 2009 Content-Type: multipart/mixed; boundary="===============0298933973205630434==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r554 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 11 Nov 2009 03:20:33 -0500 Message-ID: <200911110820.nAB8KXc3010105@svn01.web.mwc.hst.phx2.redhat.com> --===============0298933973205630434== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-11 03:20:33 -0500 (Wed, 11 Nov 2009) New Revision: 554 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java Log: EXOJCR-201: refactoring sessionId support Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 08:05:59 UTC (rev 553) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 08:20:33 UTC (rev 554) @@ -166,9 +166,9 @@ { if (systemConnection =3D=3D null) { - conn =3D + conn =3D systemConnection =3D=3D null // we need system connection but it's not exist - systemConnection =3D (systemDataContainer !=3D dat= aContainer + ? systemConnection =3D (systemDataContainer !=3D d= ataContainer // if it's different container instances ? systemDataContainer.equals(dataContainer) && = thisConnection !=3D null // but container confugrations are same and non= -system connnection open @@ -181,9 +181,9 @@ // and non-system connection doens't exist - op= en it ? thisConnection =3D dataContainer.openConne= ction() // if already open - use it - : thisConnection); - if (!systemConnection.equals(thisConnection)) - systemConnection.addSessionInfo(currChangesLog.get= SessionId(), "userId"); + : thisConnection) + // system connection opened - use it + : systemConnection; } else { @@ -193,32 +193,24 @@ } else { - if (thisConnection =3D=3D null) - { - conn =3D - // we need this conatiner conection - thisConnection =3D (systemDataContainer !=3D dataC= ontainer - // if it's different container instances - ? dataContainer.equals(systemDataContainer) && = systemConnection !=3D null - // but container confugrations are same and sys= tem connnection open - // reuse system connection as this - ? dataContainer.reuseConnection(systemConnec= tion) - // or open one new - : dataContainer.openConnection() - // else if it's same container instances (syste= m and this) - : systemConnection =3D=3D null - // and system connection doens't exist - open it - ? systemConnection =3D dataContainer.openCon= nection() - // if already open - use it - : systemConnection); - if (!thisConnection.equals(systemConnection)) - thisConnection.addSessionInfo(currChangesLog.getSe= ssionId(), "userId"); - } - else - { + conn =3D thisConnection =3D=3D null + // we need this conatiner conection + ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null + // but container confugrations are same and system= connnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnectio= n) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openConnec= tion() + // if already open - use it + : systemConnection) // this connection opened - use it - conn =3D thisConnection; - } + : thisConnection; } = data.increasePersistedVersion(); @@ -244,10 +236,10 @@ LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) + "ms, " + data.getQPath().getAsString()); } - if (thisConnection !=3D null) - thisConnection.removeSessionInfo(); - if (systemConnection !=3D null && !systemConnection.equals(thi= sConnection)) - systemConnection.removeSessionInfo(); + // if (thisConnection !=3D null) + // thisConnection.removeSessionInfo(); + // if (systemConnection !=3D null && !systemConnect= ion.equals(thisConnection)) + // systemConnection.removeSessionInfo(); } if (thisConnection !=3D null) thisConnection.commit(); --===============0298933973205630434==-- From do-not-reply at jboss.org Wed Nov 11 03:22:24 2009 Content-Type: multipart/mixed; boundary="===============4599595464213204148==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r555 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 11 Nov 2009 03:22:24 -0500 Message-ID: <200911110822.nAB8MOf9010271@svn01.web.mwc.hst.phx2.redhat.com> --===============4599595464213204148== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-11 03:22:24 -0500 (Wed, 11 Nov 2009) New Revision: 555 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java Log: EXOJCR-201: bug fix Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 08:20:33 UTC (rev 554) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 08:22:24 UTC (rev 555) @@ -164,32 +164,24 @@ WorkspaceStorageConnection conn =3D null; if (isSystemDescendant(data.getQPath())) { - if (systemConnection =3D=3D null) - { - conn =3D systemConnection =3D=3D null - // we need system connection but it's not exist - ? systemConnection =3D (systemDataContainer !=3D d= ataContainer - // if it's different container instances - ? systemDataContainer.equals(dataContainer) && = thisConnection !=3D null - // but container confugrations are same and non= -system connnection open - // reuse this connection as system - ? systemDataContainer.reuseConnection(thisCo= nnection) - // or open one new system - : systemDataContainer.openConnection() - // else if it's same container instances (syste= m and this) - : thisConnection =3D=3D null - // and non-system connection doens't exist - op= en it - ? thisConnection =3D dataContainer.openConne= ction() - // if already open - use it - : thisConnection) - // system connection opened - use it - : systemConnection; - } - else - { + conn =3D systemConnection =3D=3D null + // we need system connection but it's not exist + ? systemConnection =3D (systemDataContainer !=3D data= Container + // if it's different container instances + ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null + // but container confugrations are same and non-sy= stem connnection open + // reuse this connection as system + ? systemDataContainer.reuseConnection(thisConne= ction) + // or open one new system + : systemDataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : thisConnection =3D=3D null + // and non-system connection doens't exist - open = it + ? thisConnection =3D dataContainer.openConnecti= on() + // if already open - use it + : thisConnection) // system connection opened - use it - conn =3D systemConnection; - } + : systemConnection; } else { --===============4599595464213204148==-- From do-not-reply at jboss.org Wed Nov 11 04:12:32 2009 Content-Type: multipart/mixed; boundary="===============3508245771251086574==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r556 - jcr/trunk. Date: Wed, 11 Nov 2009 04:12:32 -0500 Message-ID: <200911110912.nAB9CWRA017855@svn01.web.mwc.hst.phx2.redhat.com> --===============3508245771251086574== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-11 04:12:32 -0500 (Wed, 11 Nov 2009) New Revision: 556 Modified: jcr/trunk/pom.xml Log: EXOJCR-208 Duplicated (ws-commons-util) entry in dependencyMangement removed Modified: jcr/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/pom.xml 2009-11-11 08:22:24 UTC (rev 555) +++ jcr/trunk/pom.xml 2009-11-11 09:12:32 UTC (rev 556) @@ -218,12 +218,6 @@ = - org.apache.ws.commons - ws-commons-util - 1.0.1 - - - javax.jcr jcr 1.0 --===============3508245771251086574==-- From do-not-reply at jboss.org Wed Nov 11 04:34:48 2009 Content-Type: multipart/mixed; boundary="===============3091041992296526845==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r557 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 11 Nov 2009 04:34:48 -0500 Message-ID: <200911110934.nAB9Ym3n022174@svn01.web.mwc.hst.phx2.redhat.com> --===============3091041992296526845== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-11 04:34:47 -0500 (Wed, 11 Nov 2009) New Revision: 557 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java Log: EXOJCR-201: refactoring Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 09:12:32 UTC (rev 556) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 09:34:47 UTC (rev 557) @@ -25,7 +25,6 @@ import org.exoplatform.services.jcr.dataflow.PersistentDataManager; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; -import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stenerFilter; import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPers= istenceListener; @@ -150,6 +149,9 @@ { for (PlainChangesLog currChangesLog : chengesLogList) { + boolean systemConnSessionInfoAdded =3D false; + boolean thisConnSessionInfoAdded =3D false; + for (Iterator iter =3D currChangesLog.getAllStates(= ).iterator(); iter.hasNext();) { ItemState itemState =3D iter.next(); @@ -169,7 +171,7 @@ ? systemConnection =3D (systemDataContainer !=3D data= Container // if it's different container instances ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null - // but container confugrations are same and non-sy= stem connnection open + // but container configurations are same and non-s= ystem connection open // reuse this connection as system ? systemDataContainer.reuseConnection(thisConne= ction) // or open one new system @@ -182,15 +184,22 @@ : thisConnection) // system connection opened - use it : systemConnection; + + if (!systemConnSessionInfoAdded) + { + if (!systemConnection.equals(thisConnection)) + systemConnection.addSessionInfo(currChangesLog.get= SessionId(), ""); + systemConnSessionInfoAdded =3D true; + } } else { conn =3D thisConnection =3D=3D null - // we need this conatiner conection + // we need this container connection ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer // if it's different container instances ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null - // but container confugrations are same and system= connnection open + // but container configurations are same and syste= m connection open // reuse system connection as this ? dataContainer.reuseConnection(systemConnectio= n) // or open one new @@ -203,6 +212,13 @@ : systemConnection) // this connection opened - use it : thisConnection; + + if (!thisConnSessionInfoAdded) + { + if (!thisConnection.equals(systemConnection)) + thisConnection.addSessionInfo(currChangesLog.getSe= ssionId(), ""); + thisConnSessionInfoAdded =3D true; + } } = data.increasePersistedVersion(); @@ -228,10 +244,10 @@ LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) + "ms, " + data.getQPath().getAsString()); } - // if (thisConnection !=3D null) - // thisConnection.removeSessionInfo(); - // if (systemConnection !=3D null && !systemConnect= ion.equals(thisConnection)) - // systemConnection.removeSessionInfo(); + if (thisConnection !=3D null) + thisConnection.removeSessionInfo(); + if (systemConnection !=3D null && !systemConnection.equals(thi= sConnection)) + systemConnection.removeSessionInfo(); } if (thisConnection !=3D null) thisConnection.commit(); --===============3091041992296526845==-- From do-not-reply at jboss.org Wed Nov 11 06:30:51 2009 Content-Type: multipart/mixed; boundary="===============4899754070242452059==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r558 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 11 Nov 2009 06:30:51 -0500 Message-ID: <200911111130.nABBUpm5018017@svn01.web.mwc.hst.phx2.redhat.com> --===============4899754070242452059== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-11 06:30:51 -0500 (Wed, 11 Nov 2009) New Revision: 558 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderException.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderException.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderException.java 2009-11-= 11 09:34:47 UTC (rev 557) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRCacheLoaderException.java 2009-11-= 11 11:30:51 UTC (rev 558) @@ -61,7 +61,7 @@ } = /** - * RepositoryConfigurationException constructor. + * ExoJCRCacheLoaderException constructor. * * @param cause * Throwable, the base exception. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 09:34:47= UTC (rev 557) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 11:30:51= UTC (rev 558) @@ -309,8 +309,88 @@ { = Map attrs =3D new LinkedHashMap(); + = if (name.size() > 1) { + if (name.get(0).equals(JBossCacheStorage.NODES)) + { + // /$NODES/ + if (name.size() =3D=3D 2) + { + // return NodeData [ITEM_DATA : NodeData] + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + + try + { + NodeData nodeData =3D (NodeData) conn.getItemData(name.g= etLastElementAsString()); + = + if (nodeData !=3D null) + { + attrs.put(JBossCacheStorage.ITEM_DATA, nodeData); + + // put [PROPERTY_NAME : propertyData_ID] + for (PropertyData prop : conn.getChildPropertiesData(= nodeData)) + { + attrs.put(prop.getQPath().getName().getAsString(),= prop.getIdentifier()); + } + } + } + finally + { + conn.close(); + } + } + // /$NODES// + else if (name.size() =3D=3D 3) + { + QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); + = + // return [ITEM_Id : nodeData_ID] + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + + try + { + NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(2)); + = + if (parentNodeData =3D=3D null) + throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(2) + " not exis, FQN =3D '" + name + "'."); + = + NodeData nodeData =3D (NodeData) conn.getItemData(parent= NodeData, nodeName); + if (nodeData !=3D null) + attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getIdent= ifier()); + } + finally + { + conn.close(); + } + } + } + // /$PROPS/ + else if (name.get(0).equals(JBossCacheStorage.PROPS)) + { + if (name.size() =3D=3D 2) + { + // return PropertyData [ITEM_DATA : PropertyData] + WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + + try + { + PropertyData propertyData =3D (PropertyData) conn.getIte= mData(name.getLastElementAsString()); + = + if (propertyData !=3D null) + attrs.put(JBossCacheStorage.ITEM_DATA, propertyData); + } + finally + { + conn.close(); + } + } = + } + } + = + return attrs; + /*if (name.size() > 1) + { if (name.get(1).equals(JBossCacheStorage.NODES)) { // return Node @@ -369,8 +449,7 @@ } } } - } - return attrs; + }*/ } = /** Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JDBCCacheLoaderException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderException.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderException.java 2009-11-11= 11:30:51 UTC (rev 558) @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Alex Re= shetnyak = + * @version $Id$ + */ +public class JDBCCacheLoaderException + extends Exception +{ + /** + * Constructs an Exception without a message. + */ + public JDBCCacheLoaderException() + { + super(); + } + + /** + * Constructs an Exception with a detailed message. + * = + * @param Message + * The message associated with the exception. + */ + public JDBCCacheLoaderException(String message) + { + super(message); + } + + /** + * Constructs an Exception with a detailed message and base exception. + * = + * @param Message + * The message associated with the exception. + * @param cause + * Throwable, the base exception. + */ + public JDBCCacheLoaderException(String message, Throwable cause) + { + super(message, cause); + } + + /** + * JDBCCacheLoaderException constructor. + * + * @param cause + * Throwable, the base exception. + */ + public JDBCCacheLoaderException(Throwable cause) + { + super(cause); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderExceptio= n.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============4899754070242452059==-- From do-not-reply at jboss.org Wed Nov 11 07:53:07 2009 Content-Type: multipart/mixed; boundary="===============4419736920176055116==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r559 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 5 other directories. Date: Wed, 11 Nov 2009 07:53:07 -0500 Message-ID: <200911111253.nABCr73g001150@svn01.web.mwc.hst.phx2.redhat.com> --===============4419736920176055116== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-11 07:53:06 -0500 (Wed, 11 Nov 2009) New Revision: 559 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/storage/WorkspaceStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java Log: EXOJCR-205: small fix Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-11 11:30:51 UTC (rev= 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-11 12:53:06 UTC (rev= 559) @@ -52,6 +52,7 @@ import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; +import org.jboss.cache.factories.annotations.NonVolatile; import org.picocontainer.Startable; = import java.io.IOException; @@ -77,6 +78,7 @@ */ @Managed @NameTemplate(@Property(key =3D "service", value =3D "lockmanager")) +(a)NonVolatile public class LockManagerImpl implements ItemsPersistenceListener, SessionL= ifecycleListener, LockManager, Startable { /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 11:30:51 UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 12:53:06 UTC (rev 559) @@ -187,8 +187,9 @@ = if (!systemConnSessionInfoAdded) { + // TODO userId if (!systemConnection.equals(thisConnection)) - systemConnection.addSessionInfo(currChangesLog.get= SessionId(), ""); + systemConnection.addSessionInfo(currChangesLog.get= SessionId()); systemConnSessionInfoAdded =3D true; } } @@ -215,8 +216,9 @@ = if (!thisConnSessionInfoAdded) { + // TODO userId if (!thisConnection.equals(systemConnection)) - thisConnection.addSessionInfo(currChangesLog.getSe= ssionId(), ""); + thisConnection.addSessionInfo(currChangesLog.getSe= ssionId()); thisConnSessionInfoAdded =3D true; } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-11 = 11:30:51 UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-11 = 12:53:06 UTC (rev 559) @@ -214,7 +214,7 @@ /** * {@inheritDoc} */ - public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + public void addSessionInfo(String sessionId) throws RepositoryException { } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -11 11:30:51 UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -11 12:53:06 UTC (rev 559) @@ -556,7 +556,7 @@ /** * {@inheritDoc} */ - public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + public void addSessionInfo(String sessionId) throws RepositoryException { startBatch(); = @@ -567,7 +567,6 @@ = // add attributes sessionRoot.put(JBossCacheStorage.SESSION_ID, sessionId); - sessionRoot.put(JBossCacheStorage.USER_ID, userId); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-11 11:30:51 UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-11 12:53:06 UTC (rev 559) @@ -396,7 +396,7 @@ /** * {@inheritDoc} */ - public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + public void addSessionInfo(String sessionId) throws RepositoryException { } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-11 11:30:51= UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-11 12:53:06= UTC (rev 559) @@ -16,11 +16,13 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -28,6 +30,7 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Modification; import org.jboss.cache.Modification.ModificationType; +import org.jboss.cache.factories.annotations.Inject; = import java.io.IOException; import java.io.UnsupportedEncodingException; @@ -51,7 +54,7 @@ /** * Lock manager. */ - private final LockManagerImpl lockManager; + private LockManagerImpl lockManager; = /** * Logger. @@ -59,12 +62,18 @@ private final Log log =3D ExoLogger.getLogger("jcr.LockCacheLoader"); = /** - * LockCacheLoader constructor. + * Injection dependencies. * - * @param lockManager + * @param lockManager LockManagerImpl */ - public LockCacheLoader(LockManagerImpl lockManager) + @Inject + public void injectDependencies(LockManagerImpl lockManager) throws Repo= sitoryConfigurationException { + if (this.lockManager !=3D null) + { + throw new RepositoryConfigurationException("Cannot set LockManage= rImpl twice"); + } + this.lockManager =3D lockManager; } = @@ -106,7 +115,7 @@ else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_NODE && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_NODE) { - PropertyData propertyData =3D (PropertyData)lockCh= anges.get(0).getOldValue(); + PropertyData propertyData =3D (PropertyData)lockCh= anges.get(0).getValue(); performUnLock(lockChanges, propertyData.getParentI= dentifier(), sessionId); } else Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-11 11:30:51= UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-11 12:53:06= UTC (rev 559) @@ -700,7 +700,7 @@ /** * {@inheritDoc} */ - public void addSessionInfo(String sessionId, String userId) throws Repo= sitoryException + public void addSessionInfo(String sessionId) throws RepositoryException { } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-11 11:30:51 UTC = (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-11 12:53:06 UTC = (rev 559) @@ -314,13 +314,10 @@ * @param sessionId * the session identifier to be added = * = - * @param userId - * the user identifier to be added - * = * @throws RepositoryException * if some exception occured */ - void addSessionInfo(String sessionId, String userId) throws RepositoryE= xception; + void addSessionInfo(String sessionId) throws RepositoryException; = /** * Remove session information from cache storage. = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-11 = 11:30:51 UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-11 = 12:53:06 UTC (rev 559) @@ -41,6 +41,11 @@ = protected static boolean addPUTDATA =3D true; = + public void setUp() throws Exception + { + super.setUp(); + } + /** * Returns {@link Modification} like as node added. NodeData is written= to /$NODE/IDxxxx as an attribute by key ITEM_DATA. * = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-11 11:3= 0:51 UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-11 12:5= 3:06 UTC (rev 559) @@ -16,20 +16,38 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; +import org.exoplatform.services.jcr.config.ContainerEntry; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.SimpleParameterEntry; +import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockData; +import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; +import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; +import org.exoplatform.services.jcr.util.IdGenerator; = +import org.jboss.cache.Cache; +import org.jboss.cache.CacheSPI; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; import org.jboss.cache.Modification; +import org.jboss.cache.Node; = +import java.io.Serializable; import java.util.ArrayList; import java.util.List; = import javax.jcr.PropertyType; +import javax.naming.Context; = /** * Created by The eXo Platform SAS. @@ -46,16 +64,26 @@ = private LockCacheLoader lockCacheLoader; = - private ValueFactoryImpl valueFactory; - private final QPath testRoot =3D QPath.makeChildPath(Constants.ROOT_PAT= H, new InternalQName("", "testRoot")); = public void setUp() throws Exception { - this.lockManager =3D new TesterLockManagerImpl(); - this.lockCacheLoader =3D new LockCacheLoader(lockManager); + super.setUp(); + + lockManager =3D new TesterLockManagerImpl(); + lockCacheLoader =3D new LockCacheLoader(); + lockCacheLoader.injectDependencies(lockManager); } = + /** + * {@inheritDoc} + */ + protected void tearDown() throws Exception + { + + super.tearDown(); + } + public void testLock() throws Exception { List modifications =3D new ArrayList(); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-11 11= :30:51 UTC (rev 558) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-11 12= :53:06 UTC (rev 559) @@ -22,6 +22,7 @@ import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.jboss.cache.factories.annotations.NonVolatile; = import java.util.Map; = @@ -35,6 +36,7 @@ * @author Anatoliy= Bazko = * @version $Id$ */ +(a)NonVolatile public class TesterLockManagerImpl extends LockManagerImpl { = --===============4419736920176055116==-- From do-not-reply at jboss.org Wed Nov 11 08:02:32 2009 Content-Type: multipart/mixed; boundary="===============4052418624080238412==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r560 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Wed, 11 Nov 2009 08:02:32 -0500 Message-ID: <200911111302.nABD2WjQ003626@svn01.web.mwc.hst.phx2.redhat.com> --===============4052418624080238412== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-11 08:02:31 -0500 (Wed, 11 Nov 2009) New Revision: 560 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ObservationManagerRegistry.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-204: Updated functionality for node-type filtering Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ObservationManagerRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-11= 12:53:06 UTC (rev 559) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-11= 13:02:31 UTC (rev 560) @@ -61,7 +61,7 @@ protected WorkspacePersistentDataManager workspaceDataManager; = public ObservationManagerRegistry(WorkspacePersistentDataManager worksp= aceDataManager, - SessionRegistry sessionRegistry, NamespaceAccessor namespaceAccessor) + SessionRegistry sessionRegistry, NamespaceAccessor namespaceAccessor= , NodeTypeDataManager nodeTypeDataManager) { this.sessionRegistry =3D sessionRegistry; this.listenersMap =3D new HashMap(); @@ -119,17 +119,5 @@ { return nodeTypeDataManager; } - - // TODO: remove hardcode - public WorkspacePersistentDataManager getWorkspaceDataManager() - { - return workspaceDataManager; - } - - // TODO: remove hardcode - public LocationFactory getLocationFactory() - { - return new LocationFactory(namespaceAccessor); - } = } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-11 1= 2:53:06 UTC (rev 559) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-11 1= 3:02:31 UTC (rev 560) @@ -18,15 +18,20 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.core.NamespaceAccessor; import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.observation.EventImpl; import org.exoplatform.services.jcr.impl.core.observation.ListenerCriteria; import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; import org.exoplatform.services.jcr.impl.util.EntityCollection; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Fqn; @@ -60,17 +65,23 @@ = private ObservationManagerRegistry observationManagerRegistry =3D null; = + private WorkspaceDataContainer dataContainer =3D null; + + private LocationFactory locationFactory =3D null; + /** - * = + * Init the loader DataContainer with given WorkspaceDataContainer inst= ance. + * + * @param dataContainer WorkspaceDataContainer */ - public ObservationCacheLoader() - { - } - @Inject - public void insertObservationRegistry(ObservationManagerRegistry observ= ationManagerRegistry) + public void injectDependencies(ObservationManagerRegistry observationMa= nagerRegistry, + WorkspaceDataContainer dataContainer, NamespaceAccessor namespaceAcc= essor) + throws RepositoryConfigurationException { + this.dataContainer =3D dataContainer; this.observationManagerRegistry =3D observationManagerRegistry; + this.locationFactory =3D new LocationFactory(namespaceAccessor); } = /** @@ -85,15 +96,12 @@ // get UserID from list String sessionId =3D ""; = - // extract real list from list of modification - // real - means list with out fake modifications containing UserID &= etc - // for each listener // for each element from real list post and event, if filtering ok = = if (observationManagerRegistry !=3D null) { - + WorkspaceStorageConnection storageConnection =3D dataContainer.op= enConnection(); EventListenerIterator eventListeners =3D observationManagerRegist= ry.getEventListeners(); while (eventListeners.hasNext()) { @@ -120,15 +128,12 @@ // check UUID result &=3D isIdentifierMatch(criteria, item); // check NodeType - // TODO: FIX nodetype checks - //result &=3D isNodeTypeMatch(criteria, item, changes= Log); + result &=3D isNodeTypeMatch(criteria, item, modificat= ions, storageConnection); // check session result &=3D isSessionMatch(criteria, sessionId); if (result) { - String path =3D - observationManagerRegistry.getLocationFactory()= .createJCRPath(item.getQPath()).getAsString( - false); + String path =3D locationFactory.createJCRPath(item= .getQPath()).getAsString(false); events.add(new EventImpl(eventType, path, userId)); } } // it wasn't able to retrive item's data @@ -136,24 +141,35 @@ // if this is session else if (isSessionSubtree(m)) { - if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE){ + if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) + { if (m.getKey().equals(JBossCacheStorage.SESSION_ID)) sessionId =3D (String)m.getValue(); else if (m.getKey().equals(JBossCacheStorage.USER_ID)) - userId =3D (String)m.getValue();} - else if (m.getType() =3D=3D ModificationType.REMOVE_N= ODE){ - sessionId =3D ""; - userId =3D ""; - } + userId =3D (String)m.getValue(); + } + else if (m.getType() =3D=3D ModificationType.REMOVE_DATA) + { + sessionId =3D ""; + userId =3D ""; + } } } = if (events.size() > 0) { // no events - no onEvent() action - listener.onEvent(events); + try + { + listener.onEvent(events); + } + catch (Exception e) + { + log.error("Onservation listener (" + listener + ") in er= ror, skipping.", e); + } } } + storageConnection.close(); } } = @@ -245,24 +261,21 @@ return itemPath.isDescendantOf(criteria.getAbsPath(), !criteria.isDe= ep()); } = - // shoud be changed in order to obtain parent's data elsewhere. Cache i= s not accessible from cacheloader.put(List) - @Deprecated - private boolean isNodeTypeMatch(ListenerCriteria criteria, ItemData ite= m, List modifications) - throws RepositoryException + // should be changed in order to obtain parent's data elsewhere. Cache = is not accessible from cacheloader.put(List) + private boolean isNodeTypeMatch(ListenerCriteria criteria, ItemData ite= m, List modifications, + WorkspaceStorageConnection storageConnection) throws RepositoryExcep= tion { if (criteria.getNodeTypeName() =3D=3D null) return true; = - // TODO: IT IS IMPOSSIBLE TO ACCESS CACHE ON CACHELOADER.PUT()!!! - NodeData node =3D - (NodeData)observationManagerRegistry.getWorkspaceDataManager().ge= tItemData(item.getParentIdentifier()); + NodeData node =3D (NodeData)storageConnection.getItemData(item.getPa= rentIdentifier()); if (node =3D=3D null) { // check if parent exists in changes log for (int i =3D modifications.size() - 1; i >=3D 0; i--) { ItemData data =3D getItemData(modifications.get(i)); - if (data.getIdentifier().equals(item.getParentIdentifier())) + if (data !=3D null && data.getIdentifier().equals(item.getPare= ntIdentifier())) { // parent found node =3D (NodeData)data; @@ -280,19 +293,8 @@ = for (int i =3D 0; i < criteria.getNodeTypeName().length; i++) { - NodeTypeData criteriaNT =3D - observationManagerRegistry.getNodeTypeDataManager().getNodeTyp= e(criteria.getNodeTypeName()[i]); - InternalQName[] testQNames; - if (criteriaNT.isMixin()) - { - testQNames =3D node.getMixinTypeNames(); - } - else - { - testQNames =3D new InternalQName[1]; - testQNames[0] =3D node.getPrimaryTypeName(); - } - if (observationManagerRegistry.getNodeTypeDataManager().isNodeTyp= e(criteriaNT.getName(), testQNames)) + if (observationManagerRegistry.getNodeTypeDataManager().isNodeTyp= e(criteria.getNodeTypeName()[i], + node.getPrimaryTypeName(), node.getMixinTypeNames())) return true; } return false; Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 11 12:53:06 UTC (rev 559) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 11 13:02:31 UTC (rev 560) @@ -19,27 +19,46 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.NamespaceAccessor; +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; +import org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataImpl; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeValue; +import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; +import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionDatas; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.observation.ListenerCriteria; import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.storage.inmemory.InmemoryContaine= rImpl; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.jboss.cache.Modification; = +import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Set; = +import javax.jcr.InvalidItemStateException; import javax.jcr.NamespaceException; import javax.jcr.PropertyType; import javax.jcr.RepositoryException; +import javax.jcr.nodetype.ConstraintViolationException; import javax.jcr.observation.Event; import javax.jcr.observation.EventIterator; import javax.jcr.observation.EventListener; @@ -56,6 +75,10 @@ = private ObservationManagerRegistry registry; = + private DummyWorkspaceStorageConnection workspaceStorageConnection; + + private NamespaceAccessor accessor; + private LocationFactory lf; = @Override @@ -63,8 +86,8 @@ { super.setUp(); loader =3D new ObservationCacheLoader(); - registry =3D new DummyObservationRegistry(); - loader.insertObservationRegistry(registry); + registry =3D new ObservationManagerRegistry(null, null, null,new Dum= myNodeTypeDataManager()); + workspaceStorageConnection =3D new DummyWorkspaceStorageConnection(); = final Map ns =3D new HashMap(); = @@ -77,9 +100,8 @@ ns.put("nt", "http://nt"); nss.put("http://nt", "nt"); = - this.lf =3D new LocationFactory(new NamespaceAccessor() + accessor =3D new NamespaceAccessor() { - public String getNamespaceURIByPrefix(String prefix) throws Names= paceException, RepositoryException { return ns.get(prefix); @@ -94,7 +116,10 @@ { return ns.keySet().toArray(new String[ns.keySet().size()]); } - }); + }; + + lf =3D new LocationFactory(accessor); + loader.injectDependencies(registry, new DummyWorkspaceDataContainer(= workspaceStorageConnection), accessor); } = public void testFilterByUUID() throws Exception @@ -220,58 +245,314 @@ = public void testFilterByNodeType() throws Exception { - QPath node1path =3D QPath.parse("[]:1[]node:1"); - NodeData newNode =3D - new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Consta= nts.NT_UNSTRUCTURED, new InternalQName[0], 0, + String parent1uuid =3D "uuid1"; + String parent2uuid =3D "uuid2"; + + QPath node1path =3D QPath.parse("[]:1[]node1:1"); + NodeData parentNode1 =3D + new TransientNodeData(node1path, parent1uuid, 1, Constants.NT_UNS= TRUCTURED, new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlList()); - NodeData newNode2 =3D - new TransientNodeData(node1path, Constants.SYSTEM_UUID, 1, Consta= nts.NT_RESOURCE, new InternalQName[0], 0, + workspaceStorageConnection.add(parentNode1); + + QPath node2path =3D QPath.parse("[]:1[]node2:1"); + NodeData parentNode2 =3D + new TransientNodeData(node2path, parent2uuid, 1, Constants.NT_RES= OURCE, new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlList()); + workspaceStorageConnection.add(parentNode2); + + QPath child1path =3D QPath.parse("[]:1[]child1:1"); + NodeData childNode1 =3D + new TransientNodeData(child1path, "child1", 1, Constants.NT_UNSTR= UCTURED, new InternalQName[0], 0, + parent1uuid, new AccessControlList()); + + QPath child2path =3D QPath.parse("[]:1[]child2:1"); + NodeData childNode2 =3D + new TransientNodeData(child2path, "child2", 1, Constants.NT_UNSTR= UCTURED, new InternalQName[0], 0, + parent2uuid, new AccessControlList()); + DummyListener listener =3D new DummyListener(); // listening only to NT_RESOURCE nodes registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, - lf.parseAbsPath("/").getInternalPath(), true, null, new InternalQ= Name[]{Constants.NT_RESOURCE}, false, "session1")); + lf.parseAbsPath("/").getInternalPath(), true, null, new InternalQ= Name[]{Constants.NT_RESOURCE}, false, + "session1")); = List modifications =3D new ArrayList(set= Session("session1", "admin")); - modifications.addAll(addNode(newNode)); - modifications.addAll(addNode(newNode2)); + modifications.addAll(addNode(childNode1)); + modifications.addAll(addNode(childNode2)); modifications.addAll(removeSession()); loader.put(modifications); // one event expected - assertEvent(Event.NODE_ADDED, node1path, listener, "admin"); + assertEvent(Event.NODE_ADDED, child2path, listener, "admin"); } - = + @Override protected void tearDown() throws Exception { super.tearDown(); } = - class DummyObservationRegistry extends ObservationManagerRegistry + class DummyListener implements EventListener { - public DummyObservationRegistry() + public List eventList =3D new ArrayList(); + + public void onEvent(EventIterator events) { - super(null, null, null); + while (events.hasNext()) + { + eventList.add(events.nextEvent()); + } } = - public LocationFactory getLocationFactory() - { - return lf; - } } = - class DummyListener implements EventListener + class DummyNodeTypeDataManager implements NodeTypeDataManager { - public List eventList =3D new ArrayList(); = - public void onEvent(EventIterator events) + public NodeDefinitionData[] getAllChildNodeDefinitions(InternalQName= ... nodeTypeNames) { - while (events.hasNext()) + return null; + } + + public List getAllNodeTypes() + { + return null; + } + + public PropertyDefinitionData[] getAllPropertyDefinitions(InternalQN= ame... nodeTypeNames) + { + return null; + } + + public NodeDefinitionData getChildNodeDefinition(InternalQName nodeN= ame, InternalQName... nodeTypeNames) + throws RepositoryException + { + return null; + } + + public NodeDefinitionData getChildNodeDefinition(InternalQName nodeN= ame, InternalQName primaryNodeType, + InternalQName[] mixinTypes) throws RepositoryException + { + return null; + } + + public Set getDeclaredSubtypes(InternalQName nodeType= Name) + { + return null; + } + + public List getManadatoryItemDefs(InternalQName = primaryNodeType, InternalQName[] mixinTypes) + throws RepositoryException + { + return null; + } + + public NodeTypeData getNodeType(InternalQName typeName) + { + return null; + } + + public PropertyDefinitionDatas getPropertyDefinitions(InternalQName = propertyName, InternalQName... nodeTypeNames) + throws RepositoryException + { + return null; + } + + public PropertyDefinitionDatas getPropertyDefinitions(InternalQName = propertyName, InternalQName primaryNodeType, + InternalQName[] mixinTypes) throws RepositoryException + { + return null; + } + + public Set getSubtypes(InternalQName nodeTypeName) + { + return null; + } + + public Set getSupertypes(InternalQName nodeTypeName) + { + return null; + } + + public boolean isChildNodePrimaryTypeAllowed(InternalQName childNode= TypeName, InternalQName parentNodeType, + InternalQName[] parentMixinNames) throws RepositoryException + { + return false; + } + + public boolean isNodeType(InternalQName testTypeName, InternalQName.= .. typeNames) + { + return false; + } + + public boolean isNodeType(InternalQName testTypeName, InternalQName = primaryNodeType, InternalQName[] mixinNames) + { + if (testTypeName.equals(primaryNodeType)) { - eventList.add(events.nextEvent()); + return true; } + for (InternalQName name : mixinNames) + { + if (testTypeName.equals(name)) + { + return true; + } + } + return false; } = + public boolean isOrderableChildNodesSupported(InternalQName primaryN= odeType, InternalQName[] mixinTypes) + throws RepositoryException + { + return false; + } + + public List registerNodeTypes(InputStream xml, int alr= eadyExistsBehaviour, String contentType) + throws RepositoryException + { + return null; + } + + public List registerNodeTypes(List ntVa= lues, int alreadyExistsBehaviour) + throws RepositoryException + { + return null; + } + + public PlainChangesLog setPrimaryType(NodeData nodeData, InternalQNa= me nodeTypeName) throws RepositoryException + { + return null; + } + + public void unregisterNodeType(InternalQName nodeTypeName) throws Re= positoryException + { + } + + public PlainChangesLog updateNodeType(NodeTypeData ancestorDefinitio= n, NodeTypeData recipientDefinition, + Map volatileNodeTypes) throws Constr= aintViolationException, RepositoryException + { + return null; + } + } = + class DummyWorkspaceDataContainer extends InmemoryContainerImpl + { + + private DummyWorkspaceStorageConnection storageConnection; + + public DummyWorkspaceDataContainer(DummyWorkspaceStorageConnection s= torageConnection) throws RepositoryException + { + super(new WorkspaceEntry("", "")); + this.storageConnection =3D storageConnection; + } + + public WorkspaceStorageConnection openConnection() + { + return storageConnection; + } + } + + class DummyWorkspaceStorageConnection implements WorkspaceStorageConnec= tion + { + + private Map storage =3D new HashMap(); + + public ItemData getItemData(String identifier) throws RepositoryExce= ption, IllegalStateException + { + return storage.get(identifier); + } + + public void add(NodeData data) throws RepositoryException, Unsupport= edOperationException, + InvalidItemStateException, IllegalStateException + { + storage.put(data.getIdentifier(), data); + } + + public void add(PropertyData data) throws RepositoryException, Unsup= portedOperationException, + InvalidItemStateException, IllegalStateException + { + storage.put(data.getIdentifier(), data); + } + + public void addSessionInfo(String sessionId, String userId) throws R= epositoryException + { + } + + public void close() throws IllegalStateException, RepositoryException + { + } + + public void commit() throws IllegalStateException, RepositoryExcepti= on + { + } + + public void delete(NodeData data) throws RepositoryException, Unsupp= ortedOperationException, + InvalidItemStateException, IllegalStateException + { + } + + public void delete(PropertyData data) throws RepositoryException, Un= supportedOperationException, + InvalidItemStateException, IllegalStateException + { + } + + public List getChildNodesData(NodeData parent) throws Repo= sitoryException, IllegalStateException + { + return null; + } + + public List getChildPropertiesData(NodeData parent) th= rows RepositoryException, + IllegalStateException + { + return null; + } + + public ItemData getItemData(NodeData parentData, QPathEntry name) th= rows RepositoryException, + IllegalStateException + { + return null; + } + + public List getReferencesData(String nodeIdentifier) t= hrows RepositoryException, + IllegalStateException, UnsupportedOperationException + { + return null; + } + + public boolean isOpened() + { + return false; + } + + public List listChildPropertiesData(NodeData parent) t= hrows RepositoryException, + IllegalStateException + { + return null; + } + + public void removeSessionInfo() throws RepositoryException + { + } + + public void rename(NodeData data) throws RepositoryException, Unsupp= ortedOperationException, + InvalidItemStateException, IllegalStateException + { + } + + public void rollback() throws IllegalStateException, RepositoryExcep= tion + { + } + + public void update(NodeData data) throws RepositoryException, Unsupp= ortedOperationException, + InvalidItemStateException, IllegalStateException + { + } + + public void update(PropertyData data) throws RepositoryException, Un= supportedOperationException, + InvalidItemStateException, IllegalStateException + { + } + + } + } --===============4052418624080238412==-- From do-not-reply at jboss.org Wed Nov 11 08:37:09 2009 Content-Type: multipart/mixed; boundary="===============0178620039892883018==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r561 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Wed, 11 Nov 2009 08:37:09 -0500 Message-ID: <200911111337.nABDb9R1009808@svn01.web.mwc.hst.phx2.redhat.com> --===============0178620039892883018== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-11 08:37:09 -0500 (Wed, 11 Nov 2009) New Revision: 561 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java Log: EXOJCR-205: new tests added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-11 13:02:31 UTC (rev= 560) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-11 13:37:09 UTC (rev= 561) @@ -109,8 +109,10 @@ = /** * Map NodeIdentifier -- lockData + * = + * TODO: changed from private to protected = */ - private final Map locks; + protected final Map locks; = /** * Data manager. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-11 13:02:31= UTC (rev 560) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-11 13:37:09= UTC (rev 561) @@ -128,13 +128,13 @@ log.error("Incorrect changes log size for lock or un= lock operation"); } = - // changesLog end for (String identifier : removedLock) { - lockManager.internalUnLock(sessionId, identifier); + lockManager.internalUnLock(identifier, sessionId); } = lockChanges =3D new ArrayList(); + removedLock =3D new HashSet(); sessionId =3D null; break; case REMOVE_KEY_VALUE : @@ -192,10 +192,10 @@ else if (m.getFqn().hasElement(JBossCacheStorage.NODES)) { int nodesPos =3D getElementPosition(m.getFqn(), JBossCacheStor= age.NODES); + // this is a node and node is locked + String nodeIdentifier =3D (String)m.getFqn().get(nodesPos + 1); if (m.getFqn().size() =3D=3D nodesPos + 2) { - // this is a node and node is locked - String nodeIdentifier =3D (String)m.getFqn().get(nodesPos += 1); if (lockManager.hasLockNode(nodeIdentifier)) { switch (m.getType()) Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-11 = 13:02:31 UTC (rev 560) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-11 = 13:37:09 UTC (rev 561) @@ -208,8 +208,8 @@ list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring("/" + JBossCacheStorage.SESSION), JBossCacheStorage.SESSION_ID, sessionId)); // add UserID by the key USER_ID - list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring("/" + JBossCacheStorage.SESSION), - JBossCacheStorage.USER_ID, userId)); + // list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fq= n.fromString("/" + JBossCacheStorage.SESSION), + // JBossCacheStorage.USER_ID, userId)); // return return list; } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-11 13:0= 2:31 UTC (rev 560) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-11 13:3= 7:09 UTC (rev 561) @@ -27,6 +27,7 @@ import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; @@ -140,4 +141,44 @@ assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); assertEquals(sessionId, lockManager.getSessionid()); } + + public void testAddNodeLock() throws Exception + { + List modifications =3D new ArrayList(); + String nodeIdentifier =3D "node1"; + String sessionId =3D "session1"; + + TransientNodeData node =3D + new TransientNodeData(testRoot, nodeIdentifier, 0, null, null, 0,= Constants.ROOT_UUID, null); + + lockManager.addLock(nodeIdentifier, new LockData(nodeIdentifier, "to= ken", false, false, "__system", -1)); + + modifications.addAll(setSession(sessionId, "userId")); + modifications.addAll(addNode(node)); + modifications.addAll(removeSession()); + lockCacheLoader.put(modifications); + + assertNull(lockManager.getNodeIdentifier()); + assertNull(lockManager.getSessionid()); + } + + public void testRemoveNodeLock() throws Exception + { + List modifications =3D new ArrayList(); + String nodeIdentifier =3D "node1"; + String sessionId =3D "session1"; + + TransientNodeData node =3D + new TransientNodeData(testRoot, nodeIdentifier, 0, null, null, 0,= Constants.ROOT_UUID, null); + + lockManager.addLock(nodeIdentifier, new LockData(nodeIdentifier, "to= ken", false, false, "__system", -1)); + + modifications.addAll(setSession(sessionId, "userId")); + modifications.addAll(removeNode(node)); + modifications.addAll(removeSession()); + lockCacheLoader.put(modifications); + + assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); + assertEquals(sessionId, lockManager.getSessionid()); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-11 13= :02:31 UTC (rev 560) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-11 13= :37:09 UTC (rev 561) @@ -86,4 +86,8 @@ pendingLocks.put(nodeIdentifier, lData); } = + public void addLock(String nodeIdentifier, LockData lData) + { + locks.put(nodeIdentifier, lData); + } } --===============0178620039892883018==-- From do-not-reply at jboss.org Wed Nov 11 09:42:46 2009 Content-Type: multipart/mixed; boundary="===============3106007680871103085==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r562 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 11 Nov 2009 09:42:45 -0500 Message-ID: <200911111442.nABEgj6t018410@svn01.web.mwc.hst.phx2.redhat.com> --===============3106007680871103085== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-11 09:42:45 -0500 (Wed, 11 Nov 2009) New Revision: 562 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-11 13:3= 7:09 UTC (rev 561) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-11 14:4= 2:45 UTC (rev 562) @@ -24,6 +24,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Properties; = import javax.naming.Context; @@ -43,15 +44,15 @@ import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; -import org.exoplatform.services.jcr.util.ConfigurationHelper; import org.exoplatform.services.jcr.util.IdGenerator; -import org.exoplatform.services.naming.InitialContextInitializer; import org.jboss.cache.CacheSPI; +import org.jboss.cache.Fqn; = = /** @@ -121,6 +122,20 @@ { jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; } + = + public void testAddNodeAndGetNode() throws Exception + { + // prepare + super.testAddNode(); + conn.commit(); + = + cache.stop(); + cache.start(); + = + Map data =3D cache.getData(Fqn.fromString("/"+= JBossCacheStorage.NODES + "/" + Constants.ROOT_UUID)); + = + = + } = public void testAddNode() throws Exception { --===============3106007680871103085==-- From do-not-reply at jboss.org Wed Nov 11 09:43:10 2009 Content-Type: multipart/mixed; boundary="===============4426254427588266776==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r563 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 11 Nov 2009 09:43:10 -0500 Message-ID: <200911111443.nABEhArn018422@svn01.web.mwc.hst.phx2.redhat.com> --===============4426254427588266776== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-11 09:43:09 -0500 (Wed, 11 Nov 2009) New Revision: 563 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 14:42:45= UTC (rev 562) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 14:43:09= UTC (rev 563) @@ -126,7 +126,7 @@ break; case REMOVE_NODE: System.out.println(m); - doRemove(m, jdbcConnection, getID(m.getFqn())); + doRemove(m, jdbcConnection); break; case MOVE: System.out.println(m); @@ -138,6 +138,7 @@ = if (jdbcConnection !=3D null) { jdbcConnection.commit(); +// jdbcConnection.close(); jdbcConnection =3D null; } } = @@ -148,8 +149,10 @@ } finally { - if (jdbcConnection !=3D null && jdbcConnection.isOpened()) + if (jdbcConnection !=3D null && jdbcConnection.isOpened()) { jdbcConnection.rollback(); + } + = } } = @@ -173,16 +176,23 @@ * @throws IllegalStateException * @throws RepositoryException */ - private void doRemove(Modification modification, JDBCStorageConnection = jdbcConnection, String identifier) + private void doRemove(Modification modification, JDBCStorageConnection = jdbcConnection) throws IllegalStateException, RepositoryException { = - ItemData itemData =3D jdbcConnection.getItemData(identifier); - - if (itemData instanceof NodeData) - jdbcConnection.delete((NodeData) itemData); - if (itemData instanceof PropertyData) - jdbcConnection.delete((PropertyData) itemData); + if (modification.getFqn().get(1).equals(JBossCacheStorage.NODES) || + modification.getFqn().get(1).equals(JBossCacheStorage.PROPS)) + { + = + String identifier =3D (String) modification.getFqn().get(1); + = + ItemData itemData =3D jdbcConnection.getItemData(identifier); + = + if (itemData instanceof NodeData) + jdbcConnection.delete((NodeData) itemData); + if (itemData instanceof PropertyData) + jdbcConnection.delete((PropertyData) itemData); + } } = private boolean isNodeData(Fqn fqn) @@ -350,7 +360,7 @@ = try { - NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(2)); + NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(1)); = if (parentNodeData =3D=3D null) throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(2) + " not exis, FQN =3D '" + name + "'."); @@ -464,11 +474,43 @@ /** * {@inheritDoc} */ - public Set getChildrenNames(Fqn fqn) throws Exception + public Set getChildrenNames(Fqn name) throws Exception { // return child nodes names + = + Set childs =3D new LinkedHashSet(); + = + // /$NODES/ + if (name.size() =3D=3D 2) = + { + WorkspaceStorageConnection conn =3D dataContainer.openConnection(= ); + try + { + NodeData parentNodeData =3D (NodeData)conn.getItemData((String= ) name.get(1)); + = + if (parentNodeData =3D=3D null) + throw new JDBCCacheLoaderException("The parent node with ID= =3D " + (String)name.get(2) + " not exis, FQN =3D '" + name + "'."); = - Set childs =3D new LinkedHashSet(); + // get child nodes by parent Id + for (NodeData node : conn.getChildNodesData(parentNodeData)) + { + childs.add(node.getQPath().getEntries()[node.getQPath().get= Entries().length - 1].getAsString(true)); + } + } + finally + { + conn.close(); + } + } + else if (name.equals(Fqn.ROOT)) + { +// childs.add(JBossCacheStorage.NODES); +// childs.add(JBossCacheStorage.PROPS); + } + = + return childs; + +/* Set childs =3D new LinkedHashSet(); if (fqn.size() > 2) { if (fqn.get(2).equals(JBossCacheStorage.NODES)) @@ -536,7 +578,7 @@ childs.add(JBossCacheStorage.NODES); childs.add(JBossCacheStorage.PROPS); } - return childs; + return childs;*/ } = /** --===============4426254427588266776==-- From do-not-reply at jboss.org Wed Nov 11 09:47:46 2009 Content-Type: multipart/mixed; boundary="===============4371982063619855153==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r564 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Wed, 11 Nov 2009 09:47:46 -0500 Message-ID: <200911111447.nABElkAm018832@svn01.web.mwc.hst.phx2.redhat.com> --===============4371982063619855153== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-11 09:47:46 -0500 (Wed, 11 Nov 2009) New Revision: 564 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader.xml Log: EXOJCR-205: small refactoring Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-11 14:43:09= UTC (rev 563) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-11 14:47:46= UTC (rev 564) @@ -89,7 +89,7 @@ = for (Modification m : modifications) { - if (m.getFqn().hasElement(JBossCacheStorage.SESSION)) + if (m.getFqn().get(0).equals(JBossCacheStorage.SESSION)) { switch (m.getType()) { @@ -98,13 +98,14 @@ case PUT_DATA : break; case PUT_KEY_VALUE : + // begin new changes log if (m.getKey().equals(JBossCacheStorage.SESSION_ID)) { sessionId =3D (String)m.getValue(); } break; case REMOVE_DATA : - // perform lock or unlock operation + // end changes log if (lockChanges.size() =3D=3D 2) { if (lockChanges.get(0).getType() =3D=3D ModificationT= ype.PUT_KEY_VALUE @@ -112,11 +113,10 @@ { performLock(lockChanges, sessionId); } - else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_NODE - && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_NODE) + else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_KEY_VALUE + && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_KEY_VALUE) { - PropertyData propertyData =3D (PropertyData)lockCh= anges.get(0).getValue(); - performUnLock(lockChanges, propertyData.getParentI= dentifier(), sessionId); + performUnLock(lockChanges, (String)lockChanges.get= (0).getFqn().get(1), sessionId); } else { @@ -147,7 +147,7 @@ throw new CacheException("Unknown modification " + m.get= Type()); } } - else if (m.getFqn().hasElement(JBossCacheStorage.PROPS)) + else if (m.getFqn().get(0).equals(JBossCacheStorage.PROPS)) { switch (m.getType()) { @@ -156,12 +156,11 @@ case PUT_DATA : break; case PUT_KEY_VALUE : + // lock operation if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) { - PropertyData propertyData =3D (PropertyData)m.getValu= e(); - InternalQName propertyName =3D propertyData.getQPath(= ).getName(); - - if (propertyName.equals(Constants.JCR_LOCKISDEEP) || = propertyName.equals(Constants.JCR_LOCKOWNER)) + InternalQName propName =3D ((PropertyData)m.getValue(= )).getQPath().getName(); + if (propName.equals(Constants.JCR_LOCKISDEEP) || prop= Name.equals(Constants.JCR_LOCKOWNER)) { lockChanges.add(m); } @@ -172,16 +171,6 @@ case REMOVE_KEY_VALUE : break; case REMOVE_NODE : - if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) - { - PropertyData propertyData =3D (PropertyData)m.getValu= e(); - InternalQName propertyName =3D propertyData.getQPath(= ).getName(); - - if (propertyName.equals(Constants.JCR_LOCKISDEEP) || = propertyName.equals(Constants.JCR_LOCKOWNER)) - { - lockChanges.add(m); - } - } break; case MOVE : break; @@ -189,38 +178,56 @@ throw new CacheException("Unknown modification " + m.get= Type()); } } - else if (m.getFqn().hasElement(JBossCacheStorage.NODES)) + else if (m.getFqn().get(0).equals(JBossCacheStorage.NODES)) { - int nodesPos =3D getElementPosition(m.getFqn(), JBossCacheStor= age.NODES); - // this is a node and node is locked - String nodeIdentifier =3D (String)m.getFqn().get(nodesPos + 1); - if (m.getFqn().size() =3D=3D nodesPos + 2) + switch (m.getType()) { - if (lockManager.hasLockNode(nodeIdentifier)) - { - switch (m.getType()) + case PUT_DATA_ERASE : + break; + case PUT_DATA : + if (m.getFqn().size() =3D=3D 2) { - case PUT_DATA_ERASE : - break; - case PUT_DATA : + String nodeIdentifier =3D (String)m.getFqn().get(1); + if (lockManager.hasLockNode(nodeIdentifier)) + { removedLock.remove(nodeIdentifier); - break; - case PUT_KEY_VALUE : - break; - case REMOVE_DATA : - break; - case REMOVE_KEY_VALUE : - break; - case REMOVE_NODE : + } + } + break; + case PUT_KEY_VALUE : + break; + case REMOVE_DATA : + break; + case REMOVE_KEY_VALUE : + // unLock operation + if (m.getKey().equals(Constants.JCR_LOCKISDEEP.getAsStri= ng()) + || m.getKey().equals(Constants.JCR_LOCKOWNER.getAsStr= ing())) + { + lockChanges.add(m); + } + break; + case REMOVE_NODE : + if (m.getFqn().size() =3D=3D 2) + { + String nodeIdentifier =3D (String)m.getFqn().get(1); + if (lockManager.hasLockNode(nodeIdentifier)) + { removedLock.add(nodeIdentifier); - break; - case MOVE : + } + } + break; + case MOVE : + if (m.getFqn().size() =3D=3D 2) + { + String nodeIdentifier =3D (String)m.getFqn().get(1); + if (lockManager.hasLockNode(nodeIdentifier)) + { removedLock.remove(nodeIdentifier); - break; - default : - throw new CacheException("Unknown modification " += m.getType()); + } } - } + break; + default : + throw new CacheException("Unknown modification " + m.get= Type()); } } } @@ -316,13 +323,4 @@ return null; } = - private int getElementPosition(Fqn fqn, String element) - { - for (int i =3D 0; i < fqn.size(); i++) - if (fqn.get(i).equals(element)) - return i; - - return -1; - } - } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-11 14= :43:09 UTC (rev 563) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-11 14= :47:46 UTC (rev 564) @@ -16,16 +16,12 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import sun.security.util.PendingException; - import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.jboss.cache.factories.annotations.NonVolatile; = -import java.util.Map; - import javax.jcr.lock.LockException; = /** @@ -40,9 +36,9 @@ public class TesterLockManagerImpl extends LockManagerImpl { = - private String nodeIdentifier; + private String nodeIdentifier =3D null; = - private String sessionId; + private String sessionId =3D null; = public TesterLockManagerImpl(WorkspacePersistentDataManager dataManager= , WorkspaceEntry config) { @@ -59,6 +55,9 @@ */ public synchronized void internalLock(String nodeIdentifier) throws Loc= kException { + if (this.nodeIdentifier !=3D null) + throw new LockException("NodeIdentifier already exist!"); + this.nodeIdentifier =3D nodeIdentifier; } = @@ -67,6 +66,12 @@ */ public synchronized void internalUnLock(String nodeIdentifier, String s= essionId) throws LockException { + if (this.nodeIdentifier !=3D null) + throw new LockException("NodeIdentifier already exist!"); + + if (this.sessionId !=3D null) + throw new LockException("SessionId already exist!"); + this.nodeIdentifier =3D nodeIdentifier; this.sessionId =3D sessionId; } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-exoloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-11 14:43:09 UTC (rev 563) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-11 14:47:46 UTC (rev 564) @@ -65,6 +65,12 @@ = + = + + + + = = --===============4371982063619855153==-- From do-not-reply at jboss.org Wed Nov 11 10:02:34 2009 Content-Type: multipart/mixed; boundary="===============7445527472879412994==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r565 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 11 Nov 2009 10:02:34 -0500 Message-ID: <200911111502.nABF2YIR020930@svn01.web.mwc.hst.phx2.redhat.com> --===============7445527472879412994== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-11 10:02:33 -0500 (Wed, 11 Nov 2009) New Revision: 565 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 14:47:46= UTC (rev 564) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 15:02:33= UTC (rev 565) @@ -398,7 +398,7 @@ } } = - return attrs; + return (attrs.size() =3D=3D 0 ? null : attrs); /*if (name.size() > 1) { if (name.get(1).equals(JBossCacheStorage.NODES)) @@ -508,7 +508,7 @@ // childs.add(JBossCacheStorage.PROPS); } = - return childs; + return (childs.size() =3D=3D 0 ? null : childs); = /* Set childs =3D new LinkedHashSet(); if (fqn.size() > 2) --===============7445527472879412994==-- From do-not-reply at jboss.org Wed Nov 11 10:39:11 2009 Content-Type: multipart/mixed; boundary="===============4767347594104472167==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r567 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 11 Nov 2009 10:39:11 -0500 Message-ID: <200911111539.nABFdBv4026413@svn01.web.mwc.hst.phx2.redhat.com> --===============4767347594104472167== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-11 10:39:11 -0500 (Wed, 11 Nov 2009) New Revision: 567 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader and JBossCacheStorageConnection was change= d. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -11 15:14:43 UTC (rev 566) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -11 15:39:11 UTC (rev 567) @@ -64,6 +64,8 @@ */ private boolean batchStarted =3D false; = + private boolean isCommited =3D false; + /** * JBossCacheStorageConnection constructor. * @@ -506,6 +508,7 @@ { this.cache.endBatch(true); // treePrint(treeRoot); batchStarted =3D false; + isCommited =3D true; } else { @@ -542,7 +545,7 @@ */ public boolean isOpened() { - return true; + return !isCommited; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 15:14:43= UTC (rev 566) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-11 15:39:11= UTC (rev 567) @@ -138,7 +138,6 @@ = if (jdbcConnection !=3D null) { jdbcConnection.commit(); -// jdbcConnection.close(); jdbcConnection =3D null; } } = --===============4767347594104472167==-- From do-not-reply at jboss.org Wed Nov 11 10:53:33 2009 Content-Type: multipart/mixed; boundary="===============2729771804413631493==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r568 - core/trunk. Date: Wed, 11 Nov 2009 10:53:33 -0500 Message-ID: <200911111553.nABFrXaT028786@svn01.web.mwc.hst.phx2.redhat.com> --===============2729771804413631493== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-11 10:53:32 -0500 (Wed, 11 Nov 2009) New Revision: 568 Modified: core/trunk/pom.xml Log: EXOJCR-179 com.sun.tools excluded from dependencies Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-11 15:39:11 UTC (rev 567) +++ core/trunk/pom.xml 2009-11-11 15:53:32 UTC (rev 568) @@ -197,7 +197,13 @@ org.htmlparser htmlparser 1.6 - compile + compile + + + com.sun + tools + +
= --===============2729771804413631493==-- From do-not-reply at jboss.org Wed Nov 11 11:11:08 2009 Content-Type: multipart/mixed; boundary="===============7937295217135660656==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r569 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader and 1 other directories. Date: Wed, 11 Nov 2009 11:11:08 -0500 Message-ID: <200911111611.nABGB8Ya000567@svn01.web.mwc.hst.phx2.redhat.com> --===============7937295217135660656== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-11 11:11:07 -0500 (Wed, 11 Nov 2009) New Revision: 569 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202: IndexerCacheLoaderRuntimeTest added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java 2009-11-11 15:53:32 UTC (= rev 568) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java 2009-11-11 16:11:07 UTC (= rev 569) @@ -54,6 +54,7 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; +import org.jboss.cache.factories.annotations.NonVolatile; import org.picocontainer.Startable; = import java.io.IOException; @@ -85,6 +86,7 @@ * @author Karpenko Sergiy = * @version $Id: SearchManagerImpl.java 111 2008-11-11 11:11:11Z serg $ */ +(a)NonVolatile public class SearchManagerImpl implements SearchManager, Startable, Mandat= oryItemsPersistenceListener { = @@ -361,82 +363,85 @@ public void updateIndex(final Set removedNodes, final Set addedNodes) throws RepositoryException, IOException { - Iterator addedStates =3D new Iterator() + if (handler !=3D null) { - private final Iterator iter =3D addedNodes.iterator(); - - public boolean hasNext() + Iterator addedStates =3D new Iterator() { - return iter.hasNext(); - } + private final Iterator iter =3D addedNodes.iterator(); = - public NodeData next() - { + public boolean hasNext() + { + return iter.hasNext(); + } = - // cycle till find a next or meet the end of set - do + public NodeData next() { - String id =3D iter.next(); - try + + // cycle till find a next or meet the end of set + do { - ItemData item =3D itemMgr.getItemData(id); - if (item !=3D null) + String id =3D iter.next(); + try { - if (item.isNode()) - return (NodeData)item; // return node + ItemData item =3D itemMgr.getItemData(id); + if (item !=3D null) + { + if (item.isNode()) + return (NodeData)item; // return node + else + log.warn("Node not found, but property " + id += ", " + item.getQPath().getAsString() + + " found. "); + } else - log.warn("Node not found, but property " + id + ",= " + item.getQPath().getAsString() - + " found. "); + log.warn("Unable to index node with id " + id + ",= node does not exist."); + } - else - log.warn("Unable to index node with id " + id + ", no= de does not exist."); + catch (RepositoryException e) + { + log.error("Can't read next node data " + id, e); + } + } + while (iter.hasNext()); // get next if error or node not fo= und = - } - catch (RepositoryException e) - { - log.error("Can't read next node data " + id, e); - } + return null; // we met the end of iterator set } - while (iter.hasNext()); // get next if error or node not found = - return null; // we met the end of iterator set - } + public void remove() + { + throw new UnsupportedOperationException(); + } + }; = - public void remove() + Iterator removedIds =3D new Iterator() { - throw new UnsupportedOperationException(); - } - }; + private final Iterator iter =3D removedNodes.iterator(= ); = - Iterator removedIds =3D new Iterator() - { - private final Iterator iter =3D removedNodes.iterator(); + public boolean hasNext() + { + return iter.hasNext(); + } = - public boolean hasNext() - { - return iter.hasNext(); - } + public String next() + { + return nextNodeId(); + } = - public String next() - { - return nextNodeId(); - } + public String nextNodeId() throws NoSuchElementException + { + return iter.next(); + } = - public String nextNodeId() throws NoSuchElementException - { - return iter.next(); - } + public void remove() + { + throw new UnsupportedOperationException(); = - public void remove() + } + }; + + if (removedNodes.size() > 0 || addedNodes.size() > 0) { - throw new UnsupportedOperationException(); - + handler.updateNodes(removedIds, addedStates); } - }; - - if (removedNodes.size() > 0 || addedNodes.size() > 0) - { - handler.updateNodes(removedIds, addedStates); } = } @@ -510,6 +515,9 @@ try { indexingRootData =3D (NodeData)itemMgr.getItemData(Const= ants.ROOT_UUID); + // indexingRootData =3D + // new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, + // new InternalQName[0], 0, null, ne= w AccessControlList()); } catch (RepositoryException e) { @@ -608,7 +616,6 @@ QueryHandler parentHandler =3D (this.parentSearchManager !=3D nul= l) ? parentSearchManager.getHandler() : null; QueryHandlerContext context =3D createQueryHandlerContext(parentH= andler); handler.init(context); - } catch (SecurityException e) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-11 1= 5:53:32 UTC (rev 568) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-11 1= 6:11:07 UTC (rev 569) @@ -25,6 +25,7 @@ import org.jboss.cache.CacheException; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; +import org.jboss.cache.factories.annotations.Inject; = import java.util.HashSet; import java.util.List; @@ -52,7 +53,8 @@ { } = - public void registerSearchManager(SearchManager manager) + @Inject + public void injectDependencies(SearchManager manager) { searchManager =3D manager; } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-11 1= 5:53:32 UTC (rev 568) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-11 1= 6:11:07 UTC (rev 569) @@ -67,7 +67,7 @@ super.setUp(); searchManager =3D new DummySearchManager(); indexerCacheLoader =3D new IndexerCacheLoader(); - indexerCacheLoader.registerSearchManager(searchManager); + indexerCacheLoader.injectDependencies(searchManager); } = /** --===============7937295217135660656==-- From do-not-reply at jboss.org Wed Nov 11 11:15:27 2009 Content-Type: multipart/mixed; boundary="===============3193806516478125990==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r570 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Wed, 11 Nov 2009 11:15:27 -0500 Message-ID: <200911111615.nABGFROf001553@svn01.web.mwc.hst.phx2.redhat.com> --===============3193806516478125990== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-11 11:15:26 -0500 (Wed, 11 Nov 2009) New Revision: 570 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-204: Updated test Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-11 1= 6:11:07 UTC (rev 569) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-11 1= 6:15:26 UTC (rev 570) @@ -20,8 +20,6 @@ = import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.core.NamespaceAccessor; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; -import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; @@ -91,7 +89,7 @@ public void put(List modifications) throws Exception { = - // get SessionID from list + // TODO: get SessionID from session registry String userId =3D ""; // get UserID from list String sessionId =3D ""; @@ -116,7 +114,6 @@ if (isItemSubtree(m)) { ItemData item =3D getItemData(m); - // TODO: remove hardcode if (item !=3D null) { int eventType =3D eventType(m); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 11 16:11:07 UTC (rev 569) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 11 16:15:26 UTC (rev 570) @@ -24,7 +24,6 @@ import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataImpl; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.core.nodetype.NodeTypeValue; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; @@ -49,7 +48,6 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; @@ -86,7 +84,7 @@ { super.setUp(); loader =3D new ObservationCacheLoader(); - registry =3D new ObservationManagerRegistry(null, null, null,new Dum= myNodeTypeDataManager()); + registry =3D new ObservationManagerRegistry(null, null, null, new Du= mmyNodeTypeDataManager()); workspaceStorageConnection =3D new DummyWorkspaceStorageConnection(); = final Map ns =3D new HashMap(); --===============3193806516478125990==-- From do-not-reply at jboss.org Wed Nov 11 13:08:15 2009 Content-Type: multipart/mixed; boundary="===============6776353965124315913==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r571 - kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl. Date: Wed, 11 Nov 2009 13:08:15 -0500 Message-ID: <200911111808.nABI8Fmf024980@svn01.web.mwc.hst.phx2.redhat.com> --===============6776353965124315913== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: hung_van Date: 2009-11-11 13:08:15 -0500 (Wed, 11 Nov 2009) New Revision: 571 Modified: kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplat= form/services/scheduler/impl/JobSchedulerServiceImpl.java Log: JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument Modified: kernel/branches/mc-int-branch/component/common/src/main/java/org/= exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/component/common/src/main/java/org/exopla= tform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 16:15= :26 UTC (rev 570) +++ kernel/branches/mc-int-branch/component/common/src/main/java/org/exopla= tform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08= :15 UTC (rev 571) @@ -175,6 +175,7 @@ new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), job= info.getJobName(), jobinfo.getGroupName(), exp); JobDetail job =3D new JobDetail(jobinfo.getJobName(), jobinfo.getGro= upName(), jobinfo.getJob()); + job.setJobDataMap(jdatamap); job.setDescription(jobinfo.getDescription()); scheduler_.addJob(job, true); scheduler_.scheduleJob(trigger); --===============6776353965124315913==-- From do-not-reply at jboss.org Wed Nov 11 13:08:58 2009 Content-Type: multipart/mixed; boundary="===============0586456515886245998==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r572 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl. Date: Wed, 11 Nov 2009 13:08:58 -0500 Message-ID: <200911111808.nABI8wZH025080@svn01.web.mwc.hst.phx2.redhat.com> --===============0586456515886245998== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: hung_van Date: 2009-11-11 13:08:57 -0500 (Wed, 11 Nov 2009) New Revision: 572 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/scheduler/impl/JobSchedulerServiceImpl.java Log: JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/scheduler/impl/JobSchedulerServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08:15 UT= C (rev 571) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08:57 UT= C (rev 572) @@ -175,6 +175,7 @@ new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), job= info.getJobName(), jobinfo.getGroupName(), exp); JobDetail job =3D new JobDetail(jobinfo.getJobName(), jobinfo.getGro= upName(), jobinfo.getJob()); + job.setJobDataMap(jdatamap); job.setDescription(jobinfo.getDescription()); scheduler_.addJob(job, true); scheduler_.scheduleJob(trigger); --===============0586456515886245998==-- From do-not-reply at jboss.org Wed Nov 11 13:13:29 2009 Content-Type: multipart/mixed; boundary="===============7745689344708191874==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r573 - kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplatform/services/scheduler/impl. Date: Wed, 11 Nov 2009 13:13:28 -0500 Message-ID: <200911111813.nABIDSFo026496@svn01.web.mwc.hst.phx2.redhat.com> --===============7745689344708191874== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: hung_van Date: 2009-11-11 13:13:28 -0500 (Wed, 11 Nov 2009) New Revision: 573 Modified: kernel/branches/mc-int-branch/component/common/src/main/java/org/exoplat= form/services/scheduler/impl/JobSchedulerServiceImpl.java Log: EXOJCR-215 JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument Modified: kernel/branches/mc-int-branch/component/common/src/main/java/org/= exoplatform/services/scheduler/impl/JobSchedulerServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/component/common/src/main/java/org/exopla= tform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:08= :57 UTC (rev 572) +++ kernel/branches/mc-int-branch/component/common/src/main/java/org/exopla= tform/services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:13= :28 UTC (rev 573) @@ -172,8 +172,8 @@ { JobInfo jobinfo =3D getJobInfo(jinfo); CronTrigger trigger =3D - new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), job= info.getJobName(), jobinfo.getGroupName(), - exp); + new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), job= info.getJobName(), jobinfo.getGroupName(), = + exp); JobDetail job =3D new JobDetail(jobinfo.getJobName(), jobinfo.getGro= upName(), jobinfo.getJob()); job.setJobDataMap(jdatamap); job.setDescription(jobinfo.getDescription()); --===============7745689344708191874==-- From do-not-reply at jboss.org Wed Nov 11 13:14:58 2009 Content-Type: multipart/mixed; boundary="===============5096468311531954882==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r574 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/scheduler/impl. Date: Wed, 11 Nov 2009 13:14:58 -0500 Message-ID: <200911111814.nABIEwgb026727@svn01.web.mwc.hst.phx2.redhat.com> --===============5096468311531954882== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: hung_van Date: 2009-11-11 13:14:58 -0500 (Wed, 11 Nov 2009) New Revision: 574 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/scheduler/impl/JobSchedulerServiceImpl.java Log: EXOJCR-215 JobSchedulerServiceImpl.addCronJob() ignores JobDataMap argument Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/scheduler/impl/JobSchedulerServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:13:28 UT= C (rev 573) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/scheduler/impl/JobSchedulerServiceImpl.java 2009-11-11 18:14:58 UT= C (rev 574) @@ -155,7 +155,7 @@ JobInfo jobinfo =3D getJobInfo(jinfo); CronTrigger trigger =3D new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), job= info.getJobName(), jobinfo.getGroupName(), - exp); + exp); JobDetail job =3D new JobDetail(jobinfo.getJobName(), jobinfo.getGro= upName(), jobinfo.getJob()); job.setDescription(jobinfo.getDescription()); scheduler_.addJob(job, true); @@ -173,7 +173,7 @@ JobInfo jobinfo =3D getJobInfo(jinfo); CronTrigger trigger =3D new CronTrigger(jobinfo.getJobName(), jobinfo.getGroupName(), job= info.getJobName(), jobinfo.getGroupName(), - exp); + exp); JobDetail job =3D new JobDetail(jobinfo.getJobName(), jobinfo.getGro= upName(), jobinfo.getJob()); job.setJobDataMap(jdatamap); job.setDescription(jobinfo.getDescription()); --===============5096468311531954882==-- From do-not-reply at jboss.org Thu Nov 12 03:06:27 2009 Content-Type: multipart/mixed; boundary="===============4210402158539225256==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r575 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Thu, 12 Nov 2009 03:06:27 -0500 Message-ID: <200911120806.nAC86Rnk032455@svn01.web.mwc.hst.phx2.redhat.com> --===============4210402158539225256== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-12 03:06:27 -0500 (Thu, 12 Nov 2009) New Revision: 575 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java Log: EXOJCR-201: bug fix Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-11 18:14:58 UTC (rev 574) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-12 08:06:27 UTC (rev 575) @@ -18,8 +18,11 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; +import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; @@ -28,8 +31,10 @@ import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; = +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Set; = import javax.jcr.RepositoryException; @@ -44,7 +49,7 @@ */ public class JBossCacheWorkspaceDataManager extends WorkspacePersistentDat= aManager { - = + /** * JBossCachePersistentDataManager constructor. * @@ -54,7 +59,7 @@ public JBossCacheWorkspaceDataManager(WorkspaceDataContainer dataContai= ner, SystemDataContainerHolder systemDataContaine= rHolder) { - super(dataContainer, systemDataContainerHolder); = + super(dataContainer, systemDataContainerHolder); } = @Override @@ -69,85 +74,125 @@ WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; = + // prepare changes log list + List chengesLogList =3D new ArrayList(); + if (changesLog instanceof PlainChangesLog) + { + chengesLogList.add((PlainChangesLog)changesLog); + } + else if (changesLog instanceof CompositeChangesLog) + { + for (ChangesLogIterator iter =3D ((CompositeChangesLog)changesLog= ).getLogIterator(); iter.hasNextLog();) + { + chengesLogList.add(iter.nextLog()); + } + } + try { - for (Iterator iter =3D changesLog.getAllStates().itera= tor(); iter.hasNext();) + for (PlainChangesLog currChangesLog : chengesLogList) { - ItemState itemState =3D iter.next(); + boolean systemConnSessionInfoAdded =3D false; + boolean thisConnSessionInfoAdded =3D false; = - if (!itemState.isPersisted()) - continue; + for (Iterator iter =3D currChangesLog.getAllStates(= ).iterator(); iter.hasNext();) + { + ItemState itemState =3D iter.next(); = - long start =3D System.currentTimeMillis(); + if (!itemState.isPersisted()) + continue; = - TransientItemData data =3D (TransientItemData)itemState.getDat= a(); + long start =3D System.currentTimeMillis(); = - WorkspaceStorageConnection conn =3D null; - if (isSystemDescendant(data.getQPath())) - { - conn =3D systemConnection =3D=3D null - // we need system connection but it's not exist - ? systemConnection =3D (systemDataContainer !=3D dataCon= tainer - // if it's different container instances - ? systemDataContainer.equals(dataContainer) && thisCo= nnection !=3D null - // but container confugrations are same and non-syste= m connnection open - // reuse this connection as system - ? systemDataContainer.reuseConnection(thisConnecti= on) - // or open one new system - : systemDataContainer.openConnection() - // else if it's same container instances (system and = this) - : thisConnection =3D=3D null - // and non-system connection doens't exist - open it - ? thisConnection =3D dataContainer.openConnection() - // if already open - use it - : thisConnection) - // system connection opened - use it - : systemConnection; - } - else - { - conn =3D thisConnection =3D=3D null - // we need this conatiner conection - ? thisConnection =3D (systemDataContainer !=3D dataConta= iner - // if it's different container instances - ? dataContainer.equals(systemDataContainer) && system= Connection !=3D null - // but container confugrations are same and system co= nnnection open - // reuse system connection as this - ? dataContainer.reuseConnection(systemConnection) - // or open one new - : dataContainer.openConnection() - // else if it's same container instances (system and = this) - : systemConnection =3D=3D null - // and system connection doens't exist - open it - ? systemConnection =3D dataContainer.openConnectio= n() - // if already open - use it - : systemConnection) - // this connection opened - use it - : thisConnection; - } + TransientItemData data =3D (TransientItemData)itemState.get= Data(); = - data.increasePersistedVersion(); + WorkspaceStorageConnection conn =3D null; + if (isSystemDescendant(data.getQPath())) + { + conn =3D systemConnection =3D=3D null + // we need system connection but it's not exist + ? systemConnection =3D (systemDataContainer !=3D data= Container + // if it's different container instances + ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null + // but container confugrations are same and non-sy= stem connnection open + // reuse this connection as system + ? systemDataContainer.reuseConnection(thisConne= ction) + // or open one new system + : systemDataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : thisConnection =3D=3D null + // and non-system connection doens't exist - open = it + ? thisConnection =3D dataContainer.openConnecti= on() + // if already open - use it + : thisConnection) + // system connection opened - use it + : systemConnection; = - if (itemState.isAdded()) - { - doAdd(data, conn, addedNodes); + if (!systemConnSessionInfoAdded) + { + // TODO userId + if (!systemConnection.equals(thisConnection)) + systemConnection.addSessionInfo(currChangesLog.get= SessionId()); + systemConnSessionInfoAdded =3D true; + } + } + else + { + conn =3D thisConnection =3D=3D null + // we need this conatiner conection + ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null + // but container confugrations are same and system= connnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnectio= n) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openConnec= tion() + // if already open - use it + : systemConnection) + // this connection opened - use it + : thisConnection; + + if (!thisConnSessionInfoAdded) + { + // TODO userId + if (!thisConnection.equals(systemConnection)) + thisConnection.addSessionInfo(currChangesLog.getSe= ssionId()); + thisConnSessionInfoAdded =3D true; + } + } + + data.increasePersistedVersion(); + + if (itemState.isAdded()) + { + doAdd(data, conn, addedNodes); + } + else if (itemState.isUpdated()) + { + doUpdate(data, conn); + } + else if (itemState.isDeleted()) + { + doDelete(data, conn); + } + else if (itemState.isRenamed()) + { + doRename(data, conn, addedNodes); + } + + if (LOG.isDebugEnabled()) + LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) + + "ms, " + data.getQPath().getAsString()); } - else if (itemState.isUpdated()) - { - doUpdate(data, conn); - } - else if (itemState.isDeleted()) - { - doDelete(data, conn); - } - else if (itemState.isRenamed()) - { - doRename(data, conn, addedNodes); - } - - if (LOG.isDebugEnabled()) - LOG.debug(ItemState.nameFromValue(itemState.getState()) + "= " + (System.currentTimeMillis() - start) - + "ms, " + data.getQPath().getAsString()); + if (thisConnection !=3D null) + thisConnection.removeSessionInfo(); + if (systemConnection !=3D null && !systemConnection.equals(thi= sConnection)) + systemConnection.removeSessionInfo(); } if (thisConnection !=3D null) thisConnection.commit(); @@ -166,7 +211,6 @@ } } = - /** * Tell if the path is jcr:system descendant. * = @@ -178,5 +222,5 @@ { return path.isDescendantOf(Constants.JCR_SYSTEM_PATH) || path.equals= (Constants.JCR_SYSTEM_PATH); } - = + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-11 18:14:58 UTC (rev 574) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-12 08:06:27 UTC (rev 575) @@ -131,125 +131,85 @@ WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; = - // prepare changes log list - List chengesLogList =3D new ArrayList(); - if (changesLog instanceof PlainChangesLog) - { - chengesLogList.add((PlainChangesLog)changesLog); - } - else if (changesLog instanceof CompositeChangesLog) - { - for (ChangesLogIterator iter =3D ((CompositeChangesLog)changesLog= ).getLogIterator(); iter.hasNextLog();) - { - chengesLogList.add(iter.nextLog()); - } - } - try { - for (PlainChangesLog currChangesLog : chengesLogList) + for (Iterator iter =3D changesLog.getAllStates().itera= tor(); iter.hasNext();) { - boolean systemConnSessionInfoAdded =3D false; - boolean thisConnSessionInfoAdded =3D false; + ItemState itemState =3D iter.next(); = - for (Iterator iter =3D currChangesLog.getAllStates(= ).iterator(); iter.hasNext();) - { - ItemState itemState =3D iter.next(); + if (!itemState.isPersisted()) + continue; = - if (!itemState.isPersisted()) - continue; + long start =3D System.currentTimeMillis(); = - long start =3D System.currentTimeMillis(); + TransientItemData data =3D (TransientItemData)itemState.getDat= a(); = - TransientItemData data =3D (TransientItemData)itemState.get= Data(); + WorkspaceStorageConnection conn =3D null; + if (isSystemDescendant(data.getQPath())) + { + conn =3D systemConnection =3D=3D null + // we need system connection but it's not exist + ? systemConnection =3D (systemDataContainer !=3D dataCon= tainer + // if it's different container instances + ? systemDataContainer.equals(dataContainer) && thisCo= nnection !=3D null + // but container configurations are same and non-syst= em connection open + // reuse this connection as system + ? systemDataContainer.reuseConnection(thisConnecti= on) + // or open one new system + : systemDataContainer.openConnection() + // else if it's same container instances (system and = this) + : thisConnection =3D=3D null + // and non-system connection doens't exist - open it + ? thisConnection =3D dataContainer.openConnection() + // if already open - use it + : thisConnection) + // system connection opened - use it + : systemConnection; + } + else + { + conn =3D thisConnection =3D=3D null + // we need this container connection + ? thisConnection =3D (systemDataContainer !=3D dataConta= iner + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && system= Connection !=3D null + // but container configurations are same and system c= onnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnection) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (system and = this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openConnectio= n() + // if already open - use it + : systemConnection) + // this connection opened - use it + : thisConnection; + } = - WorkspaceStorageConnection conn =3D null; - if (isSystemDescendant(data.getQPath())) - { - conn =3D systemConnection =3D=3D null - // we need system connection but it's not exist - ? systemConnection =3D (systemDataContainer !=3D data= Container - // if it's different container instances - ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null - // but container configurations are same and non-s= ystem connection open - // reuse this connection as system - ? systemDataContainer.reuseConnection(thisConne= ction) - // or open one new system - : systemDataContainer.openConnection() - // else if it's same container instances (system a= nd this) - : thisConnection =3D=3D null - // and non-system connection doens't exist - open = it - ? thisConnection =3D dataContainer.openConnecti= on() - // if already open - use it - : thisConnection) - // system connection opened - use it - : systemConnection; + data.increasePersistedVersion(); = - if (!systemConnSessionInfoAdded) - { - // TODO userId - if (!systemConnection.equals(thisConnection)) - systemConnection.addSessionInfo(currChangesLog.get= SessionId()); - systemConnSessionInfoAdded =3D true; - } - } - else - { - conn =3D thisConnection =3D=3D null - // we need this container connection - ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer - // if it's different container instances - ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null - // but container configurations are same and syste= m connection open - // reuse system connection as this - ? dataContainer.reuseConnection(systemConnectio= n) - // or open one new - : dataContainer.openConnection() - // else if it's same container instances (system a= nd this) - : systemConnection =3D=3D null - // and system connection doens't exist - open it - ? systemConnection =3D dataContainer.openConnec= tion() - // if already open - use it - : systemConnection) - // this connection opened - use it - : thisConnection; - - if (!thisConnSessionInfoAdded) - { - // TODO userId - if (!thisConnection.equals(systemConnection)) - thisConnection.addSessionInfo(currChangesLog.getSe= ssionId()); - thisConnSessionInfoAdded =3D true; - } - } - - data.increasePersistedVersion(); - - if (itemState.isAdded()) - { - doAdd(data, conn, addedNodes); - } - else if (itemState.isUpdated()) - { - doUpdate(data, conn); - } - else if (itemState.isDeleted()) - { - doDelete(data, conn); - } - else if (itemState.isRenamed()) - { - doRename(data, conn, addedNodes); - } - - if (LOG.isDebugEnabled()) - LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) - + "ms, " + data.getQPath().getAsString()); + if (itemState.isAdded()) + { + doAdd(data, conn, addedNodes); } - if (thisConnection !=3D null) - thisConnection.removeSessionInfo(); - if (systemConnection !=3D null && !systemConnection.equals(thi= sConnection)) - systemConnection.removeSessionInfo(); + else if (itemState.isUpdated()) + { + doUpdate(data, conn); + } + else if (itemState.isDeleted()) + { + doDelete(data, conn); + } + else if (itemState.isRenamed()) + { + doRename(data, conn, addedNodes); + } + + if (LOG.isDebugEnabled()) + LOG.debug(ItemState.nameFromValue(itemState.getState()) + "= " + (System.currentTimeMillis() - start) + + "ms, " + data.getQPath().getAsString()); } if (thisConnection !=3D null) thisConnection.commit(); --===============4210402158539225256==-- From do-not-reply at jboss.org Thu Nov 12 03:07:38 2009 Content-Type: multipart/mixed; boundary="===============5003665898117993920==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r576 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Thu, 12 Nov 2009 03:07:38 -0500 Message-ID: <200911120807.nAC87cL8032635@svn01.web.mwc.hst.phx2.redhat.com> --===============5003665898117993920== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-12 03:07:37 -0500 (Thu, 12 Nov 2009) New Revision: 576 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-201: remove TODO Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-12 08:06:27 UTC (rev 575) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-12 08:07:37 UTC (rev 576) @@ -130,7 +130,6 @@ = if (!systemConnSessionInfoAdded) { - // TODO userId if (!systemConnection.equals(thisConnection)) systemConnection.addSessionInfo(currChangesLog.get= SessionId()); systemConnSessionInfoAdded =3D true; @@ -159,7 +158,6 @@ = if (!thisConnSessionInfoAdded) { - // TODO userId if (!thisConnection.equals(systemConnection)) thisConnection.addSessionInfo(currChangesLog.getSe= ssionId()); thisConnSessionInfoAdded =3D true; --===============5003665898117993920==-- From do-not-reply at jboss.org Thu Nov 12 03:18:35 2009 Content-Type: multipart/mixed; boundary="===============7061299753099646421==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r577 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Thu, 12 Nov 2009 03:18:35 -0500 Message-ID: <200911120818.nAC8IZeP002265@svn01.web.mwc.hst.phx2.redhat.com> --===============7061299753099646421== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-12 03:18:35 -0500 (Thu, 12 Nov 2009) New Revision: 577 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-201: bug fix Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-12 08:07:37= UTC (rev 576) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-12 08:18:35= UTC (rev 577) @@ -22,12 +22,10 @@ import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.CacheException; -import org.jboss.cache.Fqn; import org.jboss.cache.Modification; import org.jboss.cache.Modification.ModificationType; import org.jboss.cache.factories.annotations.Inject; @@ -247,7 +245,7 @@ { if (lockManager.hasPendingLocks(nodeIdentifier)) { - System.out.println("Perform lock operation nodeIdentifier=3D" = + nodeIdentifier); + log.info("Perform lock operation nodeIdentifier=3D" + nodeIden= tifier); lockManager.internalLock(nodeIdentifier); } else @@ -297,7 +295,7 @@ { try { - System.out.println("Perform unlock operation nodeIdentifier=3D" += nodeIdentifier + " sessionId=3D" + sessionId); + log.info("Perform unlock operation nodeIdentifier=3D" + nodeIdent= ifier + " sessionId=3D" + sessionId); lockManager.internalUnLock(nodeIdentifier, sessionId); } catch (LockException e) Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-12 0= 8:07:37 UTC (rev 576) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-12 0= 8:18:35 UTC (rev 577) @@ -61,7 +61,7 @@ * @see junit.framework.TestCase#setUp() */ @Override - protected void setUp() throws Exception + public void setUp() throws Exception { // TODO Auto-generated method stub super.setUp(); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 12 08:07:37 UTC (rev 576) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 12 08:18:35 UTC (rev 577) @@ -80,7 +80,7 @@ private LocationFactory lf; = @Override - protected void setUp() throws Exception + public void setUp() throws Exception { super.setUp(); loader =3D new ObservationCacheLoader(); @@ -551,6 +551,10 @@ { } = + public void addSessionInfo(String sessionId) throws RepositoryExcept= ion + { + } + } = } --===============7061299753099646421==-- From do-not-reply at jboss.org Thu Nov 12 03:20:53 2009 Content-Type: multipart/mixed; boundary="===============7177303447872480662==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r578 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 03:20:53 -0500 Message-ID: <200911120820.nAC8KrKs002812@svn01.web.mwc.hst.phx2.redhat.com> --===============7177303447872480662== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 03:20:53 -0500 (Thu, 12 Nov 2009) New Revision: 578 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:18:35= UTC (rev 577) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:20:53= UTC (rev 578) @@ -275,25 +275,28 @@ { NodeData nodeData =3D (NodeData) modifications.get(i).getVa= lue(); itemData =3D jdbcConnection.getItemData(nodeData.getIdentif= ier()); + = + // Set oldValueData for update node + if (itemData !=3D null) = + modifications.get(i).setOldValue(itemData); } else if (modifications.get(i).getValue() instanceof PropertyDa= ta) { PropertyData propertyData =3D (PropertyData) modifications.= get(i).getValue(); itemData =3D jdbcConnection.getItemData(propertyData.getIde= ntifier()); + = + // Set oldValueData for update property + if (itemData !=3D null) = + modifications.get(i).setOldValue(itemData); } else { modifications.set(i, new ModificationEx(modifications.get(i= ))); continue; } - - // Set ModificationEx to list with type UPDATE or ADD. - if (itemData =3D=3D null) - modifications.set(i, new ModificationEx(modifications.get(i= ), JCROperaionType.ADD)); - else - modifications.set(i, new ModificationEx(modifications.get(i= ), JCROperaionType.UPDATE)); } - else + else if (modifications.get(i).getType() =3D=3D ModificationType.R= EMOVE_KEY_VALUE) { - modifications.set(i, new ModificationEx(modifications.get(i))); + (ItemData)(modifications.get(i).getValue()); + ItemData removedItemData =3D jdbcConnection.getItemData(.getId= entifier())); } } } @@ -361,12 +364,15 @@ { NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(1)); = - if (parentNodeData =3D=3D null) - throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(2) + " not exis, FQN =3D '" + name + "'."); +// if (parentNodeData =3D=3D null) +// throw new JDBCCacheLoaderException("The parent node = with ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'."); = - NodeData nodeData =3D (NodeData) conn.getItemData(parent= NodeData, nodeName); - if (nodeData !=3D null) - attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getIdent= ifier()); + if (parentNodeData !=3D null) + { + NodeData nodeData =3D (NodeData) conn.getItemData(par= entNodeData, nodeName); + if (nodeData !=3D null) + attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getI= dentifier()); + } } finally { --===============7177303447872480662==-- From do-not-reply at jboss.org Thu Nov 12 03:30:41 2009 Content-Type: multipart/mixed; boundary="===============8304774226450322201==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r579 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 03:30:41 -0500 Message-ID: <200911120830.nAC8UfiX004915@svn01.web.mwc.hst.phx2.redhat.com> --===============8304774226450322201== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 03:30:40 -0500 (Thu, 12 Nov 2009) New Revision: 579 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:20:53= UTC (rev 578) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:30:40= UTC (rev 579) @@ -88,7 +88,7 @@ */ public void put(List modifications) throws Exception { - System.out.println(modifications); + LOG.info(modifications); = // Prepare modifications list. // Will be changed Modification to ModificationEx and set operation t= ype (ADD or UPDATE). = @@ -98,38 +98,37 @@ = try { - for (int i=3D0; i --===============3043844486347993887== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 03:31:37 -0500 (Thu, 12 Nov 2009) New Revision: 580 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test base for JDBC loader Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:30:40= UTC (rev 579) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:31:37= UTC (rev 580) @@ -37,7 +37,6 @@ import org.jboss.cache.Modification.ModificationType; import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; import org.jboss.cache.factories.annotations.Inject; -import org.jboss.cache.factories.annotations.NonVolatile; import org.jboss.cache.loader.AbstractCacheLoader; = import java.util.LinkedHashMap; Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 08:3= 0:40 UTC (rev 579) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 08:3= 1:37 UTC (rev 580) @@ -18,19 +18,8 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.io.Serializable; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Properties; +import junit.framework.TestCase; = -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.sql.DataSource; - import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.config.CacheEntry; @@ -44,126 +33,83 @@ import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; -import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jcr.util.IdGenerator; -import org.jboss.cache.CacheSPI; -import org.jboss.cache.Fqn; = +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; = +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + /** * @author Alex Reshetnyak<= /a> * @version $Id$ * */ -public class JDBCCacheLoaderTest extends JBossCacheStorageConnectionTest +public class JDBCCacheLoaderTest extends TestCase { - JDBCWorkspaceDataContainer persistentContainer; - = + + private JDBCWorkspaceDataContainer persistentContainer; + + private JDBCCacheLoader loader; + /** * {@inheritDoc} */ protected void setUp() throws Exception { - try - { - super.setUp(); - } - catch (Exception e) - { - e.printStackTrace(); - throw e; - } + = + super.setUp(); + = + initPersistence(); + = + loader =3D new JDBCCacheLoader(); + loader.injectDependencies(persistentContainer); = } = - @Override - protected void initJBC() throws Exception + protected void initPersistence() throws Exception { - = - // persistence container - //WorkspaceDataContainer persistentContainer =3D new JDBCWorkspaceDa= taContainerTester(); - = // Create WorkspaceEntry ContainerEntry containerEntry =3D new ContainerEntry(); List params =3D new ArrayList(); params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); containerEntry.setParameters(params); - = + // Initialize id generator. new IdGenerator(new IDGeneratorServiceImpl()); - = + // Set system property Context.INITIAL_CONTEXT_FACTORY to initial co= ntext. = System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); - = + // Create data source. Will be created new data source to new test. = String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); createNewDataSource(dataSourceName); - = - WorkspaceEntry ws =3D getNewWs("ws_to_jbdc_cache_loader", true, data= SourceName, "/target/temp/ws_to_jbdc_cache_loader/lalues", containerEntry); - = + + WorkspaceEntry ws =3D + getNewWs("ws_to_jbdc_cache_loader", true, dataSourceName, "/targe= t/temp/ws_to_jbdc_cache_loader/lalues", + containerEntry); + RepositoryEntry re =3D new RepositoryEntry(); re.addWorkspace(ws); - = - ValueStoragePluginProvider valueStoragePluginProvider =3D new Stand= aloneStoragePluginProvider(ws); - = - persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); = - ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, - WorkspaceDataContainer.class); - } + ValueStoragePluginProvider valueStoragePluginProvider =3D new Standa= loneStoragePluginProvider(ws); = - @Override - protected void initJBCConfig() - { - jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; + persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); } - = - public void testAddNodeAndGetNode() throws Exception - { - // prepare - super.testAddNode(); - conn.commit(); - = - cache.stop(); - cache.start(); - = - Map data =3D cache.getData(Fqn.fromString("/"+= JBossCacheStorage.NODES + "/" + Constants.ROOT_UUID)); - = - = - } = - public void testAddNode() throws Exception + private WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Strin= g dsName, String vsPath, ContainerEntry entry) + throws Exception { - // prepare - super.testAddNode(); - conn.commit(); - = - // tests it - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); - = - NodeData nd =3D (NodeData) connection.getItemData("1"); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - } - = - public void testDeleteNode() throws Exception { - = - // prepare - super.testDeleteNode(); - conn.commit(); - = - // tests it - = - } - = - public WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, String= dsName, String vsPath, ContainerEntry entry) - throws Exception - { = List params =3D new ArrayList(); = @@ -176,7 +122,7 @@ if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != =3D null) { params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB= _DIALECT, entry - .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT= ))); + .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT))); } = String oldSwap =3D entry.getParameterValue("swap-directory"); @@ -185,8 +131,8 @@ params.add(new SimpleParameterEntry("swap-directory", newSwap)); = ContainerEntry containerEntry =3D - new ContainerEntry("org.exoplatform.services.jcr.impl.stora= ge.jdbc.JDBCWorkspaceDataContainer", - (ArrayList) params); + new ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdb= c.JDBCWorkspaceDataContainer", + (ArrayList)params); containerEntry.setParameters(params); = if (vsPath !=3D null) @@ -198,8 +144,7 @@ vsparams.add(filterEntry); = ValueStorageEntry valueStorageEntry =3D - new ValueStorageEntry("org.exoplatform.services.jcr.impl= .storage.value.fs.SimpleFileValueStorage", - vsparams); + new ValueStorageEntry("org.exoplatform.services.jcr.impl.stora= ge.value.fs.SimpleFileValueStorage", vsparams); ArrayList spe =3D new ArrayList(); spe.add(new SimpleParameterEntry("path", vsPath)); valueStorageEntry.setId(IdGenerator.generate()); @@ -219,10 +164,10 @@ ArrayList qParams =3D new ArrayList(); qParams.add(new SimpleParameterEntry("indexDir", "../temp/index/" + = IdGenerator.generate())); QueryHandlerEntry qEntry =3D - new QueryHandlerEntry("org.exoplatform.services.jcr.impl.co= re.query.lucene.SearchIndex", qParams); + new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.que= ry.lucene.SearchIndex", qParams); = WorkspaceEntry workspaceEntry =3D - new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.= generate(), "nt:unstructured"); + new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); workspaceEntry.setContainer(containerEntry); = ArrayList cacheParams =3D new ArrayList(); @@ -249,8 +194,8 @@ // workspaceEntry return workspaceEntry; } - = - public void createNewDataSource(String dataSourceName) throws Exception + + private void createNewDataSource(String dataSourceName) throws Exception { = Properties properties =3D new Properties(); @@ -269,12 +214,145 @@ = new InitialContext().rebind(dataSourceName, bds); } - = + private void createDatabase(DataSource ds, String dbName) throws SQLExc= eption { Connection connection =3D ds.getConnection(); PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); st.executeQuery(); } + + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D TESTS =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D + = + public void testAddNode() throws Exception + { + // prepare = + = + = + // tests + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + + NodeData nd =3D (NodeData)connection.getItemData("1"); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); + = + //Map data =3D cache.getData(Fqn.fromString("/= "+JBossCacheStorage.NODES + "/" + Constants.ROOT_UUID)); + } + + public void testAddProperty() throws Exception + { + // prepare + + // tests + + } + + public void testDeleteNode() throws Exception + { + + // prepare + + // tests it + + } + = + public void testDeleteProperty() throws Exception + { + + // prepare + + // tests it + + } + = + public void testUpdateNode() throws Exception + { + + // prepare + + // tests it + + } + = + public void testUpdateProperty() throws Exception + { + + // prepare + + // tests it + + } + = + public void testRenameNode() throws Exception + { + + // prepare + + // tests it + + } + = + public void testGetNodeByIdentifier() throws Exception + { + + // prepare + + // tests it + + } + = + public void testGetNodeByName() throws Exception + { + + // prepare + + // tests it + + } + = + public void testGetPropertyByIdentifier() throws Exception + { + + // prepare + + // tests it + + } + = + public void testGetPropertyByName() throws Exception + { + + // prepare + + // tests it + + } + = + public void testGetChildNodes() throws Exception + { + + // prepare + + // tests it + + } + = + public void testGetChildProperties() throws Exception + { + + // prepare + + // tests it + + } + = + public void testGetReferences() throws Exception + { + + // prepare + + // tests it + + } + } - --===============3043844486347993887==-- From do-not-reply at jboss.org Thu Nov 12 03:35:28 2009 Content-Type: multipart/mixed; boundary="===============2574259441337314276==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r581 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 03:35:28 -0500 Message-ID: <200911120835.nAC8ZSVb005726@svn01.web.mwc.hst.phx2.redhat.com> --===============2574259441337314276== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 03:35:27 -0500 (Thu, 12 Nov 2009) New Revision: 581 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 08:3= 1:37 UTC (rev 580) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 08:3= 5:27 UTC (rev 581) @@ -22,6 +22,7 @@ = import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; +import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.config.CacheEntry; import org.exoplatform.services.jcr.config.ContainerEntry; import org.exoplatform.services.jcr.config.LockManagerEntry; @@ -32,7 +33,13 @@ import org.exoplatform.services.jcr.config.ValueStorageEntry; import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; @@ -67,13 +74,13 @@ */ protected void setUp() throws Exception { - = + super.setUp(); - = + initPersistence(); - = + loader =3D new JDBCCacheLoader(); - loader.injectDependencies(persistentContainer); = + loader.injectDependencies(persistentContainer); } = protected void initPersistence() throws Exception @@ -221,22 +228,47 @@ PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); st.executeQuery(); } + = + = + private void initJCRRoot() throws Exception { + // prepare = + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValue1 =3D "Property value #1"; + propData1.setValue(new TransientValueData(propValue1)); + conn.add(propData1); + + // add property (/jcr:mixinTypes) + String propId2 =3D "2"; + QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); + TransientPropertyData propData2 =3D new TransientPropertyData(propPa= th2, propId2, 1, 1, Constants.ROOT_UUID, false); + String propValue2 =3D "Property value #2"; + propData2.setValue(new TransientValueData(propValue2)); + conn.add(propData2); + + conn.commit(); + } + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D TESTS =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D - = + public void testAddNode() throws Exception { - // prepare = + // prepare + initJCRRoot(); = = // tests - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = - NodeData nd =3D (NodeData)connection.getItemData("1"); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - = - //Map data =3D cache.getData(Fqn.fromString("/= "+JBossCacheStorage.NODES + "/" + Constants.ROOT_UUID)); + //??? Map data =3D cache.getData(Fqn.fromStrin= g("/"+JBossCacheStorage.NODES + "/" + Constants.ROOT_UUID)); } = public void testAddProperty() throws Exception @@ -255,7 +287,7 @@ // tests it = } - = + public void testDeleteProperty() throws Exception { = @@ -264,7 +296,7 @@ // tests it = } - = + public void testUpdateNode() throws Exception { = @@ -273,7 +305,7 @@ // tests it = } - = + public void testUpdateProperty() throws Exception { = @@ -282,7 +314,7 @@ // tests it = } - = + public void testRenameNode() throws Exception { = @@ -291,7 +323,7 @@ // tests it = } - = + public void testGetNodeByIdentifier() throws Exception { = @@ -300,7 +332,7 @@ // tests it = } - = + public void testGetNodeByName() throws Exception { = @@ -309,7 +341,7 @@ // tests it = } - = + public void testGetPropertyByIdentifier() throws Exception { = @@ -318,7 +350,7 @@ // tests it = } - = + public void testGetPropertyByName() throws Exception { = @@ -327,7 +359,7 @@ // tests it = } - = + public void testGetChildNodes() throws Exception { = @@ -336,7 +368,7 @@ // tests it = } - = + public void testGetChildProperties() throws Exception { = @@ -345,7 +377,7 @@ // tests it = } - = + public void testGetReferences() throws Exception { = --===============2574259441337314276==-- From do-not-reply at jboss.org Thu Nov 12 03:40:48 2009 Content-Type: multipart/mixed; boundary="===============4877042564307746895==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r582 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 03:40:48 -0500 Message-ID: <200911120840.nAC8emEX006590@svn01.web.mwc.hst.phx2.redhat.com> --===============4877042564307746895== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 03:40:48 -0500 (Thu, 12 Nov 2009) New Revision: 582 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:35:27= UTC (rev 581) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 08:40:48= UTC (rev 582) @@ -264,23 +264,24 @@ = for (int i =3D 0; i < modifications.size(); i++) { - if (modifications.get(i).getType() =3D=3D ModificationType.PUT_KE= Y_VALUE) + Modification m =3D modifications.get(i); + if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) { ItemData itemData =3D null; = //Check add or update node data. - if (modifications.get(i).getValue() instanceof NodeData) + if (m.getValue() instanceof NodeData) { - NodeData nodeData =3D (NodeData) modifications.get(i).getVa= lue(); + NodeData nodeData =3D (NodeData) m.getValue(); itemData =3D jdbcConnection.getItemData(nodeData.getIdentif= ier()); = // Set oldValueData for update node. if (itemData !=3D null) = modifications.get(i).setOldValue(itemData); } - else if (modifications.get(i).getValue() instanceof PropertyDa= ta) + else if (m.getValue() instanceof PropertyData) { - PropertyData propertyData =3D (PropertyData) modifications.= get(i).getValue(); + PropertyData propertyData =3D (PropertyData) m.getValue(); itemData =3D jdbcConnection.getItemData(propertyData.getIde= ntifier()); = // Set oldValueData for update property. @@ -288,14 +289,17 @@ modifications.get(i).setOldValue(itemData); } = } - else if (modifications.get(i).getType() =3D=3D ModificationType.R= EMOVE_NODE) + else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) { - if (modifications.get(i).getValue() instanceof ItemData) { - String id =3D ((ItemData) (modifications.get(i).getValue())= ).getIdentifier(); + if (m.getFqn().size() =3D=3D 2 + && (m.getFqn().get(1).equals(JBossCacheStorage.NODES) = + || m.getFqn().get(1).equals(JBossCacheStorage.PROPS))) + { + String id =3D (String) m.getFqn().get(1); ItemData removedItemData =3D jdbcConnection.getItemData(id); - = + // Set valueData for update property or node. - if (removedItemData !=3D null) = + if (removedItemData !=3D null) modifications.get(i).setValue(removedItemData); } } --===============4877042564307746895==-- From do-not-reply at jboss.org Thu Nov 12 04:04:27 2009 Content-Type: multipart/mixed; boundary="===============4645991428011761635==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r583 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 04:04:27 -0500 Message-ID: <200911120904.nAC94RIB010563@svn01.web.mwc.hst.phx2.redhat.com> --===============4645991428011761635== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 04:04:27 -0500 (Thu, 12 Nov 2009) New Revision: 583 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java Log: EXOJCR-201: test svn:Id Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-12 = 08:40:48 UTC (rev 582) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-12 = 09:04:27 UTC (rev 583) @@ -33,7 +33,7 @@ * This abstract class contains only methods for creating a fake {@link Mo= dification} instances. It doesn't use real cache. * = * @author Nikolay Zamosenchuk - * @version $Id: AbstractCacheLoaderClass.java 34360 2009-07-22 23:58:59Z = aheritier $ + * @version $Id$ * */ public abstract class AbstractCacheLoaderTest extends TestCase Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest= .java ___________________________________________________________________ Name: svn:keywords + Id --===============4645991428011761635==-- From do-not-reply at jboss.org Thu Nov 12 04:07:01 2009 Content-Type: multipart/mixed; boundary="===============8032338457019009992==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r584 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Thu, 12 Nov 2009 04:07:01 -0500 Message-ID: <200911120907.nAC971us011207@svn01.web.mwc.hst.phx2.redhat.com> --===============8032338457019009992== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 04:07:00 -0500 (Thu, 12 Nov 2009) New Revision: 584 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 09:04:27= UTC (rev 583) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 09:07:00= UTC (rev 584) @@ -252,7 +252,7 @@ /** * Prepare list of modifications. * = - * Will be checked the UPDATE or ADD. + * Will be checked the UPDATE, ADD, REMOVE. * = * @param modifications * @throws RepositoryException Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:0= 4:27 UTC (rev 583) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:0= 7:00 UTC (rev 584) @@ -62,7 +62,7 @@ * @version $Id$ * */ -public class JDBCCacheLoaderTest extends TestCase +public class JDBCCacheLoaderTest extends AbstractCacheLoaderTest { = private JDBCWorkspaceDataContainer persistentContainer; @@ -72,7 +72,7 @@ /** * {@inheritDoc} */ - protected void setUp() throws Exception + public void setUp() throws Exception { = super.setUp(); --===============8032338457019009992==-- From do-not-reply at jboss.org Thu Nov 12 04:09:43 2009 Content-Type: multipart/mixed; boundary="===============9055139546334199693==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r585 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 04:09:43 -0500 Message-ID: <200911120909.nAC99hVR011462@svn01.web.mwc.hst.phx2.redhat.com> --===============9055139546334199693== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-12 04:09:42 -0500 (Thu, 12 Nov 2009) New Revision: 585 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-205: remove unecessary code, rename methods Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-12 = 09:07:00 UTC (rev 584) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-12 = 09:09:42 UTC (rev 585) @@ -39,8 +39,6 @@ public abstract class AbstractCacheLoaderTest extends TestCase { = - protected static boolean addPUTDATA =3D true; - public void setUp() throws Exception { super.setUp(); @@ -70,16 +68,14 @@ "/" + JBossCacheStorage.NODES + "/" + data.getParentIdentifier= () + "/" + data.getQPath().getEntries()[data.getQPath().getEntries()= .length - 1].getAsString(); // Fire modification child added - if (addPUTDATA) - list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromS= tring(childFqn))); + list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromStri= ng(childFqn))); // add modification that value is written by key ITEM_ID list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fro= mString(childFqn), JBossCacheStorage.ITEM_ID, data.getIdentifier())); } String nodeFqn =3D "/" + JBossCacheStorage.NODES + "/" + data.getIde= ntifier(); // add PUT_DATA modification - if (addPUTDATA) - list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromStri= ng(nodeFqn))); + list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromString(= nodeFqn))); = list.add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromSt= ring(nodeFqn), JBossCacheStorage.ITEM_DATA, data)); @@ -133,8 +129,7 @@ = String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); // add modification PUT_DATA if enabled = - if (addPUTDATA) - list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromStri= ng(fqn))); + list.add(new Modification(ModificationType.PUT_DATA, Fqn.fromString(= fqn))); // put property data list .add(new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromStr= ing(fqn), JBossCacheStorage.ITEM_DATA, data)); @@ -201,7 +196,7 @@ * @param userId * @return */ - public List setSession(String sessionId, String userId) + public List addSessionInfo(String sessionId, String userI= d) { List list =3D new ArrayList(); // add SessionID by the key SESSION_ID @@ -221,7 +216,7 @@ * = * @return */ - public List removeSession() + public List removeSessionInfo() { List list =3D new ArrayList(); list.add(new Modification(ModificationType.REMOVE_DATA, Fqn.fromStri= ng("/" + JBossCacheStorage.SESSION))); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-12 09:0= 7:00 UTC (rev 584) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-12 09:0= 9:42 UTC (rev 585) @@ -105,10 +105,10 @@ = lockManager.addPendingLock(nodeIdentifier, new LockData(nodeIdentifi= er, "token", false, false, "__system", -1)); = - modifications.addAll(setSession(sessionId, "userId")); + modifications.addAll(addSessionInfo(sessionId, "userId")); modifications.addAll(addProperty(lockIsDeepData)); modifications.addAll(addProperty(lockOwnerData)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); lockCacheLoader.put(modifications); = assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); @@ -132,10 +132,10 @@ TransientValueData lockOwner =3D new TransientValueData("__system"); lockOwnerData.setValue(lockOwner); = - modifications.addAll(setSession(sessionId, "userId")); + modifications.addAll(addSessionInfo(sessionId, "userId")); modifications.addAll(removeProperty(lockIsDeepData)); modifications.addAll(removeProperty(lockOwnerData)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); lockCacheLoader.put(modifications); = assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); @@ -153,9 +153,9 @@ = lockManager.addLock(nodeIdentifier, new LockData(nodeIdentifier, "to= ken", false, false, "__system", -1)); = - modifications.addAll(setSession(sessionId, "userId")); + modifications.addAll(addSessionInfo(sessionId, "userId")); modifications.addAll(addNode(node)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); lockCacheLoader.put(modifications); = assertNull(lockManager.getNodeIdentifier()); @@ -173,9 +173,9 @@ = lockManager.addLock(nodeIdentifier, new LockData(nodeIdentifier, "to= ken", false, false, "__system", -1)); = - modifications.addAll(setSession(sessionId, "userId")); + modifications.addAll(addSessionInfo(sessionId, "userId")); modifications.addAll(removeNode(node)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); lockCacheLoader.put(modifications); = assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 12 09:07:00 UTC (rev 584) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 12 09:09:42 UTC (rev 585) @@ -130,9 +130,9 @@ registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, null, true, new String[]{Constants.ROOT_UUID}, null, false, "session1")); = - List modifications =3D new ArrayList(set= Session("session1", "admin")); + List modifications =3D new ArrayList(add= SessionInfo("session1", "admin")); modifications.addAll(addNode(newNode)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); loader.put(modifications); assertEquals(1, listener.eventList.size()); Event event =3D listener.eventList.get(0); @@ -151,9 +151,9 @@ registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= ADDED, lf.parseAbsPath("/").getInternalPath(), true, null, null, false, = "session1")); = - List modifications =3D new ArrayList(set= Session("session1", "admin")); + List modifications =3D new ArrayList(add= SessionInfo("session1", "admin")); modifications.addAll(addNode(newNode)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); loader.put(modifications); = assertEvent(Event.NODE_ADDED, node1path, listener, "admin"); @@ -169,9 +169,9 @@ registry.addEventListener(listener, new ListenerCriteria(Event.NODE_= REMOVED, lf.parseAbsPath("/") .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(set= Session("session1", "admin")); + List modifications =3D new ArrayList(add= SessionInfo("session1", "admin")); modifications.addAll(removeNode(newNode)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); loader.put(modifications); = assertEvent(Event.NODE_REMOVED, node1path, listener, "admin"); @@ -187,9 +187,9 @@ registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_ADDED, lf.parseAbsPath("/") .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(set= Session("session1", "admin")); + List modifications =3D new ArrayList(add= SessionInfo("session1", "admin")); modifications.addAll(addProperty(newProperty)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); loader.put(modifications); = assertEvent(Event.PROPERTY_ADDED, prop1path, listener, "admin"); @@ -205,9 +205,9 @@ registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_CHANGED, lf.parseAbsPath("/") .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(set= Session("session1", "admin")); + List modifications =3D new ArrayList(add= SessionInfo("session1", "admin")); modifications.addAll(updateProperty(newProperty)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); loader.put(modifications); = assertEvent(Event.PROPERTY_CHANGED, prop1path, listener, "admin"); @@ -223,9 +223,9 @@ registry.addEventListener(listener, new ListenerCriteria(Event.PROPE= RTY_REMOVED, lf.parseAbsPath("/") .getInternalPath(), true, null, null, false, "session1")); = - List modifications =3D new ArrayList(set= Session("session1", "admin")); + List modifications =3D new ArrayList(add= SessionInfo("session1", "admin")); modifications.addAll(removeProperty(newProperty)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); loader.put(modifications); = assertEvent(Event.PROPERTY_REMOVED, prop1path, listener, "admin"); @@ -274,10 +274,10 @@ lf.parseAbsPath("/").getInternalPath(), true, null, new InternalQ= Name[]{Constants.NT_RESOURCE}, false, "session1")); = - List modifications =3D new ArrayList(set= Session("session1", "admin")); + List modifications =3D new ArrayList(add= SessionInfo("session1", "admin")); modifications.addAll(addNode(childNode1)); modifications.addAll(addNode(childNode2)); - modifications.addAll(removeSession()); + modifications.addAll(removeSessionInfo()); loader.put(modifications); // one event expected assertEvent(Event.NODE_ADDED, child2path, listener, "admin"); --===============9055139546334199693==-- From do-not-reply at jboss.org Thu Nov 12 04:28:28 2009 Content-Type: multipart/mixed; boundary="===============3528736003799864587==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r586 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 04:28:28 -0500 Message-ID: <200911120928.nAC9SS4r015278@svn01.web.mwc.hst.phx2.redhat.com> --===============3528736003799864587== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 04:28:28 -0500 (Thu, 12 Nov 2009) New Revision: 586 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:0= 9:42 UTC (rev 585) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:2= 8:28 UTC (rev 586) @@ -18,8 +18,17 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import junit.framework.TestCase; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; = +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.access.AccessControlList; @@ -34,8 +43,9 @@ import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; @@ -45,18 +55,8 @@ import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jcr.util.IdGenerator; +import org.jboss.cache.Modification; = -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.sql.DataSource; - /** * @author Alex Reshetnyak<= /a> * @version $Id$ @@ -274,9 +274,37 @@ public void testAddProperty() throws Exception { // prepare + initJCRRoot(); + = + String propId =3D IdGenerator.generate(); + QPath propPath =3D QPath.makeChildPath(Constants.ROOT_PATH, Constant= s.JCR_DATA); + TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, Constants.ROOT_UUID, false); + String propValue =3D "JCR DATA VALUE"; + propData.setValue(new TransientValueData(propValue)); + = + List modifications =3D new ArrayList(); + = + modifications.addAll(addProperty(propData)); + = + loader.put(modifications); = // tests - + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + = + PropertyData destPropData =3D (PropertyData) connection.getItemData(= propId); + = + assertNotNull(destPropData); + assertEquals(propData.getIdentifier(), destPropData.getIdentifier()); + assertEquals(propData.getParentIdentifier(), destPropData.getParentI= dentifier()); + assertEquals(propData.getPersistedVersion(), destPropData.getPersist= edVersion()); + assertEquals(propData.getType(), destPropData.getType()); + assertEquals(propData.getQPath(), destPropData.getQPath()); + assertEquals(propData.getValues().size(), destPropData.getValues().s= ize()); + assertEquals(1, destPropData.getValues().size()); + = + ValueData valueData =3D destPropData.getValues().get(0); + assertEquals("JCR DATA VALUE", new String (valueData.getAsByteArray(= ), "UTF-8")); + = } = public void testDeleteNode() throws Exception --===============3528736003799864587==-- From do-not-reply at jboss.org Thu Nov 12 04:45:00 2009 Content-Type: multipart/mixed; boundary="===============0104447643742611826==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r587 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 04:45:00 -0500 Message-ID: <200911120945.nAC9j0qI017998@svn01.web.mwc.hst.phx2.redhat.com> --===============0104447643742611826== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 04:44:59 -0500 (Thu, 12 Nov 2009) New Revision: 587 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for JDBC loader Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:2= 8:28 UTC (rev 586) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:4= 4:59 UTC (rev 587) @@ -18,17 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.sql.DataSource; - import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.access.AccessControlList; @@ -57,6 +46,18 @@ import org.exoplatform.services.jcr.util.IdGenerator; import org.jboss.cache.Modification; = +import java.io.InputStream; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + /** * @author Alex Reshetnyak<= /a> * @version $Id$ @@ -228,33 +229,94 @@ PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); st.executeQuery(); } - = - = - private void initJCRRoot() throws Exception { + + private void initJCRRoot() throws Exception + { // prepare = WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + // add root (/) with jcr:primaryType + addNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.NT= _UNSTRUCTURED); + + // add property (/jcr:mixinTypes) + List mixins =3D new ArrayList(); + mixins.add(Constants.MIX_REFERENCEABLE); + mixins.add(Constants.EXO_PRIVILEGEABLE); + mixins.add(Constants.EXO_OWNEABLE); + addProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constant= s.JCR_MIXINTYPES, mixins, true); + + conn.commit(); + } + + /** + * Add Property to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param root QPath + * @param nodeId String + * @param primaryType InternalQName + * @throws Exception + */ + private void addNode(WorkspaceStorageConnection conn, QPath root, Strin= g nodeId, InternalQName primaryType) + throws Exception + { // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, null, new AccessControlList())); + conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, null, + new AccessControlList())); = // add property (/jcr:primaryType) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); - String propValue1 =3D "Property value #1"; - propData1.setValue(new TransientValueData(propValue1)); - conn.add(propData1); + addProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARYTY= PE, primaryType, false); + } = - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); - TransientPropertyData propData2 =3D new TransientPropertyData(propPa= th2, propId2, 1, 1, Constants.ROOT_UUID, false); - String propValue2 =3D "Property value #2"; - propData2.setValue(new TransientValueData(propValue2)); - conn.add(propData2); + /** + * Add Property to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param nodePath QPath + * @param nodeId String + * @param propertyName InternalQName + * @param propertyValue Object + * @return TransientPropertyData + * @throws Exception + */ + private TransientPropertyData addProperty(WorkspaceStorageConnection co= nn, QPath nodePath, String nodeId, + InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception + { + String propId =3D IdGenerator.generate(); + QPath propPath =3D QPath.makeChildPath(Constants.ROOT_PATH, Constant= s.JCR_MIXINTYPES); + TransientPropertyData propData =3D + new TransientPropertyData(propPath, propId, 1, 1, Constants.ROOT_= UUID, multiValued); = - conn.commit(); + List values =3D new ArrayList(); + if (multiValued) + { + if (propertyValue instanceof List) + { + values.addAll((List)propertyValue); + } + else + throw new Exception("propertyValue should be a List"); + } + + for (Object value : values) + { + if (value instanceof InternalQName) + { + propData.setValue(new TransientValueData((InternalQName)value)= ); + } + else if (value instanceof String) + { + propData.setValue(new TransientValueData((String)value)); + } + else if (value instanceof InputStream) + { + propData.setValue(new TransientValueData((InputStream)value)); + } + } + + conn.add(propData); + + return propData; } = // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D TESTS =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D @@ -263,8 +325,7 @@ { // prepare initJCRRoot(); - = - = + // tests WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = --===============0104447643742611826==-- From do-not-reply at jboss.org Thu Nov 12 04:49:39 2009 Content-Type: multipart/mixed; boundary="===============4819692388379540306==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r588 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 04:49:39 -0500 Message-ID: <200911120949.nAC9ndQr018780@svn01.web.mwc.hst.phx2.redhat.com> --===============4819692388379540306== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 04:49:39 -0500 (Thu, 12 Nov 2009) New Revision: 588 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for JDBC loader Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:4= 4:59 UTC (rev 587) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:4= 9:39 UTC (rev 588) @@ -236,14 +236,14 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.NT= _UNSTRUCTURED); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); mixins.add(Constants.MIX_REFERENCEABLE); mixins.add(Constants.EXO_PRIVILEGEABLE); mixins.add(Constants.EXO_OWNEABLE); - addProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constant= s.JCR_MIXINTYPES, mixins, true); + addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); = conn.commit(); } @@ -257,7 +257,7 @@ * @param primaryType InternalQName * @throws Exception */ - private void addNode(WorkspaceStorageConnection conn, QPath root, Strin= g nodeId, InternalQName primaryType) + private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType) throws Exception { // add root (/) @@ -265,7 +265,7 @@ new AccessControlList())); = // add property (/jcr:primaryType) - addProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARYTY= PE, primaryType, false); + addDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARY= TYPE, primaryType, false); } = /** @@ -279,7 +279,7 @@ * @return TransientPropertyData * @throws Exception */ - private TransientPropertyData addProperty(WorkspaceStorageConnection co= nn, QPath nodePath, String nodeId, + private TransientPropertyData addDbProperty(WorkspaceStorageConnection = conn, QPath nodePath, String nodeId, InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception { String propId =3D IdGenerator.generate(); --===============4819692388379540306==-- From do-not-reply at jboss.org Thu Nov 12 05:02:32 2009 Content-Type: multipart/mixed; boundary="===============4664199068327274991==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r589 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 05:02:32 -0500 Message-ID: <200911121002.nACA2WD8021896@svn01.web.mwc.hst.phx2.redhat.com> --===============4664199068327274991== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 05:02:31 -0500 (Thu, 12 Nov 2009) New Revision: 589 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 09:4= 9:39 UTC (rev 588) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 10:0= 2:31 UTC (rev 589) @@ -44,6 +44,7 @@ import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jcr.util.IdGenerator; +import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = import java.io.InputStream; @@ -52,6 +53,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Properties; = import javax.naming.Context; @@ -283,9 +285,9 @@ InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception { String propId =3D IdGenerator.generate(); - QPath propPath =3D QPath.makeChildPath(Constants.ROOT_PATH, Constant= s.JCR_MIXINTYPES); + QPath propPath =3D QPath.makeChildPath(nodePath, propertyName); TransientPropertyData propData =3D - new TransientPropertyData(propPath, propId, 1, 1, Constants.ROOT_= UUID, multiValued); + new TransientPropertyData(propPath, propId, 1, 1, nodeId, multiVa= lued); = List values =3D new ArrayList(); if (multiValued) @@ -337,22 +339,21 @@ // prepare initJCRRoot(); = - String propId =3D IdGenerator.generate(); - QPath propPath =3D QPath.makeChildPath(Constants.ROOT_PATH, Constant= s.JCR_DATA); - TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, Constants.ROOT_UUID, false); - String propValue =3D "JCR DATA VALUE"; - propData.setValue(new TransientValueData(propValue)); + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); = + TransientPropertyData propData =3D addDbProperty(connection, Constan= ts.ROOT_PATH, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", fa= lse); + connection.commit(); + = List modifications =3D new ArrayList(); = modifications.addAll(addProperty(propData)); = loader.put(modifications); = - // tests - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + // tests it + connection =3D persistentContainer.openConnection(); = - PropertyData destPropData =3D (PropertyData) connection.getItemData(= propId); + PropertyData destPropData =3D (PropertyData) connection.getItemData(= propData.getIdentifier()); = assertNotNull(destPropData); assertEquals(propData.getIdentifier(), destPropData.getIdentifier()); @@ -435,9 +436,30 @@ { = // prepare + initJCRRoot(); + = + String propId =3D IdGenerator.generate(); + QPath propPath =3D QPath.makeChildPath(Constants.ROOT_PATH, Constant= s.JCR_DATA); + TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, Constants.ROOT_UUID, false); + String propValue =3D "JCR DATA VALUE"; + propData.setValue(new TransientValueData(propValue)); + = + List modifications =3D new ArrayList(); + = + modifications.addAll(addProperty(propData)); + = + loader.put(modifications); = // tests it + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + = + PropertyData destPropData =3D (PropertyData) connection.getItemData(= propId); + = + Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.PROPS + "/" + propId)); + = + assertNotNull(attrebutes); = + } = public void testGetPropertyByName() throws Exception --===============4664199068327274991==-- From do-not-reply at jboss.org Thu Nov 12 05:06:18 2009 Content-Type: multipart/mixed; boundary="===============3147289146120422148==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r590 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 05:06:18 -0500 Message-ID: <200911121006.nACA6IIC022771@svn01.web.mwc.hst.phx2.redhat.com> --===============3147289146120422148== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 05:06:18 -0500 (Thu, 12 Nov 2009) New Revision: 590 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for JDBC loader Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 10:0= 2:31 UTC (rev 589) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 10:0= 6:18 UTC (rev 590) @@ -84,6 +84,8 @@ = loader =3D new JDBCCacheLoader(); loader.injectDependencies(persistentContainer); + = + initJCRRoot(); } = protected void initPersistence() throws Exception @@ -326,7 +328,6 @@ public void testAddNode() throws Exception { // prepare - initJCRRoot(); = // tests WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); @@ -337,8 +338,6 @@ public void testAddProperty() throws Exception { // prepare - initJCRRoot(); - = WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); = TransientPropertyData propData =3D addDbProperty(connection, Constan= ts.ROOT_PATH, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", fa= lse); --===============3147289146120422148==-- From do-not-reply at jboss.org Thu Nov 12 05:27:15 2009 Content-Type: multipart/mixed; boundary="===============8183443041749811354==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r591 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 05:27:14 -0500 Message-ID: <200911121027.nACAREDZ026843@svn01.web.mwc.hst.phx2.redhat.com> --===============8183443041749811354== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 05:27:14 -0500 (Thu, 12 Nov 2009) New Revision: 591 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for JDBC loader Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 10:0= 6:18 UTC (rev 590) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 10:2= 7:14 UTC (rev 591) @@ -87,7 +87,20 @@ = initJCRRoot(); } + = + = = + @Override + protected void tearDown() throws Exception + { + // delete all in DB + = + = + super.tearDown(); + } + + + protected void initPersistence() throws Exception { // Create WorkspaceEntry @@ -122,7 +135,6 @@ private WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Strin= g dsName, String vsPath, ContainerEntry entry) throws Exception { - List params =3D new ArrayList(); = params.add(new SimpleParameterEntry("sourceName", dsName)); @@ -149,7 +161,6 @@ = if (vsPath !=3D null) { - ArrayList vsparams =3D new ArrayList(); ValueStorageFilterEntry filterEntry =3D new ValueStorageFilterEnt= ry(); filterEntry.setPropertyType("Binary"); @@ -169,47 +180,44 @@ list.add(valueStorageEntry); = containerEntry.setValueStorages(list); - } - - // Indexer - ArrayList qParams =3D new ArrayList(); - qParams.add(new SimpleParameterEntry("indexDir", "../temp/index/" + = IdGenerator.generate())); - QueryHandlerEntry qEntry =3D - new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.que= ry.lucene.SearchIndex", qParams); - + = WorkspaceEntry workspaceEntry =3D new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); workspaceEntry.setContainer(containerEntry); = - ArrayList cacheParams =3D new ArrayList(); +// // Indexer +// ArrayList qParams =3D new ArrayList(); +// qParams.add(new SimpleParameterEntry("indexDir", "../temp/index/" = + IdGenerator.generate())); +// QueryHandlerEntry qEntry =3D +// new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.q= uery.lucene.SearchIndex", qParams); +// workspaceEntry.setQueryHandler(qEntry); +// +// // cache +// ArrayList cacheParams =3D new ArrayList(); +// cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); +// cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); +// CacheEntry cacheEntry =3D new CacheEntry(cacheParams); +// cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.per= sistent.LinkedWorkspaceStorageCacheImpl"); +// workspaceEntry.setCache(cacheEntry); +// = +// // lock +// LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); +// lockManagerEntry.setTimeout(900000); +// LockPersisterEntry persisterEntry =3D new LockPersisterEntry(); +// persisterEntry.setType("org.exoplatform.services.jcr.impl.core.loc= k.FileSystemLockPersister"); +// ArrayList lpParams =3D new ArrayList(); +// lpParams.add(new SimpleParameterEntry("path", "../temp/lock")); +// persisterEntry.setParameters(lpParams); +// lockManagerEntry.setPersister(persisterEntry); +// workspaceEntry.setLockManager(lockManagerEntry); = - cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); - cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); - CacheEntry cacheEntry =3D new CacheEntry(cacheParams); - cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persi= stent.LinkedWorkspaceStorageCacheImpl"); - - workspaceEntry.setCache(cacheEntry); - - workspaceEntry.setQueryHandler(qEntry); - - LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); - lockManagerEntry.setTimeout(900000); - LockPersisterEntry persisterEntry =3D new LockPersisterEntry(); - persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.= FileSystemLockPersister"); - ArrayList lpParams =3D new ArrayList(); - lpParams.add(new SimpleParameterEntry("path", "../temp/lock")); - persisterEntry.setParameters(lpParams); - lockManagerEntry.setPersister(persisterEntry); - workspaceEntry.setLockManager(lockManagerEntry); - // workspaceEntry return workspaceEntry; } = private void createNewDataSource(String dataSourceName) throws Exception { - Properties properties =3D new Properties(); = properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); @@ -251,7 +259,25 @@ = conn.commit(); } + = + private void deleteJCRRoot() throws Exception + { + // prepare = + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + // add root (/) with jcr:primaryType + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); + + // add property (/jcr:mixinTypes) + List mixins =3D new ArrayList(); + mixins.add(Constants.MIX_REFERENCEABLE); + mixins.add(Constants.EXO_PRIVILEGEABLE); + mixins.add(Constants.EXO_OWNEABLE); + addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); + + conn.commit(); + } + /** * Add Property to the connection but doesn't save it. * @@ -322,6 +348,26 @@ = return propData; } + = + /** + * Delete Property to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param root QPath + * @param nodeId String + * @param primaryType InternalQName + * @throws Exception + */ + private void deleteDbNode(WorkspaceStorageConnection conn, QPath root, = String nodeId, InternalQName primaryType) + throws Exception + { + // add property (/jcr:primaryType) + addDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARY= TYPE, primaryType, false); + = + // add root (/) + conn.delete(new TransientNodeData(root, nodeId, 1, primaryType, new = InternalQName[0], 0, null, + new AccessControlList())); + } = // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D TESTS =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D = --===============8183443041749811354==-- From do-not-reply at jboss.org Thu Nov 12 05:37:10 2009 Content-Type: multipart/mixed; boundary="===============8340120947697984282==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r592 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 05:37:10 -0500 Message-ID: <200911121037.nACAbAam028491@svn01.web.mwc.hst.phx2.redhat.com> --===============8340120947697984282== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 05:37:10 -0500 (Thu, 12 Nov 2009) New Revision: 592 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 10:2= 7:14 UTC (rev 591) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 10:3= 7:10 UTC (rev 592) @@ -327,6 +327,10 @@ else throw new Exception("propertyValue should be a List"); } + else + { + values.add(propertyValue); + } = for (Object value : values) { @@ -386,7 +390,7 @@ // prepare WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); = - TransientPropertyData propData =3D addDbProperty(connection, Constan= ts.ROOT_PATH, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", fa= lse); + TransientPropertyData propData =3D addDbProperty(connection, Constan= ts.ROOT_PATH, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", f= alse); connection.commit(); = List modifications =3D new ArrayList(); --===============8340120947697984282==-- From do-not-reply at jboss.org Thu Nov 12 06:14:24 2009 Content-Type: multipart/mixed; boundary="===============5219364387397261652==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r593 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 06:14:24 -0500 Message-ID: <200911121114.nACBEOCD003955@svn01.web.mwc.hst.phx2.redhat.com> --===============5219364387397261652== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-12 06:14:23 -0500 (Thu, 12 Nov 2009) New Revision: 593 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java Log: EXOJCR-202: IndexerCacheLoaderRuntimeTest added Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-12 11:14:23 UTC (rev 593) @@ -0,0 +1,397 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.apache.commons.dbcp.BasicDataSourceFactory; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.TermQuery; +import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.container.configuration.ConfigurationManagerImpl; +import org.exoplatform.services.document.DocumentReaderService; +import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.config.CacheEntry; +import org.exoplatform.services.jcr.config.ContainerEntry; +import org.exoplatform.services.jcr.config.LockManagerEntry; +import org.exoplatform.services.jcr.config.LockPersisterEntry; +import org.exoplatform.services.jcr.config.QueryHandlerEntry; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.SimpleParameterEntry; +import org.exoplatform.services.jcr.config.ValueStorageEntry; +import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; +import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManager= Impl; +import org.exoplatform.services.jcr.impl.core.nodetype.registration.JcrNod= eTypeDataPersister; +import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTy= peDataPersister; +import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; +import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.SearchManagerImpl; +import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; +import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.impl.dataflow.persistent.JBossCacheWor= kspaceDataManager; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; +import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; +import org.exoplatform.services.jcr.util.IdGenerator; +import org.jboss.cache.Cache; +import org.jboss.cache.CacheSPI; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; + +import java.io.Serializable; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import javax.jcr.PropertyType; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author Karpenko Sergiy = + * @version $Id: IndexerCacheLoaderRuntimeTest.java 111 2008-11-11 11:11:1= 1Z serg $ + */ +public class IndexerCacheLoaderRuntimeTest extends TestCase +{ + + protected JBossCacheStorageConnection conn; + + protected Cache cache; + + protected Node nodes; + + protected Node props; + + protected Node session; + + protected String jbcConfig; + + JDBCWorkspaceDataContainer persistentContainer; + + SearchManager manager; + + /** + * {@inheritDoc} + */ + protected void setUp() throws Exception + { + try + { + super.setUp(); + + // JBossCache = + initJBCConfig(); + + cache =3D new DefaultCacheFactory().createC= ache(jbcConfig, false); + + initJBC(); + + // run cache + cache.create(); + cache.start(); + + Node cacheRoot =3D cache.getRoot(); + + // prepare cache structures + + nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NOD= ES)); + props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PRO= PS)); + session =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.S= ESSION)); + + // JCR connection + conn =3D new JBossCacheStorageConnection(cache, nodes, props, ses= sion); + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROO= T_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + String propId1 =3D "rootf111111"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Cons= tants.JCR_PRIMARYTYPE); + TransientPropertyData propData1 =3D + new TransientPropertyData(propPath1, propId1, 1, PropertyType.= NAME, Constants.ROOT_UUID, false); + propData1.setValue(new TransientValueData(Constants.NT_UNSTRUCTUR= ED)); + conn.add(propData1); + + conn.commit(); + ((SearchManagerImpl)manager).start(); + } + catch (Exception e) + { + e.printStackTrace(); + throw e; + } + } + + /** + * {@inheritDoc} + */ + // protected void tearDown() throws Exception + // { + // + // cache.stop(); + // cache.destroy(); + // + // super.tearDown(); + // } + + protected void initJBC() throws Exception + { + + // Create WorkspaceEntry + ContainerEntry containerEntry =3D new ContainerEntry(); + List params =3D new ArrayList(); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); + containerEntry.setParameters(params); + + // Initialize id generator. + new IdGenerator(new IDGeneratorServiceImpl()); + + // Set system property Context.INITIAL_CONTEXT_FACTORY to initial co= ntext. = + System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); + + // Create data source. Will be created new data source to new test. = + String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); + createNewDataSource(dataSourceName); + + WorkspaceEntry ws =3D + getNewWs("ws_to_jbdc_cache_loader", true, dataSourceName, "/targe= t/temp/ws_to_jbdc_cache_loader/values", + containerEntry); + + RepositoryEntry re =3D new RepositoryEntry(); + re.addWorkspace(ws); + + ValueStoragePluginProvider valueStoragePluginProvider =3D new Standa= loneStoragePluginProvider(ws); + + persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); + + persistentContainer.start(); + + NamespaceRegistryImpl nsReg =3D new NamespaceRegistryImpl(); + nsReg.start(); + SystemDataContainerHolder systemDataContaine= rHolder =3D + new SystemDataContainerHolder(persistentContainer); + + WorkspacePersistentDataManager itemMgr =3D + new JBossCacheWorkspaceDataManager(persistentContainer, systemDat= aContainerHolder); + + RepositoryIndexSearcherHolder indexSearcherHolder =3D new Repository= IndexSearcherHolder(); + + NodeTypeDataPersister persister =3D new JcrNodeTypeDataPersister(ite= mMgr, false); + NodeTypeDataManager ntReg =3D + new NodeTypeDataManagerImpl(re, new LocationFactory(nsReg), nsReg= , persister, itemMgr, indexSearcherHolder); + + SystemSearchManagerHolder parentSearchManager =3D null; + DocumentReaderService extractor =3D null; + ConfigurationManager cfm =3D new ConfigurationManagerImpl(); + + manager =3D + new SearchManagerImpl(ws.getQueryHandler(), nsReg, ntReg, itemMgr= , parentSearchManager, extractor, cfm, + indexSearcherHolder); + + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, + WorkspaceDataContainer.class); + + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(manager, SearchManager.class); + + } + + protected void initJBCConfig() + { + jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; + } + + public void testAddNode() throws Exception + { + // prepare + //super.testAddNode(); + String node1id =3D "111111111111"; + QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + String propId1 =3D "111111222222"; + QPath propPath1 =3D QPath.makeChildPath(node1path, Constants.JCR_PRI= MARYTYPE); + TransientPropertyData propData1 =3D + new TransientPropertyData(propPath1, propId1, 1, PropertyType.NAM= E, node1id, false); + propData1.setValue(new TransientValueData(Constants.NT_UNSTRUCTURED)= ); + conn.add(propData1); + + conn.commit(); + + // check do we really have node + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + + NodeData nd =3D (NodeData)connection.getItemData(node1id); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); + + // find node by search engine + + SearchIndex index =3D ((SearchIndex)manager.getHandler()); + IndexReader reader =3D index.getIndexReader(); + + IndexSearcher searcher =3D new IndexSearcher(reader); + + Query query =3D new TermQuery(new Term("", "")); + searcher.search(query); + + } + + protected WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Str= ing dsName, String vsPath, + ContainerEntry entry) throws Exception + { + + List params =3D new ArrayList(); + + params.add(new SimpleParameterEntry("sourceName", dsName)); + params.add(new SimpleParameterEntry("db-type", "generic")); + params.add(new SimpleParameterEntry("multi-db", isMultiDb ? "true" := "false")); + params.add(new SimpleParameterEntry("update-storage", "true")); + params.add(new SimpleParameterEntry("max-buffer-size", "204800")); + + if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != =3D null) + { + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB= _DIALECT, entry + .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT))); + } + + String oldSwap =3D entry.getParameterValue("swap-directory"); + String newSwap =3D oldSwap.substring(0, oldSwap.lastIndexOf('/')) + = '/' + wsName; + + params.add(new SimpleParameterEntry("swap-directory", newSwap)); + + ContainerEntry containerEntry =3D + new ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdb= c.JDBCWorkspaceDataContainer", + (ArrayList)params); + containerEntry.setParameters(params); + + if (vsPath !=3D null) + { + + ArrayList vsparams =3D new ArrayList(); + ValueStorageFilterEntry filterEntry =3D new ValueStorageFilterEnt= ry(); + filterEntry.setPropertyType("Binary"); + vsparams.add(filterEntry); + + ValueStorageEntry valueStorageEntry =3D + new ValueStorageEntry("org.exoplatform.services.jcr.impl.stora= ge.value.fs.SimpleFileValueStorage", vsparams); + ArrayList spe =3D new ArrayList(); + spe.add(new SimpleParameterEntry("path", vsPath)); + valueStorageEntry.setId(IdGenerator.generate()); + valueStorageEntry.setParameters(spe); + valueStorageEntry.setFilters(vsparams); + + // containerEntry.setValueStorages(); + containerEntry.setParameters(params); + ArrayList list =3D new ArrayList(1); + list.add(valueStorageEntry); + + containerEntry.setValueStorages(list); + + } + + // Indexer + ArrayList qParams =3D new ArrayList(); + qParams.add(new SimpleParameterEntry("indexDir", "target/temp/index/= db1/ws" + IdGenerator.generate())); + QueryHandlerEntry qEntry =3D + new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.que= ry.lucene.SearchIndex", qParams); + + WorkspaceEntry workspaceEntry =3D + new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); + workspaceEntry.setContainer(containerEntry); + + ArrayList cacheParams =3D new ArrayList(); + + cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); + cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); + CacheEntry cacheEntry =3D new CacheEntry(cacheParams); + cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persi= stent.LinkedWorkspaceStorageCacheImpl"); + + workspaceEntry.setCache(cacheEntry); + + workspaceEntry.setQueryHandler(qEntry); + + LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); + lockManagerEntry.setTimeout(900000); + LockPersisterEntry persisterEntry =3D new LockPersisterEntry(); + persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.= FileSystemLockPersister"); + ArrayList lpParams =3D new ArrayList(); + lpParams.add(new SimpleParameterEntry("path", "../temp/lock")); + persisterEntry.setParameters(lpParams); + lockManagerEntry.setPersister(persisterEntry); + workspaceEntry.setLockManager(lockManagerEntry); + + // workspaceEntry + return workspaceEntry; + } + + public void createNewDataSource(String dataSourceName) throws Exception + { + + Properties properties =3D new Properties(); + + properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); + String newurl =3D "jdbc:hsqldb:file:target/temp/data/" + dataSourceN= ame; + + properties.setProperty("url", newurl); + properties.setProperty("username", "sa"); + properties.setProperty("password", ""); + DataSource bds =3D BasicDataSourceFactory.createDataSource(propertie= s); + if (!newurl.contains("hsqldb")) + { + createDatabase(bds, dataSourceName); + } + + new InitialContext().rebind(dataSourceName, bds); + } + + private void createDatabase(DataSource ds, String dbName) throws SQLExc= eption + { + Connection connection =3D ds.getConnection(); + PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); + st.executeQuery(); + } + +} --===============5219364387397261652==-- From do-not-reply at jboss.org Thu Nov 12 06:20:32 2009 Content-Type: multipart/mixed; boundary="===============6481038247951077451==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r594 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 06:20:32 -0500 Message-ID: <200911121120.nACBKWuu005398@svn01.web.mwc.hst.phx2.redhat.com> --===============6481038247951077451== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 06:20:31 -0500 (Thu, 12 Nov 2009) New Revision: 594 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 11:1= 4:23 UTC (rev 593) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 11:2= 0:31 UTC (rev 594) @@ -312,6 +312,26 @@ private TransientPropertyData addDbProperty(WorkspaceStorageConnection = conn, QPath nodePath, String nodeId, InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception { + TransientPropertyData propData =3D createProperty(nodePath, nodeId, = propertyName, propertyValue, multiValued); + = + conn.add(propData); + + return propData; + } + = + /** + * Create Property. + * + * @param nodePath QPath + * @param nodeId String + * @param propertyName InternalQName + * @param propertyValue Object + * @return TransientPropertyData + * @throws Exception + */ + private TransientPropertyData createProperty(QPath nodePath, String nod= eId, + InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception + { String propId =3D IdGenerator.generate(); QPath propPath =3D QPath.makeChildPath(nodePath, propertyName); TransientPropertyData propData =3D @@ -348,8 +368,6 @@ } } = - conn.add(propData); - return propData; } = @@ -388,11 +406,8 @@ public void testAddProperty() throws Exception { // prepare - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + TransientPropertyData propData =3D createProperty(Constants.ROOT_PAT= H, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", false); = - TransientPropertyData propData =3D addDbProperty(connection, Constan= ts.ROOT_PATH, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", f= alse); - connection.commit(); - = List modifications =3D new ArrayList(); = modifications.addAll(addProperty(propData)); @@ -400,7 +415,7 @@ loader.put(modifications); = // tests it - connection =3D persistentContainer.openConnection(); + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); = PropertyData destPropData =3D (PropertyData) connection.getItemData(= propData.getIdentifier()); = @@ -485,26 +500,17 @@ { = // prepare - initJCRRoot(); + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); = - String propId =3D IdGenerator.generate(); - QPath propPath =3D QPath.makeChildPath(Constants.ROOT_PATH, Constant= s.JCR_DATA); - TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, Constants.ROOT_UUID, false); - String propValue =3D "JCR DATA VALUE"; - propData.setValue(new TransientValueData(propValue)); + TransientPropertyData propData =3D addDbProperty(connection, Constan= ts.ROOT_PATH, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", f= alse); + connection.commit(); = - List modifications =3D new ArrayList(); - = - modifications.addAll(addProperty(propData)); - = - loader.put(modifications); - // tests it - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + connection =3D persistentContainer.openConnection(); = - PropertyData destPropData =3D (PropertyData) connection.getItemData(= propId); + PropertyData destPropData =3D (PropertyData) connection.getItemData(= propData.getIdentifier()); = - Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.PROPS + "/" + propId)); + Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.PROPS + "/" + propData.getIdentifier())); = assertNotNull(attrebutes); = --===============6481038247951077451==-- From do-not-reply at jboss.org Thu Nov 12 08:18:53 2009 Content-Type: multipart/mixed; boundary="===============4628220519096346776==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r595 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Thu, 12 Nov 2009 08:18:53 -0500 Message-ID: <200911121318.nACDIrin027631@svn01.web.mwc.hst.phx2.redhat.com> --===============4628220519096346776== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-12 08:18:52 -0500 (Thu, 12 Nov 2009) New Revision: 595 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ActionLauncher.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/observation/ObservationManagerRegistry.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ActionLauncher.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ActionLauncher.java 2009-11-12 11:20:31 UT= C (rev 594) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ActionLauncher.java 2009-11-12 13:18:52 UT= C (rev 595) @@ -18,8 +18,6 @@ */ package org.exoplatform.services.jcr.impl.core.observation; = -import org.exoplatform.services.jcr.core.NamespaceAccessor; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; @@ -31,7 +29,6 @@ import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; @@ -66,7 +63,6 @@ private final SessionRegistry sessionRegistry; = private final NodeTypeDataManager ntManager; - = = public ActionLauncher(ObservationManagerRegistry registry, WorkspacePer= sistentDataManager workspaceDataManager, NodeTypeDataManager ntManager, SessionRegistry sessionRegistry) @@ -130,8 +126,14 @@ } if (events.size() > 0) { - // TCK says, no events - no onEvent() action - listener.onEvent(events); + try + { + listener.onEvent(events); + } + catch (RuntimeException e) + { + log.warn("Listener is in error, skipping", e); + } } } } @@ -157,7 +159,6 @@ // 8.3.3 Only events whose associated parent node is at absPath (or // within its subtree, if isDeep is true) will be received. QPath itemPath =3D item.getQPath(); - return itemPath.isDescendantOf(criteria.getAbsPath(), !criteria.isDe= ep()); } = @@ -208,20 +209,9 @@ } } = - for (int i =3D 0; i < criteria.getNodeTypeName().length; i++) + for (InternalQName typeName : criteria.getNodeTypeName()) { - NodeTypeData criteriaNT =3D ntManager.getNodeType(criteria.getNod= eTypeName()[i]); - InternalQName[] testQNames; - if (criteriaNT.isMixin()) - { - testQNames =3D node.getMixinTypeNames(); - } - else - { - testQNames =3D new InternalQName[1]; - testQNames[0] =3D node.getPrimaryTypeName(); - } - if (ntManager.isNodeType(criteriaNT.getName(), testQNames)) + if (ntManager.isNodeType(typeName, node.getPrimaryTypeName(), nod= e.getMixinTypeNames())) return true; } return false; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/observation/ObservationManagerRegistry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-12= 11:20:31 UTC (rev 594) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/observation/ObservationManagerRegistry.java 2009-11-12= 13:18:52 UTC (rev 595) @@ -20,7 +20,6 @@ = import org.exoplatform.services.jcr.core.NamespaceAccessor; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; -import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; @@ -67,7 +66,7 @@ this.listenersMap =3D new HashMap(); this.nodeTypeDataManager =3D nodeTypeDataManager; this.workspaceDataManager =3D workspaceDataManager; - //this.launcher =3D new ActionLauncher(this, workspaceDataManager, n= odeTypeDataManager, sessionRegistry); + this.launcher =3D new ActionLauncher(this, workspaceDataManager, nod= eTypeDataManager, sessionRegistry); } = public ObservationManagerImpl createObservationManager(SessionImpl sess= ion) @@ -115,9 +114,13 @@ } = // TODO: remove hardcode + /** + * Was created only for ObservationCacheLoader. For lab-purposes only + */ + @Deprecated public NodeTypeDataManager getNodeTypeDataManager() { return nodeTypeDataManager; } - = + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-12 1= 1:20:31 UTC (rev 594) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoader.java 2009-11-12 1= 3:18:52 UTC (rev 595) @@ -45,10 +45,13 @@ import javax.jcr.observation.EventListenerIterator; = /** + * This class is for lab-purposes only! + * = * @author Nikolay Zamosenchuk * @version $Id: ObservationCacheLoader.java 34360 2009-07-22 23:58:59Z ah= eritier $ * */ +(a)Deprecated public class ObservationCacheLoader extends AbstractWriteOnlyCacheLoader { public final int SKIP_EVENT =3D Integer.MIN_VALUE; Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 12 11:20:31 UTC (rev 594) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 12 13:18:52 UTC (rev 595) @@ -120,7 +120,7 @@ loader.injectDependencies(registry, new DummyWorkspaceDataContainer(= workspaceStorageConnection), accessor); } = - public void testFilterByUUID() throws Exception + public void _testFilterByUUID() throws Exception { QPath node1path =3D QPath.parse("[]:1[]node:1"); NodeData newNode =3D @@ -141,7 +141,7 @@ assertEquals("admin", event.getUserID()); } = - public void testAddNode() throws Exception + public void _testAddNode() throws Exception { QPath node1path =3D QPath.parse("[]:1[]node:1"); NodeData newNode =3D @@ -159,7 +159,7 @@ assertEvent(Event.NODE_ADDED, node1path, listener, "admin"); } = - public void testRemoveNode() throws Exception + public void _testRemoveNode() throws Exception { QPath node1path =3D QPath.parse("[]:1[]node:1"); NodeData newNode =3D @@ -177,7 +177,7 @@ assertEvent(Event.NODE_REMOVED, node1path, listener, "admin"); } = - public void testAddProperty() throws Exception + public void _testAddProperty() throws Exception { QPath prop1path =3D QPath.parse("[]:1[]node:1[]property:1"); PropertyData newProperty =3D @@ -195,7 +195,7 @@ assertEvent(Event.PROPERTY_ADDED, prop1path, listener, "admin"); } = - public void testUpdateProperty() throws Exception + public void _testUpdateProperty() throws Exception { QPath prop1path =3D QPath.parse("[]:1[]node:1[]property:1"); PropertyData newProperty =3D @@ -213,7 +213,7 @@ assertEvent(Event.PROPERTY_CHANGED, prop1path, listener, "admin"); } = - public void testRemoveProperty() throws Exception + public void _testRemoveProperty() throws Exception { QPath prop1path =3D QPath.parse("[]:1[]node:1[]property:1"); PropertyData newProperty =3D @@ -231,18 +231,8 @@ assertEvent(Event.PROPERTY_REMOVED, prop1path, listener, "admin"); } = - protected void assertEvent(int eventType, QPath prop1path, DummyListene= r listener, String userId) - throws RepositoryException + public void _testFilterByNodeType() throws Exception { - assertEquals(1, listener.eventList.size()); - Event event =3D listener.eventList.get(0); - assertEquals(eventType, event.getType()); - assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); - assertEquals(userId, event.getUserID()); - } - - public void testFilterByNodeType() throws Exception - { String parent1uuid =3D "uuid1"; String parent2uuid =3D "uuid2"; = @@ -283,6 +273,16 @@ assertEvent(Event.NODE_ADDED, child2path, listener, "admin"); } = + protected void assertEvent(int eventType, QPath prop1path, DummyListene= r listener, String userId) + throws RepositoryException + { + assertEquals(1, listener.eventList.size()); + Event event =3D listener.eventList.get(0); + assertEquals(eventType, event.getType()); + assertEquals(lf.createJCRPath(prop1path).getAsString(false), event.g= etPath()); + assertEquals(userId, event.getUserID()); + } + @Override protected void tearDown() throws Exception { --===============4628220519096346776==-- From do-not-reply at jboss.org Thu Nov 12 08:33:43 2009 Content-Type: multipart/mixed; boundary="===============8873986704096392467==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r596 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 08:33:43 -0500 Message-ID: <200911121333.nACDXhDr030018@svn01.web.mwc.hst.phx2.redhat.com> --===============8873986704096392467== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 08:33:43 -0500 (Thu, 12 Nov 2009) New Revision: 596 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 13:1= 8:52 UTC (rev 595) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 13:3= 3:43 UTC (rev 596) @@ -18,20 +18,31 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import java.io.InputStream; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.config.CacheEntry; import org.exoplatform.services.jcr.config.ContainerEntry; -import org.exoplatform.services.jcr.config.LockManagerEntry; -import org.exoplatform.services.jcr.config.LockPersisterEntry; -import org.exoplatform.services.jcr.config.QueryHandlerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.SimpleParameterEntry; import org.exoplatform.services.jcr.config.ValueStorageEntry; import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.ValueData; @@ -47,19 +58,6 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = -import java.io.InputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.sql.DataSource; - /** * @author Alex Reshetnyak<= /a> * @version $Id$ @@ -248,7 +246,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); @@ -266,7 +264,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); @@ -279,7 +277,7 @@ } = /** - * Add Property to the connection but doesn't save it. + * Add Node to the connection but doesn't save it. * * @param conn WorkspaceStorageConnection * @param root QPath @@ -287,15 +285,44 @@ * @param primaryType InternalQName * @throws Exception */ - private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType) + private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType, InternalQName[] mixinTypeNames) throws Exception { - // add root (/) - conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, null, + // create node with property jcr:primaryType + List list =3D createNode(root, nodeId, primaryType, mixinT= ypeNames); + = + // add node with property jcr:primaryType + for (ItemData itemData : list) + { + if (itemData instanceof NodeData) + conn.add((NodeData)itemData); + else + conn.add((PropertyData)itemData); + } + } + + /** + * Create Node to the connection but doesn't save it. + * + * @param path QPath + * @param nodeId String + * @param primaryType InternalQName + * @param mixinTypeNames InternalQName = + * @throws Exception + */ + private List createNode(QPath path, String nodeId, InternalQN= ame primaryType, InternalQName[] mixinTypeNames) + throws Exception + { + List list =3D new ArrayList(); + = + // add node = + list.add(new TransientNodeData(path, nodeId, 1, primaryType, (mixinT= ypeNames =3D=3D null ? new InternalQName[0] : null), 0, null, new AccessControlList())); = // add property (/jcr:primaryType) - addDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARY= TYPE, primaryType, false); + list.add(createProperty(path, Constants.ROOT_UUID, Constants.JCR_PRI= MARYTYPE, primaryType, false)); + = + return list; } = /** @@ -400,7 +427,6 @@ // tests WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = - //??? Map data =3D cache.getData(Fqn.fromStrin= g("/"+JBossCacheStorage.NODES + "/" + Constants.ROOT_UUID)); } = public void testAddProperty() throws Exception @@ -506,15 +532,24 @@ connection.commit(); = // tests it - connection =3D persistentContainer.openConnection(); + Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.PROPS + "/" + propData.getIdentifier())); = - PropertyData destPropData =3D (PropertyData) connection.getItemData(= propData.getIdentifier()); + assertNotNull(attrebutes); = - Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.PROPS + "/" + propData.getIdentifier())); + PropertyData destPropData =3D (PropertyData) attrebutes.get(JBossCac= heStorage.ITEM_DATA); = - assertNotNull(attrebutes); + assertNotNull(destPropData); + assertEquals(propData.getIdentifier(), destPropData.getIdentifier()); + assertEquals(propData.getParentIdentifier(), destPropData.getParentI= dentifier()); + assertEquals(propData.getPersistedVersion(), destPropData.getPersist= edVersion()); + assertEquals(propData.getType(), destPropData.getType()); + assertEquals(propData.getQPath(), destPropData.getQPath()); + assertEquals(propData.getValues().size(), destPropData.getValues().s= ize()); + assertEquals(1, destPropData.getValues().size()); + = + ValueData valueData =3D destPropData.getValues().get(0); + assertEquals("JCR DATA VALUE", new String (valueData.getAsByteArray(= ), "UTF-8")); = - } = public void testGetPropertyByName() throws Exception --===============8873986704096392467==-- From do-not-reply at jboss.org Thu Nov 12 08:43:13 2009 Content-Type: multipart/mixed; boundary="===============0685177202180781148==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r597 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 08:43:13 -0500 Message-ID: <200911121343.nACDhD6G031233@svn01.web.mwc.hst.phx2.redhat.com> --===============0685177202180781148== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 08:43:12 -0500 (Thu, 12 Nov 2009) New Revision: 597 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 13:3= 3:43 UTC (rev 596) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 13:4= 3:12 UTC (rev 597) @@ -423,6 +423,18 @@ public void testAddNode() throws Exception { // prepare + String nodeId =3D IdGenerator.generate(); + List list =3D createNode(QPath.makeChildPath(Constants.ROO= T_PATH, InternalQName.parse("[]node:1")), nodeId, Constants.NT_UNSTRUCTURED= , null); + = + List modifications =3D new ArrayList(); + = + for (ItemData itemData : list) = + if (itemData instanceof NodeData) + modifications.addAll(addNode((NodeData) itemData)); + else + modifications.addAll(addProperty((PropertyData) itemData)); + = + loader.put(modifications); = // tests WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); --===============0685177202180781148==-- From do-not-reply at jboss.org Thu Nov 12 09:04:23 2009 Content-Type: multipart/mixed; boundary="===============3982818267170958336==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r598 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 09:04:23 -0500 Message-ID: <200911121404.nACE4NFW002042@svn01.web.mwc.hst.phx2.redhat.com> --===============3982818267170958336== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 09:04:23 -0500 (Thu, 12 Nov 2009) New Revision: 598 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 13:4= 3:12 UTC (rev 597) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 14:0= 4:23 UTC (rev 598) @@ -424,7 +424,7 @@ { // prepare String nodeId =3D IdGenerator.generate(); - List list =3D createNode(QPath.makeChildPath(Constants.ROO= T_PATH, InternalQName.parse("[]node:1")), nodeId, Constants.NT_UNSTRUCTURED= , null); + List list =3D createNode(QPath.makeChildPath(Constants.ROO= T_PATH, InternalQName.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, = null); = List modifications =3D new ArrayList(); = @@ -437,8 +437,19 @@ loader.put(modifications); = // tests + NodeData srcNodeData =3D (NodeData) list.get(0); + = WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - + = + NodeData destNodeData =3D (NodeData) conn.getItemData(nodeId); + = + assertNotNull(destNodeData); + assertEquals(srcNodeData.getIdentifier(), destNodeData.getIdentifier= ()); + assertEquals(srcNodeData.getOrderNumber(), destNodeData.getOrderNumb= er()); + assertEquals(srcNodeData.getParentIdentifier(), destNodeData.getPare= ntIdentifier()); + assertEquals(srcNodeData.getPersistedVersion(), destNodeData.getPers= istedVersion()); + assertEquals(srcNodeData.getQPath(), destNodeData.getQPath()); + assertEquals(srcNodeData.getPrimaryTypeName(), destNodeData.getPrima= ryTypeName()); } = public void testAddProperty() throws Exception --===============3982818267170958336==-- From do-not-reply at jboss.org Thu Nov 12 09:20:51 2009 Content-Type: multipart/mixed; boundary="===============0532237888838552860==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r599 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 09:20:51 -0500 Message-ID: <200911121420.nACEKpUH004251@svn01.web.mwc.hst.phx2.redhat.com> --===============0532237888838552860== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 09:20:50 -0500 (Thu, 12 Nov 2009) New Revision: 599 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 14:0= 4:23 UTC (rev 598) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 14:2= 0:50 UTC (rev 599) @@ -320,7 +320,7 @@ new AccessControlList())); = // add property (/jcr:primaryType) - list.add(createProperty(path, Constants.ROOT_UUID, Constants.JCR_PRI= MARYTYPE, primaryType, false)); + list.add(createProperty(path, nodeId, Constants.JCR_PRIMARYTYPE, pri= maryType, false)); = return list; } @@ -448,8 +448,8 @@ assertEquals(srcNodeData.getOrderNumber(), destNodeData.getOrderNumb= er()); assertEquals(srcNodeData.getParentIdentifier(), destNodeData.getPare= ntIdentifier()); assertEquals(srcNodeData.getPersistedVersion(), destNodeData.getPers= istedVersion()); - assertEquals(srcNodeData.getQPath(), destNodeData.getQPath()); - assertEquals(srcNodeData.getPrimaryTypeName(), destNodeData.getPrima= ryTypeName()); + assertEquals(srcNodeData.getQPath().getAsString(), destNodeData.getQ= Path().getAsString()); + assertEquals(srcNodeData.getPrimaryTypeName().getAsString(), destNod= eData.getPrimaryTypeName().getAsString()); } = public void testAddProperty() throws Exception --===============0532237888838552860==-- From do-not-reply at jboss.org Thu Nov 12 09:49:20 2009 Content-Type: multipart/mixed; boundary="===============1730968228367442194==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r600 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 09:49:20 -0500 Message-ID: <200911121449.nACEnKdA008135@svn01.web.mwc.hst.phx2.redhat.com> --===============1730968228367442194== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 09:49:19 -0500 (Thu, 12 Nov 2009) New Revision: 600 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 14:2= 0:50 UTC (rev 599) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 14:4= 9:19 UTC (rev 600) @@ -531,9 +531,30 @@ { = // prepare - - // tests it - + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + = + String nodeId =3D IdGenerator.generate(); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); + conn.commit(); + = + // tests + conn =3D persistentContainer.openConnection(); + = + NodeData srcNodeData =3D (NodeData) conn.getItemData(nodeId); + = + Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.NODES + "/" + nodeId)); + = + assertNotNull(attrebutes); + = + NodeData destNodeData =3D (NodeData) attrebutes.get(JBossCacheStorag= e.ITEM_DATA); + = + assertNotNull(destNodeData); + assertEquals(srcNodeData.getIdentifier(), destNodeData.getIdentifier= ()); + assertEquals(srcNodeData.getOrderNumber(), destNodeData.getOrderNumb= er()); + assertEquals(srcNodeData.getParentIdentifier(), destNodeData.getPare= ntIdentifier()); + assertEquals(srcNodeData.getPersistedVersion(), destNodeData.getPers= istedVersion()); + assertEquals(srcNodeData.getQPath().getAsString(), destNodeData.getQ= Path().getAsString()); + assertEquals(srcNodeData.getPrimaryTypeName().getAsString(), destNod= eData.getPrimaryTypeName().getAsString()); } = public void testGetNodeByName() throws Exception --===============1730968228367442194==-- From do-not-reply at jboss.org Thu Nov 12 09:50:28 2009 Content-Type: multipart/mixed; boundary="===============7984519238363293150==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r601 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 09:50:28 -0500 Message-ID: <200911121450.nACEoSoJ008463@svn01.web.mwc.hst.phx2.redhat.com> --===============7984519238363293150== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-12 09:50:26 -0500 (Thu, 12 Nov 2009) New Revision: 601 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java Log: EXOJCR-202: IndexerCacheLoaderRuntimeTest test fixed Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-12 14:49:19 UTC (rev 600) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-12 14:50:26 UTC (rev 601) @@ -16,11 +16,10 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import junit.framework.TestCase; - import org.apache.commons.dbcp.BasicDataSourceFactory; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; +import org.apache.lucene.search.Hits; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.TermQuery; @@ -29,10 +28,7 @@ import org.exoplatform.services.document.DocumentReaderService; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.config.CacheEntry; import org.exoplatform.services.jcr.config.ContainerEntry; -import org.exoplatform.services.jcr.config.LockManagerEntry; -import org.exoplatform.services.jcr.config.LockPersisterEntry; import org.exoplatform.services.jcr.config.QueryHandlerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.SimpleParameterEntry; @@ -41,7 +37,9 @@ import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.LocationFactory; @@ -50,9 +48,9 @@ import org.exoplatform.services.jcr.impl.core.nodetype.registration.JcrNod= eTypeDataPersister; import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTy= peDataPersister; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; -import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.core.query.SearchManagerImpl; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; @@ -66,13 +64,9 @@ import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jcr.util.IdGenerator; -import org.jboss.cache.Cache; -import org.jboss.cache.CacheSPI; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; +import org.jboss.cache.Modification; = -import java.io.Serializable; +import java.io.InputStream; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -80,7 +74,6 @@ import java.util.List; import java.util.Properties; = -import javax.jcr.PropertyType; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource; @@ -93,68 +86,82 @@ * @author Karpenko Sergiy = * @version $Id: IndexerCacheLoaderRuntimeTest.java 111 2008-11-11 11:11:1= 1Z serg $ */ -public class IndexerCacheLoaderRuntimeTest extends TestCase +public class IndexerCacheLoaderRuntimeTest extends AbstractCacheLoaderTest { = - protected JBossCacheStorageConnection conn; + private JDBCWorkspaceDataContainer persistentContainer; = - protected Cache cache; + private IndexerCacheLoader loader; = - protected Node nodes; + SearchManagerImpl manager; = - protected Node props; + public void createNewDataSource(String dataSourceName) throws Exception + { = - protected Node session; + Properties properties =3D new Properties(); = - protected String jbcConfig; + properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); + String newurl =3D "jdbc:hsqldb:file:target/temp/data/" + dataSourceN= ame; = - JDBCWorkspaceDataContainer persistentContainer; + properties.setProperty("url", newurl); + properties.setProperty("username", "sa"); + properties.setProperty("password", ""); + DataSource bds =3D BasicDataSourceFactory.createDataSource(propertie= s); + if (!newurl.contains("hsqldb")) + { + createDatabase(bds, dataSourceName); + } = - SearchManager manager; + new InitialContext().rebind(dataSourceName, bds); + } = - /** - * {@inheritDoc} - */ - protected void setUp() throws Exception + public void setUp() throws Exception { try { super.setUp(); = - // JBossCache = - initJBCConfig(); + initPersistence(); = - cache =3D new DefaultCacheFactory().createC= ache(jbcConfig, false); + loader =3D new IndexerCacheLoader(); + loader.injectDependencies(manager); = - initJBC(); + initJCRRoot(); = - // run cache - cache.create(); - cache.start(); + // // JBossCache = + // initJBCConfig(); + // + // cache =3D new DefaultCacheFactory().createCache(jbcConfig, false); + // + // initJBC(); = - Node cacheRoot =3D cache.getRoot(); - - // prepare cache structures - - nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NOD= ES)); - props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PRO= PS)); - session =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.S= ESSION)); - - // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props, ses= sion); - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROO= T_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, null, new AccessControlList())); - - String propId1 =3D "rootf111111"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Cons= tants.JCR_PRIMARYTYPE); - TransientPropertyData propData1 =3D - new TransientPropertyData(propPath1, propId1, 1, PropertyType.= NAME, Constants.ROOT_UUID, false); - propData1.setValue(new TransientValueData(Constants.NT_UNSTRUCTUR= ED)); - conn.add(propData1); - - conn.commit(); - ((SearchManagerImpl)manager).start(); + // // run cache + // cache.create(); + // cache.start(); + // + // Node cacheRoot =3D cache.getRoot= (); + // + // // prepare cache structures + // + // nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCache= Storage.NODES)); + // props =3D cacheRoot.addChild(Fqn.fromString(JBossCache= Storage.PROPS)); + // session =3D cacheRoot.addChild(Fqn.fromString(JBossCac= heStorage.SESSION)); + // + // // JCR connection + // conn =3D new JBossCacheStorageConnection(cache, nodes,= props, session); + // // add root (/) + // conn.add(new TransientNodeData(Constants.ROOT_PATH, Co= nstants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, + // new InternalQName[0], 0, null, new AccessControlLis= t())); + // + // String propId1 =3D "rootf111111"; + // QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT= _PATH, Constants.JCR_PRIMARYTYPE); + // TransientPropertyData propData1 =3D + // new TransientPropertyData(propPath1, propId1, 1, Pr= opertyType.NAME, Constants.ROOT_UUID, false); + // propData1.setValue(new TransientValueData(Constants.NT= _UNSTRUCTURED)); + // conn.add(propData1); + // + // conn.commit(); + manager.start(); } catch (Exception e) { @@ -163,122 +170,264 @@ } } = - /** - * {@inheritDoc} - */ - // protected void tearDown() throws Exception - // { - // - // cache.stop(); - // cache.destroy(); - // - // super.tearDown(); - // } - - protected void initJBC() throws Exception + public void testAddNode() throws Exception { + // prepare add node to storage + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = - // Create WorkspaceEntry - ContainerEntry containerEntry =3D new ContainerEntry(); - List params =3D new ArrayList(); - params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); - params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); - containerEntry.setParameters(params); + String node1id =3D IdGenerator.generate(); + QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); = - // Initialize id generator. - new IdGenerator(new IDGeneratorServiceImpl()); + // add root (/) with jcr:primaryType + addDbNode(conn, node1path, node1id, Constants.ROOT_UUID, Constants.N= T_UNSTRUCTURED); + conn.commit(); = - // Set system property Context.INITIAL_CONTEXT_FACTORY to initial co= ntext. = - System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); + List node =3D this.createNode(node1path, node1id, Constant= s.NT_UNSTRUCTURED, new InternalQName[0]); = - // Create data source. Will be created new data source to new test. = - String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); - createNewDataSource(dataSourceName); + List modifications =3D new ArrayList(); = - WorkspaceEntry ws =3D - getNewWs("ws_to_jbdc_cache_loader", true, dataSourceName, "/targe= t/temp/ws_to_jbdc_cache_loader/values", - containerEntry); + for (ItemData data : node) + { + if (data.isNode()) + { + modifications.addAll(addNode((NodeData)data)); + } + else + { + modifications.addAll(addProperty((PropertyData)data)); + } + } = - RepositoryEntry re =3D new RepositoryEntry(); - re.addWorkspace(ws); + loader.put(modifications); = - ValueStoragePluginProvider valueStoragePluginProvider =3D new Standa= loneStoragePluginProvider(ws); + // check do we really have node + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); = - persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); + NodeData nd =3D (NodeData)connection.getItemData(node1id); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); = - persistentContainer.start(); + // find node by search engine + SearchIndex index =3D ((SearchIndex)manager.getHandler()); + IndexReader reader =3D index.getIndexReader(); = - NamespaceRegistryImpl nsReg =3D new NamespaceRegistryImpl(); - nsReg.start(); - SystemDataContainerHolder systemDataContaine= rHolder =3D - new SystemDataContainerHolder(persistentContainer); + IndexSearcher searcher =3D new IndexSearcher(reader); = - WorkspacePersistentDataManager itemMgr =3D - new JBossCacheWorkspaceDataManager(persistentContainer, systemDat= aContainerHolder); + Query query =3D new TermQuery(new Term("_:UUID", node1id)); + Hits hit =3D searcher.search(query); + assertEquals(1, hit.length()); + } = - RepositoryIndexSearcherHolder indexSearcherHolder =3D new Repository= IndexSearcherHolder(); + // public void testAddProperty() throws Exception + // { + // // prepare + // TransientPropertyData propData =3D + // createProperty(Constants.ROOT_PATH, Constants.ROOT_UUID, Con= stants.JCR_DATA, "JCR DATA VALUE", false); + // + // List modifications =3D new ArrayList(); + // + // modifications.addAll(addProperty(propData)); + // + // loader.put(modifications); + // + // // tests it + // WorkspaceStorageConnection connection =3D persistentContainer.o= penConnection(); + // + // PropertyData destPropData =3D (PropertyData)connection.getItemD= ata(propData.getIdentifier()); + // + // assertNotNull(destPropData); + // assertEquals(propData.getIdentifier(), destPropData.getIdentifi= er()); + // assertEquals(propData.getParentIdentifier(), destPropData.getPa= rentIdentifier()); + // assertEquals(propData.getPersistedVersion(), destPropData.getPe= rsistedVersion()); + // assertEquals(propData.getType(), destPropData.getType()); + // assertEquals(propData.getQPath(), destPropData.getQPath()); + // assertEquals(propData.getValues().size(), destPropData.getValue= s().size()); + // assertEquals(1, destPropData.getValues().size()); + // + // ValueData valueData =3D destPropData.getValues().get(0); + // assertEquals("JCR DATA VALUE", new String(valueData.getAsByteAr= ray(), "UTF-8")); + // + // } = - NodeTypeDataPersister persister =3D new JcrNodeTypeDataPersister(ite= mMgr, false); - NodeTypeDataManager ntReg =3D - new NodeTypeDataManagerImpl(re, new LocationFactory(nsReg), nsReg= , persister, itemMgr, indexSearcherHolder); + /** + * Add Property to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param root QPath + * @param nodeId String + * @param primaryType InternalQName + * @throws Exception + */ + private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, String parentId, + InternalQName primaryType) throws Exception + { + // add root (/) + conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, parentId, + new AccessControlList())); = - SystemSearchManagerHolder parentSearchManager =3D null; - DocumentReaderService extractor =3D null; - ConfigurationManager cfm =3D new ConfigurationManagerImpl(); + // add property (/jcr:primaryType) + addDbProperty(conn, root, nodeId, Constants.JCR_PRIMARYTYPE, primary= Type, false); + } = - manager =3D - new SearchManagerImpl(ws.getQueryHandler(), nsReg, ntReg, itemMgr= , parentSearchManager, extractor, cfm, - indexSearcherHolder); + /** + * Add Property to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param nodePath QPath + * @param nodeId String + * @param propertyName InternalQName + * @param propertyValue Object + * @return TransientPropertyData + * @throws Exception + */ + private TransientPropertyData addDbProperty(WorkspaceStorageConnection = conn, QPath nodePath, String nodeId, + InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception + { + TransientPropertyData propData =3D createProperty(nodePath, nodeId, = propertyName, propertyValue, multiValued); = - ((CacheSPI)cache).getComponentRegistry().regis= terComponent(persistentContainer, - WorkspaceDataContainer.class); + conn.add(propData); = - ((CacheSPI)cache).getComponentRegistry().regis= terComponent(manager, SearchManager.class); + return propData; + } = + private void createDatabase(DataSource ds, String dbName) throws SQLExc= eption + { + Connection connection =3D ds.getConnection(); + PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); + st.executeQuery(); } = - protected void initJBCConfig() + /** + * Create Node to the connection but doesn't save it. + * + * @param path QPath + * @param nodeId String + * @param primaryType InternalQName + * @param mixinTypeNames InternalQName = + * @throws Exception + */ + private List createNode(QPath path, String nodeId, InternalQN= ame primaryType, + InternalQName[] mixinTypeNames) throws Exception { - jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; + List list =3D new ArrayList(); + + // add node = + list.add(new TransientNodeData(path, nodeId, 1, primaryType, (mixinT= ypeNames =3D=3D null ? new InternalQName[0] + : null), 0, null, new AccessControlList())); + + // add property (/jcr:primaryType) + list.add(createProperty(path, Constants.ROOT_UUID, Constants.JCR_PRI= MARYTYPE, primaryType, false)); + + return list; } = - public void testAddNode() throws Exception + /** + * Create Property. + * + * @param nodePath QPath + * @param nodeId String + * @param propertyName InternalQName + * @param propertyValue Object + * @return TransientPropertyData + * @throws Exception + */ + private TransientPropertyData createProperty(QPath nodePath, String nod= eId, InternalQName propertyName, + Object propertyValue, boolean multiValued) throws Exception { - // prepare - //super.testAddNode(); - String node1id =3D "111111111111"; - QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); + String propId =3D IdGenerator.generate(); + QPath propPath =3D QPath.makeChildPath(nodePath, propertyName); + TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, nodeId, multiValued); = - String propId1 =3D "111111222222"; - QPath propPath1 =3D QPath.makeChildPath(node1path, Constants.JCR_PRI= MARYTYPE); - TransientPropertyData propData1 =3D - new TransientPropertyData(propPath1, propId1, 1, PropertyType.NAM= E, node1id, false); - propData1.setValue(new TransientValueData(Constants.NT_UNSTRUCTURED)= ); - conn.add(propData1); + List values =3D new ArrayList(); + if (multiValued) + { + if (propertyValue instanceof List) + { + values.addAll((List)propertyValue); + } + else + throw new Exception("propertyValue should be a List"); + } + else + { + values.add(propertyValue); + } = - conn.commit(); + for (Object value : values) + { + if (value instanceof InternalQName) + { + propData.setValue(new TransientValueData((InternalQName)value)= ); + } + else if (value instanceof String) + { + propData.setValue(new TransientValueData((String)value)); + } + else if (value instanceof InputStream) + { + propData.setValue(new TransientValueData((InputStream)value)); + } + } = - // check do we really have node - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + return propData; + } = - NodeData nd =3D (NodeData)connection.getItemData(node1id); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); + /** + * Delete Property to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param root QPath + * @param nodeId String + * @param primaryType InternalQName + * @throws Exception + */ + private void deleteDbNode(WorkspaceStorageConnection conn, QPath root, = String nodeId, InternalQName primaryType) + throws Exception + { + // add property (/jcr:primaryType) + addDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARY= TYPE, primaryType, false); = - // find node by search engine + // add root (/) + conn.delete(new TransientNodeData(root, nodeId, 1, primaryType, new = InternalQName[0], 0, null, + new AccessControlList())); + } = - SearchIndex index =3D ((SearchIndex)manager.getHandler()); - IndexReader reader =3D index.getIndexReader(); + private void deleteJCRRoot() throws Exception + { + // prepare = + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = - IndexSearcher searcher =3D new IndexSearcher(reader); + // add root (/) with jcr:primaryType + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, null, Cons= tants.NT_UNSTRUCTURED); = - Query query =3D new TermQuery(new Term("", "")); - searcher.search(query); + // add property (/jcr:mixinTypes) + List mixins =3D new ArrayList(); + mixins.add(Constants.MIX_REFERENCEABLE); + mixins.add(Constants.EXO_PRIVILEGEABLE); + mixins.add(Constants.EXO_OWNEABLE); + addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); = + conn.commit(); } = + private void initJCRRoot() throws Exception + { + // prepare = + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + + // add root (/) with jcr:primaryType + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, null, Cons= tants.NT_UNSTRUCTURED); + + // add property (/jcr:mixinTypes) + //List mixins =3D new ArrayList(); + // mixins.add(Constants.MIX_REFERENCEABLE); + // mixins.add(Constants.EXO_PRIVILEGEABLE); + // mixins.add(Constants.EXO_OWNEABLE); + //addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Cons= tants.JCR_MIXINTYPES, mixins, true); + + conn.commit(); + } + protected WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Str= ing dsName, String vsPath, ContainerEntry entry) throws Exception { @@ -332,66 +481,98 @@ = } = + WorkspaceEntry workspaceEntry =3D + new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); + workspaceEntry.setContainer(containerEntry); + // Indexer ArrayList qParams =3D new ArrayList(); qParams.add(new SimpleParameterEntry("indexDir", "target/temp/index/= db1/ws" + IdGenerator.generate())); QueryHandlerEntry qEntry =3D new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.que= ry.lucene.SearchIndex", qParams); + workspaceEntry.setQueryHandler(qEntry); = - WorkspaceEntry workspaceEntry =3D - new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); - workspaceEntry.setContainer(containerEntry); + // ArrayList cacheParams =3D new ArrayList(); + // + // cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); + // cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); + // CacheEntry cacheEntry =3D new CacheEntry(cacheParams); + // cacheEntry.setType("org.exoplatform.services.jcr.impl.datafl= ow.persistent.LinkedWorkspaceStorageCacheImpl"); + // + // workspaceEntry.setCache(cacheEntry); = - ArrayList cacheParams =3D new ArrayList(); + // LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); + // lockManagerEntry.setTimeout(900000); + // LockPersisterEntry persisterEntry =3D new LockPersisterEntry= (); + // persisterEntry.setType("org.exoplatform.services.jcr.impl.co= re.lock.FileSystemLockPersister"); + // ArrayList lpParams =3D new ArrayList(); + // lpParams.add(new SimpleParameterEntry("path", "../temp/lock"= )); + // persisterEntry.setParameters(lpParams); + // lockManagerEntry.setPersister(persisterEntry); + // workspaceEntry.setLockManager(lockManagerEntry); = - cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); - cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); - CacheEntry cacheEntry =3D new CacheEntry(cacheParams); - cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.persi= stent.LinkedWorkspaceStorageCacheImpl"); - - workspaceEntry.setCache(cacheEntry); - - workspaceEntry.setQueryHandler(qEntry); - - LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); - lockManagerEntry.setTimeout(900000); - LockPersisterEntry persisterEntry =3D new LockPersisterEntry(); - persisterEntry.setType("org.exoplatform.services.jcr.impl.core.lock.= FileSystemLockPersister"); - ArrayList lpParams =3D new ArrayList(); - lpParams.add(new SimpleParameterEntry("path", "../temp/lock")); - persisterEntry.setParameters(lpParams); - lockManagerEntry.setPersister(persisterEntry); - workspaceEntry.setLockManager(lockManagerEntry); - // workspaceEntry return workspaceEntry; } = - public void createNewDataSource(String dataSourceName) throws Exception + protected void initPersistence() throws Exception { + // Create WorkspaceEntry + ContainerEntry containerEntry =3D new ContainerEntry(); + List params =3D new ArrayList(); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); + containerEntry.setParameters(params); = - Properties properties =3D new Properties(); + // Initialize id generator. + new IdGenerator(new IDGeneratorServiceImpl()); = - properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); - String newurl =3D "jdbc:hsqldb:file:target/temp/data/" + dataSourceN= ame; + // Set system property Context.INITIAL_CONTEXT_FACTORY to initial co= ntext. = + System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); = - properties.setProperty("url", newurl); - properties.setProperty("username", "sa"); - properties.setProperty("password", ""); - DataSource bds =3D BasicDataSourceFactory.createDataSource(propertie= s); - if (!newurl.contains("hsqldb")) - { - createDatabase(bds, dataSourceName); - } + // Create data source. Will be created new data source to new test. = + String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); + createNewDataSource(dataSourceName); = - new InitialContext().rebind(dataSourceName, bds); + WorkspaceEntry ws =3D + getNewWs("ws_to_jbdc_cache_loader", true, dataSourceName, "/targe= t/temp/ws_to_jbdc_cache_loader/lalues", + containerEntry); + + RepositoryEntry re =3D new RepositoryEntry(); + re.addWorkspace(ws); + + ValueStoragePluginProvider valueStoragePluginProvider =3D new Standa= loneStoragePluginProvider(ws); + + persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); + + NamespaceRegistryImpl nsReg =3D new NamespaceRegistryImpl(); + nsReg.start(); + SystemDataContainerHolder systemDataContaine= rHolder =3D + new SystemDataContainerHolder(persistentContainer); + + WorkspacePersistentDataManager itemMgr =3D + new JBossCacheWorkspaceDataManager(persistentContainer, systemDat= aContainerHolder); + + RepositoryIndexSearcherHolder indexSearcherHolder =3D new Repository= IndexSearcherHolder(); + + NodeTypeDataPersister persister =3D new JcrNodeTypeDataPersister(ite= mMgr, false); + NodeTypeDataManager ntReg =3D + new NodeTypeDataManagerImpl(re, new LocationFactory(nsReg), nsReg= , persister, itemMgr, indexSearcherHolder); + + SystemSearchManagerHolder parentSearchManager =3D null; + DocumentReaderService extractor =3D null; + ConfigurationManager cfm =3D new ConfigurationManagerImpl(); + + manager =3D + new SearchManagerImpl(ws.getQueryHandler(), nsReg, ntReg, itemMgr= , parentSearchManager, extractor, cfm, + indexSearcherHolder); } = - private void createDatabase(DataSource ds, String dbName) throws SQLExc= eption + @Override + protected void tearDown() throws Exception { - Connection connection =3D ds.getConnection(); - PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); - st.executeQuery(); + // delete all in DB + super.tearDown(); } = } --===============7984519238363293150==-- From do-not-reply at jboss.org Thu Nov 12 09:51:35 2009 Content-Type: multipart/mixed; boundary="===============2873128608441744935==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r602 - in core/trunk: exo.core.component.ldap and 1 other directory. Date: Thu, 12 Nov 2009 09:51:34 -0500 Message-ID: <200911121451.nACEpYSF008584@svn01.web.mwc.hst.phx2.redhat.com> --===============2873128608441744935== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-12 09:51:33 -0500 (Thu, 12 Nov 2009) New Revision: 602 Modified: core/trunk/exo.core.component.ldap/pom.xml core/trunk/pom.xml Log: EXOJCR-235 ldap dependency fixed Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-12 14:50:26 UTC (rev= 601) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-12 14:51:33 UTC (rev= 602) @@ -40,8 +40,8 @@ = - ldapsdk - ldap + com.novell.ldap + jldap test @@ -63,4 +63,4 @@ = - \ No newline at end of file + Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-12 14:50:26 UTC (rev 601) +++ core/trunk/pom.xml 2009-11-12 14:51:33 UTC (rev 602) @@ -219,9 +219,9 @@ = - ldapsdk - ldap - 4.1 + com.novell.ldap + jldap + 4.3 = --===============2873128608441744935==-- From do-not-reply at jboss.org Thu Nov 12 10:11:57 2009 Content-Type: multipart/mixed; boundary="===============4198738628799009011==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r604 - kernel/trunk. Date: Thu, 12 Nov 2009 10:11:57 -0500 Message-ID: <200911121511.nACFBviq012304@svn01.web.mwc.hst.phx2.redhat.com> --===============4198738628799009011== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-12 10:11:56 -0500 (Thu, 12 Nov 2009) New Revision: 604 Modified: kernel/trunk/pom.xml Log: javax.servlet:servlet-api Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-12 15:03:21 UTC (rev 603) +++ kernel/trunk/pom.xml 2009-11-12 15:11:56 UTC (rev 604) @@ -201,7 +201,7 @@ javax.servlet servlet-api - [2.5,) + 2.5 provided = --===============4198738628799009011==-- From do-not-reply at jboss.org Thu Nov 12 10:31:59 2009 Content-Type: multipart/mixed; boundary="===============2625109647644624919==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r605 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 10:31:59 -0500 Message-ID: <200911121531.nACFVxTJ016297@svn01.web.mwc.hst.phx2.redhat.com> --===============2625109647644624919== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 10:31:59 -0500 (Thu, 12 Nov 2009) New Revision: 605 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 15:1= 1:56 UTC (rev 604) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 15:3= 1:59 UTC (rev 605) @@ -45,6 +45,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; @@ -436,7 +437,7 @@ = loader.put(modifications); = - // tests + // tests it NodeData srcNodeData =3D (NodeData) list.get(0); = WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); @@ -495,9 +496,28 @@ { = // prepare - + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + = + String nodeId =3D IdGenerator.generate(); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); + conn.commit(); + = + conn =3D persistentContainer.openConnection(); + PropertyData propData =3D addDbProperty(conn, QPath.makeChildPath(Co= nstants.ROOT_PATH, InternalQName.parse("[]node")), nodeId, InternalQName.pa= rse("[]prop1"), "_Tesed_VALUE", false); + conn.commit(); + = + List modifications =3D new ArrayList(); + = + modifications.addAll(removeProperty(propData)); + = + loader.put(modifications); + = // tests it - + conn =3D persistentContainer.openConnection(); + = + PropertyData removedPropertyData =3D (PropertyData) conn.getItemData= (propData.getIdentifier()); = + = + assertNull(removedPropertyData); } = public void testUpdateNode() throws Exception @@ -537,7 +557,7 @@ addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); conn.commit(); = - // tests + // tests it conn =3D persistentContainer.openConnection(); = NodeData srcNodeData =3D (NodeData) conn.getItemData(nodeId); --===============2625109647644624919==-- From do-not-reply at jboss.org Thu Nov 12 10:32:31 2009 Content-Type: multipart/mixed; boundary="===============8521956897461376734==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r606 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 10:32:31 -0500 Message-ID: <200911121532.nACFWVr2016385@svn01.web.mwc.hst.phx2.redhat.com> --===============8521956897461376734== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 10:32:31 -0500 (Thu, 12 Nov 2009) New Revision: 606 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 15:31:59= UTC (rev 605) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 15:32:31= UTC (rev 606) @@ -177,8 +177,8 @@ throws IllegalStateException, RepositoryException { = - if (modification.getFqn().get(1).equals(JBossCacheStorage.NODES) || - modification.getFqn().get(1).equals(JBossCacheStorage.PROPS)) + if (modification.getFqn().get(0).equals(JBossCacheStorage.NODES) || + modification.getFqn().get(0).equals(JBossCacheStorage.PROPS)) { = String identifier =3D (String) modification.getFqn().get(1); --===============8521956897461376734==-- From do-not-reply at jboss.org Thu Nov 12 10:43:13 2009 Content-Type: multipart/mixed; boundary="===============5660068035581627768==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r607 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Thu, 12 Nov 2009 10:43:13 -0500 Message-ID: <200911121543.nACFhDDF018823@svn01.web.mwc.hst.phx2.redhat.com> --===============5660068035581627768== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 10:43:12 -0500 (Thu, 12 Nov 2009) New Revision: 607 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 15:32:31= UTC (rev 606) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 15:43:12= UTC (rev 607) @@ -292,8 +292,8 @@ else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) { if (m.getFqn().size() =3D=3D 2 - && (m.getFqn().get(1).equals(JBossCacheStorage.NODES) = - || m.getFqn().get(1).equals(JBossCacheStorage.PROPS))) + && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) = + || m.getFqn().get(0).equals(JBossCacheStorage.PROPS))) { String id =3D (String) m.getFqn().get(1); ItemData removedItemData =3D jdbcConnection.getItemData(id); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 15:3= 2:31 UTC (rev 606) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 15:4= 3:12 UTC (rev 607) @@ -524,9 +524,28 @@ { = // prepare - + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + = + String nodeId =3D IdGenerator.generate(); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); + conn.commit(); + = + List modifications =3D new ArrayList(); + = + conn =3D persistentContainer.openConnection(); + = + NodeData nodeData =3D (NodeData) conn.getItemData(nodeId); + = + modifications.addAll(removeNode(nodeData)); + = + loader.put(modifications); + = // tests it - + conn =3D persistentContainer.openConnection(); + = + NodeData removedNodeData =3D (NodeData) conn.getItemData(nodeData.ge= tIdentifier()); = + = + assertNull(removedNodeData); } = public void testUpdateProperty() throws Exception --===============5660068035581627768==-- From do-not-reply at jboss.org Thu Nov 12 10:46:08 2009 Content-Type: multipart/mixed; boundary="===============8808145496584730711==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r608 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry. Date: Thu, 12 Nov 2009 10:46:08 -0500 Message-ID: <200911121546.nACFk8Eb019432@svn01.web.mwc.hst.phx2.redhat.com> --===============8808145496584730711== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: vparfonov Date: 2009-11-12 10:46:07 -0500 (Thu, 12 Nov 2009) New Revision: 608 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/registry/RESTRegistryService.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/registry/RegistryService.java Log: EXOJCR-233 : if you need update RegitryEnter and create it if it's not exis= t just add QueryParam createIfNotExist=3Dtrue Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/registry/RESTRegistryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/registry/RESTRegistryService.java 2009-11-12 15:43:12 UTC (rev 607) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/registry/RESTRegistryService.java 2009-11-12 15:46:07 UTC (rev 608) @@ -18,16 +18,6 @@ */ package org.exoplatform.services.jcr.ext.registry; = -import org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderServ= ice; -import org.exoplatform.services.jcr.ext.common.SessionProvider; -import org.exoplatform.services.jcr.ext.registry.Registry.RegistryNode; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.exoplatform.services.rest.ext.util.XlinkHref; -import org.exoplatform.services.rest.resource.ResourceContainer; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - import java.io.InputStream; import java.net.URI; = @@ -42,6 +32,7 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; @@ -50,6 +41,16 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.dom.DOMSource; = +import org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderServ= ice; +import org.exoplatform.services.jcr.ext.common.SessionProvider; +import org.exoplatform.services.jcr.ext.registry.Registry.RegistryNode; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.exoplatform.services.rest.ext.util.XlinkHref; +import org.exoplatform.services.rest.resource.ResourceContainer; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + /** * @author Andrey Parfonov * @version $Id: $ @@ -181,7 +182,7 @@ @Path("/{groupName:.+}/") @Consumes(MediaType.APPLICATION_XML) public Response recreateEntry(InputStream entryStream, @PathParam("repo= sitory") String repository, - @PathParam("groupName") String groupName, @Context UriInfo uriInfo) + @PathParam("groupName") String groupName, @Context UriInfo uriInfo, = @QueryParam("createIfNotExist") boolean createIfNotExist) { = SessionProvider sessionProvider =3D sessionProviderService.getSessio= nProvider(null); @@ -189,7 +190,10 @@ { regService.getRepositoryService().setCurrentRepositoryName(reposi= tory); RegistryEntry entry =3D RegistryEntry.parse(entryStream); - regService.recreateEntry(sessionProvider, normalizePath(groupName= ), entry); + if (createIfNotExist) + regService.updateEntry(sessionProvider, normalizePath(groupNam= e), entry); + else + regService.recreateEntry(sessionProvider, normalizePath(groupN= ame), entry); URI location =3D uriInfo.getRequestUriBuilder().path(entry.getNam= e()).build(); return Response.created(location).build(); } Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/registry/RegistryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/registry/RegistryService.java 2009-11-12 15:43:12 UTC (rev 607) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/registry/RegistryService.java 2009-11-12 15:46:07 UTC (rev 608) @@ -239,7 +239,51 @@ throw new RepositoryException("Can't get XML representation from = stream " + te); } } + = + = + = + /** + * {@inheritDoc} + */ + public void updateEntry(final SessionProvider sessionProvider, final St= ring groupPath, final RegistryEntry entry) + throws RepositoryException + { = + final String entryRelPath =3D EXO_REGISTRY + "/" + groupPath + "/" += entry.getName(); + final String parentFullPath =3D "/" + EXO_REGISTRY + "/" + groupPath; + + try + { + Session session =3D session(sessionProvider, repositoryService.ge= tCurrentRepository()); + + // Don't care about concurrency, Session should be dedicated to t= he Thread, see JCR-765 + // synchronized (session) { + try { = + Node node =3D session.getRootNode().getNode(entryRelPath); + // delete existing entry... + node.remove(); + // create same entry, + // [PN] no check we need here, as we have deleted this node be= fore + // checkGroup(sessionProvider, fullParentPath); + session.importXML(parentFullPath, entry.getAsInputStream(), IM= PORT_UUID_CREATE_NEW); + } catch (PathNotFoundException e) { + createEntry(sessionProvider, groupPath, entry); + } + // save recreated changes + session.save(); + // } + } + catch (IOException ioe) + { + throw new RepositoryException("Item " + parentFullPath + "can't b= e created " + ioe); + } + catch (TransformerException te) + { + throw new RepositoryException("Can't get XML representation from = stream " + te); + } + } + + /** * {@inheritDoc} */ --===============8808145496584730711==-- From do-not-reply at jboss.org Thu Nov 12 10:46:23 2009 Content-Type: multipart/mixed; boundary="===============3849596778939879924==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r609 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 10:46:23 -0500 Message-ID: <200911121546.nACFkNfF019476@svn01.web.mwc.hst.phx2.redhat.com> --===============3849596778939879924== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 10:46:23 -0500 (Thu, 12 Nov 2009) New Revision: 609 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 15:4= 6:07 UTC (rev 608) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 15:4= 6:23 UTC (rev 609) @@ -487,8 +487,28 @@ { = // prepare - + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + = + String nodeId =3D IdGenerator.generate(); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); + conn.commit(); + = + List modifications =3D new ArrayList(); + = + conn =3D persistentContainer.openConnection(); + = + NodeData nodeData =3D (NodeData) conn.getItemData(nodeId); + = + modifications.addAll(removeNode(nodeData)); + = + loader.put(modifications); + = // tests it + conn =3D persistentContainer.openConnection(); + = + NodeData removedNodeData =3D (NodeData) conn.getItemData(nodeData.ge= tIdentifier()); = + = + assertNull(removedNodeData); = } = @@ -524,28 +544,9 @@ { = // prepare - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = - String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); - conn.commit(); - = - List modifications =3D new ArrayList(); - = - conn =3D persistentContainer.openConnection(); - = - NodeData nodeData =3D (NodeData) conn.getItemData(nodeId); - = - modifications.addAll(removeNode(nodeData)); - = - loader.put(modifications); - = // tests it - conn =3D persistentContainer.openConnection(); = - NodeData removedNodeData =3D (NodeData) conn.getItemData(nodeData.ge= tIdentifier()); = - = - assertNull(removedNodeData); } = public void testUpdateProperty() throws Exception --===============3849596778939879924==-- From do-not-reply at jboss.org Thu Nov 12 10:55:39 2009 Content-Type: multipart/mixed; boundary="===============8694226479870812870==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r610 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 10:55:39 -0500 Message-ID: <200911121555.nACFtdnx020992@svn01.web.mwc.hst.phx2.redhat.com> --===============8694226479870812870== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-12 10:55:39 -0500 (Thu, 12 Nov 2009) New Revision: 610 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java Log: EXOJCR-202: IndexerCacheLoaderRuntimeTest test updated Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-12 15:46:23 UTC (rev 609) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-12 15:55:39 UTC (rev 610) @@ -117,96 +117,102 @@ = public void setUp() throws Exception { - try - { - super.setUp(); + super.setUp(); = - initPersistence(); + initPersistence(); = - loader =3D new IndexerCacheLoader(); - loader.injectDependencies(manager); + loader =3D new IndexerCacheLoader(); + loader.injectDependencies(manager); = - initJCRRoot(); + initJCRRoot(); = - // // JBossCache = - // initJBCConfig(); - // - // cache =3D new DefaultCacheFactory().createCache(jbcConfig, false); - // - // initJBC(); - - // // run cache - // cache.create(); - // cache.start(); - // - // Node cacheRoot =3D cache.getRoot= (); - // - // // prepare cache structures - // - // nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCache= Storage.NODES)); - // props =3D cacheRoot.addChild(Fqn.fromString(JBossCache= Storage.PROPS)); - // session =3D cacheRoot.addChild(Fqn.fromString(JBossCac= heStorage.SESSION)); - // - // // JCR connection - // conn =3D new JBossCacheStorageConnection(cache, nodes,= props, session); - // // add root (/) - // conn.add(new TransientNodeData(Constants.ROOT_PATH, Co= nstants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - // new InternalQName[0], 0, null, new AccessControlLis= t())); - // - // String propId1 =3D "rootf111111"; - // QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT= _PATH, Constants.JCR_PRIMARYTYPE); - // TransientPropertyData propData1 =3D - // new TransientPropertyData(propPath1, propId1, 1, Pr= opertyType.NAME, Constants.ROOT_UUID, false); - // propData1.setValue(new TransientValueData(Constants.NT= _UNSTRUCTURED)); - // conn.add(propData1); - // - // conn.commit(); - manager.start(); - } - catch (Exception e) - { - e.printStackTrace(); - throw e; - } + manager.start(); } = public void testAddNode() throws Exception { + List modifications =3D new ArrayList(); + // prepare add node to storage WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = String node1id =3D IdGenerator.generate(); QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); = - // add root (/) with jcr:primaryType - addDbNode(conn, node1path, node1id, Constants.ROOT_UUID, Constants.N= T_UNSTRUCTURED); + // add node (/) with jcr:primaryType + NodeData nodeData =3D + new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + conn.add(nodeData); + modifications.addAll(this.addNode(nodeData)); + + // add property (/jcr:primaryType) + TransientPropertyData propData =3D + createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); + conn.add(propData); + modifications.addAll(this.addProperty(propData)); + conn.commit(); + loader.put(modifications); = - List node =3D this.createNode(node1path, node1id, Constant= s.NT_UNSTRUCTURED, new InternalQName[0]); + // check do we really have node and its property + conn =3D persistentContainer.openConnection(); + NodeData nd =3D (NodeData)conn.getItemData(node1id); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); = + PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); + assertNotNull(pd); + assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); + + // find node by search engine + SearchIndex index =3D ((SearchIndex)manager.getHandler()); + IndexReader reader =3D index.getIndexReader(); + + IndexSearcher searcher =3D new IndexSearcher(reader); + + Query query =3D new TermQuery(new Term("_:UUID", node1id)); + Hits hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + } + + public void testRemoveNode() throws Exception + { List modifications =3D new ArrayList(); = - for (ItemData data : node) - { - if (data.isNode()) - { - modifications.addAll(addNode((NodeData)data)); - } - else - { - modifications.addAll(addProperty((PropertyData)data)); - } - } + // prepare add node to storage + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + String node1id =3D IdGenerator.generate(); + QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); + + // add node (/) with jcr:primaryType + NodeData nodeData =3D + new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + conn.add(nodeData); + modifications.addAll(this.addNode(nodeData)); + + // add property (/jcr:primaryType) + TransientPropertyData propData =3D + createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); + conn.add(propData); + modifications.addAll(this.addProperty(propData)); + + conn.commit(); loader.put(modifications); = - // check do we really have node - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); - - NodeData nd =3D (NodeData)connection.getItemData(node1id); + // check do we really have node and its property + conn =3D persistentContainer.openConnection(); + NodeData nd =3D (NodeData)conn.getItemData(node1id); assertNotNull(nd); assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); = + PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); + assertNotNull(pd); + assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); + // find node by search engine SearchIndex index =3D ((SearchIndex)manager.getHandler()); IndexReader reader =3D index.getIndexReader(); @@ -216,6 +222,39 @@ Query query =3D new TermQuery(new Term("_:UUID", node1id)); Hits hit =3D searcher.search(query); assertEquals(1, hit.length()); + + // remove node1 + modifications.clear(); + + // PropertyData prop =3D (PropertyData)node.get(1); + // NodeData n =3D (NodeData)node.get(0); + + conn.delete(pd); + modifications.addAll(removeProperty(pd)); + conn.delete(nd); + modifications.addAll(removeNode(nd)); + conn.commit(); + + // NodeData data =3D + // new TransientNodeData(node1path, node1id, 1, Constants.NT= _UNSTRUCTURED, new InternalQName[0], 0, null, + // new AccessControlList()); + // conn.delete(data); + //conn.commit(); + + // check removing + conn =3D persistentContainer.openConnection(); + nd =3D (NodeData)conn.getItemData(node1id); + assertNull(nd); + + loader.put(modifications); + + // check index; + reader =3D index.getIndexReader(); + + searcher =3D new IndexSearcher(reader); + hit =3D searcher.search(query); + assertEquals(0, hit.length()); + } = // public void testAddProperty() throws Exception --===============8694226479870812870==-- From do-not-reply at jboss.org Thu Nov 12 11:04:22 2009 Content-Type: multipart/mixed; boundary="===============7156175187637654048==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r611 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 11:04:22 -0500 Message-ID: <200911121604.nACG4Mbt022555@svn01.web.mwc.hst.phx2.redhat.com> --===============7156175187637654048== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 11:04:22 -0500 (Thu, 12 Nov 2009) New Revision: 611 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 15:5= 5:39 UTC (rev 610) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:0= 4:22 UTC (rev 611) @@ -499,6 +499,11 @@ = NodeData nodeData =3D (NodeData) conn.getItemData(nodeId); = + List properties =3D conn.getChildPropertiesData(nodeDa= ta); + = + for (PropertyData propertyData : properties) + modifications.addAll(removeProperty(propertyData)); + = modifications.addAll(removeNode(nodeData)); = loader.put(modifications); @@ -509,6 +514,9 @@ NodeData removedNodeData =3D (NodeData) conn.getItemData(nodeData.ge= tIdentifier()); = = assertNull(removedNodeData); + = + for (PropertyData propertyData : properties) + assertNull((PropertyData) conn.getItemData(propertyData.getIdenti= fier())); = } = --===============7156175187637654048==-- From do-not-reply at jboss.org Thu Nov 12 11:07:40 2009 Content-Type: multipart/mixed; boundary="===============3560335781941707293==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r612 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util. Date: Thu, 12 Nov 2009 11:07:40 -0500 Message-ID: <200911121607.nACG7eYW024025@svn01.web.mwc.hst.phx2.redhat.com> --===============3560335781941707293== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-12 11:07:40 -0500 (Thu, 12 Nov 2009) New Revision: 612 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/util/StringNumberParser.java Log: EXOJCR-237 syntax for seconds added Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/util/StringNumberParser.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/util/StringNumberParser.java 2009-11-12 16:04:22 UTC (rev 611) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/util/StringNumberParser.java 2009-11-12 16:07:40 UTC (rev 612) @@ -160,6 +160,10 @@ { return Long.valueOf(text.substring(0, text.length() - 2)); } + else if (text.endsWith("s")) + { + return Long.valueOf(text) * 1000; + } else if (text.endsWith("m")) { return Long.valueOf(text.substring(0, text.length() - 1)) * 60000= ; // 1000 * 60 --===============3560335781941707293==-- From do-not-reply at jboss.org Thu Nov 12 11:18:40 2009 Content-Type: multipart/mixed; boundary="===============5782923070418050770==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r613 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 11:18:40 -0500 Message-ID: <200911121618.nACGIeug026677@svn01.web.mwc.hst.phx2.redhat.com> --===============5782923070418050770== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 11:18:40 -0500 (Thu, 12 Nov 2009) New Revision: 613 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for JDBC loader Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:0= 7:40 UTC (rev 612) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:1= 8:40 UTC (rev 613) @@ -83,23 +83,18 @@ = loader =3D new JDBCCacheLoader(); loader.injectDependencies(persistentContainer); - = + initJCRRoot(); } - = - = = @Override protected void tearDown() throws Exception { // delete all in DB - = - = + super.tearDown(); } = - - protected void initPersistence() throws Exception { // Create WorkspaceEntry @@ -180,36 +175,36 @@ = containerEntry.setValueStorages(list); } - = + WorkspaceEntry workspaceEntry =3D new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); workspaceEntry.setContainer(containerEntry); = -// // Indexer -// ArrayList qParams =3D new ArrayList(); -// qParams.add(new SimpleParameterEntry("indexDir", "../temp/index/" = + IdGenerator.generate())); -// QueryHandlerEntry qEntry =3D -// new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.q= uery.lucene.SearchIndex", qParams); -// workspaceEntry.setQueryHandler(qEntry); -// -// // cache -// ArrayList cacheParams =3D new ArrayList(); -// cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); -// cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); -// CacheEntry cacheEntry =3D new CacheEntry(cacheParams); -// cacheEntry.setType("org.exoplatform.services.jcr.impl.dataflow.per= sistent.LinkedWorkspaceStorageCacheImpl"); -// workspaceEntry.setCache(cacheEntry); -// = -// // lock -// LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); -// lockManagerEntry.setTimeout(900000); -// LockPersisterEntry persisterEntry =3D new LockPersisterEntry(); -// persisterEntry.setType("org.exoplatform.services.jcr.impl.core.loc= k.FileSystemLockPersister"); -// ArrayList lpParams =3D new ArrayList(); -// lpParams.add(new SimpleParameterEntry("path", "../temp/lock")); -// persisterEntry.setParameters(lpParams); -// lockManagerEntry.setPersister(persisterEntry); -// workspaceEntry.setLockManager(lockManagerEntry); + // // Indexer + // ArrayList qParams =3D new ArrayList(); + // qParams.add(new SimpleParameterEntry("indexDir", "../temp/in= dex/" + IdGenerator.generate())); + // QueryHandlerEntry qEntry =3D + // new QueryHandlerEntry("org.exoplatform.services.jcr.impl.= core.query.lucene.SearchIndex", qParams); + // workspaceEntry.setQueryHandler(qEntry); + // + // // cache + // ArrayList cacheParams =3D new ArrayList(); + // cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); + // cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); + // CacheEntry cacheEntry =3D new CacheEntry(cacheParams); + // cacheEntry.setType("org.exoplatform.services.jcr.impl.datafl= ow.persistent.LinkedWorkspaceStorageCacheImpl"); + // workspaceEntry.setCache(cacheEntry); + // = + // // lock + // LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); + // lockManagerEntry.setTimeout(900000); + // LockPersisterEntry persisterEntry =3D new LockPersisterEntry= (); + // persisterEntry.setType("org.exoplatform.services.jcr.impl.co= re.lock.FileSystemLockPersister"); + // ArrayList lpParams =3D new ArrayList(); + // lpParams.add(new SimpleParameterEntry("path", "../temp/lock"= )); + // persisterEntry.setParameters(lpParams); + // lockManagerEntry.setPersister(persisterEntry); + // workspaceEntry.setLockManager(lockManagerEntry); = // workspaceEntry return workspaceEntry; @@ -247,7 +242,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); @@ -258,14 +253,14 @@ = conn.commit(); } - = + private void deleteJCRRoot() throws Exception { // prepare = WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); @@ -286,20 +281,14 @@ * @param primaryType InternalQName * @throws Exception */ - private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType, InternalQName[] mixinTypeNames) - throws Exception + private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType) throws Exception { - // create node with property jcr:primaryType - List list =3D createNode(root, nodeId, primaryType, mixinT= ypeNames); - = - // add node with property jcr:primaryType - for (ItemData itemData : list) - { - if (itemData instanceof NodeData) - conn.add((NodeData)itemData); - else - conn.add((PropertyData)itemData); - } + // add root (/) + conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, null, + new AccessControlList())); + + // add property (/jcr:primaryType) + conn.add(createProperty(root, nodeId, Constants.JCR_PRIMARYTYPE, pri= maryType, false)); } = /** @@ -311,18 +300,18 @@ * @param mixinTypeNames InternalQName = * @throws Exception */ - private List createNode(QPath path, String nodeId, InternalQN= ame primaryType, InternalQName[] mixinTypeNames) - throws Exception + private List createNode(QPath path, String nodeId, InternalQN= ame primaryType, + InternalQName[] mixinTypeNames) throws Exception { List list =3D new ArrayList(); - = + // add node = - list.add(new TransientNodeData(path, nodeId, 1, primaryType, (mixinT= ypeNames =3D=3D null ? new InternalQName[0] : null), 0, null, - new AccessControlList())); + list.add(new TransientNodeData(path, nodeId, 1, primaryType, (mixinT= ypeNames =3D=3D null ? new InternalQName[0] + : null), 0, null, new AccessControlList())); = // add property (/jcr:primaryType) list.add(createProperty(path, nodeId, Constants.JCR_PRIMARYTYPE, pri= maryType, false)); - = + return list; } = @@ -341,14 +330,14 @@ InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception { TransientPropertyData propData =3D createProperty(nodePath, nodeId, = propertyName, propertyValue, multiValued); - = + conn.add(propData); = return propData; } - = + /** - * Create Property. + * Create Property data. * * @param nodePath QPath * @param nodeId String @@ -357,13 +346,12 @@ * @return TransientPropertyData * @throws Exception */ - private TransientPropertyData createProperty(QPath nodePath, String nod= eId, - InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception + private TransientPropertyData createProperty(QPath nodePath, String nod= eId, InternalQName propertyName, + Object propertyValue, boolean multiValued) throws Exception { String propId =3D IdGenerator.generate(); QPath propPath =3D QPath.makeChildPath(nodePath, propertyName); - TransientPropertyData propData =3D - new TransientPropertyData(propPath, propId, 1, 1, nodeId, multiVa= lued); + TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, nodeId, multiValued); = List values =3D new ArrayList(); if (multiValued) @@ -398,7 +386,7 @@ = return propData; } - = + /** * Delete Property to the connection but doesn't save it. * @@ -413,7 +401,7 @@ { // add property (/jcr:primaryType) addDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARY= TYPE, primaryType, false); - = + // add root (/) conn.delete(new TransientNodeData(root, nodeId, 1, primaryType, new = InternalQName[0], 0, null, new AccessControlList())); @@ -425,25 +413,27 @@ { // prepare String nodeId =3D IdGenerator.generate(); - List list =3D createNode(QPath.makeChildPath(Constants.ROO= T_PATH, InternalQName.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, = null); - = + List list =3D + createNode(QPath.makeChildPath(Constants.ROOT_PATH, InternalQName= .parse("[]node")), nodeId, + Constants.NT_UNSTRUCTURED, null); + List modifications =3D new ArrayList(); - = - for (ItemData itemData : list) = + + for (ItemData itemData : list) if (itemData instanceof NodeData) - modifications.addAll(addNode((NodeData) itemData)); + modifications.addAll(addNode((NodeData)itemData)); else - modifications.addAll(addProperty((PropertyData) itemData)); - = + modifications.addAll(addProperty((PropertyData)itemData)); + loader.put(modifications); = // tests it - NodeData srcNodeData =3D (NodeData) list.get(0); - = + NodeData srcNodeData =3D (NodeData)list.get(0); + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - = - NodeData destNodeData =3D (NodeData) conn.getItemData(nodeId); - = + + NodeData destNodeData =3D (NodeData)conn.getItemData(nodeId); + assertNotNull(destNodeData); assertEquals(srcNodeData.getIdentifier(), destNodeData.getIdentifier= ()); assertEquals(srcNodeData.getOrderNumber(), destNodeData.getOrderNumb= er()); @@ -456,19 +446,20 @@ public void testAddProperty() throws Exception { // prepare - TransientPropertyData propData =3D createProperty(Constants.ROOT_PAT= H, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", false); - = + TransientPropertyData propData =3D + createProperty(Constants.ROOT_PATH, Constants.ROOT_UUID, Constant= s.JCR_DATA, "JCR DATA VALUE", false); + List modifications =3D new ArrayList(); - = + modifications.addAll(addProperty(propData)); - = + loader.put(modifications); = // tests it WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); - = - PropertyData destPropData =3D (PropertyData) connection.getItemData(= propData.getIdentifier()); - = + + PropertyData destPropData =3D (PropertyData)connection.getItemData(p= ropData.getIdentifier()); + assertNotNull(destPropData); assertEquals(propData.getIdentifier(), destPropData.getIdentifier()); assertEquals(propData.getParentIdentifier(), destPropData.getParentI= dentifier()); @@ -477,10 +468,10 @@ assertEquals(propData.getQPath(), destPropData.getQPath()); assertEquals(propData.getValues().size(), destPropData.getValues().s= ize()); assertEquals(1, destPropData.getValues().size()); - = + ValueData valueData =3D destPropData.getValues().get(0); - assertEquals("JCR DATA VALUE", new String (valueData.getAsByteArray(= ), "UTF-8")); - = + assertEquals("JCR DATA VALUE", new String(valueData.getAsByteArray()= , "UTF-8")); + } = public void testDeleteNode() throws Exception @@ -488,35 +479,36 @@ = // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - = + String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, + Constants.NT_UNSTRUCTURED); conn.commit(); - = + List modifications =3D new ArrayList(); - = + conn =3D persistentContainer.openConnection(); - = - NodeData nodeData =3D (NodeData) conn.getItemData(nodeId); - = + + NodeData nodeData =3D (NodeData)conn.getItemData(nodeId); + List properties =3D conn.getChildPropertiesData(nodeDa= ta); - = + for (PropertyData propertyData : properties) modifications.addAll(removeProperty(propertyData)); - = + modifications.addAll(removeNode(nodeData)); - = + loader.put(modifications); - = + // tests it conn =3D persistentContainer.openConnection(); - = - NodeData removedNodeData =3D (NodeData) conn.getItemData(nodeData.ge= tIdentifier()); = - = + + NodeData removedNodeData =3D (NodeData)conn.getItemData(nodeData.get= Identifier()); + assertNull(removedNodeData); - = + for (PropertyData propertyData : properties) - assertNull((PropertyData) conn.getItemData(propertyData.getIdenti= fier())); + assertNull((PropertyData)conn.getItemData(propertyData.getIdentif= ier())); = } = @@ -525,26 +517,29 @@ = // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - = + String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, + Constants.NT_UNSTRUCTURED); conn.commit(); - = + conn =3D persistentContainer.openConnection(); - PropertyData propData =3D addDbProperty(conn, QPath.makeChildPath(Co= nstants.ROOT_PATH, InternalQName.parse("[]node")), nodeId, InternalQName.pa= rse("[]prop1"), "_Tesed_VALUE", false); + PropertyData propData =3D + addDbProperty(conn, QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]node")), nodeId, + InternalQName.parse("[]prop1"), "_Tesed_VALUE", false); conn.commit(); - = + List modifications =3D new ArrayList(); - = + modifications.addAll(removeProperty(propData)); - = + loader.put(modifications); - = + // tests it conn =3D persistentContainer.openConnection(); - = - PropertyData removedPropertyData =3D (PropertyData) conn.getItemData= (propData.getIdentifier()); = - = + + PropertyData removedPropertyData =3D (PropertyData)conn.getItemData(= propData.getIdentifier()); + assertNull(removedPropertyData); } = @@ -552,9 +547,9 @@ { = // prepare - = + // tests it - = + } = public void testUpdateProperty() throws Exception @@ -580,22 +575,23 @@ = // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - = + String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, null); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, + Constants.NT_UNSTRUCTURED); conn.commit(); - = + // tests it conn =3D persistentContainer.openConnection(); - = - NodeData srcNodeData =3D (NodeData) conn.getItemData(nodeId); - = - Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.NODES + "/" + nodeId)); - = + + NodeData srcNodeData =3D (NodeData)conn.getItemData(nodeId); + + Map attrebutes =3D loader.get(Fqn.fromString("/" + J= BossCacheStorage.NODES + "/" + nodeId)); + assertNotNull(attrebutes); - = - NodeData destNodeData =3D (NodeData) attrebutes.get(JBossCacheStorag= e.ITEM_DATA); - = + + NodeData destNodeData =3D (NodeData)attrebutes.get(JBossCacheStorage= .ITEM_DATA); + assertNotNull(destNodeData); assertEquals(srcNodeData.getIdentifier(), destNodeData.getIdentifier= ()); assertEquals(srcNodeData.getOrderNumber(), destNodeData.getOrderNumb= er()); @@ -619,17 +615,20 @@ = // prepare WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); - = - TransientPropertyData propData =3D addDbProperty(connection, Constan= ts.ROOT_PATH, Constants.ROOT_UUID, Constants.JCR_DATA, "JCR DATA VALUE", f= alse); + + TransientPropertyData propData =3D + addDbProperty(connection, Constants.ROOT_PATH, Constants.ROOT_UUI= D, Constants.JCR_DATA, "JCR DATA VALUE", + false); connection.commit(); - = + // tests it - Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.PROPS + "/" + propData.getIdentifier())); - = + Map attrebutes =3D + loader.get(Fqn.fromString("/" + JBossCacheStorage.PROPS + "/" + p= ropData.getIdentifier())); + assertNotNull(attrebutes); - = - PropertyData destPropData =3D (PropertyData) attrebutes.get(JBossCac= heStorage.ITEM_DATA); - = + + PropertyData destPropData =3D (PropertyData)attrebutes.get(JBossCach= eStorage.ITEM_DATA); + assertNotNull(destPropData); assertEquals(propData.getIdentifier(), destPropData.getIdentifier()); assertEquals(propData.getParentIdentifier(), destPropData.getParentI= dentifier()); @@ -638,9 +637,9 @@ assertEquals(propData.getQPath(), destPropData.getQPath()); assertEquals(propData.getValues().size(), destPropData.getValues().s= ize()); assertEquals(1, destPropData.getValues().size()); - = + ValueData valueData =3D destPropData.getValues().get(0); - assertEquals("JCR DATA VALUE", new String (valueData.getAsByteArray(= ), "UTF-8")); + assertEquals("JCR DATA VALUE", new String(valueData.getAsByteArray()= , "UTF-8")); = } = --===============5782923070418050770==-- From do-not-reply at jboss.org Thu Nov 12 11:28:46 2009 Content-Type: multipart/mixed; boundary="===============8422987655351621182==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r614 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 11:28:45 -0500 Message-ID: <200911121628.nACGSjEm029143@svn01.web.mwc.hst.phx2.redhat.com> --===============8422987655351621182== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 11:28:45 -0500 (Thu, 12 Nov 2009) New Revision: 614 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for JDBC loader: fix of helpers Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:1= 8:40 UTC (rev 613) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:2= 8:45 UTC (rev 614) @@ -18,19 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.io.InputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.sql.DataSource; - import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.access.AccessControlList; @@ -45,7 +32,6 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; @@ -59,6 +45,19 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = +import java.io.InputStream; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + /** * @author Alex Reshetnyak<= /a> * @version $Id$ @@ -281,7 +280,8 @@ * @param primaryType InternalQName * @throws Exception */ - private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType) throws Exception + private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType) + throws Exception { // add root (/) conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, null, @@ -292,30 +292,6 @@ } = /** - * Create Node to the connection but doesn't save it. - * - * @param path QPath - * @param nodeId String - * @param primaryType InternalQName - * @param mixinTypeNames InternalQName = - * @throws Exception - */ - private List createNode(QPath path, String nodeId, InternalQN= ame primaryType, - InternalQName[] mixinTypeNames) throws Exception - { - List list =3D new ArrayList(); - - // add node = - list.add(new TransientNodeData(path, nodeId, 1, primaryType, (mixinT= ypeNames =3D=3D null ? new InternalQName[0] - : null), 0, null, new AccessControlList())); - - // add property (/jcr:primaryType) - list.add(createProperty(path, nodeId, Constants.JCR_PRIMARYTYPE, pri= maryType, false)); - - return list; - } - - /** * Add Property to the connection but doesn't save it. * * @param conn WorkspaceStorageConnection @@ -356,9 +332,9 @@ List values =3D new ArrayList(); if (multiValued) { - if (propertyValue instanceof List) + if (propertyValue instanceof List) { - values.addAll((List)propertyValue); + values.addAll((List)propertyValue); } else throw new Exception("propertyValue should be a List"); @@ -413,34 +389,33 @@ { // prepare String nodeId =3D IdGenerator.generate(); - List list =3D - createNode(QPath.makeChildPath(Constants.ROOT_PATH, InternalQName= .parse("[]node")), nodeId, - Constants.NT_UNSTRUCTURED, null); = - List modifications =3D new ArrayList(); + QPath nodePath =3D QPath.parse("[]node:1"); + NodeData node =3D + new TransientNodeData(nodePath, nodeId, 1, Constants.NT_UNSTRUCTU= RED, new InternalQName[0], 0, + Constants.ROOT_PARENT_UUID, new AccessControlList()); = - for (ItemData itemData : list) - if (itemData instanceof NodeData) - modifications.addAll(addNode((NodeData)itemData)); - else - modifications.addAll(addProperty((PropertyData)itemData)); + PropertyData primaryType =3D + createProperty(nodePath, nodeId, Constants.JCR_PRIMARYTYPE, Const= ants.NT_UNSTRUCTURED, false); = + List modifications =3D new ArrayList(); + modifications.addAll(addNode(node)); + modifications.addAll(addProperty(primaryType)); + loader.put(modifications); = // tests it - NodeData srcNodeData =3D (NodeData)list.get(0); - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = NodeData destNodeData =3D (NodeData)conn.getItemData(nodeId); = assertNotNull(destNodeData); - assertEquals(srcNodeData.getIdentifier(), destNodeData.getIdentifier= ()); - assertEquals(srcNodeData.getOrderNumber(), destNodeData.getOrderNumb= er()); - assertEquals(srcNodeData.getParentIdentifier(), destNodeData.getPare= ntIdentifier()); - assertEquals(srcNodeData.getPersistedVersion(), destNodeData.getPers= istedVersion()); - assertEquals(srcNodeData.getQPath().getAsString(), destNodeData.getQ= Path().getAsString()); - assertEquals(srcNodeData.getPrimaryTypeName().getAsString(), destNod= eData.getPrimaryTypeName().getAsString()); + assertEquals(node.getIdentifier(), destNodeData.getIdentifier()); + assertEquals(node.getOrderNumber(), destNodeData.getOrderNumber()); + assertEquals(node.getParentIdentifier(), destNodeData.getParentIdent= ifier()); + assertEquals(node.getPersistedVersion(), destNodeData.getPersistedVe= rsion()); + assertEquals(node.getQPath().getAsString(), destNodeData.getQPath().= getAsString()); + assertEquals(node.getPrimaryTypeName().getAsString(), destNodeData.g= etPrimaryTypeName().getAsString()); } = public void testAddProperty() throws Exception --===============8422987655351621182==-- From do-not-reply at jboss.org Thu Nov 12 11:30:44 2009 Content-Type: multipart/mixed; boundary="===============0642517314256121054==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r615 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 11:30:44 -0500 Message-ID: <200911121630.nACGUi0U029745@svn01.web.mwc.hst.phx2.redhat.com> --===============0642517314256121054== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-12 11:30:44 -0500 (Thu, 12 Nov 2009) New Revision: 615 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java Log: EXOJCR-202: IndexerCacheLoaderRuntimeTest test updated Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-12 16:28:45 UTC (rev 614) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-12 16:30:44 UTC (rev 615) @@ -41,6 +41,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; @@ -257,37 +258,97 @@ = } = - // public void testAddProperty() throws Exception - // { - // // prepare - // TransientPropertyData propData =3D - // createProperty(Constants.ROOT_PATH, Constants.ROOT_UUID, Con= stants.JCR_DATA, "JCR DATA VALUE", false); - // - // List modifications =3D new ArrayList(); - // - // modifications.addAll(addProperty(propData)); - // - // loader.put(modifications); - // - // // tests it - // WorkspaceStorageConnection connection =3D persistentContainer.o= penConnection(); - // - // PropertyData destPropData =3D (PropertyData)connection.getItemD= ata(propData.getIdentifier()); - // - // assertNotNull(destPropData); - // assertEquals(propData.getIdentifier(), destPropData.getIdentifi= er()); - // assertEquals(propData.getParentIdentifier(), destPropData.getPa= rentIdentifier()); - // assertEquals(propData.getPersistedVersion(), destPropData.getPe= rsistedVersion()); - // assertEquals(propData.getType(), destPropData.getType()); - // assertEquals(propData.getQPath(), destPropData.getQPath()); - // assertEquals(propData.getValues().size(), destPropData.getValue= s().size()); - // assertEquals(1, destPropData.getValues().size()); - // - // ValueData valueData =3D destPropData.getValues().get(0); - // assertEquals("JCR DATA VALUE", new String(valueData.getAsByteAr= ray(), "UTF-8")); - // - // } + public void testUpdateAddProperty() throws Exception + { = + List modifications =3D new ArrayList(); + + // prepare add node to storage + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + + String node1id =3D IdGenerator.generate(); + QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); + + // add node (/) with jcr:primaryType + NodeData nodeData =3D + new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + conn.add(nodeData); + modifications.addAll(this.addNode(nodeData)); + + // add property (/jcr:primaryType) + TransientPropertyData propData =3D + createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); + conn.add(propData); + modifications.addAll(this.addProperty(propData)); + + conn.commit(); + loader.put(modifications); + + // check do we really have node and its property + conn =3D persistentContainer.openConnection(); + NodeData nd =3D (NodeData)conn.getItemData(node1id); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); + + PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); + assertNotNull(pd); + assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); + + // find node by search engine + SearchIndex index =3D ((SearchIndex)manager.getHandler()); + IndexReader reader =3D index.getIndexReader(); + + IndexSearcher searcher =3D new IndexSearcher(reader); + + Query query =3D new TermQuery(new Term("_:UUID", node1id)); + Hits hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + modifications.clear(); + // prepare + TransientPropertyData newPropData =3D + createProperty(node1path, node1id, new InternalQName(Constants.NS= _DEFAULT_URI, "myProp"), "JCR DATA VALUE", + false); + + conn =3D persistentContainer.openConnection(); + conn.add(newPropData); + modifications.addAll(addProperty(newPropData)); + conn.commit(); + + loader.put(modifications); + + // tests it + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + + PropertyData destPropData =3D (PropertyData)connection.getItemData(n= ewPropData.getIdentifier()); + + assertNotNull(destPropData); + assertEquals(newPropData.getIdentifier(), destPropData.getIdentifier= ()); + assertEquals(newPropData.getParentIdentifier(), destPropData.getPare= ntIdentifier()); + assertEquals(newPropData.getPersistedVersion(), destPropData.getPers= istedVersion()); + assertEquals(newPropData.getType(), destPropData.getType()); + assertEquals(newPropData.getQPath(), destPropData.getQPath()); + assertEquals(newPropData.getValues().size(), destPropData.getValues(= ).size()); + assertEquals(1, destPropData.getValues().size()); + + ValueData valueData =3D destPropData.getValues().get(0); + assertEquals("JCR DATA VALUE", new String(valueData.getAsByteArray()= , "UTF-8")); + + reader =3D index.getIndexReader(); + + searcher =3D new IndexSearcher(reader); + + query =3D new TermQuery(new Term("_:UUID", node1id)); + hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + query =3D new TermQuery(new Term("FULL:myProp", "data")); + hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + } + /** * Add Property to the connection but doesn't save it. * --===============0642517314256121054==-- From do-not-reply at jboss.org Thu Nov 12 11:31:23 2009 Content-Type: multipart/mixed; boundary="===============6172738664331339376==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r616 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 11:31:23 -0500 Message-ID: <200911121631.nACGVN8Z029875@svn01.web.mwc.hst.phx2.redhat.com> --===============6172738664331339376== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 11:31:23 -0500 (Thu, 12 Nov 2009) New Revision: 616 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:3= 0:44 UTC (rev 615) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:3= 1:23 UTC (rev 616) @@ -580,9 +580,21 @@ { = // prepare - + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + = + String nodeId =3D IdGenerator.generate(); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED); + conn.commit(); + = // tests it - + Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.NODES + "/" + Constants.ROOT_UUID + "/" + "[]node:1")); + = + assertNotNull(attrebutes); + = + String destNodeId =3D (String) attrebutes.get(JBossCacheStorage.ITEM= _ID); + = + assertNotNull(destNodeId); + assertEquals(nodeId, destNodeId); = } = public void testGetPropertyByIdentifier() throws Exception --===============6172738664331339376==-- From do-not-reply at jboss.org Thu Nov 12 11:32:28 2009 Content-Type: multipart/mixed; boundary="===============5269397084372226789==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r617 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 11:32:28 -0500 Message-ID: <200911121632.nACGWSeX030059@svn01.web.mwc.hst.phx2.redhat.com> --===============5269397084372226789== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 11:32:27 -0500 (Thu, 12 Nov 2009) New Revision: 617 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201: test for JDBC loader Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:3= 1:23 UTC (rev 616) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:3= 2:27 UTC (rev 617) @@ -390,7 +390,7 @@ // prepare String nodeId =3D IdGenerator.generate(); = - QPath nodePath =3D QPath.parse("[]node:1"); + QPath nodePath =3D QPath.parse("[]:1[]node:1"); NodeData node =3D new TransientNodeData(nodePath, nodeId, 1, Constants.NT_UNSTRUCTU= RED, new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessControlList()); @@ -561,11 +561,11 @@ = NodeData srcNodeData =3D (NodeData)conn.getItemData(nodeId); = - Map attrebutes =3D loader.get(Fqn.fromString("/" + J= BossCacheStorage.NODES + "/" + nodeId)); + Map attributes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, nodeId)); = - assertNotNull(attrebutes); + assertNotNull(attributes); = - NodeData destNodeData =3D (NodeData)attrebutes.get(JBossCacheStorage= .ITEM_DATA); + NodeData destNodeData =3D (NodeData)attributes.get(JBossCacheStorage= .ITEM_DATA); = assertNotNull(destNodeData); assertEquals(srcNodeData.getIdentifier(), destNodeData.getIdentifier= ()); --===============5269397084372226789==-- From do-not-reply at jboss.org Thu Nov 12 11:51:16 2009 Content-Type: multipart/mixed; boundary="===============8499291419839095470==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r618 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 11:51:16 -0500 Message-ID: <200911121651.nACGpGJu002272@svn01.web.mwc.hst.phx2.redhat.com> --===============8499291419839095470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 11:51:16 -0500 (Thu, 12 Nov 2009) New Revision: 618 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:3= 2:27 UTC (rev 617) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-12 16:5= 1:16 UTC (rev 618) @@ -393,7 +393,7 @@ QPath nodePath =3D QPath.parse("[]:1[]node:1"); NodeData node =3D new TransientNodeData(nodePath, nodeId, 1, Constants.NT_UNSTRUCTU= RED, new InternalQName[0], 0, - Constants.ROOT_PARENT_UUID, new AccessControlList()); + Constants.ROOT_UUID, new AccessControlList()); = PropertyData primaryType =3D createProperty(nodePath, nodeId, Constants.JCR_PRIMARYTYPE, Const= ants.NT_UNSTRUCTURED, false); --===============8499291419839095470==-- From do-not-reply at jboss.org Thu Nov 12 12:03:16 2009 Content-Type: multipart/mixed; boundary="===============6304666593255146046==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r619 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 12 Nov 2009 12:03:16 -0500 Message-ID: <200911121703.nACH3GYK004989@svn01.web.mwc.hst.phx2.redhat.com> --===============6304666593255146046== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-12 12:03:15 -0500 (Thu, 12 Nov 2009) New Revision: 619 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 16:51:16= UTC (rev 618) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-12 17:03:15= UTC (rev 619) @@ -154,17 +154,6 @@ } = /** - * Get ID from Fqn. - * @param fqn - * @return - */ - private String getID(Fqn fqn) - { - //TODO - return fqn.toString().split("/")[2]; - } - - /** * Remove NodeData or PropertyData. * = * @param modification --===============6304666593255146046==-- From do-not-reply at jboss.org Thu Nov 12 14:01:52 2009 Content-Type: multipart/mixed; boundary="===============1625713299840389217==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r620 - jcr/branches. Date: Thu, 12 Nov 2009 14:01:52 -0500 Message-ID: <200911121901.nACJ1q0r031079@svn01.web.mwc.hst.phx2.redhat.com> --===============1625713299840389217== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 14:01:52 -0500 (Thu, 12 Nov 2009) New Revision: 620 Added: jcr/branches/1.12.0-OPT/ Log: Branch for JCR optimizations and experiments Copied: jcr/branches/1.12.0-OPT (from rev 619, jcr/trunk) --===============1625713299840389217==-- From do-not-reply at jboss.org Thu Nov 12 21:37:57 2009 Content-Type: multipart/mixed; boundary="===============2636151461127132688==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r621 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core and 6 other directories. Date: Thu, 12 Nov 2009 21:37:52 -0500 Message-ID: <200911130237.nAD2bq1O022958@svn01.web.mwc.hst.phx2.redhat.com> --===============2636151461127132688== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 21:37:50 -0500 (Thu, 12 Nov 2009) New Revision: 621 Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/impl/core/TestNodeOrder.java Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/dataflow/ItemDataConsumer.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/NodeImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/SessionDataManager.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspace= DataManager.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.ja= va jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.= java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.j= ava jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerPro= xy.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/session/SessionChangesLog.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/session/TransactionableDataManager.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/storage/WorkspaceStorageConnection.java Log: EXOJCR-221: optimization of ordernumber and SNS calculations Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/dataflow/ItemDataConsumer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/dataflow/ItemDataConsumer.java 2009-11-12 19:01:52 UTC (= rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/dataflow/ItemDataConsumer.java 2009-11-13 02:37:50 UTC (= rev 621) @@ -28,48 +28,72 @@ import javax.jcr.RepositoryException; = /** - * Created by The eXo Platform SAS. + * Created by The eXo Platform SAS.
* = - * @author Gennady Azarenk= ov - * @version $Id: ItemDataConsumer.java 11907 2008-03-13 15:36:21Z ksm $ + * Basic (Level 1) data flow inmemory operations
* = - * Basic (Level 1) data flow inmemory operations - * = * Common Rule for Read : If there is some storage in this manage= r =EF=BF=BD try to get the data * from here first, if not found =EF=BF=BD call super.someMethod + * = + * @author Gennady Azarenk= ov + * @version $Id$ */ public interface ItemDataConsumer { = /** - * @param parent - * @param name - * @return data by parent and name + * Find Item by parent (id) and name (with path index). + * = + * @param parent NodeData + * @param name QPathEntry + * @return ItemData, data by parent and name * @throws RepositoryException */ ItemData getItemData(NodeData parent, QPathEntry name) throws Repositor= yException; = /** - * @param identifier - * @return data by identifier + * Find Item by identifier. + * = + * @param String identifier + * @return ItemData, data by identifier */ ItemData getItemData(String identifier) throws RepositoryException; = /** - * @param parentIdentifier - * @return children data + * Get child Nodes of the parent node. + * = + * @param parent NodeData + * @return List of children Nodes */ List getChildNodesData(NodeData parent) throws RepositoryExce= ption; = /** - * @param parentIdentifier - * @return children data + * Get children nodes count of the parent node. = + * @param parent NodeData + * @return int, child nodes count */ + int getChildNodesCount(NodeData parent) throws RepositoryException; + = + /** + * Get child Properties of the parent node. + * = + * @param parent NodeData + * @return List of children Properties + */ List getChildPropertiesData(NodeData parent) throws Repos= itoryException; = - List listChildPropertiesData(final NodeData nodeData) thr= ows RepositoryException; + /** + * List child Properties, returned list will contains Properties withou= t actual Values. + * + * @param parent NodeData = + * @return List of PropertyData = + * @throws RepositoryException + */ + List listChildPropertiesData(final NodeData parent) throw= s RepositoryException; = /** + * Get Referenced properties. + * = * @param identifier * - referenceable id * @param skipVersionStorage Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-13 02:37:50 UTC (rev 621) @@ -956,7 +956,7 @@ + itemPath.getAsString(false)); return (NodeImpl)node; } - = + /** * {@inheritDoc} */ @@ -2488,16 +2488,92 @@ = // ----------------------------- ExtendedNode -------------------------= ---- = - private int getNextChildOrderNum(List siblings) + private int getNextChildOrderNum() throws RepositoryException { - int max =3D -1; + // int max =3D -1; + // for (NodeData sibling : siblings) + // { + // int cur =3D sibling.getOrderNumber(); + // if (cur > max) + // max =3D cur; + // } + // return ++max; + + //return siblings.size(); + + return dataManager.getChildNodesCount(nodeData()); + } + + private int getNextChildIndex(InternalQName nameToAdd, NodeData parentN= ode) throws RepositoryException, + ItemExistsException + { + + NodeDefinitionData def =3D + session.getWorkspace().getNodeTypesHolder().getChildNodeDefinitio= n(nameToAdd, parentNode.getPrimaryTypeName(), + parentNode.getMixinTypeNames()); + + boolean allowSns =3D def.isAllowsSameNameSiblings(); + + int ind =3D 1; + + NodeData sibling =3D (NodeData)dataManager.getItemData(parentNode, n= ew QPathEntry(nameToAdd, ind)); + while (sibling !=3D null) + { + if (allowSns) + { + ind++; + sibling =3D (NodeData)dataManager.getItemData(parentNode, new = QPathEntry(nameToAdd, ind)); + } + else + { + throw new ItemExistsException("The node " + nameToAdd + " alre= ady exists in " + getPath() + + " and same name sibling is not allowed "); + } + }; + + return ind; + + // int ind =3D 0; + // for (NodeData sibling : siblings) + // { + // if (sibling.getQPath().getName().equals(nameToAdd)) + // { + // if (allowSns) + // ind++; + // else + // throw new ItemExistsException("The node " + nameToA= dd + " already exists in " + getPath() + // + " and same name sibling is not allowed "); + // } + // } + // return ind + 1; + + } + + // old impl + @Deprecated + private int getNextChildIndex(InternalQName nameToAdd, List s= iblings, NodeData parentNode) + throws RepositoryException, ItemExistsException + { + + int ind =3D 0; for (NodeData sibling : siblings) { - int cur =3D sibling.getOrderNumber(); - if (cur > max) - max =3D cur; + if (sibling.getQPath().getName().equals(nameToAdd)) + { + NodeDefinitionData def =3D + session.getWorkspace().getNodeTypesHolder().getChildNodeDef= inition(nameToAdd, + parentNode.getPrimaryTypeName(), parentNode.getMixinType= Names()); + if (LOG.isDebugEnabled()) + LOG.debug("Calculate index for " + nameToAdd + " " + siblin= g.getQPath().getAsString()); + + if (def.isAllowsSameNameSiblings()) + ind++; + else + throw new ItemExistsException("The node " + nameToAdd + " a= lready exists in " + getPath() + + " and same name sibling is not allowed "); + } } - return ++max; + return ind + 1; } = private NodeImpl doAddNode(NodeImpl parentNode, InternalQName name, Int= ernalQName primaryTypeName) @@ -2510,9 +2586,9 @@ InternalQName[] mixinTypeNames =3D new InternalQName[0]; String identifier =3D IdGenerator.generate(); = - List siblings =3D dataManager.getChildNodesData(parentNode= .nodeData()); - int orderNum =3D parentNode.getNextChildOrderNum(siblings); - int index =3D parentNode.getNextChildIndex(name, siblings, parentNod= e.nodeData()); + //List siblings =3D dataManager.getChildNodesData(parentNo= de.nodeData()); + int orderNum =3D parentNode.getNextChildOrderNum(); + int index =3D parentNode.getNextChildIndex(name, parentNode.nodeData= ()); = QPath path =3D QPath.makeChildPath(parentNode.getInternalPath(), nam= e, index); = @@ -2546,35 +2622,8 @@ session.getActionHandler().postAddNode(node); = return node; - } = - private int getNextChildIndex(InternalQName nameToAdd, List s= iblings, NodeData parentNode) - throws RepositoryException, ItemExistsException - { - - int ind =3D 0; - for (NodeData sibling : siblings) - { - if (sibling.getQPath().getName().equals(nameToAdd)) - { - NodeDefinitionData def =3D - session.getWorkspace().getNodeTypesHolder().getChildNodeDef= inition(nameToAdd, - parentNode.getPrimaryTypeName(), parentNode.getMixinType= Names()); - if (LOG.isDebugEnabled()) - LOG.debug("Calculate index for " + nameToAdd + " " + siblin= g.getQPath().getAsString()); - - if (def.isAllowsSameNameSiblings()) - ind++; - else - throw new ItemExistsException("The node " + nameToAdd + " a= lready exists in " + getPath() - + " and same name sibling is not allowed "); - } - } - return ind + 1; - - } - private int getOrderNumber() { return nodeData().getOrderNumber(); Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-12 19:01:52 UT= C (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-13 02:37:50 UT= C (rev 621) @@ -674,6 +674,39 @@ /** * {@inheritDoc} */ + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on + { + int childsCount =3D 0; + + for (ItemState change : changesLog.getAllStates()) + { + if (change.isNode() && change.isPersisted() + && change.getData().getParentIdentifier().equals(parent.getIde= ntifier())) + { + if (change.isDeleted()) + { + childsCount--; + } + else if (change.isAdded()) + { + childsCount++; + } + } + } + + childsCount =3D transactionableManager.getChildNodesCount(parent) + = childsCount; + if (childsCount < 0) + { + throw new InvalidItemStateException("Node's child nodes were chan= ged in another Session " + + parent.getQPath().getAsString()); + } + + return childsCount; + } + + /** + * {@inheritDoc} + */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException { long start =3D 0; Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWo= rkspaceDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspac= eDataManager.java 2009-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspac= eDataManager.java 2009-11-13 02:37:50 UTC (rev 621) @@ -18,6 +18,12 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import java.util.Calendar; +import java.util.List; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; import org.exoplatform.services.jcr.dataflow.SharedDataManager; @@ -28,12 +34,6 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = -import java.util.Calendar; -import java.util.List; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. Data Manager supported ACL Inheritance * = @@ -124,6 +124,9 @@ return node; } = + /** + * {@inheritDoc} + */ // ------------ ItemDataConsumer impl ------------ = public List getChildNodesData(NodeData parent) throws Reposit= oryException @@ -133,29 +136,52 @@ initACL(parent, node); return nodes; } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception = + { + return persistentManager.getChildNodesCount(parent); + } = + /** + * {@inheritDoc} + */ public ItemData getItemData(NodeData parent, QPathEntry name) throws Re= positoryException { final ItemData item =3D persistentManager.getItemData(parent, name); return item !=3D null && item.isNode() ? initACL(parent, (NodeData)i= tem) : item; } = + /** + * {@inheritDoc} + */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on { final ItemData item =3D persistentManager.getItemData(identifier); return item !=3D null && item.isNode() ? initACL(null, (NodeData)ite= m) : item; } = + /** + * {@inheritDoc} + */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException { return persistentManager.getChildPropertiesData(parent); } = + /** + * {@inheritDoc} + */ public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException { return persistentManager.listChildPropertiesData(parent); } = + /** + * {@inheritDoc} + */ public List getReferencesData(String identifier, boolean = skipVersionStorage) throws RepositoryException { @@ -164,12 +190,18 @@ = // ------------ SharedDataManager ---------------------- = + /** + * {@inheritDoc} + */ public void save(ItemStateChangesLog changes) throws InvalidItemStateEx= ception, UnsupportedOperationException, RepositoryException { persistentManager.save(changes); } = + /** + * {@inheritDoc} + */ public Calendar getCurrentTime() { return persistentManager.getCurrentTime(); Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataMan= ager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.j= ava 2009-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.j= ava 2009-11-13 02:37:50 UTC (rev 621) @@ -369,6 +369,18 @@ } } = + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on + { + if (cache.isEnabled()) + { + List childNodes =3D cache.getChildNodes(parent); + if (childNodes !=3D null) + return childNodes.size(); + } + + return super.getChildNodesCount(parent); + } + /** * Get child PropertyData. * = @@ -453,7 +465,7 @@ } return propertiesList; } - + = /** * {@inheritDoc} */ Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataM= anager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager= .java 2009-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager= .java 2009-11-13 02:37:50 UTC (rev 621) @@ -18,6 +18,12 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.DataManager; @@ -36,12 +42,6 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. Responsible for: *redirecting reposito= ry operations if item is * descendant of /jcr:system/jcr:versionStorage *adding version history fo= r newly added/assigned @@ -72,11 +72,8 @@ this.versionDataManager =3D (ACLInheritanceSupportedWorkspaceDataMan= ager)systemDataManager; } = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.impl.core.WorkspaceDataManager#get= ChildNodes(org.exoplatform.services - * .jcr.datamodel.NodeData) + /** + * {@inheritDoc} */ @Override public List getChildNodesData(final NodeData nodeData) throws= RepositoryException @@ -87,12 +84,22 @@ } return super.getChildNodesData(nodeData); } + = + /** + * {@inheritDoc} + */ + @Override + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception = + { + if (isSystemDescendant(parent.getQPath()) && !this.equals(versionDat= aManager)) + { + return versionDataManager.getChildNodesCount(parent); + } + return super.getChildNodesCount(parent); + } = = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.impl.core.WorkspaceDataManager#get= ChildProperties(org.exoplatform - * .services.jcr.datamodel.NodeData) + /** + * {@inheritDoc} */ @Override public List getChildPropertiesData(final NodeData nodeDat= a) throws RepositoryException @@ -104,6 +111,10 @@ return super.getChildPropertiesData(nodeData); } = + /** + * {@inheritDoc} + */ + @Override public List listChildPropertiesData(final NodeData nodeDa= ta) throws RepositoryException { if (isSystemDescendant(nodeData.getQPath()) && !this.equals(versionD= ataManager)) @@ -113,6 +124,10 @@ return super.listChildPropertiesData(nodeData); } = + /** + * {@inheritDoc} + */ + @Override public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException { if (parentData !=3D null) @@ -127,8 +142,9 @@ } = /** - * @see org.exoplatform.services.jcr.impl.dataflow.persistent.Workspace= PersistentDataManager#getItemData(java.lang.String) + * {@inheritDoc} */ + @Override public ItemData getItemData(String identifier) throws RepositoryExcepti= on { // from cache at first Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataMa= nager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.= java 2009-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.= java 2009-11-13 02:37:50 UTC (rev 621) @@ -290,6 +290,22 @@ con.close(); } } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on + { + final WorkspaceStorageConnection con =3D dataContainer.openConnectio= n(); + try + { + return con.getChildNodesCount(parent); + } + finally + { + con.close(); + } + } = = /** * {@inheritDoc} Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataMan= agerProxy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerPr= oxy.java 2009-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerPr= oxy.java 2009-11-13 02:37:50 UTC (rev 621) @@ -97,6 +97,9 @@ storageDataManager.save(newLog); } = + /** + * {@inheritDoc} + */ public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException { return copyItemData(storageDataManager.getItemData(parentData, name)= ); @@ -117,6 +120,14 @@ { return copyNodes(storageDataManager.getChildNodesData(parent)); } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception = + { + return storageDataManager.getChildNodesCount(parent); + } = = /** * {@inheritDoc} @@ -126,6 +137,9 @@ return copyProperties(storageDataManager.getChildPropertiesData(pare= nt)); } = + /** + * {@inheritDoc} + */ public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException { return copyPropertiesWithoutValues(storageDataManager.listChildPrope= rtiesData(parent)); Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-12 = 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-13 = 02:37:50 UTC (rev 621) @@ -76,11 +76,8 @@ } } = - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.dataflow.PlainChangesLog#add(org.exopla= tform.services.jcr.dataflow - * .ItemState) + /** + * {@inheritDoc} */ @Override public PlainChangesLog add(ItemState change) @@ -91,9 +88,8 @@ return this; } = - /* - * (non-Javadoc) - * @see org.exoplatform.services.jcr.dataflow.PlainChangesLog#addAll(ja= va.util.List) + /** + * {@inheritDoc} */ @Override public PlainChangesLog addAll(List changes) @@ -107,9 +103,8 @@ return this; } = - /* - * (non-Javadoc) - * @see org.exoplatform.services.jcr.dataflow.PlainChangesLog#clear() + /** + * {@inheritDoc} */ @Override public void clear() Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 20= 09-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 20= 09-11-13 02:37:50 UTC (rev 621) @@ -94,6 +94,45 @@ /** * {@inheritDoc} */ + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception + { + if (txStarted()) + { + int txChildsCount =3D 0; + for (ItemState change : transactionLog.getAllStates()) + { + if (change.isNode() && change.isPersisted() + && change.getData().getParentIdentifier().equals(parent.get= Identifier())) + { + if (change.isDeleted()) + { + txChildsCount--; + } + else if (change.isAdded()) + { + txChildsCount++; + } + } + } + + final int childsCount =3D storageDataManager.getChildNodesCount(p= arent) + txChildsCount; + if (childsCount < 0) + { + throw new InvalidItemStateException("Node's child nodes were c= hanged in another Transaction " + + parent.getQPath().getAsString()); + } + = + return childsCount; + } + else + { + return storageDataManager.getChildNodesCount(parent); + } + } + + /** + * {@inheritDoc} + */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException { List props =3D storageDataManager.getChildPropertiesDa= ta(parent); Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/DBConstants.java 2009-11-12 19:01:52 U= TC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/DBConstants.java 2009-11-13 02:37:50 U= TC (rev 621) @@ -126,6 +126,11 @@ * FIND_NODES_BY_PARENTID. */ protected String FIND_NODES_BY_PARENTID; + = + /** + * FIND_NODES_COUNT_BY_PARENTID. + */ + protected String FIND_NODES_COUNT_BY_PARENTID; = /** * FIND_PROPERTIES_BY_PARENTID. Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-12 = 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-13 = 02:37:50 UTC (rev 621) @@ -600,6 +600,29 @@ throw new RepositoryException(e); } } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on { + checkIfOpened(); + try + { + ResultSet count =3D findChildNodesCountByParentIdentifier(getInte= rnalId(parent.getIdentifier())); + if (count.next()) = + { + return count.getInt(1); + } + else + { + throw new RepositoryException("FATAL No resulton childNodes co= unt for " + parent.getQPath().getAsString()); + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } = = /** * {@inheritDoc} @@ -1871,6 +1894,8 @@ protected abstract ResultSet findItemByName(String parentId, String nam= e, int index) throws SQLException; = protected abstract ResultSet findChildNodesByParentIdentifier(String pa= rentIdentifier) throws SQLException; + = + protected abstract ResultSet findChildNodesCountByParentIdentifier(Stri= ng parentIdentifier) throws SQLException; = protected abstract ResultSet findChildPropertiesByParentIdentifier(Stri= ng parentIdentifier) throws SQLException; = Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 20= 09-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 20= 09-11-13 02:37:50 UTC (rev 621) @@ -74,6 +74,7 @@ "select V.DATA" + " from JCR_MITEM I, JCR_MVALUE V" + " where I.PARENT_ID=3D? and I.I_CLASS=3D2 and I.NAME=3D? and= I.ID=3DV.PROPERTY_ID order by V.ORDER_NUM"; FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where PAREN= T_ID=3D? and I_CLASS=3D1" + " order by N_ORDER_NUM"; + FIND_NODES_COUNT_BY_PARENTID =3D "select count(ID) from JCR_MITEM" += " where PARENT_ID=3D? and I_CLASS=3D1"; FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = PARENT_ID=3D? and I_CLASS=3D2" + " order by ID"; } } Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2= 009-11-12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2= 009-11-13 02:37:50 UTC (rev 621) @@ -81,6 +81,8 @@ + " where I.PARENT_ID=3D? and I.I_CLASS=3D2 and I.CONTAINER_NA= ME=3D? and I.NAME=3D? and I.ID=3DV.PROPERTY_ID order by V.ORDER_NUM"; FIND_NODES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D1= and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; + FIND_NODES_COUNT_BY_PARENTID =3D + "select count(ID) from JCR_SITEM" + " where PARENT_ID=3D? and I_C= LASS=3D1 and CONTAINER_NAME=3D?"; FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D2= and CONTAINER_NAME=3D?" + " order by ID"; } @@ -135,7 +137,23 @@ findNodesByParentId.setString(2, containerName); return findNodesByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findChildNodesCountByParentIdentifier(String parent= Cid) throws SQLException + { + if (findNodesCountByParentId =3D=3D null) + findNodesCountByParentId =3D dbConnection.prepareStatement(FIND_N= ODES_COUNT_BY_PARENTID); + else + findNodesCountByParentId.clearParameters(); = + findNodesCountByParentId.setString(1, parentCid); + findNodesCountByParentId.setString(2, containerName); + return findNodesCountByParentId.executeQuery(); + } + /** * {@inheritDoc} */ Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-= 12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-= 13 02:37:50 UTC (rev 621) @@ -77,6 +77,8 @@ protected PreparedStatement findValueByPropertyIdOrderNumber; = protected PreparedStatement findNodesByParentId; + = + protected PreparedStatement findNodesCountByParentId; = protected PreparedStatement findPropertiesByParentId; = @@ -185,6 +187,8 @@ FIND_VALUE_BY_PROPERTYID_OREDERNUMB =3D "select DATA from JCR_MVALUE= where PROPERTY_ID=3D? and ORDER_NUM=3D?"; = FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where I_CLA= SS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; + = + FIND_NODES_COUNT_BY_PARENTID =3D "select count(ID) from JCR_MITEM" += " where I_CLASS=3D1 and PARENT_ID=3D?"; = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; = @@ -428,6 +432,21 @@ * {@inheritDoc} */ @Override + protected ResultSet findChildNodesCountByParentIdentifier(String parent= Identifier) throws SQLException + { + if (findNodesCountByParentId =3D=3D null) + findNodesCountByParentId =3D dbConnection.prepareStatement(FIND_N= ODES_COUNT_BY_PARENTID); + else + findNodesCountByParentId.clearParameters(); + + findNodesCountByParentId.setString(1, parentIdentifier); + return findNodesCountByParentId.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override protected ResultSet findChildPropertiesByParentIdentifier(String parent= Identifier) throws SQLException { if (findPropertiesByParentId =3D=3D null) Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11= -12 19:01:52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11= -13 02:37:50 UTC (rev 621) @@ -74,6 +74,8 @@ protected PreparedStatement findValueByPropertyIdOrderNumber; = protected PreparedStatement findNodesByParentId; + = + protected PreparedStatement findNodesCountByParentId; = protected PreparedStatement findPropertiesByParentId; = @@ -193,6 +195,8 @@ FIND_NODES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = + FIND_NODES_COUNT_BY_PARENTID =3D "select count(ID) from JCR_MITEM" += " where I_CLASS=3D1 and CONTAINER_NAME=3D? and PARENT_ID=3D?"; + = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by ID"; = @@ -334,7 +338,23 @@ findNodesByParentId.setString(2, parentCid); return findNodesByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findChildNodesCountByParentIdentifier(String parent= Cid) throws SQLException + { + if (findNodesCountByParentId =3D=3D null) + findNodesCountByParentId =3D dbConnection.prepareStatement(FIND_N= ODES_COUNT_BY_PARENTID); + else + findNodesCountByParentId.clearParameters(); = + findNodesCountByParentId.setString(1, containerName); + findNodesCountByParentId.setString(2, parentCid); + return findNodesCountByParentId.executeQuery(); + } = + /** * {@inheritDoc} */ Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/storage/WorkspaceStorageConnection.java 2009-11-12 19:01= :52 UTC (rev 620) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/storage/WorkspaceStorageConnection.java 2009-11-13 02:37= :50 UTC (rev 621) @@ -93,6 +93,15 @@ * if connection is closed */ List getChildNodesData(NodeData parent) throws RepositoryExce= ption, IllegalStateException; + = + /** + * Reads count of parent child nodes. + * + * @param parent NodeData + * @return long, childs count + * @throws RepositoryException if error occurs + */ + int getChildNodesCount(NodeData parent) throws RepositoryException; = /** * Reads List of PropertyData from the storag= e using item's parent Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/impl/core/TestNodeOrder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/impl/core/TestNodeOrder.java (re= v 0) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/impl/core/TestNodeOrder.java 2009-11-13 02:37:50 UTC (re= v 621) @@ -0,0 +1,271 @@ +/* + * 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. + */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core; + +import javax.jcr.ItemExistsException; +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.Session; + +import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.datamodel.NodeData; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 13.11.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class TestNodeOrder extends JcrImplBaseTest +{ + + public void testOrder() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + testNode.addNode("z"); + session.save(); + testNode.addNode("a"); + session.save(); + testNode.addNode("b"); + session.save(); + testNode.addNode("c"); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(4, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderInSession() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(4, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderCombined() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("y"); + session.save(); + + testNode.addNode("c"); + testNode.addNode("a"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(8, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderWithRefreshDiscard() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("y"); + root.refresh(false); // discard added a and y + + testNode.addNode("c"); + testNode.addNode("a"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(6, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderWithInvalidation() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("y"); + + // add some in another session + Session another =3D repository.login(credentials, root.getSession().= getWorkspace().getName()); + Node anotherTest =3D another.getRootNode().getNode("testNode"); + another.save(); + anotherTest.addNode("a"); + anotherTest.addNode("y"); + another.save(); + another.logout(); + + try + { + session.save(); + fail("Nodes already added in another session, ItemExistsException= should be thrown"); + } + catch (ItemExistsException e) + { + // ok + root.refresh(false); // discard a and y + } + + testNode.addNode("c"); + testNode.addNode("a"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(8, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + = + public void testOrderWithRefreshKeep() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + // add some in another session + Session another =3D repository.login(credentials, root.getSession().= getWorkspace().getName()); + Node anotherTest =3D another.getRootNode().getNode("testNode"); + another.save(); + anotherTest.addNode("a"); + anotherTest.addNode("y"); + another.save(); + another.logout(); + + //root.refresh(true); // refresh to see another Session + testNode.addNode("a"); + testNode.addNode("y"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(8, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + +} Property changes on: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/tes= t/java/org/exoplatform/services/jcr/impl/core/TestNodeOrder.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id --===============2636151461127132688==-- From do-not-reply at jboss.org Thu Nov 12 21:39:30 2009 Content-Type: multipart/mixed; boundary="===============6333193089042632507==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r622 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test: resources/conf/standalone and 1 other directory. Date: Thu, 12 Nov 2009 21:39:30 -0500 Message-ID: <200911130239.nAD2dUG8023151@svn01.web.mwc.hst.phx2.redhat.com> --===============6333193089042632507== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-12 21:39:29 -0500 (Thu, 12 Nov 2009) New Revision: 622 Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/s= tandalone/test-configuration.mysql.xml jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/s= tandalone/test-jcr-config.mysql.xml Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/load/perf/TestBulkItemsAdd.java Log: EXOJCR-221: For load testing: simple test and MySQL config (not a part of f= ix) Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/load/perf/TestBulkItemsAdd.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestBulkItemsAdd.java 2009-11-13 02:37:50 UTC = (rev 621) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestBulkItemsAdd.java 2009-11-13 02:39:29 UTC = (rev 622) @@ -18,45 +18,63 @@ */ package org.exoplatform.services.jcr.load.perf; = -import org.exoplatform.services.jcr.JcrAPIBaseTest; - import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.PrintWriter; import java.util.Calendar; = import javax.jcr.Node; = +import org.exoplatform.services.jcr.JcrAPIBaseTest; + /** * Created by The eXo Platform SAS Author : Peter Nedonosko peter.nedonosk= o(a)exoplatform.com.ua * 20.07.2006 * = - * @version $Id: TestBulkItemsAdd.java 34801 2009-07-31 15:44:50Z dkatayev= $ + * @version $Id: TestBulkItemsAdd.java 352 2009-10-23 09:28:36Z pnedonosko= $ */ public class TestBulkItemsAdd extends JcrAPIBaseTest { = public void testNodeAdd() throws Exception { + StringBuilder stats =3D new StringBuilder(); + = Node testRoot =3D session.getRootNode().addNode("testRoot"); session.save(); long startTime =3D System.currentTimeMillis(); - int nodesCount =3D 250; + int nodesCount =3D 10000; for (int i =3D 0; i < nodesCount; i++) { long addTime =3D System.currentTimeMillis(); String nodeName =3D "_" + i + "_node"; Node n =3D testRoot.addNode(nodeName); long finishTime =3D System.currentTimeMillis(); - log.info("add node " + nodeName + ", " + (System.currentTimeMilli= s() - addTime) + "ms, " - + (finishTime - startTime) + "ms"); + //log.info("add node " + nodeName + ", " + (System.currentTimeMil= lis() - addTime) + "ms, " + // + (finishTime - startTime) + "ms"); + //String stat =3D (System.currentTimeMillis() - addTime) + ";" + = (finishTime - startTime); + stats.append(i); + stats.append(";"); + stats.append((System.currentTimeMillis() - addTime)); + stats.append(";"); + stats.append((finishTime - startTime)); + stats.append("\r\n"); } log.info("Nodes added " + nodesCount + ", " + (System.currentTimeMil= lis() - startTime) + "ms"); startTime =3D System.currentTimeMillis(); log.info("Nodes will be saved, wait few minutes..."); testRoot.save(); log.info("Nodes saved " + nodesCount + ", " + (System.currentTimeMil= lis() - startTime) + "ms"); + = + // save stats + PrintWriter statFile =3D new PrintWriter(new File("stats.txt")); + statFile.write(stats.toString()); + statFile.close(); + = + log.info("Test done"); } = - public void testNtFileAdd() throws Exception + public void _testNtFileAdd() throws Exception { Node testRoot =3D session.getRootNode().addNode("testRoot"); session.save(); Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/co= nf/standalone/test-configuration.mysql.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/= standalone/test-configuration.mysql.xml (rev 0) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/= standalone/test-configuration.mysql.xml 2009-11-13 02:39:29 UTC (rev 622) @@ -0,0 +1,498 @@ + + + + + org.exoplatform.services.log.LogConfigurationInitializer + org.exoplatform.services.log.LogConfigurationInitializer + + + logger + org.exoplatform.services.log.impl.BufferedLog4JLogger + + + configurator + org.exoplatform.services.log.impl.Log4JConfigurator + + + properties + Log4J properties + + = + + + = + + + = + + + = + + + = + + = + + = + + + + = + + + + + = + + = + + = + + + + + org.exoplatform.services.jcr.RepositoryService + org.exoplatform.services.jcr.impl.RepositoryServiceImpl + + + add.namespaces + addPlugin + org.exoplatform.services.jcr.impl.AddNamespacesPlugin + + + namespaces + + + + + + + + + + add.nodeType + addPlugin + org.exoplatform.services.jcr.impl.AddNodeTypePlugin + + + autoCreatedInNewRepository + Node types configuration file + jar:/conf/test/nodetypes-tck.xml + jar:/conf/test/nodetypes-impl.xml + jar:/conf/test/nodetypes-usecase.xml + jar:/conf/test/nodetypes-config.xml + jar:/conf/test/nodetypes-config-extended.xml = = + + = + + testInitNodeTypesRepository + + Node types configuration file for repository with name testI= nitNodeTypesRepository + + jar:/conf/test/nodetypes-test.xml + + = + + testInitNodeTypesRepositoryTest2 + + Node types configuration file for repository with name testI= nitNodeTypesRepositoryTest2 + + jar:/conf/test/nodetypes-test2.xml + + = + + = + + + + + = + + org.exoplatform.services.jcr.config.RepositoryServiceConfiguratio= n + org.exoplatform.services.jcr.impl.config.RepositoryServiceConfig= urationImpl + + + conf-path + JCR configuration file + jar:/conf/standalone/test-jcr-config.mysql.xml + + + + + = + + org.exoplatform.services.organization.impl.mock.DummyOrganizatio= nService + + = + + org.exoplatform.services.security.Authenticator + org.exoplatform.services.organization.auth.OrganizationAuthentic= atorImpl + + = + + org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalo= g + + = + + org.exoplatform.services.transaction.TransactionService + org.exoplatform.services.transaction.impl.jotm.TransactionServic= eJotmImpl + + + timeout + 5 + + + + = + + org.exoplatform.services.naming.InitialContextInitia= lizer + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcr + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + + + + + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcr1 + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + + + + = + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcr2 + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + + + + + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcr3 + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + + + + + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcrtck + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + + + + + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcr1tck + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + + + + + + bind.datasource + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + jdbcjcr2tck + + + class-name + javax.sql.DataSource + + + factory + org.apache.commons.dbcp.BasicDataSourceFactory + + + ref-addresses + ref-addresses + + + + + + + + + + + + + jotm.tx + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + UserTransaction + + + class-name + javax.transaction.UserTransaction + + + factory + org.objectweb.jotm.UserTransactionFactory + + + ref-addresses + ref-addresses + + + + + + bind.jcr + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + repo + + + class-name + javax.jcr.Repository + + + factory + org.exoplatform.services.jcr.impl.jndi.BindableRepository= Factory + + + ref-addresses + ref-addresses + + + + + + + rmi.jcr + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + rmirepository + + + class-name + javax.jcr.Repository + + + factory + org.exoplatform.services.jcr.rmi.RepositoryFactory + + + ref-addresses + ref-addresses + + + + + + Property changes on: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/tes= t/resources/conf/standalone/test-configuration.mysql.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/co= nf/standalone/test-jcr-config.mysql.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/= standalone/test-jcr-config.mysql.xml (rev 0) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/resources/conf/= standalone/test-jcr-config.mysql.xml 2009-11-13 02:39:29 UTC (rev 622) @@ -0,0 +1,407 @@ + + + + + + exo-domain + + + 1h + org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15m + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + exo-domain + + + 1h + org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15m + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Property changes on: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/tes= t/resources/conf/standalone/test-jcr-config.mysql.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id --===============6333193089042632507==-- From do-not-reply at jboss.org Fri Nov 13 04:16:24 2009 Content-Type: multipart/mixed; boundary="===============3666274885679024065==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r623 - in ws/trunk: exo.ws.frameworks.servlet and 2 other directories. Date: Fri, 13 Nov 2009 04:16:23 -0500 Message-ID: <200911130916.nAD9GN2E029970@svn01.web.mwc.hst.phx2.redhat.com> --===============3666274885679024065== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2009-11-13 04:16:23 -0500 (Fri, 13 Nov 2009) New Revision: 623 Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/services/tes= t/mock/MockHttpServletResponse.java ws/trunk/pom.xml Log: EXOJCR-239 : = Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 02:39:29 UTC (rev= 622) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 09:16:23 UTC (rev= 623) @@ -34,6 +34,10 @@ = + javax.servlet + servlet-api + + org.exoplatform.kernel exo.kernel.component.common Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 02:39:29 UTC (rev 622) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 09:16:23 UTC (rev 623) @@ -36,8 +36,6 @@ javax.servlet servlet-api - 2.3 - compile \ No newline at end of file Modified: ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/servi= ces/test/mock/MockHttpServletResponse.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/services/te= st/mock/MockHttpServletResponse.java 2009-11-13 02:39:29 UTC (rev 622) +++ ws/trunk/exo.ws.testframework/src/main/java/org/exoplatform/services/te= st/mock/MockHttpServletResponse.java 2009-11-13 09:16:23 UTC (rev 623) @@ -81,7 +81,7 @@ protected int contentLength =3D -1; = /** The encoding. */ - protected String encoding =3D null; + protected String charset =3D null; = /** The date format we will use for creating date headers. */ protected static final SimpleDateFormat format =3D new SimpleDateFormat= ("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); @@ -364,15 +364,23 @@ */ public String getCharacterEncoding() { - if (encoding =3D=3D null) + if (charset =3D=3D null) return ("UTF-8"); else - return (encoding); + return (charset); } = /** * {@inheritDoc} */ + public String getContentType() + { + return contentType; + } + + /** + * {@inheritDoc} + */ public Locale getLocale() { return locale; @@ -391,6 +399,14 @@ /** * {@inheritDoc} */ + public void setCharacterEncoding(String charset) + { + this.charset =3D charset; + } + + /** + * {@inheritDoc} + */ public void setContentLength(int length) { this.contentLength =3D length; Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-13 02:39:29 UTC (rev 622) +++ ws/trunk/pom.xml 2009-11-13 09:16:23 UTC (rev 623) @@ -140,6 +140,11 @@ jsr250-api 1.0 + + javax.servlet + servlet-api + 2.4 + --===============3666274885679024065==-- From do-not-reply at jboss.org Fri Nov 13 04:40:51 2009 Content-Type: multipart/mixed; boundary="===============5655346683048631635==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r624 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Fri, 13 Nov 2009 04:40:51 -0500 Message-ID: <200911130940.nAD9ep8w003258@svn01.web.mwc.hst.phx2.redhat.com> --===============5655346683048631635== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 04:40:49 -0500 (Fri, 13 Nov 2009) New Revision: 624 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 09:16:23= UTC (rev 623) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 09:40:49= UTC (rev 624) @@ -488,7 +488,7 @@ NodeData parentNodeData =3D (NodeData)conn.getItemData((String= ) name.get(1)); = if (parentNodeData =3D=3D null) - throw new JDBCCacheLoaderException("The parent node with ID= =3D " + (String)name.get(2) + " not exis, FQN =3D '" + name + "'."); + throw new JDBCCacheLoaderException("The parent node with ID= =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'."); = // get child nodes by parent Id for (NodeData node : conn.getChildNodesData(parentNodeData)) Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 09:1= 6:23 UTC (rev 623) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 09:4= 0:49 UTC (rev 624) @@ -53,6 +53,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Set; = import javax.naming.Context; import javax.naming.InitialContext; @@ -241,7 +242,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); @@ -259,7 +260,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); @@ -280,11 +281,11 @@ * @param primaryType InternalQName * @throws Exception */ - private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType) + private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType, String parentNodeId) throws Exception { // add root (/) - conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, null, + conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, parentNodeId, new AccessControlList())); = // add property (/jcr:primaryType) @@ -457,7 +458,7 @@ = String nodeId =3D IdGenerator.generate(); addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, - Constants.NT_UNSTRUCTURED); + Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID); conn.commit(); = List modifications =3D new ArrayList(); @@ -495,7 +496,7 @@ = String nodeId =3D IdGenerator.generate(); addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, - Constants.NT_UNSTRUCTURED); + Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID); conn.commit(); = conn =3D persistentContainer.openConnection(); @@ -553,7 +554,7 @@ = String nodeId =3D IdGenerator.generate(); addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, - Constants.NT_UNSTRUCTURED); + Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID); conn.commit(); = // tests it @@ -583,7 +584,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED); + addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID= ); conn.commit(); = // tests it @@ -643,8 +644,23 @@ { = // prepare + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); + String baseNodeId =3D IdGenerator.generate(); + addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); + = + // add child nodes [node1, node2, node3] = + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), IdGenerator.generate(), Constants.NT_UNSTRUCTURED, baseNodeI= d); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node2")), IdGenerator.generate(), Constants.NT_UNSTRUCTURED, baseNodeI= d); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node3")), IdGenerator.generate(), Constants.NT_UNSTRUCTURED, baseNodeI= d); + conn.commit(); + // tests it + Set childs =3D (Set) loader.getChildrenNames(Fqn.fro= mElements(JBossCacheStorage.NODES, baseNodeId)); + = + assertNotNull(childs); + = = } = --===============5655346683048631635==-- From do-not-reply at jboss.org Fri Nov 13 04:43:29 2009 Content-Type: multipart/mixed; boundary="===============2812306515767636586==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r625 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 04:43:29 -0500 Message-ID: <200911130943.nAD9hTQL003788@svn01.web.mwc.hst.phx2.redhat.com> --===============2812306515767636586== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 04:43:29 -0500 (Fri, 13 Nov 2009) New Revision: 625 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 09:4= 0:49 UTC (rev 624) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 09:4= 3:29 UTC (rev 625) @@ -242,7 +242,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, Constants.ROOT_PARENT_UUID); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); @@ -260,7 +260,7 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, null); + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, Constants.ROOT_PARENT_UUID); = // add property (/jcr:mixinTypes) List mixins =3D new ArrayList(); --===============2812306515767636586==-- From do-not-reply at jboss.org Fri Nov 13 04:49:58 2009 Content-Type: multipart/mixed; boundary="===============4631856930592422049==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r626 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 04:49:57 -0500 Message-ID: <200911130949.nAD9nv8Q005282@svn01.web.mwc.hst.phx2.redhat.com> --===============4631856930592422049== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 04:49:57 -0500 (Fri, 13 Nov 2009) New Revision: 626 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 09:4= 3:29 UTC (rev 625) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 09:4= 9:57 UTC (rev 626) @@ -661,7 +661,10 @@ = assertNotNull(childs); = - + assertEquals(3, childs.size()); + assertTrue(childs.contains("[]node1:1")); + assertTrue(childs.contains("[]node2:1")); + assertTrue(childs.contains("[]node3:1")); } = public void testGetChildProperties() throws Exception --===============4631856930592422049==-- From do-not-reply at jboss.org Fri Nov 13 04:53:11 2009 Content-Type: multipart/mixed; boundary="===============5384401338842507935==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r627 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db. Date: Fri, 13 Nov 2009 04:53:11 -0500 Message-ID: <200911130953.nAD9rBhP006175@svn01.web.mwc.hst.phx2.redhat.com> --===============5384401338842507935== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-13 04:53:11 -0500 (Fri, 13 Nov 2009) New Revision: 627 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-221: fix SQL statement Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11= -13 09:49:57 UTC (rev 626) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11= -13 09:53:11 UTC (rev 627) @@ -74,7 +74,7 @@ protected PreparedStatement findValueByPropertyIdOrderNumber; = protected PreparedStatement findNodesByParentId; - = + protected PreparedStatement findNodesCountByParentId; = protected PreparedStatement findPropertiesByParentId; @@ -195,8 +195,9 @@ FIND_NODES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = - FIND_NODES_COUNT_BY_PARENTID =3D "select count(ID) from JCR_MITEM" += " where I_CLASS=3D1 and CONTAINER_NAME=3D? and PARENT_ID=3D?"; - = + FIND_NODES_COUNT_BY_PARENTID =3D + "select count(ID) from JCR_SITEM" + " where I_CLASS=3D1 and CONTA= INER_NAME=3D? and PARENT_ID=3D?"; + FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by ID"; = @@ -338,7 +339,7 @@ findNodesByParentId.setString(2, parentCid); return findNodesByParentId.executeQuery(); } - = + /** * {@inheritDoc} */ @@ -353,7 +354,7 @@ findNodesCountByParentId.setString(1, containerName); findNodesCountByParentId.setString(2, parentCid); return findNodesCountByParentId.executeQuery(); - } = + } = /** * {@inheritDoc} --===============5384401338842507935==-- From do-not-reply at jboss.org Fri Nov 13 04:57:40 2009 Content-Type: multipart/mixed; boundary="===============4043807992773158456==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r628 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/dataflow/session and 1 other directory. Date: Fri, 13 Nov 2009 04:57:40 -0500 Message-ID: <200911130957.nAD9veul007306@svn01.web.mwc.hst.phx2.redhat.com> --===============4043807992773158456== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-13 04:57:40 -0500 (Fri, 13 Nov 2009) New Revision: 628 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/dataflow/PlainChangesLogImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/session/SessionChangesLog.java Log: EXOJCR-221: SessionChangesLog improvement Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/dataflow/PlainChangesLogImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/dataflow/PlainChangesLogImpl.java 2009-11-13 09:53:11 UT= C (rev 627) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/dataflow/PlainChangesLogImpl.java 2009-11-13 09:57:40 UT= C (rev 628) @@ -199,7 +199,6 @@ in.readFully(buf); sessionId =3D new String(buf, DEFAULT_ENCODING); = - items =3D new ArrayList(); int listSize =3D in.readInt(); for (int i =3D 0; i < listSize; i++) add((ItemState)in.readObject()); Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-13 = 09:53:11 UTC (rev 627) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-13 = 09:57:40 UTC (rev 628) @@ -26,6 +26,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; = import java.util.ArrayList; @@ -50,6 +51,17 @@ protected Map index =3D new HashMap(); = /** + * ItemState index storage. Used to store last nodes states. = + */ + protected Map> lastChildNodeStates =3D n= ew HashMap>(); + + /** + * ItemState index storage. Used to store last properties states. = + */ + protected Map> lastChildPropertyStates = =3D + new HashMap>(); + + /** * Create empty ChangesLog. * = * @param sessionId @@ -70,10 +82,7 @@ super(items, sessionId); = for (ItemState change : items) - { - index.put(change.getData().getIdentifier(), change); - index.put(change.getData().getQPath(), change); - } + addItem(change); } = /** @@ -83,8 +92,8 @@ public PlainChangesLog add(ItemState change) { super.add(change); - index.put(change.getData().getIdentifier(), change); - index.put(change.getData().getQPath(), change); + addItem(change); + return this; } = @@ -96,10 +105,8 @@ { super.addAll(changes); for (ItemState change : changes) - { - index.put(change.getData().getIdentifier(), change); - index.put(change.getData().getQPath(), change); - } + addItem(change); + return this; } = @@ -111,6 +118,8 @@ { super.clear(); index.clear(); + lastChildNodeStates.clear(); + lastChildPropertyStates.clear(); } = /** @@ -121,24 +130,34 @@ */ public void remove(QPath rootPath) { - List removedList =3D new ArrayList(); + for (int i =3D items.size() - 1; i >=3D 0; i--) + { + ItemState item =3D items.get(i); = - for (ItemState item : items) - { QPath qPath =3D item.getData().getQPath(); if (qPath.isDescendantOf(rootPath) || item.getAncestorToSave().is= DescendantOf(rootPath) || item.getAncestorToSave().equals(rootPath) || qPath.equals(r= ootPath)) { - removedList.add(item); + items.remove(i); + index.remove(item.getData().getIdentifier()); + index.remove(item.getData().getQPath()); + index.remove(new ParentIDQPathBasedKey(item)); + index.remove(new IDStateBasedKey(item.getData().getIdentifier(= ), item.getState())); + + if (item.getData().isNode()) + { + Map children =3D lastChildNodeStates.get= (item.getData().getParentIdentifier()); + if (children !=3D null) + children.remove(item.getData().getIdentifier()); + } + else + { + Map children =3D lastChildPropertyStates= .get(item.getData().getParentIdentifier()); + if (children !=3D null) + children.remove(item.getData().getIdentifier()); + } } } - - for (ItemState item : removedList) - { - items.remove(item); - index.remove(item.getData().getIdentifier()); - index.remove(item.getData().getQPath()); - } } = /** @@ -210,9 +229,11 @@ return list; } = - /* - * (non-Javadoc) - * @see org.exoplatform.services.jcr.dataflow.ItemDataChangesLog#getIte= mStates(java.lang.String) + /** + * Gets items by identifier. + * + * @param itemIdentifier + * @return */ public List getItemStates(String itemIdentifier) { @@ -237,8 +258,18 @@ public PlainChangesLog pushLog(QPath rootPath) { PlainChangesLog cLog =3D new PlainChangesLogImpl(sessionId); - cLog.addAll(getDescendantsChanges(rootPath)); - remove(rootPath); + + if (rootPath.equals(Constants.ROOT_PATH)) + { + cLog.addAll(items); + clear(); + } + else + { + cLog.addAll(getDescendantsChanges(rootPath)); + remove(rootPath); + } + return cLog; } = @@ -252,15 +283,7 @@ */ public ItemState getItemState(NodeData parentData, QPathEntry name) thr= ows IllegalPathException { - List allStates =3D getAllStates(); - for (int i =3D allStates.size() - 1; i >=3D 0; i--) - { - ItemState state =3D allStates.get(i); - if (state.getData().getParentIdentifier().equals(parentData.getId= entifier()) - && state.getData().getQPath().getEntries()[state.getData().get= QPath().getEntries().length - 1].isSame(name)) - return state; - } - return null; + return index.get(new ParentIDQPathBasedKey(parentData.getIdentifier(= ), name)); } = /** @@ -290,6 +313,20 @@ } = /** + * Get ItemState by identifier and state. + * = + * NOTE: Uses index HashMap. + * = + * @param itemIdentifier + * @param sate + * @return + */ + public ItemState getItemState(String itemIdentifier, int state) + { + return index.get(new IDStateBasedKey(itemIdentifier, state)); + } + + /** * Collect changes of all item direct childs (only). Including the item= itself. * = * @param rootIdentifier @@ -318,17 +355,11 @@ */ public Collection getLastChildrenStates(ItemData rootData, b= oolean forNodes) { - HashMap children =3D new HashMap(); - List changes =3D getChildrenChanges(rootData.getIdentifie= r()); - for (ItemState child : changes) - { - ItemData data =3D child.getData(); - // add state to result - if (data.isNode() =3D=3D forNodes && !data.equals(rootData)) - children.put(data.getIdentifier(), child); + Map children =3D + forNodes ? lastChildNodeStates.get(rootData.getIdentifier()) : la= stChildPropertyStates.get(rootData + .getIdentifier()); = - } - return children.values(); + return children =3D=3D null ? new ArrayList() : children.= values(); } = /** @@ -523,4 +554,200 @@ } return null; } + + /** + * Adds item to the changes log. + * = + * @param item + * the item + */ + private void addItem(ItemState item) + { + index.put(item.getData().getIdentifier(), item); + index.put(item.getData().getQPath(), item); + index.put(new ParentIDQPathBasedKey(item), item); + index.put(new IDStateBasedKey(item.getData().getIdentifier(), item.g= etState()), item); + + if (item.getData().isNode()) + { + Map children =3D lastChildNodeStates.get(item.= getData().getParentIdentifier()); + if (children =3D=3D null) + { + children =3D new HashMap(); + lastChildNodeStates.put(item.getData().getParentIdentifier(), = children); + } + children.put(item.getData().getIdentifier(), item); + } + else + { + Map children =3D lastChildPropertyStates.get(i= tem.getData().getParentIdentifier()); + if (children =3D=3D null) + { + children =3D new HashMap(); + lastChildPropertyStates.put(item.getData().getParentIdentifier= (), children); + } + children.put(item.getData().getIdentifier(), item); + } + } + + /** + * This class is used as a key for index map. + */ + private class IDStateBasedKey + { + + /** + * Item identifier. + */ + private final String identifier; + + /** + * Item state. + */ + private final int state; + + /** + * KeyUUIDState constructor. + * + * @param identifier + * item identifier + * @param state + * item state + */ + IDStateBasedKey(String identifier, int state) + { + this.identifier =3D identifier; + this.state =3D state; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() + { + final int prime =3D 31; + int result =3D 1; + result =3D prime * result + identifier.hashCode(); + result =3D prime * result + state; + + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) + { + if (this =3D=3D obj) + return true; + if (obj =3D=3D null) + return false; + if (getClass() !=3D obj.getClass()) + return false; + IDStateBasedKey other =3D (IDStateBasedKey)obj; + + if (identifier =3D=3D null) + { + if (other.identifier !=3D null) + return false; + } + else if (!identifier.equals(other.identifier)) + return false; + if (state !=3D other.state) + return false; + return true; + } + } + + /** + * This class is used as a key for index map. + */ + private class ParentIDQPathBasedKey + { + /** + * Item name. + */ + private final QPathEntry name; + + /** + * Parent identifier. + */ + private final String parentIdentifier; + + /** + * KeyParentUUIDQPath constructor. + * + * @param item + * the item + */ + ParentIDQPathBasedKey(ItemState item) + { + this.name =3D item.getData().getQPath().getEntries()[item.getData= ().getQPath().getEntries().length - 1]; + this.parentIdentifier =3D item.getData().getParentIdentifier(); + } + + /** + * KeyParentUUIDQPath constructor. + * + * @param parentIdentifier + * the parent identifier + * @param name + * item name + */ + ParentIDQPathBasedKey(String parentIdentifier, QPathEntry name) + { + this.name =3D name; + this.parentIdentifier =3D parentIdentifier; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() + { + final int prime =3D 31; + int result =3D 1; + result =3D prime * result + name.getName().hashCode(); + result =3D prime * result + name.getNamespace().hashCode(); + result =3D prime * result + name.getIndex(); + result =3D prime * result + parentIdentifier.hashCode(); + + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) + { + if (this =3D=3D obj) + return true; + if (obj =3D=3D null) + return false; + if (getClass() !=3D obj.getClass()) + return false; + ParentIDQPathBasedKey other =3D (ParentIDQPathBasedKey)obj; + + if (name =3D=3D null) + { + if (other.name !=3D null) + return false; + } + else if (!name.getName().equals(other.name.getName()) + || !name.getNamespace().equals(other.name.getNamespace()) || n= ame.getIndex() !=3D other.name.getIndex()) + return false; + if (parentIdentifier =3D=3D null) + { + if (other.parentIdentifier !=3D null) + return false; + } + else if (!parentIdentifier.equals(other.parentIdentifier)) + return false; + return true; + } + } } --===============4043807992773158456==-- From do-not-reply at jboss.org Fri Nov 13 04:58:10 2009 Content-Type: multipart/mixed; boundary="===============4209048770617231806==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r629 - jcr/branches/1.12.0-OPT/exo.jcr.component.core. Date: Fri, 13 Nov 2009 04:58:10 -0500 Message-ID: <200911130958.nAD9wAP0007417@svn01.web.mwc.hst.phx2.redhat.com> --===============4209048770617231806== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-13 04:58:10 -0500 (Fri, 13 Nov 2009) New Revision: 629 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/TCK.sh Log: EXOJCR-221: fix sh Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/TCK.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/TCK.sh 2009-11-13 09:57:= 40 UTC (rev 628) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/TCK.sh 2009-11-13 09:58:= 10 UTC (rev 629) @@ -1,2 +1,2 @@ -MAVEN_OPTS=3D"-Duser.language=3Den -Duser.region=3Dus -Dmaven.test.skip=3D= true -DforkMode=3Dnever -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_OP= TS " -mvn $MAVEN_OPTS clean install -Prun-its \ No newline at end of file +MAVEN_OPTS=3D"-Duser.language=3Den -Duser.region=3Dus -Dmaven.test.skip=3D= false -DforkMode=3Dnever -Dorg.exoplatform.jcr.monitor.jdbcMonitor $MAVEN_O= PTS " +mvn $MAVEN_OPTS clean test -Prun-tck --===============4209048770617231806==-- From do-not-reply at jboss.org Fri Nov 13 05:03:38 2009 Content-Type: multipart/mixed; boundary="===============8549602366398756125==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r631 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 05:03:38 -0500 Message-ID: <200911131003.nADA3c0i009014@svn01.web.mwc.hst.phx2.redhat.com> --===============8549602366398756125== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-13 05:03:37 -0500 (Fri, 13 Nov 2009) New Revision: 631 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java Log: EXOJCR-202: IndexerCacheLoaderRuntimeTest test updated Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-13 10:00:05 UTC (rev 630) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-13 10:03:37 UTC (rev 631) @@ -236,12 +236,6 @@ modifications.addAll(removeNode(nd)); conn.commit(); = - // NodeData data =3D - // new TransientNodeData(node1path, node1id, 1, Constants.NT= _UNSTRUCTURED, new InternalQName[0], 0, null, - // new AccessControlList()); - // conn.delete(data); - //conn.commit(); - // check removing conn =3D persistentContainer.openConnection(); nd =3D (NodeData)conn.getItemData(node1id); @@ -255,9 +249,67 @@ searcher =3D new IndexSearcher(reader); hit =3D searcher.search(query); assertEquals(0, hit.length()); - } = + // public void testRenameNode() throws Exception + // { + // List modifications =3D new ArrayList(); + // + // // prepare add node to storage + // WorkspaceStorageConnection conn =3D persistentContainer.openCon= nection(); + // + // String node1id =3D IdGenerator.generate(); + // QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[= ]node:1"); + // + // // add node (/) with jcr:primaryType + // NodeData nodeData =3D + // new TransientNodeData(node1path, node1id, 1, Constants.NT_UN= STRUCTURED, new InternalQName[0], 0, + // Constants.ROOT_UUID, new AccessControlList()); + // conn.add(nodeData); + // modifications.addAll(this.addNode(nodeData)); + // + // // add property (/jcr:primaryType) + // TransientPropertyData propData =3D + // createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE= , Constants.NT_UNSTRUCTURED, false); + // conn.add(propData); + // modifications.addAll(this.addProperty(propData)); + // + // conn.commit(); + // loader.put(modifications); + // + // // check do we really have node and its property + // conn =3D persistentContainer.openConnection(); + // NodeData nd =3D (NodeData)conn.getItemData(node1id); + // assertNotNull(nd); + // assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); + // + // PropertyData pd =3D (PropertyData)conn.getItemData(propData.get= Identifier()); + // assertNotNull(pd); + // assertEquals(propData.getQPath().getAsString(), pd.getQPath().g= etAsString()); + // + // // find node by search engine + // SearchIndex index =3D ((SearchIndex)manager.getHandler()); + // IndexReader reader =3D index.getIndexReader(); + // + // IndexSearcher searcher =3D new IndexSearcher(reader); + // + // Query query =3D new TermQuery(new Term("_:UUID", node1id)); + // Hits hit =3D searcher.search(query); + // assertEquals(1, hit.length()); + // + // modifications.clear(); + // + // conn =3D persistentContainer.openConnection(); + // + // QPath newnode1path =3D QPath.makeChildPath(Constants.ROOT_PATH,= "[]node:1"); + // NodeData newnodeData =3D + // new TransientNodeData(newnode1path, node1id, 1, Constants.NT= _UNSTRUCTURED, new InternalQName[0], 0, + // Constants.ROOT_UUID, new AccessControlList()); + // + // conn.rename(newnodeData); + // + // } + public void testUpdateAddProperty() throws Exception { = @@ -349,6 +401,194 @@ = } = + public void testUpdateRemoveProperty() throws Exception + { + + List modifications =3D new ArrayList(); + + // prepare add node to storage + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + + String node1id =3D IdGenerator.generate(); + QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); + + // add node (/) with jcr:primaryType + NodeData nodeData =3D + new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + conn.add(nodeData); + modifications.addAll(this.addNode(nodeData)); + + // add property (/jcr:primaryType) + TransientPropertyData propData =3D + createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); + conn.add(propData); + modifications.addAll(this.addProperty(propData)); + + // add additonal property + TransientPropertyData propData2 =3D + createProperty(node1path, node1id, new InternalQName(Constants.NS= _DEFAULT_URI, "myProp2"), "JCR DATA VALUE", + false); + conn.add(propData2); + modifications.addAll(addProperty(propData2)); + + conn.commit(); + loader.put(modifications); + + // check do we really have node and its property + conn =3D persistentContainer.openConnection(); + NodeData nd =3D (NodeData)conn.getItemData(node1id); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); + + PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); + assertNotNull(pd); + assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); + + // find node by search engine + SearchIndex index =3D ((SearchIndex)manager.getHandler()); + IndexReader reader =3D index.getIndexReader(); + + IndexSearcher searcher =3D new IndexSearcher(reader); + + Query query =3D new TermQuery(new Term("_:UUID", node1id)); + Hits hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + query =3D new TermQuery(new Term("FULL:myProp2", "data")); + hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + modifications.clear(); + + // remove property + conn =3D persistentContainer.openConnection(); + conn.delete(propData2); + modifications.addAll(removeProperty(propData2)); + conn.commit(); + + loader.put(modifications); + + // tests it + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + + PropertyData destPropData =3D (PropertyData)connection.getItemData(p= ropData2.getIdentifier()); + + assertNull(destPropData); + + reader =3D index.getIndexReader(); + + searcher =3D new IndexSearcher(reader); + + query =3D new TermQuery(new Term("_:UUID", node1id)); + hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + query =3D new TermQuery(new Term("FULL:myProp2", "data")); + hit =3D searcher.search(query); + assertEquals(0, hit.length()); + + } + + public void testUpdateProperty() throws Exception + { + + List modifications =3D new ArrayList(); + + // prepare add node to storage + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + + String node1id =3D IdGenerator.generate(); + QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); + + // add node (/) with jcr:primaryType + NodeData nodeData =3D + new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + conn.add(nodeData); + modifications.addAll(this.addNode(nodeData)); + + // add property (/jcr:primaryType) + TransientPropertyData propData =3D + createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); + conn.add(propData); + modifications.addAll(this.addProperty(propData)); + + // add additonal property + TransientPropertyData propData2 =3D + createProperty(node1path, node1id, new InternalQName(Constants.NS= _DEFAULT_URI, "myProp2"), "JCR DATA VALUE", + false); + conn.add(propData2); + modifications.addAll(addProperty(propData2)); + + conn.commit(); + loader.put(modifications); + + // check do we really have node and its property + conn =3D persistentContainer.openConnection(); + NodeData nd =3D (NodeData)conn.getItemData(node1id); + assertNotNull(nd); + assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); + + PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); + assertNotNull(pd); + assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); + + // find node by search engine + SearchIndex index =3D ((SearchIndex)manager.getHandler()); + IndexReader reader =3D index.getIndexReader(); + + IndexSearcher searcher =3D new IndexSearcher(reader); + + Query query =3D new TermQuery(new Term("_:UUID", node1id)); + Hits hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + query =3D new TermQuery(new Term("FULL:myProp2", "data")); + hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + modifications.clear(); + + // update property + conn =3D persistentContainer.openConnection(); + + TransientPropertyData newpropData2 =3D + new TransientPropertyData(propData2.getQPath(), propData2.getIden= tifier(), propData2.getPersistedVersion(), + propData2.getType(), propData2.getParentIdentifier(), propData= 2.isMultiValued()); + + newpropData2.setValue(new TransientValueData("newvalue")); + + conn.update(newpropData2); + modifications.addAll(updateProperty(newpropData2)); + conn.commit(); + + loader.put(modifications); + + // tests it + WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); + + PropertyData destPropData =3D (PropertyData)connection.getItemData(p= ropData2.getIdentifier()); + + assertNotNull(destPropData); + + reader =3D index.getIndexReader(); + + searcher =3D new IndexSearcher(reader); + + query =3D new TermQuery(new Term("_:UUID", node1id)); + hit =3D searcher.search(query); + assertEquals(1, hit.length()); + + query =3D new TermQuery(new Term("FULL:myProp2", "data")); + hit =3D searcher.search(query); + assertEquals(0, hit.length()); + + query =3D new TermQuery(new Term("FULL:myProp2", "newvalue")); + hit =3D searcher.search(query); + assertEquals(1, hit.length()); + } + /** * Add Property to the connection but doesn't save it. * --===============8549602366398756125==-- From do-not-reply at jboss.org Fri Nov 13 05:20:13 2009 Content-Type: multipart/mixed; boundary="===============5268055975447914157==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r632 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 05:20:13 -0500 Message-ID: <200911131020.nADAKDFU014308@svn01.web.mwc.hst.phx2.redhat.com> --===============5268055975447914157== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 05:20:13 -0500 (Fri, 13 Nov 2009) New Revision: 632 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 10:0= 3:37 UTC (rev 631) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 10:2= 0:13 UTC (rev 632) @@ -671,9 +671,31 @@ { = // prepare + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); + String baseNodeId =3D IdGenerator.generate(); + addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); + + TransientPropertyData propData1 =3D addDbProperty(conn, baseNodePath= , baseNodeId, InternalQName.parse("[]prop1"), "JCR DATA VALUE 1", false); + TransientPropertyData propData2 =3D addDbProperty(conn, baseNodePath= , baseNodeId, InternalQName.parse("[]prop2"), "JCR DATA VALUE 2", false); + TransientPropertyData propData3 =3D addDbProperty(conn, baseNodePath= , baseNodeId, InternalQName.parse("[]prop3"), "JCR DATA VALUE 3", false); + + conn.commit(); + = // tests it - + Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, baseNodeId)); + = + assertNotNull(attrebutes); + = + assertTrue(attrebutes.containsKey(Constants.JCR_PRIMARYTYPE.getAsStr= ing())); + assertTrue(attrebutes.containsKey("[]prop1")); + assertTrue(attrebutes.containsKey("[]prop2")); + assertTrue(attrebutes.containsKey("[]prop3")); + = + assertEquals(propData1.getIdentifier(), attrebutes.get("[]prop1")); + assertEquals(propData2.getIdentifier(), attrebutes.get("[]prop2")); + assertEquals(propData3.getIdentifier(), attrebutes.get("[]prop3")); } = public void testGetReferences() throws Exception --===============5268055975447914157==-- From do-not-reply at jboss.org Fri Nov 13 05:51:34 2009 Content-Type: multipart/mixed; boundary="===============6362511924765669477==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r633 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 05:51:33 -0500 Message-ID: <200911131051.nADApXhe020953@svn01.web.mwc.hst.phx2.redhat.com> --===============6362511924765669477== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 05:51:33 -0500 (Fri, 13 Nov 2009) New Revision: 633 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 10:2= 0:13 UTC (rev 632) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 10:5= 1:33 UTC (rev 633) @@ -523,8 +523,25 @@ { = // prepare + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + String nodeId =3D IdGenerator.generate(); + QPath nodePath =3D QPath.parse("[]:1[]node:1"); + addDbNode(conn, nodePath, nodeId, Constants.NT_UNSTRUCTURED, Constan= ts.ROOT_UUID); + conn.commit(); + = + conn =3D persistentContainer.openConnection(); + = + NodeData nodeData =3D + new TransientNodeData(nodePath, nodeId, 1, Constants.NT_UNSTRUCTU= RED, new InternalQName[0], 2, + Constants.ROOT_UUID, new AccessControlList()); + = + List modifications =3D new ArrayList(); + +// modifications.addAll(updateNode(nodeData)); + // tests it + = = } = @@ -532,9 +549,34 @@ { = // prepare + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + String nodeId =3D IdGenerator.generate(); + QPath nodePath =3D QPath.parse("[]:1[]node:1"); + addDbNode(conn, nodePath, nodeId, Constants.NT_UNSTRUCTURED, Constan= ts.ROOT_UUID); + = + TransientPropertyData propData =3D addDbProperty(conn, nodePath, nod= eId, InternalQName.parse("[]prop"), "JCR DATA VALUE [base]", false); + = + conn.commit(); + + // create update property + TransientPropertyData updatePropData =3D new TransientPropertyData(Q= Path.makeChildPath(nodePath, InternalQName.parse("[]prop")), propData.getId= entifier(), 1, 1, nodeId, false); + updatePropData.setValue(new TransientValueData("JCR DATA VALUE [upda= ted]")); + = + List modifications =3D new ArrayList(); + = + modifications.addAll(updateProperty(updatePropData)); + = + loader.put(modifications); + // tests it - + conn =3D persistentContainer.openConnection(); + = + PropertyData destPropData =3D (PropertyData) conn.getItemData(propDa= ta.getIdentifier()); + = + assertNotNull(destPropData); + ValueData valueData =3D destPropData.getValues().get(0); + assertEquals("JCR DATA VALUE [updated]", new String(valueData.getAsB= yteArray(), "UTF-8")); } = public void testRenameNode() throws Exception --===============6362511924765669477==-- From do-not-reply at jboss.org Fri Nov 13 06:16:32 2009 Content-Type: multipart/mixed; boundary="===============2543995568931554454==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r634 - in kernel/branches/mc-int-branch: exo.kernel.container and 27 other directories. Date: Fri, 13 Nov 2009 06:16:32 -0500 Message-ID: <200911131116.nADBGWnk026408@svn01.web.mwc.hst.phx2.redhat.com> --===============2543995568931554454== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2009-11-13 06:16:31 -0500 (Fri, 13 Nov 2009) New Revision: 634 Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/GenericWrapperUtil.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/InterceptMC.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/JavassistAOPClassLoader.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCComponentAdapter.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCComponentInfo.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCIntegration.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCIntegrationContainer.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCInterceptProxy.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/RootContainerVDFDecoratorInjector.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/WrapperMethodComposer.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/util/EnvSpecific.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/util/JBossEnv.java kernel/branches/mc-int-branch/exo.kernel.demos/ kernel/branches/mc-int-branch/exo.kernel.demos/custom-pojo/ kernel/branches/mc-int-branch/exo.kernel.demos/custom-pojo/pom.xml kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/InjectedBean.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/InjectingBean.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/META-INF/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/META-INF/jboss-beans.xml kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/conf/ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/conf/configuration.xml kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/o= rg/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/o= rg/jboss/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/o= rg/jboss/dependency/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/o= rg/jboss/dependency/plugins/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/o= rg/jboss/dependency/plugins/helpers/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/o= rg/jboss/dependency/plugins/helpers/StatelessController.java Modified: kernel/branches/mc-int-branch/exo.kernel.container/pom.xml kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/CachingContainer.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/web/PortalContainerConfigOwner.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/web/PortalContainerCreator.java kernel/branches/mc-int-branch/pom.xml Log: MC integration - initial commit Modified: kernel/branches/mc-int-branch/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-13 1= 0:51:33 UTC (rev 633) +++ kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-13 1= 1:16:31 UTC (rev 634) @@ -1,122 +1,148 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.container - - eXo Kernel :: Container - eXo Kernel Container - = - - - org.exoplatform.kernel - exo.kernel.commons - - - - org.exoplatform.tool - exo.tool.framework.junit - compile - - - - javax.servlet - servlet-api - - - - picocontainer - picocontainer - - - - commons-beanutils - commons-beanutils - - - - org.jibx - jibx-run - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-bind - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-extras - - - - - - - org.jibx - maven-jibx-plugin - - src/main/resources - - binding.xml - - - - - - bind - - - - - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03-SNAPSHOT + + + exo.kernel.container + + eXo Kernel :: Container + eXo Kernel Container + = + + + org.exoplatform.kernel + exo.kernel.commons + + + + org.exoplatform.tool + exo.tool.framework.junit + compile + + + + javax.servlet + servlet-api + + + + picocontainer + picocontainer + + + + commons-beanutils + commons-beanutils + + + + org.jibx + jibx-run + + + org.codehaus.woodstox + wstx-asl + + + + + + org.jibx + jibx-bind + + + org.codehaus.woodstox + wstx-asl + + + + + + org.jibx + jibx-extras + + + + org.jboss.microcontainer + jboss-aop-mc-int + + + + org.jboss.mc-int + jboss-mc-int-common + + + + org.jboss.mc-int + jboss-mc-int-servlet + + + + org.jboss.cl + jboss-classloader + + + + org.exoplatform.kernel + mc-kernel-extras + + + + + + + + org.jibx + maven-jibx-plugin + + src/main/resources + + binding.xml + + + + + + bind + + + + + + + + + Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/CachingContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/CachingContainer.java 2009-11-13 10:51:33 UTC (rev 633) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/CachingContainer.java 2009-11-13 11:16:31 UTC (rev 634) @@ -18,6 +18,7 @@ */ package org.exoplatform.container; = +import org.exoplatform.container.mc.MCIntegrationContainer; import org.picocontainer.ComponentAdapter; import org.picocontainer.Parameter; import org.picocontainer.PicoContainer; @@ -26,7 +27,6 @@ import org.picocontainer.PicoVisitor; import org.picocontainer.defaults.AbstractPicoVisitor; import org.picocontainer.defaults.ComponentAdapterFactory; -import org.picocontainer.defaults.DefaultPicoContainer; import org.picocontainer.defaults.DuplicateComponentKeyRegistrationExcepti= on; = import java.util.List; @@ -37,7 +37,7 @@ * @author Julien Viet * @version $Revision$ */ -public class CachingContainer extends DefaultPicoContainer +public class CachingContainer extends MCIntegrationContainer { = private final ConcurrentMap adapterByType =3D Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/GenericWrapperUtil.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/GenericWrapperUtil.java (rev= 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/GenericWrapperUtil.java 2009-11-13 11:16:31 UTC (rev= 634) @@ -0,0 +1,165 @@ +package org.exoplatform.container.mc; + +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtConstructor; +import javassist.CtMethod; +import javassist.CtNewMethod; +import javassist.LoaderClassPath; +import javassist.Modifier; +import javassist.NotFoundException; +import javassist.bytecode.AnnotationsAttribute; +import javassist.bytecode.ClassFile; +import javassist.bytecode.ConstPool; +import javassist.bytecode.MethodInfo; +import org.jboss.deployers.structure.spi.DeploymentUnit; +import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentUnit; +import org.jboss.mc.common.ThreadLocalUtils; +import org.jboss.virtual.MemoryFileFactory; +import org.jboss.virtual.VirtualFile; + +import java.net.URL; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @author Ales Justin + * @author Marko Strukelj + */ +final class GenericWrapperUtil +{ + private static AtomicInteger counter =3D new AtomicInteger(0); + + static MCComponentInfo generateAndInstallWrapper(Object instance) throw= s Exception + { + ClassPool pool =3D ClassPool.getDefault(); + pool.insertClassPath(new LoaderClassPath(Thread.currentThread().getC= ontextClassLoader())); + + CtClass cc =3D pool.get(MCInterceptProxy.class.getName()); + CtClass pc =3D pool.get(instance.getClass().getName()); + + zeroArgConstructorCheck(pc, instance); + + cc.setSuperclass(pc); + cc.setName(getPackage(cc.getName()) + ".MCInterceptProxy$" + counter= .getAndIncrement()); + WrapperMethodComposer composer =3D new WrapperMethodComposer(MCInter= ceptProxy.DELEGATE, pc.getName()); + + ClassFile cf =3D cc.getClassFile(); + AnnotationsAttribute attr =3D setAnnotations(pc.getClassFile().getAt= tributes(), cf.getConstPool()); + if (attr !=3D null) + cf.addAttribute(attr); + cf.setVersionToJava5(); + + for (CtMethod m : pc.getMethods()) + { + if (isMethodOverridable(m)) + { + CtMethod method =3D CtNewMethod.make(composer.composeMethod(m)= , cc); + MethodInfo minf =3D method.getMethodInfo(); + attr =3D setAnnotations(m.getMethodInfo().getAttributes(), min= f.getConstPool()); + if (attr !=3D null) + minf.addAttribute(attr); + cc.addMethod(method); + } + } + + installWrapper(cc); + + MCComponentInfo mcinf =3D new MCComponentInfo(cc.getName(), + new JavassistAOPClassLoader(Thread.currentThread().getContextC= lassLoader(), cc.getClassPool())); + Thread.currentThread().setContextClassLoader(mcinf.getClassLoader())= ; // TODO: ensure symetry - reset old CL when done + return mcinf; + } + + private static AnnotationsAttribute setAnnotations(List attrs, ConstPoo= l cpool) + { + AnnotationsAttribute attr =3D new AnnotationsAttribute(cpool, Annota= tionsAttribute.visibleTag); + for (Object a : attrs) + { + if (a instanceof AnnotationsAttribute) + { + AnnotationsAttribute aa =3D (AnnotationsAttribute) a; + if (AnnotationsAttribute.visibleTag.equals(aa.getName()) =3D= =3D false) + continue; + attr.setAnnotations(aa.getAnnotations()); + return attr; + } + } + return null; + } + + private static String getPackage(String name) + { + return name.substring(0, name.lastIndexOf(".")); + } + + private static void installWrapper(CtClass cc) throws Exception + { + // This is to make classloading work with jboss-aop and mc-classload= ing + // - third-party (Tomcat) can be enabled through context classloader + DeploymentUnit unit =3D ThreadLocalUtils.getUnit(); + String host =3D getVFSMemoryHost(unit); + if (host !=3D null) + { + URL vfsUrl =3D new URL("vfsmemory://" + host + "/" + getResourceP= ath(cc.getName())); + MemoryFileFactory.putFile(vfsUrl, cc.toBytecode()); + return; + } + } + + static void postInstallCleanup() + { + // TODO: symmetry not 100% assured here + ClassLoader cl =3D Thread.currentThread().getContextClassLoader(); + if (cl instanceof JavassistAOPClassLoader) + Thread.currentThread().setContextClassLoader(cl.getParent()); + } + + private static String getResourcePath(String name) + { + return name.replace(".", "/") + ".class"; + } + + private static String getVFSMemoryHost(DeploymentUnit unit) throws Exce= ption + { + if (unit instanceof AbstractVFSDeploymentUnit) + { + List classPath =3D ((AbstractVFSDeploymentUnit) unit= ).getClassPath(); + for (VirtualFile vf : classPath) + { + URL url =3D vf.toURL(); + if ("vfsmemory".equals(url.getProtocol())) + { + return url.getHost(); + } + } + return getVFSMemoryHost(unit.getParent()); + } + + return null; + } + + private static boolean isMethodOverridable(CtMethod m) + { + return (m.getModifiers() & Modifier.FINAL) =3D=3D 0 + && !"clone".equals(m.getName()) + && !"finalize".equals(m.getName()); + } + + private static void zeroArgConstructorCheck(CtClass pc, Object c) + throws NotFoundException + { + CtConstructor[] ctors =3D pc.getConstructors(); + boolean found =3D false; + for (CtConstructor cons : ctors) + { + if (cons.getParameterTypes().length =3D=3D 0) + { + found =3D true; + break; + } + } + if (!found) + throw new RuntimeException("Class can not be AOP instrumented - i= t has no zero-arguments public constructor: " + c.getClass()); + } +} \ No newline at end of file Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/InterceptMC.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/InterceptMC.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/InterceptMC.java 2009-11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,24 @@ +package org.exoplatform.container.mc; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks Gatein MC enabled component. + * + * @author Marko Strukelj + * @author Ales Justin + */ +(a)Retention(RetentionPolicy.RUNTIME) +(a)Target({ElementType.TYPE}) +public @interface InterceptMC +{ + /** + * Do we enable AOP for this component. + * + * @return true if we should enable AOP, false otherwise + */ + boolean enableAOP() default false; +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/JavassistAOPClassLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/JavassistAOPClassLoader.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/JavassistAOPClassLoader.java 2009-11-13 11:16:31 UTC= (rev 634) @@ -0,0 +1,61 @@ +package org.exoplatform.container.mc; + +import javassist.Loader; +import javassist.ClassPool; + +/** + * @author Marko Strukelj + */ +public class JavassistAOPClassLoader extends Loader +{ + public JavassistAOPClassLoader() + { + } + + public JavassistAOPClassLoader(ClassPool cp) + { + super(cp); + } + + public JavassistAOPClassLoader(ClassLoader parent, ClassPool cp) + { + super(parent, cp); + } + + @Override + protected Class loadClassByDelegation(String name) throws ClassNotFound= Exception + { + if (name.startsWith("org.jboss.aop.")) + return delegateToParent(name); + + return super.loadClassByDelegation(name); + } + + protected Class loadClass(String name, boolean resolve) + throws ClassFormatError, ClassNotFoundException + { + name =3D name.intern(); + synchronized (name) + { + Class c =3D findLoadedClass(name); + if (c =3D=3D null) + { + try + { + c =3D delegateToParent(name); + } + catch (ClassNotFoundException ignored) + { + } + } + + if (c =3D=3D null) + c =3D findClass(name); + + if (resolve) + resolveClass(c); + + return c; + } + } +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/MCComponentAdapter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentAdapter.java (rev= 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentAdapter.java 2009-11-13 11:16:31 UTC (rev= 634) @@ -0,0 +1,125 @@ +package org.exoplatform.container.mc; + +import java.lang.ref.WeakReference; + +import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; +import org.jboss.dependency.plugins.helpers.StatelessController; +import org.jboss.dependency.spi.ControllerState; +import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext; +import org.jboss.kernel.spi.dependency.KernelController; +import org.jboss.kernel.spi.dependency.KernelControllerContext; +import org.picocontainer.ComponentAdapter; +import org.picocontainer.PicoContainer; +import org.picocontainer.PicoInitializationException; +import org.picocontainer.PicoIntrospectionException; +import org.picocontainer.PicoVisitor; + +/** + * @author Ales Justin + * @author Marko Strukelj + */ +public class MCComponentAdapter implements ComponentAdapter +{ + private KernelController controller; + private ComponentAdapter delegate; + private InterceptMC interceptMC; + private WeakReference lastComponentInstance; + + public MCComponentAdapter(KernelController controller, ComponentAdapter= delegate, InterceptMC interceptMC) + { + if (controller =3D=3D null) + throw new IllegalArgumentException("Null controller"); + if (delegate =3D=3D null) + throw new IllegalArgumentException("Null delegate"); + + if (controller instanceof StatelessController) + throw new IllegalArgumentException("controller is instanceof Stat= elessController"); + + this.controller =3D controller; + this.delegate =3D delegate; + this.interceptMC =3D interceptMC; + } + + public Object getComponentKey() + { + return delegate.getComponentKey(); + } + + public Class getComponentImplementation() + { + return delegate.getComponentImplementation(); + } + + public Object getComponentInstance(PicoContainer container) throws Pico= InitializationException, PicoIntrospectionException + { + Object target =3D getTargetFromRef(); + if (target !=3D null) + return target; + + try + { + String key =3D delegate.getComponentKey().toString(); + Object instance =3D delegate.getComponentInstance(container); + BeanMetaDataBuilder builder; + if (interceptMC !=3D null && interceptMC.enableAOP()) + { + MCComponentInfo mcinfo =3D GenericWrapperUtil.generateAndInsta= llWrapper(instance); + builder =3D BeanMetaDataBuilder.createBuilder(key, mcinfo.getW= rapperClassName()); + builder.addConstructorParameter(Object.class.getName(), instan= ce); + } + else + { + builder =3D BeanMetaDataBuilder.createBuilder(key, instance.ge= tClass().getName()); + builder.setConstructorValue(instance); + } + builder.ignoreCreate(); + builder.ignoreStart(); + builder.ignoreStop(); + builder.ignoreDestroy(); + + KernelControllerContext ctx =3D new AbstractKernelControllerConte= xt(null, builder.getBeanMetaData(), null); + try + { + StatelessController ctrl =3D new StatelessController(controlle= r); + ctrl.install(ctx); + if (ctx.getError() !=3D null) + throw ctx.getError(); + if (ctrl.getStates().isBeforeState(ctx.getState(), ControllerS= tate.INSTALLED)) + throw new IllegalArgumentException("Missing some dependency= : " + ctx.getDependencyInfo().getUnresolvedDependencies(null)); + + target =3D ctx.getTarget(); + lastComponentInstance =3D new WeakReference(target); + return target; + } + finally + { + GenericWrapperUtil.postInstallCleanup(); + } + } + catch (Throwable ex) + { + throw new RuntimeException("Failed to perform MC interception on = component: " + delegate.getComponentImplementation(), ex); + } + } + + public void verify(PicoContainer container) throws PicoIntrospectionExc= eption + { + delegate.verify(container); + } + + public void accept(PicoVisitor visitor) + { + delegate.accept(visitor); + } + + private Object getTargetFromRef() + { + if (lastComponentInstance =3D=3D null) + return null; + + Object target =3D lastComponentInstance.get(); + if (target =3D=3D null) + return null; + return target; + } +} \ No newline at end of file Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/MCComponentInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentInfo.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentInfo.java 2009-11-13 11:16:31 UTC (rev 63= 4) @@ -0,0 +1,26 @@ +package org.exoplatform.container.mc; + +/** + * @author Marko Strukelj + */ +public class MCComponentInfo +{ + private String name; + private ClassLoader classLoader; + + public MCComponentInfo(String wrapperClassName, ClassLoader classLoader) + { + this.name =3D wrapperClassName; + this.classLoader =3D classLoader; + } + + public String getWrapperClassName() + { + return name; + } + + public ClassLoader getClassLoader() + { + return classLoader; + } +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/MCIntegration.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegration.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegration.java 2009-11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,95 @@ +package org.exoplatform.container.mc; + +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.kernel.Kernel; +import org.jboss.kernel.plugins.dependency.AbstractKernelController; +import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; +import org.jboss.kernel.spi.deployment.KernelDeployment; +import org.jboss.mc.common.ThreadLocalUtils; +import org.picocontainer.ComponentAdapter; + +import java.io.IOException; +import java.net.URL; +import java.util.Enumeration; +import java.util.LinkedList; +import java.util.List; + +/** + * @author Marko Strukelj + */ +public class MCIntegration +{ + private static Log log =3D ExoLogger.getLogger(MCIntegration.class); + private static MCIntegration mcint; + + private AbstractKernelController rootController; + private List deployments =3D new LinkedList(); + + public synchronized static MCIntegration getInstance() + { + if (mcint =3D=3D null) + mcint =3D new MCIntegration(); + return mcint; + } + + public synchronized AbstractKernelController getRootController() + { + if (rootController =3D=3D null) + { + Kernel kernel =3D ThreadLocalUtils.getKernel(); + if (kernel !=3D null) + { + rootController =3D (AbstractKernelController) kernel.getContro= ller(); + } + else + { + log.warn("GateIn - MC integration not available"); + return null; + } + processDeployments(); + } + return rootController; + } + + private void processDeployments() + { + // Now deploy any AOP configuration - instantiates lifecycle callbac= ks + BasicXMLDeployer deployer =3D new BasicXMLDeployer(rootController.ge= tKernel()); + Enumeration urls =3D null; + try + { + urls =3D Thread.currentThread().getContextClassLoader().getResour= ces("conf/mc-beans.xml"); + } + catch (IOException e) + { + throw new RuntimeException("Failed to load resources: conf/mc-bea= ns.xml", e); + } + + while (urls.hasMoreElements()) + { + URL confUrl =3D urls.nextElement(); + try + { + deployments.add(deployer.deploy(confUrl)); + } + catch (Throwable ex) + { + throw new RuntimeException("Failed to deploy: " + confUrl, ex); + } + } + + if (deployments.size() =3D=3D 0) + { + log.debug("No conf/mc-beans.xml found. MC integration disabled."); + } + } + + public ComponentAdapter getMCAdapter(ComponentAdapter adapter, Intercep= tMC interceptAnnotation) + { + AbstractKernelController controller =3D getRootController(); + if (controller !=3D null) + adapter =3D new MCComponentAdapter(controller, adapter, intercept= Annotation); + return adapter; + } +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/MCIntegrationContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationContainer.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationContainer.java 2009-11-13 11:16:31 UTC = (rev 634) @@ -0,0 +1,95 @@ +package org.exoplatform.container.mc; + +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.picocontainer.ComponentAdapter; +import org.picocontainer.PicoContainer; +import org.picocontainer.defaults.ComponentAdapterFactory; +import org.picocontainer.defaults.DefaultPicoContainer; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/** + * @author Marko Strukelj + */ +public class MCIntegrationContainer extends DefaultPicoContainer +{ + private static Log log =3D ExoLogger.getLogger(MCIntegrationContainer.c= lass); + + public MCIntegrationContainer(ComponentAdapterFactory componentAdapterF= actory, PicoContainer parent) + { + super(componentAdapterFactory, parent); + } + + public MCIntegrationContainer(PicoContainer parent) + { + super(parent); + } + + public MCIntegrationContainer(ComponentAdapterFactory componentAdapterF= actory) + { + super(componentAdapterFactory); + } + + public MCIntegrationContainer() + { + } + + public ComponentAdapter registerComponent(ComponentAdapter componentAda= pter) + { + Class clazz =3D componentAdapter.getComponentImplementation(); + InterceptMC interceptAnnotation =3D clazz.getAnnotation(InterceptMC.= class); + + ComponentAdapter adapter =3D componentAdapter; + if (interceptAnnotation !=3D null) + { + if (hasMCKernel(componentAdapter)) + { + adapter =3D MCIntegration.getInstance().getMCAdapter(component= Adapter, interceptAnnotation); + } + } + super.registerComponent(adapter); + return adapter; + } + + public static boolean hasMCKernel(ComponentAdapter componentAdapter) + { + try + { + Class tlu =3D null; + String name =3D "org.jboss.mc.common.ThreadLocalUtils"; + try + { + ClassLoader cl =3D Thread.currentThread().getContextClassLoade= r(); + if (cl !=3D null) + tlu =3D cl.loadClass(name); + } + catch (ClassNotFoundException ignored) + { + tlu =3D Class.forName(name); + } + + Method m =3D tlu.getMethod("getKernel"); + Object ret =3D m.invoke(null); + return ret !=3D null; + } + catch (ClassNotFoundException ignored) + { + log.warn("@InterceptMC not supported in this environment (compone= nt: " + componentAdapter.getComponentKey() + ") - necessary classes are mis= sing: ", ignored); + return false; + } + catch (NoSuchMethodException e) + { + throw new RuntimeException(e); + } + catch (InvocationTargetException e) + { + throw new RuntimeException(e); + } + catch (IllegalAccessException e) + { + throw new RuntimeException(e); + } + } +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/MCInterceptProxy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInterceptProxy.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInterceptProxy.java 2009-11-13 11:16:31 UTC (rev 6= 34) @@ -0,0 +1,16 @@ +package org.exoplatform.container.mc; + +/** + * @author Marko Strukelj + */ +public class MCInterceptProxy +{ + public static final String DELEGATE =3D "__delegate"; + private Object __delegate; + + public MCInterceptProxy(Object delegate) + { + this.__delegate =3D delegate; + System.out.println("MCInterceptProxy - CL: " + delegate.getC= lass().getClassLoader()); + } +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/RootContainerVDFDecoratorInjector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/RootContainerVDFDecoratorInjector.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/RootContainerVDFDecoratorInjector.java 2009-11-13 11= :16:31 UTC (rev 634) @@ -0,0 +1,71 @@ +package org.exoplatform.container.mc; + +import java.security.ProtectionDomain; + +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtMethod; +import javassist.LoaderClassPath; +import org.jboss.beans.metadata.api.annotations.Inject; +import org.jboss.classloader.spi.ClassLoaderSystem; +import org.jboss.kernel.Kernel; +import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; +import org.jboss.util.loading.Translator; +import org.jboss.mc.common.ThreadLocalUtils; + +public class RootContainerVDFDecoratorInjector implements Translator +{ + @SuppressWarnings({"UnusedDeclaration"}) + private Kernel kernel; + private ClassLoaderSystem system; + + private static final String RC_CLASSNAME =3D "org.exoplatform.container= .RootContainer"; + private boolean found; + + public void start() + { + system.addTranslator(this); + } + + public void stop() + { + system.removeTranslator(this); + } + + protected byte[] decorate() throws Exception + { + ClassPool pool =3D ClassPool.getDefault(); + pool.insertClassPath(new LoaderClassPath(Thread.currentThread().getC= ontextClassLoader())); + CtClass cc =3D pool.get(RC_CLASSNAME); + CtMethod m =3D cc.getDeclaredMethod("getInstance"); + m.insertBefore(ThreadLocalUtils.class.getName() + ".putKernel(kernel= );\ntry {\n"); + m.insertAfter("\n } finally { \n" + ThreadLocalUtils.class.getName()= + ".removeKernel();\n }"); + return cc.toBytecode(); + } + + public byte[] transform(ClassLoader classLoader, String s, Class aCl= ass, ProtectionDomain protectionDomain, byte[] bytes) throws Exception + { + if (found =3D=3D false && RC_CLASSNAME.equals(s)) + { + found =3D true; + return decorate(); + } + return bytes; + } + + public void unregisterClassLoader(ClassLoader classLoader) + { + } + + @Inject(bean =3D KernelConstants.KERNEL_NAME) + public void setKernel(Kernel kernel) + { + this.kernel =3D kernel; + } + + @Inject + public void setSystem(ClassLoaderSystem system) + { + this.system =3D system; + } +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/WrapperMethodComposer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/WrapperMethodComposer.java (= rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/WrapperMethodComposer.java 2009-11-13 11:16:31 UTC (= rev 634) @@ -0,0 +1,126 @@ +package org.exoplatform.container.mc; + +import javassist.CtClass; +import javassist.CtMethod; +import javassist.NotFoundException; +import javassist.bytecode.AccessFlag; + +/** + * @author Marko Strukelj + */ +public class WrapperMethodComposer +{ + private String delegate; + private String type; + + public WrapperMethodComposer(String delegateFldName, String type) + { + delegate =3D delegateFldName; + this.type =3D type; + } + + public String composeMethod(CtMethod method) throws NotFoundException + { + StringBuilder sb =3D new StringBuilder(); + + String next =3D addModifiers(method.getModifiers()); + sb.append(next); + if (next.length() > 0) + sb.append(" "); + + CtClass ret =3D method.getReturnType(); + next =3D addReturnType(ret); + sb.append(next).append(" "); + + sb.append(method.getName()).append("("); + next =3D addParams(method.getParameterTypes()); + sb.append(next); + sb.append(") "); + + next =3D addExceptions(method.getExceptionTypes()); + sb.append(next); + if (next.length() > 0) + sb.append(" "); + + sb.append("{ "); + sb.append(delegateCall(method.getName(), method.getParameterTypes(),= method.getReturnType())); + sb.append("}"); + + return sb.toString(); + } + + private String delegateCall(String name, CtClass[] parameterTypes, CtCl= ass returnType) + { + StringBuilder sb =3D new StringBuilder(); + if (returnType !=3D null) + sb.append("return "); + sb.append("((").append(type).append(")"); + sb.append(delegate).append(")").append(".").append(name).append("("); + for (int i =3D 0; i < parameterTypes.length; i++) + { + if (i > 0) + sb.append(","); + sb.append("a").append(i); + } + sb.append(");"); + + if (returnType =3D=3D null) + sb.append("return;"); + + return sb.toString(); + } + + + private String addParams(CtClass[] parameterTypes) + { + if (parameterTypes =3D=3D null || parameterTypes.length =3D=3D 0) + return ""; + + StringBuilder sb =3D new StringBuilder(); + for (int i =3D 0; i < parameterTypes.length; i++) + { + if (i > 0) + sb.append(","); + sb.append(parameterTypes[i].getName()).append(" a").append(i); + } + return sb.toString(); + } + + private String addExceptions(CtClass[] exceptionTypes) + { + StringBuilder ret =3D new StringBuilder(); + if (exceptionTypes =3D=3D null || exceptionTypes.length =3D=3D 0) + return ""; + + ret.append("throws "); + for (int i =3D 0; i < exceptionTypes.length; i++) + { + if (i > 0) + ret.append(","); + ret.append(exceptionTypes[i].getName()); + } + return ret.toString(); + } + + private String addReturnType(CtClass ret) + { + if (ret =3D=3D null) + return "void"; + else + return ret.getName(); + } + + private String addModifiers(int modifiers) + { + if (AccessFlag.isPackage(modifiers)) + return ""; + else if (AccessFlag.isPrivate(modifiers)) + return "private"; + else if (AccessFlag.isPublic(modifiers)) + return "public"; + else if (AccessFlag.isProtected(modifiers)) + return "protected"; + else + throw new RuntimeException("Invalid modifiers: " + modifiers); + } +} Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/util/EnvSpecific.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/util/EnvSpecific.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/util/EnvSpecific.java 2009-11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,31 @@ +package org.exoplatform.container.util; + +import javax.servlet.ServletContext; + +/** + * This class makes env specific thread context inits when GateIn runs ins= ide JBossAS or MC + * + * @author Marko Strukelj + */ +public class EnvSpecific { + + /** + * Perform environment specific thread context initialization + * + * @param ctx ServletContext + */ + public static void initThreadEnv(ServletContext ctx) { + if (JBossEnv.isAvailable(ctx)) + JBossEnv.initThreadEnv(ctx); + } + + /** + * Perform environment specific thread context cleanup + * + * @param ctx ServletContext + */ + public static void cleanupThreadEnv(ServletContext ctx) { + if (JBossEnv.isAvailable(ctx)) + JBossEnv.cleanupThreadEnv(ctx); + } +} \ No newline at end of file Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/util/JBossEnv.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/util/JBossEnv.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/util/JBossEnv.java 2009-11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,45 @@ +package org.exoplatform.container.util; + +import javax.servlet.ServletContext; + +import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; +import org.jboss.mc.servlet.vdf.api.VDFThreadLocalUtils; + +/** + * This class makes env specific thread context inits when GateIn runs ins= ide JBossAS or MC + * + * @author Marko Strukelj + */ +public class JBossEnv +{ + /** + * Check if MC Kernel is available + * + * @param ctx ServletContext + * @return true if we're running within JBoss environment + */ + public static boolean isAvailable(ServletContext ctx) + { + return ctx.getAttribute(KernelConstants.KERNEL_NAME) !=3D null; + } + + /** + * Use VDF to grab relevant information from ServletContext and store i= t in thread context + * + * @param ctx ServletContext + */ + public static void initThreadEnv(ServletContext ctx) + { + org.jboss.mc.servlet.vdf.api.VDFThreadLocalUtils.init(ctx); + } + + /** + * Perform thread context cleanup + * + * @param ctx ServletContext + */ + public static void cleanupThreadEnv(ServletContext ctx) + { + org.jboss.mc.servlet.vdf.api.VDFThreadLocalUtils.reset(); + } +} \ No newline at end of file Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/web/PortalContainerConfigOwner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/web/PortalContainerConfigOwner.java 2009-11-13 10:51:33= UTC (rev 633) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/web/PortalContainerConfigOwner.java 2009-11-13 11:16:31= UTC (rev 634) @@ -19,6 +19,7 @@ import org.exoplatform.container.PortalContainer; import org.exoplatform.container.RootContainer.PortalContainerPostInitTask; import org.exoplatform.container.RootContainer.PortalContainerPreInitTask; +import org.exoplatform.container.util.EnvSpecific; = import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; @@ -46,7 +47,17 @@ portalContainer.registerContext(context); } }; - PortalContainer.addInitTask(event.getServletContext(), task); + + ServletContext ctx =3D event.getServletContext(); + try + { + EnvSpecific.initThreadEnv(ctx); + PortalContainer.addInitTask(ctx, task); + } + finally + { + EnvSpecific.cleanupThreadEnv(ctx); + } } = public void contextDestroyed(ServletContextEvent event) Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/web/PortalContainerCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/web/PortalContainerCreator.java 2009-11-13 10:51:33 UTC= (rev 633) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/web/PortalContainerCreator.java 2009-11-13 11:16:31 UTC= (rev 634) @@ -17,7 +17,9 @@ package org.exoplatform.container.web; = import org.exoplatform.container.RootContainer; +import org.exoplatform.container.util.EnvSpecific; = +import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; = @@ -45,7 +47,16 @@ */ public void contextInitialized(ServletContextEvent event) { - RootContainer rootContainer =3D RootContainer.getInstance(); - rootContainer.createPortalContainers(); + ServletContext ctx =3D event.getServletContext(); + try + { + EnvSpecific.initThreadEnv(ctx); + RootContainer rootContainer =3D RootContainer.getInstance(); + rootContainer.createPortalContainers(); + } + finally + { + EnvSpecific.cleanupThreadEnv(ctx); + } } } Added: kernel/branches/mc-int-branch/exo.kernel.demos/custom-pojo/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/custom-pojo/pom.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/custom-pojo/pom.xml 2009= -11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,16 @@ + + + 4.0.0 + + + org.exoplatform.kernel.demos + exo.kernel.demos + 2.2.0-Beta03-SNAPSHOT + + + exo.mc-int.custom-pojo + + eXo Kernel Demo - Custom POJO + MC Integration Demo - MC Injection of Custom POJO + + Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml 200= 9-11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,27 @@ + + + 4.0.0 + + + org.exoplatform.kernel.demos + exo.kernel.demos + 2.2.0-Beta03-SNAPSHOT + + + exo.mc-int.mc-injection + + eXo Kernel Demo - MC Injection + MC Integration Demo - MC Injection + + + + org.exoplatform.kernel + exo.kernel.container = + + + org.jboss.microcontainer + jboss-kernel + + + = + Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /java/org/exoplatform/kernel/demos/mc/InjectedBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectedBean.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectedBean.java 2009-11-13 11:16:31 UT= C (rev 634) @@ -0,0 +1,31 @@ +package org.exoplatform.kernel.demos.mc; + +import org.jboss.logging.Logger; + +/** + * @author Marko Strukelj + */ +public class InjectedBean +{ + private static final Logger log =3D Logger.getLogger(InjectedBean.class= ); + + //static + //{ + // System.out.println("InjectedBean class loaded !!!"); + //} + + public InjectedBean() + { + log.info("InjectedBean instantiated :: " + this); + } + + public String getSomeString() + { + return "[This is some property value]"; + } + + public void start() + { + log.info("Method start() called on InjectedBean"); + } +} Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /java/org/exoplatform/kernel/demos/mc/InjectingBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectingBean.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectingBean.java 2009-11-13 11:16:31 U= TC (rev 634) @@ -0,0 +1,102 @@ +package org.exoplatform.kernel.demos.mc; + +import org.exoplatform.container.mc.InterceptMC; +import org.jboss.beans.metadata.api.annotations.EntryValue; +import org.jboss.beans.metadata.api.annotations.Inject; +import org.jboss.beans.metadata.api.annotations.MapValue; +import org.jboss.beans.metadata.api.annotations.StringValue; +import org.jboss.beans.metadata.api.annotations.Value; +import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; +import org.jboss.kernel.spi.config.KernelConfigurator; +import org.jboss.logging.Logger; + +import java.util.Map; + +/** + * If we want our class to be instantiated at deploy time, + * it has to implement org.picocontainer.Startable, otherwise it will only + * be registered, but not instantiated. MC integration takes place + * at instantiation time. + * + * @author Marko Strukelj + */ +(a)InterceptMC +public class InjectingBean implements org.picocontainer.Startable +{ + private static final Logger log =3D Logger.getLogger(InjectingBean.clas= s); + + private InjectedBean bean1; + private KernelConfigurator configurator; + + @Inject(bean =3D "InjectedBean") + private InjectedBean injectedBean; + + + public InjectingBean() + { + log.info("Injecting bean instantiated"); + } + + @Inject + public void setBean(InjectedBean bean) + { + this.bean1 =3D bean; + log.info("Received InjectedBean: " + bean); + } + + @Inject(bean =3D KernelConstants.KERNEL_CONFIGURATOR_NAME) + public void setConfigurator(KernelConfigurator configurator) + { + this.configurator =3D configurator; + log.info("InjectingBean Received KernelConfigurator: " + configurato= r); + } + + @MapValue( + value =3D { + @EntryValue( + key =3D @Value(type =3D Class.class, string =3D @Stri= ngValue(value =3D "org.jboss.dependency.spi.Controller", type =3D Class.cla= ss)), + value =3D @Value(inject =3D @Inject(bean =3D KernelCo= nstants.KERNEL_CONTROLLER_NAME)) + ), + @EntryValue( + key =3D @Value(type =3D Class.class, string =3D @Stri= ngValue(value =3D "org.jboss.kernel.Kernel", type =3D Class.class)), + value =3D @Value(inject =3D @Inject(bean =3D KernelCo= nstants.KERNEL_NAME)) + ), + @EntryValue( + key =3D @Value(type =3D Class.class, string =3D @Stri= ngValue(value =3D "org.jboss.kernel.spi.dependency.KernelController", type = =3D Class.class)), + value =3D @Value(inject =3D @Inject(bean =3D KernelCo= nstants.KERNEL_CONTROLLER_NAME)) + ), + @EntryValue( + key =3D @Value(type =3D Class.class, string =3D @Stri= ngValue(value =3D "org.jboss.kernel.spi.registry.KernelBus", type =3D Class= .class)), + value =3D @Value(inject =3D @Inject(bean =3D KernelCo= nstants.KERNEL_BUS_NAME)) + ), + @EntryValue( + key =3D @Value(type =3D Class.class, string =3D @Stri= ngValue(value =3D "org.jboss.kernel.spi.registry.KernelRegistry", type =3D = Class.class)), + value =3D @Value(inject =3D @Inject(bean =3D KernelCo= nstants.KERNEL_REGISTRY_NAME)) + ), + @EntryValue( + key =3D @Value(type =3D Class.class, string =3D @Stri= ngValue(value =3D "org.jboss.kernel.spi.config.KernelConfigurator", type = =3D Class.class)), + value =3D @Value(inject =3D @Inject(bean =3D KernelCo= nstants.KERNEL_CONFIGURATOR_NAME)) + ) + } + ) + public void setBindings(Map, Object> bindings) + { + log.info("Received a map with bindings: " + bindings); + } + + @Inject(bean =3D "InjectedBean", property =3D "someString") + public void setSomeStringProperty(String value) + { + log.info("Received SomeStringProperty value: " + value); + } + + public void start() + { + log.warn("start() called (injectedBean is set to: " + injectedBean += ")"); + } + + public void stop() + { + log.info("stop() called"); + } +} Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /resources/META-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/META-INF/jboss-beans.xml (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/META-INF/jboss-beans.xml 2009-11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,3 @@ + + + \ No newline at end of file Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /resources/conf/configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/configuration.xml (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/configuration.xml 2009-11-13 11:16:31 UTC (rev 634) @@ -0,0 +1,12 @@ + + + + + InjectingBean + org.exoplatform.kernel.demos.mc.InjectingBean + = + + Added: kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml 2009-11-13 11:16= :31 UTC (rev 634) @@ -0,0 +1,21 @@ + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03-SNAPSHOT + + + org.exoplatform.kernel.demos + exo.kernel.demos + pom + + eXo Kernel Demos + + + mc-injection + + + Added: kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml = (rev 0) +++ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml 2009-1= 1-13 11:16:31 UTC (rev 634) @@ -0,0 +1,58 @@ + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03-SNAPSHOT + + + mc-kernel-extras + 1.0.0-SNAPSHOT + + MC Kernel 2.2.0 Selected Classes + MC integration classes that aren't available in mc-kernel = 2.0.6.GA + = + + + + + org.jboss.microcontainer + jboss-kernel + + + Added: kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/ja= va/org/jboss/dependency/plugins/helpers/StatelessController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/= org/jboss/dependency/plugins/helpers/StatelessController.java = (rev 0) +++ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/src/main/java/= org/jboss/dependency/plugins/helpers/StatelessController.java 2009-11-13 11= :16:31 UTC (rev 634) @@ -0,0 +1,167 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* 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.jboss.dependency.plugins.helpers; + +import org.jboss.beans.metadata.spi.BeanMetaData; +import org.jboss.dependency.spi.Controller; +import org.jboss.dependency.spi.ControllerContext; +import org.jboss.dependency.spi.ControllerState; +import org.jboss.dependency.plugins.AbstractController; +import org.jboss.kernel.Kernel; +import org.jboss.kernel.spi.dependency.KernelController; +import org.jboss.kernel.spi.dependency.KernelControllerContext; +import org.jboss.kernel.spi.event.KernelEvent; +import org.jboss.kernel.spi.event.KernelEventFilter; +import org.jboss.kernel.spi.event.KernelEventListener; + +import java.util.Set; + +/** + * Stateless controller. + * + * @author Ales Justin + */ +public class StatelessController extends AbstractController implements Ker= nelController +{ + private KernelController controller; + + public StatelessController(KernelController controller) + { + if (controller =3D=3D null) + throw new IllegalArgumentException("Null controller"); + + this.controller =3D controller; + for (ControllerState state : controller.getStates()) + addState(state, null); + } + + public void enableOnDemand(ControllerContext context) throws Throwable + { + // ignore + } + + @Override + protected void registerControllerContext(ControllerContext context) + { + // do nothing + } + + @Override + public void install(ControllerContext context) throws Throwable + { + super.install(context); + } + + public ControllerContext uninstall(Object name) + { + return null; + } + + public ControllerContext getContext(Object name, ControllerState state) + { + return controller.getContext(name, state); + } + + public ControllerContext getInstalledContext(Object name) + { + return controller.getInstalledContext(name); + } + + public boolean isShutdown() + { + return controller.isShutdown(); + } + + public void shutdown() + { + } + + public Kernel getKernel() + { + return controller.getKernel(); + } + + public void setKernel(Kernel kernel) throws Throwable + { + controller.setKernel(kernel); + } + + public KernelControllerContext install(BeanMetaData metaData) throws Th= rowable + { + return controller.install(metaData); + } + + public KernelControllerContext install(BeanMetaData metaData, Object ta= rget) throws Throwable + { + return controller.install(metaData, target); + } + + public void addSupplies(KernelControllerContext context) + { + controller.addSupplies(context); + } + + public void removeSupplies(KernelControllerContext context) + { + controller.removeSupplies(context); + } + + public Set getInstantiatedContexts(Class cl= azz) + { + return controller.getInstantiatedContexts(clazz); + } + + public Set getContexts(Class clazz, Control= lerState state) + { + return controller.getContexts(clazz, state); + } + + public KernelControllerContext getContextByClass(Class clazz) + { + return controller.getContextByClass(clazz); + } + + public void addInstantiatedContext(KernelControllerContext context) + { + controller.addInstantiatedContext(context); + } + + public void removeInstantiatedContext(KernelControllerContext context) + { + controller.removeInstantiatedContext(context); + } + + public void registerListener(KernelEventListener listener, KernelEventF= ilter filter, Object handback) throws Throwable + { + controller.registerListener(listener, filter, handback); + } + + public void unregisterListener(KernelEventListener listener, KernelEven= tFilter filter, Object handback) throws Throwable + { + controller.unregisterListener(listener, filter, handback); + } + + public void fireKernelEvent(KernelEvent event) + { + controller.fireKernelEvent(event); + } +} \ No newline at end of file Modified: kernel/branches/mc-int-branch/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/pom.xml 2009-11-13 10:51:33 UTC (rev 633) +++ kernel/branches/mc-int-branch/pom.xml 2009-11-13 11:16:31 UTC (rev 634) @@ -38,6 +38,9 @@ exo-kernel 2.2 + 2.0.6.GA + 2.2.0-SNAPSHOT + 2.0.7.GA always = @@ -54,6 +57,8 @@ exo.kernel.component.remote exo.kernel.component.cache exo.kernel.component.command + exo.kernel.demos + org.jboss.mc-kernel-extras packaging/module = @@ -85,6 +90,12 @@ = + org.exoplatform.kernel + mc-kernel-extras + 1.0.0-SNAPSHOT + + + org.exoplatform.tool exo.tool.framework.junit 1.2.0 @@ -210,6 +221,43 @@ jta 1.0.1B + + + org.jboss.microcontainer + jboss-dependency + ${org.jboss.mc} + + + + org.jboss.microcontainer + jboss-kernel + ${org.jboss.mc} + + + + org.jboss.microcontainer + jboss-aop-mc-int + ${org.jboss.mc} + + + + org.jboss.mc-int + jboss-mc-int-common + ${org.jboss.mc-int} + + + + org.jboss.mc-int + jboss-mc-int-servlet + ${org.jboss.mc-int} + + + + org.jboss.cl + jboss-classloader + ${version.jboss.classloader} + + = --===============2543995568931554454==-- From do-not-reply at jboss.org Fri Nov 13 06:43:49 2009 Content-Type: multipart/mixed; boundary="===============0401725186862459577==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r635 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 06:43:49 -0500 Message-ID: <200911131143.nADBhnL5031278@svn01.web.mwc.hst.phx2.redhat.com> --===============0401725186862459577== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 06:43:48 -0500 (Fri, 13 Nov 2009) New Revision: 635 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest and AbstractCacheLoaderTest was change= d. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-13 = 11:16:31 UTC (rev 634) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-13 = 11:43:48 UTC (rev 635) @@ -24,11 +24,16 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; +import org.jboss.cache.Node; import org.jboss.cache.Modification.ModificationType; = +import java.io.Serializable; import java.util.ArrayList; import java.util.List; = +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + /** * This abstract class contains only methods for creating a fake {@link Mo= dification} instances. It doesn't use real cache. * = @@ -157,7 +162,33 @@ list.add(modification); return list; } + = + /** + * Returns {@link Modification} like as node update. = + * = + * PUT_KEY_VALUE /$NODES/ParentNodeId/ChildNodeName.Item_Id + * PUT_KEY_VALUE /$NODES/NodeId.Item_data + * = + * @param data + * @return + */ + public List updateNode(NodeData data) { = + List list =3D new ArrayList(); = + Fqn fqn =3D Fqn.fromElements(JBossCacheStorage.NODES, data.getParent= Identifier(), data.getQPath().getEntries()[data.getQPath().getEntries().len= gth - 1].getAsString(true)); + = + Modification modification =3D + new Modification(ModificationType.PUT_KEY_VALUE, fqn, JBossCacheS= torage.ITEM_ID, data.getIdentifier()); + list.add(modification); + = + fqn =3D Fqn.fromElements(JBossCacheStorage.NODES, data.getIdentifier= ()); + modification =3D new Modification(ModificationType.PUT_KEY_VALUE, fq= n, JBossCacheStorage.ITEM_DATA, data); + modification.setOldValue(data); + list.add(modification); + = + return list; = + } + /** * Returns {@link Modification} like as property removed. But it is tho= ught, that list is already modified by JDBC loader, * so {@link Modification} instance contains additional data: Key=3DITE= M_DATA, value=3DPropertyData - data of already removed Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 11:1= 6:31 UTC (rev 634) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 11:4= 3:48 UTC (rev 635) @@ -538,11 +538,17 @@ = List modifications =3D new ArrayList(); = -// modifications.addAll(updateNode(nodeData)); + modifications.addAll(updateNode(nodeData)); + = + loader.put(modifications); = // tests it + conn =3D persistentContainer.openConnection(); = - + NodeData destNodeData =3D (NodeData) conn.getItemData(nodeId); + = + assertNotNull(destNodeData); + assertEquals(2, destNodeData.getOrderNumber()); } = public void testUpdateProperty() throws Exception --===============0401725186862459577==-- From do-not-reply at jboss.org Fri Nov 13 07:36:49 2009 Content-Type: multipart/mixed; boundary="===============8094651421341450678==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r636 - in jcr/branches/1.12.0-OPT: applications and 16 other directories. Date: Fri, 13 Nov 2009 07:36:49 -0500 Message-ID: <200911131236.nADCanwr008960@svn01.web.mwc.hst.phx2.redhat.com> --===============8094651421341450678== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-13 07:36:49 -0500 (Fri, 13 Nov 2009) New Revision: 636 Modified: jcr/branches/1.12.0-OPT/applications/exo.jcr.applications.config/pom.xml jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupcon= sole/bin/jcrbackup.cmd jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupcon= sole/bin/jcrbackup.sh jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupcon= sole/pom.xml jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.browser/p= om.xml jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.fckeditor= /pom.xml jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.rest/pom.= xml jcr/branches/1.12.0-OPT/applications/java/exo.jcr.ear/pom.xml jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jboss-ear.xml jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jonas-ear.xml jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-tomcat6.xml jcr/branches/1.12.0-OPT/exo.jcr.component.core/pom.xml jcr/branches/1.12.0-OPT/exo.jcr.component.ext/pom.xml jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/pom.xml jcr/branches/1.12.0-OPT/exo.jcr.component.webdav/pom.xml jcr/branches/1.12.0-OPT/exo.jcr.connectors.localadapter/pom.xml jcr/branches/1.12.0-OPT/exo.jcr.framework.command/pom.xml jcr/branches/1.12.0-OPT/exo.jcr.framework.ftpclient/pom.xml jcr/branches/1.12.0-OPT/exo.jcr.framework.web/pom.xml jcr/branches/1.12.0-OPT/packaging/module/pom.xml jcr/branches/1.12.0-OPT/pom.xml Log: version 1.12.0-OPT-SNAPSHOT Modified: jcr/branches/1.12.0-OPT/applications/exo.jcr.applications.config/= pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/exo.jcr.applications.config/pom.xm= l 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/exo.jcr.applications.config/pom.xm= l 2009-11-13 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.applications.config Modified: jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.ba= ckupconsole/bin/jcrbackup.cmd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupco= nsole/bin/jcrbackup.cmd 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupco= nsole/bin/jcrbackup.cmd 2009-11-13 12:36:49 UTC (rev 636) @@ -1 +1 @@ -java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03-SNAPSHOT.jar %* +java -jar exo.jcr.applications.backupconsole-1.12.0-OPT-SNAPSHOT.jar %* Modified: jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.ba= ckupconsole/bin/jcrbackup.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupco= nsole/bin/jcrbackup.sh 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupco= nsole/bin/jcrbackup.sh 2009-11-13 12:36:49 UTC (rev 636) @@ -1,3 +1,3 @@ #!/bin/sh = -java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03-SNAPSHOT.jar $* +java -jar exo.jcr.applications.backupconsole-1.12.0-OPT-SNAPSHOT.jar $* Modified: jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.ba= ckupconsole/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupco= nsole/pom.xml 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.backupco= nsole/pom.xml 2009-11-13 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.applications.backupconsole Modified: jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.br= owser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.browser/= pom.xml 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.browser/= pom.xml 2009-11-13 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.applications.browser Modified: jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.fc= keditor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.fckedito= r/pom.xml 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.fckedito= r/pom.xml 2009-11-13 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.applications.fckeditor Modified: jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.re= st/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.rest/pom= .xml 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/java/exo.jcr.applications.rest/pom= .xml 2009-11-13 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.applications.rest Modified: jcr/branches/1.12.0-OPT/applications/java/exo.jcr.ear/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/java/exo.jcr.ear/pom.xml 2009-11-1= 3 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/java/exo.jcr.ear/pom.xml 2009-11-1= 3 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.ear Modified: jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jboss-ear= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jboss-ear.xml 2= 009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jboss-ear.xml 2= 009-11-13 12:36:49 UTC (rev 636) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = 4.0.0 @@ -36,7 +36,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT ear runtime Modified: jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jonas-ear= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jonas-ear.xml 2= 009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-jonas-ear.xml 2= 009-11-13 12:36:49 UTC (rev 636) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = 4.0.0 @@ -36,7 +36,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT ear runtime Modified: jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-tomcat6.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-tomcat6.xml 200= 9-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/applications/product-exo-jcr-as-tomcat6.xml 200= 9-11-13 12:36:49 UTC (rev 636) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/pom.xml 2009-11-13 11:43= :48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/pom.xml 2009-11-13 12:36= :49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.component.core Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.ext/pom.xml 2009-11-13 11:43:= 48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.ext/pom.xml 2009-11-13 12:36:= 49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.component.ext Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/pom.xml 2009-11-13 11:43:= 48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/pom.xml 2009-11-13 12:36:= 49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.component.ftp Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.webdav/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.webdav/pom.xml 2009-11-13 11:= 43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.webdav/pom.xml 2009-11-13 12:= 36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.component.webdav Modified: jcr/branches/1.12.0-OPT/exo.jcr.connectors.localadapter/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.connectors.localadapter/pom.xml 2009-11= -13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.connectors.localadapter/pom.xml 2009-11= -13 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.connectors.localadapter Modified: jcr/branches/1.12.0-OPT/exo.jcr.framework.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.framework.command/pom.xml 2009-11-13 11= :43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.framework.command/pom.xml 2009-11-13 12= :36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.framework.command Modified: jcr/branches/1.12.0-OPT/exo.jcr.framework.ftpclient/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.framework.ftpclient/pom.xml 2009-11-13 = 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.framework.ftpclient/pom.xml 2009-11-13 = 12:36:49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.framework.ftpclient Modified: jcr/branches/1.12.0-OPT/exo.jcr.framework.web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.framework.web/pom.xml 2009-11-13 11:43:= 48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/exo.jcr.framework.web/pom.xml 2009-11-13 12:36:= 49 UTC (rev 636) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = exo.jcr.framework.web Modified: jcr/branches/1.12.0-OPT/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/packaging/module/pom.xml 2009-11-13 11:43:48 UT= C (rev 635) +++ jcr/branches/1.12.0-OPT/packaging/module/pom.xml 2009-11-13 12:36:49 UT= C (rev 636) @@ -2,7 +2,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.0-OPT/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/pom.xml 2009-11-13 11:43:48 UTC (rev 635) +++ jcr/branches/1.12.0-OPT/pom.xml 2009-11-13 12:36:49 UTC (rev 636) @@ -30,7 +30,7 @@ = org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-OPT-SNAPSHOT pom = eXo JCR --===============8094651421341450678==-- From do-not-reply at jboss.org Fri Nov 13 08:18:46 2009 Content-Type: multipart/mixed; boundary="===============6501654202013336990==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r637 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 08:18:46 -0500 Message-ID: <200911131318.nADDIkHH017581@svn01.web.mwc.hst.phx2.redhat.com> --===============6501654202013336990== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 08:18:46 -0500 (Fri, 13 Nov 2009) New Revision: 637 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 12:3= 6:49 UTC (rev 636) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 13:1= 8:46 UTC (rev 637) @@ -636,7 +636,7 @@ conn.commit(); = // tests it - Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.NODES + "/" + Constants.ROOT_UUID + "/" + "[]node:1")); + Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.NODES + "/" + nodeId + "/" + "[]node:1")); = assertNotNull(attrebutes); = --===============6501654202013336990==-- From do-not-reply at jboss.org Fri Nov 13 08:27:09 2009 Content-Type: multipart/mixed; boundary="===============1097452289251824377==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r638 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 08:27:09 -0500 Message-ID: <200911131327.nADDR9vs019011@svn01.web.mwc.hst.phx2.redhat.com> --===============1097452289251824377== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 08:27:09 -0500 (Fri, 13 Nov 2009) New Revision: 638 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 13:1= 8:46 UTC (rev 637) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 13:2= 7:09 UTC (rev 638) @@ -636,7 +636,7 @@ conn.commit(); = // tests it - Map attrebutes =3D loader.get(Fqn.fromString("/"+JBo= ssCacheStorage.NODES + "/" + nodeId + "/" + "[]node:1")); + Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, Constants.ROOT_UUID, "[]node:1")); = assertNotNull(attrebutes); = @@ -659,7 +659,7 @@ = // tests it Map attrebutes =3D - loader.get(Fqn.fromString("/" + JBossCacheStorage.PROPS + "/" + p= ropData.getIdentifier())); + loader.get(Fqn.fromElements(JBossCacheStorage.PROPS, propData.get= Identifier())); = assertNotNull(attrebutes); = --===============1097452289251824377==-- From do-not-reply at jboss.org Fri Nov 13 08:41:49 2009 Content-Type: multipart/mixed; boundary="===============7519853553951739299==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r639 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 08:41:48 -0500 Message-ID: <200911131341.nADDfmrc021689@svn01.web.mwc.hst.phx2.redhat.com> --===============7519853553951739299== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 08:41:48 -0500 (Fri, 13 Nov 2009) New Revision: 639 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 13:2= 7:09 UTC (rev 638) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 13:4= 1:48 UTC (rev 639) @@ -631,12 +631,16 @@ // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); = + QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); + String baseNodeId =3D IdGenerator.generate(); + addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); + = + // add child nodes [node1] = String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID= ); - conn.commit(); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId); = // tests it - Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, Constants.ROOT_UUID, "[]node:1")); + Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, baseNodeId, "[]node1:1")); = assertNotNull(attrebutes); = --===============7519853553951739299==-- From do-not-reply at jboss.org Fri Nov 13 08:44:31 2009 Content-Type: multipart/mixed; boundary="===============2168640895010462215==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r640 - parent/trunk. Date: Fri, 13 Nov 2009 08:44:31 -0500 Message-ID: <200911131344.nADDiV9u022280@svn01.web.mwc.hst.phx2.redhat.com> --===============2168640895010462215== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:44:31 -0500 (Fri, 13 Nov 2009) New Revision: 640 Modified: parent/trunk/pom.xml Log: [maven-release-plugin] prepare release 3 Modified: parent/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- parent/trunk/pom.xml 2009-11-13 13:41:48 UTC (rev 639) +++ parent/trunk/pom.xml 2009-11-13 13:44:31 UTC (rev 640) @@ -1,621 +1,621 @@ - - - 4.0.0 - - org.jboss - jboss-parent - 5-beta-1 - - org.exoplatform - foundation-parent - 3-SNAPSHOT - pom - - eXo JBoss Parent - - - eXo Platform SAS - http://www.exoplatform.com - - = - - - LGPL, version 2.1 - http://www.opensource.org/licenses/lgpl-license.php - - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/tr= unk - scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/trunk - http://fisheye.jboss.org/browse/exo-jcr/parent/trunk - - - - - - repository.jboss.com - http://repository.jboss.com/maven2 - - - exo-int - exoplatform.org internal repository - http://maven2.exoplatform.org/rest/maven2 - - - repo.jfrog.org-releases - repo.jfrog.org-releases - http://repo.jfrog.org/artifactory/plugins-releases-local - - - download.java.net - download.java.net repository - http://download.java.net/maven/2 - - - - - repository.jboss.com - http://repository.jboss.com/maven2 - - - exo-int - exoplatform.org internal repository - http://maven2.exoplatform.org/rest/maven2 - - - repo.jfrog.org-releases - repo.jfrog.org-releases - http://repo.jfrog.org/artifactory/plugins-releases-local - - - download.java.net - download.java.net repository - http://download.java.net/maven/2 - - - - mc-release - Local Maven repository of releases - http://mc-repo.googlecode.com/svn/maven2/releases - - - - - D:/java - ${exo.projects.directory.base}/= exo-dependencies - ${exo.projects.directory.base}/exo-w= orking - - ${exo.projects.directory.dependencies}/re= pository - = - tomcat-6.0.16 - jboss-4.2.3.GA - JONAS_4_8_5 - = - 1.2.0 - = - eXo Platform - N/A - - - false - once - false - true - Test* - = - - true - 1.5 - 1.5 - = - - - - UTF-8 - = - - 2.2-beta-4 - 1.0-beta-3 - 2.3 - 2.3 - 2.0.2 - 2.3.2 - 1.0-beta-1 - 2.3 - 2.2 - 2.5 - 2.6 - 0.1 - 1.2.1 - 2.1.2 - 2.0-beta-9 - 2.0.1 - 2.4.3 - 2.4.3 - 2.3 - 2.1-beta-1 - - - - - - - junit - junit - 3.8.2 - - - - - - install - - - - org.apache.maven.plugins - maven-clean-plugin - ${clean.plugin.version} - - - - org.apache.maven.plugins - maven-compiler-plugin - ${compiler.plugin.version} - - - org.apache.maven.plugins - maven-enforcer-plugin - ${enforcer.plugin.version} - - - org.apache.maven.plugins - maven-install-plugin - ${install.plugin.version} - - - org.apache.maven.plugins - maven-jar-plugin - ${jar.plugin.version} - - - ${maven.compiler.source} - ${maven.compiler.target} - = - - - - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specification= } - ${project.organization.name}= - ${project.name} - ${project.version} - ${project.organization.name= } - - - - - - org.apache.maven.plugins - maven-release-plugin - ${release.plugin.version} - - - false - -Prelease -Dmaven.test.skip=3Dtrue - true = = - - - - org.apache.maven.plugins - maven-site-plugin - ${site.plugin.version} - - - org.apache.maven.plugins - maven-source-plugin - = - - - true - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire.plugin.version} - - - **/${exo.test.includes}.java - - - - - org.apache.maven.plugins - maven-war-plugin - ${war.plugin.version} - - - - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specification= } - ${project.organization.name}= - ${project.name} - ${project.version} - ${project.organization.name= } - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - ${buildnumber.plugin.version} - - - org.codehaus.mojo - javacc-maven-plugin - ${javacc.plugin.version} - - - org.jibx - maven-jibx-plugin - ${jibx.plugin.version} - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - ${jaxb2.plugin.version} - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.plugin.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc.plugin.version} - - - org.codehaus.mojo - taglist-maven-plugin - ${taglist.plugin.version} - - - org.apache.maven.plugins - maven-ear-plugin - ${ear.plugin.version} - - - org.apache.maven.plugins - maven-assembly-plugin - ${assembly.plugin.version} - - - - - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${project.info.reports.plugin.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc.plugin.version} - - true - ${project.build.directory}/javadoc - 512m - 256m - - - - org.apache.maven.plugins - maven-surefire-report-plugin - ${surefire.report.plugin.version} - - - org.codehaus.mojo - taglist-maven-plugin - ${taglist.plugin.version} - - - = - - - - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.plugin.version} - - - org.exoplatform.tool - dev-resources - ${exo.dev.resources.version} - - - - - verify - - check - - - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.plugin.version} - - warning - checkstyle/codestyle.xml - checkstyle/java.header - - - - - - - release - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - ${buildNumber} - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specificat= ion} - ${project.organization.na= me} - ${project.name} - ${project.version} - ${project.organization.n= ame} - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - ${buildNumber} - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specificat= ion} - ${project.organization.na= me} - ${project.name} - ${project.version} - ${project.organization.n= ame} - - - - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - - - validate - - create - - - - - false - false - - - - - - - tomcat-server - - - tomcat - - false - - - - jboss-server - - - jboss-server - - false - - - - jonas-server - - - jonas-server - - false - - - - jmeter-perftest - - - jmeter-perftest - - false - - - - - - emma - - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - emma.coverage.out.file - target/emma/coverage.ec - - - - - - - - - maven-antrun-plugin - - - emma1 - test-compile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - run - - - - - - emma - emma - 2.0.5312 - - - emma - emma_ant - 2.0.5312 - - - - - - - - emma - emma - 2.0.5312 - test - - - - - + + + 4.0.0 + + org.jboss + jboss-parent + 5-beta-1 + + org.exoplatform + foundation-parent + 3 + pom + + eXo JBoss Parent + + + eXo Platform SAS + http://www.exoplatform.com + + = + + + LGPL, version 2.1 + http://www.opensource.org/licenses/lgpl-license.php + + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/ta= gs/3 + scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/tags/3 + http://fisheye.jboss.org/browse/exo-jcr/parent/tags/3 + + + + + + repository.jboss.com + http://repository.jboss.com/maven2 + + + exo-int + exoplatform.org internal repository + http://maven2.exoplatform.org/rest/maven2 + + + repo.jfrog.org-releases + repo.jfrog.org-releases + http://repo.jfrog.org/artifactory/plugins-releases-local + + + download.java.net + download.java.net repository + http://download.java.net/maven/2 + + + + + repository.jboss.com + http://repository.jboss.com/maven2 + + + exo-int + exoplatform.org internal repository + http://maven2.exoplatform.org/rest/maven2 + + + repo.jfrog.org-releases + repo.jfrog.org-releases + http://repo.jfrog.org/artifactory/plugins-releases-local + + + download.java.net + download.java.net repository + http://download.java.net/maven/2 + + + + mc-release + Local Maven repository of releases + http://mc-repo.googlecode.com/svn/maven2/releases + + + + + D:/java + ${exo.projects.directory.base}/= exo-dependencies + ${exo.projects.directory.base}/exo-w= orking + + ${exo.projects.directory.dependencies}/re= pository + = + tomcat-6.0.16 + jboss-4.2.3.GA + JONAS_4_8_5 + = + 1.2.0 + = + eXo Platform + N/A + + + false + once + false + true + Test* + = + + true + 1.5 + 1.5 + = + + + + UTF-8 + = + + 2.2-beta-4 + 1.0-beta-3 + 2.3 + 2.3 + 2.0.2 + 2.3.2 + 1.0-beta-1 + 2.3 + 2.2 + 2.5 + 2.6 + 0.1 + 1.2.1 + 2.1.2 + 2.0-beta-9 + 2.0.1 + 2.4.3 + 2.4.3 + 2.3 + 2.1-beta-1 + + + + + + + junit + junit + 3.8.2 + + + + + + install + + + + org.apache.maven.plugins + maven-clean-plugin + ${clean.plugin.version} + + + + org.apache.maven.plugins + maven-compiler-plugin + ${compiler.plugin.version} + + + org.apache.maven.plugins + maven-enforcer-plugin + ${enforcer.plugin.version} + + + org.apache.maven.plugins + maven-install-plugin + ${install.plugin.version} + + + org.apache.maven.plugins + maven-jar-plugin + ${jar.plugin.version} + + + ${maven.compiler.source} + ${maven.compiler.target} + = + + + + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specification= } + ${project.organization.name}= + ${project.name} + ${project.version} + ${project.organization.name= } + + + + + + org.apache.maven.plugins + maven-release-plugin + ${release.plugin.version} + + + false + -Prelease -Dmaven.test.skip=3Dtrue + true = = + + + + org.apache.maven.plugins + maven-site-plugin + ${site.plugin.version} + + + org.apache.maven.plugins + maven-source-plugin + = + + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.plugin.version} + + + **/${exo.test.includes}.java + + + + + org.apache.maven.plugins + maven-war-plugin + ${war.plugin.version} + + + + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specification= } + ${project.organization.name}= + ${project.name} + ${project.version} + ${project.organization.name= } + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + ${buildnumber.plugin.version} + + + org.codehaus.mojo + javacc-maven-plugin + ${javacc.plugin.version} + + + org.jibx + maven-jibx-plugin + ${jibx.plugin.version} + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + ${jaxb2.plugin.version} + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + + org.codehaus.mojo + taglist-maven-plugin + ${taglist.plugin.version} + + + org.apache.maven.plugins + maven-ear-plugin + ${ear.plugin.version} + + + org.apache.maven.plugins + maven-assembly-plugin + ${assembly.plugin.version} + + + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + ${project.info.reports.plugin.version} + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + true + ${project.build.directory}/javadoc + 512m + 256m + + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.report.plugin.version} + + + org.codehaus.mojo + taglist-maven-plugin + ${taglist.plugin.version} + + + = + + + + checkstyle + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + + org.exoplatform.tool + dev-resources + ${exo.dev.resources.version} + + + + + verify + + check + + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + warning + checkstyle/codestyle.xml + checkstyle/java.header + + + + + + + release + + + + + + org.apache.maven.plugins + maven-war-plugin + + + + ${buildNumber} + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specificat= ion} + ${project.organization.na= me} + ${project.name} + ${project.version} + ${project.organization.n= ame} + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${buildNumber} + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specificat= ion} + ${project.organization.na= me} + ${project.name} + ${project.version} + ${project.organization.n= ame} + + + + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + + + validate + + create + + + + + false + false + + + + + + + tomcat-server + + + tomcat + + false + + + + jboss-server + + + jboss-server + + false + + + + jonas-server + + + jonas-server + + false + + + + jmeter-perftest + + + jmeter-perftest + + false + + + + + + emma + + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + emma.coverage.out.file + target/emma/coverage.ec + + + + + + + + + maven-antrun-plugin + + + emma1 + test-compile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + + emma + emma + 2.0.5312 + + + emma + emma_ant + 2.0.5312 + + + + + + + + emma + emma + 2.0.5312 + test + + + + + --===============2168640895010462215==-- From do-not-reply at jboss.org Fri Nov 13 08:45:06 2009 Content-Type: multipart/mixed; boundary="===============0084340634074723525==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r641 - parent/tags. Date: Fri, 13 Nov 2009 08:45:06 -0500 Message-ID: <200911131345.nADDj63t022360@svn01.web.mwc.hst.phx2.redhat.com> --===============0084340634074723525== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:45:06 -0500 (Fri, 13 Nov 2009) New Revision: 641 Added: parent/tags/3/ Log: [maven-scm] copy for tag 3 Copied: parent/tags/3 (from rev 640, parent/trunk) --===============0084340634074723525==-- From do-not-reply at jboss.org Fri Nov 13 08:45:19 2009 Content-Type: multipart/mixed; boundary="===============2577420449907115633==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r642 - parent/trunk. Date: Fri, 13 Nov 2009 08:45:19 -0500 Message-ID: <200911131345.nADDjJRf022638@svn01.web.mwc.hst.phx2.redhat.com> --===============2577420449907115633== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:45:19 -0500 (Fri, 13 Nov 2009) New Revision: 642 Modified: parent/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: parent/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- parent/trunk/pom.xml 2009-11-13 13:45:06 UTC (rev 641) +++ parent/trunk/pom.xml 2009-11-13 13:45:19 UTC (rev 642) @@ -27,7 +27,7 @@ org.exoplatform foundation-parent - 3 + 4-SNAPSHOT pom = eXo JBoss Parent @@ -45,9 +45,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/ta= gs/3 - scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/tags/3 - http://fisheye.jboss.org/browse/exo-jcr/parent/tags/3 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/tr= unk + scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/trunk + http://fisheye.jboss.org/browse/exo-jcr/parent/trunk = --===============2577420449907115633==-- From do-not-reply at jboss.org Fri Nov 13 08:47:12 2009 Content-Type: multipart/mixed; boundary="===============7379786282174454242==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r643 - kernel/trunk. Date: Fri, 13 Nov 2009 08:47:12 -0500 Message-ID: <200911131347.nADDlCZ1022888@svn01.web.mwc.hst.phx2.redhat.com> --===============7379786282174454242== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:47:12 -0500 (Fri, 13 Nov 2009) New Revision: 643 Modified: kernel/trunk/pom.xml Log: foundation parent version updated to 3 tag Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-13 13:45:19 UTC (rev 642) +++ kernel/trunk/pom.xml 2009-11-13 13:47:12 UTC (rev 643) @@ -25,7 +25,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.kernel --===============7379786282174454242==-- From do-not-reply at jboss.org Fri Nov 13 08:48:44 2009 Content-Type: multipart/mixed; boundary="===============6330291735958102036==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r644 - in kernel/trunk: exo.kernel.commons and 6 other directories. Date: Fri, 13 Nov 2009 08:48:44 -0500 Message-ID: <200911131348.nADDmig9023043@svn01.web.mwc.hst.phx2.redhat.com> --===============6330291735958102036== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:48:44 -0500 (Fri, 13 Nov 2009) New Revision: 644 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.2.0-Beta03 Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-13 13:47:12 UTC (rev 64= 3) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-13 13:48:44 UTC (rev 64= 4) @@ -1,67 +1,67 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.commons - - eXo Kernel :: Commons Utils - eXo Commons - - - - commons-lang - commons-lang - - - - xpp3 - xpp3 - - - - commons-logging - commons-logging - - - - org.slf4j - slf4j-api - - - - org.slf4j - slf4j-log4j12 - - - - log4j - log4j - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.commons + + eXo Kernel :: Commons Utils + eXo Commons + + + + commons-lang + commons-lang + + + + xpp3 + xpp3 + + + + commons-logging + commons-logging + + + + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-log4j12 + + + + log4j + log4j + + + Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-13 13:47:12 UTC= (rev 643) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-13 13:48:44 UTC= (rev 644) @@ -1,51 +1,51 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.cache - - eXo Kernel :: Component :: Cache Service - exoplatform Cache services implementation - - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.kernel - exo.kernel.component.remote - - - org.exoplatform.kernel - exo.kernel.component.common - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.cache + + eXo Kernel :: Component :: Cache Service + exoplatform Cache services implementation + + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.component.remote + + + org.exoplatform.kernel + exo.kernel.component.common + + + + Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-13 13:47:12 U= TC (rev 643) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-13 13:48:44 U= TC (rev 644) @@ -1,54 +1,54 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.command - - eXo Kernel :: Component :: Command Service - exoplatform command services implementation - - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - commons-chain - commons-chain - - - xml-apis - xml-apis - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.command + + eXo Kernel :: Component :: Command Service + exoplatform command services implementation + + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + commons-chain + commons-chain + + + xml-apis + xml-apis + + + + + Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-13 13:47:12 UT= C (rev 643) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-13 13:48:44 UT= C (rev 644) @@ -1,84 +1,84 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.common - - eXo Kernel :: Component :: Common Service - exoplatform common services implementation - - - - org.exoplatform.kernel - exo.kernel.container - - - - javax.activation - activation - - - - jotm - jotm - - - javax.resource - connector - - - log4j - log4j - - - - - - javax.resource - connector-api - provided - - - - quartz - quartz - - - - javax.mail - mail - - - - javax.transaction - jta - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.common + + eXo Kernel :: Component :: Common Service + exoplatform common services implementation + + + + org.exoplatform.kernel + exo.kernel.container + + + + javax.activation + activation + + + + jotm + jotm + + + javax.resource + connector + + + log4j + log4j + + + + + + javax.resource + connector-api + provided + + + + quartz + quartz + + + + javax.mail + mail + + + + javax.transaction + jta + + + + Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-13 13:47:12 UT= C (rev 643) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-13 13:48:44 UT= C (rev 644) @@ -1,47 +1,47 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.remote - - eXo Kernel :: Component :: Remote Service - exoplatform remote services implementation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - jgroups - jgroups - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.remote + + eXo Kernel :: Component :: Remote Service + exoplatform remote services implementation + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + jgroups + jgroups + + + Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-13 13:47:12 UTC (rev = 643) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-13 13:48:44 UTC (rev = 644) @@ -1,122 +1,122 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.container - - eXo Kernel :: Container - eXo Kernel Container - = - - - org.exoplatform.kernel - exo.kernel.commons - - - - org.exoplatform.tool - exo.tool.framework.junit - compile - - - - javax.servlet - servlet-api - - - - picocontainer - picocontainer - - - - commons-beanutils - commons-beanutils - - - - org.jibx - jibx-run - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-bind - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-extras - - - - - - - org.jibx - maven-jibx-plugin - - src/main/resources - - binding.xml - - - - - - bind - - - - - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.container + + eXo Kernel :: Container + eXo Kernel Container + = + + + org.exoplatform.kernel + exo.kernel.commons + + + + org.exoplatform.tool + exo.tool.framework.junit + compile + + + + javax.servlet + servlet-api + + + + picocontainer + picocontainer + + + + commons-beanutils + commons-beanutils + + + + org.jibx + jibx-run + + + org.codehaus.woodstox + wstx-asl + + + + + + org.jibx + jibx-bind + + + org.codehaus.woodstox + wstx-asl + + + + + + org.jibx + jibx-extras + + + + + + + org.jibx + maven-jibx-plugin + + src/main/resources + + binding.xml + + + + + + bind + + + + + + + + + Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2009-11-13 13:47:12 UTC (rev 643) +++ kernel/trunk/packaging/module/pom.xml 2009-11-13 13:48:44 UTC (rev 644) @@ -1,66 +1,66 @@ - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - 4.0.0 - kernel.packaging.module - pom - eXo Kernel Build module - - - kernel - module - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = - + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + 4.0.0 + kernel.packaging.module + pom + eXo Kernel Build module + + + kernel + module + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = + Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-13 13:47:12 UTC (rev 643) +++ kernel/trunk/pom.xml 2009-11-13 13:48:44 UTC (rev 644) @@ -1,224 +1,224 @@ - - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - pom - - eXo Kernel - - - exo-kernel - 2.2 - always - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk - http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk - - - - exo.kernel.container - exo.kernel.commons - exo.kernel.component.common - exo.kernel.component.remote - exo.kernel.component.cache - exo.kernel.component.command - packaging/module - - - - - - - org.exoplatform.kernel - exo.kernel.container - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.commons - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.component.common - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.component.remote - ${project.version} - - - - org.exoplatform.tool - exo.tool.framework.junit - 1.2.0 - - - - commons-lang - commons-lang - 2.3 - - - - commons-chain - commons-chain - 1.0 - - - - xpp3 - xpp3 - 1.1.3.4.O - - - - commons-logging - commons-logging - 1.0.4 - - - - jgroups - jgroups - 2.6.10.GA - - - - org.slf4j - slf4j-api - 1.5.6 - - - - org.slf4j - slf4j-log4j12 - 1.5.6 - - - - log4j - log4j - 1.2.14 - - - - picocontainer - picocontainer - 1.1 - - - - commons-beanutils - commons-beanutils - 1.6 - - - - org.jibx - jibx-run - ${jibx.plugin.version} - - - - org.jibx - jibx-bind - ${jibx.plugin.version} - - - - org.jibx - jibx-extras - ${jibx.plugin.version} - - - - javax.activation - activation - 1.1 - - - - javax.resource - connector-api - 1.5 - - - - jotm - jotm - 2.0.10 - - - - quartz - quartz - 1.5.0-RC2 - - - - javax.mail - mail - 1.4 - - - - javax.servlet - servlet-api - 2.5 - provided - - - - javax.transaction - jta - 1.0.1B - - - - - - - junit - junit - test - - - - + + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + pom + + eXo Kernel + + + exo-kernel + 2.2 + always + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.0-Beta03 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.0-Beta03 + http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.0-Beta0= 3 + + + + exo.kernel.container + exo.kernel.commons + exo.kernel.component.common + exo.kernel.component.remote + exo.kernel.component.cache + exo.kernel.component.command + packaging/module + + + + + + + org.exoplatform.kernel + exo.kernel.container + ${project.version} + + + + org.exoplatform.kernel + exo.kernel.commons + ${project.version} + + + + org.exoplatform.kernel + exo.kernel.component.common + ${project.version} + + + + org.exoplatform.kernel + exo.kernel.component.remote + ${project.version} + + + + org.exoplatform.tool + exo.tool.framework.junit + 1.2.0 + + + + commons-lang + commons-lang + 2.3 + + + + commons-chain + commons-chain + 1.0 + + + + xpp3 + xpp3 + 1.1.3.4.O + + + + commons-logging + commons-logging + 1.0.4 + + + + jgroups + jgroups + 2.6.10.GA + + + + org.slf4j + slf4j-api + 1.5.6 + + + + org.slf4j + slf4j-log4j12 + 1.5.6 + + + + log4j + log4j + 1.2.14 + + + + picocontainer + picocontainer + 1.1 + + + + commons-beanutils + commons-beanutils + 1.6 + + + + org.jibx + jibx-run + ${jibx.plugin.version} + + + + org.jibx + jibx-bind + ${jibx.plugin.version} + + + + org.jibx + jibx-extras + ${jibx.plugin.version} + + + + javax.activation + activation + 1.1 + + + + javax.resource + connector-api + 1.5 + + + + jotm + jotm + 2.0.10 + + + + quartz + quartz + 1.5.0-RC2 + + + + javax.mail + mail + 1.4 + + + + javax.servlet + servlet-api + 2.5 + provided + + + + javax.transaction + jta + 1.0.1B + + + + + + + junit + junit + test + + + + --===============6330291735958102036==-- From do-not-reply at jboss.org Fri Nov 13 08:49:18 2009 Content-Type: multipart/mixed; boundary="===============7639313350270436436==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r645 - kernel/tags. Date: Fri, 13 Nov 2009 08:49:18 -0500 Message-ID: <200911131349.nADDnIvb023125@svn01.web.mwc.hst.phx2.redhat.com> --===============7639313350270436436== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:49:18 -0500 (Fri, 13 Nov 2009) New Revision: 645 Added: kernel/tags/2.2.0-Beta03/ Log: [maven-scm] copy for tag 2.2.0-Beta03 Copied: kernel/tags/2.2.0-Beta03 (from rev 644, kernel/trunk) --===============7639313350270436436==-- From do-not-reply at jboss.org Fri Nov 13 08:49:45 2009 Content-Type: multipart/mixed; boundary="===============1094450998214154161==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r646 - in kernel/trunk: exo.kernel.commons and 6 other directories. Date: Fri, 13 Nov 2009 08:49:45 -0500 Message-ID: <200911131349.nADDnjVF023175@svn01.web.mwc.hst.phx2.redhat.com> --===============1094450998214154161== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:49:45 -0500 (Fri, 13 Nov 2009) New Revision: 646 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-13 13:49:18 UTC (rev 64= 5) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-13 13:49:45 UTC (rev 64= 6) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.commons Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-13 13:49:18 UTC= (rev 645) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-13 13:49:45 UTC= (rev 646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.cache Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-13 13:49:18 U= TC (rev 645) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-13 13:49:45 U= TC (rev 646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.command Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-13 13:49:18 UT= C (rev 645) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-13 13:49:45 UT= C (rev 646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.common Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-13 13:49:18 UT= C (rev 645) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-13 13:49:45 UT= C (rev 646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.remote Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-13 13:49:18 UTC (rev = 645) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-13 13:49:45 UTC (rev = 646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.container Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2009-11-13 13:49:18 UTC (rev 645) +++ kernel/trunk/packaging/module/pom.xml 2009-11-13 13:49:45 UTC (rev 646) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = 4.0.0 Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-13 13:49:18 UTC (rev 645) +++ kernel/trunk/pom.xml 2009-11-13 13:49:45 UTC (rev 646) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT pom = eXo Kernel @@ -42,9 +42,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.0-Beta03 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.0-Beta03 - http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.0-Beta0= 3 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk + http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk = --===============1094450998214154161==-- From do-not-reply at jboss.org Fri Nov 13 08:51:51 2009 Content-Type: multipart/mixed; boundary="===============6213377339523095301==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r647 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 08:51:51 -0500 Message-ID: <200911131351.nADDppgH023701@svn01.web.mwc.hst.phx2.redhat.com> --===============6213377339523095301== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 08:51:51 -0500 (Fri, 13 Nov 2009) New Revision: 647 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 13:49:45= UTC (rev 646) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 13:51:51= UTC (rev 647) @@ -87,10 +87,8 @@ */ public void put(List modifications) throws Exception { - LOG.info(modifications); - = // Prepare modifications list. - // Will be changed Modification to ModificationEx and set operation t= ype (ADD or UPDATE). = + // Will be added oldValueData to modification for UPDATE. = prepareModifications(modifications); = JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection)dataC= ontainer.openConnection(); @@ -102,13 +100,10 @@ switch (m.getType()) { case PUT_DATA: - LOG.info(m); break; case PUT_DATA_ERASE: - LOG.info(m); break; case PUT_KEY_VALUE: - LOG.info(m); = if (m.getOldValue() !=3D null) doUpdate(m, jdbcConnection); @@ -117,17 +112,14 @@ = break; case REMOVE_DATA: - LOG.info(m); break; case REMOVE_KEY_VALUE: - LOG.info(m); break; case REMOVE_NODE: - LOG.info(m); + = doRemove(m, jdbcConnection); break; case MOVE: - LOG.info(m); break; default: throw new CacheException("Unknown modification " + m.getT= ype()); @@ -278,7 +270,8 @@ modifications.get(i).setOldValue(itemData); } = } - else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) + //TODO for REMOVE is not need removed ItemData + /*else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) { if (m.getFqn().size() =3D=3D 2 && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) = @@ -291,7 +284,7 @@ if (removedItemData !=3D null) modifications.get(i).setValue(removedItemData); } - } + }*/ } } = @@ -398,67 +391,6 @@ } = return (attrs.size() =3D=3D 0 ? null : attrs); - /*if (name.size() > 1) - { - if (name.get(1).equals(JBossCacheStorage.NODES)) - { - // return Node - if (name.size() > 3) - { - QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); - - // 1) all subtree will be cached - // 2) all subtree will be read from DB (with allprops) for = only Ids. - // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = - String parentId =3D (String)cache.get(name.getParent(), JBo= ssCacheStorage.ITEM_ID); - - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - try - { - NodeData parent =3D (NodeData)conn.getItemData(parentId); - - ItemData item =3D conn.getItemData(parent, nodeName); - - // item Id - attrs.put(JBossCacheStorage.ITEM_ID, item.getIdentifier(= )); - - // if Node (Property cannot due to logic of StorageConne= ction) add props - for (PropertyData prop : conn.getChildPropertiesData(par= ent)) - { - attrs.put(prop.getQPath().getName().getAsString(), pr= op.getIdentifier()); - } - } - finally - { - conn.close(); - } - } - else - { - // root Node (/$TREE/[]:1) - attrs.put(JBossCacheStorage.ITEM_ID, Constants.ROOT_UUID); - } - } - else if (name.get(1).equals(JBossCacheStorage.NODES)) - { - // we have all data on thrid level = - if (name.size() =3D=3D 3) - { - // return Node or Property - String itemId =3D name.getLastElementAsString(); - - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - try - { - attrs.put(JBossCacheStorage.ITEM_DATA, conn.getItemData(= itemId)); - } - finally - { - conn.close(); - } - } - } - }*/ } = /** @@ -508,76 +440,6 @@ } = return (childs.size() =3D=3D 0 ? null : childs); - -/* Set childs =3D new LinkedHashSet(); - if (fqn.size() > 2) - { - if (fqn.get(2).equals(JBossCacheStorage.NODES)) - { - // return Node - if (fqn.size() > 3) - { - QPathEntry nodeName =3D QPathEntry.parse(fqn.getLastElement= AsString()); - - // TODO non effective, in this way 1) all subtree will be c= ached - // 2) all subtree will be read from DB (with allprops) for = only Ids. - // The effective way DON NOT use calls to cache and use spe= cial SQLs for Ids only read. = - String parentId =3D (String)cache.get(fqn.getParent(), JBos= sCacheStorage.ITEM_ID); - - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - try - { - NodeData parent =3D (NodeData)conn.getItemData(parentId); - - NodeData node =3D (NodeData)conn.getItemData(parent, nod= eName); - - // get child nodes by parent Id - for (NodeData prop : conn.getChildNodesData(node)) - { - childs - .add(node.getQPath().getEntries()[node.getQPath().= getEntries().length - 1].getAsString(true)); - } - } - finally - { - conn.close(); - } - } - else - { - // root Node (/$TREE/[]:1) - childs.add(Constants.ROOT_PATH.getEntries()[Constants.ROOT_= PATH.getEntries().length - 1] - .getAsString(true)); - } - } - else if (fqn.get(2).equals(JBossCacheStorage.NODES)) - { - // we have all data on thrid level = - if (fqn.size() =3D=3D 3) - { - // return all Nodes and Properties Ids - -// WorkspaceStorageConnection conn =3D dataContainer.openCon= nection(); -// try -// { -// for (String itemId : conn.getAllItemIdentifiers()) -// { -// childs.add(itemId); -// } -// } -// finally -// { -// conn.close(); -// } - } - } - } - else if (fqn.equals(Fqn.ROOT)) - { - childs.add(JBossCacheStorage.NODES); - childs.add(JBossCacheStorage.PROPS); - } - return childs;*/ } = /** --===============6213377339523095301==-- From do-not-reply at jboss.org Fri Nov 13 08:54:43 2009 Content-Type: multipart/mixed; boundary="===============2701375295573230057==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r648 - jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/dasl. Date: Fri, 13 Nov 2009 08:54:43 -0500 Message-ID: <200911131354.nADDshlu023954@svn01.web.mwc.hst.phx2.redhat.com> --===============2701375295573230057== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: gavrikvetal Date: 2009-11-13 08:54:42 -0500 (Fri, 13 Nov 2009) New Revision: 648 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/dasl/SearchResultResponseEntity.java Log: EXOJCR-131 - Add D:getcontenttype and jcr:nodeType properties to SEARCH met= hod response. Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/dasl/SearchResultResponseEntity.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/dasl/SearchResultResponseEntity.java 2009-11-13 13:51= :51 UTC (rev 647) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/dasl/SearchResultResponseEntity.java 2009-11-13 13:54= :42 UTC (rev 648) @@ -89,6 +89,7 @@ properties.add(new QName("DAV:", "creationdate")); properties.add(new QName("DAV:", "getlastmodified")); properties.add(new QName("DAV:", "getcontentlength")); + properties.add(new QName("DAV:", "getcontenttype")); } = /** --===============2701375295573230057==-- From do-not-reply at jboss.org Fri Nov 13 08:57:53 2009 Content-Type: multipart/mixed; boundary="===============2166524447908213768==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r649 - core/trunk. Date: Fri, 13 Nov 2009 08:57:52 -0500 Message-ID: <200911131357.nADDvq3g024592@svn01.web.mwc.hst.phx2.redhat.com> --===============2166524447908213768== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 08:57:52 -0500 (Fri, 13 Nov 2009) New Revision: 649 Modified: core/trunk/pom.xml Log: kernel dependency updated to Beta3 tag Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-13 13:54:42 UTC (rev 648) +++ core/trunk/pom.xml 2009-11-13 13:57:52 UTC (rev 649) @@ -38,7 +38,7 @@ exo-core 2.3 = - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta03 *Test* = --===============2166524447908213768==-- From do-not-reply at jboss.org Fri Nov 13 09:01:17 2009 Content-Type: multipart/mixed; boundary="===============1573796658318249777==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r650 - core/trunk. Date: Fri, 13 Nov 2009 09:01:16 -0500 Message-ID: <200911131401.nADE1GQX025380@svn01.web.mwc.hst.phx2.redhat.com> --===============1573796658318249777== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:01:16 -0500 (Fri, 13 Nov 2009) New Revision: 650 Modified: core/trunk/pom.xml Log: foundation parent version updated to 3 tag Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-13 13:57:52 UTC (rev 649) +++ core/trunk/pom.xml 2009-11-13 14:01:16 UTC (rev 650) @@ -24,7 +24,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.core --===============1573796658318249777==-- From do-not-reply at jboss.org Fri Nov 13 09:03:03 2009 Content-Type: multipart/mixed; boundary="===============5426927925171428019==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r651 - in core/trunk: exo.core.component.database and 10 other directories. Date: Fri, 13 Nov 2009 09:03:03 -0500 Message-ID: <200911131403.nADE33UP025672@svn01.web.mwc.hst.phx2.redhat.com> --===============5426927925171428019== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:03:02 -0500 (Fri, 13 Nov 2009) New Revision: 651 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.3.0-Beta03 Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2009-11-13 14:01:16 UTC = (rev 650) +++ core/trunk/exo.core.component.database/pom.xml 2009-11-13 14:03:02 UTC = (rev 651) @@ -1,146 +1,146 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.database - - eXo Core :: Component :: Database Service - exoplatform database services implementation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - - javax.resource - connector-api - test - - - - hsqldb - hsqldb - runtime - - - - com.experlog - xapool - - - - c3p0 - c3p0 - runtime - - - - commons-dbcp - commons-dbcp - provided - - - - org.hibernate - hibernate-core - - - org.slf4j - slf4j-api - - = - - - - xdoclet - xdoclet-hibernate-module - - - - xdoclet - xdoclet - - - - xdoclet - xdoclet-xdoclet-module - - - - xdoclet - xjavadoc - - - - commons-collections - commons-collections - runtime - - = - - javassist - javassist - - - - org.hibernate - hibernate-annotations - - - org.slf4j - slf4j-api - - = - - = - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/DBCreatorTest.java - - - - = - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.database + + eXo Core :: Component :: Database Service + exoplatform database services implementation + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + + javax.resource + connector-api + test + + + + hsqldb + hsqldb + runtime + + + + com.experlog + xapool + + + + c3p0 + c3p0 + runtime + + + + commons-dbcp + commons-dbcp + provided + + + + org.hibernate + hibernate-core + + + org.slf4j + slf4j-api + + = + + + + xdoclet + xdoclet-hibernate-module + + + + xdoclet + xdoclet + + + + xdoclet + xdoclet-xdoclet-module + + + + xdoclet + xjavadoc + + + + commons-collections + commons-collections + runtime + + = + + javassist + javassist + + + + org.hibernate + hibernate-annotations + + + org.slf4j + slf4j-api + + = + + = + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/DBCreatorTest.java + + + + = + + + Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2009-11-13 14:01:16 UTC = (rev 650) +++ core/trunk/exo.core.component.document/pom.xml 2009-11-13 14:03:02 UTC = (rev 651) @@ -1,104 +1,104 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.document - - eXo Core :: Component :: Demo Service - eXo demo service Impl - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - pdfbox - pdfbox - - - - com.lowagie - itext - - - - org.htmlparser - htmlparser - - - - org.apache.poi - poi - - - log4j - log4j - - - - - - org.apache.poi - poi-scratchpad - - - log4j - log4j - - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.drl - **/*.vm - **/*.doc - **/*.dot - **/*.xls - **/*.ppt - **/*.txt - **/*.tiff - **/*.pdf - **/*.odt - **/*.html - **/*.msg - **/*.pst - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.document + + eXo Core :: Component :: Demo Service + eXo demo service Impl + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + pdfbox + pdfbox + + + + com.lowagie + itext + + + + org.htmlparser + htmlparser + + + + org.apache.poi + poi + + + log4j + log4j + + + + + + org.apache.poi + poi-scratchpad + + + log4j + log4j + + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.drl + **/*.vm + **/*.doc + **/*.dot + **/*.xls + **/*.ppt + **/*.txt + **/*.tiff + **/*.pdf + **/*.odt + **/*.html + **/*.msg + **/*.pst + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-13 14:01:16 UTC (rev= 650) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-13 14:03:02 UTC (rev= 651) @@ -1,66 +1,66 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.ldap - - eXo Core :: Component :: LDAP Service - eXo LDAP impl - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - com.novell.ldap - jldap - test - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - - - - = - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.ldap + + eXo Core :: Component :: LDAP Service + eXo LDAP impl + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + com.novell.ldap + jldap + test + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + + + + = + + Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-13 14:01= :16 UTC (rev 650) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-13 14:03= :02 UTC (rev 651) @@ -1,133 +1,133 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.organization.api - - eXo Core :: Component :: Organization Service API - eXo Organization Service API - - - - org.exoplatform.kernel - exo.kernel.container - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - - org.exoplatform.core - exo.core.component.security.core - - - - javax.ejb - ejb - - - - xdoclet - xdoclet-hibernate-module - - - - xdoclet - xdoclet - - - - xdoclet - xdoclet-xdoclet-module - - - - xdoclet - xjavadoc - - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - compile - - - - - - - - - - - - - - - - - run - - - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.organization.api + + eXo Core :: Component :: Organization Service API + eXo Organization Service API + + + + org.exoplatform.kernel + exo.kernel.container + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + + org.exoplatform.core + exo.core.component.security.core + + + + javax.ejb + ejb + + + + xdoclet + xdoclet-hibernate-module + + + + xdoclet + xdoclet + + + + xdoclet + xdoclet-xdoclet-module + + + + xdoclet + xjavadoc + + + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + compile + + + + + + + + + + + + + + + + + run + + + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-13 14:0= 1:16 UTC (rev 650) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-13 14:0= 3:02 UTC (rev 651) @@ -1,89 +1,89 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.organization.jdbc - - eXo Core :: Component :: Organization Service JDBC - eXo Organization Service JDBC - - - - org.exoplatform.core - exo.core.component.database - - - - org.exoplatform.core - exo.core.component.organization.api - - - - javax.resource - connector-api - test - - - - com.microsoft - sqljdbc - test - - - - com.ibm.db2 - db2jcc - test - - - - com.ibm.db2 - db2jcc_license_cu - test - - - - oracle - ojdbc - test - - - - postgresql - postgresql - test - - - - mysql - mysql-connector-java - test - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.organization.jdbc + + eXo Core :: Component :: Organization Service JDBC + eXo Organization Service JDBC + + + + org.exoplatform.core + exo.core.component.database + + + + org.exoplatform.core + exo.core.component.organization.api + + + + javax.resource + connector-api + test + + + + com.microsoft + sqljdbc + test + + + + com.ibm.db2 + db2jcc + test + + + + com.ibm.db2 + db2jcc_license_cu + test + + + + oracle + ojdbc + test + + + + postgresql + postgresql + test + + + + mysql + mysql-connector-java + test + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-13 14:0= 1:16 UTC (rev 650) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-13 14:0= 3:02 UTC (rev 651) @@ -1,66 +1,66 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.organization.ldap - - eXo Core :: Component :: Organization Service LDAP - eXo Organization Service LDAP - - - - org.exoplatform.core - exo.core.component.ldap - - - org.exoplatform.core - exo.core.component.organization.api - - - org.exoplatform.core - exo.core.component.organization.jdbc - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestOrganizationService.java - - - - = - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.organization.ldap + + eXo Core :: Component :: Organization Service LDAP + eXo Organization Service LDAP + + + + org.exoplatform.core + exo.core.component.ldap + + + org.exoplatform.core + exo.core.component.organization.api + + + org.exoplatform.core + exo.core.component.organization.jdbc + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestOrganizationService.java + + + + = + + \ No newline at end of file Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-13 14:01:16= UTC (rev 650) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-13 14:03:02= UTC (rev 651) @@ -1,46 +1,46 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.script.groovy - - eXo Core :: Component :: Groovy Scripts Instantiator - Load and compile Groovy script - - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.codehaus.groovy - groovy-all - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.script.groovy + + eXo Core :: Component :: Groovy Scripts Instantiator + Load and compile Groovy script + + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.codehaus.groovy + groovy-all + + \ No newline at end of file Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-13 14:01:16= UTC (rev 650) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-13 14:03:02= UTC (rev 651) @@ -1,62 +1,62 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.security.core - - eXo Core :: Component :: Security Service - eXo Security - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.security.core + + eXo Core :: Component :: Security Service + eXo Security + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-13 14:01:16 UTC (= rev 650) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-13 14:03:02 UTC (= rev 651) @@ -1,53 +1,53 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.web.css - - eXo Core :: Component :: Web CSS - Stylesheet engine - - - - org.w3c - sac - - - - batik - batik-util - - - - batik - batik-css - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.web.css + + eXo Core :: Component :: Web CSS + Stylesheet engine + + + + org.w3c + sac + + + + batik + batik-util + + + + batik + batik-css + + + + Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-13 14:01:1= 6 UTC (rev 650) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-13 14:03:0= 2 UTC (rev 651) @@ -1,103 +1,103 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.xml-processing - - eXo Core :: Component :: XML Processing Service - eXo XML Processing Services - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - jtidy - jtidy - - - - xml-resolver - xml-resolver - - - - - - - src/main/java - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - src/main/resources - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - src/test/java - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.xml-processing + + eXo Core :: Component :: XML Processing Service + eXo XML Processing Services + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + jtidy + jtidy + + + + xml-resolver + xml-resolver + + + + + + + src/main/java + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + src/main/resources + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + src/test/java + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + \ No newline at end of file Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2009-11-13 14:01:16 UTC (rev 650) +++ core/trunk/packaging/module/pom.xml 2009-11-13 14:03:02 UTC (rev 651) @@ -1,77 +1,77 @@ - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - 4.0.0 - core.packaging.module - pom - eXo Core Build module - - - core - module - - - - - org.exoplatform.coreexo= .core.component.database2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta03-SNAPSHOT= - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta03-SNAPSHO= T - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta03-SNAPSHOT - - = - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + 4.0.0 + core.packaging.module + pom + eXo Core Build module + + + core + module + + + + + org.exoplatform.coreexo= .core.component.database2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.document2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta03<= /dependency> + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta03 + + = + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = = \ No newline at end of file Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-13 14:01:16 UTC (rev 650) +++ core/trunk/pom.xml 2009-11-13 14:03:02 UTC (rev 651) @@ -1,396 +1,396 @@ - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - pom - - eXo Core - - - exo-core - 2.3 - = - 2.2.0-Beta03 - *Test* - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk - http://fisheye.jboss.org/browse/exo-jcr/core/trunk - - - - exo.core.component.security.core - exo.core.component.database - exo.core.component.document - exo.core.component.ldap - exo.core.component.organization.api - exo.core.component.organization.jdbc - exo.core.component.organization.ldap - exo.core.component.xml-processing - exo.core.component.script.groovy - exo.core.component.web.css - packaging/module - - - - - = - - org.exoplatform.core - exo.core.component.security.core - ${project.version} - - - - org.exoplatform.core - exo.core.component.database - ${project.version} - - - - org.exoplatform.core - exo.core.component.ldap - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.api - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.jdbc - ${project.version} - - = - - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} - - - - org.exoplatform.kernel - exo.kernel.container - ${org.exoplatform.kernel.version} - - - - org.exoplatform.kernel - exo.kernel.component.cache - ${org.exoplatform.kernel.version} - - - - javax.resource - connector-api - 1.5 - - - - hsqldb - hsqldb - 1.8.0.7 - - - - com.experlog - xapool - 1.5.0 - - - - c3p0 - c3p0 - 0.9.1.2 - - - - commons-dbcp - commons-dbcp - 1.2.2 - - - - org.hibernate - hibernate-core - 3.3.1.GA - - - - xdoclet - xdoclet-hibernate-module - 1.2.3 - - - - xdoclet - xdoclet - 1.2.3 - - - - xdoclet - xdoclet-xdoclet-module - 1.2 - - - - xdoclet - xjavadoc - 1.0.3 - - - - commons-collections - commons-collections - 3.1 - - - - pdfbox - pdfbox - 0.7.3 - compile - - - - com.lowagie - itext - 2.1.0 - compile - - - - org.htmlparser - htmlparser - 1.6 + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + pom + + eXo Core + + + exo-core + 2.3 + = + 2.2.0-Beta03 + *Test* + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.0-Beta03 + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.0-Beta03 + http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.0-Beta03<= /url> + + + + exo.core.component.security.core + exo.core.component.database + exo.core.component.document + exo.core.component.ldap + exo.core.component.organization.api + exo.core.component.organization.jdbc + exo.core.component.organization.ldap + exo.core.component.xml-processing + exo.core.component.script.groovy + exo.core.component.web.css + packaging/module + + + + + = + + org.exoplatform.core + exo.core.component.security.core + ${project.version} + + + + org.exoplatform.core + exo.core.component.database + ${project.version} + + + + org.exoplatform.core + exo.core.component.ldap + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.api + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.jdbc + ${project.version} + + = + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + + + + org.exoplatform.kernel + exo.kernel.container + ${org.exoplatform.kernel.version} + + + + org.exoplatform.kernel + exo.kernel.component.cache + ${org.exoplatform.kernel.version} + + + + javax.resource + connector-api + 1.5 + + + + hsqldb + hsqldb + 1.8.0.7 + + + + com.experlog + xapool + 1.5.0 + + + + c3p0 + c3p0 + 0.9.1.2 + + + + commons-dbcp + commons-dbcp + 1.2.2 + + + + org.hibernate + hibernate-core + 3.3.1.GA + + + + xdoclet + xdoclet-hibernate-module + 1.2.3 + + + + xdoclet + xdoclet + 1.2.3 + + + + xdoclet + xdoclet-xdoclet-module + 1.2 + + + + xdoclet + xjavadoc + 1.0.3 + + + + commons-collections + commons-collections + 3.1 + + + + pdfbox + pdfbox + 0.7.3 compile + + + + com.lowagie + itext + 2.1.0 + compile + + + + org.htmlparser + htmlparser + 1.6 + compile com.sun tools - - - - - org.apache.poi - poi - 3.0.2-FINAL - - - - org.apache.poi - poi-scratchpad - 3.0.2-FINAL - - - - com.novell.ldap - jldap - 4.3 - - - - javax.ejb - ejb - 2.1 - - - - xdoclet - xdoclet-hibernate-module - 1.2.3 - compile - - - - xdoclet - xdoclet - 1.2.3 - - - - xdoclet - xdoclet-xdoclet-module - 1.2 - - - - xdoclet - xjavadoc - 1.0.3 - - - - javax.resource - connector-api - 1.5 - - - - com.microsoft - sqljdbc - 1.1.1501 - - - - com.ibm.db2 - db2jcc - 9.1 - - - - com.ibm.db2 - db2jcc_license_cu - 9.1 - - - - oracle - ojdbc - 1.4 - - - - postgresql - postgresql - 8.3-603.jdbc3 - - - - mysql - mysql-connector-java - 5.0.8 - - - - org.codehaus.groovy - groovy-all - 1.6.5 - - - - org.w3c - sac - 1.3 - - - - batik - batik-util - 1.7 - - - - batik - batik-css - 1.7 - - - - jtidy - jtidy - 4aug2000r7-dev - - - - xml-resolver - xml-resolver - 1.1 - - - - commons-logging - commons-logging - 1.1 - - - - javassist - javassist - 3.4.GA - - = - - org.hibernate - hibernate-annotations - 3.4.0.GA - - - - - - - - junit - junit - test - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - always - - **/*$* - **/DBCreatorTest.java - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - - - - - - - + + + + + org.apache.poi + poi + 3.0.2-FINAL + + + + org.apache.poi + poi-scratchpad + 3.0.2-FINAL + + + + com.novell.ldap + jldap + 4.3 + + + + javax.ejb + ejb + 2.1 + + + + xdoclet + xdoclet-hibernate-module + 1.2.3 + compile + + + + xdoclet + xdoclet + 1.2.3 + + + + xdoclet + xdoclet-xdoclet-module + 1.2 + + + + xdoclet + xjavadoc + 1.0.3 + + + + javax.resource + connector-api + 1.5 + + + + com.microsoft + sqljdbc + 1.1.1501 + + + + com.ibm.db2 + db2jcc + 9.1 + + + + com.ibm.db2 + db2jcc_license_cu + 9.1 + + + + oracle + ojdbc + 1.4 + + + + postgresql + postgresql + 8.3-603.jdbc3 + + + + mysql + mysql-connector-java + 5.0.8 + + + + org.codehaus.groovy + groovy-all + 1.6.5 + + + + org.w3c + sac + 1.3 + + + + batik + batik-util + 1.7 + + + + batik + batik-css + 1.7 + + + + jtidy + jtidy + 4aug2000r7-dev + + + + xml-resolver + xml-resolver + 1.1 + + + + commons-logging + commons-logging + 1.1 + + + + javassist + javassist + 3.4.GA + + = + + org.hibernate + hibernate-annotations + 3.4.0.GA + + + + + + + + junit + junit + test + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + always + + **/*$* + **/DBCreatorTest.java + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + + + + + + + --===============5426927925171428019==-- From do-not-reply at jboss.org Fri Nov 13 09:03:51 2009 Content-Type: multipart/mixed; boundary="===============7590046282827002011==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r652 - core/tags. Date: Fri, 13 Nov 2009 09:03:50 -0500 Message-ID: <200911131403.nADE3oqS025804@svn01.web.mwc.hst.phx2.redhat.com> --===============7590046282827002011== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:03:50 -0500 (Fri, 13 Nov 2009) New Revision: 652 Added: core/tags/2.3.0-Beta03/ Log: [maven-scm] copy for tag 2.3.0-Beta03 Copied: core/tags/2.3.0-Beta03 (from rev 651, core/trunk) --===============7590046282827002011==-- From do-not-reply at jboss.org Fri Nov 13 09:04:54 2009 Content-Type: multipart/mixed; boundary="===============8784862272101841898==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r653 - in core/trunk: exo.core.component.database and 10 other directories. Date: Fri, 13 Nov 2009 09:04:54 -0500 Message-ID: <200911131404.nADE4s2l025952@svn01.web.mwc.hst.phx2.redhat.com> --===============8784862272101841898== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:04:54 -0500 (Fri, 13 Nov 2009) New Revision: 653 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2009-11-13 14:03:50 UTC = (rev 652) +++ core/trunk/exo.core.component.database/pom.xml 2009-11-13 14:04:54 UTC = (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.database Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2009-11-13 14:03:50 UTC = (rev 652) +++ core/trunk/exo.core.component.document/pom.xml 2009-11-13 14:04:54 UTC = (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.document Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-13 14:03:50 UTC (rev= 652) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-13 14:04:54 UTC (rev= 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.ldap Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-13 14:03= :50 UTC (rev 652) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-13 14:04= :54 UTC (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.organization.api Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-13 14:0= 3:50 UTC (rev 652) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-13 14:0= 4:54 UTC (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.organization.jdbc Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-13 14:0= 3:50 UTC (rev 652) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-13 14:0= 4:54 UTC (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.organization.ldap Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-13 14:03:50= UTC (rev 652) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-13 14:04:54= UTC (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.script.groovy Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-13 14:03:50= UTC (rev 652) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-13 14:04:54= UTC (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.security.core Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-13 14:03:50 UTC (= rev 652) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-13 14:04:54 UTC (= rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.web.css Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-13 14:03:5= 0 UTC (rev 652) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-13 14:04:5= 4 UTC (rev 653) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.xml-processing Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2009-11-13 14:03:50 UTC (rev 652) +++ core/trunk/packaging/module/pom.xml 2009-11-13 14:04:54 UTC (rev 653) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = 4.0.0 @@ -17,13 +17,13 @@ = - org.exoplatform.coreexo= .core.component.database2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.document2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta03<= /dependency> - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.database2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04-SNAPSHOT= + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04-SNAPSHO= T + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04-SNAPSHOT = Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-13 14:03:50 UTC (rev 652) +++ core/trunk/pom.xml 2009-11-13 14:04:54 UTC (rev 653) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.0-Beta03 - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.0-Beta03 - http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.0-Beta03<= /url> + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk + http://fisheye.jboss.org/browse/exo-jcr/core/trunk = --===============8784862272101841898==-- From do-not-reply at jboss.org Fri Nov 13 09:10:43 2009 Content-Type: multipart/mixed; boundary="===============3467227105303803223==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r654 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Fri, 13 Nov 2009 09:10:43 -0500 Message-ID: <200911131410.nADEAhE9027329@svn01.web.mwc.hst.phx2.redhat.com> --===============3467227105303803223== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 09:10:43 -0500 (Fri, 13 Nov 2009) New Revision: 654 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoaderTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:04:54= UTC (rev 653) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:10:43= UTC (rev 654) @@ -351,8 +351,8 @@ { NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(1)); = -// if (parentNodeData =3D=3D null) -// throw new JDBCCacheLoaderException("The parent node = with ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'."); + if (parentNodeData =3D=3D null) + throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'."); = if (parentNodeData !=3D null) { Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 14:0= 4:54 UTC (rev 653) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 14:1= 0:43 UTC (rev 654) @@ -638,6 +638,7 @@ // add child nodes [node1] = String nodeId =3D IdGenerator.generate(); addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId); + conn.commit(); = // tests it Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, baseNodeId, "[]node1:1")); @@ -758,5 +759,51 @@ // tests it = } + = + public void testExistNode() throws Exception + { = + // prepare + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + = + QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); + String baseNodeId =3D IdGenerator.generate(); + addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); + conn.commit(); + = + // tests it + String nodeId =3D IdGenerator.generate(); + = + assertFalse(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, = nodeId))); + assertFalse(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, = baseNodeId, "[]node1:1"))); + = + conn =3D persistentContainer.openConnection(); + = + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId); + conn.commit(); + = + assertTrue(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, n= odeId))); + assertTrue(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, b= aseNodeId, "[]node1:1"))); + } + = + public void testExistProperty() throws Exception + { + + // prepare + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + = + TransientPropertyData propData =3D + createProperty(Constants.ROOT_PATH, Constants.ROOT_UUID, Constant= s.JCR_DATA, "JCR DATA VALUE", + false); + = + // tests it + assertFalse(loader.exists(Fqn.fromElements(JBossCacheStorage.PROPS, = propData.getIdentifier()))); + = + // commit in DB + conn.add(propData); + conn.commit(); + = + assertTrue(loader.exists(Fqn.fromElements(JBossCacheStorage.PROPS, p= ropData.getIdentifier()))); + } + } --===============3467227105303803223==-- From do-not-reply at jboss.org Fri Nov 13 09:14:34 2009 Content-Type: multipart/mixed; boundary="===============8593013286251378348==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r655 - ws/trunk. Date: Fri, 13 Nov 2009 09:14:34 -0500 Message-ID: <200911131414.nADEEYhC027875@svn01.web.mwc.hst.phx2.redhat.com> --===============8593013286251378348== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:14:34 -0500 (Fri, 13 Nov 2009) New Revision: 655 Modified: ws/trunk/pom.xml Log: foundation parent, kernel and core version updated to latest tags Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-13 14:10:43 UTC (rev 654) +++ ws/trunk/pom.xml 2009-11-13 14:14:34 UTC (rev 655) @@ -25,7 +25,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.ws @@ -45,8 +45,8 @@ exo-ws 2.1 = - 2.2.0-Beta03-SNAPSHOT - 2.3.0-Beta03-SNAPSHOT + 2.2.0-Beta03 + 2.3.0-Beta03 = *Test* --===============8593013286251378348==-- From do-not-reply at jboss.org Fri Nov 13 09:16:48 2009 Content-Type: multipart/mixed; boundary="===============0521535578958319288==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r656 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Fri, 13 Nov 2009 09:16:48 -0500 Message-ID: <200911131416.nADEGmd3028514@svn01.web.mwc.hst.phx2.redhat.com> --===============0521535578958319288== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:16:48 -0500 (Fri, 13 Nov 2009) New Revision: 656 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.1.0-Beta03 Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-13 14:14:34 UTC (rev 655) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-13 14:16:48 UTC (rev 656) @@ -1,49 +1,49 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.commons - - eXo WS :: Commons Utils - - - - org.exoplatform.kernel - exo.kernel.component.common - - - com.sun.xml.stream - sjsxp - - - stax - stax-api - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.commons + + eXo WS :: Commons Utils + + + + org.exoplatform.kernel + exo.kernel.component.common + + + com.sun.xml.stream + sjsxp + + + stax + stax-api + + + Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-13 14:14:34 UTC (rev 65= 5) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-13 14:16:48 UTC (rev 65= 6) @@ -1,54 +1,54 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.frameworks.json - - eXo WS :: Framework :: JSON - eXo Java Bean to JSON Transformation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - - - - src/test/resources - - **/*.json - **/*.txt - - - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.frameworks.json + + eXo WS :: Framework :: JSON + eXo Java Bean to JSON Transformation + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + + + + src/test/resources + + **/*.json + **/*.txt + + + + + Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 14:14:34 UTC (rev= 655) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 14:16:48 UTC (rev= 656) @@ -1,45 +1,45 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.frameworks.servlet - - eXo WS :: Framework :: Servlet - - - - javax.servlet - servlet-api - - - org.exoplatform.kernel - exo.kernel.component.common - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.frameworks.servlet + + eXo WS :: Framework :: Servlet + + + + javax.servlet + servlet-api + + + org.exoplatform.kernel + exo.kernel.component.common + + + Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-13 14:14:34 UTC (rev 655) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-13 14:16:48 UTC (rev 656) @@ -1,151 +1,151 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.rest.core - - eXo WS :: REST :: Core - - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.exoplatform.core - exo.core.component.xml-processing - - - org.exoplatform.ws - exo.ws.frameworks.json - - - org.exoplatform.ws - exo.ws.testframework - test - - - javax.xml.bind - jaxb-api - - - com.sun.xml.bind - jaxb-impl - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - test - - - javax.ws.rs - jsr311-api - - - commons-fileupload - commons-fileupload - - - commons-io - commons-io - - - - - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - generate wadl classes - - generate - - generate-sources - - src/main/resources - src/main/resources/catalog.xml - target/generated-sources - org.exoplatform.services.rest.wadl.r= esearch - - -extension - - - wadl.xsd - - - - - generate classes for test - - generate - - generate-test-sources - - src/test/resources - src/main/resources/catalog.xml - target/generated-test-sources - org.exoplatform.services.rest.genera= ted - - -extension - - - book.xsd - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - 0 - - run - - generate-test-sources - - - copy files gnerated by JAXB to test source d= irectory - - - - - - - - - - - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.rest.core + + eXo WS :: REST :: Core + + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.exoplatform.core + exo.core.component.xml-processing + + + org.exoplatform.ws + exo.ws.frameworks.json + + + org.exoplatform.ws + exo.ws.testframework + test + + + javax.xml.bind + jaxb-api + + + com.sun.xml.bind + jaxb-impl + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + test + + + javax.ws.rs + jsr311-api + + + commons-fileupload + commons-fileupload + + + commons-io + commons-io + + + + + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + generate wadl classes + + generate + + generate-sources + + src/main/resources + src/main/resources/catalog.xml + target/generated-sources + org.exoplatform.services.rest.wadl.r= esearch + + -extension + + + wadl.xsd + + + + + generate classes for test + + generate + + generate-test-sources + + src/test/resources + src/main/resources/catalog.xml + target/generated-test-sources + org.exoplatform.services.rest.genera= ted + + -extension + + + book.xsd + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + 0 + + run + + generate-test-sources + + + copy files gnerated by JAXB to test source d= irectory + + + + + + + + + + + + + Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-13 14:14:34 UTC (rev 655) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-13 14:16:48 UTC (rev 656) @@ -1,49 +1,49 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.rest.ext - - eXo WS :: REST :: Extentions - - - - org.exoplatform.ws - exo.ws.commons - - - org.exoplatform.ws - exo.ws.rest.core - - - javax.annotation - jsr250-api - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.rest.ext + + eXo WS :: REST :: Extentions + + + + org.exoplatform.ws + exo.ws.commons + + + org.exoplatform.ws + exo.ws.rest.core + + + javax.annotation + jsr250-api + + + Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 14:14:34 UTC (rev 655) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 14:16:48 UTC (rev 656) @@ -1,41 +1,41 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.testframework - - eXo WS :: HTTP :: testframework - - - - javax.servlet - servlet-api - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.testframework + + eXo WS :: HTTP :: testframework + + + + javax.servlet + servlet-api + + \ No newline at end of file Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2009-11-13 14:14:34 UTC (rev 655) +++ ws/trunk/packaging/module/pom.xml 2009-11-13 14:16:48 UTC (rev 656) @@ -1,66 +1,66 @@ - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - 4.0.0 - ws.packaging.module - pom - eXo WS Build module - - - ws - module - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = - + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + 4.0.0 + ws.packaging.module + pom + eXo WS Build module + + + ws + module + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = + Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-13 14:14:34 UTC (rev 655) +++ ws/trunk/pom.xml 2009-11-13 14:16:48 UTC (rev 656) @@ -1,150 +1,150 @@ - - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - pom - - eXo WS - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk - http://fisheye.jboss.org/browse/exo-jcr/ws/trunk - - - - exo-ws - 2.1 - = - 2.2.0-Beta03 - 2.3.0-Beta03 - - *Test* - - - - exo.ws.commons - exo.ws.frameworks.json - exo.ws.frameworks.servlet - exo.ws.testframework - exo.ws.rest.core - exo.ws.rest.ext - packaging/module - - - - - - org.exoplatform.ws - exo.ws.frameworks.json - ${project.version} - - - org.exoplatform.ws - exo.ws.commons - ${project.version} - - - org.exoplatform.ws - exo.ws.rest.core - ${project.version} - - - org.exoplatform.ws - exo.ws.testframework - ${project.version} - - - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} - - - org.exoplatform.core - exo.core.component.xml-processing - ${org.exoplatform.core.version} - - - - com.sun.xml.stream - sjsxp - 1.0 - - - com.sun.xml.bind - jaxb-impl - 2.1.7 = - - - stax - stax-api - 1.0 - - - javax.xml.bind - jaxb-api - 2.1 - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - 0.4 - - - javax.ws.rs - jsr311-api - 1.0 - - - commons-fileupload - commons-fileupload - - 1.0 - - - commons-io - commons-io - 1.3.2 - - - javax.annotation - jsr250-api - 1.0 - - - javax.servlet - servlet-api - 2.4 - - - - + + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + pom + + eXo WS + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.0-Beta03 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.0-Beta03 + http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.0-Beta03 + + + + exo-ws + 2.1 + = + 2.2.0-Beta03 + 2.3.0-Beta03 + + *Test* + + + + exo.ws.commons + exo.ws.frameworks.json + exo.ws.frameworks.servlet + exo.ws.testframework + exo.ws.rest.core + exo.ws.rest.ext + packaging/module + + + + + + org.exoplatform.ws + exo.ws.frameworks.json + ${project.version} + + + org.exoplatform.ws + exo.ws.commons + ${project.version} + + + org.exoplatform.ws + exo.ws.rest.core + ${project.version} + + + org.exoplatform.ws + exo.ws.testframework + ${project.version} + + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + + + org.exoplatform.core + exo.core.component.xml-processing + ${org.exoplatform.core.version} + + + + com.sun.xml.stream + sjsxp + 1.0 + + + com.sun.xml.bind + jaxb-impl + 2.1.7 = + + + stax + stax-api + 1.0 + + + javax.xml.bind + jaxb-api + 2.1 + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + 0.4 + + + javax.ws.rs + jsr311-api + 1.0 + + + commons-fileupload + commons-fileupload + + 1.0 + + + commons-io + commons-io + 1.3.2 + + + javax.annotation + jsr250-api + 1.0 + + + javax.servlet + servlet-api + 2.4 + + + + --===============0521535578958319288==-- From do-not-reply at jboss.org Fri Nov 13 09:16:59 2009 Content-Type: multipart/mixed; boundary="===============3814393946260664571==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r657 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 09:16:59 -0500 Message-ID: <200911131416.nADEGxqY028548@svn01.web.mwc.hst.phx2.redhat.com> --===============3814393946260664571== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 09:16:59 -0500 (Fri, 13 Nov 2009) New Revision: 657 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:16:48= UTC (rev 656) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:16:59= UTC (rev 657) @@ -455,8 +455,7 @@ */ public Object put(Fqn name, Object key, Object value) throws Exception { - // TODO Auto-generated method stub - return null; + throw new JDBCCacheLoaderException("The method 'put(Fqn name, Object= key, Object value))' should not be called."); } = /** @@ -464,8 +463,7 @@ */ public void put(Fqn name, Map attributes) throws Except= ion { - // TODO Auto-generated method stub - + throw new JDBCCacheLoaderException("The method 'put(Fqn name, Map attributes)' should not be called."); } = /** @@ -473,8 +471,7 @@ */ public Object remove(Fqn fqn, Object key) throws Exception { - // TODO Auto-generated method stub - return null; + throw new JDBCCacheLoaderException("The method 'remove(Fqn fqn, Obje= ct key)' should not be called."); } = /** @@ -482,8 +479,7 @@ */ public void remove(Fqn fqn) throws Exception { - // TODO Auto-generated method stub - + throw new JDBCCacheLoaderException("The method 'remove(Fqn fqn)' sho= uld not be called."); } = /** @@ -491,8 +487,7 @@ */ public void removeData(Fqn fqn) throws Exception { - // TODO Auto-generated method stub - + throw new JDBCCacheLoaderException("The method 'removeData(Fqn fqn)'= should not be called."); } = /** --===============3814393946260664571==-- From do-not-reply at jboss.org Fri Nov 13 09:17:52 2009 Content-Type: multipart/mixed; boundary="===============8835341910108822981==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r658 - ws/tags. Date: Fri, 13 Nov 2009 09:17:52 -0500 Message-ID: <200911131417.nADEHq1Y028658@svn01.web.mwc.hst.phx2.redhat.com> --===============8835341910108822981== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:17:52 -0500 (Fri, 13 Nov 2009) New Revision: 658 Added: ws/tags/2.1.0-Beta03/ Log: [maven-scm] copy for tag 2.1.0-Beta03 Copied: ws/tags/2.1.0-Beta03 (from rev 656, ws/trunk) --===============8835341910108822981==-- From do-not-reply at jboss.org Fri Nov 13 09:18:37 2009 Content-Type: multipart/mixed; boundary="===============5469701644776316124==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r659 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Fri, 13 Nov 2009 09:18:36 -0500 Message-ID: <200911131418.nADEIaFs028790@svn01.web.mwc.hst.phx2.redhat.com> --===============5469701644776316124== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 09:18:36 -0500 (Fri, 13 Nov 2009) New Revision: 659 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-13 14:17:52 UTC (rev 658) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-13 14:18:36 UTC (rev 659) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.commons Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-13 14:17:52 UTC (rev 65= 8) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-13 14:18:36 UTC (rev 65= 9) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.frameworks.json Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 14:17:52 UTC (rev= 658) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-13 14:18:36 UTC (rev= 659) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-13 14:17:52 UTC (rev 658) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-13 14:18:36 UTC (rev 659) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.rest.core Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-13 14:17:52 UTC (rev 658) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-13 14:18:36 UTC (rev 659) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.rest.ext Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 14:17:52 UTC (rev 658) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-13 14:18:36 UTC (rev 659) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.testframework Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2009-11-13 14:17:52 UTC (rev 658) +++ ws/trunk/packaging/module/pom.xml 2009-11-13 14:18:36 UTC (rev 659) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = 4.0.0 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-13 14:17:52 UTC (rev 658) +++ ws/trunk/pom.xml 2009-11-13 14:18:36 UTC (rev 659) @@ -30,15 +30,15 @@ = org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT pom = eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.0-Beta03 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.0-Beta03 - http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.0-Beta03 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk + http://fisheye.jboss.org/browse/exo-jcr/ws/trunk = --===============5469701644776316124==-- From do-not-reply at jboss.org Fri Nov 13 09:53:41 2009 Content-Type: multipart/mixed; boundary="===============4628596835451166819==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r660 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Fri, 13 Nov 2009 09:53:41 -0500 Message-ID: <200911131453.nADErfdP002139@svn01.web.mwc.hst.phx2.redhat.com> --===============4628596835451166819== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 09:53:41 -0500 (Fri, 13 Nov 2009) New Revision: 660 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:18:36= UTC (rev 659) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:53:41= UTC (rev 660) @@ -118,6 +118,7 @@ case REMOVE_NODE: = doRemove(m, jdbcConnection); + = break; case MOVE: break; @@ -158,8 +159,8 @@ throws IllegalStateException, RepositoryException { = - if (modification.getFqn().get(0).equals(JBossCacheStorage.NODES) || - modification.getFqn().get(0).equals(JBossCacheStorage.PROPS)) + if ( modification.getFqn().size() =3D=3D 2 && (modification.getFqn()= .get(0).equals(JBossCacheStorage.NODES) || + modification.getFqn().get(0).equals(JBossCacheStorage.PROPS))) { = String identifier =3D (String) modification.getFqn().get(1); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 14:1= 8:36 UTC (rev 659) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-13 14:5= 3:41 UTC (rev 660) @@ -455,10 +455,13 @@ = // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - + QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); + String baseNodeId =3D IdGenerator.generate(); + addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); + = + // add child nodes [node1] = String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(Constants.ROOT_PATH, InternalQNa= me.parse("[]node")), nodeId, - Constants.NT_UNSTRUCTURED, Constants.ROOT_UUID); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId); conn.commit(); = List modifications =3D new ArrayList(); --===============4628596835451166819==-- From do-not-reply at jboss.org Fri Nov 13 10:01:15 2009 Content-Type: multipart/mixed; boundary="===============7373574976211876282==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r661 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 10:01:15 -0500 Message-ID: <200911131501.nADF1F2l003586@svn01.web.mwc.hst.phx2.redhat.com> --===============7373574976211876282== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 10:01:15 -0500 (Fri, 13 Nov 2009) New Revision: 661 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 14:53:41= UTC (rev 660) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 15:01:15= UTC (rev 661) @@ -163,9 +163,11 @@ modification.getFqn().get(0).equals(JBossCacheStorage.PROPS))) { = - String identifier =3D (String) modification.getFqn().get(1); - = - ItemData itemData =3D jdbcConnection.getItemData(identifier); +// String identifier =3D (String) modification.getFqn().get(1); +// ItemData itemData =3D jdbcConnection.getItemData(identifier); + = + // TODO the removed ItemData is setting in value in prepareModifi= cations(); + ItemData itemData =3D (ItemData) modification.getValue(); = if (itemData instanceof NodeData) jdbcConnection.delete((NodeData) itemData); @@ -271,8 +273,7 @@ modifications.get(i).setOldValue(itemData); } = } - //TODO for REMOVE is not need removed ItemData - /*else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) + else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) { if (m.getFqn().size() =3D=3D 2 && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) = @@ -285,7 +286,7 @@ if (removedItemData !=3D null) modifications.get(i).setValue(removedItemData); } - }*/ + } } } = --===============7373574976211876282==-- From do-not-reply at jboss.org Fri Nov 13 10:12:09 2009 Content-Type: multipart/mixed; boundary="===============6850191237016827157==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r662 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone. Date: Fri, 13 Nov 2009 10:12:09 -0500 Message-ID: <200911131512.nADFC956005528@svn01.web.mwc.hst.phx2.redhat.com> --===============6850191237016827157== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 10:12:09 -0500 (Fri, 13 Nov 2009) New Revision: 662 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config.xml Log: EXOJCR-201 : The test-jcr-config.xml was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jcr-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-13 15:01:15 UTC (rev 661) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-13 15:12:09 UTC (rev 662) @@ -32,7 +32,7 @@ - + --===============6850191237016827157==-- From do-not-reply at jboss.org Fri Nov 13 10:32:27 2009 Content-Type: multipart/mixed; boundary="===============7765230122995332604==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r663 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 10:32:27 -0500 Message-ID: <200911131532.nADFWRBj008106@svn01.web.mwc.hst.phx2.redhat.com> --===============7765230122995332604== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 10:32:27 -0500 (Fri, 13 Nov 2009) New Revision: 663 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java Log: EXOJCR-201 : The JBossCacheWorkspaceDataContainer.java was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-13 15:12:09 UTC (rev 662) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-13 15:32:27 UTC (rev 663) @@ -120,9 +120,11 @@ //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); = // prepare cache structures + cache.startBatch(); this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .NODES)); this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheSt= orage.PROPS)); this.session =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.SESSION)); + cache.endBatch(true); } = public void start() --===============7765230122995332604==-- From do-not-reply at jboss.org Fri Nov 13 10:45:48 2009 Content-Type: multipart/mixed; boundary="===============6774182149427648349==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r664 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directory. Date: Fri, 13 Nov 2009 10:45:47 -0500 Message-ID: <200911131545.nADFjlHi009868@svn01.web.mwc.hst.phx2.redhat.com> --===============6774182149427648349== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-13 10:45:47 -0500 (Fri, 13 Nov 2009) New Revision: 664 Removed: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/monitor/ Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/db/GenericConnectionFactory.java Log: EXOJCR-240 org.exoplatform.services.jcr.impl.storage.jdbc.monitor package r= emoved Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2009-11-13 15:32:27= UTC (rev 663) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2009-11-13 15:45:47= UTC (rev 664) @@ -18,7 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jdbc.db; = -import org.exoplatform.services.jcr.impl.storage.jdbc.monitor.ManagedConne= ction; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; @@ -43,7 +42,29 @@ */ public class GenericConnectionFactory implements WorkspaceStorageConnectio= nFactory { + = + public static final String JCR_JDBC_CONNECTION_MONITOR =3D "org.exoplat= form.jcr.monitor.jdbcMonitor"; = + public static final String PREPARE_INTREST_NAME =3D "PREPARE"; + + public static final String COMMIT_INTEREST_NAME =3D "COMMIT"; + + public static final String CLOSE_INTEREST_NAME =3D "CLOSE"; + + public static final String OPEN_INTEREST_NAME =3D "OPEN"; + + public static final String EXECUTE_INTEREST_NAME =3D "EXECUTE"; + + public static final int PREPARE_INTREST =3D 1; + + public static final int COMMIT_INTREST =3D 2; + + public static final int CLOSE_INTREST =3D 4; + + public static final int OPEN_INTREST =3D 8; + + public static final int EXECUTE_INTREST =3D 16; + protected final Log log =3D ExoLogger.getLogger("jcr.GenericConnectionF= actory"); = protected final DataSource dbDataSource; @@ -239,7 +260,7 @@ if (readOnly) // set this feature only if it asked conn.setReadOnly(readOnly); = - return monitorInterest =3D=3D 0 ? conn : new ManagedConnection(co= nn, monitorInterest); + return monitorInterest =3D=3D 0 ? conn : null; } catch (SQLException e) { @@ -264,7 +285,7 @@ */ private void initMonitor() { - String monitor =3D System.getProperty(ManagedConnection.JCR_JDBC_CON= NECTION_MONITOR); + String monitor =3D System.getProperty(JCR_JDBC_CONNECTION_MONITOR); if (monitor !=3D null) { // parse @@ -273,14 +294,14 @@ for (String s : ints) { s =3D s.trim(); - if (s.equalsIgnoreCase(ManagedConnection.EXECUTE_INTEREST_NAME= )) - interest |=3D ManagedConnection.EXECUTE_INTREST; - else if (s.equalsIgnoreCase(ManagedConnection.COMMIT_INTEREST_= NAME)) - interest |=3D ManagedConnection.COMMIT_INTREST; - else if (s.equalsIgnoreCase(ManagedConnection.CLOSE_INTEREST_N= AME)) - interest |=3D ManagedConnection.CLOSE_INTREST; - else if (s.equalsIgnoreCase(ManagedConnection.OPEN_INTEREST_NA= ME)) - interest |=3D ManagedConnection.OPEN_INTREST; + if (s.equalsIgnoreCase(EXECUTE_INTEREST_NAME)) + interest |=3D EXECUTE_INTREST; + else if (s.equalsIgnoreCase(COMMIT_INTEREST_NAME)) + interest |=3D COMMIT_INTREST; + else if (s.equalsIgnoreCase(CLOSE_INTEREST_NAME)) + interest |=3D CLOSE_INTREST; + else if (s.equalsIgnoreCase(OPEN_INTEREST_NAME)) + interest |=3D OPEN_INTREST; } = this.monitorInterest =3D interest; --===============6774182149427648349==-- From do-not-reply at jboss.org Fri Nov 13 11:54:23 2009 Content-Type: multipart/mixed; boundary="===============5330180950435231142==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r665 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory. Date: Fri, 13 Nov 2009 11:54:23 -0500 Message-ID: <200911131654.nADGsN3h021979@svn01.web.mwc.hst.phx2.redhat.com> --===============5330180950435231142== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 11:54:22 -0500 (Fri, 13 Nov 2009) New Revision: 665 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JBossCacheWorkspaceDataManager.java was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-13 15:45:47 UTC (rev 664) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-13 16:54:22 UTC (rev 665) @@ -187,10 +187,11 @@ LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) + "ms, " + data.getQPath().getAsString()); } - if (thisConnection !=3D null) + //TODO rainf0x + /*if (thisConnection !=3D null) thisConnection.removeSessionInfo(); if (systemConnection !=3D null && !systemConnection.equals(thi= sConnection)) - systemConnection.removeSessionInfo(); + systemConnection.removeSessionInfo();*/ } if (thisConnection !=3D null) thisConnection.commit(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 15:45:47= UTC (rev 664) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 16:54:22= UTC (rev 665) @@ -97,6 +97,7 @@ { for (Modification m : modifications) { + LOG.info(m); switch (m.getType()) { case PUT_DATA: @@ -353,8 +354,9 @@ { NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(1)); = - if (parentNodeData =3D=3D null) - throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'."); + //TODO rainf0x + /*if (parentNodeData =3D=3D null) + throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'.");*/ = if (parentNodeData !=3D null) { --===============5330180950435231142==-- From do-not-reply at jboss.org Fri Nov 13 12:17:56 2009 Content-Type: multipart/mixed; boundary="===============3073149397976762994==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r666 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 12:17:56 -0500 Message-ID: <200911131717.nADHHuRp025773@svn01.web.mwc.hst.phx2.redhat.com> --===============3073149397976762994== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 12:17:55 -0500 (Fri, 13 Nov 2009) New Revision: 666 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 16:54:22= UTC (rev 665) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 17:17:55= UTC (rev 666) @@ -18,14 +18,20 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.storage.jbosscache.ModificationEx= .JCROperaionType; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; @@ -39,14 +45,6 @@ import org.jboss.cache.factories.annotations.Inject; import org.jboss.cache.loader.AbstractCacheLoader; = -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. * = @@ -244,51 +242,56 @@ */ private void prepareModifications(List modifications) thr= ows RepositoryException { - JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection) dat= aContainer.openConnection(); = - for (int i =3D 0; i < modifications.size(); i++) - { - Modification m =3D modifications.get(i); - if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) + try { + for (int i =3D 0; i < modifications.size(); i++) { - ItemData itemData =3D null; - - //Check add or update node data. - if (m.getValue() instanceof NodeData) + Modification m =3D modifications.get(i); + if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) { - NodeData nodeData =3D (NodeData) m.getValue(); - itemData =3D jdbcConnection.getItemData(nodeData.getIdentif= ier()); - = - // Set oldValueData for update node. - if (itemData !=3D null) = - modifications.get(i).setOldValue(itemData); + ItemData itemData =3D null; + = + //Check add or update node data. + if (m.getValue() instanceof NodeData) + { + NodeData nodeData =3D (NodeData) m.getValue(); + itemData =3D jdbcConnection.getItemData(nodeData.getIden= tifier()); + = + // Set oldValueData for update node. + if (itemData !=3D null) = + modifications.get(i).setOldValue(itemData); + } + else if (m.getValue() instanceof PropertyData) + { + PropertyData propertyData =3D (PropertyData) m.getValue(= ); + itemData =3D jdbcConnection.getItemData(propertyData.get= Identifier()); + = + // Set oldValueData for update property. + if (itemData !=3D null) = + modifications.get(i).setOldValue(itemData); + } = } - else if (m.getValue() instanceof PropertyData) + else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) { - PropertyData propertyData =3D (PropertyData) m.getValue(); - itemData =3D jdbcConnection.getItemData(propertyData.getIde= ntifier()); - = - // Set oldValueData for update property. - if (itemData !=3D null) = - modifications.get(i).setOldValue(itemData); - } = - } - else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) - { - if (m.getFqn().size() =3D=3D 2 - && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) = - || m.getFqn().get(0).equals(JBossCacheStorage.PROPS))) - { - String id =3D (String) m.getFqn().get(1); - ItemData removedItemData =3D jdbcConnection.getItemData(id); - - // Set valueData for update property or node. - if (removedItemData !=3D null) - modifications.get(i).setValue(removedItemData); + if (m.getFqn().size() =3D=3D 2 + && (m.getFqn().get(0).equals(JBossCacheStorage.NOD= ES) = + || m.getFqn().get(0).equals(JBossCacheStorage.PROP= S))) + { + String id =3D (String) m.getFqn().get(1); + ItemData removedItemData =3D jdbcConnection.getItemData(= id); + = + // Set valueData for update property or node. + if (removedItemData !=3D null) + modifications.get(i).setValue(removedItemData); + } } } } + finally + { + jdbcConnection.close(); + } } = protected QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberF= ormatException, IllegalNameException @@ -339,7 +342,7 @@ } finally { - conn.close(); + conn.close(); } } // /$NODES// --===============3073149397976762994==-- From do-not-reply at jboss.org Fri Nov 13 12:31:01 2009 Content-Type: multipart/mixed; boundary="===============1795651524412907646==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r667 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 13 Nov 2009 12:31:01 -0500 Message-ID: <200911131731.nADHV13I027607@svn01.web.mwc.hst.phx2.redhat.com> --===============1795651524412907646== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-13 12:31:00 -0500 (Fri, 13 Nov 2009) New Revision: 667 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 17:17:55= UTC (rev 666) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-13 17:31:00= UTC (rev 667) @@ -85,6 +85,7 @@ */ public void put(List modifications) throws Exception { + LOG.info("Modifications list size =3D " + modifications.size()); // Prepare modifications list. // Will be added oldValueData to modification for UPDATE. = prepareModifications(modifications); @@ -95,7 +96,6 @@ { for (Modification m : modifications) { - LOG.info(m); switch (m.getType()) { case PUT_DATA: --===============1795651524412907646==-- From do-not-reply at jboss.org Sun Nov 15 09:29:47 2009 Content-Type: multipart/mixed; boundary="===============5833627157920076740==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r668 - in jcr/branches/1.12.0-JBC/component/core/src/test: resources/conf/standalone and 1 other directory. Date: Sun, 15 Nov 2009 09:29:47 -0500 Message-ID: <200911151429.nAFETls5026324@svn01.web.mwc.hst.phx2.redhat.com> --===============5833627157920076740== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-15 09:29:46 -0500 (Sun, 15 Nov 2009) New Revision: 668 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/CacheLoaderParameter.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/DummyCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/DummyInterceptor.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/InjectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/InterceptorParameter.java jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-custom-interceptor.xml Log: EXOJCR-199 : injection test Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/CacheLoaderParameter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/CacheLoaderParameter.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/CacheLoaderParameter.java 2009-11-15 14:= 29:46 UTC (rev 668) @@ -0,0 +1,31 @@ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.jboss.cache.factories.annotations.NonVolatile; + +(a)NonVolatile +public class CacheLoaderParameter +{ + private boolean injected =3D false; + + public CacheLoaderParameter() + { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @return the injected + */ + public boolean isInjected() + { + return injected; + } + + /** + * @param injected the injected to set + */ + public void setInjected(boolean injected) + { + this.injected =3D injected; + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/CacheLoaderParameter.ja= va ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/DummyCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/DummyCacheLoader.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/DummyCacheLoader.java 2009-11-15 14:29:4= 6 UTC (rev 668) @@ -0,0 +1,86 @@ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.jboss.cache.Fqn; +import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi= g; +import org.jboss.cache.factories.annotations.Inject; +import org.jboss.cache.loader.AbstractCacheLoader; + +import java.util.Map; +import java.util.Set; + +public class DummyCacheLoader extends AbstractCacheLoader +{ + private IndividualCacheLoaderConfig config; + + private CacheLoaderParameter dummyParameter; + + public boolean exists(Fqn name) throws Exception + { + // TODO Auto-generated method stub + return false; + } + = + public Map get(Fqn name) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + public Set getChildrenNames(Fqn fqn) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + public IndividualCacheLoaderConfig getConfig() + { + return config; + } + + @Inject + public void inject(CacheLoaderParameter dummyParameter) throws Reposito= ryConfigurationException + { + this.dummyParameter =3D dummyParameter; + //set injected flag + dummyParameter.setInjected(true); + } + + public void put(Fqn name, Map attributes) throws Except= ion + { + // TODO Auto-generated method stub + = + } + + public Object put(Fqn name, Object key, Object value) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + public void remove(Fqn fqn) throws Exception + { + // TODO Auto-generated method stub + = + } + + public Object remove(Fqn fqn, Object key) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + public void removeData(Fqn fqn) throws Exception + { + // TODO Auto-generated method stub + = + } + + public void setConfig(IndividualCacheLoaderConfig config) + { + this.config =3D config; + = + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/DummyCacheLoader.java ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/DummyInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/DummyInterceptor.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/DummyInterceptor.java 2009-11-15 14:29:4= 6 UTC (rev 668) @@ -0,0 +1,34 @@ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; +import org.jboss.cache.factories.annotations.Inject; +import org.jboss.cache.interceptors.base.CommandInterceptor; + +public class DummyInterceptor extends CommandInterceptor +{ + = + private InterceptorParameter dummyParameter; + + public DummyInterceptor() + { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @return the dummyParameter + */ + public InterceptorParameter getDummyParameter() + { + return dummyParameter; + } + + @Inject + public void inject(InterceptorParameter dummyParameter) throws Reposito= ryConfigurationException + { + this.dummyParameter =3D dummyParameter; + //set injected flag + dummyParameter.setInjected(true); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/DummyInterceptor.java ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/InjectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/InjectionTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/InjectionTest.java 2009-11-15 14:29:46 U= TC (rev 668) @@ -0,0 +1,47 @@ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.jboss.cache.Cache; +import org.jboss.cache.CacheFactory; +import org.jboss.cache.CacheSPI; +import org.jboss.cache.DefaultCacheFactory; + +import java.io.Serializable; + +public class InjectionTest extends TestCase +{ + /** + * Test injection of run time objects + * @throws Exception + */ + public void testCustomInterceptorInjection() throws Exception + { + CacheFactory factory =3D new DefaultCacheFacto= ry(); + = + // create cache + Cache cache =3D + factory.createCache(InjectionTest.class.getResourceAsStream("/con= f/standalone/test-custom-interceptor.xml"), false); + //create interceptor parameter + InterceptorParameter interceptorParameter =3D new InterceptorParamet= er(); + assertFalse(interceptorParameter.isInjected()); + //create cache loader parameter + CacheLoaderParameter cacheLoaderParameter =3D new CacheLoaderParamet= er(); + assertFalse(cacheLoaderParameter.isInjected()); + = + = + //register in component registry + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(interceptorParameter, + InterceptorParameter.class); + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(cacheLoaderParameter, + CacheLoaderParameter.class); + = + cache.create(); + cache.start(); + = + //expect what all parameter woud be injected + assertTrue(cacheLoaderParameter.isInjected()); + assertTrue(interceptorParameter.isInjected()); + = + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/InjectionTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/InterceptorParameter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/InterceptorParameter.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/InterceptorParameter.java 2009-11-15 14:= 29:46 UTC (rev 668) @@ -0,0 +1,31 @@ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.jboss.cache.factories.annotations.NonVolatile; + +(a)NonVolatile +public class InterceptorParameter +{ + private boolean injected =3D false; + + public InterceptorParameter() + { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @return the injected + */ + public boolean isInjected() + { + return injected; + } + + /** + * @param injected the injected to set + */ + public void setInjected(boolean injected) + { + this.injected =3D injected; + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/InterceptorParameter.ja= va ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-custom-interceptor.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-custom-interceptor.xml (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-custom-interceptor.xml 2009-11-15 14:29:46 UTC (rev 668) @@ -0,0 +1,41 @@ + + + + + + + = + + + cache.jdbc.table.name=3Djdbcjcr + cache.jdbc.table.create=3Dtrue + cache.jdbc.table.drop=3Dtrue + cache.jdbc.table.primarykey=3Dexojcr_pk + cache.jdbc.fqn.column=3Dfqn + cache.jdbc.fqn.type=3DVARCHAR(512) + cache.jdbc.node.column=3Dnode + cache.jdbc.node.type=3DVARBINARY(65535) + cache.jdbc.parent.column=3Dparent + cache.jdbc.driver=3Dorg.hsqldb.jdbcDriver + cache.jdbc.url=3Djdbc:hsqldb:file:target/temp/data/exojcr + cache.jdbc.user=3Dsa + cache.jdbc.password=3D + + = + + + + = + + + + + + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-custom-interceptor.xml ___________________________________________________________________ Name: svn:mime-type + text/plain --===============5833627157920076740==-- From do-not-reply at jboss.org Mon Nov 16 03:31:56 2009 Content-Type: multipart/mixed; boundary="===============1001781625474921221==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r669 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 16 Nov 2009 03:31:56 -0500 Message-ID: <200911160831.nAG8Vufe008574@svn01.web.mwc.hst.phx2.redhat.com> --===============1001781625474921221== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-16 03:31:56 -0500 (Mon, 16 Nov 2009) New Revision: 669 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/DummyInterceptor.java Log: EXOJCR-199: imports fixed Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/DummyInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/DummyInterceptor.java 2009-11-15 14:29:4= 6 UTC (rev 668) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/DummyInterceptor.java 2009-11-16 08:31:5= 6 UTC (rev 669) @@ -1,7 +1,6 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.jboss.cache.factories.annotations.Inject; import org.jboss.cache.interceptors.base.CommandInterceptor; = --===============1001781625474921221==-- From do-not-reply at jboss.org Mon Nov 16 04:47:33 2009 Content-Type: multipart/mixed; boundary="===============5417604508084635798==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r670 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/session and 1 other directories. Date: Mon, 16 Nov 2009 04:47:33 -0500 Message-ID: <200911160947.nAG9lXR2023137@svn01.web.mwc.hst.phx2.redhat.com> --===============5417604508084635798== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-16 04:47:33 -0500 (Mon, 16 Nov 2009) New Revision: 670 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/SessionDataManager.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/session/SessionChangesLog.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/load/perf/TestBulkItemsAdd.java Log: EXOJCR-221: SessionChangesLog improvement Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-16 08:31:56 UT= C (rev 669) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-16 09:47:33 UT= C (rev 670) @@ -676,23 +676,29 @@ */ public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on { - int childsCount =3D 0; + int childsCount =3D changesLog.getChildNodesCount(parent.getIdentifi= er()); = - for (ItemState change : changesLog.getAllStates()) - { - if (change.isNode() && change.isPersisted() - && change.getData().getParentIdentifier().equals(parent.getIde= ntifier())) - { - if (change.isDeleted()) - { - childsCount--; - } - else if (change.isAdded()) - { - childsCount++; - } - } - } + // for (ItemState change : changesLog.getAllStates()) + // { + // if (change.isNode() && change.isPersisted() + // && parent.getIdentifier().equals(change.getData().getP= arentIdentifier())) + // { + // if (change.isDeleted()) + // { + // childsCount--; + // } + // else if (change.isAdded()) + // { + // childsCount++; + // } + // } + // } + // + // if (childsCount !=3D changesLog.getChildNodesCount(parent.ge= tIdentifier())) + // { + // System.out.println(""); + // changesLog.getChildNodesCount(parent.getIdentifier()); + // } = childsCount =3D transactionableManager.getChildNodesCount(parent) + = childsCount; if (childsCount < 0) Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-16 = 08:31:56 UTC (rev 669) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-16 = 09:47:33 UTC (rev 670) @@ -61,6 +61,8 @@ protected Map> lastChildPropertyStates = =3D new HashMap>(); = + protected Map childNodesCount =3D new HashMap(); + /** * Create empty ChangesLog. * = @@ -120,6 +122,7 @@ index.clear(); lastChildNodeStates.clear(); lastChildPropertyStates.clear(); + childNodesCount.clear(); } = /** @@ -144,17 +147,44 @@ index.remove(new ParentIDQPathBasedKey(item)); index.remove(new IDStateBasedKey(item.getData().getIdentifier(= ), item.getState())); = + if (item.isNode() && item.isPersisted()) + { + int childCount[] =3D childNodesCount.get(item.getData().get= ParentIdentifier()); + if (childCount !=3D null) + { + childNodesCount.remove(item.getData().getIdentifier()); + + if (item.isDeleted()) + childCount[0]++; + else if (item.isAdded()) + childCount[0]--; + + if (childCount[0] =3D=3D 0) + childNodesCount.remove(item.getData().getParentIdenti= fier()); + else + childNodesCount.put(item.getData().getParentIdentifie= r(), childCount); + } + } + if (item.getData().isNode()) { Map children =3D lastChildNodeStates.get= (item.getData().getParentIdentifier()); if (children !=3D null) + { children.remove(item.getData().getIdentifier()); + if (children.size() =3D=3D 0) + lastChildNodeStates.remove(item.getData().getParentId= entifier()); + } } else { Map children =3D lastChildPropertyStates= .get(item.getData().getParentIdentifier()); if (children !=3D null) + { children.remove(item.getData().getIdentifier()); + if (children.size() =3D=3D 0) + lastChildNodeStates.remove(item.getData().getParentId= entifier()); + } } } } @@ -344,6 +374,12 @@ return list; } = + public int getChildNodesCount(String rootIdentifier) + { + int[] childCount =3D childNodesCount.get(rootIdentifier); + return childCount =3D=3D null ? 0 : childCount[0]; + } + /** * Collect last in ChangesLog order item child changes. * = @@ -588,6 +624,20 @@ } children.put(item.getData().getIdentifier(), item); } + + if (item.isNode() && item.isPersisted()) + { + int[] childCount =3D childNodesCount.get(item.getData().getParent= Identifier()); + if (childCount =3D=3D null) + childCount =3D new int[1]; + + if (item.isDeleted()) + childCount[0] -=3D 1; + else if (item.isAdded()) + childCount[0] +=3D 1; + + childNodesCount.put(item.getData().getParentIdentifier(), childCo= unt); + } } = /** Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/load/perf/TestBulkItemsAdd.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestBulkItemsAdd.java 2009-11-16 08:31:56 UTC = (rev 669) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestBulkItemsAdd.java 2009-11-16 09:47:33 UTC = (rev 670) @@ -39,7 +39,7 @@ public void testNodeAdd() throws Exception { StringBuilder stats =3D new StringBuilder(); - = + Node testRoot =3D session.getRootNode().addNode("testRoot"); session.save(); long startTime =3D System.currentTimeMillis(); @@ -49,28 +49,35 @@ long addTime =3D System.currentTimeMillis(); String nodeName =3D "_" + i + "_node"; Node n =3D testRoot.addNode(nodeName); - long finishTime =3D System.currentTimeMillis(); //log.info("add node " + nodeName + ", " + (System.currentTimeMil= lis() - addTime) + "ms, " // + (finishTime - startTime) + "ms"); //String stat =3D (System.currentTimeMillis() - addTime) + ";" + = (finishTime - startTime); - stats.append(i); - stats.append(";"); - stats.append((System.currentTimeMillis() - addTime)); - stats.append(";"); - stats.append((finishTime - startTime)); - stats.append("\r\n"); + if ((i % 100) =3D=3D 0) + { + stats.append(i); + stats.append(";"); + stats.append((System.currentTimeMillis() - addTime)); + // stats.append(";"); + // stats.append((System.currentTimeMillis() - start= Time)); + stats.append("\r\n"); + } } + // stats.append(nodesCount); + // stats.append(";"); + // stats.append((System.currentTimeMillis() - startTime)); + // stats.append("\r\n"); + log.info("Nodes added " + nodesCount + ", " + (System.currentTimeMil= lis() - startTime) + "ms"); startTime =3D System.currentTimeMillis(); log.info("Nodes will be saved, wait few minutes..."); testRoot.save(); log.info("Nodes saved " + nodesCount + ", " + (System.currentTimeMil= lis() - startTime) + "ms"); - = + // save stats PrintWriter statFile =3D new PrintWriter(new File("stats.txt")); statFile.write(stats.toString()); statFile.close(); - = + log.info("Test done"); } = --===============5417604508084635798==-- From do-not-reply at jboss.org Mon Nov 16 04:51:32 2009 Content-Type: multipart/mixed; boundary="===============7164968393542528416==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r671 - parent/tags. Date: Mon, 16 Nov 2009 04:51:32 -0500 Message-ID: <200911160951.nAG9pWTv023919@svn01.web.mwc.hst.phx2.redhat.com> --===============7164968393542528416== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 04:51:32 -0500 (Mon, 16 Nov 2009) New Revision: 671 Removed: parent/tags/3/ Log: Tag #3 removed --===============7164968393542528416==-- From do-not-reply at jboss.org Mon Nov 16 05:07:28 2009 Content-Type: multipart/mixed; boundary="===============8863798254065459449==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r672 - parent/trunk. Date: Mon, 16 Nov 2009 05:07:28 -0500 Message-ID: <200911161007.nAGA7SGQ027611@svn01.web.mwc.hst.phx2.redhat.com> --===============8863798254065459449== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 05:07:27 -0500 (Mon, 16 Nov 2009) New Revision: 672 Modified: parent/trunk/pom.xml Log: EXOJCR-234 - version reverted to 3-SNAPSHOT Modified: parent/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- parent/trunk/pom.xml 2009-11-16 09:51:32 UTC (rev 671) +++ parent/trunk/pom.xml 2009-11-16 10:07:27 UTC (rev 672) @@ -27,7 +27,7 @@ org.exoplatform foundation-parent - 4-SNAPSHOT + 3-SNAPSHOT pom = eXo JBoss Parent --===============8863798254065459449==-- From do-not-reply at jboss.org Mon Nov 16 05:13:44 2009 Content-Type: multipart/mixed; boundary="===============0678788222926831949==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r673 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query and 2 other directories. Date: Mon, 16 Nov 2009 05:13:43 -0500 Message-ID: <200911161013.nAGADhb9028611@svn01.web.mwc.hst.phx2.redhat.com> --===============0678788222926831949== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-16 05:13:42 -0500 (Mon, 16 Nov 2009) New Revision: 673 Removed: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManagerImpl.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/RepositoryContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SystemSearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202: SearchManager interface removed Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/RepositoryContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-16 10:07:27 UTC (rev 672) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-16 10:13:42 UTC (rev 673) @@ -48,6 +48,7 @@ import org.exoplatform.services.jcr.impl.core.query.QueryManagerFactory; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.JBossCacheWor= kspaceDataManager; import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; @@ -209,6 +210,16 @@ = workspaceContainer.registerComponentImplementation(StandaloneStor= agePluginProvider.class); = + //TODO remove it + if (wsConfig.getQueryHandler() !=3D null) + { + workspaceContainer.registerComponentImplementation(SearchManag= er.class); + + workspaceContainer.registerComponentImplementation(QueryManage= r.class); + workspaceContainer.registerComponentImplementation(QueryManage= rFactory.class); + workspaceContainer.registerComponentInstance(wsConfig.getQuery= Handler()); + } + try { Class containerType =3D Class.forName(wsConfig.getContainer= ().getType()); @@ -227,22 +238,22 @@ = // cache type // TODO remove cache -// try -// { -// String className =3D wsConfig.getCache().getType(); -// if (className !=3D null && className.length() > 0) -// { -// workspaceContainer.registerComponentImplementation(Class.= forName(className)); -// } -// else -// workspaceContainer.registerComponentImplementation(Linked= WorkspaceStorageCacheImpl.class); -// } -// catch (ClassNotFoundException e) -// { -// log.warn("Workspace cache class not found " + wsConfig.getCa= che().getType() -// + ", will use default. Error : " + e); -// workspaceContainer.registerComponentImplementation(LinkedWor= kspaceStorageCacheImpl.class); -// } + // try + // { + // String className =3D wsConfig.getCache().getType(); + // if (className !=3D null && className.length() > 0) + // { + // workspaceContainer.registerComponentImplementati= on(Class.forName(className)); + // } + // else + // workspaceContainer.registerComponentImplementati= on(LinkedWorkspaceStorageCacheImpl.class); + // } + // catch (ClassNotFoundException e) + // { + // log.warn("Workspace cache class not found " + wsCon= fig.getCache().getType() + // + ", will use default. Error : " + e); + // workspaceContainer.registerComponentImplementation(= LinkedWorkspaceStorageCacheImpl.class); + // } = workspaceContainer.registerComponentImplementation(JBossCacheWork= spaceDataManager.class); workspaceContainer.registerComponentImplementation(LocalWorkspace= DataManagerStub.class); @@ -268,14 +279,14 @@ // Query handler if (wsConfig.getQueryHandler() !=3D null) { -// workspaceContainer.registerComponentImplementation(SearchMan= ager.class); -// workspaceContainer.registerComponentImplementation(QueryMana= ger.class); -// workspaceContainer.registerComponentImplementation(QueryMana= gerFactory.class); -// workspaceContainer.registerComponentInstance(wsConfig.getQue= ryHandler()); -// TODO if (isSystem) -// { -// workspaceContainer.registerComponentImplementation(System= SearchManager.class); -// } + workspaceContainer.registerComponentImplementation(SearchManag= er.class); + workspaceContainer.registerComponentImplementation(QueryManage= r.class); + workspaceContainer.registerComponentImplementation(QueryManage= rFactory.class); + workspaceContainer.registerComponentInstance(wsConfig.getQuery= Handler()); + // TODO if (isSystem) + // { + // workspaceContainer.registerComponentImplement= ation(SystemSearchManager.class); + // } } = // access manager @@ -437,9 +448,9 @@ // } } = -// TODO SystemSearchManagerHolder searchManager =3D -// (SystemSearchManagerHolder)this.getComponentInstanceOfType(Syst= emSearchManagerHolder.class); - = + // TODO SystemSearchManagerHolder searchManager =3D + // (SystemSearchManagerHolder)this.getComponentInstanceOfTyp= e(SystemSearchManagerHolder.class); + // if (searchManager !=3D null) // { // typeManager.addQueryHandler(searchManager.get().getHandle= r()); @@ -508,13 +519,13 @@ String systemWsname =3D config.getSystemWorkspaceName(); WorkspaceEntry systemWsEntry =3D getWorkspaceEntry(systemWsname); = -// TODO if (systemWsEntry !=3D null && systemWsEntry.getQueryHandler()= !=3D null) -// { -// SystemSearchManager systemSearchManager =3D -// (SystemSearchManager)getWorkspaceContainer(systemWsname).get= ComponentInstanceOfType( -// SystemSearchManager.class); -// registerComponentInstance(new SystemSearchManagerHolder(systemS= earchManager)); -// } + // TODO if (systemWsEntry !=3D null && systemWsEntry.getQueryHan= dler() !=3D null) + // { + // SystemSearchManager systemSearchManager =3D + // (SystemSearchManager)getWorkspaceContainer(systemWsnam= e).getComponentInstanceOfType( + // SystemSearchManager.class); + // registerComponentInstance(new SystemSearchManagerHolder(s= ystemSearchManager)); + // } = try { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-16 10:07:27 UTC (rev = 672) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-16 10:13:42 UTC (rev = 673) @@ -1,104 +1,883 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.exoplatform.services.jcr.impl.core.query; - -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.impl.core.SessionDataManager; -import org.exoplatform.services.jcr.impl.core.SessionImpl; - -import java.io.IOException; -import java.util.Set; - -import javax.jcr.Node; -import javax.jcr.RepositoryException; -import javax.jcr.query.InvalidQueryException; -import javax.jcr.query.Query; - -/** - * Acts as a global entry point to execute queries and index nodes. - */ -public interface SearchManager -{ - /** - * Creates a query object from a node that can be executed on the works= pace. - * = - * @param session - * the session of the user executing the query. - * @param itemMgr - * the item manager of the user executing the query. Needed = to - * return Node instances in the result set. - * @param node - * a node of type nt:query. - * @return a Query instance to execute. - * @throws InvalidQueryException - * if absPath is not a valid persisted query (= that - * is, a node of type nt:query) - * @throws RepositoryException - * if any other error occurs. - */ - Query createQuery(SessionImpl session, SessionDataManager sessionDataMa= nager, Node node) - throws InvalidQueryException, RepositoryException; - - /** - * Creates a query object that can be executed on the workspace. - * = - * @param session - * the session of the user executing the query. - * @param itemMgr - * the item manager of the user executing the query. Needed = to - * return Node instances in the result set. - * @param statement - * the actual query statement. - * @param language - * the syntax of the query statement. - * @return a Query instance to execute. - * @throws InvalidQueryException - * if the query is malformed or the language is - * unknown. - * @throws RepositoryException - * if any other error occurs. - */ - Query createQuery(SessionImpl session, SessionDataManager sessionDataMa= nager, String statement, String language) - throws InvalidQueryException, RepositoryException; - - Set getFieldNames() throws IndexException; - - QueryHandler getHandler(); - - Set getNodesByNodeType(final InternalQName nodeType) throws Rep= ositoryException; - - /** - * Return set of uuid of nodes. Contains in names prefixes mapped to the - * given uri - * = - * @param prefix - * @return - * @throws RepositoryException - */ - Set getNodesByUri(final String uri) throws RepositoryException; - - /** - * Update Index storege for next uuid lists. - * = - * @param removedNodes - removed nodes uuid set - * @param addedNodes - added nodes uuid set - * @throws RepositoryException - * @throws IOException - */ - public void updateIndex(Set removedNodes, Set addedNode= s) throws RepositoryException, IOException; - -} +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.core.query; + +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.Term; +import org.apache.lucene.search.BooleanQuery; +import org.apache.lucene.search.WildcardQuery; +import org.apache.lucene.search.BooleanClause.Occur; +import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.services.document.DocumentReaderService; +import org.exoplatform.services.jcr.config.QueryHandlerEntry; +import org.exoplatform.services.jcr.config.QueryHandlerParams; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPers= istenceListener; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.ValueData; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; +import org.exoplatform.services.jcr.impl.core.SessionDataManager; +import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; +import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; +import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; +import org.exoplatform.services.jcr.impl.core.query.lucene.ScoreNode; +import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; +import org.exoplatform.services.jcr.impl.core.value.NameValue; +import org.exoplatform.services.jcr.impl.core.value.PathValue; +import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; +import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.cache.factories.annotations.NonVolatile; +import org.picocontainer.Startable; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; +import java.util.StringTokenizer; + +import javax.jcr.Node; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.jcr.Value; +import javax.jcr.query.InvalidQueryException; +import javax.jcr.query.Query; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author Karpenko Sergiy = + * @version $Id$ + */ +(a)NonVolatile +public class SearchManager implements Startable, MandatoryItemsPersistence= Listener +{ + + /** + * Logger instance for this class + */ + private static final Log log =3D ExoLogger.getLogger(SearchManager.clas= s); + + protected final QueryHandlerEntry config; + + /** + * Text extractor for extracting text content of binary properties. + */ + protected final DocumentReaderService extractor; + + /** + * QueryHandler where query execution is delegated to + */ + protected QueryHandler handler; + + /** + * The shared item state manager instance for the workspace. + */ + protected final ItemDataConsumer itemMgr; + + /** + * The namespace registry of the repository. + */ + protected final NamespaceRegistryImpl nsReg; + + /** + * The node type registry. + */ + protected final NodeTypeDataManager nodeTypeDataManager; + + /** + * QueryHandler of the parent search manager or null if th= ere + * is none. + */ + protected final SearchManager parentSearchManager; + + // protected QPath indexingRoot; + // + // protected List excludedPaths =3D new ArrayList(); + + protected IndexingTree indexingTree; + + private final ConfigurationManager cfm; + + protected LuceneVirtualTableResolver virtualTableResolver; + + /** + * Creates a new SearchManager. + * = + * @param config + * the search configuration. + * @param nsReg + * the namespace registry. + * @param ntReg + * the node type registry. + * @param itemMgr + * the shared item state manager. + * @param rootNodeId + * the id of the root node. + * @param parentMgr + * the parent search manager or null if there i= s no + * parent search manager. + * @param excludedNodeId + * id of the node that should be excluded from indexing. Any + * descendant of that node will also be excluded from indexi= ng. + * @throws RepositoryException + * if the search manager cannot be initialized + * @throws RepositoryConfigurationException + */ + public SearchManager(QueryHandlerEntry config, NamespaceRegistryImpl ns= Reg, NodeTypeDataManager ntReg, + WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, + DocumentReaderService extractor, ConfigurationManager cfm, final Rep= ositoryIndexSearcherHolder indexSearcherHolder) + throws RepositoryException, RepositoryConfigurationException + { + + this.extractor =3D extractor; + indexSearcherHolder.addIndexSearcher(this); + this.config =3D config; + this.nodeTypeDataManager =3D ntReg; + this.nsReg =3D nsReg; + this.itemMgr =3D itemMgr; + this.cfm =3D cfm; + this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); + this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; + itemMgr.addItemPersistenceListener(this); + } + + /** + * Creates a query object from a node that can be executed on the works= pace. + * = + * @param session + * the session of the user executing the query. + * @param itemMgr + * the item manager of the user executing the query. Needed = to + * return Node instances in the result set. + * @param node + * a node of type nt:query. + * @return a Query instance to execute. + * @throws InvalidQueryException + * if absPath is not a valid persisted query (= that + * is, a node of type nt:query) + * @throws RepositoryException + * if any other error occurs. + */ + public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, Node node) + throws InvalidQueryException, RepositoryException + { + AbstractQueryImpl query =3D createQueryInstance(); + query.init(session, sessionDataManager, handler, node); + return query; + } + + /** + * Creates a query object that can be executed on the workspace. + * = + * @param session + * the session of the user executing the query. + * @param itemMgr + * the item manager of the user executing the query. Needed = to + * return Node instances in the result set. + * @param statement + * the actual query statement. + * @param language + * the syntax of the query statement. + * @return a Query instance to execute. + * @throws InvalidQueryException + * if the query is malformed or the language is + * unknown. + * @throws RepositoryException + * if any other error occurs. + */ + public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, String statement, + String language) throws InvalidQueryException, RepositoryException + { + AbstractQueryImpl query =3D createQueryInstance(); + query.init(session, sessionDataManager, handler, statement, language= ); + return query; + } + + /** + * just for test use only + */ + public QueryHandler getHandler() + { + + return handler; + } + + public void onSaveItems(ItemStateChangesLog changesLog) + { + if (handler =3D=3D null) + return; + + long time =3D System.currentTimeMillis(); + + // nodes that need to be removed from the index. + final Set removedNodes =3D new HashSet(); + // nodes that need to be added to the index. + final Set addedNodes =3D new HashSet(); + + final Map> updatedNodes =3D new HashMap>(); + + for (Iterator iter =3D changesLog.getAllStates().iterator= (); iter.hasNext();) + { + ItemState itemState =3D iter.next(); + + if (!indexingTree.isExcluded(itemState)) + { + String uuid =3D + itemState.isNode() ? itemState.getData().getIdentifier() : = itemState.getData().getParentIdentifier(); + + if (itemState.isAdded()) + { + if (itemState.isNode()) + { + addedNodes.add(uuid); + } + else + { + if (!addedNodes.contains(uuid)) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + } + } + else if (itemState.isRenamed()) + { + if (itemState.isNode()) + { + addedNodes.add(uuid); + } + else + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + } + else if (itemState.isUpdated()) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + else if (itemState.isMixinChanged()) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + else if (itemState.isDeleted()) + { + if (itemState.isNode()) + { + if (addedNodes.contains(uuid)) + { + addedNodes.remove(uuid); + removedNodes.remove(uuid); + } + else + { + removedNodes.add(uuid); + } + // remove all changes after node remove + updatedNodes.remove(uuid); + } + else + { + if (!removedNodes.contains(uuid) && !addedNodes.contains= (uuid)) + { + createNewOrAdd(uuid, itemState, updatedNodes); + } + } + } + } + } + // TODO make quick changes + for (String uuid : updatedNodes.keySet()) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } + + try + { + updateIndex(removedNodes, addedNodes); + } + catch (RepositoryException e) + { + log.error("Error indexing changes " + e, e); + } + catch (IOException e) + { + log.error("Error indexing changes " + e, e); + try + { + handler.logErrorChanges(removedNodes, addedNodes); + } + catch (IOException ioe) + { + log.warn("Exception occure when errorLog writed. Error log is = not complete. " + ioe, ioe); + } + } + + if (log.isDebugEnabled()) + { + log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); + } + + } + + /** + * {@inheritDoc} + */ + public void updateIndex(final Set removedNodes, final Set addedNodes) throws RepositoryException, + IOException + { + if (handler !=3D null) + { + Iterator addedStates =3D new Iterator() + { + private final Iterator iter =3D addedNodes.iterator(); + + public boolean hasNext() + { + return iter.hasNext(); + } + + public NodeData next() + { + + // cycle till find a next or meet the end of set + do + { + String id =3D iter.next(); + try + { + ItemData item =3D itemMgr.getItemData(id); + if (item !=3D null) + { + if (item.isNode()) + return (NodeData)item; // return node + else + log.warn("Node not found, but property " + id += ", " + item.getQPath().getAsString() + + " found. "); + } + else + log.warn("Unable to index node with id " + id + ",= node does not exist."); + + } + catch (RepositoryException e) + { + log.error("Can't read next node data " + id, e); + } + } + while (iter.hasNext()); // get next if error or node not fo= und + + return null; // we met the end of iterator set + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + }; + + Iterator removedIds =3D new Iterator() + { + private final Iterator iter =3D removedNodes.iterator(= ); + + public boolean hasNext() + { + return iter.hasNext(); + } + + public String next() + { + return nextNodeId(); + } + + public String nextNodeId() throws NoSuchElementException + { + return iter.next(); + } + + public void remove() + { + throw new UnsupportedOperationException(); + + } + }; + + if (removedNodes.size() > 0 || addedNodes.size() > 0) + { + handler.updateNodes(removedIds, addedStates); + } + } + + } + + public void createNewOrAdd(String key, ItemState state, Map> updatedNodes) + { + List list =3D updatedNodes.get(key); + if (list =3D=3D null) + { + list =3D new ArrayList(); + updatedNodes.put(key, list); + } + list.add(state); + + } + + public void start() + { + + if (log.isDebugEnabled()) + log.debug("start"); + try + { + if (indexingTree =3D=3D null) + { + List excludedPath =3D new ArrayList(); + // Calculating excluded node identifiers + excludedPath.add(Constants.JCR_SYSTEM_PATH); + + //if (config.getExcludedNodeIdentifers() !=3D null) + String excludedNodeIdentifer =3D + config.getParameterValue(QueryHandlerParams.PARAM_EXCLUDED_= NODE_IDENTIFERS, null); + if (excludedNodeIdentifer !=3D null) + { + StringTokenizer stringTokenizer =3D new StringTokenizer(exc= ludedNodeIdentifer); + while (stringTokenizer.hasMoreTokens()) + { + + try + { + ItemData excludeData =3D itemMgr.getItemData(stringTo= kenizer.nextToken()); + if (excludeData !=3D null) + excludedPath.add(excludeData.getQPath()); + } + catch (RepositoryException e) + { + log.warn(e.getLocalizedMessage()); + } + } + } + + NodeData indexingRootData =3D null; + String rootNodeIdentifer =3D config.getParameterValue(QueryHan= dlerParams.PARAM_ROOT_NODE_ID, null); + if (rootNodeIdentifer !=3D null) + { + try + { + ItemData indexingRootDataItem =3D itemMgr.getItemData(ro= otNodeIdentifer); + if (indexingRootDataItem !=3D null && indexingRootDataIt= em.isNode()) + indexingRootData =3D (NodeData)indexingRootDataItem; + } + catch (RepositoryException e) + { + log.warn(e.getLocalizedMessage() + " Indexing root set t= o " + Constants.ROOT_PATH.getAsString()); + + } + + } + else + { + try + { + indexingRootData =3D (NodeData)itemMgr.getItemData(Const= ants.ROOT_UUID); + // indexingRootData =3D + // new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, + // new InternalQName[0], 0, null, ne= w AccessControlList()); + } + catch (RepositoryException e) + { + log.error("Fail to load root node data"); + } + } + + indexingTree =3D new IndexingTree(indexingRootData, excludedPa= th); + } + + initializeQueryHandler(); + } + catch (RepositoryException e) + { + log.error(e.getLocalizedMessage()); + handler =3D null; + throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); + } + catch (RepositoryConfigurationException e) + { + log.error(e.getLocalizedMessage()); + handler =3D null; + throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); + } + } + + public void stop() + { + handler.close(); + log.info("Search manager stopped"); + } + + // /** + // * Checks if the given event should be excluded based on the + // * {@link #excludePath} setting. + // * + // * @param event + // * observation event + // * @return true if the event should be excluded, + // * false otherwise + // */ + // protected boolean isExcluded(ItemState event) { + // + // for (QPath excludedPath : excludedPaths) { + // if (event.getData().getQPath().isDescendantOf(excludedPath) + // || event.getData().getQPath().equals(excludedPath)) + // return true; + // } + // + // return !event.getData().getQPath().isDescendantOf(indexingRoot) + // && !event.getData().getQPath().equals(indexingRoot); + // } + + protected QueryHandlerContext createQueryHandlerContext(QueryHandler pa= rentHandler) + throws RepositoryConfigurationException + { + + QueryHandlerContext context =3D + new QueryHandlerContext(itemMgr, indexingTree, nodeTypeDataManage= r, nsReg, parentHandler, getIndexDir(), + extractor, true, virtualTableResolver); + return context; + } + + protected String getIndexDir() throws RepositoryConfigurationException + { + String dir =3D config.getParameterValue(QueryHandlerParams.PARAM_IND= EX_DIR, null); + if (dir =3D=3D null) + { + log.warn(QueryHandlerParams.PARAM_INDEX_DIR + " parameter not fou= nd. Using outdated parameter name " + + QueryHandlerParams.OLD_PARAM_INDEX_DIR); + dir =3D config.getParameterValue(QueryHandlerParams.OLD_PARAM_IND= EX_DIR); + } + return dir; + } + + /** + * Initializes the query handler. + * = + * @throws RepositoryException + * if the query handler cannot be initialized. + * @throws RepositoryConfigurationException + * @throws ClassNotFoundException + */ + protected void initializeQueryHandler() throws RepositoryException, Rep= ositoryConfigurationException + { + // initialize query handler + String className =3D config.getType(); + if (className =3D=3D null) + throw new RepositoryConfigurationException("Content hanler = configuration fail"); + + try + { + Class qHandlerClass =3D Class.forName(className, true, this.getCl= ass().getClassLoader()); + Constructor constuctor =3D qHandlerClass.getConstructor(QueryHand= lerEntry.class, ConfigurationManager.class); + handler =3D (QueryHandler)constuctor.newInstance(config, cfm); + QueryHandler parentHandler =3D (this.parentSearchManager !=3D nul= l) ? parentSearchManager.getHandler() : null; + QueryHandlerContext context =3D createQueryHandlerContext(parentH= andler); + handler.init(context); + } + catch (SecurityException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IllegalArgumentException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (ClassNotFoundException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (NoSuchMethodException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (InstantiationException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IllegalAccessException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (InvocationTargetException e) + { + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + throw new RepositoryException(e.getMessage(), e); + } + } + + /** + * Creates a new instance of an {@link AbstractQueryImpl} which is not + * initialized. + * = + * @return an new query instance. + * @throws RepositoryException + * if an error occurs while creating a new query instance. + */ + protected AbstractQueryImpl createQueryInstance() throws RepositoryExce= ption + { + try + { + String queryImplClassName =3D handler.getQueryClass(); + Object obj =3D Class.forName(queryImplClassName).newInstance(); + if (obj instanceof AbstractQueryImpl) + { + return (AbstractQueryImpl)obj; + } + else + { + throw new IllegalArgumentException(queryImplClassName + " is n= ot of type " + + AbstractQueryImpl.class.getName()); + } + } + catch (Throwable t) + { + throw new RepositoryException("Unable to create query: " + t.toSt= ring(), t); + } + } + + /** + * {@inheritDoc} + */ + public Set getFieldNames() throws IndexException + { + final Set fildsSet =3D new HashSet(); + if (handler instanceof SearchIndex) + { + IndexReader reader =3D null; + try + { + reader =3D ((SearchIndex)handler).getIndexReader(); + final Collection fields =3D reader.getFieldNames(IndexReader.F= ieldOption.ALL); + for (final Object field : fields) + { + fildsSet.add((String)field); + } + } + catch (IOException e) + { + throw new IndexException(e.getLocalizedMessage(), e); + } + finally + { + try + { + if (reader !=3D null) + reader.close(); + } + catch (IOException e) + { + throw new IndexException(e.getLocalizedMessage(), e); + } + } + + } + return fildsSet; + } + + public Set getNodesByNodeType(final InternalQName nodeType) thr= ows RepositoryException + { + + return getNodes(virtualTableResolver.resolve(nodeType, true)); + } + + /** + * Return set of uuid of nodes. Contains in names prefixes maped to the + * given uri + * = + * @param prefix + * @return + * @throws RepositoryException + */ + public Set getNodesByUri(final String uri) throws RepositoryExc= eption + { + Set result; + final int defaultClauseCount =3D BooleanQuery.getMaxClauseCount(); + try + { + + // final LocationFactory locationFactory =3D new + // LocationFactory(this); + final ValueFactoryImpl valueFactory =3D new ValueFactoryImpl(new = LocationFactory(nsReg)); + BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE); + BooleanQuery query =3D new BooleanQuery(); + + final String prefix =3D nsReg.getNamespacePrefixByURI(uri); + query.add(new WildcardQuery(new Term(FieldNames.LABEL, prefix + "= :*")), Occur.SHOULD); + // name of the property + query.add(new WildcardQuery(new Term(FieldNames.PROPERTIES_SET, p= refix + ":*")), Occur.SHOULD); + + result =3D getNodes(query); + + // value of the property + + try + { + final Set props =3D getFieldNames(); + + query =3D new BooleanQuery(); + for (final String fieldName : props) + { + if (!FieldNames.PROPERTIES_SET.equals(fieldName)) + { + query.add(new WildcardQuery(new Term(fieldName, "*" + pr= efix + ":*")), Occur.SHOULD); + } + } + } + catch (final IndexException e) + { + throw new RepositoryException(e.getLocalizedMessage(), e); + } + + final Set propSet =3D getNodes(query); + // Manually check property values; + for (final String uuid : propSet) + { + if (isPrefixMatch(valueFactory, uuid, prefix)) + { + result.add(uuid); + } + } + } + finally + { + BooleanQuery.setMaxClauseCount(defaultClauseCount); + } + + return result; + } + + private boolean isPrefixMatch(final InternalQName value, final String p= refix) throws RepositoryException + { + return value.getNamespace().equals(nsReg.getNamespaceURIByPrefix(pre= fix)); + } + + private boolean isPrefixMatch(final QPath value, final String prefix) t= hrows RepositoryException + { + for (int i =3D 0; i < value.getEntries().length; i++) + { + if (isPrefixMatch(value.getEntries()[i], prefix)) + { + return true; + } + } + return false; + } + + /** + * @param valueFactory + * @param dm + * @param uuid + * @param prefix + * @throws RepositoryException + */ + private boolean isPrefixMatch(final ValueFactoryImpl valueFactory, fina= l String uuid, final String prefix) + throws RepositoryException + { + + final ItemData node =3D itemMgr.getItemData(uuid); + if (node !=3D null && node.isNode()) + { + final List props =3D itemMgr.getChildPropertiesData= ((NodeData)node); + for (final PropertyData propertyData : props) + { + if (propertyData.getType() =3D=3D PropertyType.PATH || propert= yData.getType() =3D=3D PropertyType.NAME) + { + for (final ValueData vdata : propertyData.getValues()) + { + final Value val =3D + valueFactory.loadValue(((AbstractValueData)vdata).cre= ateTransientCopy(), propertyData.getType()); + if (propertyData.getType() =3D=3D PropertyType.PATH) + { + if (isPrefixMatch(((PathValue)val).getQPath(), prefix= )) + { + return true; + } + } + else if (propertyData.getType() =3D=3D PropertyType.NAME) + { + if (isPrefixMatch(((NameValue)val).getQName(), prefix= )) + { + return true; + } + } + } + } + } + } + return false; + } + + /** + * @param query + * @return + * @throws RepositoryException + */ + private Set getNodes(final org.apache.lucene.search.Query query= ) throws RepositoryException + { + Set result =3D new HashSet(); + try + { + QueryHits hits =3D handler.executeQuery(query); + + ScoreNode sn; + + while ((sn =3D hits.nextScoreNode()) !=3D null) + { + // Node node =3D session.getNodeById(sn.getNodeId()); + result.add(sn.getNodeId()); + } + } + catch (IOException e) + { + throw new RepositoryException(e.getLocalizedMessage(), e); + } + return result; + } + +} Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/SearchManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java 2009-11-16 10:07:27 UTC (= rev 672) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerImpl.java 2009-11-16 10:13:42 UTC (= rev 673) @@ -1,883 +0,0 @@ -/* - * Copyright (C) 2003-2009 eXo Platform SAS. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see. - */ -package org.exoplatform.services.jcr.impl.core.query; - -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.Term; -import org.apache.lucene.search.BooleanQuery; -import org.apache.lucene.search.WildcardQuery; -import org.apache.lucene.search.BooleanClause.Occur; -import org.exoplatform.container.configuration.ConfigurationManager; -import org.exoplatform.services.document.DocumentReaderService; -import org.exoplatform.services.jcr.config.QueryHandlerEntry; -import org.exoplatform.services.jcr.config.QueryHandlerParams; -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; -import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; -import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; -import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPers= istenceListener; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.ValueData; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.LocationFactory; -import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; -import org.exoplatform.services.jcr.impl.core.SessionDataManager; -import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; -import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; -import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; -import org.exoplatform.services.jcr.impl.core.query.lucene.ScoreNode; -import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; -import org.exoplatform.services.jcr.impl.core.value.NameValue; -import org.exoplatform.services.jcr.impl.core.value.PathValue; -import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; -import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.cache.factories.annotations.NonVolatile; -import org.picocontainer.Startable; - -import java.io.IOException; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Set; -import java.util.StringTokenizer; - -import javax.jcr.Node; -import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; -import javax.jcr.Value; -import javax.jcr.query.InvalidQueryException; -import javax.jcr.query.Query; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: = - * - * @author Karpenko Sergiy = - * @version $Id: SearchManagerImpl.java 111 2008-11-11 11:11:11Z serg $ - */ -(a)NonVolatile -public class SearchManagerImpl implements SearchManager, Startable, Mandat= oryItemsPersistenceListener -{ - - /** - * Logger instance for this class - */ - private static final Log log =3D ExoLogger.getLogger(SearchManagerImpl.= class); - - protected final QueryHandlerEntry config; - - /** - * Text extractor for extracting text content of binary properties. - */ - protected final DocumentReaderService extractor; - - /** - * QueryHandler where query execution is delegated to - */ - protected QueryHandler handler; - - /** - * The shared item state manager instance for the workspace. - */ - protected final ItemDataConsumer itemMgr; - - /** - * The namespace registry of the repository. - */ - protected final NamespaceRegistryImpl nsReg; - - /** - * The node type registry. - */ - protected final NodeTypeDataManager nodeTypeDataManager; - - /** - * QueryHandler of the parent search manager or null if th= ere - * is none. - */ - protected final SearchManager parentSearchManager; - - // protected QPath indexingRoot; - // - // protected List excludedPaths =3D new ArrayList(); - - protected IndexingTree indexingTree; - - private final ConfigurationManager cfm; - - protected LuceneVirtualTableResolver virtualTableResolver; - - /** - * Creates a new SearchManager. - * = - * @param config - * the search configuration. - * @param nsReg - * the namespace registry. - * @param ntReg - * the node type registry. - * @param itemMgr - * the shared item state manager. - * @param rootNodeId - * the id of the root node. - * @param parentMgr - * the parent search manager or null if there i= s no - * parent search manager. - * @param excludedNodeId - * id of the node that should be excluded from indexing. Any - * descendant of that node will also be excluded from indexi= ng. - * @throws RepositoryException - * if the search manager cannot be initialized - * @throws RepositoryConfigurationException - */ - public SearchManagerImpl(QueryHandlerEntry config, NamespaceRegistryImp= l nsReg, NodeTypeDataManager ntReg, - WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, - DocumentReaderService extractor, ConfigurationManager cfm, final Rep= ositoryIndexSearcherHolder indexSearcherHolder) - throws RepositoryException, RepositoryConfigurationException - { - - this.extractor =3D extractor; - indexSearcherHolder.addIndexSearcher(this); - this.config =3D config; - this.nodeTypeDataManager =3D ntReg; - this.nsReg =3D nsReg; - this.itemMgr =3D itemMgr; - this.cfm =3D cfm; - this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); - this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; - itemMgr.addItemPersistenceListener(this); - } - - /** - * Creates a query object from a node that can be executed on the works= pace. - * = - * @param session - * the session of the user executing the query. - * @param itemMgr - * the item manager of the user executing the query. Needed = to - * return Node instances in the result set. - * @param node - * a node of type nt:query. - * @return a Query instance to execute. - * @throws InvalidQueryException - * if absPath is not a valid persisted query (= that - * is, a node of type nt:query) - * @throws RepositoryException - * if any other error occurs. - */ - public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, Node node) - throws InvalidQueryException, RepositoryException - { - AbstractQueryImpl query =3D createQueryInstance(); - query.init(session, sessionDataManager, handler, node); - return query; - } - - /** - * Creates a query object that can be executed on the workspace. - * = - * @param session - * the session of the user executing the query. - * @param itemMgr - * the item manager of the user executing the query. Needed = to - * return Node instances in the result set. - * @param statement - * the actual query statement. - * @param language - * the syntax of the query statement. - * @return a Query instance to execute. - * @throws InvalidQueryException - * if the query is malformed or the language is - * unknown. - * @throws RepositoryException - * if any other error occurs. - */ - public Query createQuery(SessionImpl session, SessionDataManager sessio= nDataManager, String statement, - String language) throws InvalidQueryException, RepositoryException - { - AbstractQueryImpl query =3D createQueryInstance(); - query.init(session, sessionDataManager, handler, statement, language= ); - return query; - } - - /** - * just for test use only - */ - public QueryHandler getHandler() - { - - return handler; - } - - public void onSaveItems(ItemStateChangesLog changesLog) - { - if (handler =3D=3D null) - return; - - long time =3D System.currentTimeMillis(); - - // nodes that need to be removed from the index. - final Set removedNodes =3D new HashSet(); - // nodes that need to be added to the index. - final Set addedNodes =3D new HashSet(); - - final Map> updatedNodes =3D new HashMap>(); - - for (Iterator iter =3D changesLog.getAllStates().iterator= (); iter.hasNext();) - { - ItemState itemState =3D iter.next(); - - if (!indexingTree.isExcluded(itemState)) - { - String uuid =3D - itemState.isNode() ? itemState.getData().getIdentifier() : = itemState.getData().getParentIdentifier(); - - if (itemState.isAdded()) - { - if (itemState.isNode()) - { - addedNodes.add(uuid); - } - else - { - if (!addedNodes.contains(uuid)) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - } - } - else if (itemState.isRenamed()) - { - if (itemState.isNode()) - { - addedNodes.add(uuid); - } - else - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - } - else if (itemState.isUpdated()) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - else if (itemState.isMixinChanged()) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - else if (itemState.isDeleted()) - { - if (itemState.isNode()) - { - if (addedNodes.contains(uuid)) - { - addedNodes.remove(uuid); - removedNodes.remove(uuid); - } - else - { - removedNodes.add(uuid); - } - // remove all changes after node remove - updatedNodes.remove(uuid); - } - else - { - if (!removedNodes.contains(uuid) && !addedNodes.contains= (uuid)) - { - createNewOrAdd(uuid, itemState, updatedNodes); - } - } - } - } - } - // TODO make quick changes - for (String uuid : updatedNodes.keySet()) - { - removedNodes.add(uuid); - addedNodes.add(uuid); - } - - try - { - updateIndex(removedNodes, addedNodes); - } - catch (RepositoryException e) - { - log.error("Error indexing changes " + e, e); - } - catch (IOException e) - { - log.error("Error indexing changes " + e, e); - try - { - handler.logErrorChanges(removedNodes, addedNodes); - } - catch (IOException ioe) - { - log.warn("Exception occure when errorLog writed. Error log is = not complete. " + ioe, ioe); - } - } - - if (log.isDebugEnabled()) - { - log.debug("onEvent: indexing finished in " + String.valueOf(Syste= m.currentTimeMillis() - time) + " ms."); - } - - } - - /** - * {@inheritDoc} - */ - public void updateIndex(final Set removedNodes, final Set addedNodes) throws RepositoryException, - IOException - { - if (handler !=3D null) - { - Iterator addedStates =3D new Iterator() - { - private final Iterator iter =3D addedNodes.iterator(); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public NodeData next() - { - - // cycle till find a next or meet the end of set - do - { - String id =3D iter.next(); - try - { - ItemData item =3D itemMgr.getItemData(id); - if (item !=3D null) - { - if (item.isNode()) - return (NodeData)item; // return node - else - log.warn("Node not found, but property " + id += ", " + item.getQPath().getAsString() - + " found. "); - } - else - log.warn("Unable to index node with id " + id + ",= node does not exist."); - - } - catch (RepositoryException e) - { - log.error("Can't read next node data " + id, e); - } - } - while (iter.hasNext()); // get next if error or node not fo= und - - return null; // we met the end of iterator set - } - - public void remove() - { - throw new UnsupportedOperationException(); - } - }; - - Iterator removedIds =3D new Iterator() - { - private final Iterator iter =3D removedNodes.iterator(= ); - - public boolean hasNext() - { - return iter.hasNext(); - } - - public String next() - { - return nextNodeId(); - } - - public String nextNodeId() throws NoSuchElementException - { - return iter.next(); - } - - public void remove() - { - throw new UnsupportedOperationException(); - - } - }; - - if (removedNodes.size() > 0 || addedNodes.size() > 0) - { - handler.updateNodes(removedIds, addedStates); - } - } - - } - - public void createNewOrAdd(String key, ItemState state, Map> updatedNodes) - { - List list =3D updatedNodes.get(key); - if (list =3D=3D null) - { - list =3D new ArrayList(); - updatedNodes.put(key, list); - } - list.add(state); - - } - - public void start() - { - - if (log.isDebugEnabled()) - log.debug("start"); - try - { - if (indexingTree =3D=3D null) - { - List excludedPath =3D new ArrayList(); - // Calculating excluded node identifiers - excludedPath.add(Constants.JCR_SYSTEM_PATH); - - //if (config.getExcludedNodeIdentifers() !=3D null) - String excludedNodeIdentifer =3D - config.getParameterValue(QueryHandlerParams.PARAM_EXCLUDED_= NODE_IDENTIFERS, null); - if (excludedNodeIdentifer !=3D null) - { - StringTokenizer stringTokenizer =3D new StringTokenizer(exc= ludedNodeIdentifer); - while (stringTokenizer.hasMoreTokens()) - { - - try - { - ItemData excludeData =3D itemMgr.getItemData(stringTo= kenizer.nextToken()); - if (excludeData !=3D null) - excludedPath.add(excludeData.getQPath()); - } - catch (RepositoryException e) - { - log.warn(e.getLocalizedMessage()); - } - } - } - - NodeData indexingRootData =3D null; - String rootNodeIdentifer =3D config.getParameterValue(QueryHan= dlerParams.PARAM_ROOT_NODE_ID, null); - if (rootNodeIdentifer !=3D null) - { - try - { - ItemData indexingRootDataItem =3D itemMgr.getItemData(ro= otNodeIdentifer); - if (indexingRootDataItem !=3D null && indexingRootDataIt= em.isNode()) - indexingRootData =3D (NodeData)indexingRootDataItem; - } - catch (RepositoryException e) - { - log.warn(e.getLocalizedMessage() + " Indexing root set t= o " + Constants.ROOT_PATH.getAsString()); - - } - - } - else - { - try - { - indexingRootData =3D (NodeData)itemMgr.getItemData(Const= ants.ROOT_UUID); - // indexingRootData =3D - // new TransientNodeData(Constants.ROOT= _PATH, Constants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - // new InternalQName[0], 0, null, ne= w AccessControlList()); - } - catch (RepositoryException e) - { - log.error("Fail to load root node data"); - } - } - - indexingTree =3D new IndexingTree(indexingRootData, excludedPa= th); - } - - initializeQueryHandler(); - } - catch (RepositoryException e) - { - log.error(e.getLocalizedMessage()); - handler =3D null; - throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); - } - catch (RepositoryConfigurationException e) - { - log.error(e.getLocalizedMessage()); - handler =3D null; - throw new RuntimeException(e.getLocalizedMessage(), e.getCause()); - } - } - - public void stop() - { - handler.close(); - log.info("Search manager stopped"); - } - - // /** - // * Checks if the given event should be excluded based on the - // * {@link #excludePath} setting. - // * - // * @param event - // * observation event - // * @return true if the event should be excluded, - // * false otherwise - // */ - // protected boolean isExcluded(ItemState event) { - // - // for (QPath excludedPath : excludedPaths) { - // if (event.getData().getQPath().isDescendantOf(excludedPath) - // || event.getData().getQPath().equals(excludedPath)) - // return true; - // } - // - // return !event.getData().getQPath().isDescendantOf(indexingRoot) - // && !event.getData().getQPath().equals(indexingRoot); - // } - - protected QueryHandlerContext createQueryHandlerContext(QueryHandler pa= rentHandler) - throws RepositoryConfigurationException - { - - QueryHandlerContext context =3D - new QueryHandlerContext(itemMgr, indexingTree, nodeTypeDataManage= r, nsReg, parentHandler, getIndexDir(), - extractor, true, virtualTableResolver); - return context; - } - - protected String getIndexDir() throws RepositoryConfigurationException - { - String dir =3D config.getParameterValue(QueryHandlerParams.PARAM_IND= EX_DIR, null); - if (dir =3D=3D null) - { - log.warn(QueryHandlerParams.PARAM_INDEX_DIR + " parameter not fou= nd. Using outdated parameter name " - + QueryHandlerParams.OLD_PARAM_INDEX_DIR); - dir =3D config.getParameterValue(QueryHandlerParams.OLD_PARAM_IND= EX_DIR); - } - return dir; - } - - /** - * Initializes the query handler. - * = - * @throws RepositoryException - * if the query handler cannot be initialized. - * @throws RepositoryConfigurationException - * @throws ClassNotFoundException - */ - protected void initializeQueryHandler() throws RepositoryException, Rep= ositoryConfigurationException - { - // initialize query handler - String className =3D config.getType(); - if (className =3D=3D null) - throw new RepositoryConfigurationException("Content hanler = configuration fail"); - - try - { - Class qHandlerClass =3D Class.forName(className, true, this.getCl= ass().getClassLoader()); - Constructor constuctor =3D qHandlerClass.getConstructor(QueryHand= lerEntry.class, ConfigurationManager.class); - handler =3D (QueryHandler)constuctor.newInstance(config, cfm); - QueryHandler parentHandler =3D (this.parentSearchManager !=3D nul= l) ? parentSearchManager.getHandler() : null; - QueryHandlerContext context =3D createQueryHandlerContext(parentH= andler); - handler.init(context); - } - catch (SecurityException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IllegalArgumentException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (ClassNotFoundException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (NoSuchMethodException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (InstantiationException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IllegalAccessException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (InvocationTargetException e) - { - throw new RepositoryException(e.getMessage(), e); - } - catch (IOException e) - { - throw new RepositoryException(e.getMessage(), e); - } - } - - /** - * Creates a new instance of an {@link AbstractQueryImpl} which is not - * initialized. - * = - * @return an new query instance. - * @throws RepositoryException - * if an error occurs while creating a new query instance. - */ - protected AbstractQueryImpl createQueryInstance() throws RepositoryExce= ption - { - try - { - String queryImplClassName =3D handler.getQueryClass(); - Object obj =3D Class.forName(queryImplClassName).newInstance(); - if (obj instanceof AbstractQueryImpl) - { - return (AbstractQueryImpl)obj; - } - else - { - throw new IllegalArgumentException(queryImplClassName + " is n= ot of type " - + AbstractQueryImpl.class.getName()); - } - } - catch (Throwable t) - { - throw new RepositoryException("Unable to create query: " + t.toSt= ring(), t); - } - } - - /** - * {@inheritDoc} - */ - public Set getFieldNames() throws IndexException - { - final Set fildsSet =3D new HashSet(); - if (handler instanceof SearchIndex) - { - IndexReader reader =3D null; - try - { - reader =3D ((SearchIndex)handler).getIndexReader(); - final Collection fields =3D reader.getFieldNames(IndexReader.F= ieldOption.ALL); - for (final Object field : fields) - { - fildsSet.add((String)field); - } - } - catch (IOException e) - { - throw new IndexException(e.getLocalizedMessage(), e); - } - finally - { - try - { - if (reader !=3D null) - reader.close(); - } - catch (IOException e) - { - throw new IndexException(e.getLocalizedMessage(), e); - } - } - - } - return fildsSet; - } - - public Set getNodesByNodeType(final InternalQName nodeType) thr= ows RepositoryException - { - - return getNodes(virtualTableResolver.resolve(nodeType, true)); - } - - /** - * Return set of uuid of nodes. Contains in names prefixes maped to the - * given uri - * = - * @param prefix - * @return - * @throws RepositoryException - */ - public Set getNodesByUri(final String uri) throws RepositoryExc= eption - { - Set result; - final int defaultClauseCount =3D BooleanQuery.getMaxClauseCount(); - try - { - - // final LocationFactory locationFactory =3D new - // LocationFactory(this); - final ValueFactoryImpl valueFactory =3D new ValueFactoryImpl(new = LocationFactory(nsReg)); - BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE); - BooleanQuery query =3D new BooleanQuery(); - - final String prefix =3D nsReg.getNamespacePrefixByURI(uri); - query.add(new WildcardQuery(new Term(FieldNames.LABEL, prefix + "= :*")), Occur.SHOULD); - // name of the property - query.add(new WildcardQuery(new Term(FieldNames.PROPERTIES_SET, p= refix + ":*")), Occur.SHOULD); - - result =3D getNodes(query); - - // value of the property - - try - { - final Set props =3D getFieldNames(); - - query =3D new BooleanQuery(); - for (final String fieldName : props) - { - if (!FieldNames.PROPERTIES_SET.equals(fieldName)) - { - query.add(new WildcardQuery(new Term(fieldName, "*" + pr= efix + ":*")), Occur.SHOULD); - } - } - } - catch (final IndexException e) - { - throw new RepositoryException(e.getLocalizedMessage(), e); - } - - final Set propSet =3D getNodes(query); - // Manually check property values; - for (final String uuid : propSet) - { - if (isPrefixMatch(valueFactory, uuid, prefix)) - { - result.add(uuid); - } - } - } - finally - { - BooleanQuery.setMaxClauseCount(defaultClauseCount); - } - - return result; - } - - private boolean isPrefixMatch(final InternalQName value, final String p= refix) throws RepositoryException - { - return value.getNamespace().equals(nsReg.getNamespaceURIByPrefix(pre= fix)); - } - - private boolean isPrefixMatch(final QPath value, final String prefix) t= hrows RepositoryException - { - for (int i =3D 0; i < value.getEntries().length; i++) - { - if (isPrefixMatch(value.getEntries()[i], prefix)) - { - return true; - } - } - return false; - } - - /** - * @param valueFactory - * @param dm - * @param uuid - * @param prefix - * @throws RepositoryException - */ - private boolean isPrefixMatch(final ValueFactoryImpl valueFactory, fina= l String uuid, final String prefix) - throws RepositoryException - { - - final ItemData node =3D itemMgr.getItemData(uuid); - if (node !=3D null && node.isNode()) - { - final List props =3D itemMgr.getChildPropertiesData= ((NodeData)node); - for (final PropertyData propertyData : props) - { - if (propertyData.getType() =3D=3D PropertyType.PATH || propert= yData.getType() =3D=3D PropertyType.NAME) - { - for (final ValueData vdata : propertyData.getValues()) - { - final Value val =3D - valueFactory.loadValue(((AbstractValueData)vdata).cre= ateTransientCopy(), propertyData.getType()); - if (propertyData.getType() =3D=3D PropertyType.PATH) - { - if (isPrefixMatch(((PathValue)val).getQPath(), prefix= )) - { - return true; - } - } - else if (propertyData.getType() =3D=3D PropertyType.NAME) - { - if (isPrefixMatch(((NameValue)val).getQName(), prefix= )) - { - return true; - } - } - } - } - } - } - return false; - } - - /** - * @param query - * @return - * @throws RepositoryException - */ - private Set getNodes(final org.apache.lucene.search.Query query= ) throws RepositoryException - { - Set result =3D new HashSet(); - try - { - QueryHits hits =3D handler.executeQuery(query); - - ScoreNode sn; - - while ((sn =3D hits.nextScoreNode()) !=3D null) - { - // Node node =3D session.getNodeById(sn.getNodeId()); - result.add(sn.getNodeId()); - } - } - catch (IOException e) - { - throw new RepositoryException(e.getLocalizedMessage(), e); - } - return result; - } - -} Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SystemSearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-16 10:07:27 UTC= (rev 672) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-16 10:13:42 UTC= (rev 673) @@ -42,7 +42,7 @@ * @version $Id: SystemSearchManager.java 13891 2008-05-05 16:02:30Z pnedo= nosko * $ */ -public class SystemSearchManager extends SearchManagerImpl +public class SystemSearchManager extends SearchManager { = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-16 1= 0:07:27 UTC (rev 672) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-16 1= 0:13:42 UTC (rev 673) @@ -211,75 +211,6 @@ } } = - // for (Iterator iter =3D changesLog.getAllStates().= iterator(); iter.hasNext();) - // { - // ItemState itemState =3D iter.next(); - // - // if (!indexingTree.isExcluded(itemState)) - // { - // String uuid =3D - // itemState.isNode() ? itemState.getData().getIdentif= ier() : itemState.getData().getParentIdentifier(); - // - // if (itemState.isAdded()) - // { - // if (itemState.isNode()) - // { - // addedNodes.add(uuid); - // } - // else - // { - // if (!addedNodes.contains(uuid)) - // { - // createNewOrAdd(uuid, itemState, updatedNodes); - // } - // } - // } - // else if (itemState.isRenamed()) - // { - // if (itemState.isNode()) - // { - // addedNodes.add(uuid); - // } - // else - // { - // createNewOrAdd(uuid, itemState, updatedNodes); - // } - // } - // else if (itemState.isUpdated()) - // { - // createNewOrAdd(uuid, itemState, updatedNodes); - // } - // else if (itemState.isMixinChanged()) - // { - // createNewOrAdd(uuid, itemState, updatedNodes); - // } - // else if (itemState.isDeleted()) - // { - // if (itemState.isNode()) - // { - // if (addedNodes.contains(uuid)) - // { - // addedNodes.remove(uuid); - // removedNodes.remove(uuid); - // } - // else - // { - // removedNodes.add(uuid); - // } - // // remove all changes after node remove - // updatedNodes.remove(uuid); - // } - // else - // { - // if (!removedNodes.contains(uuid) && !addedNodes.= contains(uuid)) - // { - // createNewOrAdd(uuid, itemState, updatedNodes); - // } - // } - // } - // } - // } - for (String uuid : updateNodes) { removedNodes.add(uuid); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-16 10:07:27 UTC (rev 672) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-16 10:13:42 UTC (rev 673) @@ -49,7 +49,7 @@ import org.exoplatform.services.jcr.impl.core.nodetype.registration.JcrNod= eTypeDataPersister; import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTy= peDataPersister; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; -import org.exoplatform.services.jcr.impl.core.query.SearchManagerImpl; +import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; @@ -94,7 +94,7 @@ = private IndexerCacheLoader loader; = - SearchManagerImpl manager; + SearchManager manager; = public void createNewDataSource(String dataSourceName) throws Exception { @@ -904,7 +904,7 @@ ConfigurationManager cfm =3D new ConfigurationManagerImpl(); = manager =3D - new SearchManagerImpl(ws.getQueryHandler(), nsReg, ntReg, itemMgr= , parentSearchManager, extractor, cfm, + new SearchManager(ws.getQueryHandler(), nsReg, ntReg, itemMgr, pa= rentSearchManager, extractor, cfm, indexSearcherHolder); } = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-16 1= 0:07:27 UTC (rev 672) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-16 1= 0:13:42 UTC (rev 673) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; @@ -28,6 +29,7 @@ import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.query.IndexException; import org.exoplatform.services.jcr.impl.core.query.QueryHandler; +import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; @@ -254,13 +256,18 @@ assertTrue(expectedRemoveUUID.containsAll(searchManager.getRemovedNo= des())); } = - private class DummySearchManager implements SearchManager + private class DummySearchManager extends SearchManager { = private Set removedNodes; = private Set addedNodes; = + public DummySearchManager() throws RepositoryException, RepositoryCo= nfigurationException + { + super(null, null, null, null, null, null, null, new RepositoryInd= exSearcherHolder()); + } + /** * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#c= reateQuery(org.exoplatform.services.jcr.impl.core.SessionImpl, org.exoplatf= orm.services.jcr.impl.core.SessionDataManager, javax.jcr.Node) */ --===============0678788222926831949==-- From do-not-reply at jboss.org Mon Nov 16 05:14:06 2009 Content-Type: multipart/mixed; boundary="===============8657614186321552552==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r674 - in kernel/trunk: exo.kernel.commons and 6 other directories. Date: Mon, 16 Nov 2009 05:14:06 -0500 Message-ID: <200911161014.nAGAE6GG028654@svn01.web.mwc.hst.phx2.redhat.com> --===============8657614186321552552== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 05:14:06 -0500 (Mon, 16 Nov 2009) New Revision: 674 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: EXOJCR-234 - version reverted to 2.2.0-Beta03-SNAPSHOT Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-16 10:13:42 UTC (rev 67= 3) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-16 10:14:06 UTC (rev 67= 4) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = exo.kernel.commons Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-16 10:13:42 UTC= (rev 673) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-16 10:14:06 UTC= (rev 674) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = exo.kernel.component.cache Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-16 10:13:42 U= TC (rev 673) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-16 10:14:06 U= TC (rev 674) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = exo.kernel.component.command Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-16 10:13:42 UT= C (rev 673) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-16 10:14:06 UT= C (rev 674) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = exo.kernel.component.common Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-16 10:13:42 UT= C (rev 673) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-16 10:14:06 UT= C (rev 674) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = exo.kernel.component.remote Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-16 10:13:42 UTC (rev = 673) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-16 10:14:06 UTC (rev = 674) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = exo.kernel.container Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2009-11-16 10:13:42 UTC (rev 673) +++ kernel/trunk/packaging/module/pom.xml 2009-11-16 10:14:06 UTC (rev 674) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = 4.0.0 Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-16 10:13:42 UTC (rev 673) +++ kernel/trunk/pom.xml 2009-11-16 10:14:06 UTC (rev 674) @@ -25,12 +25,12 @@ org.exoplatform foundation-parent - 3 + 3-SNAPSHOT = org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT pom = eXo Kernel --===============8657614186321552552==-- From do-not-reply at jboss.org Mon Nov 16 05:15:09 2009 Content-Type: multipart/mixed; boundary="===============8980831948581638325==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r675 - kernel/tags. Date: Mon, 16 Nov 2009 05:15:09 -0500 Message-ID: <200911161015.nAGAF9iI028872@svn01.web.mwc.hst.phx2.redhat.com> --===============8980831948581638325== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 05:15:09 -0500 (Mon, 16 Nov 2009) New Revision: 675 Removed: kernel/tags/2.2.0-Beta03/ Log: EXOJCR-234 2.2.0-Beta03 tag removed --===============8980831948581638325==-- From do-not-reply at jboss.org Mon Nov 16 05:23:33 2009 Content-Type: multipart/mixed; boundary="===============5168716613907476444==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r676 - in core/trunk: exo.core.component.database and 10 other directories. Date: Mon, 16 Nov 2009 05:23:33 -0500 Message-ID: <200911161023.nAGANX0e030270@svn01.web.mwc.hst.phx2.redhat.com> --===============5168716613907476444== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 05:23:32 -0500 (Mon, 16 Nov 2009) New Revision: 676 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: EXOJCR-234 - version reverted to 2.3.0-Beta03-SNAPSHOT Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2009-11-16 10:15:09 UTC = (rev 675) +++ core/trunk/exo.core.component.database/pom.xml 2009-11-16 10:23:32 UTC = (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.database Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2009-11-16 10:15:09 UTC = (rev 675) +++ core/trunk/exo.core.component.document/pom.xml 2009-11-16 10:23:32 UTC = (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.document Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-16 10:15:09 UTC (rev= 675) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-16 10:23:32 UTC (rev= 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.ldap Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-16 10:15= :09 UTC (rev 675) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-16 10:23= :32 UTC (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.organization.api Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-16 10:1= 5:09 UTC (rev 675) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-16 10:2= 3:32 UTC (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.organization.jdbc Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-16 10:1= 5:09 UTC (rev 675) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-16 10:2= 3:32 UTC (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.organization.ldap Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-16 10:15:09= UTC (rev 675) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-16 10:23:32= UTC (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.script.groovy Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-16 10:15:09= UTC (rev 675) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-16 10:23:32= UTC (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.security.core Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-16 10:15:09 UTC (= rev 675) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-16 10:23:32 UTC (= rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.web.css Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-16 10:15:0= 9 UTC (rev 675) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-16 10:23:3= 2 UTC (rev 676) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = exo.core.component.xml-processing Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2009-11-16 10:15:09 UTC (rev 675) +++ core/trunk/packaging/module/pom.xml 2009-11-16 10:23:32 UTC (rev 676) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = 4.0.0 @@ -17,13 +17,13 @@ = - org.exoplatform.coreexo= .core.component.database2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04-SNAPSHOT= - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04-SNAPSHO= T - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.database2.3.0-Beta03-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.0-Beta03-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta03-SNAPSHOT= + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta03-SNAPSHO= T + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta03-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta03-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta03-SNAPSHOT = Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-16 10:15:09 UTC (rev 675) +++ core/trunk/pom.xml 2009-11-16 10:23:32 UTC (rev 676) @@ -24,12 +24,12 @@ org.exoplatform foundation-parent - 3 + 3-SNAPSHOT = org.exoplatform.core core-parent - 2.3.0-Beta04-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT pom = eXo Core @@ -38,7 +38,7 @@ exo-core 2.3 = - 2.2.0-Beta03 + 2.2.0-Beta03-SNAPSHOT *Test*
= --===============5168716613907476444==-- From do-not-reply at jboss.org Mon Nov 16 05:27:52 2009 Content-Type: multipart/mixed; boundary="===============4783167555750452056==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r677 - core/tags. Date: Mon, 16 Nov 2009 05:27:51 -0500 Message-ID: <200911161027.nAGARp7s031672@svn01.web.mwc.hst.phx2.redhat.com> --===============4783167555750452056== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 05:27:51 -0500 (Mon, 16 Nov 2009) New Revision: 677 Removed: core/tags/2.3.0-Beta03/ Log: EXOJCR-234 2.3.0-Beta03 tag removed --===============4783167555750452056==-- From do-not-reply at jboss.org Mon Nov 16 05:31:28 2009 Content-Type: multipart/mixed; boundary="===============4953744964779519709==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r678 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Mon, 16 Nov 2009 05:31:28 -0500 Message-ID: <200911161031.nAGAVS2K032370@svn01.web.mwc.hst.phx2.redhat.com> --===============4953744964779519709== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 05:31:28 -0500 (Mon, 16 Nov 2009) New Revision: 678 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: EXOJCR-234 - version reverted to 2.1.0-Beta03-SNAPSHOT Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-16 10:27:51 UTC (rev 677) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-16 10:31:28 UTC (rev 678) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT = exo.ws.commons Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-16 10:27:51 UTC (rev 67= 7) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-16 10:31:28 UTC (rev 67= 8) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT = exo.ws.frameworks.json Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-16 10:27:51 UTC (rev= 677) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-16 10:31:28 UTC (rev= 678) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-16 10:27:51 UTC (rev 677) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-16 10:31:28 UTC (rev 678) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT = exo.ws.rest.core Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-16 10:27:51 UTC (rev 677) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-16 10:31:28 UTC (rev 678) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT = exo.ws.rest.ext Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-16 10:27:51 UTC (rev 677) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-16 10:31:28 UTC (rev 678) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT = exo.ws.testframework Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2009-11-16 10:27:51 UTC (rev 677) +++ ws/trunk/packaging/module/pom.xml 2009-11-16 10:31:28 UTC (rev 678) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT = 4.0.0 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-16 10:27:51 UTC (rev 677) +++ ws/trunk/pom.xml 2009-11-16 10:31:28 UTC (rev 678) @@ -25,12 +25,12 @@ org.exoplatform foundation-parent - 3 + 3-SNAPSHOT = org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta03-SNAPSHOT pom = eXo WS @@ -45,8 +45,8 @@ exo-ws 2.1 = - 2.2.0-Beta03 - 2.3.0-Beta03 + 2.2.0-Beta03-SNAPSHOT + 2.3.0-Beta03-SNAPSHOT = *Test*
--===============4953744964779519709==-- From do-not-reply at jboss.org Mon Nov 16 05:32:05 2009 Content-Type: multipart/mixed; boundary="===============4983366039418979978==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r679 - ws/tags. Date: Mon, 16 Nov 2009 05:32:05 -0500 Message-ID: <200911161032.nAGAW5KR032442@svn01.web.mwc.hst.phx2.redhat.com> --===============4983366039418979978== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 05:32:05 -0500 (Mon, 16 Nov 2009) New Revision: 679 Removed: ws/tags/2.1.0-Beta03/ Log: EXOJCR-234 2.1.0-Beta03 tag removed --===============4983366039418979978==-- From do-not-reply at jboss.org Mon Nov 16 05:38:24 2009 Content-Type: multipart/mixed; boundary="===============7820338202511835446==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r680 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 16 Nov 2009 05:38:24 -0500 Message-ID: <200911161038.nAGAcOo0000973@svn01.web.mwc.hst.phx2.redhat.com> --===============7820338202511835446== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-16 05:38:24 -0500 (Mon, 16 Nov 2009) New Revision: 680 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed (more detailed TODO). Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-16 10:32:05= UTC (rev 679) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-16 10:38:24= UTC (rev 680) @@ -161,11 +161,13 @@ if ( modification.getFqn().size() =3D=3D 2 && (modification.getFqn()= .get(0).equals(JBossCacheStorage.NODES) || modification.getFqn().get(0).equals(JBossCacheStorage.PROPS))) { - = + + // TODO The removed ItemData was setting to value in prepareModif= ications(); + // That is need because we do not get NodeData from DB if we dele= te property with primaytype. = + = // String identifier =3D (String) modification.getFqn().get(1); // ItemData itemData =3D jdbcConnection.getItemData(identifier); = - // TODO the removed ItemData is setting in value in prepareModifi= cations(); ItemData itemData =3D (ItemData) modification.getValue(); = if (itemData instanceof NodeData) @@ -357,7 +359,7 @@ { NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(1)); = - //TODO rainf0x + //TODO We do not throw exception if parentNodeData not = exists in DB, because we use that method (get(Fqn name)) in exists(Fqn name= ). = /*if (parentNodeData =3D=3D null) throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'.");*/ = @@ -405,7 +407,7 @@ */ public boolean exists(Fqn name) throws Exception { - // TODO do it with less cost + // TODO Will be created specialization code to checking exist node o= r property in DB without getting NodeData or PropertyData from DB. = return get(name) !=3D null; } = @@ -440,11 +442,6 @@ conn.close(); } } - else if (name.equals(Fqn.ROOT)) - { -// childs.add(JBossCacheStorage.NODES); -// childs.add(JBossCacheStorage.PROPS); - } = return (childs.size() =3D=3D 0 ? null : childs); } --===============7820338202511835446==-- From do-not-reply at jboss.org Mon Nov 16 08:33:32 2009 Content-Type: multipart/mixed; boundary="===============6284532509734127871==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r681 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session. Date: Mon, 16 Nov 2009 08:33:32 -0500 Message-ID: <200911161333.nAGDXWKY003477@svn01.web.mwc.hst.phx2.redhat.com> --===============6284532509734127871== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-16 08:33:32 -0500 (Mon, 16 Nov 2009) New Revision: 681 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/dataflow/session/SessionChangesLog.java Log: EXOJCR-221: SessionChangesLog improvement Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-16 = 10:38:24 UTC (rev 680) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-16 = 13:33:32 UTC (rev 681) @@ -61,6 +61,9 @@ protected Map> lastChildPropertyStates = =3D new HashMap>(); = + /** + * Stores persisted child nodes count. = + */ protected Map childNodesCount =3D new HashMap(); = /** @@ -146,23 +149,21 @@ index.remove(item.getData().getQPath()); index.remove(new ParentIDQPathBasedKey(item)); index.remove(new IDStateBasedKey(item.getData().getIdentifier(= ), item.getState())); + childNodesCount.remove(item.getData().getIdentifier()); + lastChildNodeStates.remove(item.getData().getIdentifier()); + lastChildPropertyStates.remove(item.getData().getIdentifier()); = if (item.isNode() && item.isPersisted()) { int childCount[] =3D childNodesCount.get(item.getData().get= ParentIdentifier()); if (childCount !=3D null) { - childNodesCount.remove(item.getData().getIdentifier()); - if (item.isDeleted()) - childCount[0]++; + ++childCount[0]; else if (item.isAdded()) - childCount[0]--; + --childCount[0]; = - if (childCount[0] =3D=3D 0) - childNodesCount.remove(item.getData().getParentIdenti= fier()); - else - childNodesCount.put(item.getData().getParentIdentifie= r(), childCount); + childNodesCount.put(item.getData().getParentIdentifier()= , childCount); } } = @@ -170,21 +171,13 @@ { Map children =3D lastChildNodeStates.get= (item.getData().getParentIdentifier()); if (children !=3D null) - { children.remove(item.getData().getIdentifier()); - if (children.size() =3D=3D 0) - lastChildNodeStates.remove(item.getData().getParentId= entifier()); - } } else { Map children =3D lastChildPropertyStates= .get(item.getData().getParentIdentifier()); if (children !=3D null) - { children.remove(item.getData().getIdentifier()); - if (children.size() =3D=3D 0) - lastChildNodeStates.remove(item.getData().getParentId= entifier()); - } } } } @@ -632,9 +625,9 @@ childCount =3D new int[1]; = if (item.isDeleted()) - childCount[0] -=3D 1; + --childCount[0]; else if (item.isAdded()) - childCount[0] +=3D 1; + ++childCount[0]; = childNodesCount.put(item.getData().getParentIdentifier(), childCo= unt); } --===============6284532509734127871==-- From do-not-reply at jboss.org Mon Nov 16 08:36:14 2009 Content-Type: multipart/mixed; boundary="===============2359331331060053552==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r682 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query and 3 other directories. Date: Mon, 16 Nov 2009 08:36:14 -0500 Message-ID: <200911161336.nAGDaE3U004053@svn01.web.mwc.hst.phx2.redhat.com> --===============2359331331060053552== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-16 08:36:14 -0500 (Mon, 16 Nov 2009) New Revision: 682 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManagerHolder.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/RepositoryContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SystemSearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-202: SearchManager added to JCR setup Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/RepositoryContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-16 13:33:32 UTC (rev 681) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-16 13:36:14 UTC (rev 682) @@ -48,7 +48,9 @@ import org.exoplatform.services.jcr.impl.core.query.QueryManagerFactory; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; +import org.exoplatform.services.jcr.impl.core.query.SystemSearchManager; +import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.JBossCacheWor= kspaceDataManager; import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; @@ -210,22 +212,19 @@ = workspaceContainer.registerComponentImplementation(StandaloneStor= agePluginProvider.class); = - //TODO remove it - if (wsConfig.getQueryHandler() !=3D null) - { - workspaceContainer.registerComponentImplementation(SearchManag= er.class); - - workspaceContainer.registerComponentImplementation(QueryManage= r.class); - workspaceContainer.registerComponentImplementation(QueryManage= rFactory.class); - workspaceContainer.registerComponentInstance(wsConfig.getQuery= Handler()); - } - try { Class containerType =3D Class.forName(wsConfig.getContainer= ().getType()); workspaceContainer.registerComponentImplementation(containerTy= pe); + // TODO hardcoded SearchManagerHolder will by puted to JBossWo= rkspaceDataContainer = + //constructor, and injected to IndexerCacheLoader, and later S= earchManager will be inserted to this holder, + //so IndexerCacheLoader will use it. + //registerComponentInstance(new SearchManagerHolder()); + // workspaceContainer.registerComponentImplementation(SearchMa= nagerHolder.class); + workspaceContainer.registerComponentInstance(new SearchManager= Holder()); if (isSystem) { + //registerComponentInstance(new SearchManagerHolder()); registerComponentInstance(new SystemDataContainerHolder((Wo= rkspaceDataContainer)workspaceContainer .getComponentInstanceOfType(WorkspaceDataContainer.class= ))); } @@ -283,10 +282,10 @@ workspaceContainer.registerComponentImplementation(QueryManage= r.class); workspaceContainer.registerComponentImplementation(QueryManage= rFactory.class); workspaceContainer.registerComponentInstance(wsConfig.getQuery= Handler()); - // TODO if (isSystem) - // { - // workspaceContainer.registerComponentImplement= ation(SystemSearchManager.class); - // } + if (isSystem) + { + workspaceContainer.registerComponentImplementation(SystemSe= archManager.class); + } } = // access manager @@ -519,13 +518,13 @@ String systemWsname =3D config.getSystemWorkspaceName(); WorkspaceEntry systemWsEntry =3D getWorkspaceEntry(systemWsname); = - // TODO if (systemWsEntry !=3D null && systemWsEntry.getQueryHan= dler() !=3D null) - // { - // SystemSearchManager systemSearchManager =3D - // (SystemSearchManager)getWorkspaceContainer(systemWsnam= e).getComponentInstanceOfType( - // SystemSearchManager.class); - // registerComponentInstance(new SystemSearchManagerHolder(s= ystemSearchManager)); - // } + if (systemWsEntry !=3D null && systemWsEntry.getQueryHandler() !=3D = null) + { + SystemSearchManager systemSearchManager =3D + (SystemSearchManager)getWorkspaceContainer(systemWsname).getCo= mponentInstanceOfType( + SystemSearchManager.class); + registerComponentInstance(new SystemSearchManagerHolder(systemSea= rchManager)); + } = try { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-16 13:33:32 UTC (rev = 681) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-16 13:36:14 UTC (rev = 682) @@ -161,9 +161,11 @@ * if the search manager cannot be initialized * @throws RepositoryConfigurationException */ + public SearchManager(QueryHandlerEntry config, NamespaceRegistryImpl ns= Reg, NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, - DocumentReaderService extractor, ConfigurationManager cfm, final Rep= ositoryIndexSearcherHolder indexSearcherHolder) + DocumentReaderService extractor, ConfigurationManager cfm, + final RepositoryIndexSearcherHolder indexSearcherHolder, final Searc= hManagerHolder searchManagerHolder) throws RepositoryException, RepositoryConfigurationException { = @@ -177,6 +179,7 @@ this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; itemMgr.addItemPersistenceListener(this); + searchManagerHolder.put(this); } = /** @@ -242,6 +245,9 @@ = public void onSaveItems(ItemStateChangesLog changesLog) { + Exception es =3D new Exception(); + es.printStackTrace(); + if (handler =3D=3D null) return; = Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/query/SearchManagerHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerHolder.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerHolder.java 2009-11-16 13:36:14 UTC= (rev 682) @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.core.query; + +import org.jboss.cache.factories.annotations.NonVolatile; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author Karpenko Sergiy = + * @version $Id: SearchManagerHolder.java 111 2008-11-11 11:11:11Z serg $ + */ +(a)NonVolatile +public class SearchManagerHolder +{ + protected SearchManager manager; + + public SearchManagerHolder() + { + } + + public void put(SearchManager manager) + { + this.manager =3D manager; + } + + public SearchManager get() + { + return manager; + } +} Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SystemSearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-16 13:33:32 UTC= (rev 681) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-16 13:36:14 UTC= (rev 682) @@ -64,9 +64,10 @@ = public SystemSearchManager(QueryHandlerEntry config, NamespaceRegistryI= mpl nsReg, NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, DocumentReaderService servic= e, ConfigurationManager cfm, - RepositoryIndexSearcherHolder indexSearcherHolder) throws Repository= Exception, RepositoryConfigurationException + RepositoryIndexSearcherHolder indexSearcherHolder, SearchManagerHold= er holder) throws RepositoryException, + RepositoryConfigurationException { - super(config, nsReg, ntReg, itemMgr, null, service, cfm, indexSearch= erHolder); + super(config, nsReg, ntReg, itemMgr, null, service, cfm, indexSearch= erHolder, holder); } = @Override Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-16 1= 3:33:32 UTC (rev 681) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-16 1= 3:36:14 UTC (rev 682) @@ -17,7 +17,7 @@ package org.exoplatform.services.jcr.impl.core.query.cacheloader; = import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= age; import org.exoplatform.services.log.ExoLogger; @@ -47,16 +47,16 @@ */ private static final Log log =3D ExoLogger.getLogger(IndexerCacheLoader= .class); = - SearchManager searchManager =3D null; + SearchManagerHolder searchManagerHolder =3D null; = public IndexerCacheLoader() { } = @Inject - public void injectDependencies(SearchManager manager) + public void injectDependencies(SearchManagerHolder holder) { - searchManager =3D manager; + searchManagerHolder =3D holder; } = private String parseUUID(Fqn fqn) @@ -85,8 +85,10 @@ @Override public void put(List modifications) throws Exception { - if (searchManager =3D=3D null) + if (searchManagerHolder =3D=3D null && searchManagerHolder.get() != =3D null) + { return; + } = // nodes that need to be removed from the index. final Set removedNodes =3D new HashSet(); @@ -217,7 +219,7 @@ addedNodes.add(uuid); } = - searchManager.updateIndex(removedNodes, addedNodes); + searchManagerHolder.get().updateIndex(removedNodes, addedNodes); = } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-16 13:33:32 UTC (rev 681) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-16 13:36:14 UTC (rev 682) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import org.exoplatform.services.jbosscache.JBossCacheService; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBas= e; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; @@ -78,8 +78,9 @@ * */ public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, Reposi= toryEntry repConfig, - InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider) - throws RepositoryConfigurationException, NamingException, Repository= Exception, IOException + InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider, + SearchManagerHolder searchManagerHolder) throws RepositoryConfigurat= ionException, NamingException, + RepositoryException, IOException { this.repositoryName =3D repConfig.getName(); this.containerName =3D wsConfig.getName(); @@ -111,6 +112,9 @@ ((CacheSPI)cache).getComponentRegistry().regis= terComponent(this.persistentContainer, WorkspaceDataContainer.class); = + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(searchManagerHolder, + SearchManagerHolder.class); + // TODO check lifecycle, might be we have to create in start(), with= jdbc start. = // initializes configuration state, the root node, etc. this.cache.create(); @@ -129,6 +133,7 @@ = public void start() { + // TODO started on init, due to RepositoryContainer logic // if (persistentContainer instanceof Startable) // { Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-16 13:33:32 UTC (rev 681) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-16 13:36:14 UTC (rev 682) @@ -50,6 +50,7 @@ import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTy= peDataPersister; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; @@ -96,6 +97,8 @@ = SearchManager manager; = + SearchManagerHolder holder; + public void createNewDataSource(String dataSourceName) throws Exception { = @@ -123,7 +126,7 @@ initPersistence(); = loader =3D new IndexerCacheLoader(); - loader.injectDependencies(manager); + loader.injectDependencies(holder); = initJCRRoot(); = @@ -857,6 +860,8 @@ = protected void initPersistence() throws Exception { + holder =3D new SearchManagerHolder(); + // Create WorkspaceEntry ContainerEntry containerEntry =3D new ContainerEntry(); List params =3D new ArrayList(); @@ -905,7 +910,7 @@ = manager =3D new SearchManager(ws.getQueryHandler(), nsReg, ntReg, itemMgr, pa= rentSearchManager, extractor, cfm, - indexSearcherHolder); + indexSearcherHolder, holder); } = @Override Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-16 1= 3:33:32 UTC (rev 681) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-16 1= 3:36:14 UTC (rev 682) @@ -31,6 +31,7 @@ import org.exoplatform.services.jcr.impl.core.query.QueryHandler; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; @@ -59,6 +60,8 @@ = private DummySearchManager searchManager; = + private SearchManagerHolder holder; + /** * @see junit.framework.TestCase#setUp() */ @@ -67,9 +70,11 @@ { // TODO Auto-generated method stub super.setUp(); + holder =3D new SearchManagerHolder(); + indexerCacheLoader =3D new IndexerCacheLoader(); + indexerCacheLoader.injectDependencies(holder); searchManager =3D new DummySearchManager(); - indexerCacheLoader =3D new IndexerCacheLoader(); - indexerCacheLoader.injectDependencies(searchManager); + } = /** @@ -265,7 +270,7 @@ = public DummySearchManager() throws RepositoryException, RepositoryCo= nfigurationException { - super(null, null, null, null, null, null, null, new RepositoryInd= exSearcherHolder()); + super(null, null, null, null, null, null, null, new RepositoryInd= exSearcherHolder(), holder); } = /** --===============2359331331060053552==-- From do-not-reply at jboss.org Mon Nov 16 09:16:42 2009 Content-Type: multipart/mixed; boundary="===============8830908554299983444==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r683 - core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap. Date: Mon, 16 Nov 2009 09:16:42 -0500 Message-ID: <200911161416.nAGEGgnt010803@svn01.web.mwc.hst.phx2.redhat.com> --===============8830908554299983444== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-16 09:16:42 -0500 (Mon, 16 Nov 2009) New Revision: 683 Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exopla= tform/services/organization/ldap/LDAPUserPageList.java Log: EXOJCR-244 exc.printStackTrace() replaced with log.warning Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org= /exoplatform/services/organization/ldap/LDAPUserPageList.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exopl= atform/services/organization/ldap/LDAPUserPageList.java 2009-11-16 13:36:14= UTC (rev 682) +++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exopl= atform/services/organization/ldap/LDAPUserPageList.java 2009-11-16 14:16:42= UTC (rev 683) @@ -20,6 +20,8 @@ = import org.exoplatform.commons.utils.PageList; import org.exoplatform.services.ldap.LDAPService; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; import org.exoplatform.services.organization.User; = import java.util.ArrayList; @@ -52,6 +54,8 @@ private LDAPService ldapService; = private LDAPAttributeMapping ldapAttrMapping; + = + private static Log logger =3D ExoLogger.getLogger(LDAPUserPageList.clas= s); = = static boolean SEARCH_CONTROL =3D Control.NONCRITICAL; = @@ -68,14 +72,14 @@ int size =3D this.getResultSize(); setAvailablePage(size); } - catch (NameNotFoundException exp) + catch (NameNotFoundException e) { - exp.printStackTrace(); + logger.warn("Cannot set the page size while creating a LDAPUserPa= geList, no page size will be used", e); setAvailablePage(0); } - catch (OperationNotSupportedException exp) + catch (OperationNotSupportedException e) { - exp.printStackTrace(); + logger.warn("Cannot set the page size while creating a LDAPUserPa= geList, no page size will be used", e); setAvailablePage(0); } } --===============8830908554299983444==-- From do-not-reply at jboss.org Mon Nov 16 09:23:56 2009 Content-Type: multipart/mixed; boundary="===============5664950286442918141==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r684 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 16 Nov 2009 09:23:56 -0500 Message-ID: <200911161423.nAGENufK011805@svn01.web.mwc.hst.phx2.redhat.com> --===============5664950286442918141== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-16 09:23:56 -0500 (Mon, 16 Nov 2009) New Revision: 684 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : Clean JDBCCacheLoader Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-16 14:16:42= UTC (rev 683) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-16 14:23:56= UTC (rev 684) @@ -177,11 +177,6 @@ } } = - private boolean isNodeData(Fqn fqn) - { - return fqn.toString().startsWith("/" +JBossCacheStorage.NODES); - } - = /** * Performs ADD to NodeData and PropertyData. * @param modification --===============5664950286442918141==-- From do-not-reply at jboss.org Mon Nov 16 10:13:26 2009 Content-Type: multipart/mixed; boundary="===============4575455459520011850==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r685 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone. Date: Mon, 16 Nov 2009 10:13:25 -0500 Message-ID: <200911161513.nAGFDPO1020048@svn01.web.mwc.hst.phx2.redhat.com> --===============4575455459520011850== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-16 10:13:25 -0500 (Mon, 16 Nov 2009) New Revision: 685 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config.xml Log: EXOJCR-202: config updated - IndexerCacheLoader conf added Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-exoloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-16 14:23:56 UTC (rev 684) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-16 15:13:25 UTC (rev 685) @@ -1,78 +1,84 @@ - - - - - - - - = - - - - = - - = - - - - - - - - - - - - - - - - - - - = - - - = - - - - = - = - - - - = - - = - - - + + + + + + + + = + + + + = + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + + + + + = + = + + + + = + + = + + + Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jcr-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-16 14:23:56 UTC (rev 684) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-16 15:13:25 UTC (rev 685) @@ -1,393 +1,393 @@ - - - - - - exo-domain - - - 1h - org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - exo-domain - - - 1h - org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 15m - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + exo-domain + + + 1h + org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + exo-domain + + + 1h + org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15m + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --===============4575455459520011850==-- From do-not-reply at jboss.org Mon Nov 16 10:30:08 2009 Content-Type: multipart/mixed; boundary="===============8810951881541395145==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r686 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core: nodetype and 1 other directories. Date: Mon, 16 Nov 2009 10:30:08 -0500 Message-ID: <200911161530.nAGFU8DC022059@svn01.web.mwc.hst.phx2.redhat.com> --===============8810951881541395145== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-16 10:30:08 -0500 (Mon, 16 Nov 2009) New Revision: 686 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/ItemImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/NodeImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/nodetype/ItemAutocreator.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/query/QueryImpl.java Log: EXOJCR-221: ItemAutocreator improvement: dont check exists child items for = new added node Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/ItemImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-16 15:13:25 UTC (rev 685) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-16 15:30:08 UTC (rev 686) @@ -123,7 +123,6 @@ = this.session =3D session; this.data =3D data; - this.location =3D session.getLocationFactory().createJCRPath(data.ge= tQPath()); = this.dataManager =3D session.getTransientNodesManager(); this.locationFactory =3D session.getLocationFactory(); Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-16 15:13:25 UTC (rev 685) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-16 15:30:08 UTC (rev 686) @@ -585,7 +585,7 @@ dataManager.update(state, false); = NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeType= sHolder(); - ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager); + ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager, false); = PlainChangesLog changes =3D itemAutocreator.makeAutoCreatedItems(nodeData(), type.getName(), = dataManager, session.getUserID()); @@ -2604,7 +2604,7 @@ NodeImpl node =3D (NodeImpl)dataManager.update(state, true); = NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeType= sHolder(); - ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager); + ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager, true); = PlainChangesLog changes =3D itemAutocreator.makeAutoCreatedItems(node.nodeData(), primaryType= Name, dataManager, session.getUserID()); Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/nodetype/ItemAutocreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/nodetype/ItemAutocreator.java 2009-11-16 15:13= :25 UTC (rev 685) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/nodetype/ItemAutocreator.java 2009-11-16 15:30= :08 UTC (rev 686) @@ -69,16 +69,19 @@ = private final ValueFactory valueFactory; = + private final boolean avoidCheckExistedChildItems; + /** * @param nodeTypeDataManager */ public ItemAutocreator(NodeTypeDataManager nodeTypeDataManager, ValueFa= ctory valueFactory, - ItemDataConsumer dataConsumer) + ItemDataConsumer dataConsumer, boolean avoidCheckExistedChildItems) { super(); this.nodeTypeDataManager =3D nodeTypeDataManager; this.valueFactory =3D valueFactory; this.dataConsumer =3D dataConsumer; + this.avoidCheckExistedChildItems =3D avoidCheckExistedChildItems; } = public PlainChangesLog makeAutoCreatedItems(final NodeData parent, fina= l InternalQName nodeTypeName, @@ -113,7 +116,9 @@ { if (ndef.isAutoCreated()) { - final ItemData pdata =3D targetDataManager.getItemData(parent,= new QPathEntry(ndef.getName(), 0)); + final ItemData pdata =3D + avoidCheckExistedChildItems ? null : targetDataManager.getI= temData(parent, new QPathEntry( + ndef.getName(), 0)); if (pdata =3D=3D null && !addedNodes.contains(ndef.getName()) = || pdata !=3D null && !pdata.isNode()) { = @@ -156,7 +161,9 @@ if (pdef.isAutoCreated()) { = - final ItemData pdata =3D targetDataManager.getItemData(parent,= new QPathEntry(pdef.getName(), 0)); + final ItemData pdata =3D + avoidCheckExistedChildItems ? null : targetDataManager.getI= temData(parent, new QPathEntry( + pdef.getName(), 0)); if (pdata =3D=3D null && !addedProperties.contains(pdef.getNam= e()) || pdata !=3D null && pdata.isNode()) { = Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-11-= 16 15:13:25 UTC (rev 685) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-11-= 16 15:30:08 UTC (rev 686) @@ -638,7 +638,7 @@ final boolean recipientsMixVersionable =3D isNodeType(Constants.MIX_= VERSIONABLE, recipienAllNodeTypeNames); final boolean ancestorIsMixVersionable =3D isNodeType(Constants.MIX_= VERSIONABLE, ancestorAllNodeTypeNames); = - ItemAutocreator itemAutocreator =3D new ItemAutocreator(this, valueF= actory, dataManager); + ItemAutocreator itemAutocreator =3D new ItemAutocreator(this, valueF= actory, dataManager, false); if (recipientsMixVersionable && !ancestorIsMixVersionable) { = @@ -838,7 +838,8 @@ = volatileNodeTypeDataManager.registerVolatileNodeTypes(volatileNodeTy= pes); = - ItemAutocreator itemAutocreator =3D new ItemAutocreator(volatileNode= TypeDataManager, valueFactory, dataManager); + ItemAutocreator itemAutocreator =3D + new ItemAutocreator(volatileNodeTypeDataManager, valueFactory, da= taManager, false); = final Set nodes =3D this.indexSearcherHolder.getNodesByNodeT= ype(recipientDefinition.getName()); // check add mix:versionable super Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/query/QueryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/query/QueryImpl.java 2009-11-16 15:13:25 UTC (= rev 685) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/query/QueryImpl.java 2009-11-16 15:30:08 UTC (= rev 686) @@ -16,7 +16,6 @@ */ package org.exoplatform.services.jcr.impl.core.query; = - import java.text.NumberFormat; = import javax.jcr.ItemExistsException; @@ -56,298 +55,302 @@ /** * Provides the default implementation for a JCR query. */ -public class QueryImpl extends AbstractQueryImpl { +public class QueryImpl extends AbstractQueryImpl +{ = - /** - * The logger instance for this class - */ - private static final Logger log =3D LoggerFactory.getLogger(QueryImpl.= class); + /** + * The logger instance for this class + */ + private static final Logger log =3D LoggerFactory.getLogger(QueryImpl.c= lass); = - /** - * A string constant representing the JCR-SQL2 query language. - * - * @since JCR 2.0 - * TODO: REMOVE WHEN JSR 283 IS FINAL!! - */ - public static final String JCR_SQL2 =3D "JCR-SQL2"; + /** + * A string constant representing the JCR-SQL2 query language. + * + * @since JCR 2.0 + * TODO: REMOVE WHEN JSR 283 IS FINAL!! + */ + public static final String JCR_SQL2 =3D "JCR-SQL2"; = - /** - * A string constant representing the JCR-JQOM query language. - * - * @since JCR 2.0 - * TODO: REMOVE WHEN JSR 283 IS FINAL!! - */ - public static final String JCR_JQOM =3D "JCR-JQOM"; + /** + * A string constant representing the JCR-JQOM query language. + * + * @since JCR 2.0 + * TODO: REMOVE WHEN JSR 283 IS FINAL!! + */ + public static final String JCR_JQOM =3D "JCR-JQOM"; = - /** - * The session of the user executing this query - */ - protected SessionImpl session; + /** + * The session of the user executing this query + */ + protected SessionImpl session; = - /** - * The query statement - */ - protected String statement; + /** + * The query statement + */ + protected String statement; = - /** - * The syntax of the query statement - */ - protected String language; + /** + * The syntax of the query statement + */ + protected String language; = - /** - * The actual query implementation that can be executed - */ - protected ExecutableQuery query; + /** + * The actual query implementation that can be executed + */ + protected ExecutableQuery query; = - /** - * The node where this query is persisted. Only set when this is a per= sisted - * query. - */ - protected Node node; + /** + * The node where this query is persisted. Only set when this is a pers= isted + * query. + */ + protected Node node; = - /** - * The query handler for this query. - */ - protected QueryHandler handler; + /** + * The query handler for this query. + */ + protected QueryHandler handler; = - /** - * Flag indicating whether this query is initialized. - */ - private boolean initialized =3D false; + /** + * Flag indicating whether this query is initialized. + */ + private boolean initialized =3D false; = - /** - * The maximum result size - */ - private long limit; + /** + * The maximum result size + */ + private long limit; = - /** - * The offset in the total result set - */ - private long offset; + /** + * The offset in the total result set + */ + private long offset; = - /** - * @inheritDoc - */ - public void init(SessionImpl session, - SessionDataManager itemMgr, - QueryHandler handler, - String statement, - String language) throws InvalidQueryException { - checkNotInitialized(); - this.session =3D session; - this.statement =3D statement; - this.language =3D language; - this.handler =3D handler; - this.query =3D handler.createExecutableQuery(session, itemMgr, sta= tement, language); - setInitialized(); - } + /** + * @inheritDoc + */ + public void init(SessionImpl session, SessionDataManager itemMgr, Query= Handler handler, String statement, + String language) throws InvalidQueryException + { + checkNotInitialized(); + this.session =3D session; + this.statement =3D statement; + this.language =3D language; + this.handler =3D handler; + this.query =3D handler.createExecutableQuery(session, itemMgr, state= ment, language); + setInitialized(); + } = - /** - * @inheritDoc - */ - public void init(SessionImpl session, - SessionDataManager itemMgr, - QueryHandler handler, - Node node) - throws InvalidQueryException, RepositoryException { - checkNotInitialized(); - this.session =3D session; - this.node =3D node; - this.handler =3D handler; + /** + * @inheritDoc + */ + public void init(SessionImpl session, SessionDataManager itemMgr, Query= Handler handler, Node node) + throws InvalidQueryException, RepositoryException + { + checkNotInitialized(); + this.session =3D session; + this.node =3D node; + this.handler =3D handler; = - if (!((ExtendedNode)node).isNodeType(Constants.NT_QUERY)){ - throw new InvalidQueryException("node is not of type nt:query"= ); - } - statement =3D node.getProperty("jcr:statement").getString(); - language =3D node.getProperty("jcr:language").getString(); - query =3D handler.createExecutableQuery(session, itemMgr, statemen= t, language); - setInitialized(); - } + if (!((ExtendedNode)node).isNodeType(Constants.NT_QUERY)) + { + throw new InvalidQueryException("node is not of type nt:query"); + } + statement =3D node.getProperty("jcr:statement").getString(); + language =3D node.getProperty("jcr:language").getString(); + query =3D handler.createExecutableQuery(session, itemMgr, statement,= language); + setInitialized(); + } = -// /** -// * @inheritDoc -// *

-// * Throws an {@link UnsupportedOperationException}. -// */ -// public void init(SessionImpl session, -// Sess itemMgr, -// QueryHandler handler, -// QueryObjectModelTree qomTree, -// String language) -// throws InvalidQueryException, RepositoryException { -// throw new UnsupportedOperationException("not a prepared query"); -// } + // /** + // * @inheritDoc + // *

+ // * Throws an {@link UnsupportedOperationException}. + // */ + // public void init(SessionImpl session, + // Sess itemMgr, + // QueryHandler handler, + // QueryObjectModelTree qomTree, + // String language) + // throws InvalidQueryException, RepositoryException { + // throw new UnsupportedOperationException("not a prepared query= "); + // } = - /** - * This method simply forwards the execute call to the - * {@link ExecutableQuery} object returned by - * {@link QueryHandler#createExecutableQuery}. - * {@inheritDoc} - */ - public QueryResult execute() throws RepositoryException { - checkInitialized(); - long time =3D System.currentTimeMillis(); - QueryResult result =3D query.execute(offset, limit); - if (log.isDebugEnabled()) { - time =3D System.currentTimeMillis() - time; - NumberFormat format =3D NumberFormat.getNumberInstance(); - format.setMinimumFractionDigits(2); - format.setMaximumFractionDigits(2); - String seconds =3D format.format((double) time / 1000); - log.debug("executed in " + seconds + " s. (" + statement + ")"= ); - } - return result; - } + /** + * This method simply forwards the execute call to the + * {@link ExecutableQuery} object returned by + * {@link QueryHandler#createExecutableQuery}. + * {@inheritDoc} + */ + public QueryResult execute() throws RepositoryException + { + checkInitialized(); + long time =3D System.currentTimeMillis(); + QueryResult result =3D query.execute(offset, limit); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + NumberFormat format =3D NumberFormat.getNumberInstance(); + format.setMinimumFractionDigits(2); + format.setMaximumFractionDigits(2); + String seconds =3D format.format((double)time / 1000); + log.debug("executed in " + seconds + " s. (" + statement + ")"); + } + return result; + } = - /** - * {@inheritDoc} - */ - public String getStatement() { - checkInitialized(); - return statement; - } + /** + * {@inheritDoc} + */ + public String getStatement() + { + checkInitialized(); + return statement; + } = - /** - * {@inheritDoc} - */ - public String getLanguage() { - checkInitialized(); - return language; - } + /** + * {@inheritDoc} + */ + public String getLanguage() + { + checkInitialized(); + return language; + } = - /** - * {@inheritDoc} - */ - public String getStoredQueryPath() - throws ItemNotFoundException, RepositoryException { - checkInitialized(); - if (node =3D=3D null) { - throw new ItemNotFoundException("not a persistent query"); - } - return node.getPath(); - } + /** + * {@inheritDoc} + */ + public String getStoredQueryPath() throws ItemNotFoundException, Reposi= toryException + { + checkInitialized(); + if (node =3D=3D null) + { + throw new ItemNotFoundException("not a persistent query"); + } + return node.getPath(); + } = - /** - * {@inheritDoc} - */ - public Node storeAsNode(String absPath) - throws ItemExistsException, - PathNotFoundException, - VersionException, - ConstraintViolationException, - LockException, - UnsupportedRepositoryOperationException, - RepositoryException { + /** + * {@inheritDoc} + */ + public Node storeAsNode(String absPath) throws ItemExistsException, Pat= hNotFoundException, VersionException, + ConstraintViolationException, LockException, UnsupportedRepositoryOp= erationException, RepositoryException + { = - checkInitialized(); - JCRPath path =3D session.getLocationFactory().parseAbsPath(absPath); - QPath qpath =3D path.getInternalPath(); - NodeImpl parent =3D (NodeImpl)session.getTransientNodesManager().ge= tItem(qpath.makeParentPath(), false); - if (parent =3D=3D null) - throw new PathNotFoundException("Parent not found for " + path.g= etAsString(false)); + checkInitialized(); + JCRPath path =3D session.getLocationFactory().parseAbsPath(absPath); + QPath qpath =3D path.getInternalPath(); + NodeImpl parent =3D (NodeImpl)session.getTransientNodesManager().get= Item(qpath.makeParentPath(), false); + if (parent =3D=3D null) + throw new PathNotFoundException("Parent not found for " + path.ge= tAsString(false)); = - // validate as on parent child node - parent.validateChildNode(qpath.getName(), Constants.NT_QUERY); + // validate as on parent child node + parent.validateChildNode(qpath.getName(), Constants.NT_QUERY); = - NodeData queryData =3D - TransientNodeData.createNodeData((NodeData)parent.getData(), qpa= th.getName(), Constants.NT_QUERY); - NodeImpl queryNode =3D - (NodeImpl)session.getTransientNodesManager().update(ItemState.cr= eateAddedState(queryData), false); + NodeData queryData =3D + TransientNodeData.createNodeData((NodeData)parent.getData(), qpat= h.getName(), Constants.NT_QUERY); + NodeImpl queryNode =3D + (NodeImpl)session.getTransientNodesManager().update(ItemState.cre= ateAddedState(queryData), false); = - NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeTyp= esHolder(); + NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeType= sHolder(); = - ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, = session.getValueFactory(),session.getTransientNodesManager()); + ItemAutocreator itemAutocreator =3D + new ItemAutocreator(ntmanager, session.getValueFactory(), session= .getTransientNodesManager(), false); = - PlainChangesLog changes =3D - itemAutocreator.makeAutoCreatedItems((NodeData)queryNode.getData= (), Constants.NT_QUERY, session - .getTransientNodesManager(), session.getUserID()); + PlainChangesLog changes =3D + itemAutocreator.makeAutoCreatedItems((NodeData)queryNode.getData(= ), Constants.NT_QUERY, session + .getTransientNodesManager(), session.getUserID()); = - for (ItemState autoCreatedState : changes.getAllStates()) - { - session.getTransientNodesManager().update(autoCreatedState, fals= e); - } - // queryNode.addAutoCreatedItems(Constants.NT_QUERY); - // set properties - TransientValueData value =3D new TransientValueData(language); - TransientPropertyData jcrLanguage =3D - TransientPropertyData.createPropertyData(queryData, Constants.JC= R_LANGUAGE, PropertyType.STRING, false, value); - session.getTransientNodesManager().update(ItemState.createAddedStat= e(jcrLanguage), false); + for (ItemState autoCreatedState : changes.getAllStates()) + { + session.getTransientNodesManager().update(autoCreatedState, false= ); + } + // queryNode.addAutoCreatedItems(Constants.NT_QUERY); + // set properties + TransientValueData value =3D new TransientValueData(language); + TransientPropertyData jcrLanguage =3D + TransientPropertyData.createPropertyData(queryData, Constants.JCR= _LANGUAGE, PropertyType.STRING, false, value); + session.getTransientNodesManager().update(ItemState.createAddedState= (jcrLanguage), false); = - value =3D new TransientValueData(statement); - TransientPropertyData jcrStatement =3D - TransientPropertyData - .createPropertyData(queryData, Constants.JCR_STATEMENT, Prope= rtyType.STRING, false, value); - session.getTransientNodesManager().update(ItemState.createAddedStat= e(jcrStatement), false); + value =3D new TransientValueData(statement); + TransientPropertyData jcrStatement =3D + TransientPropertyData + .createPropertyData(queryData, Constants.JCR_STATEMENT, Proper= tyType.STRING, false, value); + session.getTransientNodesManager().update(ItemState.createAddedState= (jcrStatement), false); = - // NOTE: for save stored node need save() on parent or on session (= 6.6.10 - // The Query Object) - node =3D queryNode; - return node; - } + // NOTE: for save stored node need save() on parent or on session (6= .6.10 + // The Query Object) + node =3D queryNode; + return node; + } = - /** - * Binds the given value to the variable named - * varName. - * - * @param varName name of variable in query - * @param value value to bind - * @throws IllegalArgumentException if varName is no= t a - * valid variable in this query. - * @throws javax.jcr.RepositoryException if an error occurs. - */ - public void bindValue(String varName, Value value) - throws IllegalArgumentException, RepositoryException { - checkInitialized(); - query.bindValue(session.getLocationFactory().parseJCRName(varName)= .getInternalName(), value); - } + /** + * Binds the given value to the variable named + * varName. + * + * @param varName name of variable in query + * @param value value to bind + * @throws IllegalArgumentException if varName is not= a + * valid variable in this query. + * @throws javax.jcr.RepositoryException if an error occurs. + */ + public void bindValue(String varName, Value value) throws IllegalArgume= ntException, RepositoryException + { + checkInitialized(); + query.bindValue(session.getLocationFactory().parseJCRName(varName).g= etInternalName(), value); + } = - /** - * Sets the maximum size of the result set. - * - * @param limit new maximum size of the result set - */ - public void setLimit(long limit) { - this.limit =3D limit; - } + /** + * Sets the maximum size of the result set. + * + * @param limit new maximum size of the result set + */ + public void setLimit(long limit) + { + this.limit =3D limit; + } = - /** - * Sets the start offset of the result set. - * - * @param offset new start offset of the result set - */ - public void setOffset(long offset) { - this.offset =3D offset; - } + /** + * Sets the start offset of the result set. + * + * @param offset new start offset of the result set + */ + public void setOffset(long offset) + { + this.offset =3D offset; + } = - //-----------------------------< internal >---------------------------= ------ + //-----------------------------< internal >----------------------------= ----- = - /** - * Sets the initialized flag. - */ - protected void setInitialized() { - initialized =3D true; - } + /** + * Sets the initialized flag. + */ + protected void setInitialized() + { + initialized =3D true; + } = - /** - * Checks if this query is not yet initialized and throws an - * IllegalStateException if it is already initialized. - */ - protected void checkNotInitialized() { - if (initialized) { - throw new IllegalStateException("already initialized"); - } - } + /** + * Checks if this query is not yet initialized and throws an + * IllegalStateException if it is already initialized. + */ + protected void checkNotInitialized() + { + if (initialized) + { + throw new IllegalStateException("already initialized"); + } + } = - /** - * Checks if this query is initialized and throws an - * IllegalStateException if it is not yet initialized. - */ - protected void checkInitialized() { - if (!initialized) { - throw new IllegalStateException("not initialized"); - } - } + /** + * Checks if this query is initialized and throws an + * IllegalStateException if it is not yet initialized. + */ + protected void checkInitialized() + { + if (!initialized) + { + throw new IllegalStateException("not initialized"); + } + } = - = } - --===============8810951881541395145==-- From do-not-reply at jboss.org Mon Nov 16 11:32:37 2009 Content-Type: multipart/mixed; boundary="===============4082170426908131272==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r687 - parent/trunk. Date: Mon, 16 Nov 2009 11:32:37 -0500 Message-ID: <200911161632.nAGGWbFJ001136@svn01.web.mwc.hst.phx2.redhat.com> --===============4082170426908131272== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:32:37 -0500 (Mon, 16 Nov 2009) New Revision: 687 Modified: parent/trunk/pom.xml Log: [maven-release-plugin] prepare release 3 Modified: parent/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- parent/trunk/pom.xml 2009-11-16 15:30:08 UTC (rev 686) +++ parent/trunk/pom.xml 2009-11-16 16:32:37 UTC (rev 687) @@ -1,621 +1,621 @@ - - - 4.0.0 - - org.jboss - jboss-parent - 5-beta-1 - - org.exoplatform - foundation-parent - 3-SNAPSHOT - pom - - eXo JBoss Parent - - - eXo Platform SAS - http://www.exoplatform.com - - = - - - LGPL, version 2.1 - http://www.opensource.org/licenses/lgpl-license.php - - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/tr= unk - scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/trunk - http://fisheye.jboss.org/browse/exo-jcr/parent/trunk - - - - - - repository.jboss.com - http://repository.jboss.com/maven2 - - - exo-int - exoplatform.org internal repository - http://maven2.exoplatform.org/rest/maven2 - - - repo.jfrog.org-releases - repo.jfrog.org-releases - http://repo.jfrog.org/artifactory/plugins-releases-local - - - download.java.net - download.java.net repository - http://download.java.net/maven/2 - - - - - repository.jboss.com - http://repository.jboss.com/maven2 - - - exo-int - exoplatform.org internal repository - http://maven2.exoplatform.org/rest/maven2 - - - repo.jfrog.org-releases - repo.jfrog.org-releases - http://repo.jfrog.org/artifactory/plugins-releases-local - - - download.java.net - download.java.net repository - http://download.java.net/maven/2 - - - - mc-release - Local Maven repository of releases - http://mc-repo.googlecode.com/svn/maven2/releases - - - - - D:/java - ${exo.projects.directory.base}/= exo-dependencies - ${exo.projects.directory.base}/exo-w= orking - - ${exo.projects.directory.dependencies}/re= pository - = - tomcat-6.0.16 - jboss-4.2.3.GA - JONAS_4_8_5 - = - 1.2.0 - = - eXo Platform - N/A - - - false - once - false - true - Test* - = - - true - 1.5 - 1.5 - = - - - - UTF-8 - = - - 2.2-beta-4 - 1.0-beta-3 - 2.3 - 2.3 - 2.0.2 - 2.3.2 - 1.0-beta-1 - 2.3 - 2.2 - 2.5 - 2.6 - 0.1 - 1.2.1 - 2.1.2 - 2.0-beta-9 - 2.0.1 - 2.4.3 - 2.4.3 - 2.3 - 2.1-beta-1 - - - - - - - junit - junit - 3.8.2 - - - - - - install - - - - org.apache.maven.plugins - maven-clean-plugin - ${clean.plugin.version} - - - - org.apache.maven.plugins - maven-compiler-plugin - ${compiler.plugin.version} - - - org.apache.maven.plugins - maven-enforcer-plugin - ${enforcer.plugin.version} - - - org.apache.maven.plugins - maven-install-plugin - ${install.plugin.version} - - - org.apache.maven.plugins - maven-jar-plugin - ${jar.plugin.version} - - - ${maven.compiler.source} - ${maven.compiler.target} - = - - - - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specification= } - ${project.organization.name}= - ${project.name} - ${project.version} - ${project.organization.name= } - - - - - - org.apache.maven.plugins - maven-release-plugin - ${release.plugin.version} - - - false - -Prelease -Dmaven.test.skip=3Dtrue - true = = - - - - org.apache.maven.plugins - maven-site-plugin - ${site.plugin.version} - - - org.apache.maven.plugins - maven-source-plugin - = - - - true - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire.plugin.version} - - - **/${exo.test.includes}.java - - - - - org.apache.maven.plugins - maven-war-plugin - ${war.plugin.version} - - - - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specification= } - ${project.organization.name}= - ${project.name} - ${project.version} - ${project.organization.name= } - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - ${buildnumber.plugin.version} - - - org.codehaus.mojo - javacc-maven-plugin - ${javacc.plugin.version} - - - org.jibx - maven-jibx-plugin - ${jibx.plugin.version} - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - ${jaxb2.plugin.version} - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.plugin.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc.plugin.version} - - - org.codehaus.mojo - taglist-maven-plugin - ${taglist.plugin.version} - - - org.apache.maven.plugins - maven-ear-plugin - ${ear.plugin.version} - - - org.apache.maven.plugins - maven-assembly-plugin - ${assembly.plugin.version} - - - - - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${project.info.reports.plugin.version} - - - org.apache.maven.plugins - maven-javadoc-plugin - ${javadoc.plugin.version} - - true - ${project.build.directory}/javadoc - 512m - 256m - - - - org.apache.maven.plugins - maven-surefire-report-plugin - ${surefire.report.plugin.version} - - - org.codehaus.mojo - taglist-maven-plugin - ${taglist.plugin.version} - - - = - - - - checkstyle - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.plugin.version} - - - org.exoplatform.tool - dev-resources - ${exo.dev.resources.version} - - - - - verify - - check - - - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle.plugin.version} - - warning - checkstyle/codestyle.xml - checkstyle/java.header - - - - - - - release - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - ${buildNumber} - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specificat= ion} - ${project.organization.na= me} - ${project.name} - ${project.version} - ${project.organization.n= ame} - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - ${buildNumber} - ${project.scm.connection} - ${exo.product.name} - ${exo.product.specificat= ion} - ${project.organization.na= me} - ${project.name} - ${project.version} - ${project.organization.n= ame} - - - - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - - - validate - - create - - - - - false - false - - - - - - - tomcat-server - - - tomcat - - false - - - - jboss-server - - - jboss-server - - false - - - - jonas-server - - - jonas-server - - false - - - - jmeter-perftest - - - jmeter-perftest - - false - - - - - - emma - - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - emma.coverage.out.file - target/emma/coverage.ec - - - - - - - - - maven-antrun-plugin - - - emma1 - test-compile - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - run - - - - - - emma - emma - 2.0.5312 - - - emma - emma_ant - 2.0.5312 - - - - - - - - emma - emma - 2.0.5312 - test - - - - - + + + 4.0.0 + + org.jboss + jboss-parent + 5-beta-1 + + org.exoplatform + foundation-parent + 3 + pom + + eXo JBoss Parent + + + eXo Platform SAS + http://www.exoplatform.com + + = + + + LGPL, version 2.1 + http://www.opensource.org/licenses/lgpl-license.php + + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/ta= gs/3 + scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/tags/3 + http://fisheye.jboss.org/browse/exo-jcr/parent/tags/3 + + + + + + repository.jboss.com + http://repository.jboss.com/maven2 + + + exo-int + exoplatform.org internal repository + http://maven2.exoplatform.org/rest/maven2 + + + repo.jfrog.org-releases + repo.jfrog.org-releases + http://repo.jfrog.org/artifactory/plugins-releases-local + + + download.java.net + download.java.net repository + http://download.java.net/maven/2 + + + + + repository.jboss.com + http://repository.jboss.com/maven2 + + + exo-int + exoplatform.org internal repository + http://maven2.exoplatform.org/rest/maven2 + + + repo.jfrog.org-releases + repo.jfrog.org-releases + http://repo.jfrog.org/artifactory/plugins-releases-local + + + download.java.net + download.java.net repository + http://download.java.net/maven/2 + + + + mc-release + Local Maven repository of releases + http://mc-repo.googlecode.com/svn/maven2/releases + + + + + D:/java + ${exo.projects.directory.base}/= exo-dependencies + ${exo.projects.directory.base}/exo-w= orking + + ${exo.projects.directory.dependencies}/re= pository + = + tomcat-6.0.16 + jboss-4.2.3.GA + JONAS_4_8_5 + = + 1.2.0 + = + eXo Platform + N/A + + + false + once + false + true + Test* + = + + true + 1.5 + 1.5 + = + + + + UTF-8 + = + + 2.2-beta-4 + 1.0-beta-3 + 2.3 + 2.3 + 2.0.2 + 2.3.2 + 1.0-beta-1 + 2.3 + 2.2 + 2.5 + 2.6 + 0.1 + 1.2.1 + 2.1.2 + 2.0-beta-9 + 2.0.1 + 2.4.3 + 2.4.3 + 2.3 + 2.1-beta-1 + + + + + + + junit + junit + 3.8.2 + + + + + + install + + + + org.apache.maven.plugins + maven-clean-plugin + ${clean.plugin.version} + + + + org.apache.maven.plugins + maven-compiler-plugin + ${compiler.plugin.version} + + + org.apache.maven.plugins + maven-enforcer-plugin + ${enforcer.plugin.version} + + + org.apache.maven.plugins + maven-install-plugin + ${install.plugin.version} + + + org.apache.maven.plugins + maven-jar-plugin + ${jar.plugin.version} + + + ${maven.compiler.source} + ${maven.compiler.target} + = + + + + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specification= } + ${project.organization.name}= + ${project.name} + ${project.version} + ${project.organization.name= } + + + + + + org.apache.maven.plugins + maven-release-plugin + ${release.plugin.version} + + + false + -Prelease -Dmaven.test.skip=3Dtrue + true = = + + + + org.apache.maven.plugins + maven-site-plugin + ${site.plugin.version} + + + org.apache.maven.plugins + maven-source-plugin + = + + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.plugin.version} + + + **/${exo.test.includes}.java + + + + + org.apache.maven.plugins + maven-war-plugin + ${war.plugin.version} + + + + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specification= } + ${project.organization.name}= + ${project.name} + ${project.version} + ${project.organization.name= } + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + ${buildnumber.plugin.version} + + + org.codehaus.mojo + javacc-maven-plugin + ${javacc.plugin.version} + + + org.jibx + maven-jibx-plugin + ${jibx.plugin.version} + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + ${jaxb2.plugin.version} + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + + org.codehaus.mojo + taglist-maven-plugin + ${taglist.plugin.version} + + + org.apache.maven.plugins + maven-ear-plugin + ${ear.plugin.version} + + + org.apache.maven.plugins + maven-assembly-plugin + ${assembly.plugin.version} + + + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + ${project.info.reports.plugin.version} + + + org.apache.maven.plugins + maven-javadoc-plugin + ${javadoc.plugin.version} + + true + ${project.build.directory}/javadoc + 512m + 256m + + + + org.apache.maven.plugins + maven-surefire-report-plugin + ${surefire.report.plugin.version} + + + org.codehaus.mojo + taglist-maven-plugin + ${taglist.plugin.version} + + + = + + + + checkstyle + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + + org.exoplatform.tool + dev-resources + ${exo.dev.resources.version} + + + + + verify + + check + + + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle.plugin.version} + + warning + checkstyle/codestyle.xml + checkstyle/java.header + + + + + + + release + + + + + + org.apache.maven.plugins + maven-war-plugin + + + + ${buildNumber} + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specificat= ion} + ${project.organization.na= me} + ${project.name} + ${project.version} + ${project.organization.n= ame} + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + ${buildNumber} + ${project.scm.connection} + ${exo.product.name} + ${exo.product.specificat= ion} + ${project.organization.na= me} + ${project.name} + ${project.version} + ${project.organization.n= ame} + + + + + + + + + org.codehaus.mojo + buildnumber-maven-plugin + + + validate + + create + + + + + false + false + + + + + + + tomcat-server + + + tomcat + + false + + + + jboss-server + + + jboss-server + + false + + + + jonas-server + + + jonas-server + + false + + + + jmeter-perftest + + + jmeter-perftest + + false + + + + + + emma + + true + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + emma.coverage.out.file + target/emma/coverage.ec + + + + + + + + + maven-antrun-plugin + + + emma1 + test-compile + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + + emma + emma + 2.0.5312 + + + emma + emma_ant + 2.0.5312 + + + + + + + + emma + emma + 2.0.5312 + test + + + + + --===============4082170426908131272==-- From do-not-reply at jboss.org Mon Nov 16 11:33:00 2009 Content-Type: multipart/mixed; boundary="===============4460669963446508831==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r688 - parent/tags. Date: Mon, 16 Nov 2009 11:33:00 -0500 Message-ID: <200911161633.nAGGX0eN001174@svn01.web.mwc.hst.phx2.redhat.com> --===============4460669963446508831== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:33:00 -0500 (Mon, 16 Nov 2009) New Revision: 688 Added: parent/tags/3/ Log: [maven-scm] copy for tag 3 Copied: parent/tags/3 (from rev 687, parent/trunk) --===============4460669963446508831==-- From do-not-reply at jboss.org Mon Nov 16 11:33:09 2009 Content-Type: multipart/mixed; boundary="===============2471511203420681047==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r689 - parent/trunk. Date: Mon, 16 Nov 2009 11:33:09 -0500 Message-ID: <200911161633.nAGGX9RA001203@svn01.web.mwc.hst.phx2.redhat.com> --===============2471511203420681047== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:33:09 -0500 (Mon, 16 Nov 2009) New Revision: 689 Modified: parent/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: parent/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- parent/trunk/pom.xml 2009-11-16 16:33:00 UTC (rev 688) +++ parent/trunk/pom.xml 2009-11-16 16:33:09 UTC (rev 689) @@ -27,7 +27,7 @@ org.exoplatform foundation-parent - 3 + 4-SNAPSHOT pom = eXo JBoss Parent @@ -45,9 +45,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/ta= gs/3 - scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/tags/3 - http://fisheye.jboss.org/browse/exo-jcr/parent/tags/3 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/parent/tr= unk + scm:svn:https://svn.jboss.org/repos/exo-jcr/par= ent/trunk + http://fisheye.jboss.org/browse/exo-jcr/parent/trunk = --===============2471511203420681047==-- From do-not-reply at jboss.org Mon Nov 16 11:38:37 2009 Content-Type: multipart/mixed; boundary="===============6668966590089827006==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r690 - kernel/trunk. Date: Mon, 16 Nov 2009 11:38:37 -0500 Message-ID: <200911161638.nAGGcbKI002746@svn01.web.mwc.hst.phx2.redhat.com> --===============6668966590089827006== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:38:37 -0500 (Mon, 16 Nov 2009) New Revision: 690 Modified: kernel/trunk/pom.xml Log: EXOJCR-234: parent deps Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-16 16:33:09 UTC (rev 689) +++ kernel/trunk/pom.xml 2009-11-16 16:38:37 UTC (rev 690) @@ -25,7 +25,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.kernel --===============6668966590089827006==-- From do-not-reply at jboss.org Mon Nov 16 11:40:29 2009 Content-Type: multipart/mixed; boundary="===============0742219305638439529==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r691 - in kernel/trunk: exo.kernel.commons and 6 other directories. Date: Mon, 16 Nov 2009 11:40:28 -0500 Message-ID: <200911161640.nAGGeSCo003352@svn01.web.mwc.hst.phx2.redhat.com> --===============0742219305638439529== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:40:28 -0500 (Mon, 16 Nov 2009) New Revision: 691 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.2.0-Beta03 Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-16 16:38:37 UTC (rev 69= 0) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-16 16:40:28 UTC (rev 69= 1) @@ -1,67 +1,67 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.commons - - eXo Kernel :: Commons Utils - eXo Commons - - - - commons-lang - commons-lang - - - - xpp3 - xpp3 - - - - commons-logging - commons-logging - - - - org.slf4j - slf4j-api - - - - org.slf4j - slf4j-log4j12 - - - - log4j - log4j - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.commons + + eXo Kernel :: Commons Utils + eXo Commons + + + + commons-lang + commons-lang + + + + xpp3 + xpp3 + + + + commons-logging + commons-logging + + + + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-log4j12 + + + + log4j + log4j + + + Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-16 16:38:37 UTC= (rev 690) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-16 16:40:28 UTC= (rev 691) @@ -1,51 +1,51 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.cache - - eXo Kernel :: Component :: Cache Service - exoplatform Cache services implementation - - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.kernel - exo.kernel.component.remote - - - org.exoplatform.kernel - exo.kernel.component.common - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.cache + + eXo Kernel :: Component :: Cache Service + exoplatform Cache services implementation + + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.component.remote + + + org.exoplatform.kernel + exo.kernel.component.common + + + + Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-16 16:38:37 U= TC (rev 690) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-16 16:40:28 U= TC (rev 691) @@ -1,54 +1,54 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.command - - eXo Kernel :: Component :: Command Service - exoplatform command services implementation - - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - commons-chain - commons-chain - - - xml-apis - xml-apis - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.command + + eXo Kernel :: Component :: Command Service + exoplatform command services implementation + + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + commons-chain + commons-chain + + + xml-apis + xml-apis + + + + + Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-16 16:38:37 UT= C (rev 690) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-16 16:40:28 UT= C (rev 691) @@ -1,84 +1,84 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.common - - eXo Kernel :: Component :: Common Service - exoplatform common services implementation - - - - org.exoplatform.kernel - exo.kernel.container - - - - javax.activation - activation - - - - jotm - jotm - - - javax.resource - connector - - - log4j - log4j - - - - - - javax.resource - connector-api - provided - - - - quartz - quartz - - - - javax.mail - mail - - - - javax.transaction - jta - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.common + + eXo Kernel :: Component :: Common Service + exoplatform common services implementation + + + + org.exoplatform.kernel + exo.kernel.container + + + + javax.activation + activation + + + + jotm + jotm + + + javax.resource + connector + + + log4j + log4j + + + + + + javax.resource + connector-api + provided + + + + quartz + quartz + + + + javax.mail + mail + + + + javax.transaction + jta + + + + Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-16 16:38:37 UT= C (rev 690) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-16 16:40:28 UT= C (rev 691) @@ -1,47 +1,47 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.component.remote - - eXo Kernel :: Component :: Remote Service - exoplatform remote services implementation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - jgroups - jgroups - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.component.remote + + eXo Kernel :: Component :: Remote Service + exoplatform remote services implementation + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + jgroups + jgroups + + + Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-16 16:38:37 UTC (rev = 690) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-16 16:40:28 UTC (rev = 691) @@ -1,122 +1,122 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - exo.kernel.container - - eXo Kernel :: Container - eXo Kernel Container - = - - - org.exoplatform.kernel - exo.kernel.commons - - - - org.exoplatform.tool - exo.tool.framework.junit - compile - - - - javax.servlet - servlet-api - - - - picocontainer - picocontainer - - - - commons-beanutils - commons-beanutils - - - - org.jibx - jibx-run - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-bind - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-extras - - - - - - - org.jibx - maven-jibx-plugin - - src/main/resources - - binding.xml - - - - - - bind - - - - - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + exo.kernel.container + + eXo Kernel :: Container + eXo Kernel Container + = + + + org.exoplatform.kernel + exo.kernel.commons + + + + org.exoplatform.tool + exo.tool.framework.junit + compile + + + + javax.servlet + servlet-api + + + + picocontainer + picocontainer + + + + commons-beanutils + commons-beanutils + + + + org.jibx + jibx-run + + + org.codehaus.woodstox + wstx-asl + + + + + + org.jibx + jibx-bind + + + org.codehaus.woodstox + wstx-asl + + + + + + org.jibx + jibx-extras + + + + + + + org.jibx + maven-jibx-plugin + + src/main/resources + + binding.xml + + + + + + bind + + + + + + + + + Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2009-11-16 16:38:37 UTC (rev 690) +++ kernel/trunk/packaging/module/pom.xml 2009-11-16 16:40:28 UTC (rev 691) @@ -1,66 +1,66 @@ - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - - - 4.0.0 - kernel.packaging.module - pom - eXo Kernel Build module - - - kernel - module - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = - + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + + + 4.0.0 + kernel.packaging.module + pom + eXo Kernel Build module + + + kernel + module + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = + Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-16 16:38:37 UTC (rev 690) +++ kernel/trunk/pom.xml 2009-11-16 16:40:28 UTC (rev 691) @@ -1,224 +1,224 @@ - - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta03-SNAPSHOT - pom - - eXo Kernel - - - exo-kernel - 2.2 - always - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk - http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk - - - - exo.kernel.container - exo.kernel.commons - exo.kernel.component.common - exo.kernel.component.remote - exo.kernel.component.cache - exo.kernel.component.command - packaging/module - - - - - - - org.exoplatform.kernel - exo.kernel.container - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.commons - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.component.common - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.component.remote - ${project.version} - - - - org.exoplatform.tool - exo.tool.framework.junit - 1.2.0 - - - - commons-lang - commons-lang - 2.3 - - - - commons-chain - commons-chain - 1.0 - - - - xpp3 - xpp3 - 1.1.3.4.O - - - - commons-logging - commons-logging - 1.0.4 - - - - jgroups - jgroups - 2.6.10.GA - - - - org.slf4j - slf4j-api - 1.5.6 - - - - org.slf4j - slf4j-log4j12 - 1.5.6 - - - - log4j - log4j - 1.2.14 - - - - picocontainer - picocontainer - 1.1 - - - - commons-beanutils - commons-beanutils - 1.6 - - - - org.jibx - jibx-run - ${jibx.plugin.version} - - - - org.jibx - jibx-bind - ${jibx.plugin.version} - - - - org.jibx - jibx-extras - ${jibx.plugin.version} - - - - javax.activation - activation - 1.1 - - - - javax.resource - connector-api - 1.5 - - - - jotm - jotm - 2.0.10 - - - - quartz - quartz - 1.5.0-RC2 - - - - javax.mail - mail - 1.4 - - - - javax.servlet - servlet-api - 2.5 - provided - - - - javax.transaction - jta - 1.0.1B - - - - - - - junit - junit - test - - - - + + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta03 + pom + + eXo Kernel + + + exo-kernel + 2.2 + always + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.0-Beta03 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.0-Beta03 + http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.0-Beta0= 3 + + + + exo.kernel.container + exo.kernel.commons + exo.kernel.component.common + exo.kernel.component.remote + exo.kernel.component.cache + exo.kernel.component.command + packaging/module + + + + + + + org.exoplatform.kernel + exo.kernel.container + ${project.version} + + + + org.exoplatform.kernel + exo.kernel.commons + ${project.version} + + + + org.exoplatform.kernel + exo.kernel.component.common + ${project.version} + + + + org.exoplatform.kernel + exo.kernel.component.remote + ${project.version} + + + + org.exoplatform.tool + exo.tool.framework.junit + 1.2.0 + + + + commons-lang + commons-lang + 2.3 + + + + commons-chain + commons-chain + 1.0 + + + + xpp3 + xpp3 + 1.1.3.4.O + + + + commons-logging + commons-logging + 1.0.4 + + + + jgroups + jgroups + 2.6.10.GA + + + + org.slf4j + slf4j-api + 1.5.6 + + + + org.slf4j + slf4j-log4j12 + 1.5.6 + + + + log4j + log4j + 1.2.14 + + + + picocontainer + picocontainer + 1.1 + + + + commons-beanutils + commons-beanutils + 1.6 + + + + org.jibx + jibx-run + ${jibx.plugin.version} + + + + org.jibx + jibx-bind + ${jibx.plugin.version} + + + + org.jibx + jibx-extras + ${jibx.plugin.version} + + + + javax.activation + activation + 1.1 + + + + javax.resource + connector-api + 1.5 + + + + jotm + jotm + 2.0.10 + + + + quartz + quartz + 1.5.0-RC2 + + + + javax.mail + mail + 1.4 + + + + javax.servlet + servlet-api + 2.5 + provided + + + + javax.transaction + jta + 1.0.1B + + + + + + + junit + junit + test + + + + --===============0742219305638439529==-- From do-not-reply at jboss.org Mon Nov 16 11:40:53 2009 Content-Type: multipart/mixed; boundary="===============7783488610219375796==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r692 - kernel/tags. Date: Mon, 16 Nov 2009 11:40:53 -0500 Message-ID: <200911161640.nAGGerfl003438@svn01.web.mwc.hst.phx2.redhat.com> --===============7783488610219375796== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:40:53 -0500 (Mon, 16 Nov 2009) New Revision: 692 Added: kernel/tags/2.2.0-Beta03/ Log: [maven-scm] copy for tag 2.2.0-Beta03 Copied: kernel/tags/2.2.0-Beta03 (from rev 691, kernel/trunk) --===============7783488610219375796==-- From do-not-reply at jboss.org Mon Nov 16 11:41:12 2009 Content-Type: multipart/mixed; boundary="===============2177509116362200809==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r693 - in kernel/trunk: exo.kernel.commons and 6 other directories. Date: Mon, 16 Nov 2009 11:41:12 -0500 Message-ID: <200911161641.nAGGfCBG003504@svn01.web.mwc.hst.phx2.redhat.com> --===============2177509116362200809== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:41:12 -0500 (Mon, 16 Nov 2009) New Revision: 693 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-16 16:40:53 UTC (rev 69= 2) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-16 16:41:12 UTC (rev 69= 3) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.commons Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-16 16:40:53 UTC= (rev 692) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-16 16:41:12 UTC= (rev 693) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.cache Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-16 16:40:53 U= TC (rev 692) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-16 16:41:12 U= TC (rev 693) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.command Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-16 16:40:53 UT= C (rev 692) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-16 16:41:12 UT= C (rev 693) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.common Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-16 16:40:53 UT= C (rev 692) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-16 16:41:12 UT= C (rev 693) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.remote Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-16 16:40:53 UTC (rev = 692) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-16 16:41:12 UTC (rev = 693) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = exo.kernel.container Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2009-11-16 16:40:53 UTC (rev 692) +++ kernel/trunk/packaging/module/pom.xml 2009-11-16 16:41:12 UTC (rev 693) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT = 4.0.0 Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-16 16:40:53 UTC (rev 692) +++ kernel/trunk/pom.xml 2009-11-16 16:41:12 UTC (rev 693) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.0-Beta03 + 2.2.0-Beta04-SNAPSHOT pom = eXo Kernel @@ -42,9 +42,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.0-Beta03 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.0-Beta03 - http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.0-Beta0= 3 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk + http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk = --===============2177509116362200809==-- From do-not-reply at jboss.org Mon Nov 16 11:43:23 2009 Content-Type: multipart/mixed; boundary="===============8064118754940337290==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r694 - core/trunk. Date: Mon, 16 Nov 2009 11:43:23 -0500 Message-ID: <200911161643.nAGGhN7E004582@svn01.web.mwc.hst.phx2.redhat.com> --===============8064118754940337290== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:43:23 -0500 (Mon, 16 Nov 2009) New Revision: 694 Modified: core/trunk/pom.xml Log: EXOJCR-234: parent dependency Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-16 16:41:12 UTC (rev 693) +++ core/trunk/pom.xml 2009-11-16 16:43:23 UTC (rev 694) @@ -24,7 +24,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.core --===============8064118754940337290==-- From do-not-reply at jboss.org Mon Nov 16 11:46:00 2009 Content-Type: multipart/mixed; boundary="===============5924758521528368142==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r695 - core/trunk. Date: Mon, 16 Nov 2009 11:46:00 -0500 Message-ID: <200911161646.nAGGk0Na005203@svn01.web.mwc.hst.phx2.redhat.com> --===============5924758521528368142== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:46:00 -0500 (Mon, 16 Nov 2009) New Revision: 695 Modified: core/trunk/pom.xml Log: EXOJCR-234: dependency on Kernel 2.2.0-Beta03 Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-16 16:43:23 UTC (rev 694) +++ core/trunk/pom.xml 2009-11-16 16:46:00 UTC (rev 695) @@ -38,7 +38,7 @@ exo-core 2.3 = - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta03 *Test* = --===============5924758521528368142==-- From do-not-reply at jboss.org Mon Nov 16 11:48:46 2009 Content-Type: multipart/mixed; boundary="===============6465762531356325682==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r696 - in core/trunk: exo.core.component.database and 10 other directories. Date: Mon, 16 Nov 2009 11:48:46 -0500 Message-ID: <200911161648.nAGGmkUh005718@svn01.web.mwc.hst.phx2.redhat.com> --===============6465762531356325682== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:48:46 -0500 (Mon, 16 Nov 2009) New Revision: 696 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.3.0-Beta03 Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2009-11-16 16:46:00 UTC = (rev 695) +++ core/trunk/exo.core.component.database/pom.xml 2009-11-16 16:48:46 UTC = (rev 696) @@ -1,146 +1,146 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.database - - eXo Core :: Component :: Database Service - exoplatform database services implementation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - - javax.resource - connector-api - test - - - - hsqldb - hsqldb - runtime - - - - com.experlog - xapool - - - - c3p0 - c3p0 - runtime - - - - commons-dbcp - commons-dbcp - provided - - - - org.hibernate - hibernate-core - - - org.slf4j - slf4j-api - - = - - - - xdoclet - xdoclet-hibernate-module - - - - xdoclet - xdoclet - - - - xdoclet - xdoclet-xdoclet-module - - - - xdoclet - xjavadoc - - - - commons-collections - commons-collections - runtime - - = - - javassist - javassist - - - - org.hibernate - hibernate-annotations - - - org.slf4j - slf4j-api - - = - - = - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/DBCreatorTest.java - - - - = - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.database + + eXo Core :: Component :: Database Service + exoplatform database services implementation + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + + javax.resource + connector-api + test + + + + hsqldb + hsqldb + runtime + + + + com.experlog + xapool + + + + c3p0 + c3p0 + runtime + + + + commons-dbcp + commons-dbcp + provided + + + + org.hibernate + hibernate-core + + + org.slf4j + slf4j-api + + = + + + + xdoclet + xdoclet-hibernate-module + + + + xdoclet + xdoclet + + + + xdoclet + xdoclet-xdoclet-module + + + + xdoclet + xjavadoc + + + + commons-collections + commons-collections + runtime + + = + + javassist + javassist + + + + org.hibernate + hibernate-annotations + + + org.slf4j + slf4j-api + + = + + = + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/DBCreatorTest.java + + + + = + + + Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2009-11-16 16:46:00 UTC = (rev 695) +++ core/trunk/exo.core.component.document/pom.xml 2009-11-16 16:48:46 UTC = (rev 696) @@ -1,104 +1,104 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.document - - eXo Core :: Component :: Demo Service - eXo demo service Impl - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - pdfbox - pdfbox - - - - com.lowagie - itext - - - - org.htmlparser - htmlparser - - - - org.apache.poi - poi - - - log4j - log4j - - - - - - org.apache.poi - poi-scratchpad - - - log4j - log4j - - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.drl - **/*.vm - **/*.doc - **/*.dot - **/*.xls - **/*.ppt - **/*.txt - **/*.tiff - **/*.pdf - **/*.odt - **/*.html - **/*.msg - **/*.pst - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.document + + eXo Core :: Component :: Demo Service + eXo demo service Impl + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + pdfbox + pdfbox + + + + com.lowagie + itext + + + + org.htmlparser + htmlparser + + + + org.apache.poi + poi + + + log4j + log4j + + + + + + org.apache.poi + poi-scratchpad + + + log4j + log4j + + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.drl + **/*.vm + **/*.doc + **/*.dot + **/*.xls + **/*.ppt + **/*.txt + **/*.tiff + **/*.pdf + **/*.odt + **/*.html + **/*.msg + **/*.pst + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-16 16:46:00 UTC (rev= 695) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-16 16:48:46 UTC (rev= 696) @@ -1,66 +1,66 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.ldap - - eXo Core :: Component :: LDAP Service - eXo LDAP impl - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - com.novell.ldap - jldap - test - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - - - - = - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.ldap + + eXo Core :: Component :: LDAP Service + eXo LDAP impl + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + com.novell.ldap + jldap + test + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + + + + = + + + Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-16 16:46= :00 UTC (rev 695) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-16 16:48= :46 UTC (rev 696) @@ -1,133 +1,133 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.organization.api - - eXo Core :: Component :: Organization Service API - eXo Organization Service API - - - - org.exoplatform.kernel - exo.kernel.container - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - - org.exoplatform.core - exo.core.component.security.core - - - - javax.ejb - ejb - - - - xdoclet - xdoclet-hibernate-module - - - - xdoclet - xdoclet - - - - xdoclet - xdoclet-xdoclet-module - - - - xdoclet - xjavadoc - - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - compile - - - - - - - - - - - - - - - - - run - - - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.organization.api + + eXo Core :: Component :: Organization Service API + eXo Organization Service API + + + + org.exoplatform.kernel + exo.kernel.container + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + + org.exoplatform.core + exo.core.component.security.core + + + + javax.ejb + ejb + + + + xdoclet + xdoclet-hibernate-module + + + + xdoclet + xdoclet + + + + xdoclet + xdoclet-xdoclet-module + + + + xdoclet + xjavadoc + + + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + compile + + + + + + + + + + + + + + + + + run + + + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-16 16:4= 6:00 UTC (rev 695) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-16 16:4= 8:46 UTC (rev 696) @@ -1,89 +1,89 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.organization.jdbc - - eXo Core :: Component :: Organization Service JDBC - eXo Organization Service JDBC - - - - org.exoplatform.core - exo.core.component.database - - - - org.exoplatform.core - exo.core.component.organization.api - - - - javax.resource - connector-api - test - - - - com.microsoft - sqljdbc - test - - - - com.ibm.db2 - db2jcc - test - - - - com.ibm.db2 - db2jcc_license_cu - test - - - - oracle - ojdbc - test - - - - postgresql - postgresql - test - - - - mysql - mysql-connector-java - test - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.organization.jdbc + + eXo Core :: Component :: Organization Service JDBC + eXo Organization Service JDBC + + + + org.exoplatform.core + exo.core.component.database + + + + org.exoplatform.core + exo.core.component.organization.api + + + + javax.resource + connector-api + test + + + + com.microsoft + sqljdbc + test + + + + com.ibm.db2 + db2jcc + test + + + + com.ibm.db2 + db2jcc_license_cu + test + + + + oracle + ojdbc + test + + + + postgresql + postgresql + test + + + + mysql + mysql-connector-java + test + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-16 16:4= 6:00 UTC (rev 695) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-16 16:4= 8:46 UTC (rev 696) @@ -1,66 +1,66 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.organization.ldap - - eXo Core :: Component :: Organization Service LDAP - eXo Organization Service LDAP - - - - org.exoplatform.core - exo.core.component.ldap - - - org.exoplatform.core - exo.core.component.organization.api - - - org.exoplatform.core - exo.core.component.organization.jdbc - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestOrganizationService.java - - - - = - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.organization.ldap + + eXo Core :: Component :: Organization Service LDAP + eXo Organization Service LDAP + + + + org.exoplatform.core + exo.core.component.ldap + + + org.exoplatform.core + exo.core.component.organization.api + + + org.exoplatform.core + exo.core.component.organization.jdbc + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestOrganizationService.java + + + + = + + \ No newline at end of file Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-16 16:46:00= UTC (rev 695) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-16 16:48:46= UTC (rev 696) @@ -1,46 +1,46 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.script.groovy - - eXo Core :: Component :: Groovy Scripts Instantiator - Load and compile Groovy script - - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.codehaus.groovy - groovy-all - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.script.groovy + + eXo Core :: Component :: Groovy Scripts Instantiator + Load and compile Groovy script + + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.codehaus.groovy + groovy-all + + \ No newline at end of file Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-16 16:46:00= UTC (rev 695) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-16 16:48:46= UTC (rev 696) @@ -1,62 +1,62 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.security.core - - eXo Core :: Component :: Security Service - eXo Security - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.security.core + + eXo Core :: Component :: Security Service + eXo Security + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-16 16:46:00 UTC (= rev 695) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-16 16:48:46 UTC (= rev 696) @@ -1,53 +1,53 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.web.css - - eXo Core :: Component :: Web CSS - Stylesheet engine - - - - org.w3c - sac - - - - batik - batik-util - - - - batik - batik-css - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.web.css + + eXo Core :: Component :: Web CSS + Stylesheet engine + + + + org.w3c + sac + + + + batik + batik-util + + + + batik + batik-css + + + + Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-16 16:46:0= 0 UTC (rev 695) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-16 16:48:4= 6 UTC (rev 696) @@ -1,103 +1,103 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - exo.core.component.xml-processing - - eXo Core :: Component :: XML Processing Service - eXo XML Processing Services - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - jtidy - jtidy - - - - xml-resolver - xml-resolver - - - - - - - src/main/java - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - src/main/resources - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - src/test/java - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + exo.core.component.xml-processing + + eXo Core :: Component :: XML Processing Service + eXo XML Processing Services + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + jtidy + jtidy + + + + xml-resolver + xml-resolver + + + + + + + src/main/java + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + src/main/resources + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + src/test/java + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + \ No newline at end of file Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2009-11-16 16:46:00 UTC (rev 695) +++ core/trunk/packaging/module/pom.xml 2009-11-16 16:48:46 UTC (rev 696) @@ -1,77 +1,77 @@ - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - - - 4.0.0 - core.packaging.module - pom - eXo Core Build module - - - core - module - - - - - org.exoplatform.coreexo= .core.component.database2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta03-SNAPSHOT= - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta03-SNAPSHO= T - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta03-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta03-SNAPSHOT - - = - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + + + 4.0.0 + core.packaging.module + pom + eXo Core Build module + + + core + module + + + + + org.exoplatform.coreexo= .core.component.database2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.document2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta03<= /dependency> + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta03 + + = + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = = \ No newline at end of file Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-16 16:46:00 UTC (rev 695) +++ core/trunk/pom.xml 2009-11-16 16:48:46 UTC (rev 696) @@ -1,396 +1,396 @@ - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.core - core-parent - 2.3.0-Beta03-SNAPSHOT - pom - - eXo Core - - - exo-core - 2.3 - = - 2.2.0-Beta03 - *Test* - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk - http://fisheye.jboss.org/browse/exo-jcr/core/trunk - - - - exo.core.component.security.core - exo.core.component.database - exo.core.component.document - exo.core.component.ldap - exo.core.component.organization.api - exo.core.component.organization.jdbc - exo.core.component.organization.ldap - exo.core.component.xml-processing - exo.core.component.script.groovy - exo.core.component.web.css - packaging/module - - - - - = - - org.exoplatform.core - exo.core.component.security.core - ${project.version} - - - - org.exoplatform.core - exo.core.component.database - ${project.version} - - - - org.exoplatform.core - exo.core.component.ldap - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.api - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.jdbc - ${project.version} - - = - - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} - - - - org.exoplatform.kernel - exo.kernel.container - ${org.exoplatform.kernel.version} - - - - org.exoplatform.kernel - exo.kernel.component.cache - ${org.exoplatform.kernel.version} - - - - javax.resource - connector-api - 1.5 - - - - hsqldb - hsqldb - 1.8.0.7 - - - - com.experlog - xapool - 1.5.0 - - - - c3p0 - c3p0 - 0.9.1.2 - - - - commons-dbcp - commons-dbcp - 1.2.2 - - - - org.hibernate - hibernate-core - 3.3.1.GA - - - - xdoclet - xdoclet-hibernate-module - 1.2.3 - - - - xdoclet - xdoclet - 1.2.3 - - - - xdoclet - xdoclet-xdoclet-module - 1.2 - - - - xdoclet - xjavadoc - 1.0.3 - - - - commons-collections - commons-collections - 3.1 - - - - pdfbox - pdfbox - 0.7.3 - compile - - - - com.lowagie - itext - 2.1.0 - compile - - - - org.htmlparser - htmlparser - 1.6 - compile - - - com.sun - tools - - - - - - org.apache.poi - poi - 3.0.2-FINAL - - - - org.apache.poi - poi-scratchpad - 3.0.2-FINAL - - - - com.novell.ldap - jldap - 4.3 - - - - javax.ejb - ejb - 2.1 - - - - xdoclet - xdoclet-hibernate-module - 1.2.3 - compile - - - - xdoclet - xdoclet - 1.2.3 - - - - xdoclet - xdoclet-xdoclet-module - 1.2 - - - - xdoclet - xjavadoc - 1.0.3 - - - - javax.resource - connector-api - 1.5 - - - - com.microsoft - sqljdbc - 1.1.1501 - - - - com.ibm.db2 - db2jcc - 9.1 - - - - com.ibm.db2 - db2jcc_license_cu - 9.1 - - - - oracle - ojdbc - 1.4 - - - - postgresql - postgresql - 8.3-603.jdbc3 - - - - mysql - mysql-connector-java - 5.0.8 - - - - org.codehaus.groovy - groovy-all - 1.6.5 - - - - org.w3c - sac - 1.3 - - - - batik - batik-util - 1.7 - - - - batik - batik-css - 1.7 - - - - jtidy - jtidy - 4aug2000r7-dev - - - - xml-resolver - xml-resolver - 1.1 - - - - commons-logging - commons-logging - 1.1 - - - - javassist - javassist - 3.4.GA - - = - - org.hibernate - hibernate-annotations - 3.4.0.GA - - - - - - - - junit - junit - test - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - always - - **/*$* - **/DBCreatorTest.java - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - - - - - - - + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.core + core-parent + 2.3.0-Beta03 + pom + + eXo Core + + + exo-core + 2.3 + = + 2.2.0-Beta03 + *Test* + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.0-Beta03 + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.0-Beta03 + http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.0-Beta03<= /url> + + + + exo.core.component.security.core + exo.core.component.database + exo.core.component.document + exo.core.component.ldap + exo.core.component.organization.api + exo.core.component.organization.jdbc + exo.core.component.organization.ldap + exo.core.component.xml-processing + exo.core.component.script.groovy + exo.core.component.web.css + packaging/module + + + + + = + + org.exoplatform.core + exo.core.component.security.core + ${project.version} + + + + org.exoplatform.core + exo.core.component.database + ${project.version} + + + + org.exoplatform.core + exo.core.component.ldap + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.api + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.jdbc + ${project.version} + + = + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + + + + org.exoplatform.kernel + exo.kernel.container + ${org.exoplatform.kernel.version} + + + + org.exoplatform.kernel + exo.kernel.component.cache + ${org.exoplatform.kernel.version} + + + + javax.resource + connector-api + 1.5 + + + + hsqldb + hsqldb + 1.8.0.7 + + + + com.experlog + xapool + 1.5.0 + + + + c3p0 + c3p0 + 0.9.1.2 + + + + commons-dbcp + commons-dbcp + 1.2.2 + + + + org.hibernate + hibernate-core + 3.3.1.GA + + + + xdoclet + xdoclet-hibernate-module + 1.2.3 + + + + xdoclet + xdoclet + 1.2.3 + + + + xdoclet + xdoclet-xdoclet-module + 1.2 + + + + xdoclet + xjavadoc + 1.0.3 + + + + commons-collections + commons-collections + 3.1 + + + + pdfbox + pdfbox + 0.7.3 + compile + + + + com.lowagie + itext + 2.1.0 + compile + + + + org.htmlparser + htmlparser + 1.6 + compile + + + com.sun + tools + + + + + + org.apache.poi + poi + 3.0.2-FINAL + + + + org.apache.poi + poi-scratchpad + 3.0.2-FINAL + + + + com.novell.ldap + jldap + 4.3 + + + + javax.ejb + ejb + 2.1 + + + + xdoclet + xdoclet-hibernate-module + 1.2.3 + compile + + + + xdoclet + xdoclet + 1.2.3 + + + + xdoclet + xdoclet-xdoclet-module + 1.2 + + + + xdoclet + xjavadoc + 1.0.3 + + + + javax.resource + connector-api + 1.5 + + + + com.microsoft + sqljdbc + 1.1.1501 + + + + com.ibm.db2 + db2jcc + 9.1 + + + + com.ibm.db2 + db2jcc_license_cu + 9.1 + + + + oracle + ojdbc + 1.4 + + + + postgresql + postgresql + 8.3-603.jdbc3 + + + + mysql + mysql-connector-java + 5.0.8 + + + + org.codehaus.groovy + groovy-all + 1.6.5 + + + + org.w3c + sac + 1.3 + + + + batik + batik-util + 1.7 + + + + batik + batik-css + 1.7 + + + + jtidy + jtidy + 4aug2000r7-dev + + + + xml-resolver + xml-resolver + 1.1 + + + + commons-logging + commons-logging + 1.1 + + + + javassist + javassist + 3.4.GA + + = + + org.hibernate + hibernate-annotations + 3.4.0.GA + + + + + + + + junit + junit + test + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + always + + **/*$* + **/DBCreatorTest.java + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + + + + + + + --===============6465762531356325682==-- From do-not-reply at jboss.org Mon Nov 16 11:49:11 2009 Content-Type: multipart/mixed; boundary="===============1484045013598819855==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r697 - core/tags. Date: Mon, 16 Nov 2009 11:49:11 -0500 Message-ID: <200911161649.nAGGnBcD005793@svn01.web.mwc.hst.phx2.redhat.com> --===============1484045013598819855== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:49:11 -0500 (Mon, 16 Nov 2009) New Revision: 697 Added: core/tags/2.3.0-Beta03/ Log: [maven-scm] copy for tag 2.3.0-Beta03 Copied: core/tags/2.3.0-Beta03 (from rev 696, core/trunk) --===============1484045013598819855==-- From do-not-reply at jboss.org Mon Nov 16 11:49:36 2009 Content-Type: multipart/mixed; boundary="===============8452031970288449639==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r698 - in core/trunk: exo.core.component.database and 10 other directories. Date: Mon, 16 Nov 2009 11:49:36 -0500 Message-ID: <200911161649.nAGGnasS005851@svn01.web.mwc.hst.phx2.redhat.com> --===============8452031970288449639== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:49:35 -0500 (Mon, 16 Nov 2009) New Revision: 698 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2009-11-16 16:49:11 UTC = (rev 697) +++ core/trunk/exo.core.component.database/pom.xml 2009-11-16 16:49:35 UTC = (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.database Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2009-11-16 16:49:11 UTC = (rev 697) +++ core/trunk/exo.core.component.document/pom.xml 2009-11-16 16:49:35 UTC = (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.document Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-16 16:49:11 UTC (rev= 697) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-16 16:49:35 UTC (rev= 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.ldap Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-16 16:49= :11 UTC (rev 697) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-16 16:49= :35 UTC (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.organization.api Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-16 16:4= 9:11 UTC (rev 697) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-16 16:4= 9:35 UTC (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.organization.jdbc Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-16 16:4= 9:11 UTC (rev 697) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-16 16:4= 9:35 UTC (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.organization.ldap Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-16 16:49:11= UTC (rev 697) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-16 16:49:35= UTC (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.script.groovy Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-16 16:49:11= UTC (rev 697) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-16 16:49:35= UTC (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.security.core Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-16 16:49:11 UTC (= rev 697) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-16 16:49:35 UTC (= rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.web.css Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-16 16:49:1= 1 UTC (rev 697) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-16 16:49:3= 5 UTC (rev 698) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = exo.core.component.xml-processing Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2009-11-16 16:49:11 UTC (rev 697) +++ core/trunk/packaging/module/pom.xml 2009-11-16 16:49:35 UTC (rev 698) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT = 4.0.0 @@ -17,13 +17,13 @@ = - org.exoplatform.coreexo= .core.component.database2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.document2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta03 - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta03<= /dependency> - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta03 + org.exoplatform.coreexo= .core.component.database2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04-SNAPSHOT= + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04-SNAPSHO= T + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04-SNAPSHOT = Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-16 16:49:11 UTC (rev 697) +++ core/trunk/pom.xml 2009-11-16 16:49:35 UTC (rev 698) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.3.0-Beta03 + 2.3.0-Beta04-SNAPSHOT pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.0-Beta03 - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.0-Beta03 - http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.0-Beta03<= /url> + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk + http://fisheye.jboss.org/browse/exo-jcr/core/trunk = --===============8452031970288449639==-- From do-not-reply at jboss.org Mon Nov 16 11:52:30 2009 Content-Type: multipart/mixed; boundary="===============0459214488744631619==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r699 - ws/trunk. Date: Mon, 16 Nov 2009 11:52:30 -0500 Message-ID: <200911161652.nAGGqUNe006560@svn01.web.mwc.hst.phx2.redhat.com> --===============0459214488744631619== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:52:30 -0500 (Mon, 16 Nov 2009) New Revision: 699 Modified: ws/trunk/pom.xml Log: EXOJCR-234: dependency on Parent 3, Kernel 2.2.0-Beta03, Core 2.3.0-beta03 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-16 16:49:35 UTC (rev 698) +++ ws/trunk/pom.xml 2009-11-16 16:52:30 UTC (rev 699) @@ -25,7 +25,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.ws @@ -45,8 +45,8 @@ exo-ws 2.1 = - 2.2.0-Beta03-SNAPSHOT - 2.3.0-Beta03-SNAPSHOT + 2.2.0-Beta03 + 2.3.0-Beta03 = *Test* --===============0459214488744631619==-- From do-not-reply at jboss.org Mon Nov 16 11:55:15 2009 Content-Type: multipart/mixed; boundary="===============4347499400171212281==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r700 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Mon, 16 Nov 2009 11:55:14 -0500 Message-ID: <200911161655.nAGGtE4f007208@svn01.web.mwc.hst.phx2.redhat.com> --===============4347499400171212281== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:55:14 -0500 (Mon, 16 Nov 2009) New Revision: 700 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.1.0-Beta03 Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-16 16:52:30 UTC (rev 699) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-16 16:55:14 UTC (rev 700) @@ -1,49 +1,49 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.commons - - eXo WS :: Commons Utils - - - - org.exoplatform.kernel - exo.kernel.component.common - - - com.sun.xml.stream - sjsxp - - - stax - stax-api - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.commons + + eXo WS :: Commons Utils + + + + org.exoplatform.kernel + exo.kernel.component.common + + + com.sun.xml.stream + sjsxp + + + stax + stax-api + + + Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-16 16:52:30 UTC (rev 69= 9) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-16 16:55:14 UTC (rev 70= 0) @@ -1,54 +1,54 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.frameworks.json - - eXo WS :: Framework :: JSON - eXo Java Bean to JSON Transformation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - - - - src/test/resources - - **/*.json - **/*.txt - - - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.frameworks.json + + eXo WS :: Framework :: JSON + eXo Java Bean to JSON Transformation + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + + + + src/test/resources + + **/*.json + **/*.txt + + + + + Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-16 16:52:30 UTC (rev= 699) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-16 16:55:14 UTC (rev= 700) @@ -1,45 +1,45 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.frameworks.servlet - - eXo WS :: Framework :: Servlet - - - - javax.servlet - servlet-api - - - org.exoplatform.kernel - exo.kernel.component.common - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.frameworks.servlet + + eXo WS :: Framework :: Servlet + + + + javax.servlet + servlet-api + + + org.exoplatform.kernel + exo.kernel.component.common + + + Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-16 16:52:30 UTC (rev 699) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-16 16:55:14 UTC (rev 700) @@ -1,151 +1,151 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.rest.core - - eXo WS :: REST :: Core - - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.exoplatform.core - exo.core.component.xml-processing - - - org.exoplatform.ws - exo.ws.frameworks.json - - - org.exoplatform.ws - exo.ws.testframework - test - - - javax.xml.bind - jaxb-api - - - com.sun.xml.bind - jaxb-impl - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - test - - - javax.ws.rs - jsr311-api - - - commons-fileupload - commons-fileupload - - - commons-io - commons-io - - - - - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - - - generate wadl classes - - generate - - generate-sources - - src/main/resources - src/main/resources/catalog.xml - target/generated-sources - org.exoplatform.services.rest.wadl.r= esearch - - -extension - - - wadl.xsd - - - - - generate classes for test - - generate - - generate-test-sources - - src/test/resources - src/main/resources/catalog.xml - target/generated-test-sources - org.exoplatform.services.rest.genera= ted - - -extension - - - book.xsd - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - 0 - - run - - generate-test-sources - - - copy files gnerated by JAXB to test source d= irectory - - - - - - - - - - - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.rest.core + + eXo WS :: REST :: Core + + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.exoplatform.core + exo.core.component.xml-processing + + + org.exoplatform.ws + exo.ws.frameworks.json + + + org.exoplatform.ws + exo.ws.testframework + test + + + javax.xml.bind + jaxb-api + + + com.sun.xml.bind + jaxb-impl + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + test + + + javax.ws.rs + jsr311-api + + + commons-fileupload + commons-fileupload + + + commons-io + commons-io + + + + + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + generate wadl classes + + generate + + generate-sources + + src/main/resources + src/main/resources/catalog.xml + target/generated-sources + org.exoplatform.services.rest.wadl.r= esearch + + -extension + + + wadl.xsd + + + + + generate classes for test + + generate + + generate-test-sources + + src/test/resources + src/main/resources/catalog.xml + target/generated-test-sources + org.exoplatform.services.rest.genera= ted + + -extension + + + book.xsd + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + 0 + + run + + generate-test-sources + + + copy files gnerated by JAXB to test source d= irectory + + + + + + + + + + + + + Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-16 16:52:30 UTC (rev 699) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-16 16:55:14 UTC (rev 700) @@ -1,49 +1,49 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.rest.ext - - eXo WS :: REST :: Extentions - - - - org.exoplatform.ws - exo.ws.commons - - - org.exoplatform.ws - exo.ws.rest.core - - - javax.annotation - jsr250-api - - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.rest.ext + + eXo WS :: REST :: Extentions + + + + org.exoplatform.ws + exo.ws.commons + + + org.exoplatform.ws + exo.ws.rest.core + + + javax.annotation + jsr250-api + + + Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-16 16:52:30 UTC (rev 699) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-16 16:55:14 UTC (rev 700) @@ -1,41 +1,41 @@ - - - - 4.0.0 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - exo.ws.testframework - - eXo WS :: HTTP :: testframework - - - - javax.servlet - servlet-api - - + + + + 4.0.0 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + exo.ws.testframework + + eXo WS :: HTTP :: testframework + + + + javax.servlet + servlet-api + + \ No newline at end of file Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2009-11-16 16:52:30 UTC (rev 699) +++ ws/trunk/packaging/module/pom.xml 2009-11-16 16:55:14 UTC (rev 700) @@ -1,66 +1,66 @@ - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - - - 4.0.0 - ws.packaging.module - pom - eXo WS Build module - - - ws - module - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = - + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + + + 4.0.0 + ws.packaging.module + pom + eXo WS Build module + + + ws + module + + + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = + Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-16 16:52:30 UTC (rev 699) +++ ws/trunk/pom.xml 2009-11-16 16:55:14 UTC (rev 700) @@ -1,150 +1,150 @@ - - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.ws - ws-parent - 2.1.0-Beta03-SNAPSHOT - pom - - eXo WS - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk - http://fisheye.jboss.org/browse/exo-jcr/ws/trunk - - - - exo-ws - 2.1 - = - 2.2.0-Beta03 - 2.3.0-Beta03 - - *Test* - - - - exo.ws.commons - exo.ws.frameworks.json - exo.ws.frameworks.servlet - exo.ws.testframework - exo.ws.rest.core - exo.ws.rest.ext - packaging/module - - - - - - org.exoplatform.ws - exo.ws.frameworks.json - ${project.version} - - - org.exoplatform.ws - exo.ws.commons - ${project.version} - - - org.exoplatform.ws - exo.ws.rest.core - ${project.version} - - - org.exoplatform.ws - exo.ws.testframework - ${project.version} - - - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} - - - org.exoplatform.core - exo.core.component.xml-processing - ${org.exoplatform.core.version} - - - - com.sun.xml.stream - sjsxp - 1.0 - - - com.sun.xml.bind - jaxb-impl - 2.1.7 = - - - stax - stax-api - 1.0 - - - javax.xml.bind - jaxb-api - 2.1 - - - org.jvnet.jaxb2.maven2 - maven-jaxb2-plugin - 0.4 - - - javax.ws.rs - jsr311-api - 1.0 - - - commons-fileupload - commons-fileupload - - 1.0 - - - commons-io - commons-io - 1.3.2 - - - javax.annotation - jsr250-api - 1.0 - - - javax.servlet - servlet-api - 2.4 - - - - + + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.ws + ws-parent + 2.1.0-Beta03 + pom + + eXo WS + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.0-Beta03 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.0-Beta03 + http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.0-Beta03 + + + + exo-ws + 2.1 + = + 2.2.0-Beta03 + 2.3.0-Beta03 + + *Test* + + + + exo.ws.commons + exo.ws.frameworks.json + exo.ws.frameworks.servlet + exo.ws.testframework + exo.ws.rest.core + exo.ws.rest.ext + packaging/module + + + + + + org.exoplatform.ws + exo.ws.frameworks.json + ${project.version} + + + org.exoplatform.ws + exo.ws.commons + ${project.version} + + + org.exoplatform.ws + exo.ws.rest.core + ${project.version} + + + org.exoplatform.ws + exo.ws.testframework + ${project.version} + + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + + + org.exoplatform.core + exo.core.component.xml-processing + ${org.exoplatform.core.version} + + + + com.sun.xml.stream + sjsxp + 1.0 + + + com.sun.xml.bind + jaxb-impl + 2.1.7 = + + + stax + stax-api + 1.0 + + + javax.xml.bind + jaxb-api + 2.1 + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + 0.4 + + + javax.ws.rs + jsr311-api + 1.0 + + + commons-fileupload + commons-fileupload + + 1.0 + + + commons-io + commons-io + 1.3.2 + + + javax.annotation + jsr250-api + 1.0 + + + javax.servlet + servlet-api + 2.4 + + + + --===============4347499400171212281==-- From do-not-reply at jboss.org Mon Nov 16 11:55:38 2009 Content-Type: multipart/mixed; boundary="===============3719175219732857125==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r701 - ws/tags. Date: Mon, 16 Nov 2009 11:55:38 -0500 Message-ID: <200911161655.nAGGtceh007298@svn01.web.mwc.hst.phx2.redhat.com> --===============3719175219732857125== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:55:38 -0500 (Mon, 16 Nov 2009) New Revision: 701 Added: ws/tags/2.1.0-Beta03/ Log: [maven-scm] copy for tag 2.1.0-Beta03 Copied: ws/tags/2.1.0-Beta03 (from rev 700, ws/trunk) --===============3719175219732857125==-- From do-not-reply at jboss.org Mon Nov 16 11:55:59 2009 Content-Type: multipart/mixed; boundary="===============1175065964313903227==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r702 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Mon, 16 Nov 2009 11:55:59 -0500 Message-ID: <200911161655.nAGGtxdn007374@svn01.web.mwc.hst.phx2.redhat.com> --===============1175065964313903227== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 11:55:59 -0500 (Mon, 16 Nov 2009) New Revision: 702 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-16 16:55:38 UTC (rev 701) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-16 16:55:59 UTC (rev 702) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.commons Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-16 16:55:38 UTC (rev 70= 1) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-16 16:55:59 UTC (rev 70= 2) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.frameworks.json Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-16 16:55:38 UTC (rev= 701) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-16 16:55:59 UTC (rev= 702) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-16 16:55:38 UTC (rev 701) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-16 16:55:59 UTC (rev 702) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.rest.core Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-16 16:55:38 UTC (rev 701) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-16 16:55:59 UTC (rev 702) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.rest.ext Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-16 16:55:38 UTC (rev 701) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-16 16:55:59 UTC (rev 702) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = exo.ws.testframework Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2009-11-16 16:55:38 UTC (rev 701) +++ ws/trunk/packaging/module/pom.xml 2009-11-16 16:55:59 UTC (rev 702) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT = 4.0.0 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-16 16:55:38 UTC (rev 701) +++ ws/trunk/pom.xml 2009-11-16 16:55:59 UTC (rev 702) @@ -30,15 +30,15 @@ = org.exoplatform.ws ws-parent - 2.1.0-Beta03 + 2.1.0-Beta04-SNAPSHOT pom = eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.0-Beta03 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.0-Beta03 - http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.0-Beta03 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk + http://fisheye.jboss.org/browse/exo-jcr/ws/trunk = --===============1175065964313903227==-- From do-not-reply at jboss.org Mon Nov 16 11:59:51 2009 Content-Type: multipart/mixed; boundary="===============7197725447541294944==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r703 - in kernel/branches/mc-int-branch: exo.kernel.container/src/main/java/org/exoplatform/container/mc and 1 other directories. Date: Mon, 16 Nov 2009 11:59:51 -0500 Message-ID: <200911161659.nAGGxp7C007952@svn01.web.mwc.hst.phx2.redhat.com> --===============7197725447541294944== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2009-11-16 11:59:51 -0500 (Mon, 16 Nov 2009) New Revision: 703 Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCInjectionMode.java Removed: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/RootContainerVDFDecoratorInjector.java Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/InterceptMC.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCComponentAdapter.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/InjectingBean.java kernel/branches/mc-int-branch/pom.xml Log: removed some uncooked code, added field injection support Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/mc/InterceptMC.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/InterceptMC.java 2009-11-16 16:55:59 UTC (rev 702) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/InterceptMC.java 2009-11-16 16:59:51 UTC (rev 703) @@ -21,4 +21,11 @@ * @return true if we should enable AOP, false otherwise */ boolean enableAOP() default false; + + /** + * Injection mode + * + * @return MCInjectionMode enumeration constant representing injection = mode + */ + MCInjectionMode injectionMode() default MCInjectionMode.STANDARD; } Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/mc/MCComponentAdapter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentAdapter.java 2009-11-16 16:55:59 UTC (rev= 702) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentAdapter.java 2009-11-16 16:59:51 UTC (rev= 703) @@ -2,6 +2,7 @@ = import java.lang.ref.WeakReference; = +import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.plugins.helpers.StatelessController; import org.jboss.dependency.spi.ControllerState; @@ -76,6 +77,7 @@ builder.ignoreStart(); builder.ignoreStop(); builder.ignoreDestroy(); + builder.setAccessMode(getInjectionMode(interceptMC)); = KernelControllerContext ctx =3D new AbstractKernelControllerConte= xt(null, builder.getBeanMetaData(), null); try @@ -102,6 +104,21 @@ } } = + private BeanAccessMode getInjectionMode(InterceptMC interceptMC) + { + MCInjectionMode mode =3D interceptMC.injectionMode(); + + switch(mode) + { + case ALL: + return BeanAccessMode.ALL; + case FIELDS: + return BeanAccessMode.FIELDS; + default: + return BeanAccessMode.STANDARD; + } + } + public void verify(PicoContainer container) throws PicoIntrospectionExc= eption { delegate.verify(container); Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/MCInjectionMode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInjectionMode.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInjectionMode.java 2009-11-16 16:59:51 UTC (rev 70= 3) @@ -0,0 +1,16 @@ +package org.exoplatform.container.mc; + +/** + * @author Marko Strukelj + */ +public enum MCInjectionMode +{ + /** Field and method injections */ + ALL, + + /** Disable field injections (default) */ + FIELDS, + + /** Try setter injection first, if no setter found, fallback to field */ + STANDARD +} Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/RootContainerVDFDecoratorInjector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/RootContainerVDFDecoratorInjector.java 2009-11-16 16= :55:59 UTC (rev 702) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/RootContainerVDFDecoratorInjector.java 2009-11-16 16= :59:51 UTC (rev 703) @@ -1,71 +0,0 @@ -package org.exoplatform.container.mc; - -import java.security.ProtectionDomain; - -import javassist.ClassPool; -import javassist.CtClass; -import javassist.CtMethod; -import javassist.LoaderClassPath; -import org.jboss.beans.metadata.api.annotations.Inject; -import org.jboss.classloader.spi.ClassLoaderSystem; -import org.jboss.kernel.Kernel; -import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; -import org.jboss.util.loading.Translator; -import org.jboss.mc.common.ThreadLocalUtils; - -public class RootContainerVDFDecoratorInjector implements Translator -{ - @SuppressWarnings({"UnusedDeclaration"}) - private Kernel kernel; - private ClassLoaderSystem system; - - private static final String RC_CLASSNAME =3D "org.exoplatform.container= .RootContainer"; - private boolean found; - - public void start() - { - system.addTranslator(this); - } - - public void stop() - { - system.removeTranslator(this); - } - - protected byte[] decorate() throws Exception - { - ClassPool pool =3D ClassPool.getDefault(); - pool.insertClassPath(new LoaderClassPath(Thread.currentThread().getC= ontextClassLoader())); - CtClass cc =3D pool.get(RC_CLASSNAME); - CtMethod m =3D cc.getDeclaredMethod("getInstance"); - m.insertBefore(ThreadLocalUtils.class.getName() + ".putKernel(kernel= );\ntry {\n"); - m.insertAfter("\n } finally { \n" + ThreadLocalUtils.class.getName()= + ".removeKernel();\n }"); - return cc.toBytecode(); - } - - public byte[] transform(ClassLoader classLoader, String s, Class aCl= ass, ProtectionDomain protectionDomain, byte[] bytes) throws Exception - { - if (found =3D=3D false && RC_CLASSNAME.equals(s)) - { - found =3D true; - return decorate(); - } - return bytes; - } - - public void unregisterClassLoader(ClassLoader classLoader) - { - } - - @Inject(bean =3D KernelConstants.KERNEL_NAME) - public void setKernel(Kernel kernel) - { - this.kernel =3D kernel; - } - - @Inject - public void setSystem(ClassLoaderSystem system) - { - this.system =3D system; - } -} Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/m= ain/java/org/exoplatform/kernel/demos/mc/InjectingBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectingBean.java 2009-11-16 16:55:59 U= TC (rev 702) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectingBean.java 2009-11-16 16:59:51 U= TC (rev 703) @@ -1,6 +1,7 @@ package org.exoplatform.kernel.demos.mc; = import org.exoplatform.container.mc.InterceptMC; +import org.exoplatform.container.mc.MCInjectionMode; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.MapValue; @@ -20,7 +21,8 @@ * * @author Marko Strukelj */ -(a)InterceptMC +// Enable field injection by setting injectionMode +(a)InterceptMC(injectionMode=3D MCInjectionMode.ALL) public class InjectingBean implements org.picocontainer.Startable { private static final Logger log =3D Logger.getLogger(InjectingBean.clas= s); @@ -28,6 +30,7 @@ private InjectedBean bean1; private KernelConfigurator configurator; = + // Avoid using field injection, it's an anti-pattern @Inject(bean =3D "InjectedBean") private InjectedBean injectedBean; = Modified: kernel/branches/mc-int-branch/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/pom.xml 2009-11-16 16:55:59 UTC (rev 702) +++ kernel/branches/mc-int-branch/pom.xml 2009-11-16 16:59:51 UTC (rev 703) @@ -39,7 +39,7 @@ exo-kernel 2.2 2.0.6.GA - 2.2.0-SNAPSHOT + 2.2.0.Alpha2 2.0.7.GA always --===============7197725447541294944==-- From do-not-reply at jboss.org Mon Nov 16 12:01:44 2009 Content-Type: multipart/mixed; boundary="===============6806050356130664431==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r704 - jcr/trunk. Date: Mon, 16 Nov 2009 12:01:43 -0500 Message-ID: <200911161701.nAGH1hCP008764@svn01.web.mwc.hst.phx2.redhat.com> --===============6806050356130664431== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 12:01:43 -0500 (Mon, 16 Nov 2009) New Revision: 704 Modified: jcr/trunk/pom.xml Log: EXOJCR-234: dependency on Parent 3, Kernel 2.2.0-Beta03, Core 2.3.0-Beta03,= WS 2.1.0-Beta03 Modified: jcr/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/pom.xml 2009-11-16 16:59:51 UTC (rev 703) +++ jcr/trunk/pom.xml 2009-11-16 17:01:43 UTC (rev 704) @@ -25,7 +25,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.jcr @@ -38,9 +38,9 @@ exo-jcr 1.12 - 2.2.0-Beta03-SNAPSHOT - 2.3.0-Beta03-SNAPSHOT - 2.1.0-Beta03-SNAPSHOT + 2.2.0-Beta03 + 2.3.0-Beta03 + 2.1.0-Beta03 = --===============6806050356130664431==-- From do-not-reply at jboss.org Mon Nov 16 12:04:56 2009 Content-Type: multipart/mixed; boundary="===============7683390073170640509==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r705 - in jcr/trunk: applications/exo.jcr.applications.config and 14 other directories. Date: Mon, 16 Nov 2009 12:04:55 -0500 Message-ID: <200911161704.nAGH4tS6009603@svn01.web.mwc.hst.phx2.redhat.com> --===============7683390073170640509== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 12:04:54 -0500 (Mon, 16 Nov 2009) New Revision: 705 Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml jcr/trunk/applications/java/exo.jcr.ear/pom.xml jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ftp/pom.xml jcr/trunk/exo.jcr.component.webdav/pom.xml jcr/trunk/exo.jcr.connectors.localadapter/pom.xml jcr/trunk/exo.jcr.framework.command/pom.xml jcr/trunk/exo.jcr.framework.ftpclient/pom.xml jcr/trunk/exo.jcr.framework.web/pom.xml jcr/trunk/packaging/module/pom.xml jcr/trunk/pom.xml Log: [maven-release-plugin] prepare release 1.12.0-Beta03 Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2009-11-16 1= 7:01:43 UTC (rev 704) +++ jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2009-11-16 1= 7:04:54 UTC (rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.applications.config Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/po= m.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-16 17:01:43 UTC (rev 704) +++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-16 17:04:54 UTC (rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.applications.backupconsole Modified: jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-16 17:01:43 UTC (rev 704) +++ jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-16 17:04:54 UTC (rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.applications.browser Modified: jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-16 17:01:43 UTC (rev 704) +++ jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-16 17:04:54 UTC (rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.applications.fckeditor Modified: jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-1= 6 17:01:43 UTC (rev 704) +++ jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-1= 6 17:04:54 UTC (rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.applications.rest Modified: jcr/trunk/applications/java/exo.jcr.ear/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-16 17:01:43 UTC= (rev 704) +++ jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-16 17:04:54 UTC= (rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.ear Modified: jcr/trunk/exo.jcr.component.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-16 17:01:43 UTC (rev 7= 04) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-16 17:04:54 UTC (rev 7= 05) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.component.core @@ -125,8 +125,7 @@ + = javax.resource Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-16 17:01:43 UTC (rev 70= 4) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-16 17:04:54 UTC (rev 70= 5) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.component.ext @@ -86,11 +86,11 @@ src/test/resources - - **/*.xml = - **/*.xls = - **/*.groovy = - **/login.conf = + + **/*.xml = + **/*.xls = + **/*.groovy = + **/login.conf = Modified: jcr/trunk/exo.jcr.component.ftp/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-16 17:01:43 UTC (rev 70= 4) +++ jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-16 17:04:54 UTC (rev 70= 5) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.component.ftp Modified: jcr/trunk/exo.jcr.component.webdav/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-16 17:01:43 UTC (rev= 704) +++ jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-16 17:04:54 UTC (rev= 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.component.webdav Modified: jcr/trunk/exo.jcr.connectors.localadapter/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-16 17:01:43 U= TC (rev 704) +++ jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-16 17:04:54 U= TC (rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.connectors.localadapter Modified: jcr/trunk/exo.jcr.framework.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-16 17:01:43 UTC (re= v 704) +++ jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-16 17:04:54 UTC (re= v 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.framework.command Modified: jcr/trunk/exo.jcr.framework.ftpclient/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-16 17:01:43 UTC (= rev 704) +++ jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-16 17:04:54 UTC (= rev 705) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.framework.ftpclient Modified: jcr/trunk/exo.jcr.framework.web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-16 17:01:43 UTC (rev 70= 4) +++ jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-16 17:04:54 UTC (rev 70= 5) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = exo.jcr.framework.web Modified: jcr/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/packaging/module/pom.xml 2009-11-16 17:01:43 UTC (rev 704) +++ jcr/trunk/packaging/module/pom.xml 2009-11-16 17:04:54 UTC (rev 705) @@ -2,7 +2,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = 4.0.0 Modified: jcr/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/pom.xml 2009-11-16 17:01:43 UTC (rev 704) +++ jcr/trunk/pom.xml 2009-11-16 17:04:54 UTC (rev 705) @@ -30,7 +30,7 @@ = org.exoplatform.jcr jcr-parent - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 pom = eXo JCR @@ -44,9 +44,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/trunk= - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr= /trunk - https://svn.jboss.org/repos/exo-jcr/jcr/trunk + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/= 1.12.0-Beta03 + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr= /tags/1.12.0-Beta03 + https://svn.jboss.org/repos/exo-jcr/jcr/tags/1.12.0-Beta03 = --===============7683390073170640509==-- From do-not-reply at jboss.org Mon Nov 16 12:05:20 2009 Content-Type: multipart/mixed; boundary="===============2072412279171922693==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r706 - jcr/tags. Date: Mon, 16 Nov 2009 12:05:20 -0500 Message-ID: <200911161705.nAGH5Knf010390@svn01.web.mwc.hst.phx2.redhat.com> --===============2072412279171922693== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 12:05:20 -0500 (Mon, 16 Nov 2009) New Revision: 706 Added: jcr/tags/1.12.0-Beta03/ Log: [maven-scm] copy for tag 1.12.0-Beta03 Copied: jcr/tags/1.12.0-Beta03 (from rev 705, jcr/trunk) --===============2072412279171922693==-- From do-not-reply at jboss.org Mon Nov 16 12:05:53 2009 Content-Type: multipart/mixed; boundary="===============8878679941689705868==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r707 - in jcr/trunk: applications/exo.jcr.applications.config and 14 other directories. Date: Mon, 16 Nov 2009 12:05:53 -0500 Message-ID: <200911161705.nAGH5rPh010531@svn01.web.mwc.hst.phx2.redhat.com> --===============8878679941689705868== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 12:05:53 -0500 (Mon, 16 Nov 2009) New Revision: 707 Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml jcr/trunk/applications/java/exo.jcr.ear/pom.xml jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ftp/pom.xml jcr/trunk/exo.jcr.component.webdav/pom.xml jcr/trunk/exo.jcr.connectors.localadapter/pom.xml jcr/trunk/exo.jcr.framework.command/pom.xml jcr/trunk/exo.jcr.framework.ftpclient/pom.xml jcr/trunk/exo.jcr.framework.web/pom.xml jcr/trunk/packaging/module/pom.xml jcr/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2009-11-16 1= 7:05:20 UTC (rev 706) +++ jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2009-11-16 1= 7:05:53 UTC (rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.applications.config Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/po= m.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-16 17:05:20 UTC (rev 706) +++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-16 17:05:53 UTC (rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.applications.backupconsole Modified: jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-16 17:05:20 UTC (rev 706) +++ jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-16 17:05:53 UTC (rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.applications.browser Modified: jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-16 17:05:20 UTC (rev 706) +++ jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-16 17:05:53 UTC (rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.applications.fckeditor Modified: jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-1= 6 17:05:20 UTC (rev 706) +++ jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-1= 6 17:05:53 UTC (rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.applications.rest Modified: jcr/trunk/applications/java/exo.jcr.ear/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-16 17:05:20 UTC= (rev 706) +++ jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-16 17:05:53 UTC= (rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.ear Modified: jcr/trunk/exo.jcr.component.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-16 17:05:20 UTC (rev 7= 06) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-16 17:05:53 UTC (rev 7= 07) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.component.core Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-16 17:05:20 UTC (rev 70= 6) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-16 17:05:53 UTC (rev 70= 7) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.component.ext Modified: jcr/trunk/exo.jcr.component.ftp/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-16 17:05:20 UTC (rev 70= 6) +++ jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-16 17:05:53 UTC (rev 70= 7) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.component.ftp Modified: jcr/trunk/exo.jcr.component.webdav/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-16 17:05:20 UTC (rev= 706) +++ jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-16 17:05:53 UTC (rev= 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.component.webdav Modified: jcr/trunk/exo.jcr.connectors.localadapter/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-16 17:05:20 U= TC (rev 706) +++ jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-16 17:05:53 U= TC (rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.connectors.localadapter Modified: jcr/trunk/exo.jcr.framework.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-16 17:05:20 UTC (re= v 706) +++ jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-16 17:05:53 UTC (re= v 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.framework.command Modified: jcr/trunk/exo.jcr.framework.ftpclient/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-16 17:05:20 UTC (= rev 706) +++ jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-16 17:05:53 UTC (= rev 707) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.framework.ftpclient Modified: jcr/trunk/exo.jcr.framework.web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-16 17:05:20 UTC (rev 70= 6) +++ jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-16 17:05:53 UTC (rev 70= 7) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = exo.jcr.framework.web Modified: jcr/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/packaging/module/pom.xml 2009-11-16 17:05:20 UTC (rev 706) +++ jcr/trunk/packaging/module/pom.xml 2009-11-16 17:05:53 UTC (rev 707) @@ -2,7 +2,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT = 4.0.0 Modified: jcr/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/pom.xml 2009-11-16 17:05:20 UTC (rev 706) +++ jcr/trunk/pom.xml 2009-11-16 17:05:53 UTC (rev 707) @@ -30,7 +30,7 @@ = org.exoplatform.jcr jcr-parent - 1.12.0-Beta03 + 1.12.0-Beta04-SNAPSHOT pom = eXo JCR @@ -44,9 +44,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/= 1.12.0-Beta03 - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr= /tags/1.12.0-Beta03 - https://svn.jboss.org/repos/exo-jcr/jcr/tags/1.12.0-Beta03 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/trunk= + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr= /trunk + https://svn.jboss.org/repos/exo-jcr/jcr/trunk = --===============8878679941689705868==-- From do-not-reply at jboss.org Mon Nov 16 12:41:46 2009 Content-Type: multipart/mixed; boundary="===============5849439542912508567==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r708 - jcr/tags/1.12.0-Beta03. Date: Mon, 16 Nov 2009 12:41:46 -0500 Message-ID: <200911161741.nAGHfkwp019170@svn01.web.mwc.hst.phx2.redhat.com> --===============5849439542912508567== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-16 12:41:46 -0500 (Mon, 16 Nov 2009) New Revision: 708 Added: jcr/tags/1.12.0-Beta03/readme.txt Log: EXOJCR-234: readme Added: jcr/tags/1.12.0-Beta03/readme.txt =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/tags/1.12.0-Beta03/readme.txt (rev 0) +++ jcr/tags/1.12.0-Beta03/readme.txt 2009-11-16 17:41:46 UTC (rev 708) @@ -0,0 +1,53 @@ +JCR 1.12.0-Beta03 = +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + +eXoPlatform Java Content Repository (JSR-170) implementation and Extension= services. +Includes: +* eXo Kernel 2.2.0-Beta03 +* eXo Core 2.3.0-Beta03 +* eXo WS 2.1.0-Beta03 + + +Release Notes - eXo-JCR - Version JCR-1.12.0-Beta03 + +** Bug + * [EXOJCR-176] - TestExcerpt fails in some cases + * [EXOJCR-179] - tools.jar in the dependency tree (caused by htmlparse= r). + * [EXOJCR-181] - Binary properties could be indexed differently in som= e cases + * [EXOJCR-189] - Import of version history is not working well for nt:= file + * [EXOJCR-208] - Duplicated (ws-commons-util) entry in dependencyMange= ment + * [EXOJCR-215] - JobSchedulerServiceImpl.addCronJob() ignores JobDataM= ap argument + * [EXOJCR-232] - Jcr can store nodetype definitions with wrong isMulti= ple flag in some cases + * [EXOJCR-239] - Update javax.servlet:servlet-api dependency to versio= n 2.4 for project exo.ws.testframework. + +** Feature Request + * [EXOJCR-233] - Add possibility update entry in Registry or if not ex= ist create it = + +** Task + * [EXOJCR-28] - "update-policy" parameter : Use the check-in/check-out= only on versionned files + * [EXOJCR-131] - Add D:getcontenttype and jcr:nodeType properties to S= EARCH method response. + * [EXOJCR-163] - [SWF] Maven best practice : module name =3D artifactId + * [EXOJCR-165] - Maven convention : Move resources from [main|test]/ja= va to [main|test]/resources + * [EXOJCR-178] - Provide a mechanism to manage Cache-Control header va= lue for different mime-types from server configuration. + * [EXOJCR-183] - full-text method SEARCH does not find out text file + * [EXOJCR-184] - 1.12-Beta02 performance profiling = + * [EXOJCR-195] - Update Oracle script with analyze statements + * [EXOJCR-196] - Remove META-INF folder from jcr.core src resources + * [EXOJCR-206] - Add MimeType "application/x-groovy", "script/groovy",= "application/x-javascript" to the TextPlainDocumentReader. + * [EXOJCR-218] - Extend ItemExistsException in JCRItemExistsException = with details about an error + * [EXOJCR-219] - Optimize creation of ChangesLog from full backup. + * [EXOJCR-191] - Save default node types in repository + + +Resources +=3D=3D=3D=3D=3D=3D=3D=3D=3D + + Project site http://www.jboss.org/exojcr + Company site http://www.exoplatform.com + Documentation wiki http://wiki.exoplatform.org + Community JIRA http://jira.exoplatform.org + Comminity site http://www.exoplatform.org + Community forum http://www.exoplatform.com/portal/public/en/forum = = + JavaDoc site http://docs.exoplatform.org + = \ No newline at end of file --===============5849439542912508567==-- From do-not-reply at jboss.org Tue Nov 17 04:23:06 2009 Content-Type: multipart/mixed; boundary="===============0465014672535399948==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r709 - kernel/branches/mc-int-branch. Date: Tue, 17 Nov 2009 04:23:06 -0500 Message-ID: <200911170923.nAH9N6iR006088@svn01.web.mwc.hst.phx2.redhat.com> --===============0465014672535399948== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2009-11-17 04:23:05 -0500 (Tue, 17 Nov 2009) New Revision: 709 Modified: kernel/branches/mc-int-branch/pom.xml Log: Incremented parent pom to release version Modified: kernel/branches/mc-int-branch/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/pom.xml 2009-11-16 17:41:46 UTC (rev 708) +++ kernel/branches/mc-int-branch/pom.xml 2009-11-17 09:23:05 UTC (rev 709) @@ -25,7 +25,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.kernel --===============0465014672535399948==-- From do-not-reply at jboss.org Tue Nov 17 04:58:24 2009 Content-Type: multipart/mixed; boundary="===============6965213939087323157==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r710 - in kernel/branches/mc-int-branch: org.jboss.mc-kernel-extras and 1 other directory. Date: Tue, 17 Nov 2009 04:58:24 -0500 Message-ID: <200911170958.nAH9wOAC010953@svn01.web.mwc.hst.phx2.redhat.com> --===============6965213939087323157== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2009-11-17 04:58:24 -0500 (Tue, 17 Nov 2009) New Revision: 710 Removed: kernel/branches/mc-int-branch/exo.kernel.demos/custom-pojo/ Modified: kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml Log: Incremented mc-kernel-extras version to be in sync with the rest of the pro= ject + removed uncooked custom-pojo demo Modified: kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml 2009-1= 1-17 09:23:05 UTC (rev 709) +++ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml 2009-1= 1-17 09:58:24 UTC (rev 710) @@ -10,7 +10,7 @@ = mc-kernel-extras - 1.0.0-SNAPSHOT + 2.2.0-Beta03-SNAPSHOT = MC Kernel 2.2.0 Selected Classes MC integration classes that aren't available in mc-kernel = 2.0.6.GA --===============6965213939087323157==-- From do-not-reply at jboss.org Tue Nov 17 06:05:04 2009 Content-Type: multipart/mixed; boundary="===============1969130531999230743==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r711 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core and 7 other directories. Date: Tue, 17 Nov 2009 06:05:04 -0500 Message-ID: <200911171105.nAHB54jU023411@svn01.web.mwc.hst.phx2.redhat.com> --===============1969130531999230743== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-17 06:05:04 -0500 (Tue, 17 Nov 2009) New Revision: 711 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/dataflow/LockPlainChangesLogImpl.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/dataflow/ItemDataConsumer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/SessionDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataMana= ger.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/session/TransactionableDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/storage/WorkspaceStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-242: ItemDataConsumer and WorkspaceStorageConnection (and all their = implementators) extended with getLockData() and getLocksData(). Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/dataflow/ItemDataConsumer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/ItemDataConsumer.java 2009-11-17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/ItemDataConsumer.java 2009-11-17 11:05:04 UTC (rev 711) @@ -22,6 +22,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.core.lock.LockData; = import java.util.List; = @@ -56,6 +57,13 @@ ItemData getItemData(String identifier) throws RepositoryException; = /** + * @param identifier + * @return + * LockData by given node uuid, or null if not present + */ + LockData getLockData(String identifier) throws RepositoryException; + + /** * @param parentIdentifier * @return children data */ @@ -79,4 +87,10 @@ * @throws RepositoryException */ List getReferencesData(String identifier, boolean skipVer= sionStorage) throws RepositoryException; + + /** + * @return + * List of all locks. + */ + List getLocksData() throws RepositoryException; } Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/dataflow/LockPlainChangesLogImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/LockPlainChangesLogImpl.java (r= ev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/LockPlainChangesLogImpl.java 2009-11-17 11:05:04 UTC (r= ev 711) @@ -0,0 +1,57 @@ +/* + * 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.dataflow; + +import org.exoplatform.services.jcr.impl.core.lock.LockData; + +import java.util.ArrayList; + +/** + * This plain changes log is used to pass lock information through DataMan= ager down to + * workspace persistent storage = + * = + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class LockPlainChangesLogImpl extends PlainChangesLogImpl +{ + protected LockData lockData =3D null; + + /** + * @param arrayList + * @param id + * @param lock + */ + public LockPlainChangesLogImpl(ArrayList arrayList, String i= d, int lock) + { + super(arrayList, id, lock); + } + + public LockData getLockData() + { + return lockData; + } + + public void setLockData(LockData lockData) + { + this.lockData =3D lockData; + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/dataflow/LockPlainChangesLogImpl.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java 2009-11-17 09:58:24 UTC (rev 7= 10) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java 2009-11-17 11:05:04 UTC (rev 7= 11) @@ -33,6 +33,7 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerImpl; import org.exoplatform.services.jcr.impl.core.version.ChildVersionRemoveVi= sitor; import org.exoplatform.services.jcr.impl.core.version.VersionHistoryImpl; @@ -1891,4 +1892,20 @@ return -i1.getData().getQPath().compareTo(i2.getData().getQPath()= ); } } + + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLockD= ata(java.lang.String) + */ + public LockData getLockData(String identifier) throws RepositoryExcepti= on + { + return transactionableManager.getLockData(identifier); + } + + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLocks= Data() + */ + public List getLocksData() throws RepositoryException + { + return transactionableManager.getLocksData(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceD= ataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataMan= ager.java 2009-11-17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataMan= ager.java 2009-11-17 11:05:04 UTC (rev 711) @@ -25,6 +25,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = @@ -172,4 +173,20 @@ { return persistentManager.getCurrentTime(); } + + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLockD= ata(java.lang.String) + */ + public LockData getLockData(String identifier) throws RepositoryExcepti= on + { + return persistentManager.getLockData(identifier); + } + + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLocks= Data() + */ + public List getLocksData() throws RepositoryException + { + return persistentManager.getLocksData(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-17 11:05:04 UTC (rev 711) @@ -34,6 +34,7 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; @@ -310,6 +311,32 @@ } } = + public LockData getLockData(String identifier) throws RepositoryExcepti= on + { + final WorkspaceStorageConnection con =3D dataContainer.openConnectio= n(); + try + { + return con.getLockData(identifier); + } + finally + { + con.close(); + } + } + + public List getLocksData() throws RepositoryException + { + final WorkspaceStorageConnection con =3D dataContainer.openConnectio= n(); + try + { + return con.getLocksData(); + } + finally + { + con.close(); + } + } + /** * {@inheritDoc} */ Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProx= y.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java= 2009-11-17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java= 2009-11-17 11:05:04 UTC (rev 711) @@ -31,6 +31,7 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; @@ -246,4 +247,20 @@ } return copyOfChildsProperties; } + + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLockD= ata(java.lang.String) + */ + public LockData getLockData(String identifier) throws RepositoryExcepti= on + { + return storageDataManager.getLockData(identifier); + } + + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLocks= Data() + */ + public List getLocksData() throws RepositoryException + { + return storageDataManager.getLocksData(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/session/TransactionableDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java 2009-11-17= 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java 2009-11-17= 11:05:04 UTC (rev 711) @@ -28,6 +28,7 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -262,4 +263,21 @@ return storageDataManager; } = + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLockD= ata(java.lang.String) + */ + public LockData getLockData(String identifier) throws RepositoryExcepti= on + { + return storageDataManager.getLockData(identifier); + } + + /** + * @see org.exoplatform.services.jcr.dataflow.ItemDataConsumer#getLocks= Data() + */ + public List getLocksData() throws RepositoryException + { + // TODO Auto-generated method stub + return storageDataManager.getLocksData(); + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17 = 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17 = 11:05:04 UTC (rev 711) @@ -25,6 +25,7 @@ import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.core.JCRPath; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -259,4 +260,20 @@ = } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) + */ + public LockData getLockData(String identifier) + { + return null; + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLocksData() + */ + public List getLocksData() + { + return null; + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-17 09:58:= 24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-17 11:05:= 04 UTC (rev 711) @@ -18,7 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.jboss.cache.Fqn; import org.jboss.cache.Node; @@ -42,7 +41,7 @@ = public static final String PROPS =3D "$PROPS".intern(); = - public static final String OBSERVATION =3D "$OBSERVATION".intern(); + public static final String LOCKS =3D "$LOCKS".intern(); = public static final String ITEM_DATA =3D "$data".intern(); = @@ -51,21 +50,27 @@ public static final String SESSION_ID =3D "$sessionId".intern(); = public static final String USER_ID =3D "$userId".intern(); + = + public static final String LOCK_DATA =3D "$lock".intern(); = protected final Node nodesRoot; = protected final Node propsRoot; = protected final Node sessionRoot; + = + protected final Node locksRoot; = protected JBossCacheStorage(Node nodesRoot, Node<= Serializable, Object> propsRoot, - Node sessionRoot) + Node sessionRoot, Node l= ocksRoot) { this.nodesRoot =3D nodesRoot; = this.propsRoot =3D propsRoot; = this.sessionRoot =3D sessionRoot; + = + this.locksRoot =3D locksRoot; = } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 11:05:04 UTC (rev 711) @@ -21,8 +21,8 @@ import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -72,9 +72,9 @@ * @param cache Cache */ public JBossCacheStorageConnection(Cache cache, N= ode nodesRoot, - Node propsRoot, Node ses= sionRoot) + Node propsRoot, Node ses= sionRoot, Node locksRoot) { - super(nodesRoot, propsRoot, sessionRoot); + super(nodesRoot, propsRoot, sessionRoot, locksRoot); = this.cache =3D cache; } @@ -600,4 +600,38 @@ } } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) + */ + public LockData getLockData(String identifier) + { + LockData lockData =3D null; + Node node =3D locksRoot.getChild(makeNodeFqn(i= dentifier)); + if (node !=3D null) + { + lockData =3D (LockData)node.get(JBossCacheStorage.LOCK_DATA); + } + return lockData; + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLocksData() + */ + public List getLocksData() + { + Set> lockSet =3D locksRoot.getChildren(); + List locksData =3D new ArrayList(); + for (Node node : lockSet) + { + if (node !=3D null) + { + LockData lockData =3D (LockData)node.get(JBossCacheStorage.LOC= K_DATA); + if (lockData !=3D null) + { + locksData.add(lockData); + } + } + } + return locksData; + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-17 11:05:04 UTC (rev 711) @@ -18,18 +18,11 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -37,6 +30,14 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Node; = +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + /** * DEPRECATED - DO NOT USE! * = @@ -419,4 +420,20 @@ } } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) + */ + public LockData getLockData(String identifier) + { + throw new UnsupportedOperationException(); + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLocksData() + */ + public List getLocksData() + { + throw new UnsupportedOperationException(); + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-17 11:05:04 UTC (rev 711) @@ -73,6 +73,8 @@ = private Node session; = + private Node locks; + /** * JBossWorkspaceDataContainer constructor. * @@ -128,6 +130,7 @@ this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .NODES)); this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheSt= orage.PROPS)); this.session =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.SESSION)); + this.locks =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .LOCKS)); cache.endBatch(true); } = @@ -177,7 +180,7 @@ // throw new RepositoryException("Container is not started"); // } = - return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion); + return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion, locks); } = /** @@ -191,7 +194,7 @@ // throw new RepositoryException("Container is not started"); // } = - return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion); + return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion, locks); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 09:58:24= UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 11:05:04= UTC (rev 711) @@ -33,6 +33,7 @@ import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPers= istedValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.CleanableFile= StreamValueData; import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateExcept= ion; @@ -698,6 +699,24 @@ } = /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) + */ + public LockData getLockData(String identifier) + { + // TODO Add logic HERE! Need to store locks some where + return null; + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLocksData() + */ + public List getLocksData() + { + // TODO Add logic HERE! Need to store locks some where + return null; + } + + /** * {@inheritDoc} */ public void addSessionInfo(String sessionId) throws RepositoryException Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-17 09:58:24 UTC = (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-17 11:05:04 UTC = (rev 711) @@ -22,6 +22,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.core.lock.LockData; = import java.util.List; = @@ -333,4 +334,17 @@ * @return boolean, true if connection is open and ready, false - other= wise */ boolean isOpened(); + = + /** + * @param identifier + * @return + * LockData by given node uuid, or null if not present + */ + LockData getLockData(String identifier); + = + /** + * @return + * List of all locks. + */ + List getLocksData(); } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-17 11:05:04 UTC (rev 711) @@ -62,6 +62,8 @@ = protected Node session; = + protected Node locks; + protected String jbcConfig; = /** @@ -88,9 +90,10 @@ nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); session =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.SESS= ION)); + locks =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.SESSIO= N)); = // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props, sessio= n); + conn =3D new JBossCacheStorageConnection(cache, nodes, props, sessio= n, locks); } = protected void initJBCConfig() Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 17 09:58:24 UTC (rev 710) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 17 11:05:04 UTC (rev 711) @@ -37,6 +37,7 @@ import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.core.observation.ListenerCriteria; import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; @@ -555,6 +556,22 @@ { } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnect= ion#getLockData(java.lang.String) + */ + public LockData getLockData(String identifier) + { + return null; + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnect= ion#getLocksData() + */ + public List getLocksData() + { + return null; + } + } = } --===============1969130531999230743==-- From do-not-reply at jboss.org Tue Nov 17 06:53:09 2009 Content-Type: multipart/mixed; boundary="===============1737009866020106000==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r712 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 4 other directories. Date: Tue, 17 Nov 2009 06:53:09 -0500 Message-ID: <200911171153.nAHBr9uM032451@svn01.web.mwc.hst.phx2.redhat.com> --===============1737009866020106000== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-17 06:53:08 -0500 (Tue, 17 Nov 2009) New Revision: 712 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/storage/WorkspaceStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-249 : Add methods delateNode and deleteProperty in WorkspaceStprageC= onnection. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17 = 11:05:04 UTC (rev 711) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17 = 11:53:08 UTC (rev 712) @@ -276,4 +276,24 @@ return null; } = + /** + * {@inheritDoc} + */ + public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub + = + } + + /** + * {@inheritDoc} + */ + public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub + = + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 11:05:04 UTC (rev 711) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 11:53:08 UTC (rev 712) @@ -377,6 +377,26 @@ /** * {@inheritDoc} */ + public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub + = + } + + /** + * {@inheritDoc} + */ + public void deleteProperty(String identifier) throws RepositoryExceptio= n, + UnsupportedOperationException, InvalidItemStateException, Ille= galStateException + { + // TODO Auto-generated method stub + = + } + + /** + * {@inheritDoc} + */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException { = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-17 11:05:04 UTC (rev 711) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-17 11:53:08 UTC (rev 712) @@ -436,4 +436,24 @@ throw new UnsupportedOperationException(); } = + /** + * {@inheritDoc} + */ + public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub + = + } + + /** + * {@inheritDoc} + */ + public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub + = + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 11:05:04= UTC (rev 711) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 11:53:08= UTC (rev 712) @@ -490,10 +490,30 @@ exceptionHandler.handleDeleteException(e, data); } } + = + /** + * {@inheritDoc} + */ + public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub = + } + /** * {@inheritDoc} */ + public void deleteProperty(String identifier) throws RepositoryExceptio= n, + UnsupportedOperationException, InvalidItemStateException, Ille= galStateException + { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, InvalidItemStateException, IllegalStateException { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-17 11:05:04 UTC = (rev 711) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-17 11:53:08 UTC = (rev 712) @@ -259,6 +259,42 @@ */ void delete(NodeData data) throws RepositoryException, UnsupportedOpera= tionException, InvalidItemStateException, IllegalStateException; + = + /** + * Deletes NodeData by identifier. + * = + * @param identifier + * the identifier of NodeData to be deleted + * = + * @throws InvalidItemStateException + * if the data is already deleted + * @throws UnsupportedOperationException + * if operation is not supported (it is container for level 1) + * @throws RepositoryException + * if some exception occured + * @throws IllegalStateException + * if connection is closed + */ + void deleteNode(String identifier) throws RepositoryException, Unsuppor= tedOperationException, InvalidItemStateException, + IllegalStateException; + = + /** + * Deletes PropertyData by identifier. + * = + * @param identifier + * the identifier of PropertyData to be deleted + * = + * @throws InvalidItemStateException + * if the data is already deleted + * @throws UnsupportedOperationException + * if operation is not supported (it is container for level 1) + * @throws RepositoryException + * if some exception occured + * @throws IllegalStateException + * if connection is closed + */ + void deleteProperty(String identifier) throws RepositoryException, Unsu= pportedOperationException, InvalidItemStateException, + IllegalStateException; = /** * Deletes PropertyData. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCStorageConnectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17 11:05:04 = UTC (rev 711) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17 11:53:08 = UTC (rev 712) @@ -18,6 +18,12 @@ */ package org.exoplatform.services.jcr.impl.storage; = +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.JcrImplBaseTest; import org.exoplatform.services.jcr.access.AccessControlEntry; import org.exoplatform.services.jcr.access.PermissionType; @@ -37,13 +43,9 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; = -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS Author : Peter Nedonosko peter.nedonosk= o(a)exoplatform.com.ua * 30.01.2008 @@ -259,5 +261,27 @@ assertEquals("Wrong permission for operators", PermissionType.SET_PR= OPERTY, iperms.get(0)); assertEquals("Wrong permission for operators", PermissionType.ADD_NO= DE, iperms.get(1)); } + = + public void testDeleteItemsById() throws Exception + { + WorkspaceDataContainer dataContainer =3D + (WorkspaceDataContainer) session.getContainer().getComponen= tInstanceOfType(WorkspaceDataContainer.class); = + List propertysData =3D dataManager.getChildPropertiesD= ata(testRoot); + + assertNotNull(propertysData); + assertEquals(1, propertysData.size()); + + PropertyData primaryTypeData =3D propertysData.get(0); + + WorkspaceStorageConnection connection =3D dataContainer.openConnecti= on(); + + connection.deleteProperty(primaryTypeData.getIdentifier()); + connection.deleteNode(testRoot.getIdentifier()); + connection.commit(); + + assertNull(dataManager.getItemData(testRoot.getIdentifier())); + assertNull(dataManager.getItemData(primaryTypeData.getIdentifier())); + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 17 11:05:04 UTC (rev 711) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 17 11:53:08 UTC (rev 712) @@ -572,6 +572,26 @@ return null; } = + /** + * {@inheritDoc} + */ + public void deleteNode(String identifier) throws RepositoryException= , UnsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub + = + } + + /** + * {@inheritDoc} + */ + public void deleteProperty(String identifier) throws RepositoryExcep= tion, UnsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + // TODO Auto-generated method stub + = + } + } = } --===============1737009866020106000==-- From do-not-reply at jboss.org Tue Nov 17 06:57:53 2009 Content-Type: multipart/mixed; boundary="===============7132454175097234518==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r713 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 17 Nov 2009 06:57:53 -0500 Message-ID: <200911171157.nAHBvrtn000787@svn01.web.mwc.hst.phx2.redhat.com> --===============7132454175097234518== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 06:57:53 -0500 (Tue, 17 Nov 2009) New Revision: 713 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-203: loader put(List) rework, JDBC connection replaced on WorkspaceS= troageConnection Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 11:53:08= UTC (rev 712) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 11:57:53= UTC (rev 713) @@ -32,7 +32,6 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -56,14 +55,15 @@ public class JDBCCacheLoader extends AbstractCacheLoader { protected static final Log LOG =3D ExoLogger.getLogger("jcr.JDBCCacheLo= ader"); - = + private IndividualCacheLoaderConfig config; - = + private WorkspaceDataContainer dataContainer; = - public JDBCCacheLoader() { + public JDBCCacheLoader() + { } - = + /** * Init the loader DataContainer with given WorkspaceDataContainer inst= ance. * @@ -79,156 +79,187 @@ = this.dataContainer =3D dataContainer; } - = + /** + * Put all Modifications into JDBC database, but don't commite them. + * + * @param modifications List if Modification + * @param conn WorkspaceStorageConnection + * @throws RepositoryException if error = + */ + protected void apply(WorkspaceStorageConnection conn, List modifications) throws RepositoryException + { + if (LOG.isDebugEnabled()) + { + LOG.debug("Modifications list size =3D " + modifications.size()); + } + + // Prepare modifications list. + // Will be added oldValueData to modification for UPDATE. = + //prepareModifications(modifications); + + for (Modification m : modifications) + { + switch (m.getType()) + { + case PUT_DATA : + LOG.info("PUT_DATA modification"); + break; + case PUT_DATA_ERASE : + LOG.info("PUT_DATA_ERASE modification"); + break; + case PUT_KEY_VALUE : + + if (m.getOldValue() !=3D null) + doUpdate(m, conn); + else + doAdd(m, conn); + + break; + case REMOVE_DATA : + LOG.info("REMOVE_DATA modification"); + break; + case REMOVE_KEY_VALUE : + LOG.info("REMOVE_KEY_VALUE modification"); + break; + case REMOVE_NODE : + + doRemove(m, conn); + + break; + case MOVE : + LOG.info("MOVE modification"); + break; + default : + throw new CacheException("Unknown modification " + m.getTyp= e()); + } + } + } + + /** * {@inheritDoc} */ public void put(List modifications) throws Exception { - LOG.info("Modifications list size =3D " + modifications.size()); - // Prepare modifications list. - // Will be added oldValueData to modification for UPDATE. = - prepareModifications(modifications); - = - JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection)dataC= ontainer.openConnection(); - = - try - { - for (Modification m : modifications) - { - switch (m.getType()) - { - case PUT_DATA: - break; - case PUT_DATA_ERASE: - break; - case PUT_KEY_VALUE: - = - if (m.getOldValue() !=3D null) - doUpdate(m, jdbcConnection); - else = - doAdd(m, jdbcConnection); - = - break; - case REMOVE_DATA: - break; - case REMOVE_KEY_VALUE: - break; - case REMOVE_NODE: - = - doRemove(m, jdbcConnection); - = - break; - case MOVE: - break; - default: - throw new CacheException("Unknown modification " + m.getT= ype()); - } - } - = - if (jdbcConnection !=3D null) { - jdbcConnection.commit(); - jdbcConnection =3D null; - } - } = - catch (Exception e) - { - LOG.error("Can not put data to DB", e); - throw e; - } - finally - { - if (jdbcConnection !=3D null && jdbcConnection.isOpened()) { - jdbcConnection.rollback(); - } - = - } + if (LOG.isDebugEnabled()) + { + LOG.debug("Modifications list size =3D " + modifications.size()); + } + + // Prepare modifications list. + // Will be added oldValueData to modification for UPDATE. = + //prepareModifications(modifications); + + WorkspaceStorageConnection conn =3D dataContainer.openConnection(); + try + { + apply(conn, modifications); + conn.commit(); + } + catch (RepositoryException e) + { + LOG.error("RepositoryException: ", e); // TODO cleanup + throw new RepositoryException(e); + } + catch (IllegalStateException e) + { + LOG.error("IllegalStateException: ", e); // TODO cleanup + throw new IllegalStateException(e); + } + finally + { + if (conn !=3D null && conn.isOpened()) + { + conn.rollback(); + } + } } = /** * Remove NodeData or PropertyData. * = * @param modification - * @param jdbcConnection + * @param conn * @param identifier * @throws IllegalStateException * @throws RepositoryException */ - private void doRemove(Modification modification, JDBCStorageConnection = jdbcConnection) - throws IllegalStateException, RepositoryException + private void doRemove(Modification modification, WorkspaceStorageConnec= tion conn) throws IllegalStateException, + RepositoryException { = - if ( modification.getFqn().size() =3D=3D 2 && (modification.getFqn()= .get(0).equals(JBossCacheStorage.NODES) || - modification.getFqn().get(0).equals(JBossCacheStorage.PROPS))) + if (modification.getFqn().size() =3D=3D 2 + && (modification.getFqn().get(0).equals(JBossCacheStorage.NODES) = || modification.getFqn().get(0).equals( + JBossCacheStorage.PROPS))) { = // TODO The removed ItemData was setting to value in prepareModif= ications(); // That is need because we do not get NodeData from DB if we dele= te property with primaytype. = - = -// String identifier =3D (String) modification.getFqn().get(1); -// ItemData itemData =3D jdbcConnection.getItemData(identifier); - = - ItemData itemData =3D (ItemData) modification.getValue(); - = + + // String identifier =3D (String) modification.getFqn().g= et(1); + // ItemData itemData =3D jdbcConnection.getItemData(ident= ifier); + + ItemData itemData =3D (ItemData)modification.getValue(); + if (itemData instanceof NodeData) - jdbcConnection.delete((NodeData) itemData); + conn.delete((NodeData)itemData); if (itemData instanceof PropertyData) - jdbcConnection.delete((PropertyData) itemData); + conn.delete((PropertyData)itemData); } } - = + /** * Performs ADD to NodeData and PropertyData. * @param modification - * @param jdbcConnection + * @param conn * @throws IllegalStateException * @throws RepositoryException */ - private void doAdd(Modification modification, JDBCStorageConnection jdb= cConnection) - throws IllegalStateException, RepositoryException + private void doAdd(Modification modification, WorkspaceStorageConnectio= n conn) throws IllegalStateException, + RepositoryException { if (modification.getValue() instanceof NodeData) { //add node data NodeData nodeData =3D (NodeData)modification.getValue(); = - jdbcConnection.add(nodeData); + conn.add(nodeData); } else if (modification.getValue() instanceof PropertyData) { //add property data PropertyData propertyData =3D (PropertyData)modification.getValue= (); = - jdbcConnection.add(propertyData); + conn.add(propertyData); } } - = + /** * Performs UPDATE to NodeData and PropertyData. * @param modification - * @param jdbcConnection + * @param conn * @throws IllegalStateException * @throws RepositoryException */ - private void doUpdate(Modification modification, JDBCStorageConnection = jdbcConnection) - throws IllegalStateException, RepositoryException + private void doUpdate(Modification modification, WorkspaceStorageConnec= tion conn) throws IllegalStateException, + RepositoryException { if (modification.getValue() instanceof NodeData) { //update node data NodeData nodeData =3D (NodeData)modification.getValue(); = - jdbcConnection.update(nodeData); + conn.update(nodeData); } else if (modification.getValue() instanceof PropertyData) { //update property data PropertyData propertyData =3D (PropertyData)modification.getValue= (); = - jdbcConnection.update(propertyData); + conn.update(propertyData); } } - = + /** * Prepare list of modifications. * = @@ -237,47 +268,49 @@ * @param modifications * @throws RepositoryException */ + @Deprecated private void prepareModifications(List modifications) thr= ows RepositoryException { - JDBCStorageConnection jdbcConnection =3D (JDBCStorageConnection) dat= aContainer.openConnection(); + WorkspaceStorageConnection conn =3D dataContainer.openConnection(); = - try { + try + { for (int i =3D 0; i < modifications.size(); i++) { Modification m =3D modifications.get(i); if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) { ItemData itemData =3D null; - = + //Check add or update node data. if (m.getValue() instanceof NodeData) { - NodeData nodeData =3D (NodeData) m.getValue(); - itemData =3D jdbcConnection.getItemData(nodeData.getIden= tifier()); - = + NodeData nodeData =3D (NodeData)m.getValue(); + itemData =3D conn.getItemData(nodeData.getIdentifier()); + // Set oldValueData for update node. - if (itemData !=3D null) = + if (itemData !=3D null) modifications.get(i).setOldValue(itemData); } else if (m.getValue() instanceof PropertyData) { - PropertyData propertyData =3D (PropertyData) m.getValue(= ); - itemData =3D jdbcConnection.getItemData(propertyData.get= Identifier()); - = + PropertyData propertyData =3D (PropertyData)m.getValue(); + itemData =3D conn.getItemData(propertyData.getIdentifier= ()); + // Set oldValueData for update property. - if (itemData !=3D null) = + if (itemData !=3D null) modifications.get(i).setOldValue(itemData); - } = + } } else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) { if (m.getFqn().size() =3D=3D 2 - && (m.getFqn().get(0).equals(JBossCacheStorage.NOD= ES) = - || m.getFqn().get(0).equals(JBossCacheStorage.PROP= S))) + && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) ||= m.getFqn().get(0).equals( + JBossCacheStorage.PROPS))) { - String id =3D (String) m.getFqn().get(1); - ItemData removedItemData =3D jdbcConnection.getItemData(= id); - = + String id =3D (String)m.getFqn().get(1); + ItemData removedItemData =3D conn.getItemData(id); + // Set valueData for update property or node. if (removedItemData !=3D null) modifications.get(i).setValue(removedItemData); @@ -287,7 +320,7 @@ } finally { - jdbcConnection.close(); + conn.close(); } } = @@ -311,7 +344,7 @@ { = Map attrs =3D new LinkedHashMap(); - = + if (name.size() > 1) { if (name.get(0).equals(JBossCacheStorage.NODES)) @@ -324,8 +357,8 @@ = try { - NodeData nodeData =3D (NodeData) conn.getItemData(name.g= etLastElementAsString()); - = + NodeData nodeData =3D (NodeData)conn.getItemData(name.ge= tLastElementAsString()); + if (nodeData !=3D null) { attrs.put(JBossCacheStorage.ITEM_DATA, nodeData); @@ -339,28 +372,28 @@ } finally { - conn.close(); + conn.close(); } } // /$NODES// else if (name.size() =3D=3D 3) { QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); - = + // return [ITEM_Id : nodeData_ID] WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); = try { - NodeData parentNodeData =3D (NodeData) conn.getItemData(= (String)name.get(1)); - = + NodeData parentNodeData =3D (NodeData)conn.getItemData((= String)name.get(1)); + //TODO We do not throw exception if parentNodeData not = exists in DB, because we use that method (get(Fqn name)) in exists(Fqn name= ). = /*if (parentNodeData =3D=3D null) throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'.");*/ - = + if (parentNodeData !=3D null) { - NodeData nodeData =3D (NodeData) conn.getItemData(par= entNodeData, nodeName); + NodeData nodeData =3D (NodeData)conn.getItemData(pare= ntNodeData, nodeName); if (nodeData !=3D null) attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getI= dentifier()); } @@ -381,19 +414,19 @@ = try { - PropertyData propertyData =3D (PropertyData) conn.getIte= mData(name.getLastElementAsString()); - = + PropertyData propertyData =3D (PropertyData)conn.getItem= Data(name.getLastElementAsString()); + if (propertyData !=3D null) - attrs.put(JBossCacheStorage.ITEM_DATA, propertyData); + attrs.put(JBossCacheStorage.ITEM_DATA, propertyData); } finally { conn.close(); } - } = + } } } - = + return (attrs.size() =3D=3D 0 ? null : attrs); } = @@ -412,19 +445,20 @@ public Set getChildrenNames(Fqn name) throws Exception { // return child nodes names - = + Set childs =3D new LinkedHashSet(); - = + // /$NODES/ - if (name.size() =3D=3D 2) = + if (name.size() =3D=3D 2) { WorkspaceStorageConnection conn =3D dataContainer.openConnection(= ); try { - NodeData parentNodeData =3D (NodeData)conn.getItemData((String= ) name.get(1)); - = + NodeData parentNodeData =3D (NodeData)conn.getItemData((String= )name.get(1)); + if (parentNodeData =3D=3D null) - throw new JDBCCacheLoaderException("The parent node with ID= =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'."); + throw new JDBCCacheLoaderException("The parent node with ID= =3D " + (String)name.get(1) + + " not exis, FQN =3D '" + name + "'."); = // get child nodes by parent Id for (NodeData node : conn.getChildNodesData(parentNodeData)) @@ -437,7 +471,7 @@ conn.close(); } } - = + return (childs.size() =3D=3D 0 ? null : childs); } = @@ -452,8 +486,66 @@ /** * {@inheritDoc} */ + public void setConfig(IndividualCacheLoaderConfig config) + { + this.config =3D config; + + } + + // TRANSACTION support + + /** + * {@inheritDoc} + */ + public void prepare(Object tx, List modifications, boolea= n one_phase) throws Exception + { + + put(modifications); + + if (one_phase) + { + //put(modifications); + //commitJDBC(); + } + else + { + //transactions.put(tx, modifications); + } + } + + /** + * {@inheritDoc} + */ + public void commit(Object tx) throws Exception + { + // List modifications =3D transactions.remove(tx); + // if (modifications =3D=3D null) + // { + // throw new Exception("transaction " + tx + " not found in = transaction table"); + // } + // put(modifications); + + //commitJDBC(); + } + + /** + * {@inheritDoc} + */ + public void rollback(Object tx) + { + //transactions.remove(tx); + + //rollbackJDBC(); + } + + // SHOULD NOT BE USED methods + + /** + * {@inheritDoc} + */ public Object put(Fqn name, Object key, Object value) throws Exception { + LOG.error("The method 'put(Fqn name, Object key, Object value))' sho= uld not be called."); throw new JDBCCacheLoaderException("The method 'put(Fqn name, Object= key, Object value))' should not be called."); } = @@ -462,7 +554,9 @@ */ public void put(Fqn name, Map attributes) throws Except= ion { - throw new JDBCCacheLoaderException("The method 'put(Fqn name, Map attributes)' should not be called."); + LOG.error("The method 'put(Fqn name, Map attributes)= ' should not be called."); + throw new JDBCCacheLoaderException( + "The method 'put(Fqn name, Map attributes)' shoul= d not be called."); } = /** @@ -470,6 +564,7 @@ */ public Object remove(Fqn fqn, Object key) throws Exception { + LOG.error("The method 'remove(Fqn fqn, Object key)' should not be ca= lled."); throw new JDBCCacheLoaderException("The method 'remove(Fqn fqn, Obje= ct key)' should not be called."); } = @@ -478,6 +573,7 @@ */ public void remove(Fqn fqn) throws Exception { + LOG.error("The method 'remove(Fqn fqn)' should not be called."); throw new JDBCCacheLoaderException("The method 'remove(Fqn fqn)' sho= uld not be called."); } = @@ -486,16 +582,10 @@ */ public void removeData(Fqn fqn) throws Exception { + LOG.error("The method 'removeData(Fqn fqn)' should not be called."); throw new JDBCCacheLoaderException("The method 'removeData(Fqn fqn)'= should not be called."); } = - /** - * {@inheritDoc} - */ - public void setConfig(IndividualCacheLoaderConfig config) - { - this.config =3D config; + // etc. = - } - } --===============7132454175097234518==-- From do-not-reply at jboss.org Tue Nov 17 07:26:26 2009 Content-Type: multipart/mixed; boundary="===============8106467343125150967==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r714 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 17 Nov 2009 07:26:25 -0500 Message-ID: <200911171226.nAHCQP8n006820@svn01.web.mwc.hst.phx2.redhat.com> --===============8106467343125150967== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 07:26:25 -0500 (Tue, 17 Nov 2009) New Revision: 714 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-203: JDBC loader TX support Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 11:57:53= UTC (rev 713) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 12:26:25= UTC (rev 714) @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; = import javax.jcr.RepositoryException; = @@ -56,6 +57,12 @@ { protected static final Log LOG =3D ExoLogger.getLogger("jcr.JDBCCacheLo= ader"); = + /** + * Storage connections involved in transactions. + */ + protected Map transactions =3D + new ConcurrentHashMap(); + private IndividualCacheLoaderConfig config; = private WorkspaceDataContainer dataContainer; @@ -81,7 +88,7 @@ } = /** - * Put all Modifications into JDBC database, but don't commite them. + * Apply all Modifications to JDBC database, but don't commite them. * * @param modifications List if Modification * @param conn WorkspaceStorageConnection @@ -103,10 +110,10 @@ switch (m.getType()) { case PUT_DATA : - LOG.info("PUT_DATA modification"); + LOG.warn("PUT_DATA modification"); break; case PUT_DATA_ERASE : - LOG.info("PUT_DATA_ERASE modification"); + LOG.warn("PUT_DATA_ERASE modification"); break; case PUT_KEY_VALUE : = @@ -117,10 +124,10 @@ = break; case REMOVE_DATA : - LOG.info("REMOVE_DATA modification"); + LOG.warn("REMOVE_DATA modification"); break; case REMOVE_KEY_VALUE : - LOG.info("REMOVE_KEY_VALUE modification"); + LOG.warn("REMOVE_KEY_VALUE modification"); break; case REMOVE_NODE : = @@ -128,7 +135,7 @@ = break; case MOVE : - LOG.info("MOVE modification"); + LOG.warn("MOVE modification"); break; default : throw new CacheException("Unknown modification " + m.getTyp= e()); @@ -492,24 +499,36 @@ = } = - // TRANSACTION support + // 2-phase TRANSACTION support = /** * {@inheritDoc} */ - public void prepare(Object tx, List modifications, boolea= n one_phase) throws Exception + public void prepare(Object tx, List modifications, boolea= n onePhase) throws Exception { = - put(modifications); + final WorkspaceStorageConnection exconn =3D transactions.remove(tx); + if (exconn !=3D null) + { + apply(exconn, modifications); + } + else + { + final WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + apply(exconn, modifications); + transactions.put(tx, conn); + } = - if (one_phase) + final WorkspaceStorageConnection conn =3D dataContainer.openConnecti= on(); + apply(conn, modifications); + + if (onePhase) { - //put(modifications); - //commitJDBC(); + conn.commit(); } else { - //transactions.put(tx, modifications); + transactions.put(tx, conn); } } = @@ -518,14 +537,13 @@ */ public void commit(Object tx) throws Exception { - // List modifications =3D transactions.remove(tx); - // if (modifications =3D=3D null) - // { - // throw new Exception("transaction " + tx + " not found in = transaction table"); - // } - // put(modifications); + final WorkspaceStorageConnection conn =3D transactions.remove(tx); + if (conn =3D=3D null) + { + throw new RepositoryException("Transaction " + tx + " not found i= n transaction table."); + } = - //commitJDBC(); + conn.commit(); } = /** @@ -533,9 +551,23 @@ */ public void rollback(Object tx) { - //transactions.remove(tx); - - //rollbackJDBC(); + final WorkspaceStorageConnection conn =3D transactions.remove(tx); + if (conn !=3D null) + { + try + { + conn.rollback(); + } + catch (Throwable e) + { + // TODO why we cannot throw an exception??? + LOG.error("Error of transaction " + tx + " rollback.", e); + } + } + else + { + LOG.warn("Transaction " + tx + " not found in transaction table, = but rollback called."); + } } = // SHOULD NOT BE USED methods --===============8106467343125150967==-- From do-not-reply at jboss.org Tue Nov 17 07:39:36 2009 Content-Type: multipart/mixed; boundary="===============8314684042694960737==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r715 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 17 Nov 2009 07:39:36 -0500 Message-ID: <200911171239.nAHCda6d009377@svn01.web.mwc.hst.phx2.redhat.com> --===============8314684042694960737== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 07:39:35 -0500 (Tue, 17 Nov 2009) New Revision: 715 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-203: JDBC loader TX support (fixes) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 12:26:25= UTC (rev 714) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 12:39:35= UTC (rev 715) @@ -506,29 +506,27 @@ */ public void prepare(Object tx, List modifications, boolea= n onePhase) throws Exception { - - final WorkspaceStorageConnection exconn =3D transactions.remove(tx); - if (exconn !=3D null) - { - apply(exconn, modifications); - } - else - { - final WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - apply(exconn, modifications); - transactions.put(tx, conn); - } - - final WorkspaceStorageConnection conn =3D dataContainer.openConnecti= on(); - apply(conn, modifications); - if (onePhase) { + final WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); + apply(conn, modifications); conn.commit(); } else { - transactions.put(tx, conn); + final WorkspaceStorageConnection exconn =3D transactions.remove(t= x); + if (exconn !=3D null) + { + // apply in existed connection associated with tx + apply(exconn, modifications); + } + else + { + // open new tx conn, apply in it, save the conn + final WorkspaceStorageConnection conn =3D dataContainer.openCo= nnection(); + apply(conn, modifications); + transactions.put(tx, conn); + } } } = --===============8314684042694960737==-- From do-not-reply at jboss.org Tue Nov 17 07:41:23 2009 Content-Type: multipart/mixed; boundary="===============2265869291019247027==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r716 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 17 Nov 2009 07:41:23 -0500 Message-ID: <200911171241.nAHCfNK5009878@svn01.web.mwc.hst.phx2.redhat.com> --===============2265869291019247027== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 07:41:22 -0500 (Tue, 17 Nov 2009) New Revision: 716 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-203: JDBC loader TX support (comments) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 12:39:35= UTC (rev 715) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 12:41:22= UTC (rev 716) @@ -510,7 +510,7 @@ { final WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); apply(conn, modifications); - conn.commit(); + conn.commit(); // same immediately = } else { --===============2265869291019247027==-- From do-not-reply at jboss.org Tue Nov 17 08:01:06 2009 Content-Type: multipart/mixed; boundary="===============2270089728899729097==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r717 - in kernel/branches/mc-int-branch: exo.kernel.commons and 10 other directories. Date: Tue, 17 Nov 2009 08:01:06 -0500 Message-ID: <200911171301.nAHD16vd012627@svn01.web.mwc.hst.phx2.redhat.com> --===============2270089728899729097== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2009-11-17 08:01:05 -0500 (Tue, 17 Nov 2009) New Revision: 717 Modified: kernel/branches/mc-int-branch/exo.kernel.commons/pom.xml kernel/branches/mc-int-branch/exo.kernel.component.cache/pom.xml kernel/branches/mc-int-branch/exo.kernel.component.command/pom.xml kernel/branches/mc-int-branch/exo.kernel.component.common/pom.xml kernel/branches/mc-int-branch/exo.kernel.component.remote/pom.xml kernel/branches/mc-int-branch/exo.kernel.container/pom.xml kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCIntegrationContainer.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml kernel/branches/mc-int-branch/packaging/module/pom.xml kernel/branches/mc-int-branch/pom.xml Log: Merged in trunk changes up to rev. 710 Modified: kernel/branches/mc-int-branch/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.commons/pom.xml 2009-11-17 12:= 41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.commons/pom.xml 2009-11-17 13:= 01:05 UTC (rev 717) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = exo.kernel.commons Modified: kernel/branches/mc-int-branch/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.cache/pom.xml 2009-1= 1-17 12:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.component.cache/pom.xml 2009-1= 1-17 13:01:05 UTC (rev 717) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.cache Modified: kernel/branches/mc-int-branch/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.command/pom.xml 2009= -11-17 12:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.component.command/pom.xml 2009= -11-17 13:01:05 UTC (rev 717) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.command Modified: kernel/branches/mc-int-branch/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.common/pom.xml 2009-= 11-17 12:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.component.common/pom.xml 2009-= 11-17 13:01:05 UTC (rev 717) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.common Modified: kernel/branches/mc-int-branch/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.remote/pom.xml 2009-= 11-17 12:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.component.remote/pom.xml 2009-= 11-17 13:01:05 UTC (rev 717) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = exo.kernel.component.remote Modified: kernel/branches/mc-int-branch/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-17 1= 2:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-17 1= 3:01:05 UTC (rev 717) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = exo.kernel.container Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/mc/MCIntegrationContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationContainer.java 2009-11-17 12:41:22 UTC = (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationContainer.java 2009-11-17 13:01:05 UTC = (rev 717) @@ -76,7 +76,7 @@ } catch (ClassNotFoundException ignored) { - log.warn("@InterceptMC not supported in this environment (compone= nt: " + componentAdapter.getComponentKey() + ") - necessary classes are mis= sing: ", ignored); + log.warn("@InterceptMC not supported in this environment (compone= nt: " + componentAdapter.getComponentKey() + ") - necessary classes are mis= sing: " + ignored); return false; } catch (NoSuchMethodException e) Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml 200= 9-11-17 12:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml 200= 9-11-17 13:01:05 UTC (rev 717) @@ -5,7 +5,7 @@ org.exoplatform.kernel.demos exo.kernel.demos - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = exo.mc-int.mc-injection Modified: kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml 2009-11-17 12:41= :22 UTC (rev 716) +++ kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml 2009-11-17 13:01= :05 UTC (rev 717) @@ -5,7 +5,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = org.exoplatform.kernel.demos Modified: kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml 2009-1= 1-17 12:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml 2009-1= 1-17 13:01:05 UTC (rev 717) @@ -6,11 +6,10 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = mc-kernel-extras - 2.2.0-Beta03-SNAPSHOT = MC Kernel 2.2.0 Selected Classes MC integration classes that aren't available in mc-kernel = 2.0.6.GA Modified: kernel/branches/mc-int-branch/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/packaging/module/pom.xml 2009-11-17 12:41= :22 UTC (rev 716) +++ kernel/branches/mc-int-branch/packaging/module/pom.xml 2009-11-17 13:01= :05 UTC (rev 717) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT = 4.0.0 Modified: kernel/branches/mc-int-branch/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/pom.xml 2009-11-17 12:41:22 UTC (rev 716) +++ kernel/branches/mc-int-branch/pom.xml 2009-11-17 13:01:05 UTC (rev 717) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.0-Beta03-SNAPSHOT + 2.2.0-Beta04-SNAPSHOT pom = eXo Kernel --===============2270089728899729097==-- From do-not-reply at jboss.org Tue Nov 17 08:13:23 2009 Content-Type: multipart/mixed; boundary="===============4105350403963529711==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r718 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 17 Nov 2009 08:13:23 -0500 Message-ID: <200911171313.nAHDDNcE015174@svn01.web.mwc.hst.phx2.redhat.com> --===============4105350403963529711== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-17 08:13:23 -0500 (Tue, 17 Nov 2009) New Revision: 718 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-245: JBossCacheStorageConnection remove() method implemented Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 13:01:05 UTC (rev 717) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 13:13:23 UTC (rev 718) @@ -21,8 +21,10 @@ import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.core.lock.LockData; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -378,20 +380,20 @@ * {@inheritDoc} */ public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, - InvalidItemStateException, IllegalStateException + InvalidItemStateException, IllegalStateException { // TODO Auto-generated method stub - = + } = /** * {@inheritDoc} */ - public void deleteProperty(String identifier) throws RepositoryExceptio= n, - UnsupportedOperationException, InvalidItemStateException, Ille= galStateException + public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, + InvalidItemStateException, IllegalStateException { // TODO Auto-generated method stub - = + } = /** @@ -449,9 +451,99 @@ public void rename(NodeData data) throws RepositoryException, Unsupport= edOperationException, InvalidItemStateException, IllegalStateException { + //TODO we expecting that on session.move() there will be only one re= name() method call + startBatch(); - // TODO move Node to a new position at the tree, - // but prev location was in prev DELETE. + + String nodeUUID =3D data.getIdentifier(); + + //1. Update renamed node and also get old parent node UUID + Node node =3D nodesRoot.getChild(makeNodeFqn(n= odeUUID)); + if (node =3D=3D null) + { + throw new RepositoryException("FATAL renamed node is not exist" += data.getQPath().getAsString()); + } + String oldParentIdentifier =3D null; + Object itemData =3D node.put(ITEM_DATA, data); + if (itemData !=3D null) + { + oldParentIdentifier =3D ((NodeData)itemData).getParentIdentifier(= ); + } + else + { + throw new RepositoryException("FATAL NodeData is empty " + data.= getQPath().getAsString()); + } + + // 2. remove renamed node from child list of previous parent node + // check if parent is cached + Node oldparent =3D nodesRoot.getChild(makeNode= Fqn(oldParentIdentifier)); + if (oldparent =3D=3D null) + { + throw new RepositoryException("Nodes old parent doesn't exist " += data.getQPath().getAsString()); + } + + // remove child on old Parent + boolean removed =3D + oldparent.removeChild(makeChildNodeFqn(data.getQPath().getEntries= ()[data.getQPath().getEntries().length - 1])); + if (!removed) + { + throw new RepositoryException("Node was not removed from child li= st of old parent " + + data.getQPath().getAsString()); + } + + // 3. add node to child list of new parent node + if (data.getParentIdentifier() !=3D null) + { + // check if parent is cached + Node newparent =3D nodesRoot.getChild(makeN= odeFqn(data.getParentIdentifier())); + if (newparent =3D=3D null) + { + throw new RepositoryException("Nodes new parent doesn't exist = " + data.getQPath().getAsString()); + } + + // add child to Parent = + Node childNode =3D + newparent.addChild(makeChildNodeFqn(data.getQPath().getEntries= ()[data.getQPath().getEntries().length - 1])); + + // set child id attr = + childNode.put(ITEM_ID, data.getIdentifier()); + } + + // 4. update all child nodes + Set> childNodes =3D node.getChildren(); + + for (Node child : childNodes) + { + String childNodeId =3D (String)child.get(ITEM_ID); + if (childNodeId =3D=3D null) + { + throw new RepositoryException("FATAL Child Node Id key is null= . Parent " + data.getQPath().getAsString()); + } + + // TODO NodeData or PropertyData? As ItemData check then and cast. + Node childnode =3D nodesRoot.getChild(makeN= odeFqn(childNodeId)); + if (childnode =3D=3D null) + { + throw new RepositoryException("FATAL Node record not found(" += childNodeId + "), but listed in childs of " + + data.getQPath().getAsString()); + } + NodeData nodeData =3D (NodeData)childnode.get(ITEM_DATA); + if (nodeData =3D=3D null) + { + // TODO should not occurs by contract + throw new RepositoryException("Child node data is null. Parent= " + data.getQPath().getAsString()); + } + + //repack child NodeData with new QPath + //TODO check it + QPath newPath =3D QPath.makeChildPath(data.getQPath(), nodeData.g= etQPath().getName()); + TransientNodeData newNodeData =3D + new TransientNodeData(newPath, nodeData.getIdentifier(), nodeD= ata.getPersistedVersion(), nodeData + .getPrimaryTypeName(), nodeData.getMixinTypeNames(), nodeDa= ta.getOrderNumber(), nodeData + .getParentIdentifier(), nodeData.getACL()); + childnode.put(ITEM_DATA, newNodeData); + } + } = /** --===============4105350403963529711==-- From do-not-reply at jboss.org Tue Nov 17 08:17:40 2009 Content-Type: multipart/mixed; boundary="===============2174837698553571579==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r719 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/core/query and 1 other directory. Date: Tue, 17 Nov 2009 08:17:40 -0500 Message-ID: <200911171317.nAHDHeV7015940@svn01.web.mwc.hst.phx2.redhat.com> --===============2174837698553571579== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-17 08:17:40 -0500 (Tue, 17 Nov 2009) New Revision: 719 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/ItemImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/SessionDataManager.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/api/core/query/UpperLowerCaseQueryTest.java Log: EXOJCR-221: add, getNodes improvement Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/ItemImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-17 13:13:23 UTC (rev 718) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-17 13:17:40 UTC (rev 719) @@ -104,20 +104,15 @@ protected ValueFactoryImpl valueFactory; = /** - * Hashcode. - */ - protected final int itemHashCode; - - /** - * ItemImpl constructor. - * = - * @param data - * ItemData object - * @param session - * Session object - * @throws RepositoryException - * if any Exception is occurred - */ + * ItemImpl constructor. + * = + * @param data + * ItemData object + * @param session + * Session object + * @throws RepositoryException + * if any Exception is occurred + */ ItemImpl(ItemData data, SessionImpl session) throws RepositoryException { = @@ -127,8 +122,6 @@ this.dataManager =3D session.getTransientNodesManager(); this.locationFactory =3D session.getLocationFactory(); this.valueFactory =3D session.getValueFactory(); - - itemHashCode =3D (session.getWorkspace().getName() + data.getIdentif= ier()).hashCode(); } = protected void invalidate() @@ -803,15 +796,6 @@ return false; } = - /** - * {@inheritDoc} - */ - @Override - public int hashCode() - { - return itemHashCode; - } - private ValueData valueData(Value value, int type) throws RepositoryExc= eption, ValueFormatException { = Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-17 13:13:23 UT= C (rev 718) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-17 13:17:40 UT= C (rev 719) @@ -466,18 +466,12 @@ public boolean isNew(String identifier) { = - List states =3D changesLog.getItemStates(identifier); - ItemState lastState =3D states.size() > 0 ? states.get(states.size()= - 1) : null; + ItemState lastState =3D changesLog.getItemState(identifier); = if (lastState =3D=3D null || lastState.isDeleted()) return false; = - for (ItemState state : states) - { - if (state.isAdded()) - return true; - } - return false; + return changesLog.getItemState(identifier, ItemState.ADDED) !=3D nul= l; } = /** @@ -534,7 +528,8 @@ // [PN] 21.12.07 use item data NodeData parent =3D (NodeData)getItemData(data.getParentIdentifie= r()); // skip not permitted - if (accessManager.hasPermission(parent.getACL(), PermissionType.R= EAD, session.getUserState().getIdentity())) + if (accessManager.hasPermission(parent.getACL(), new String[]{Per= missionType.READ}, session.getUserState() + .getIdentity())) { PropertyImpl item =3D null; ItemState state =3D changesLog.getItemState(identifier); @@ -587,7 +582,8 @@ = session.getActionHandler().postRead(item); = - if (accessManager.hasPermission(data.getACL(), PermissionType.= READ, session.getUserState().getIdentity())) + if (accessManager.hasPermission(data.getACL(), new String[]{Pe= rmissionType.READ}, session.getUserState() + .getIdentity())) { if (pool) item =3D (NodeImpl)itemsPool.get(item); @@ -633,7 +629,8 @@ { ItemImpl item =3D itemFactory.createItem(data); session.getActionHandler().postRead(item); - if (accessManager.hasPermission(parent.getACL(), PermissionTyp= e.READ, session.getUserState().getIdentity())) + if (accessManager.hasPermission(parent.getACL(), new String[]{= PermissionType.READ}, session.getUserState() + .getIdentity())) { if (pool) item =3D itemsPool.get(item); @@ -676,31 +673,8 @@ */ public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on { - int childsCount =3D changesLog.getChildNodesCount(parent.getIdentifi= er()); - - // for (ItemState change : changesLog.getAllStates()) - // { - // if (change.isNode() && change.isPersisted() - // && parent.getIdentifier().equals(change.getData().getP= arentIdentifier())) - // { - // if (change.isDeleted()) - // { - // childsCount--; - // } - // else if (change.isAdded()) - // { - // childsCount++; - // } - // } - // } - // - // if (childsCount !=3D changesLog.getChildNodesCount(parent.ge= tIdentifier())) - // { - // System.out.println(""); - // changesLog.getChildNodesCount(parent.getIdentifier()); - // } - - childsCount =3D transactionableManager.getChildNodesCount(parent) + = childsCount; + int childsCount =3D + changesLog.getChildNodesCount(parent.getIdentifier()) + transacti= onableManager.getChildNodesCount(parent); if (childsCount < 0) { throw new InvalidItemStateException("Node's child nodes were chan= ged in another Session " @@ -1303,8 +1277,8 @@ // Remove propery or node if (changedItem.isDeleted()) { - if (!accessManager.hasPermission(parent.getACL(), PermissionTy= pe.REMOVE, session.getUserState() - .getIdentity())) + if (!accessManager.hasPermission(parent.getACL(), new String[]= {PermissionType.REMOVE}, session + .getUserState().getIdentity())) throw new AccessDeniedException("Access denied: REMOVE " + changedItem.getData().getQPath().getAsString() + " for= : " + session.getUserID() + " item owner " + parent.getACL().getOwner()); @@ -1314,8 +1288,8 @@ // add node if (changedItem.isAdded()) { - if (!accessManager.hasPermission(parent.getACL(), Permissio= nType.ADD_NODE, session.getUserState() - .getIdentity())) + if (!accessManager.hasPermission(parent.getACL(), new Strin= g[]{PermissionType.ADD_NODE}, session + .getUserState().getIdentity())) { throw new AccessDeniedException("Access denied: ADD_NODE= " + changedItem.getData().getQPath().getAsString() + " = for: " + session.getUserID() + " item owner " @@ -1326,8 +1300,8 @@ else if (changedItem.isAdded() || changedItem.isUpdated()) { // add or update property - if (!accessManager.hasPermission(parent.getACL(), PermissionTy= pe.SET_PROPERTY, session.getUserState() - .getIdentity())) + if (!accessManager.hasPermission(parent.getACL(), new String[]= {PermissionType.SET_PROPERTY}, session + .getUserState().getIdentity())) throw new AccessDeniedException("Access denied: SET_PROPERT= Y " + changedItem.getData().getQPath().getAsString() + " for= : " + session.getUserID() + " item owner " + parent.getACL().getOwner()); @@ -1686,10 +1660,6 @@ { ret.add(childNode); = - if (log.isDebugEnabled()) - log.debug("Traverse transient (N) " + childNode.getData(= ).getQPath().getAsString() + " " - + ItemState.nameFromValue(childNode.getState())); - if (deep) traverseTransientDescendants(childNode.getData(), deep, = action, ret); } @@ -1700,17 +1670,14 @@ for (ItemState childProp : childProps) { ret.add(childProp); - - if (log.isDebugEnabled()) - log.debug("Traverse transient (P) " + childProp.getData= ().getQPath().getAsString()); } } } } = /** - * Pool for touched items. - */ + * Pool for touched items. + */ protected final class ItemReferencePool { = Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/api/core/query/UpperLowerCaseQueryTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/api/core/query/UpperLowerCaseQueryTest.java 2009-11-17 1= 3:13:23 UTC (rev 718) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/api/core/query/UpperLowerCaseQueryTest.java 2009-11-17 1= 3:17:40 UTC (rev 719) @@ -16,9 +16,9 @@ */ package org.exoplatform.services.jcr.api.core.query; = - - +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Random; import java.util.Set; = @@ -32,295 +32,276 @@ * fn:upper-case() in XPath, LOWER() and UPPER() in SQL and UpperCase and * LowerCase in JQOM. */ -public class UpperLowerCaseQueryTest extends AbstractQueryTest { +public class UpperLowerCaseQueryTest extends AbstractQueryTest +{ = -// /** -// * Maps operator strings to QueryObjectModelConstants. -// */ -// private static final Map OPERATORS =3D new HashMap(); -// -// static { -// OPERATORS.put("=3D", new Integer(OPERATOR_EQUAL_TO)); -// OPERATORS.put(">", new Integer(OPERATOR_GREATER_THAN)); -// OPERATORS.put(">=3D", new Integer(OPERATOR_GREATER_THAN_OR_EQUAL= _TO)); -// OPERATORS.put("<", new Integer(OPERATOR_LESS_THAN)); -// OPERATORS.put("<=3D", new Integer(OPERATOR_LESS_THAN_OR_EQUAL_TO= )); -// OPERATORS.put("like", new Integer(OPERATOR_LIKE)); -// OPERATORS.put("!=3D", new Integer(OPERATOR_NOT_EQUAL_TO)); -// } + // /** + // * Maps operator strings to QueryObjectModelConstants. + // */ + // private static final Map OPERATORS =3D new HashMap(); + // + // static { + // OPERATORS.put("=3D", new Integer(OPERATOR_EQUAL_TO)); + // OPERATORS.put(">", new Integer(OPERATOR_GREATER_THAN)); + // OPERATORS.put(">=3D", new Integer(OPERATOR_GREATER_THAN_OR_EQ= UAL_TO)); + // OPERATORS.put("<", new Integer(OPERATOR_LESS_THAN)); + // OPERATORS.put("<=3D", new Integer(OPERATOR_LESS_THAN_OR_EQUAL= _TO)); + // OPERATORS.put("like", new Integer(OPERATOR_LIKE)); + // OPERATORS.put("!=3D", new Integer(OPERATOR_NOT_EQUAL_TO)); + // } = - public void testEqualsGeneralComparison() throws RepositoryException { - check(new String[]{"foo", "Foo", "fOO", "FOO", "fooBar", "fo", "fo= oo"}, - "=3D", - "foo", - new boolean[]{true, true, true, true, false, false, false}= ); - check(new String[]{"foo"}, "=3D", "", new boolean[]{false}); - check(new String[]{""}, "=3D", "", new boolean[]{true}); - } + public void testEqualsGeneralComparison() throws RepositoryException + { + check(new String[]{"foo", "Foo", "fOO", "FOO", "fooBar", "fo", "fooo= "}, "=3D", "foo", new boolean[]{true, true, + true, true, false, false, false}); + check(new String[]{"foo"}, "=3D", "", new boolean[]{false}); + check(new String[]{""}, "=3D", "", new boolean[]{true}); + } = - public void testGreaterThanGeneralComparison() throws RepositoryExcept= ion { - // check edges - check(new String[]{"foo", "FOO", "FoO", "fOo", "FON", "fon", "fo",= "FO"}, - ">", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"foo ", "FOOa", "FoOO", "fOo1", "FOp", "foP", "= fp", "g", "G"}, - ">", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, - ">", - "foo", - new boolean[]{false, true, true, false, false, false}); - } + public void testGreaterThanGeneralComparison() throws RepositoryExcepti= on + { + // check edges + check(new String[]{"foo", "FOO", "FoO", "fOo", "FON", "fon", "fo", "= FO"}, ">", "foo", new boolean[]{false, false, + false, false, false, false, false, false}); + check(new String[]{"foo ", "FOOa", "FoOO", "fOo1", "FOp", "foP", "fp= ", "g", "G"}, ">", "foo", new boolean[]{true, + true, true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, ">", = "foo", new boolean[]{false, true, true, + false, false, false}); + } = - public void testLessThanGeneralComparison() throws RepositoryException= { - // check edges - check(new String[]{"foo", "FOO", "FoO", "fOo", "foOo", "foo ", "fo= oa", "fop"}, - "<", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"fo", "FOn", "FoN", "fO", "FO1", "fn", "fN", "E= ", "e"}, - "<", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, - "<", - "foo", - new boolean[]{false, false, false, true, true, true}); - } + public void testLessThanGeneralComparison() throws RepositoryException + { + // check edges + check(new String[]{"foo", "FOO", "FoO", "fOo", "foOo", "foo ", "fooa= ", "fop"}, "<", "foo", new boolean[]{false, + false, false, false, false, false, false, false}); + check(new String[]{"fo", "FOn", "FoN", "fO", "FO1", "fn", "fN", "E",= "e"}, "<", "foo", new boolean[]{true, true, + true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, "<", = "foo", new boolean[]{false, false, false, + true, true, true}); + } = - public void testGreaterEqualsGeneralComparison() throws RepositoryExce= ption { - // check edges - check(new String[]{"fo", "FO", "Fon", "fONo", "FON", "fO", "fo", "= FO"}, - ">=3D", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"foo", "FoO", "FoOO", "fOo1", "FOp", "foP", "fp= ", "g", "G"}, - ">=3D", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fooo", "FOo", "fo", "FON", "fon"}, - ">=3D", - "foo", - new boolean[]{true, true, true, false, false, false}); - } + public void testGreaterEqualsGeneralComparison() throws RepositoryExcep= tion + { + // check edges + check(new String[]{"fo", "FO", "Fon", "fONo", "FON", "fO", "fo", "FO= "}, ">=3D", "foo", new boolean[]{false, false, + false, false, false, false, false, false}); + check(new String[]{"foo", "FoO", "FoOO", "fOo1", "FOp", "foP", "fp",= "g", "G"}, ">=3D", "foo", new boolean[]{true, + true, true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fooo", "FOo", "fo", "FON", "fon"}, ">=3D"= , "foo", new boolean[]{true, true, true, false, + false, false}); + } = - public void testLessEqualsGeneralComparison() throws RepositoryExcepti= on { - // check edges - check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "= fp", "G"}, - "<=3D", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"foo", "FoO", "Foo", "fOn", "FO", "fo", "f", "E= ", "e"}, - "<=3D", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, - "<=3D", - "foo", - new boolean[]{true, true, true, false, false, false}); - } + public void testLessEqualsGeneralComparison() throws RepositoryException + { + // check edges + check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "fp= ", "G"}, "<=3D", "foo", new boolean[]{false, + false, false, false, false, false, false, false}); + check(new String[]{"foo", "FoO", "Foo", "fOn", "FO", "fo", "f", "E",= "e"}, "<=3D", "foo", new boolean[]{true, true, + true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, "<=3D"= , "foo", new boolean[]{true, true, true, false, + false, false}); + } = - public void testNotEqualsGeneralComparison() throws RepositoryExceptio= n { - // check edges - check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "= fp", "G", ""}, - "!=3D", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - check(new String[]{"foo", "FoO", "Foo", "foO", "FOO"}, - "!=3D", - "foo", - new boolean[]{false, false, false, false, false}); - // check combinations - check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, - "!=3D", - "foo", - new boolean[]{false, true, false, true, true, true}); - } + public void testNotEqualsGeneralComparison() throws RepositoryException + { + // check edges + check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "fp= ", "G", ""}, "!=3D", "foo", new boolean[]{true, + true, true, true, true, true, true, true, true}); + check(new String[]{"foo", "FoO", "Foo", "foO", "FOO"}, "!=3D", "foo"= , new boolean[]{false, false, false, false, + false}); + // check combinations + check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, "!=3D"= , "foo", new boolean[]{false, true, false, + true, true, true}); + } = - public void testLikeComparison() throws RepositoryException { - check(new String[]{"foo", "Foo", "fOO", "FO "}, - "like", - "fo_", - new boolean[]{true, true, true, true}); - check(new String[]{"foo", "Foo", "fOO", "FOO"}, - "like", - "f_o", - new boolean[]{true, true, true, true}); - check(new String[]{"foo", "Foo", "fOO", " OO"}, - "like", - "_oo", - new boolean[]{true, true, true, true}); - check(new String[]{"foo", "Foa", "fOO", "FO", "foRm", "fPo", "fno"= , "FPo", "Fno"}, - "like", - "fo%", - new boolean[]{true, true, true, true, true, false, false, = false, false}); - } + public void testLikeComparison() throws RepositoryException + { + check(new String[]{"foo", "Foo", "fOO", "FO "}, "like", "fo_", new b= oolean[]{true, true, true, true}); + check(new String[]{"foo", "Foo", "fOO", "FOO"}, "like", "f_o", new b= oolean[]{true, true, true, true}); + check(new String[]{"foo", "Foo", "fOO", " OO"}, "like", "_oo", new b= oolean[]{true, true, true, true}); + check(new String[]{"foo", "Foa", "fOO", "FO", "foRm", "fPo", "fno", = "FPo", "Fno"}, "like", "fo%", new boolean[]{ + true, true, true, true, true, false, false, false, false}); + } = - public void testLikeComparisonRandom() throws RepositoryException { - String abcd =3D "abcd"; - Random random =3D new Random(); - for (int i =3D 0; i < 50; i++) { - String pattern =3D ""; - pattern +=3D getRandomChar(abcd, random); - pattern +=3D getRandomChar(abcd, random); + public void testLikeComparisonRandom() throws RepositoryException + { + String abcd =3D "abcd"; + Random random =3D new Random(); + for (int i =3D 0; i < 50; i++) + { + String pattern =3D ""; + pattern +=3D getRandomChar(abcd, random); + pattern +=3D getRandomChar(abcd, random); = - // create 10 random values with 4 characters - String[] values =3D new String[10]; - boolean[] matches =3D new boolean[10]; - for (int n =3D 0; n < 10; n++) { - // at least the first character always matches - String value =3D String.valueOf(pattern.charAt(0)); - for (int r =3D 1; r < 4; r++) { - char c =3D getRandomChar(abcd, random); - if (random.nextBoolean()) { - c =3D Character.toUpperCase(c); - } - value +=3D c; - } - matches[n] =3D value.toLowerCase().startsWith(pattern); - values[n] =3D value; + // create 10 random values with 4 characters + String[] values =3D new String[10]; + boolean[] matches =3D new boolean[10]; + for (int n =3D 0; n < 10; n++) + { + // at least the first character always matches + String value =3D String.valueOf(pattern.charAt(0)); + for (int r =3D 1; r < 4; r++) + { + char c =3D getRandomChar(abcd, random); + if (random.nextBoolean()) + { + c =3D Character.toUpperCase(c); + } + value +=3D c; } - pattern +=3D "%"; - check(values, "like", pattern, matches); - } - } + matches[n] =3D value.toLowerCase().startsWith(pattern); + values[n] =3D value; + } + pattern +=3D "%"; + check(values, "like", pattern, matches); + } + } = - public void testRangeWithEmptyString() throws RepositoryException { - check(new String[]{" ", "a", "A", "1", "3", "!", "@"}, - ">", - "", - new boolean[]{true, true, true, true, true, true, true}); - check(new String[]{"", "a", "A", "1", "3", "!", "@"}, - ">=3D", - "", - new boolean[]{true, true, true, true, true, true, true}); - check(new String[]{"", "a", "A", "1", "3", "!", "@"}, - "<", - "", - new boolean[]{false, false, false, false, false, false, fa= lse}); - check(new String[]{"", "a", "A", "1", "3", "!", "@"}, - "<=3D", - "", - new boolean[]{true, false, false, false, false, false, fal= se}); - } + public void testRangeWithEmptyString() throws RepositoryException + { + check(new String[]{" ", "a", "A", "1", "3", "!", "@"}, ">", "", new = boolean[]{true, true, true, true, true, true, + true}); + check(new String[]{"", "a", "A", "1", "3", "!", "@"}, ">=3D", "", ne= w boolean[]{true, true, true, true, true, true, + true}); + check(new String[]{"", "a", "A", "1", "3", "!", "@"}, "<", "", new b= oolean[]{false, false, false, false, false, + false, false}); + check(new String[]{"", "a", "A", "1", "3", "!", "@"}, "<=3D", "", ne= w boolean[]{true, false, false, false, false, + false, false}); + } = - public void testInvalidQuery() throws RepositoryException { - try { - executeXPathQuery("//*[fn:lower-case(@foo) =3D 123]", new Node= []{}); - fail("must throw InvalidQueryException"); - } catch (InvalidQueryException e) { - // correct - } + public void testInvalidQuery() throws RepositoryException + { + try + { + executeXPathQuery("//*[fn:lower-case(@foo) =3D 123]", new Node[]{= }); + fail("must throw InvalidQueryException"); + } + catch (InvalidQueryException e) + { + // correct + } = - try { - executeSQLQuery("select * from nt:base where LOWER(foo) =3D 12= 3", new Node[]{}); - fail("must throw InvalidQueryException"); - } catch (InvalidQueryException e) { - // correct - } - } + try + { + executeSQLQuery("select * from nt:base where LOWER(foo) =3D 123",= new Node[]{}); + fail("must throw InvalidQueryException"); + } + catch (InvalidQueryException e) + { + // correct + } + } = - public void testWrongCaseNeverMatches() throws RepositoryException { - Node n =3D testRootNode.addNode("node"); - n.setProperty("foo", "Bar"); - testRootNode.save(); - executeXPathQuery(testPath + "/*[jcr:like(fn:lower-case(@foo), 'BA= %')]", new Node[]{}); - } + public void testWrongCaseNeverMatches() throws RepositoryException + { + Node n =3D testRootNode.addNode("node"); + n.setProperty("foo", "Bar"); + testRootNode.save(); + executeXPathQuery(testPath + "/*[jcr:like(fn:lower-case(@foo), 'BA%'= )]", new Node[]{}); + } = - //----------------------------< internal >----------------------------= ------ + //----------------------------< internal >-----------------------------= ----- = - private void check(String[] values, String operation, String queryTerm= , boolean[] matches) - throws RepositoryException { - if (values.length !=3D matches.length) { - throw new IllegalArgumentException("values and matches must ha= ve same length"); - } - // create log message - StringBuffer logMsg =3D new StringBuffer(); - logMsg.append("queryTerm: ").append(queryTerm); - logMsg.append(" values: "); - String separator =3D ""; - for (int i =3D 0; i < values.length; i++) { - logMsg.append(separator); - separator =3D ", "; - if (matches[i]) { - logMsg.append("+"); - } else { - logMsg.append("-"); - } - logMsg.append(values[i]); - } - log.println(logMsg.toString()); - for (NodeIterator it =3D testRootNode.getNodes(); it.hasNext();) { - it.nextNode().remove(); - } - Set matchingNodes =3D new HashSet(); - for (int i =3D 0; i < values.length; i++) { - Node n =3D testRootNode.addNode("node" + i); - n.setProperty(propertyName1, values[i]); - if (matches[i]) { - matchingNodes.add(n); - } - } - testRootNode.save(); + private void check(String[] values, String operation, String queryTerm,= boolean[] matches) + throws RepositoryException + { + if (values.length !=3D matches.length) + { + throw new IllegalArgumentException("values and matches must have = same length"); + } + // create log message + StringBuffer logMsg =3D new StringBuffer(); + logMsg.append("queryTerm: ").append(queryTerm); + logMsg.append(" values: "); + String separator =3D ""; + for (int i =3D 0; i < values.length; i++) + { + logMsg.append(separator); + separator =3D ", "; + if (matches[i]) + { + logMsg.append("+"); + } + else + { + logMsg.append("-"); + } + logMsg.append(values[i]); + } + log.println(logMsg.toString()); + for (NodeIterator it =3D testRootNode.getNodes(); it.hasNext();) + { + it.nextNode().remove(); + } + List matchingNodes =3D new ArrayList(); + for (int i =3D 0; i < values.length; i++) + { + Node n =3D testRootNode.addNode("node" + i); + n.setProperty(propertyName1, values[i]); + if (matches[i]) + { + matchingNodes.add(n); + } + } + testRootNode.save(); = - Node[] nodes =3D (Node[]) matchingNodes.toArray(new Node[matchingN= odes.size()]); - String sqlOperation =3D operation; - if (operation.equals("!=3D")) { - sqlOperation =3D "<>"; - } + Node[] nodes =3D (Node[])matchingNodes.toArray(new Node[matchingNode= s.size()]); + String sqlOperation =3D operation; + if (operation.equals("!=3D")) + { + sqlOperation =3D "<>"; + } = - // run queries with lower-case - String xpath =3D testPath; - if (operation.equals("like")) { - xpath +=3D "/*[jcr:like(fn:lower-case(@" + propertyName1 + - "), '" + queryTerm.toLowerCase() + "')]"; - } else { - xpath +=3D "/*[fn:lower-case(@" + propertyName1 + - ") " + operation + " '" + queryTerm.toLowerCase() + "'= ]"; - } - executeXPathQuery(xpath, nodes); + // run queries with lower-case + String xpath =3D testPath; + if (operation.equals("like")) + { + xpath +=3D "/*[jcr:like(fn:lower-case(@" + propertyName1 + "), '"= + queryTerm.toLowerCase() + "')]"; + } + else + { + xpath +=3D "/*[fn:lower-case(@" + propertyName1 + ") " + operatio= n + " '" + queryTerm.toLowerCase() + "']"; + } + executeXPathQuery(xpath, nodes); = - String sql =3D "select * from nt:base where jcr:path like '" + - testRoot + "/%' and LOWER(" + propertyName1 + ") " + - sqlOperation + " '" + queryTerm.toLowerCase() + "'"; - executeSQLQuery(sql, nodes); + String sql =3D + "select * from nt:base where jcr:path like '" + testRoot + "/%' a= nd LOWER(" + propertyName1 + ") " + + sqlOperation + " '" + queryTerm.toLowerCase() + "'"; + executeSQLQuery(sql, nodes); = + // run queries with upper-case + xpath =3D testPath; + if (operation.equals("like")) + { + xpath +=3D "/*[jcr:like(fn:upper-case(@" + propertyName1 + "), '"= + queryTerm.toUpperCase() + "')]"; + } + else + { + xpath +=3D "/*[fn:upper-case(@" + propertyName1 + ") " + operatio= n + " '" + queryTerm.toUpperCase() + "']"; + } + executeXPathQuery(xpath, nodes); = + sql =3D + "select * from nt:base where jcr:path like '" + testRoot + "/%' a= nd UPPER(" + propertyName1 + ") " + + sqlOperation + " '" + queryTerm.toUpperCase() + "'"; + executeSQLQuery(sql, nodes); = - // run queries with upper-case - xpath =3D testPath; - if (operation.equals("like")) { - xpath +=3D "/*[jcr:like(fn:upper-case(@" + propertyName1 + - "), '" + queryTerm.toUpperCase() + "')]"; - } else { - xpath +=3D "/*[fn:upper-case(@" + propertyName1 + - ") " + operation + " '" + queryTerm.toUpperCase() + "'= ]"; - } - executeXPathQuery(xpath, nodes); + } = - sql =3D "select * from nt:base where jcr:path like '" + - testRoot + "/%' and UPPER(" + propertyName1 + ") " + - sqlOperation + " '" + queryTerm.toUpperCase() + "'"; - executeSQLQuery(sql, nodes); + private char getRandomChar(String pool, Random random) + { + return pool.charAt(random.nextInt(pool.length())); + } = - - } - - private char getRandomChar(String pool, Random random) { - return pool.charAt(random.nextInt(pool.length())); - } - -// protected static int getOperatorForString(String operator) { -// Integer i =3D (Integer) OPERATORS.get(operator); -// if (i =3D=3D null) { -// throw new IllegalArgumentException("unknown operator: " + op= erator); -// } -// return i.intValue(); -// } + // protected static int getOperatorForString(String operator) { + // Integer i =3D (Integer) OPERATORS.get(operator); + // if (i =3D=3D null) { + // throw new IllegalArgumentException("unknown operator: " += operator); + // } + // return i.intValue(); + // } } --===============2174837698553571579==-- From do-not-reply at jboss.org Tue Nov 17 11:07:54 2009 Content-Type: multipart/mixed; boundary="===============2176882093725457234==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r720 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query and 4 other directories. Date: Tue, 17 Nov 2009 11:07:54 -0500 Message-ID: <200911171607.nAHG7sgT017570@svn01.web.mwc.hst.phx2.redhat.com> --===============2176882093725457234== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-17 11:07:53 -0500 (Tue, 17 Nov 2009) New Revision: 720 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexInterceptor.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexModificationsBuilder.java Removed: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManagerHolder.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/RepositoryContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SystemSearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader.xml Log: EXOJCR-241 : IndexInterceptor initial implementation Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/RepositoryContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-17 13:17:40 UTC (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-17 16:07:53 UTC (rev 720) @@ -48,9 +48,9 @@ import org.exoplatform.services.jcr.impl.core.query.QueryManagerFactory; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManager; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.JBossCacheWor= kspaceDataManager; import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; @@ -221,7 +221,8 @@ //so IndexerCacheLoader will use it. //registerComponentInstance(new SearchManagerHolder()); // workspaceContainer.registerComponentImplementation(SearchMa= nagerHolder.class); - workspaceContainer.registerComponentInstance(new SearchManager= Holder()); + workspaceContainer.registerComponentImplementation(IndexInterc= eptor.class); + if (isSystem) { //registerComponentInstance(new SearchManagerHolder()); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-17 13:17:40 UTC (rev = 719) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-17 16:07:53 UTC (rev = 720) @@ -42,6 +42,8 @@ import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexModif= icationsBuilder; import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; @@ -54,6 +56,7 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; +import org.jboss.cache.commands.WriteCommand; import org.jboss.cache.factories.annotations.NonVolatile; import org.picocontainer.Startable; = @@ -165,7 +168,7 @@ public SearchManager(QueryHandlerEntry config, NamespaceRegistryImpl ns= Reg, NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, DocumentReaderService extractor, ConfigurationManager cfm, - final RepositoryIndexSearcherHolder indexSearcherHolder, final Searc= hManagerHolder searchManagerHolder) + final RepositoryIndexSearcherHolder indexSearcherHolder, IndexInterc= eptor indexInterceptor) throws RepositoryException, RepositoryConfigurationException { = @@ -178,8 +181,9 @@ this.cfm =3D cfm; this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; - itemMgr.addItemPersistenceListener(this); - searchManagerHolder.put(this); + //itemMgr.addItemPersistenceListener(this); + //searchManagerHolder.put(this); + indexInterceptor.addIndexInterceptorListener(this); } = /** @@ -243,6 +247,41 @@ return handler; } = + public void onSaveItems(List modifications) throws Reposi= toryException + { + try + { + // nodes that need to be removed from the index. + HashSet removedNodes =3D new HashSet(); + + // nodes that need to be added to the index. + HashSet addedNodes =3D new HashSet(); + + // node thst must be updated + HashSet updateNodes =3D new HashSet(); + + IndexModificationsBuilder indexModificationsBuilder =3D + new IndexModificationsBuilder(addedNodes, removedNodes, update= Nodes); + for (WriteCommand cacheCommand : modifications) + { + cacheCommand.acceptVisitor(null, indexModificationsBuilder); + } + + for (String uuid : updateNodes) + { + removedNodes.add(uuid); + addedNodes.add(uuid); + } + + updateIndex(removedNodes, addedNodes); + } + catch (Throwable e) + { + e.printStackTrace(); + throw new RepositoryException(e.getLocalizedMessage(), e.getCause= ()); + } + } + public void onSaveItems(ItemStateChangesLog changesLog) { Exception es =3D new Exception(); Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/SearchManagerHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerHolder.java 2009-11-17 13:17:40 UTC= (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManagerHolder.java 2009-11-17 16:07:53 UTC= (rev 720) @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2003-2009 eXo Platform SAS. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see. - */ -package org.exoplatform.services.jcr.impl.core.query; - -import org.jboss.cache.factories.annotations.NonVolatile; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: = - * - * @author
Karpenko Sergiy = - * @version $Id: SearchManagerHolder.java 111 2008-11-11 11:11:11Z serg $ - */ -(a)NonVolatile -public class SearchManagerHolder -{ - protected SearchManager manager; - - public SearchManagerHolder() - { - } - - public void put(SearchManager manager) - { - this.manager =3D manager; - } - - public SearchManager get() - { - return manager; - } -} Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SystemSearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-17 13:17:40 UTC= (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-17 16:07:53 UTC= (rev 720) @@ -26,6 +26,7 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -64,10 +65,10 @@ = public SystemSearchManager(QueryHandlerEntry config, NamespaceRegistryI= mpl nsReg, NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, DocumentReaderService servic= e, ConfigurationManager cfm, - RepositoryIndexSearcherHolder indexSearcherHolder, SearchManagerHold= er holder) throws RepositoryException, + RepositoryIndexSearcherHolder indexSearcherHolder, IndexInterceptor = indexInterceptor) throws RepositoryException, RepositoryConfigurationException { - super(config, nsReg, ntReg, itemMgr, null, service, cfm, indexSearch= erHolder, holder); + super(config, nsReg, ntReg, itemMgr, null, service, cfm, indexSearch= erHolder, indexInterceptor); } = @Override Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/query/cacheloader/IndexInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexInterceptor.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexInterceptor.java 2009-11-17 16:= 07:53 UTC (rev 720) @@ -0,0 +1,96 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core.query.cacheloader; + +import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.cache.InvocationContext; +import org.jboss.cache.commands.tx.PrepareCommand; +import org.jboss.cache.interceptors.base.CommandInterceptor; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Sergey K= abashnyuk + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ + * + */ +public class IndexInterceptor extends CommandInterceptor +{ + private final Log log =3D ExoLogger.getLogger(IndexInterceptor.class); + + /** + * List of index interceptor listeners. + */ + private final List indexInterceptorListners; + + /** + * Default constructor. + */ + public IndexInterceptor() + { + super(); + this.indexInterceptorListners =3D new ArrayList(); + } + + /** + * @see org.jboss.cache.commands.AbstractVisitor#visitPrepareCommand(or= g.jboss.cache.InvocationContext, org.jboss.cache.commands.tx.PrepareCommand) + */ + @Override + public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand= command) throws Throwable + { + // try + // { + // if (ctx.getTransactionContext().getModifications().size()= > 0) + // { + // for (SearchManager searchManager : indexInterceptorLis= tners) + // { + // searchManager.onSaveItems(ctx.getTransactionContext= ().getModifications()); + // } + // } + // } + // catch (RepositoryException e) + // { + // //TODO handle rollback + // log.error(e.getLocalizedMessage()); + // } + + return invokeNextInterceptor(ctx, command); + } + + /** + * Add new SearchManager to the indexInterceptorListners list. + * @param searchManager - search manager. + */ + public void addIndexInterceptorListener(SearchManager searchManager) + { + indexInterceptorListners.add(searchManager); + } + + /** + * Add new SearchManager to the indexInterceptorListners list. + * @param searchManager - search manager. + */ + public boolean removeIndexInterceptorListener(SearchManager searchManag= er) + { + return indexInterceptorListners.remove(searchManager); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/core/query/cacheloader/IndexInterceptor.ja= va ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/query/cacheloader/IndexModificationsBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexModificationsBuilder.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexModificationsBuilder.java 2009-= 11-17 16:07:53 UTC (rev 720) @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core.query.cacheloader; + +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= age; +import org.jboss.cache.Fqn; +import org.jboss.cache.InvocationContext; +import org.jboss.cache.commands.AbstractVisitor; +import org.jboss.cache.commands.write.ClearDataCommand; +import org.jboss.cache.commands.write.MoveCommand; +import org.jboss.cache.commands.write.PutDataMapCommand; +import org.jboss.cache.commands.write.PutKeyValueCommand; +import org.jboss.cache.commands.write.RemoveKeyCommand; +import org.jboss.cache.commands.write.RemoveNodeCommand; + +import java.util.HashSet; +import java.util.Set; + +/** + * @author Sergey K= abashnyuk + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ + * + */ +public class IndexModificationsBuilder extends AbstractVisitor +{ + + // nodes that need to be removed from the index. + private final Set removedNodes; + + // nodes that need to be added to the index. + private final Set addedNodes; + + // node thst must be updated + private final Set updateNodes; + + public IndexModificationsBuilder(HashSet addedNodes, HashSet removedNodes, + HashSet updateNodes) + { + // nodes that need to be removed from the index. + this.removedNodes =3D removedNodes; + + // nodes that need to be added to the index. + this.addedNodes =3D addedNodes; + + // node thst must be updated + this.updateNodes =3D updateNodes; + + } + + @Override + public Object visitClearDataCommand(InvocationContext ctx, ClearDataCom= mand command) throws Throwable + { + Fqn fqn =3D command.getFqn(); + if (fqn.size() =3D=3D 2) + { + + if (isNode(fqn)) + { + // add node + String uuid =3D parseUUID(fqn); + removedNodes.add(uuid); + } + } + return null; + } + + @Override + public Object visitMoveCommand(InvocationContext ctx, MoveCommand comma= nd) throws Throwable + { + Fqn fqn =3D command.getFqn(); + if (fqn.size() =3D=3D 2) + { + + if (isNode(fqn)) + { + //remove first + removedNodes.add(parseUUID(command.getFqn())); + //add second + addedNodes.add(parseUUID(command.getTo())); + } + else + { + // this is property - do nothing + } + } + return null; + } + + @Override + public Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapC= ommand command) throws Throwable + { + + Fqn fqn =3D command.getFqn(); + if (fqn.size() =3D=3D 2) + { + + if (isNode(fqn)) + { + // add node + String uuid =3D parseUUID(fqn); + addedNodes.add(uuid); + } + else + { + // this is property - do nothing + } + } + return null; + } + + @Override + public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValu= eCommand command) throws Throwable + { + Fqn fqn =3D command.getFqn(); + if (fqn.size() =3D=3D 2) + { + String uuid =3D parseUUID(fqn); + if (!isNode(fqn)) + { + PropertyData property =3D (PropertyData)command.getValue(); + uuid =3D property.getParentIdentifier(); + } + if (!addedNodes.contains(uuid)) + { + updateNodes.add(uuid); + } + + } + return null; + + } + + @Override + public Object visitRemoveKeyCommand(InvocationContext ctx, RemoveKeyCom= mand command) throws Throwable + { + Fqn fqn =3D command.getFqn(); + if (fqn.size() =3D=3D 2) + { + + if (isNode(fqn)) + { + // add node + String uuid =3D parseUUID(fqn); + if (!removedNodes.contains(uuid)) + { + updateNodes.add(uuid); + } + } + } + return null; + + } + + @Override + public Object visitRemoveNodeCommand(InvocationContext ctx, RemoveNodeC= ommand command) throws Throwable + { + Fqn fqn =3D command.getFqn(); + if (fqn.size() =3D=3D 2) + { + + if (isNode(fqn)) + { + // add node + String uuid =3D parseUUID(fqn); + removedNodes.add(uuid); + } + else + { + // this is property - do nothing + } + } + return null; + } + + private boolean isNode(Fqn fqn) + { + String items =3D (String)fqn.get(0); + String s =3D items.toString(); + return s.equals(JBossCacheStorage.NODES); + } + + private String parseUUID(Fqn fqn) + { + if (fqn.size() > 1) + { + + // get only uuid + String uuid =3D (String)fqn.get(1); + //remove slash + return uuid; + } + else + { + return null; + } + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/core/query/cacheloader/IndexModificationsB= uilder.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-17 1= 3:17:40 UTC (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-17 1= 6:07:53 UTC (rev 720) @@ -17,7 +17,6 @@ package org.exoplatform.services.jcr.impl.core.query.cacheloader; = import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= age; import org.exoplatform.services.log.ExoLogger; @@ -25,7 +24,6 @@ import org.jboss.cache.CacheException; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; -import org.jboss.cache.factories.annotations.Inject; = import java.util.HashSet; import java.util.List; @@ -39,6 +37,7 @@ * @author Karpenko Sergiy = * @version $Id: CacheIndexer.java 111 2008-11-11 11:11:11Z serg $ */ +(a)Deprecated public class IndexerCacheLoader extends AbstractWriteOnlyCacheLoader { = @@ -47,17 +46,17 @@ */ private static final Log log =3D ExoLogger.getLogger(IndexerCacheLoader= .class); = - SearchManagerHolder searchManagerHolder =3D null; + //IndexInterceptorHolder searchManagerHolder =3D null; = public IndexerCacheLoader() { } = - @Inject - public void injectDependencies(SearchManagerHolder holder) - { - searchManagerHolder =3D holder; - } + // @Inject + // public void injectDependencies(IndexInterceptorHolder holder) + // { + // searchManagerHolder =3D holder; + // } = private String parseUUID(Fqn fqn) { @@ -85,10 +84,10 @@ @Override public void put(List modifications) throws Exception { - if (searchManagerHolder =3D=3D null && searchManagerHolder.get() != =3D null) - { - return; - } + // if (searchManagerHolder =3D=3D null || searchManagerHolder.g= et() =3D=3D null) + // { + // return; + // } = // nodes that need to be removed from the index. final Set removedNodes =3D new HashSet(); @@ -219,7 +218,15 @@ addedNodes.add(uuid); } = - searchManagerHolder.get().updateIndex(removedNodes, addedNodes); + try + { + //searchManagerHolder.get().updateIndex(removedNodes, addedNodes); + } + catch (Exception e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } = } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-17 13:17:40 UTC (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-17 16:07:53 UTC (rev 720) @@ -21,7 +21,7 @@ import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; +import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBas= e; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; @@ -36,6 +36,7 @@ import org.jboss.cache.DefaultCacheFactory; import org.jboss.cache.Fqn; import org.jboss.cache.Node; +import org.jboss.cache.interceptors.CacheStoreInterceptor; import org.picocontainer.Startable; = import java.io.IOException; @@ -81,8 +82,8 @@ */ public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, Reposi= toryEntry repConfig, InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider, - SearchManagerHolder searchManagerHolder) throws RepositoryConfigurat= ionException, NamingException, - RepositoryException, IOException + IndexInterceptor indexInterceptor) throws RepositoryConfigurationExc= eption, NamingException, RepositoryException, + IOException { this.repositoryName =3D repConfig.getName(); this.containerName =3D wsConfig.getName(); @@ -114,13 +115,14 @@ ((CacheSPI)cache).getComponentRegistry().regis= terComponent(this.persistentContainer, WorkspaceDataContainer.class); = - ((CacheSPI)cache).getComponentRegistry().regis= terComponent(searchManagerHolder, - SearchManagerHolder.class); + // SearchManager stub. We need it because IndexInterceptor will be c= reated = + // much earlier when SearchManager = // TODO check lifecycle, might be we have to create in start(), with= jdbc start. = // initializes configuration state, the root node, etc. this.cache.create(); this.cache.start(); + this.cache.addInterceptor(indexInterceptor, CacheStoreInterceptor.cl= ass); = Node cacheRoot =3D cache.getRoot(); //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-17 13:17:40 UTC (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-17 16:07:53 UTC (rev 720) @@ -50,7 +50,6 @@ import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTy= peDataPersister; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; @@ -97,7 +96,7 @@ = SearchManager manager; = - SearchManagerHolder holder; + //IndexInterceptorHolder holder; = public void createNewDataSource(String dataSourceName) throws Exception { @@ -126,7 +125,7 @@ initPersistence(); = loader =3D new IndexerCacheLoader(); - loader.injectDependencies(holder); + //loader.injectDependencies(holder); = initJCRRoot(); = @@ -860,7 +859,7 @@ = protected void initPersistence() throws Exception { - holder =3D new SearchManagerHolder(); + //holder =3D new IndexInterceptorHolder(); = // Create WorkspaceEntry ContainerEntry containerEntry =3D new ContainerEntry(); @@ -908,9 +907,9 @@ DocumentReaderService extractor =3D null; ConfigurationManager cfm =3D new ConfigurationManagerImpl(); = - manager =3D - new SearchManager(ws.getQueryHandler(), nsReg, ntReg, itemMgr, pa= rentSearchManager, extractor, cfm, - indexSearcherHolder, holder); + // manager =3D + // new SearchManager(ws.getQueryHandler(), nsReg, ntReg, ite= mMgr, parentSearchManager, extractor, cfm, + // indexSearcherHolder, holder); } = @Override Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-17 1= 3:17:40 UTC (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-17 1= 6:07:53 UTC (rev 720) @@ -31,7 +31,6 @@ import org.exoplatform.services.jcr.impl.core.query.QueryHandler; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.SearchManagerHolder; import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; @@ -60,7 +59,7 @@ = private DummySearchManager searchManager; = - private SearchManagerHolder holder; + //private IndexInterceptorHolder holder; = /** * @see junit.framework.TestCase#setUp() @@ -70,9 +69,9 @@ { // TODO Auto-generated method stub super.setUp(); - holder =3D new SearchManagerHolder(); + // holder =3D new IndexInterceptorHolder(); indexerCacheLoader =3D new IndexerCacheLoader(); - indexerCacheLoader.injectDependencies(holder); + //indexerCacheLoader.injectDependencies(holder); searchManager =3D new DummySearchManager(); = } @@ -270,7 +269,7 @@ = public DummySearchManager() throws RepositoryException, RepositoryCo= nfigurationException { - super(null, null, null, null, null, null, null, new RepositoryInd= exSearcherHolder(), holder); + super(null, null, null, null, null, null, null, new RepositoryInd= exSearcherHolder(), null); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-exoloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-17 13:17:40 UTC (rev 719) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-17 16:07:53 UTC (rev 720) @@ -9,7 +9,7 @@ = - - + = - + + = @@ -66,17 +67,12 @@ = = - - = + = = - - - - = = --===============2176882093725457234==-- From do-not-reply at jboss.org Tue Nov 17 11:08:08 2009 Content-Type: multipart/mixed; boundary="===============2646403109030377485==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r721 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Tue, 17 Nov 2009 11:08:08 -0500 Message-ID: <200911171608.nAHG88TS017622@svn01.web.mwc.hst.phx2.redhat.com> --===============2646403109030377485== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-17 11:08:08 -0500 (Tue, 17 Nov 2009) New Revision: 721 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-245: JBossCacheStorageConnectionTest updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 16:07:53 UTC (rev 720) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 16:08:08 UTC (rev 721) @@ -457,34 +457,31 @@ = String nodeUUID =3D data.getIdentifier(); = - //1. Update renamed node and also get old parent node UUID + //1. Update renamed node and also get old nodeData Node node =3D nodesRoot.getChild(makeNodeFqn(n= odeUUID)); if (node =3D=3D null) { throw new RepositoryException("FATAL renamed node is not exist" += data.getQPath().getAsString()); } - String oldParentIdentifier =3D null; - Object itemData =3D node.put(ITEM_DATA, data); - if (itemData !=3D null) + + NodeData oldNodeData =3D (NodeData)node.put(ITEM_DATA, data); + if (oldNodeData =3D=3D null) { - oldParentIdentifier =3D ((NodeData)itemData).getParentIdentifier(= ); - } - else - { throw new RepositoryException("FATAL NodeData is empty " + data.= getQPath().getAsString()); } = // 2. remove renamed node from child list of previous parent node // check if parent is cached - Node oldparent =3D nodesRoot.getChild(makeNode= Fqn(oldParentIdentifier)); + Node oldparent =3D nodesRoot.getChild(makeNode= Fqn(oldNodeData.getParentIdentifier())); if (oldparent =3D=3D null) { throw new RepositoryException("Nodes old parent doesn't exist " += data.getQPath().getAsString()); } = - // remove child on old Parent + // remove node form old parent child list boolean removed =3D - oldparent.removeChild(makeChildNodeFqn(data.getQPath().getEntries= ()[data.getQPath().getEntries().length - 1])); + oldparent + .removeChild(makeChildNodeFqn(oldNodeData.getQPath().getEntrie= s()[oldNodeData.getQPath().getEntries().length - 1])); if (!removed) { throw new RepositoryException("Node was not removed from child li= st of old parent " Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-17 16:07:53 UTC (rev 720) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-17 16:08:08 UTC (rev 721) @@ -26,7 +26,6 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; @@ -717,4 +716,64 @@ } } = + public void testMoveNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]firstParent:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + String node2id =3D "2"; + QPath node2path =3D QPath.parse("[]:1[]secondParent:1"); + conn.add(new TransientNodeData(node2path, node2id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + String node3id =3D "3"; + QPath node3path =3D QPath.parse("[]:1[]firstParent:1[]node:1"); + conn.add(new TransientNodeData(node3path, node3id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + node1id, new AccessControlList())); + + // check in nodes + treePrint(nodes); + + // get root node ([]:1) + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + assertNotNull("Node expected", rootNode); + + // check root Node + checkNode(rootNode, Constants.ROOT_UUID, Constants.ROOT_PATH); + + // cechk childs + assertEquals("Childs expected", 2, rootNode.getChildren().size()); + checkChildNode(rootNode, node1id, node1path); + checkChildNode(rootNode, node2id, node2path); + + Node firstParent =3D nodes.getChild(Fqn.fromEl= ements(node1id)); + assertEquals("Childs expected", 1, firstParent.getChildren().size()); + checkChildNode(firstParent, node3id, node3path); + + Node secondParent =3D nodes.getChild(Fqn.fromE= lements(node2id)); + assertEquals("Childs expected", 0, secondParent.getChildren().size()= ); + + // lets move node + + QPath newnode3path =3D QPath.parse("[]:1[]secondParent:1[]nodesec:1"= ); + conn.rename(new TransientNodeData(newnode3path, node3id, 1, Constant= s.NT_UNSTRUCTURED, new InternalQName[0], 0, + node2id, new AccessControlList())); + + //check results + firstParent =3D nodes.getChild(Fqn.fromElements(node1id)); + assertEquals("Childs expected", 0, firstParent.getChildren().size()); + + secondParent =3D nodes.getChild(Fqn.fromElements(node2id)); + assertEquals("Childs expected", 1, secondParent.getChildren().size()= ); + checkChildNode(secondParent, node3id, newnode3path); + + } + } --===============2646403109030377485==-- From do-not-reply at jboss.org Tue Nov 17 11:14:29 2009 Content-Type: multipart/mixed; boundary="===============3680264854881124048==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r722 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 3 other directories. Date: Tue, 17 Nov 2009 11:14:29 -0500 Message-ID: <200911171614.nAHGET0A019411@svn01.web.mwc.hst.phx2.redhat.com> --===============3680264854881124048== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 11:14:29 -0500 (Tue, 17 Nov 2009) New Revision: 722 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/SQLExceptionHandler.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/storage/WorkspaceStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-203: JDBC loader get(Fqn), getChildrenNames(Fqn); WS connection rewo= rk Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17 = 16:08:08 UTC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17 = 16:14:29 UTC (rev 722) @@ -276,24 +276,4 @@ return null; } = - /** - * {@inheritDoc} - */ - public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - = - } - - /** - * {@inheritDoc} - */ - public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - = - } - } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 16:08:08 UTC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 16:14:29 UTC (rev 722) @@ -379,26 +379,6 @@ /** * {@inheritDoc} */ - public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException { = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-17 16:08:08 UTC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-17 16:14:29 UTC (rev 722) @@ -436,24 +436,4 @@ throw new UnsupportedOperationException(); } = - /** - * {@inheritDoc} - */ - public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - = - } - - /** - * {@inheritDoc} - */ - public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - = - } - } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 16:08:08= UTC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 16:14:29= UTC (rev 722) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import java.sql.SQLException; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; @@ -25,14 +26,17 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; = +import javax.jcr.InvalidItemStateException; import javax.jcr.RepositoryException; = import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateExcept= ion; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -77,7 +81,7 @@ * @param dataContainer WorkspaceDataContainer */ @Inject - public void injectDependencies(WorkspaceDataContainer dataContainer) th= rows RepositoryConfigurationException + public void init(WorkspaceDataContainer dataContainer) throws Repositor= yConfigurationException { if (this.dataContainer !=3D null) { @@ -96,11 +100,6 @@ */ protected void apply(WorkspaceStorageConnection conn, List modifications) throws RepositoryException { - if (LOG.isDebugEnabled()) - { - LOG.debug("Modifications list size =3D " + modifications.size()); - } - // Prepare modifications list. // Will be added oldValueData to modification for UPDATE. = //prepareModifications(modifications); @@ -153,10 +152,6 @@ LOG.debug("Modifications list size =3D " + modifications.size()); } = - // Prepare modifications list. - // Will be added oldValueData to modification for UPDATE. = - //prepareModifications(modifications); - WorkspaceStorageConnection conn =3D dataContainer.openConnection(); try { @@ -165,12 +160,12 @@ } catch (RepositoryException e) { - LOG.error("RepositoryException: ", e); // TODO cleanup + LOG.error("RepositoryException: ", e); // TODO don't catch throw new RepositoryException(e); } catch (IllegalStateException e) { - LOG.error("IllegalStateException: ", e); // TODO cleanup + LOG.error("IllegalStateException: ", e); // TODO don't catch throw new IllegalStateException(e); } finally @@ -268,173 +263,129 @@ } = /** - * Prepare list of modifications. - * = - * Will be checked the UPDATE, ADD, REMOVE. - * = - * @param modifications - * @throws RepositoryException - */ - @Deprecated - private void prepareModifications(List modifications) thr= ows RepositoryException - { - WorkspaceStorageConnection conn =3D dataContainer.openConnection(); - - try - { - for (int i =3D 0; i < modifications.size(); i++) - { - Modification m =3D modifications.get(i); - if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) - { - ItemData itemData =3D null; - - //Check add or update node data. - if (m.getValue() instanceof NodeData) - { - NodeData nodeData =3D (NodeData)m.getValue(); - itemData =3D conn.getItemData(nodeData.getIdentifier()); - - // Set oldValueData for update node. - if (itemData !=3D null) - modifications.get(i).setOldValue(itemData); - } - else if (m.getValue() instanceof PropertyData) - { - PropertyData propertyData =3D (PropertyData)m.getValue(); - itemData =3D conn.getItemData(propertyData.getIdentifier= ()); - - // Set oldValueData for update property. - if (itemData !=3D null) - modifications.get(i).setOldValue(itemData); - } - } - else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) - { - if (m.getFqn().size() =3D=3D 2 - && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) ||= m.getFqn().get(0).equals( - JBossCacheStorage.PROPS))) - { - String id =3D (String)m.getFqn().get(1); - ItemData removedItemData =3D conn.getItemData(id); - - // Set valueData for update property or node. - if (removedItemData !=3D null) - modifications.get(i).setValue(removedItemData); - } - } - } - } - finally - { - conn.close(); - } - } - - protected QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberF= ormatException, IllegalNameException - { - List elements =3D nodeFqn.peekElements(); - QPathEntry[] path =3D new QPathEntry[elements.size()]; - - for (int i =3D 0; i < elements.size(); i++) - { - path[i] =3D QPathEntry.parse(elements.get(i)); - } - - return path; - } - - /** * {@inheritDoc} */ public Map get(Fqn name) throws Exception { = - Map attrs =3D new LinkedHashMap(); + Map attrs; = - if (name.size() > 1) + WorkspaceStorageConnection conn =3D dataContainer.openConnection(); + try { - if (name.get(0).equals(JBossCacheStorage.NODES)) + + if (name.size() > 1) { - // /$NODES/ - if (name.size() =3D=3D 2) + if (name.get(0).equals(JBossCacheStorage.NODES)) { - // return NodeData [ITEM_DATA : NodeData] - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - - try + // /$NODES/ + if (name.size() =3D=3D 2) { - NodeData nodeData =3D (NodeData)conn.getItemData(name.ge= tLastElementAsString()); - + String nodeId =3D name.getLastElementAsString(); + NodeData nodeData =3D (NodeData)conn.getItemData(nodeId); if (nodeData !=3D null) { + // TODO use dedicated select, not child datas + List childProps =3D conn.getChildProper= tiesData(nodeData); + if (childProps.size() <=3D 0) + { + throw new JDBCCacheLoaderException("FATAL Empty at= tributes for Node " + nodeId + " '" + name + + "'"); + } + + attrs =3D new LinkedHashMap(); attrs.put(JBossCacheStorage.ITEM_DATA, nodeData); - - // put [PROPERTY_NAME : propertyData_ID] - for (PropertyData prop : conn.getChildPropertiesData(= nodeData)) + for (PropertyData prop : childProps) { attrs.put(prop.getQPath().getName().getAsString(),= prop.getIdentifier()); } } + else + { + attrs =3D null; + } } - finally + // /$NODES// + else if (name.size() =3D=3D 3) { - conn.close(); - } - } - // /$NODES// - else if (name.size() =3D=3D 3) - { - QPathEntry nodeName =3D QPathEntry.parse(name.getLastElemen= tAsString()); + QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); + String parentId =3D (String)name.get(1); = - // return [ITEM_Id : nodeData_ID] - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - - try - { - NodeData parentNodeData =3D (NodeData)conn.getItemData((= String)name.get(1)); - - //TODO We do not throw exception if parentNodeData not = exists in DB, because we use that method (get(Fqn name)) in exists(Fqn name= ). = - /*if (parentNodeData =3D=3D null) - throw new JDBCCacheLoaderException("The parent node wi= th ID =3D " + (String)name.get(1) + " not exis, FQN =3D '" + name + "'.");*/ - - if (parentNodeData !=3D null) + // TODO use non-data method, check ACL creation + NodeData parentData =3D (NodeData)conn.getItemData(paren= tId); + if (parentData !=3D null) { - NodeData nodeData =3D (NodeData)conn.getItemData(pare= ntNodeData, nodeName); + NodeData nodeData =3D (NodeData)conn.getItemData(pare= ntData, childNodeName); if (nodeData !=3D null) + { + attrs =3D new LinkedHashMap(); attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getI= dentifier()); + } + else + { + throw new JDBCCacheLoaderException("FATAL Child No= de data not found " + + parentData.getQPath().getAsString() + childNo= deName.getAsString(true) + " for '" + name + + "'"); + } } + else + { + throw new JDBCCacheLoaderException("FATAL Parent not = found " + parentId + " for '" + name + "'"); + } } - finally + else { - conn.close(); + attrs =3D null; + LOG.warn("Unexpected Fqn asked " + name); } } - } - // /$PROPS/ - else if (name.get(0).equals(JBossCacheStorage.PROPS)) - { - if (name.size() =3D=3D 2) + // /$PROPS/ + else if (name.get(0).equals(JBossCacheStorage.PROPS)) { - // return PropertyData [ITEM_DATA : PropertyData] - WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - - try + if (name.size() =3D=3D 2) { - PropertyData propertyData =3D (PropertyData)conn.getItem= Data(name.getLastElementAsString()); - + String propertyId =3D name.getLastElementAsString(); + PropertyData propertyData =3D (PropertyData)conn.getItem= Data(propertyId); if (propertyData !=3D null) + { + attrs =3D new LinkedHashMap(); attrs.put(JBossCacheStorage.ITEM_DATA, propertyData); + } + else + { + attrs =3D null; + } } - finally + else { - conn.close(); + attrs =3D null; + LOG.warn("Unexpected Fqn asked " + name); } } + else + { + attrs =3D null; + LOG.warn("Unexpected Fqn asked " + name); + } } + else if (name.equals(Fqn.ROOT) || name.equals(JBossCacheStorage.P= ROPS) || name.equals(JBossCacheStorage.NODES) + || name.equals(JBossCacheStorage.LOCKS)) + { + // roots, like NODES, PROPS etc = + attrs =3D new LinkedHashMap(); + } + else + { + LOG.warn("Unexpected Fqn asked " + name); + attrs =3D null; + } } + finally + { + conn.close(); + } = - return (attrs.size() =3D=3D 0 ? null : attrs); + return attrs; } = /** @@ -453,7 +404,7 @@ { // return child nodes names = - Set childs =3D new LinkedHashSet(); + Set childs; = // /$NODES/ if (name.size() =3D=3D 2) @@ -461,25 +412,54 @@ WorkspaceStorageConnection conn =3D dataContainer.openConnection(= ); try { - NodeData parentNodeData =3D (NodeData)conn.getItemData((String= )name.get(1)); - - if (parentNodeData =3D=3D null) - throw new JDBCCacheLoaderException("The parent node with ID= =3D " + (String)name.get(1) - + " not exis, FQN =3D '" + name + "'."); - - // get child nodes by parent Id - for (NodeData node : conn.getChildNodesData(parentNodeData)) + String nodeId =3D (String)name.get(1); + NodeData parentData =3D (NodeData)conn.getItemData(nodeId); + if (parentData !=3D null) { - childs.add(node.getQPath().getEntries()[node.getQPath().get= Entries().length - 1].getAsString(true)); + childs =3D new LinkedHashSet(); + // TODO get child nodes by parent Id, we need only id and n= ame + for (NodeData node : conn.getChildNodesData(parentData)) + { + childs.add(node.getQPath().getEntries()[node.getQPath().= getEntries().length - 1].getAsString(true)); + } } + else + { + // TODO by JBC API we can just retur null, but it will not = be normal for this loader contract = + throw new JDBCCacheLoaderException("FATAL Parent not found = " + nodeId + " '" + name + "'"); + } } finally { conn.close(); } } + else if (name.equals(JBossCacheStorage.NODES)) + { + // TODO return all Nodes in workspace + childs =3D new LinkedHashSet(); + } + else if (name.equals(JBossCacheStorage.PROPS)) + { + // TODO return all Properties in workspace + childs =3D new LinkedHashSet(); + } + else if (name.equals(JBossCacheStorage.LOCKS)) + { + // TODO return all Locks in workspace + childs =3D new LinkedHashSet(); + } + else if (name.equals(Fqn.ROOT)) + { + childs =3D new LinkedHashSet(); + childs.add(JBossCacheStorage.NODES); + childs.add(JBossCacheStorage.PROPS); + childs.add(JBossCacheStorage.LOCKS); + } else { + childs =3D null; + } = - return (childs.size() =3D=3D 0 ? null : childs); + return childs; } = /** @@ -618,4 +598,82 @@ = // etc. = -} + /** + * Prepare list of modifications. + * = + * Will be checked the UPDATE, ADD, REMOVE. + * = + * @param modifications + * @throws RepositoryException + */ + @Deprecated + private void prepareModifications(List modifications) thr= ows RepositoryException + { + WorkspaceStorageConnection conn =3D dataContainer.openConnection(); + + try + { + for (int i =3D 0; i < modifications.size(); i++) + { + Modification m =3D modifications.get(i); + if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) + { + ItemData itemData =3D null; + + //Check add or update node data. + if (m.getValue() instanceof NodeData) + { + NodeData nodeData =3D (NodeData)m.getValue(); + itemData =3D conn.getItemData(nodeData.getIdentifier()); + + // Set oldValueData for update node. + if (itemData !=3D null) + modifications.get(i).setOldValue(itemData); + } + else if (m.getValue() instanceof PropertyData) + { + PropertyData propertyData =3D (PropertyData)m.getValue(); + itemData =3D conn.getItemData(propertyData.getIdentifier= ()); + + // Set oldValueData for update property. + if (itemData !=3D null) + modifications.get(i).setOldValue(itemData); + } + } + else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) + { + if (m.getFqn().size() =3D=3D 2 + && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) ||= m.getFqn().get(0).equals( + JBossCacheStorage.PROPS))) + { + String id =3D (String)m.getFqn().get(1); + ItemData removedItemData =3D conn.getItemData(id); + + // Set valueData for update property or node. + if (removedItemData !=3D null) + modifications.get(i).setValue(removedItemData); + } + } + } + } + finally + { + conn.close(); + } + } + + @Deprecated + private QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberFor= matException, IllegalNameException + { + List elements =3D nodeFqn.peekElements(); + QPathEntry[] path =3D new QPathEntry[elements.size()]; + + for (int i =3D 0; i < elements.size(); i++) + { + path[i] =3D QPathEntry.parse(elements.get(i)); + } + + return path; + } + +} \ No newline at end of file Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 16:08:08= UTC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 16:14:29= UTC (rev 722) @@ -456,7 +456,7 @@ = try { - deleteValues(cid, data, false); + deleteValues(cid, data.getIdentifier(), false); = // delete references deleteReference(cid); @@ -490,30 +490,10 @@ exceptionHandler.handleDeleteException(e, data); } } - = - /** - * {@inheritDoc} - */ - public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub = - } - /** * {@inheritDoc} */ - public void deleteProperty(String identifier) throws RepositoryExceptio= n, - UnsupportedOperationException, InvalidItemStateException, Ille= galStateException - { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, InvalidItemStateException, IllegalStateException { @@ -575,7 +555,7 @@ } = // do Values update: delete all and add all - deleteValues(cid, data, true); + deleteValues(cid, data.getIdentifier(), true); addValues(cid, data); = if (LOG.isDebugEnabled()) @@ -1653,8 +1633,8 @@ * = * @param cid * Property id - * @param pdata - * PropertyData + * @param propertyIdentifier + * the identifier the PropertyData * @param update * boolean true if it's delete-add sequence (update operation) * @throws IOException @@ -1664,7 +1644,7 @@ * @throws ValueStorageNotFoundException * if no such storage found with Value storageId */ - private void deleteValues(String cid, PropertyData pdata, boolean updat= e) throws IOException, SQLException, + private void deleteValues(String cid, String propertyIdentifier, boolea= n update) throws IOException, SQLException, ValueStorageNotFoundException { = @@ -1684,7 +1664,7 @@ final ValueIOChannel channel =3D valueStorageProvider.ge= tChannel(storageId); try { - channel.delete(pdata.getIdentifier()); + channel.delete(propertyIdentifier); valueChanges.add(channel); } finally @@ -1913,6 +1893,181 @@ } } = + // for JBC etc. + = + /** + * Deletes NodeData by identifier. + * = + * @param identifier + * the identifier of NodeData to be deleted + * = + * @throws InvalidItemStateException + * if the data is already deleted + * @throws UnsupportedOperationException + * if operation is not supported (it is container for level 1) + * @throws RepositoryException + * if some exception occured + * @throws IllegalStateException + * if connection is closed + */ + public void deleteNode(String identifier) throws RepositoryException, U= nsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + checkIfOpened(); + + final String cid =3D getInternalId(identifier); + + try + { + int nc =3D deleteItemByIdentifier(cid); + + if (nc <=3D 0) + { + throw new JCRInvalidItemStateException("(delete) Node not foun= d " + identifier + + ". Probably was deleted by another session ", identifier,= ItemState.DELETED); + } + + if (LOG.isDebugEnabled()) + { + LOG.debug("Node deleted id " + identifier); + } + + } + catch (SQLException e) + { + if (LOG.isDebugEnabled()) + LOG.error("Node remove. Database error: " + e, e); + exceptionHandler.handleDeleteException(e, identifier, true, ""); + } + + } + + /** + * Deletes PropertyData by identifier. + * = + * @param identifier + * the identifier of PropertyData to be deleted + * = + * @throws InvalidItemStateException + * if the data is already deleted + * @throws UnsupportedOperationException + * if operation is not supported (it is container for level 1) + * @throws RepositoryException + * if some exception occured + * @throws IllegalStateException + * if connection is closed + */ + public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, + InvalidItemStateException, IllegalStateException + { + checkIfOpened(); + + final String cid =3D getInternalId(identifier); + + try + { + deleteValues(cid, identifier, false); + + // delete references + deleteReference(cid); + + // delete item + int nc =3D deleteItemByIdentifier(cid); + if (nc <=3D 0) + throw new JCRInvalidItemStateException("(delete) Property not = found ID =3D " + identifier + + ". Probably was deleted by another session ", identifier,= ItemState.DELETED); + + if (LOG.isDebugEnabled()) + LOG.debug("Property deleted ID =3D " + identifier); + + } + catch (IOException e) + { + if (LOG.isDebugEnabled()) + LOG.error("Property remove. IO error: " + e, e); + throw new RepositoryException("Error of Property Value delete " += e, e); + } + catch (SQLException e) + { + if (LOG.isDebugEnabled()) + LOG.error("Property remove. Database error: " + e, e); + exceptionHandler.handleDeleteException(e, identifier, true, ""); + } + } + = + public String getItemIdentifier(String parentId, String name) throws Re= positoryException, IllegalStateException + { + = + return null; // TODO + } + = + class PropertyDataInfo { + String propertyId; + String propertyName; + } + = + public List getChildProperties(String parentId) throw= s RepositoryException, IllegalStateException + { + = + return new ArrayList(); // TODO + } + = + public List getChildNodeNames(String parentId) throws Repositor= yException, IllegalStateException + { + checkIfOpened(); + try + { + ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= (parentId)); + List childrens =3D new ArrayList(); + //while (node.next()) + //childrens.add((NodeData)itemData(parent.getQPath(), node, I_= CLASS_NODE, parent.getACL())); + + return childrens; + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } + = + public List getAllPropertyIdentifiers() throws RepositoryExcept= ion, IllegalStateException + { + checkIfOpened(); + try + { + ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); + List childrens =3D new ArrayList(); + //while (node.next()) + //childrens.add((NodeData)itemData(parent.getQPath(), node, I_= CLASS_NODE, parent.getACL())); + + return childrens; + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } + = + public List getAllNodeIdentifiers() throws RepositoryException,= IllegalStateException + { + checkIfOpened(); + try + { + ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); + List childrens =3D new ArrayList(); + //while (node.next()) + //childrens.add((NodeData)itemData(parent.getQPath(), node, I_= CLASS_NODE, parent.getACL())); + + return childrens; + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } + + // abstract to be impl + protected abstract int addNodeRecord(NodeData data) throws SQLException; = protected abstract int addPropertyRecord(PropertyData prop) throws SQLE= xception; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2009-11-17 16:08:08 U= TC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2009-11-17 16:14:29 U= TC (rev 722) @@ -332,7 +332,50 @@ message +=3D "Error of item delete " + itemInfo; throw new RepositoryException(message, e); } + = + /** + * Handle delete Exceptions. + * = + * @param e + * - an SQLException + * @param item + * - context ItemData + * @return String with error message + * @throws RepositoryException + * if RepositoryException should be thrown + * @throws InvalidItemStateException + * if InvalidItemStateException should be thrown + */ + protected String handleDeleteException(SQLException e, String itemId, b= oolean isNode, String path ) throws RepositoryException, + InvalidItemStateException + { + String message =3D "[" + containerName + "] DELETE " + (isNode ? "NO= DE. " : "PROPERTY. "); + String errMessage =3D e.getMessage(); + String itemInfo =3D + path + " " + itemId + + (errMessage !=3D null ? ". Cause >>>> " + errMessage : ""); = + if (errMessage !=3D null) + { + // try detect error by foreign key names + String umsg =3D errMessage.toLowerCase().toUpperCase(); + if (umsg.indexOf(conn.JCR_FK_ITEM_PARENT) >=3D 0) + { + message +=3D "Can not delete parent till childs exists. Item "= + itemInfo; + throw new JCRInvalidItemStateException(message, itemId, ItemSt= ate.DELETED, e); + } + else if (umsg.indexOf(conn.JCR_FK_VALUE_PROPERTY) >=3D 0) + { + message +=3D + "[FATAL] Can not delete property item till it contains valu= es. Condition: property ID. " + itemInfo; + throw new RepositoryException(message, e); + } + } + + message +=3D "Error of item delete " + itemInfo; + throw new RepositoryException(message, e); + } + /** * Handle update Exceptions. * = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-17 16:08:08 UTC = (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-17 16:14:29 UTC = (rev 722) @@ -261,42 +261,6 @@ IllegalStateException; = /** - * Deletes NodeData by identifier. - * = - * @param identifier - * the identifier of NodeData to be deleted - * = - * @throws InvalidItemStateException - * if the data is already deleted - * @throws UnsupportedOperationException - * if operation is not supported (it is container for level 1) - * @throws RepositoryException - * if some exception occured - * @throws IllegalStateException - * if connection is closed - */ - void deleteNode(String identifier) throws RepositoryException, Unsuppor= tedOperationException, InvalidItemStateException, - IllegalStateException; - = - /** - * Deletes PropertyData by identifier. - * = - * @param identifier - * the identifier of PropertyData to be deleted - * = - * @throws InvalidItemStateException - * if the data is already deleted - * @throws UnsupportedOperationException - * if operation is not supported (it is container for level 1) - * @throws RepositoryException - * if some exception occured - * @throws IllegalStateException - * if connection is closed - */ - void deleteProperty(String identifier) throws RepositoryException, Unsu= pportedOperationException, InvalidItemStateException, - IllegalStateException; - - /** * Deletes PropertyData. * = * @param data Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-17 16:0= 8:08 UTC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-17 16:1= 4:29 UTC (rev 722) @@ -82,7 +82,7 @@ initPersistence(); = loader =3D new JDBCCacheLoader(); - loader.injectDependencies(persistentContainer); + loader.init(persistentContainer); = initJCRRoot(); } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 17 16:08:08 UTC (rev 721) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 17 16:14:29 UTC (rev 722) @@ -572,26 +572,6 @@ return null; } = - /** - * {@inheritDoc} - */ - public void deleteNode(String identifier) throws RepositoryException= , UnsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - = - } - - /** - * {@inheritDoc} - */ - public void deleteProperty(String identifier) throws RepositoryExcep= tion, UnsupportedOperationException, - InvalidItemStateException, IllegalStateException - { - // TODO Auto-generated method stub - = - } - } = } --===============3680264854881124048==-- From do-not-reply at jboss.org Tue Nov 17 11:18:16 2009 Content-Type: multipart/mixed; boundary="===============5745458424702107423==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r723 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl and 5 other directories. Date: Tue, 17 Nov 2009 11:18:15 -0500 Message-ID: <200911171618.nAHGIFTR020256@svn01.web.mwc.hst.phx2.redhat.com> --===============5745458424702107423== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-17 11:18:15 -0500 (Tue, 17 Nov 2009) New Revision: 723 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java Removed: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockManagerImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockRemover.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/core/lock/ExtendedLock.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/RepositoryContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/NodeImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/SessionImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockImpl.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/lock/TestLockImpl.java Log: EXOJCR-243: Initial implementation of new lock manager: Created class: Sess= ionLockManager, updated NodeImpl and SessionImpl to use it, reworked LockDa= ta and LockImpl. Removed LockCacheLoaders and it's tests, old LockManager a= nd LockRemover*. Needed to implement: Lock removing on session logout, lock= removing by time out. Fill JBossCacheWorkspaceDataManager with functionali= ty. = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/core/lock/ExtendedLock.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/core/lock/ExtendedLock.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/core/lock/ExtendedLock.java 2009-11-17 16:18:15 UTC (rev 723) @@ -18,6 +18,8 @@ */ package org.exoplatform.services.jcr.core.lock; = +import org.exoplatform.services.jcr.impl.core.lock.LockData; + import javax.jcr.lock.Lock; = /** @@ -31,4 +33,9 @@ * @return The time to death in sec */ public long getTimeToDeath(); + + /** + * @return LockData instance + */ + public LockData getLockData(); } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/RepositoryContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-17 16:18:15 UTC (rev 723) @@ -40,7 +40,6 @@ import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.core.WorkspaceInitializer; import org.exoplatform.services.jcr.impl.core.access.DefaultAccessManagerI= mpl; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManager= Impl; import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerImpl; import org.exoplatform.services.jcr.impl.core.nodetype.registration.JcrNod= eTypeDataPersister; @@ -259,23 +258,6 @@ workspaceContainer.registerComponentImplementation(LocalWorkspace= DataManagerStub.class); workspaceContainer.registerComponentImplementation(ObservationMan= agerRegistry.class); = - // Lock manager and Lock persister is a optional parameters - if (wsConfig.getLockManager() !=3D null && wsConfig.getLockManage= r().getPersister() !=3D null) - { - try - { - Class lockPersister =3D Class.forName(wsConfig.getLockMa= nager().getPersister().getType()); - workspaceContainer.registerComponentImplementation(lockPers= ister); - } - catch (ClassNotFoundException e) - { - throw new RepositoryConfigurationException("Class not found= for workspace lock persister " - + wsConfig.getLockManager().getPersister().getType() + "= , container " + wsConfig.getUniqueName() - + " : " + e); - } - } - workspaceContainer.registerComponentImplementation(LockManagerImp= l.class); - // Query handler if (wsConfig.getQueryHandler() !=3D null) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java 2009-11-17 16:18:15 UTC (rev 723) @@ -29,6 +29,7 @@ import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; import org.exoplatform.services.jcr.datamodel.Identifier; @@ -895,7 +896,7 @@ = checkValid(); = - LockImpl lock =3D session.getLockManager().getLock(this); + LockImpl lock =3D session.getLockManager().getLock((NodeData)this.ge= tData()); if (lock =3D=3D null) throw new LockException("Lock not found " + getPath()); return lock; @@ -1279,7 +1280,6 @@ */ public boolean isLocked() throws RepositoryException { - checkValid(); return session.getLockManager().isLocked((NodeData)this.getData()); } @@ -1359,7 +1359,7 @@ public Lock lock(boolean isDeep, boolean isSessionScoped) throws Unsupp= ortedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException { - + // checks checkValid(); = if (!isNodeType(Constants.MIX_LOCKABLE)) @@ -1368,25 +1368,14 @@ if (dataManager.hasPendingChanges(getInternalPath())) throw new InvalidItemStateException("Node has pending unsaved cha= nges " + getPath()); = - Lock newLock =3D session.getLockManager().addPendingLock(this, isDee= p, isSessionScoped, -1); + if (session.getLockManager().isLocked((NodeData)this.getData())) + { + throw new LockException("Node is already locked itself or due to = deep lock of parent, "); + } + Lock lock =3D session.getLockManager().lock((NodeData)data, isDeep, = isSessionScoped, -1); = - PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), session.getId= (), ExtendedEvent.LOCK); - - PropertyData propData =3D - TransientPropertyData.createPropertyData(nodeData(), Constants.JC= R_LOCKOWNER, PropertyType.STRING, false, - new TransientValueData(session.getUserID())); - changesLog.add(ItemState.createAddedState(propData)); - - propData =3D - TransientPropertyData.createPropertyData(nodeData(), Constants.JC= R_LOCKISDEEP, PropertyType.BOOLEAN, false, - new TransientValueData(isDeep)); - changesLog.add(ItemState.createAddedState(propData)); - - dataManager.getTransactManager().save(changesLog); - session.getActionHandler().postLock(this); - return newLock; + return lock; = } = @@ -1396,6 +1385,7 @@ public Lock lock(boolean isDeep, long timeOut) throws UnsupportedReposi= toryOperationException, LockException, AccessDeniedException, RepositoryException { + // checks checkValid(); = if (!isNodeType(Constants.MIX_LOCKABLE)) @@ -1404,25 +1394,15 @@ if (dataManager.hasPendingChanges(getInternalPath())) throw new InvalidItemStateException("Node has pending unsaved cha= nges " + getPath()); = - Lock newLock =3D session.getLockManager().addPendingLock(this, isDee= p, false, timeOut); + if (session.getLockManager().isLocked((NodeData)this.getData())) + { + throw new LockException("Node is already locked itself or due to = deep lock of parent, "); + } = - PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), session.getId= (), ExtendedEvent.LOCK); + Lock lock =3D session.getLockManager().lock((NodeData)data, isDeep, = false, timeOut); = - PropertyData propData =3D - TransientPropertyData.createPropertyData(nodeData(), Constants.JC= R_LOCKOWNER, PropertyType.STRING, false, - new TransientValueData(session.getUserID())); - changesLog.add(ItemState.createAddedState(propData)); - - propData =3D - TransientPropertyData.createPropertyData(nodeData(), Constants.JC= R_LOCKISDEEP, PropertyType.BOOLEAN, false, - new TransientValueData(isDeep)); - changesLog.add(ItemState.createAddedState(propData)); - - dataManager.getTransactManager().save(changesLog); - session.getActionHandler().postLock(this); - return newLock; + return lock; = } = @@ -2023,13 +2003,13 @@ if (!session.getLockManager().holdsLock((NodeData)this.getData())) throw new LockException("The node not locked " + getPath()); = - if (!session.getLockManager().isLockHolder(this)) + if (!session.getLockManager().isLockHolder((NodeData)this.getData())) throw new LockException("There are no permission to unlock the no= de " + getPath()); = if (dataManager.hasPendingChanges(getInternalPath())) throw new InvalidItemStateException("Node has pending unsaved cha= nges " + getPath()); = - doUnlock(); + session.getLockManager().unlock((NodeData)data); = session.getActionHandler().postUnlock(this); } @@ -2167,8 +2147,8 @@ = boolean checkLocking() throws RepositoryException { - return (!isLocked() || session.getLockManager().isLockHolder(this) |= | session.getUserID().equals( - SystemIdentity.SYSTEM)); + return (!isLocked() || session.getLockManager().isLockHolder((NodeDa= ta)this.getData()) || session.getUserID() + .equals(SystemIdentity.SYSTEM)); } = protected void doOrderBefore(QPath srcPath, QPath destPath) throws Repo= sitoryException @@ -2330,28 +2310,6 @@ dataManager.getChangesLog().addAll(changes); } = - /** - * Remove mix:lockable properties. - * = - * @throws RepositoryException if error occurs - */ - protected void doUnlock() throws RepositoryException - { - - PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), session.getId= (), ExtendedEvent.UNLOCK); - - ItemData lockOwner =3D dataManager.getItemData(nodeData(), new QPath= Entry(Constants.JCR_LOCKOWNER, 0)); - - changesLog.add(ItemState.createDeletedState(lockOwner)); - - ItemData lockIsDeep =3D dataManager.getItemData(nodeData(), new QPat= hEntry(Constants.JCR_LOCKISDEEP, 0)); - - changesLog.add(ItemState.createDeletedState(lockIsDeep)); - - dataManager.getTransactManager().save(changesLog); - } - protected NodeData nodeData() { return (NodeData)data; @@ -2372,11 +2330,11 @@ { // locked, should be unlocked = - if (!session.getLockManager().isLockHolder(this)) + if (!session.getLockManager().isLockHolder((NodeData)this.getData= ())) throw new LockException("There are no permission to unlock the= node " + getPath()); = // remove mix:lockable properties (as the node is locked) - doUnlock(); + session.getLockManager().unlock((NodeData)data); } } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/SessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionImpl.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionImpl.java 2009-11-17 16:18:15 UTC (rev 723) @@ -31,7 +31,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; +import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager; import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeImpl; import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erImpl; import org.exoplatform.services.jcr.impl.core.observation.ObservationManag= erRegistry; @@ -118,7 +118,7 @@ = private final LocationFactory systemLocationFactory; = - private final LockManagerImpl lockManager; + private final SessionLockManager sessionLockManager; = protected final String workspaceName; = @@ -152,7 +152,6 @@ this.systemLocationFactory =3D (LocationFactory)container.getCompone= ntInstanceOfType(LocationFactory.class); = this.accessManager =3D (AccessManager)container.getComponentInstance= OfType(AccessManager.class); - this.lockManager =3D (LockManagerImpl)container.getComponentInstance= OfType(LockManagerImpl.class); WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentIn= stanceOfType(WorkspaceEntry.class); WorkspaceFileCleanerHolder cleanerHolder =3D (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(= WorkspaceFileCleanerHolder.class); @@ -177,9 +176,12 @@ = this.workspace =3D new WorkspaceImpl(workspaceName, container, this,= observationManager); = + // TODO: try to get lock time out from workspace configuration, as i= t was before + this.sessionLockManager =3D new SessionLockManager(this, SessionLock= Manager.DEFAULT_LOCK_TIMEOUT); + this.lifecycleListeners =3D new ArrayList(= ); this.registerLifecycleListener((ObservationManagerImpl)observationMa= nager); - this.registerLifecycleListener(lockManager); + this.registerLifecycleListener(sessionLockManager); = SessionActionCatalog catalog =3D (SessionActionCatalog)container.getComponentInstanceOfType(Sessio= nActionCatalog.class); @@ -197,7 +199,7 @@ */ public void addLockToken(String lt) { - getLockManager().addLockToken(getId(), lt); + sessionLockManager.addLockToken(lt); } = /** @@ -543,9 +545,9 @@ return locationFactory; } = - public LockManagerImpl getLockManager() + public SessionLockManager getLockManager() { - return lockManager; + return sessionLockManager; } = /** @@ -553,7 +555,7 @@ */ public String[] getLockTokens() { - return getLockManager().getLockTokens(getId()); + return sessionLockManager.getLockTokens(); } = /** @@ -901,7 +903,7 @@ */ public void removeLockToken(String lt) { - getLockManager().removeLockToken(getId(), lt); + sessionLockManager.removeLockToken(lt); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-17 16:18:15 UTC (rev 723) @@ -18,11 +18,6 @@ */ package org.exoplatform.services.jcr.impl.core.lock; = -import org.exoplatform.services.jcr.access.SystemIdentity; - -import java.util.HashSet; -import java.util.Set; - /** * Created by The eXo Platform SAS. * = @@ -49,15 +44,10 @@ private boolean live; = /** - * List of session id's which holds a lock tokens. - */ - private final Set lockHolders =3D new HashSet(); - - /** * A lock token is a string that uniquely identifies a particular lock = and acts as a =E2=80=9Ckey=E2=80=9D - * allowing a user to alter a locked node. + * allowing a user to alter a locked node. LockData stores only token h= ash. */ - private String lockToken; + private String tokenHash; = /** * Identifier of locked node. @@ -95,7 +85,7 @@ long timeOut) { this.nodeIdentifier =3D nodeIdentifier; - this.lockToken =3D lockToken; + this.tokenHash =3D lockToken; this.deep =3D deep; this.sessionScoped =3D sessionScoped; this.owner =3D owner; @@ -104,15 +94,6 @@ this.birthday =3D System.currentTimeMillis() / 1000; } = - /** - * @param sessionId - * @return - */ - public boolean addLockHolder(String sessionId) - { - return lockHolders.add(sessionId); - } - /* * (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) @@ -131,20 +112,11 @@ return false; } = - public int getLockHolderSize() + public String getTokenHash() { - return lockHolders.size(); + return tokenHash; } = - public String getLockToken(String sessionId) - { - if (isLockHolder(sessionId)) - { - return lockToken; - } - return null; - } - /** * @return the nodeIdentifier */ @@ -176,7 +148,7 @@ @Override public int hashCode() { - return super.hashCode() + lockToken.hashCode(); + return super.hashCode() + tokenHash.hashCode(); } = public boolean isDeep() @@ -193,17 +165,8 @@ } = /** - * @param sessionId * @return */ - public boolean isLockHolder(String sessionId) - { - return lockHolders.contains(sessionId) || SystemIdentity.SYSTEM.equa= ls(sessionId); - } - - /** - * @return - */ public boolean isSessionScoped() { return sessionScoped; @@ -218,15 +181,6 @@ } = /** - * @param sessionId - * @return - */ - public boolean removeLockHolder(String sessionId) - { - return lockHolders.remove(sessionId); - } - - /** * @param the * live to set */ @@ -236,31 +190,6 @@ } = /** - * @param lockToken - */ - public void setLockToken(String lockToken) - { - this.lockToken =3D lockToken; - } - - /** - * @param nodeIdentifier - * the nodeIdentifier to set - */ - public void setNodeIdentifier(String nodeIdentifier) - { - this.nodeIdentifier =3D nodeIdentifier; - } - - /** - * @param owner - */ - public void setOwner(String owner) - { - this.owner =3D owner; - } - - /** * @return */ protected long getTimeOut() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-17 16:18:15 UTC (rev 723) @@ -38,27 +38,47 @@ = private SessionImpl session; = - public LockImpl(SessionImpl session, LockData lockData) + // Token is not stored in lockData any more + private String token; + + /** + * @param session + * @param lockData + */ + public LockImpl(SessionImpl session, LockData lockData, String token) { this.lockData =3D lockData; this.session =3D session; + this.token =3D token; } = + /** + * @see javax.jcr.lock.Lock#getLockOwner() + */ public String getLockOwner() { return lockData.getOwner(); } = + /** + * @see javax.jcr.lock.Lock#getLockToken() + */ public String getLockToken() { - return lockData.getLockToken(session.getId()); + return token; } = + /** + * @see javax.jcr.lock.Lock#isLive() + */ public boolean isLive() { return lockData.isLive(); } = + /** + * @see javax.jcr.lock.Lock#refresh() + */ public void refresh() throws LockException, RepositoryException { if (!isLive()) @@ -66,6 +86,9 @@ lockData.refresh(); } = + /** + * @see javax.jcr.lock.Lock#getNode() + */ public Node getNode() { try @@ -74,29 +97,49 @@ } catch (RepositoryException e) { - e.printStackTrace(); } return null; } = + /** + * @see javax.jcr.lock.Lock#isDeep() + */ public boolean isDeep() { = return lockData.isDeep(); } = + /** + * @see javax.jcr.lock.Lock#isSessionScoped() + */ public boolean isSessionScoped() { return lockData.isSessionScoped(); } = + /** + * @see org.exoplatform.services.jcr.core.lock.ExtendedLock#getTimeToDe= ath() + */ public long getTimeToDeath() { return lockData.getTimeToDeath(); } = + /** + * @see org.exoplatform.services.jcr.core.lock.ExtendedLock#getLockData= () + */ + public LockData getLockData() + { + return lockData; + } + + /** + * @param timeOut + */ protected void setTimeOut(long timeOut) { lockData.setTimeOut(timeOut); } + } Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/lock/LockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManager.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManager.java 2009-11-17 16:18:15 UTC (rev 723) @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.core.lock; - -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.impl.core.NodeImpl; - -import javax.jcr.RepositoryException; -import javax.jcr.lock.Lock; -import javax.jcr.lock.LockException; - -/** - * @author Sergey Kabashn= yuk - * @version $Id$ - */ -public interface LockManager -{ - /** - * Invoked by a session to inform that a lock token has been added. - * = - * @param session - * session that has a added lock token - * @param lt - * added lock token - */ - public void addLockToken(String sessionId, String lt); - - public Lock addPendingLock(NodeImpl node, boolean isDeep, boolean isSes= sionScoped, long timeOut) - throws LockException, RepositoryException; - - /** - * Returns the Lock object that applies to a node. This may be either a= lock on this node itself - * or a deep lock on a node above this node. - * = - * @param node - * node - * @return lock object - * @throws LockException - * if this node is not locked - * @see javax.jcr.Node#getLock - */ - public LockImpl getLock(NodeImpl node) throws LockException, Repository= Exception; - - /** - * Return lock tokens enshrined by session - * = - * @param sessionID - * - Id of session. - * @return array of lock tokens. - */ - public String[] getLockTokens(String sessionID); - - /** - * Returns true if the node given holds a lock; otherwise = returns false. - * = - * @param node - * node - * @return true if the node given holds a lock; otherwise = returns false - * @see javax.jcr.Node#holdsLock - */ - public boolean holdsLock(NodeData node) throws RepositoryException; - - /** - * Returns true if this node is locked either as a result = of a lock held by this node - * or by a deep lock on a node above this node; otherwise returns false - * = - * @param node - * node - * @return true if this node is locked either as a result = of a lock held by this node - * or by a deep lock on a node above this node; otherwise retur= ns false - * @see javax.jcr.Node#isLocked - */ - public boolean isLocked(NodeData node); - - /** - * Returns true if the specified session holds a lock on t= he given node; otherwise - * returns false.

Note that isLockHolder(sessio= n, node)=3D=3Dtrue - * implies holdsLock(node)=3D=3Dtrue. - * = - * @param session - * session - * @param node - * node - * @return if the specified session holds a lock on the given node; oth= erwise returns - * false - */ - public boolean isLockHolder(NodeImpl node) throws RepositoryException; - - /** - * Invoked by a session to inform that a lock token has been removed. - * = - * @param session - * session that has a removed lock token - * @param lt - * removed lock token - */ - public void removeLockToken(String sessionId, String lt); - -} Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/lock/LockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-17 16:14:29 UTC (rev= 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockManagerImpl.java 2009-11-17 16:18:15 UTC (rev= 723) @@ -1,831 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.core.lock; - -import org.exoplatform.management.annotations.Managed; -import org.exoplatform.management.annotations.ManagedDescription; -import org.exoplatform.management.jmx.annotations.NameTemplate; -import org.exoplatform.management.jmx.annotations.Property; -import org.exoplatform.services.jcr.access.SystemIdentity; -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.core.ExtendedSession; -import org.exoplatform.services.jcr.core.SessionLifecycleListener; -import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; -import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; -import org.exoplatform.services.jcr.dataflow.DataManager; -import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; -import org.exoplatform.services.jcr.dataflow.PlainChangesLog; -import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; -import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; -import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.datamodel.ValueData; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.NodeImpl; -import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.dataflow.AbstractValueData; -import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; -import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; -import org.exoplatform.services.jcr.observation.ExtendedEvent; -import org.exoplatform.services.jcr.util.IdGenerator; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.cache.factories.annotations.NonVolatile; -import org.picocontainer.Startable; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import javax.jcr.AccessDeniedException; -import javax.jcr.RepositoryException; -import javax.jcr.UnsupportedRepositoryOperationException; -import javax.jcr.lock.Lock; -import javax.jcr.lock.LockException; - -/** - * Created by The eXo Platform SAS. - * = - * @author Gennady = Azarenkov - * @version $Id$ - */ -(a)Managed -(a)NameTemplate(@Property(key =3D "service", value =3D "lockmanager")) -(a)NonVolatile -public class LockManagerImpl implements ItemsPersistenceListener, SessionL= ifecycleListener, LockManager, Startable -{ - /** - * Default lock time out. 30min - */ - public static final long DEFAULT_LOCK_TIMEOUT =3D 1000 * 60 * 30; - - // Search constants - /** - * The exact lock token. - */ - private static final int SEARCH_EXECMATCH =3D 1; - - /** - * Lock token of closed parent - */ - private static final int SEARCH_CLOSEDPARENT =3D 2; - - /** - * Lock token of closed child - */ - private static final int SEARCH_CLOSEDCHILD =3D 4; - - /** - * Logger - */ - private final Log log =3D ExoLogger.getLogger("jcr.lock.LockManager"); - - /** - * Map NodeIdentifier -- lockData - * = - * TODO: changed from private to protected = - */ - protected final Map locks; - - /** - * Data manager. - */ - private final DataManager dataManager; - - /** - * Map NodeIdentifier -- lockData - * = - * TODO: changed from private to protected - */ - protected final Map pendingLocks; - - /** - * Map lockToken --lockData - */ - private final Map tokensMap; - - /** - * Run time lock time out. - */ - private long lockTimeOut; - - /** - * Lock remover thread. - */ - private LockRemover lockRemover; - - /** - * Lock persister instance. - */ - private final LockPersister persister; - - /** - * Constructor for workspace without LockPersister - * = - * @param dataManager - * @param config - */ - public LockManagerImpl(WorkspacePersistentDataManager dataManager, Work= spaceEntry config) - { - this(dataManager, config, null); - } - - public LockManagerImpl(WorkspacePersistentDataManager dataManager, Work= spaceEntry config, LockPersister persister) - { - - this.dataManager =3D dataManager; - this.persister =3D persister; - if (config.getLockManager() !=3D null) - { - lockTimeOut =3D - config.getLockManager().getTimeout() > 0 ? config.getLockManag= er().getTimeout() : DEFAULT_LOCK_TIMEOUT; - } - else - lockTimeOut =3D DEFAULT_LOCK_TIMEOUT; - - locks =3D new HashMap(); - pendingLocks =3D new HashMap(); - tokensMap =3D new HashMap(); - - dataManager.addItemPersistenceListener(this); - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.impl.core.lock.LockManager#lockTokenAdd= ed(org.exoplatform.services - * .jcr.impl.core.SessionImpl, java.lang.String) - */ - public synchronized void addLockToken(String sessionId, String lt) - { - LockData currLock =3D tokensMap.get(lt); - if (currLock !=3D null) - { - currLock.addLockHolder(sessionId); - } - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.impl.core.lock.LockManager#addPendingLo= ck(org.exoplatform.services - * .jcr.impl.core.NodeImpl, boolean, boolean, long) - */ - public synchronized Lock addPendingLock(NodeImpl node, boolean isDeep, = boolean isSessionScoped, long timeOut) - throws LockException - { - LockData lData =3D getLockData((NodeData)node.getData(), SEARCH_EXEC= MATCH | SEARCH_CLOSEDPARENT); - if (lData !=3D null) - { - if (lData.getNodeIdentifier().equals(node.getInternalIdentifier()= )) - { - throw new LockException("Node already locked: " + node.getData= ().getQPath()); - } - else if (lData.isDeep()) - { - throw new LockException("Parent node has deep lock."); - } - } - - if (isDeep && getLockData((NodeData)node.getData(), SEARCH_CLOSEDCHI= LD) !=3D null) - { - throw new LockException("Some child node is locked."); - } - - String lockToken =3D IdGenerator.generate(); - lData =3D - new LockData(node.getInternalIdentifier(), lockToken, isDeep, isS= essionScoped, node.getSession().getUserID(), - timeOut > 0 ? timeOut : lockTimeOut); - - lData.addLockHolder(node.getSession().getId()); - pendingLocks.put(node.getInternalIdentifier(), lData); - tokensMap.put(lockToken, lData); - - LockImpl lock =3D new LockImpl(node.getSession(), lData); - return lock; - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.impl.core.lock.LockManager#getLock(org.= exoplatform.services.jcr - * .impl.core.NodeImpl) - */ - public LockImpl getLock(NodeImpl node) throws LockException, Repository= Exception - { - - LockData lData =3D getLockData((NodeData)node.getData(), SEARCH_EXEC= MATCH | SEARCH_CLOSEDPARENT); - - if (lData =3D=3D null || (!node.getInternalIdentifier().equals(lData= .getNodeIdentifier()) && !lData.isDeep())) - { - throw new LockException("Node not locked: " + node.getData().getQ= Path()); - - } - return new LockImpl(node.getSession(), lData); - } - - /* - * (non-Javadoc) - * @see org.exoplatform.services.jcr.impl.core.lock.LockManager#getLock= Tokens(java.lang.String) - */ - public synchronized String[] getLockTokens(String sessionID) - { - List retval =3D new ArrayList(); - - for (LockData lockData : locks.values()) - { - if (lockData.isLockHolder(sessionID)) - retval.add(lockData.getLockToken(sessionID)); - - } - return retval.toArray(new String[retval.size()]); - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.impl.core.lock.LockManager#holdsLock(or= g.exoplatform.services. - * jcr.impl.core.NodeImpl) - */ - public boolean holdsLock(NodeData node) throws RepositoryException - { - return getLockData(node, SEARCH_EXECMATCH) !=3D null; - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.impl.core.lock.LockManager#isLocked(org= .exoplatform.services.jcr - * .datamodel.NodeData) - */ - public boolean isLocked(NodeData node) - { - LockData lData =3D getLockData(node, SEARCH_EXECMATCH | SEARCH_CLOSE= DPARENT); - - if (lData =3D=3D null || (!node.getIdentifier().equals(lData.getNode= Identifier()) && !lData.isDeep())) - { - return false; - } - return true; - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.impl.core.lock.LockManager#isLockHolder= (org.exoplatform.services - * .jcr.impl.core.NodeImpl) - */ - public boolean isLockHolder(NodeImpl node) throws RepositoryException - { - LockData lData =3D getLockData((NodeData)node.getData(), SEARCH_EXEC= MATCH | SEARCH_CLOSEDPARENT); - return lData !=3D null && lData.isLockHolder(node.getSession().getId= ()); - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.core.SessionLifecycleListener#onCloseSe= ssion(org.exoplatform.services - * .jcr.core.ExtendedSession) - */ - public synchronized void onCloseSession(ExtendedSession session) - { - // List deadLocksList =3D new ArrayList(); - SessionImpl sessionImpl =3D (SessionImpl)session; - for (Iterator> entries =3D locks.entrySe= t().iterator(); entries.hasNext();) - { - Map.Entry entry =3D entries.next(); - LockData lockData =3D entry.getValue(); - if (lockData.isLive()) - { - if (lockData.isLockHolder(session.getId())) - { - if (lockData.isSessionScoped()) - { - // if no session currently holds lock except this - try - { - // TODO it's possible to have next error - // java.lang.NullPointerException - // at - // org.exoplatform.services.jcr.impl.core.lock.LockMa= nagerImpl.onCloseSession(LockManagerImpl.java:312) - // at org.exoplatform.services.jcr.impl.core.SessionI= mpl.logout(SessionImpl.java:794) - // at - // org.exoplatform.services.jcr.impl.core.XASessionIm= pl.logout(XASessionImpl.java:254) - // at - // org.exoplatform.services.jcr.impl.core.SessionRegi= stry$SessionCleaner.callPeriodically(SessionRegistry.java:165) - // at - // org.exoplatform.services.jcr.impl.proccess.WorkerT= hread.run(WorkerThread.java:46) - ((NodeImpl)sessionImpl.getTransientNodesManager().get= ItemByIdentifier( - lockData.getNodeIdentifier(), false)).unlock(); - } - catch (UnsupportedRepositoryOperationException e) - { - log.error(e.getLocalizedMessage()); - } - catch (LockException e) - { - log.error(e.getLocalizedMessage()); - } - catch (AccessDeniedException e) - { - log.error(e.getLocalizedMessage()); - } - catch (RepositoryException e) - { - log.error(e.getLocalizedMessage()); - } - - } - else - { - lockData.removeLockHolder(session.getId()); - } - } - } - else - { - entries.remove(); - } - } - } - - /* - * (non-Javadoc) - * @seeorg.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenc= eListener#onSaveItems(org. - * exoplatform.services.jcr.dataflow.ItemStateChangesLog) - */ - @Deprecated - public void onSaveItems(ItemStateChangesLog changesLog) - { - List chengesLogList =3D new ArrayList(); - if (changesLog instanceof TransactionChangesLog) - { - ChangesLogIterator logIterator =3D ((TransactionChangesLog)change= sLog).getLogIterator(); - - while (logIterator.hasNextLog()) - { - chengesLogList.add(logIterator.nextLog()); - } - } - else if (changesLog instanceof PlainChangesLog) - { - chengesLogList.add((PlainChangesLog)changesLog); - } - else if (changesLog instanceof CompositeChangesLog) - { - for (ChangesLogIterator iter =3D ((CompositeChangesLog)changesLog= ).getLogIterator(); iter.hasNextLog();) - { - chengesLogList.add(iter.nextLog()); - } - } - - for (PlainChangesLog currChangesLog : chengesLogList) - { - String nodeIdentifier; - try - { - switch (currChangesLog.getEventType()) - { - case ExtendedEvent.LOCK : - if (currChangesLog.getSize() < 2) - { - log.error("Incorrect changes log of type ExtendedEve= nt.LOCK size=3D" + currChangesLog.getSize() - + "<2 \n" + currChangesLog.dump()); - break; - } - nodeIdentifier =3D currChangesLog.getAllStates().get(0).= getData().getParentIdentifier(); - - if (pendingLocks.containsKey(nodeIdentifier)) - { - internalLock(nodeIdentifier); - } - else - { - log.warn("No lock in pendingLocks for identifier " + = nodeIdentifier - + " Probably lock come from replication."); - - String lockToken =3D IdGenerator.generate(); - ItemState ownerState =3D getItemState(currChangesLog,= Constants.JCR_LOCKOWNER); - ItemState isDeepState =3D getItemState(currChangesLog= , Constants.JCR_LOCKISDEEP); - if (ownerState !=3D null && isDeepState !=3D null) - { - - String owner =3D - new String(((((TransientPropertyData)(ownerStat= e.getData())).getValues()).get(0)) - .getAsByteArray(), Constants.DEFAULT_ENCODIN= G); - - boolean isDeep =3D - Boolean.valueOf( - new String(((((TransientPropertyData)(isDeep= State.getData())).getValues()).get(0)) - .getAsByteArray(), Constants.DEFAULT_ENCO= DING)).booleanValue(); - - createRemoteLock(currChangesLog.getSessionId(), no= deIdentifier, lockToken, isDeep, false, owner); - } - } - break; - case ExtendedEvent.UNLOCK : - if (currChangesLog.getSize() < 2) - { - log.error("Incorrect changes log of type ExtendedEve= nt.UNLOCK size=3D" + currChangesLog.getSize() - + "<2 \n" + currChangesLog.dump()); - break; - } - - internalUnLock(currChangesLog.getSessionId(), currChange= sLog.getAllStates().get(0).getData() - .getParentIdentifier()); - break; - default : - HashSet removedLock =3D new HashSet(); - for (ItemState itemState : currChangesLog.getAllStates()) - { - // this is a node and node is locked - if (itemState.getData().isNode() && locks.containsKey= (itemState.getData().getIdentifier())) - { - nodeIdentifier =3D itemState.getData().getIdentifi= er(); - if (itemState.isDeleted()) - { - removedLock.add(nodeIdentifier); - } - else if (itemState.isAdded() || itemState.isRename= d() || itemState.isUpdated()) - { - removedLock.remove(nodeIdentifier); - } - } - } - for (String identifier : removedLock) - { - internalUnLock(currChangesLog.getSessionId(), identif= ier); - } - break; - } - } - catch (LockException e) - { - log.error(e.getLocalizedMessage(), e); - } - catch (UnsupportedEncodingException e) - { - log.error(e.getLocalizedMessage(), e); - } - catch (IllegalStateException e) - { - log.error(e.getLocalizedMessage(), e); - } - catch (IOException e) - { - log.error(e.getLocalizedMessage(), e); - } - } - } - - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.impl.core.lock.LockManager#lockTokenRem= oved(org.exoplatform.services - * .jcr.impl.core.SessionImpl, java.lang.String) - */ - public synchronized void removeLockToken(String sessionId, String lt) - { - LockData lData =3D tokensMap.get(lt); - if (lData !=3D null && lData.isLockHolder(sessionId)) - { - lData.removeLockHolder(sessionId); - } - } - - /* - * (non-Javadoc) - * @see org.picocontainer.Startable#start() - */ - public void start() - { - lockRemover =3D new LockRemover(this); - } - - // Quick method. We need to reconstruct - synchronized List getLockList() - { - return new ArrayList(locks.values()); - } - - /** - * Remove expired locks. Used from LockRemover. - */ - synchronized void removeExpired() - { - final List removeLockList =3D new ArrayList(); - - for (LockData lock : locks.values()) - { - if (!lock.isSessionScoped() && lock.getTimeToDeath() < 0) - { - removeLockList.add(lock.getNodeIdentifier()); - } - } - - for (String rLock : removeLockList) - { - removeLock(rLock); - } - } - - /* - * (non-Javadoc) - * @see org.picocontainer.Startable#stop() - */ - public void stop() - { - lockRemover.halt(); - lockRemover.interrupt(); - locks.clear(); - pendingLocks.clear(); - tokensMap.clear(); - } - - /** - * Copy PropertyData prop to new TransientItemData - * = - * @param prop - * @return - * @throws RepositoryException - */ - private TransientItemData copyItemData(PropertyData prop) throws Reposi= toryException - { - - if (prop =3D=3D null) - return null; - - // make a copy - TransientPropertyData newData =3D - new TransientPropertyData(prop.getQPath(), prop.getIdentifier(), = prop.getPersistedVersion(), prop.getType(), - prop.getParentIdentifier(), prop.isMultiValued()); - - List values =3D null; - // null is possible for deleting items - if (prop.getValues() !=3D null) - { - values =3D new ArrayList(); - for (ValueData val : prop.getValues()) - { - values.add(((AbstractValueData)val).createTransientCopy()); - } - } - newData.setValues(values); - return newData; - } - - /** - * Search item with name itemName in changesLog - * = - * @param changesLog - * @param itemName - * @return Item - */ - private ItemState getItemState(PlainChangesLog changesLog, InternalQNam= e itemName) - { - List allStates =3D changesLog.getAllStates(); - for (int i =3D allStates.size() - 1; i >=3D 0; i--) - { - ItemState state =3D allStates.get(i); - if (state.getData().getQPath().getName().equals(itemName)) - return state; - } - return null; - } - - /** - * Search lock in maps. - * = - * @param data - * @param searchType - * @return - */ - private LockData getLockData(NodeData data, int searchType) - { - if (data =3D=3D null || locks.size() =3D=3D 0) - return null; - LockData retval =3D null; - try - { - if ((searchType & SEARCH_EXECMATCH) !=3D 0) - { - retval =3D locks.get(data.getIdentifier()); - } - if (retval =3D=3D null && (searchType & SEARCH_CLOSEDPARENT) !=3D= 0) - { - - NodeData parentData =3D (NodeData)dataManager.getItemData(data= .getParentIdentifier()); - if (parentData !=3D null) - { - retval =3D locks.get(parentData.getIdentifier()); - // parent not found try to fo upper - if (retval =3D=3D null) - { - retval =3D getLockData(parentData, SEARCH_CLOSEDPARENT); - } - } - } - if (retval =3D=3D null && (searchType & SEARCH_CLOSEDCHILD) !=3D = 0) - { - - List childData =3D dataManager.getChildNodesData(dat= a); - for (NodeData nodeData : childData) - { - retval =3D locks.get(nodeData.getIdentifier()); - if (retval !=3D null) - break; - } - if (retval =3D=3D null) - { - // child not found try to find diper - for (NodeData nodeData : childData) - { - retval =3D getLockData(nodeData, SEARCH_CLOSEDCHILD); - if (retval !=3D null) - break; - } - } - } - } - catch (RepositoryException e) - { - return null; - } - - return retval; - } - - /** - * Internal lock - * = - * @param nodeIdentifier - * @throws LockException - * = - * TODO: Changed from private to public. Need for LockCacheLoader. - */ - public synchronized void internalLock(String nodeIdentifier) throws Loc= kException - { - LockData ldata =3D pendingLocks.get(nodeIdentifier); - if (ldata !=3D null) - { - locks.put(nodeIdentifier, ldata); - - if (persister !=3D null) - { - persister.add(ldata); - } - pendingLocks.remove(nodeIdentifier); - } - else - { - throw new LockException("No lock in pending locks"); - } - } - - /** - * Internal unlock. - * = - * @param sessionId - * @param nodeIdentifier - * @throws LockException - * = - * TODO: Changed from private to public. Need for LockCacheLoader. - */ - public synchronized void internalUnLock(String sessionId, String nodeId= entifier) throws LockException - { - LockData lData =3D locks.get(nodeIdentifier); - - if (lData !=3D null) - { - tokensMap.remove(lData.getLockToken(sessionId)); - locks.remove(nodeIdentifier); - - lData.setLive(false); - if (persister !=3D null) - { - persister.remove(lData); - } - lData =3D null; - } - } - - /** - * For locks comes from remote JCRs (replication usecase) - * = - * @param sessionId - * String - * @param nodeIdentifier - * String - * @param lockToken - * String - * @param isDeep - * boolean - * @param sessionScoped - * boolean - * @param owner - * String - * @return LockData - * = - * TODO: Changed from private to public. Need for LockCacheLoader. - */ - public synchronized LockData createRemoteLock(String sessionId, String = nodeIdentifier, String lockToken, - boolean isDeep, boolean sessionScoped, String owner) - { - LockData lData =3D new LockData(nodeIdentifier, lockToken, isDeep, s= essionScoped, owner, lockTimeOut); - lData.addLockHolder(sessionId); - locks.put(nodeIdentifier, lData); - tokensMap.put(lockToken, lData); - - return lData; - } - - /** - * Remove lock, used by Lock remover. - * = - * @param nodeIdentifier String - */ - protected void removeLock(String nodeIdentifier) - { - try - { - NodeData nData =3D (NodeData)dataManager.getItemData(nodeIdentifi= er); - PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), SystemIden= tity.SYSTEM, ExtendedEvent.UNLOCK); - - ItemData lockOwner =3D - copyItemData((PropertyData)dataManager.getItemData(nData, new = QPathEntry(Constants.JCR_LOCKOWNER, 1))); - - changesLog.add(ItemState.createDeletedState(lockOwner)); - - ItemData lockIsDeep =3D - copyItemData((PropertyData)dataManager.getItemData(nData, new = QPathEntry(Constants.JCR_LOCKISDEEP, 1))); - changesLog.add(ItemState.createDeletedState(lockIsDeep)); - - // lock probably removed by other thread - if (lockOwner =3D=3D null && lockIsDeep =3D=3D null) - return; - dataManager.save(new TransactionChangesLog(changesLog)); - } - catch (RepositoryException e) - { - log.error("Error occur during removing lock" + e.getLocalizedMess= age()); - } - } - - @Managed - @ManagedDescription("The number of active locks") - public int getNumLocks() - { - return locks.size(); - } - - @Managed - @ManagedDescription("Remove the expired locks") - public void cleanExpiredLocks() - { - removeExpired(); - } - - /** - * TODO: Added. Need for LockCacheLoader.. - */ - public boolean hasPendingLocks(String nodeIdentifier) - { - return pendingLocks.containsKey(nodeIdentifier); - } - - /** - * TODO: Added. Need for LockCacheLoader.. - */ - public boolean hasLockNode(String nodeIdentifier) - { - return locks.containsKey(nodeIdentifier); - } -} Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/lock/LockRemover.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockRemover.java 2009-11-17 16:14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockRemover.java 2009-11-17 16:18:15 UTC (rev 723) @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.core.lock; - -import org.exoplatform.services.jcr.impl.proccess.WorkerThread; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; - -/** - * Created by The eXo Platform SAS. - * = - * @author Sergey Kabashn= yuk - * @version $Id$ - */ -public class LockRemover extends WorkerThread -{ - - private final Log log =3D ExoLogger.getLogger("jcr.lock.LockRemover"); - - public static final long DEFAULT_THREAD_TIMEOUT =3D 30000; // 30 - - // sec - - private final LockManagerImpl lockManagerImpl; - - public LockRemover(LockManagerImpl lockManagerImpl) - { - this(lockManagerImpl, DEFAULT_THREAD_TIMEOUT); - } - - private LockRemover(LockManagerImpl lockManagerImpl, long timeout) - { - super(timeout); - this.lockManagerImpl =3D lockManagerImpl; - setName("LockRemover " + getId()); - setPriority(Thread.MIN_PRIORITY); - setDaemon(true); - start(); - if (log.isDebugEnabled()) - log.debug("LockRemover instantiated name=3D " + getName() + " tim= eout=3D " + timeout); - } - - @Override - protected void callPeriodically() throws Exception - { - lockManagerImpl.removeExpired(); - } -} Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java (= rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-17 16:18:15 UTC (= rev 723) @@ -0,0 +1,398 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core.lock; + +import org.exoplatform.services.jcr.access.SystemIdentity; +import org.exoplatform.services.jcr.core.ExtendedSession; +import org.exoplatform.services.jcr.core.SessionLifecycleListener; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; +import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.observation.ExtendedEvent; +import org.exoplatform.services.jcr.util.IdGenerator; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; + +import java.math.BigInteger; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.jcr.lock.LockException; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class SessionLockManager implements SessionLifecycleListener +{ + /** + * Default lock time out. 30min + */ + public static final long DEFAULT_LOCK_TIMEOUT =3D 1000 * 60 * 30; + + /** + * Search lockData for given node = + */ + private static final int SEARCH_EXACMATCH =3D 1; + + /** + * Search lockData for parent's of given node + */ + private static final int SEARCH_PARENT =3D 2; + + /** + * Search lockData for children of given node + */ + private static final int SEARCH_CHILD =3D 4; + + /** + * Session through which this lock manager is created + */ + private final SessionImpl session; + + protected final Log log =3D ExoLogger.getLogger(this.getClass().getName= ()); + + /** + * Holds session's tokens and their hashes to avoid calculation every t= ime. + * Token <--> Hash = + */ + private Map tokens; + + /** + * Holds session's tokens and their hashes to avoid calculation every t= ime. + * Hash <--> Token + * Added to speed up operations = + */ + private Map tokenHash; + + /** + * Configured lock timeout + */ + private long lockTimeOut; + + /** + * @param session + * @param lockTimeOut + */ + public SessionLockManager(SessionImpl session, long lockTimeOut) + { + this.session =3D session; + this.lockTimeOut =3D lockTimeOut; + // TODO: configured lock timeout should be acquired from WSconfig + /* if (config.getLockManager() !=3D null) + { + lockTimeOut =3D + config.getLockManager().getTimeout() > 0 ? config.getLockManag= er().getTimeout() : DEFAULT_LOCK_TIMEOUT; + } + else + lockTimeOut =3D DEFAULT_LOCK_TIMEOUT;*/ + } + + /** + * Adds token to current session + * @param token + */ + public void addLockToken(String token) + { + String hash =3D getHash(token); + tokens.put(token, hash); + tokenHash.put(hash, token); + } + + /** + * Removes token from current session + * @param token + */ + public void removeLockToken(String token) + { + String hash =3D getHash(token); + tokens.remove(token); + tokenHash.remove(hash); + } + + /** + * Tries to get Lock for node. Is node is not a lockholder, then parent= with deep lock is looked for. = + * = + * @param node + * @return + * @throws LockException + * @throws RepositoryException + */ + public LockImpl getLock(NodeData node) throws LockException, Repository= Exception + { + LockData lockData =3D getLockData(node, SEARCH_EXACMATCH | SEARCH_PA= RENT); + + if (lockData =3D=3D null || (!node.getIdentifier().equals(lockData.g= etNodeIdentifier()) && !lockData.isDeep())) + { + throw new LockException("Node not locked: " + node.getQPath()); + } + // if session doesn't have token, null will be returned + return new LockImpl(session, lockData, tokenHash.get(lockData.getTok= enHash())); + } + + /** + * Returns the list of token that current session owns. + * @return + */ + public String[] getLockTokens() + { + return tokens.keySet().toArray(new String[tokens.size()]); + } + + /** + * Checks if node actually has a lock. = + * = + * @param node + * @return + * @throws RepositoryException + */ + public boolean holdsLock(NodeData node) throws RepositoryException + { + return getLockData(node, SEARCH_EXACMATCH) !=3D null; + } + + /** + * Checks if current session has a token (access) for this node. + * = + * @param node + * @return + * @throws RepositoryException + */ + public boolean isLockHolder(NodeData node) throws RepositoryException + { + LockData lockData =3D getLockData(node, SEARCH_EXACMATCH | SEARCH_PA= RENT); + return lockData !=3D null && isLockHolder(lockData); + } + + /** + * Checks if node is locked, or it's any parent has a deep lock. = + * = + * @param node + * @return + */ + public boolean isLocked(NodeData node) + { + LockData lockData =3D getLockData(node, SEARCH_EXACMATCH | SEARCH_PA= RENT); + + if (lockData =3D=3D null || (!node.getIdentifier().equals(lockData.g= etNodeIdentifier()) && !lockData.isDeep())) + { + return false; + } + return true; + } + + /** + * Actually locks the node, adding jcr:lockOwner and jcr:lockIsDeep pro= perties to node and adds lock token + * to current session. = + * = + * @param node + * @param isDeep + * @param isSessionScoped + * @param timeOut + * @return + * @throws LockException + * @throws RepositoryException + */ + public LockImpl lock(NodeData node, boolean isDeep, boolean isSessionSc= oped, long timeOut) throws LockException, + RepositoryException + { + // check child node is not locked + if (isDeep && getLockData(node, SEARCH_CHILD) !=3D null) + { + throw new LockException("Can't place deep lock: some child node i= s locked."); + } + + String token =3D IdGenerator.generate(); + String hash =3D getHash(token); + + LockData lockData =3D + new LockData(node.getIdentifier(), hash, isDeep, isSessionScoped,= session.getUserID(), timeOut > 0 ? timeOut + : lockTimeOut); + + tokens.put(token, hash); + tokenHash.put(hash, token); + + // Create and pass changes log = + LockPlainChangesLogImpl changesLog =3D + new LockPlainChangesLogImpl(new ArrayList(), session.g= etId(), ExtendedEvent.LOCK); + + changesLog.setLockData(lockData); + + PropertyData propData =3D + TransientPropertyData.createPropertyData(node, Constants.JCR_LOCK= OWNER, PropertyType.STRING, false, + new TransientValueData(session.getUserID())); + changesLog.add(ItemState.createAddedState(propData)); + + propData =3D + TransientPropertyData.createPropertyData(node, Constants.JCR_LOCK= ISDEEP, PropertyType.BOOLEAN, false, + new TransientValueData(isDeep)); + changesLog.add(ItemState.createAddedState(propData)); + + LockImpl newLock =3D new LockImpl(session, lockData, token); + + session.getTransientNodesManager().getTransactManager().save(changes= Log); + return newLock; + } + + /** + * Actually unlock the node also removing jcr:lockOwner and jcr:lockIsD= eep properties + * = + * @param node + * @throws RepositoryException + */ + public void unlock(NodeData node) throws RepositoryException + { + PlainChangesLog changesLog =3D + new PlainChangesLogImpl(new ArrayList(), session.getId= (), ExtendedEvent.UNLOCK); + + ItemData lockOwner =3D + session.getTransientNodesManager().getItemData(node, new QPathEnt= ry(Constants.JCR_LOCKOWNER, 0)); + + changesLog.add(ItemState.createDeletedState(lockOwner)); + + ItemData lockIsDeep =3D + session.getTransientNodesManager().getItemData(node, new QPathEnt= ry(Constants.JCR_LOCKISDEEP, 0)); + + changesLog.add(ItemState.createDeletedState(lockIsDeep)); + + session.getTransientNodesManager().getTransactManager().save(changes= Log); + } + + /** + * Calculates md5 hash of string. + * = + * @param token + * @return + */ + private String getHash(String token) + { + String hash =3D ""; + try + { + MessageDigest m =3D MessageDigest.getInstance("MD5"); + m.update(token.getBytes(), 0, token.length()); + hash =3D new BigInteger(1, m.digest()).toString(16); + } + catch (NoSuchAlgorithmException e) + { + log.error("Can't get instanse of MD5 MessageDigest!", e); + } + return hash; + } + + /** + * Search lock with given search options: + * * for only given node + * * for any upper parent of given node + * * for any deeper child of given node + * = + * @param data + * @param searchType + * @return + */ + private LockData getLockData(NodeData data, int searchType) + { + if (data =3D=3D null) + return null; + LockData retval =3D null; + try + { + if ((searchType & SEARCH_EXACMATCH) !=3D 0) + { + retval =3D session.getTransientNodesManager().getLockData(data= .getIdentifier()); + } + if (retval =3D=3D null && (searchType & SEARCH_PARENT) !=3D 0) + { + + NodeData parentData =3D (NodeData)session.getTransientNodesMan= ager().getItemData(data.getParentIdentifier()); + if (parentData !=3D null) + { + retval =3D session.getTransientNodesManager().getLockData(p= arentData.getIdentifier()); + // parent not found try to find upper + if (retval =3D=3D null) + { + retval =3D getLockData(parentData, SEARCH_PARENT); + } + } + } + if (retval =3D=3D null && (searchType & SEARCH_CHILD) !=3D 0) + { + + List childData =3D session.getTransientNodesManager(= ).getChildNodesData(data); + for (NodeData nodeData : childData) + { + retval =3D session.getTransientNodesManager().getLockData(n= odeData.getIdentifier()); + if (retval !=3D null) + break; + } + if (retval =3D=3D null) + { + // child not found try to find deeper + for (NodeData nodeData : childData) + { + retval =3D getLockData(nodeData, SEARCH_CHILD); + if (retval !=3D null) + break; + } + } + } + } + catch (RepositoryException e) + { + return null; + } + + return retval; + } + + /** + * Checks if session has token to this lock data or session is System. + * = + * @param lockData + * @return + */ + private boolean isLockHolder(LockData lockData) + { + return (SystemIdentity.SYSTEM.equals(session.getId()) || tokenHash.g= et(lockData.getTokenHash()) !=3D null); + } + + /** + * @see org.exoplatform.services.jcr.core.SessionLifecycleListener#onCl= oseSession(org.exoplatform.services.jcr.core.ExtendedSession) + */ + public void onCloseSession(ExtendedSession session) + { + // TODO: remove session scoped locks + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/core/lock/SessionLockManager.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/LockCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-17 16:14:29= UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoader.java 2009-11-17 16:18:15= UTC (rev 723) @@ -1,324 +0,0 @@ -/* - * Copyright (C) 2003-2009 eXo Platform SAS. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; -import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.exoplatform.services.jcr.util.IdGenerator; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.cache.CacheException; -import org.jboss.cache.Modification; -import org.jboss.cache.Modification.ModificationType; -import org.jboss.cache.factories.annotations.Inject; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; - -import javax.jcr.lock.LockException; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 2009 - * - * @author
Anatoliy= Bazko = - * @version $Id$ - */ -public class LockCacheLoader extends AbstractWriteOnlyCacheLoader -{ - - /** - * Lock manager. - */ - private LockManagerImpl lockManager; - - /** - * Logger. - */ - private final Log log =3D ExoLogger.getLogger("jcr.LockCacheLoader"); - - /** - * Injection dependencies. - * - * @param lockManager LockManagerImpl - */ - @Inject - public void injectDependencies(LockManagerImpl lockManager) throws Repo= sitoryConfigurationException - { - if (this.lockManager !=3D null) - { - throw new RepositoryConfigurationException("Cannot set LockManage= rImpl twice"); - } - - this.lockManager =3D lockManager; - } - - /** - * {@inheritDoc} - */ - @Override - public void put(List modifications) throws Exception - { - String sessionId =3D null; - HashSet removedLock =3D new HashSet(); - List lockChanges =3D new ArrayList(); - - for (Modification m : modifications) - { - if (m.getFqn().get(0).equals(JBossCacheStorage.SESSION)) - { - switch (m.getType()) - { - case PUT_DATA_ERASE : - break; - case PUT_DATA : - break; - case PUT_KEY_VALUE : - // begin new changes log - if (m.getKey().equals(JBossCacheStorage.SESSION_ID)) - { - sessionId =3D (String)m.getValue(); - } - break; - case REMOVE_DATA : - // end changes log - if (lockChanges.size() =3D=3D 2) - { - if (lockChanges.get(0).getType() =3D=3D ModificationT= ype.PUT_KEY_VALUE - && lockChanges.get(1).getType() =3D=3D Modificatio= nType.PUT_KEY_VALUE) - { - performLock(lockChanges, sessionId); - } - else if (lockChanges.get(0).getType() =3D=3D Modifica= tionType.REMOVE_KEY_VALUE - && lockChanges.get(1).getType() =3D=3D Modificatio= nType.REMOVE_KEY_VALUE) - { - performUnLock(lockChanges, (String)lockChanges.get= (0).getFqn().get(1), sessionId); - } - else - { - log.error("Incorrect changes log contains lock and= unlock operation simultaneously"); - } - } - else if (lockChanges.size() !=3D 0) - { - log.error("Incorrect changes log size for lock or un= lock operation"); - } - - for (String identifier : removedLock) - { - lockManager.internalUnLock(identifier, sessionId); - } - - lockChanges =3D new ArrayList(); - removedLock =3D new HashSet(); - sessionId =3D null; - break; - case REMOVE_KEY_VALUE : - break; - case REMOVE_NODE : - break; - case MOVE : - break; - default : - throw new CacheException("Unknown modification " + m.get= Type()); - } - } - else if (m.getFqn().get(0).equals(JBossCacheStorage.PROPS)) - { - switch (m.getType()) - { - case PUT_DATA_ERASE : - break; - case PUT_DATA : - break; - case PUT_KEY_VALUE : - // lock operation - if (m.getKey().equals(JBossCacheStorage.ITEM_DATA)) - { - InternalQName propName =3D ((PropertyData)m.getValue(= )).getQPath().getName(); - if (propName.equals(Constants.JCR_LOCKISDEEP) || prop= Name.equals(Constants.JCR_LOCKOWNER)) - { - lockChanges.add(m); - } - } - break; - case REMOVE_DATA : - break; - case REMOVE_KEY_VALUE : - break; - case REMOVE_NODE : - break; - case MOVE : - break; - default : - throw new CacheException("Unknown modification " + m.get= Type()); - } - } - else if (m.getFqn().get(0).equals(JBossCacheStorage.NODES)) - { - switch (m.getType()) - { - case PUT_DATA_ERASE : - break; - case PUT_DATA : - if (m.getFqn().size() =3D=3D 2) - { - String nodeIdentifier =3D (String)m.getFqn().get(1); - if (lockManager.hasLockNode(nodeIdentifier)) - { - removedLock.remove(nodeIdentifier); - } - } - break; - case PUT_KEY_VALUE : - break; - case REMOVE_DATA : - break; - case REMOVE_KEY_VALUE : - // unLock operation - if (m.getKey().equals(Constants.JCR_LOCKISDEEP.getAsStri= ng()) - || m.getKey().equals(Constants.JCR_LOCKOWNER.getAsStr= ing())) - { - lockChanges.add(m); - } - break; - case REMOVE_NODE : - if (m.getFqn().size() =3D=3D 2) - { - String nodeIdentifier =3D (String)m.getFqn().get(1); - if (lockManager.hasLockNode(nodeIdentifier)) - { - removedLock.add(nodeIdentifier); - } - } - break; - case MOVE : - if (m.getFqn().size() =3D=3D 2) - { - String nodeIdentifier =3D (String)m.getFqn().get(1); - if (lockManager.hasLockNode(nodeIdentifier)) - { - removedLock.remove(nodeIdentifier); - } - } - break; - default : - throw new CacheException("Unknown modification " + m.get= Type()); - } - } - } - } - - /** - * Perform lock operation. - * - * @param lockChanges - * @throws LockException - */ - private void performLock(List lockChanges, String session= Id) - { - String nodeIdentifier =3D ((PropertyData)lockChanges.get(0).getValue= ()).getParentIdentifier(); - - try - { - if (lockManager.hasPendingLocks(nodeIdentifier)) - { - log.info("Perform lock operation nodeIdentifier=3D" + nodeIden= tifier); - lockManager.internalLock(nodeIdentifier); - } - else - { - log.warn("No lock in pendingLocks for identifier " + nodeIdent= ifier - + " Probably lock come from replication."); - - String lockToken =3D IdGenerator.generate(); - Modification ownerModification =3D getModification(lockChanges= , Constants.JCR_LOCKOWNER); - Modification isDeepModification =3D getModification(lockChange= s, Constants.JCR_LOCKISDEEP); - - if (ownerModification !=3D null && isDeepModification !=3D nul= l) - { - - String owner =3D - new String(((((TransientPropertyData)(ownerModification.= getValue())).getValues()).get(0)) - .getAsByteArray(), Constants.DEFAULT_ENCODING); - - boolean isDeep =3D - Boolean.valueOf( - new String(((((TransientPropertyData)(isDeepModificat= ion.getValue())).getValues()).get(0)) - .getAsByteArray(), Constants.DEFAULT_ENCODING)).bo= oleanValue(); - - lockManager.createRemoteLock(sessionId, nodeIdentifier, loc= kToken, isDeep, false, owner); - } - } - } - catch (LockException e) - { - log.error(e.getLocalizedMessage(), e); - } - catch (UnsupportedEncodingException e) - { - log.error(e.getLocalizedMessage(), e); - } - catch (IllegalStateException e) - { - log.error(e.getLocalizedMessage(), e); - } - catch (IOException e) - { - log.error(e.getLocalizedMessage(), e); - } - } - - private void performUnLock(List lockChanges, String nodeI= dentifier, String sessionId) - { - try - { - log.info("Perform unlock operation nodeIdentifier=3D" + nodeIdent= ifier + " sessionId=3D" + sessionId); - lockManager.internalUnLock(nodeIdentifier, sessionId); - } - catch (LockException e) - { - log.error(e.getLocalizedMessage(), e); - } - } - - /** - * Search item with name itemName in modification list - * = - * @param changes - * @param itemName - * @return Item - */ - private Modification getModification(List changes, Intern= alQName itemName) - { - for (Modification m : changes) - { - if (((PropertyData)changes.get(0).getValue()).getQPath().getName(= ).equals(itemName)) - return m; - } - return null; - } - -} Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/core/lock/TestLockImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestLockImpl.java 2009-11-17 16:14:29 UTC (rev 72= 2) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestLockImpl.java 2009-11-17 16:18:15 UTC (rev 72= 3) @@ -32,11 +32,10 @@ { private ExtendedNode lockedNode =3D null; = - private LockManagerImpl service; - private static final long LOCK_TIMEOUT =3D 5; // sec = - private static final long LOCK_REMOVER_WAIT =3D LockRemover.DEFAULT_THR= EAD_TIMEOUT + (LOCK_TIMEOUT + 1) * 1000; // 15 + //private static final long LOCK_REMOVER_WAIT =3D LockRemover.DEFAULT_T= HREAD_TIMEOUT + (LOCK_TIMEOUT + 1) * 1000; // 15 + private static final long LOCK_REMOVER_WAIT =3D (LOCK_TIMEOUT + 30) * 1= 000; // = // sec = @@ -45,8 +44,6 @@ = super.setUp(); = - service =3D (LockManagerImpl)container.getComponentInstanceOfType(Lo= ckManagerImpl.class); - if (lockedNode =3D=3D null) try { Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-17 16:1= 4:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/LockCacheLoaderTest.java 2009-11-17 16:1= 8:15 UTC (rev 723) @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2003-2009 eXo Platform SAS. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; -import org.exoplatform.services.jcr.config.ContainerEntry; -import org.exoplatform.services.jcr.config.RepositoryEntry; -import org.exoplatform.services.jcr.config.SimpleParameterEntry; -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.lock.LockData; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; -import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; -import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; -import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; -import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; -import org.exoplatform.services.jcr.util.IdGenerator; - -import org.jboss.cache.Cache; -import org.jboss.cache.CacheSPI; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.Fqn; -import org.jboss.cache.Modification; -import org.jboss.cache.Node; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.PropertyType; -import javax.naming.Context; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 2009 - * - * @author Anatoliy= Bazko = - * @version $Id$ - */ -public class LockCacheLoaderTest extends AbstractCacheLoaderTest -{ - - private TesterLockManagerImpl lockManager; - - private LockCacheLoader lockCacheLoader; - - private final QPath testRoot =3D QPath.makeChildPath(Constants.ROOT_PAT= H, new InternalQName("", "testRoot")); - - public void setUp() throws Exception - { - super.setUp(); - - lockManager =3D new TesterLockManagerImpl(); - lockCacheLoader =3D new LockCacheLoader(); - lockCacheLoader.injectDependencies(lockManager); - } - - /** - * {@inheritDoc} - */ - protected void tearDown() throws Exception - { - - super.tearDown(); - } - - public void testLock() throws Exception - { - List modifications =3D new ArrayList(); - String nodeIdentifier =3D "node1"; - String sessionId =3D "session1"; - - TransientPropertyData lockIsDeepData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), "prop1", 1, - PropertyType.BOOLEAN, nodeIdentifier, false); - TransientValueData lockIsDeepValue =3D new TransientValueData(false); - lockIsDeepData.setValue(lockIsDeepValue); - - TransientPropertyData lockOwnerData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), "prop2", 1, - PropertyType.BOOLEAN, nodeIdentifier, false); - TransientValueData lockOwner =3D new TransientValueData("__system"); - lockOwnerData.setValue(lockOwner); - - lockManager.addPendingLock(nodeIdentifier, new LockData(nodeIdentifi= er, "token", false, false, "__system", -1)); - - modifications.addAll(addSessionInfo(sessionId, "userId")); - modifications.addAll(addProperty(lockIsDeepData)); - modifications.addAll(addProperty(lockOwnerData)); - modifications.addAll(removeSessionInfo()); - lockCacheLoader.put(modifications); - - assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); - } - - public void testUnLock() throws Exception - { - List modifications =3D new ArrayList(); - String nodeIdentifier =3D "node1"; - String sessionId =3D "session1"; - - TransientPropertyData lockIsDeepData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKISDEEP), "prop1", 1, - PropertyType.BOOLEAN, nodeIdentifier, false); - TransientValueData lockIsDeepValue =3D new TransientValueData(false); - lockIsDeepData.setValue(lockIsDeepValue); - - TransientPropertyData lockOwnerData =3D - new TransientPropertyData(QPath.makeChildPath(testRoot, Constants= .JCR_LOCKOWNER), "prop2", 1, - PropertyType.BOOLEAN, nodeIdentifier, false); - TransientValueData lockOwner =3D new TransientValueData("__system"); - lockOwnerData.setValue(lockOwner); - - modifications.addAll(addSessionInfo(sessionId, "userId")); - modifications.addAll(removeProperty(lockIsDeepData)); - modifications.addAll(removeProperty(lockOwnerData)); - modifications.addAll(removeSessionInfo()); - lockCacheLoader.put(modifications); - - assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); - assertEquals(sessionId, lockManager.getSessionid()); - } - - public void testAddNodeLock() throws Exception - { - List modifications =3D new ArrayList(); - String nodeIdentifier =3D "node1"; - String sessionId =3D "session1"; - - TransientNodeData node =3D - new TransientNodeData(testRoot, nodeIdentifier, 0, null, null, 0,= Constants.ROOT_UUID, null); - - lockManager.addLock(nodeIdentifier, new LockData(nodeIdentifier, "to= ken", false, false, "__system", -1)); - - modifications.addAll(addSessionInfo(sessionId, "userId")); - modifications.addAll(addNode(node)); - modifications.addAll(removeSessionInfo()); - lockCacheLoader.put(modifications); - - assertNull(lockManager.getNodeIdentifier()); - assertNull(lockManager.getSessionid()); - } - - public void testRemoveNodeLock() throws Exception - { - List modifications =3D new ArrayList(); - String nodeIdentifier =3D "node1"; - String sessionId =3D "session1"; - - TransientNodeData node =3D - new TransientNodeData(testRoot, nodeIdentifier, 0, null, null, 0,= Constants.ROOT_UUID, null); - - lockManager.addLock(nodeIdentifier, new LockData(nodeIdentifier, "to= ken", false, false, "__system", -1)); - - modifications.addAll(addSessionInfo(sessionId, "userId")); - modifications.addAll(removeNode(node)); - modifications.addAll(removeSessionInfo()); - lockCacheLoader.put(modifications); - - assertEquals(nodeIdentifier, lockManager.getNodeIdentifier()); - assertEquals(sessionId, lockManager.getSessionid()); - } -} Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-17 16= :14:29 UTC (rev 722) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/TesterLockManagerImpl.java 2009-11-17 16= :18:15 UTC (rev 723) @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2003-2009 eXo Platform SAS. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.impl.core.lock.LockData; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; -import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; -import org.jboss.cache.factories.annotations.NonVolatile; - -import javax.jcr.lock.LockException; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 2009 - * - * @author Anatoliy= Bazko = - * @version $Id$ - */ -(a)NonVolatile -public class TesterLockManagerImpl extends LockManagerImpl -{ - - private String nodeIdentifier =3D null; - - private String sessionId =3D null; - - public TesterLockManagerImpl(WorkspacePersistentDataManager dataManager= , WorkspaceEntry config) - { - super(dataManager, config); - } - - public TesterLockManagerImpl() - { - this(new TesterWorkspacePersistedDataManager(null, null), new Tester= WorkspaceEntry()); - } - - /** - * Internal lock - */ - public synchronized void internalLock(String nodeIdentifier) throws Loc= kException - { - if (this.nodeIdentifier !=3D null) - throw new LockException("NodeIdentifier already exist!"); - - this.nodeIdentifier =3D nodeIdentifier; - } - - /** - * Internal lock - */ - public synchronized void internalUnLock(String nodeIdentifier, String s= essionId) throws LockException - { - if (this.nodeIdentifier !=3D null) - throw new LockException("NodeIdentifier already exist!"); - - if (this.sessionId !=3D null) - throw new LockException("SessionId already exist!"); - - this.nodeIdentifier =3D nodeIdentifier; - this.sessionId =3D sessionId; - } - - public String getNodeIdentifier() - { - return nodeIdentifier; - } - - public String getSessionid() - { - return sessionId; - } - - public void addPendingLock(String nodeIdentifier, LockData lData) - { - pendingLocks.put(nodeIdentifier, lData); - } - - public void addLock(String nodeIdentifier, LockData lData) - { - locks.put(nodeIdentifier, lData); - } -} --===============5745458424702107423==-- From do-not-reply at jboss.org Tue Nov 17 11:18:58 2009 Content-Type: multipart/mixed; boundary="===============4099641934728851755==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r724 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage. Date: Tue, 17 Nov 2009 11:18:58 -0500 Message-ID: <200911171618.nAHGIwSi020355@svn01.web.mwc.hst.phx2.redhat.com> --===============4099641934728851755== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 11:18:57 -0500 (Tue, 17 Nov 2009) New Revision: 724 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCStorageConnectionTest.java Log: EXOJCR-203: test fix Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCStorageConnectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17 16:18:15 = UTC (rev 723) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17 16:18:57 = UTC (rev 724) @@ -18,12 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage; = -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; - import org.exoplatform.services.jcr.JcrImplBaseTest; import org.exoplatform.services.jcr.access.AccessControlEntry; import org.exoplatform.services.jcr.access.PermissionType; @@ -43,9 +37,15 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; = +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; + /** * Created by The eXo Platform SAS Author : Peter Nedonosko peter.nedonosk= o(a)exoplatform.com.ua * 30.01.2008 @@ -274,7 +274,7 @@ = PropertyData primaryTypeData =3D propertysData.get(0); = - WorkspaceStorageConnection connection =3D dataContainer.openConnecti= on(); + JDBCStorageConnection connection =3D (JDBCStorageConnection) dataCon= tainer.openConnection(); = connection.deleteProperty(primaryTypeData.getIdentifier()); connection.deleteNode(testRoot.getIdentifier()); --===============4099641934728851755==-- From do-not-reply at jboss.org Tue Nov 17 11:20:15 2009 Content-Type: multipart/mixed; boundary="===============0194284778960121944==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r725 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/dataflow. Date: Tue, 17 Nov 2009 11:20:15 -0500 Message-ID: <200911171620.nAHGKF3J020804@svn01.web.mwc.hst.phx2.redhat.com> --===============0194284778960121944== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-17 11:20:15 -0500 (Tue, 17 Nov 2009) New Revision: 725 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/dataflow/LockPlainChangesLogImpl.java Log: EXOJCR-242: LockPlainChangesLog updated. (minor fix) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/dataflow/LockPlainChangesLogImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/LockPlainChangesLogImpl.java 2009-11-17 16:18:57 UTC (r= ev 724) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/LockPlainChangesLogImpl.java 2009-11-17 16:20:15 UTC (r= ev 725) @@ -20,7 +20,7 @@ = import org.exoplatform.services.jcr.impl.core.lock.LockData; = -import java.util.ArrayList; +import java.util.List; = /** * This plain changes log is used to pass lock information through DataMan= ager down to @@ -39,9 +39,9 @@ * @param id * @param lock */ - public LockPlainChangesLogImpl(ArrayList arrayList, String i= d, int lock) + public LockPlainChangesLogImpl(List items, String sessionId,= int eventType) { - super(arrayList, id, lock); + super(items, sessionId, eventType); } = public LockData getLockData() --===============0194284778960121944==-- From do-not-reply at jboss.org Tue Nov 17 11:24:46 2009 Content-Type: multipart/mixed; boundary="===============8636596570115131609==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r726 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc. Date: Tue, 17 Nov 2009 11:24:46 -0500 Message-ID: <200911171624.nAHGOkKq021534@svn01.web.mwc.hst.phx2.redhat.com> --===============8636596570115131609== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-17 11:24:46 -0500 (Tue, 17 Nov 2009) New Revision: 726 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/SQLExceptionHandler.java Log: EXOJCR-249 : The JDBCStorageConnection, SQLExceptionHandler was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 16:20:15= UTC (rev 725) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 16:24:46= UTC (rev 726) @@ -1937,7 +1937,7 @@ { if (LOG.isDebugEnabled()) LOG.error("Node remove. Database error: " + e, e); - exceptionHandler.handleDeleteException(e, identifier, true, ""); + exceptionHandler.handleDeleteException(e, identifier, true); } = } @@ -1991,7 +1991,7 @@ { if (LOG.isDebugEnabled()) LOG.error("Property remove. Database error: " + e, e); - exceptionHandler.handleDeleteException(e, identifier, true, ""); + exceptionHandler.handleDeleteException(e, identifier, true); } } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/SQLExceptionHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2009-11-17 16:20:15 U= TC (rev 725) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/SQLExceptionHandler.java 2009-11-17 16:24:46 U= TC (rev 726) @@ -338,21 +338,20 @@ * = * @param e * - an SQLException - * @param item - * - context ItemData + * @param itemId + * - identifier of ItemData * @return String with error message * @throws RepositoryException * if RepositoryException should be thrown * @throws InvalidItemStateException * if InvalidItemStateException should be thrown */ - protected String handleDeleteException(SQLException e, String itemId, b= oolean isNode, String path ) throws RepositoryException, + protected String handleDeleteException(SQLException e, String itemId, b= oolean isNode) throws RepositoryException, InvalidItemStateException { String message =3D "[" + containerName + "] DELETE " + (isNode ? "NO= DE. " : "PROPERTY. "); String errMessage =3D e.getMessage(); - String itemInfo =3D - path + " " + itemId + String itemInfo =3D "ID =3D " + itemId + (errMessage !=3D null ? ". Cause >>>> " + errMessage : ""); = if (errMessage !=3D null) --===============8636596570115131609==-- From do-not-reply at jboss.org Tue Nov 17 11:35:31 2009 Content-Type: multipart/mixed; boundary="===============9098252333889985972==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r727 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 17 Nov 2009 11:35:30 -0500 Message-ID: <200911171635.nAHGZUuV023906@svn01.web.mwc.hst.phx2.redhat.com> --===============9098252333889985972== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 11:35:30 -0500 (Tue, 17 Nov 2009) New Revision: 727 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-203: JDBC loader exists() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-17 16:24:46 UTC (rev 726) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-17 16:35:30 UTC (rev 727) @@ -131,7 +131,7 @@ cache.startBatch(); this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .NODES)); this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheSt= orage.PROPS)); - this.session =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.SESSION)); + this.session =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.SESSION)); // TODO remove it this.locks =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .LOCKS)); cache.endBatch(true); } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 16:24:46= UTC (rev 726) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 16:35:30= UTC (rev 727) @@ -18,25 +18,13 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import java.sql.SQLException; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateExcept= ion; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -49,6 +37,15 @@ import org.jboss.cache.factories.annotations.Inject; import org.jboss.cache.loader.AbstractCacheLoader; = +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import javax.jcr.RepositoryException; + /** * Created by The eXo Platform SAS. * = @@ -270,7 +267,7 @@ = Map attrs; = - WorkspaceStorageConnection conn =3D dataContainer.openConnection(); + JDBCStorageConnection conn =3D (JDBCStorageConnection) dataContainer= .openConnection(); try { = @@ -393,8 +390,15 @@ */ public boolean exists(Fqn name) throws Exception { - // TODO Will be created specialization code to checking exist node o= r property in DB without getting NodeData or PropertyData from DB. = - return get(name) !=3D null; + // TODO Will be created specialization code to checking exist node o= r property in DB without getting NodeData or PropertyData from DB. + try + { + return get(name) !=3D null; + } + catch (JDBCCacheLoaderException e) + { + return false; + } } = /** @@ -409,7 +413,7 @@ // /$NODES/ if (name.size() =3D=3D 2) { - WorkspaceStorageConnection conn =3D dataContainer.openConnection(= ); + JDBCStorageConnection conn =3D (JDBCStorageConnection) dataContai= ner.openConnection(); try { String nodeId =3D (String)name.get(1); @@ -455,7 +459,9 @@ childs.add(JBossCacheStorage.NODES); childs.add(JBossCacheStorage.PROPS); childs.add(JBossCacheStorage.LOCKS); - } else { + } + else + { childs =3D null; } = --===============9098252333889985972==-- From do-not-reply at jboss.org Tue Nov 17 11:35:31 2009 Content-Type: multipart/mixed; boundary="===============5160807114513477881==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r728 - jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone. Date: Tue, 17 Nov 2009 11:35:31 -0500 Message-ID: <200911171635.nAHGZVjL023915@svn01.web.mwc.hst.phx2.redhat.com> --===============5160807114513477881== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-17 11:35:30 -0500 (Tue, 17 Nov 2009) New Revision: 728 Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-= configuration-replication.xml Log: test configuration updated Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalon= e/test-configuration-replication.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test= -configuration-replication.xml 2009-11-17 16:35:30 UTC (rev 727) +++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test= -configuration-replication.xml 2009-11-17 16:35:30 UTC (rev 728) @@ -186,7 +186,7 @@ conf-path JCR configuration file - file:src/test/java/conf/standalone/test-jcr-ext-config-= replication.xml + file:src/test/resources/conf/standalone/test-jcr-ext-co= nfig-replication.xml --===============5160807114513477881==-- From do-not-reply at jboss.org Tue Nov 17 11:42:19 2009 Content-Type: multipart/mixed; boundary="===============1106255386414053801==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r729 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage. Date: Tue, 17 Nov 2009 11:42:19 -0500 Message-ID: <200911171642.nAHGgJxD025172@svn01.web.mwc.hst.phx2.redhat.com> --===============1106255386414053801== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-17 11:42:18 -0500 (Tue, 17 Nov 2009) New Revision: 729 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCStorageConnectionTest.java Log: EXOJCR-249 : The JDBCStorageConnectionTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCStorageConnectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17 16:35:30 = UTC (rev 728) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-17 16:42:18 = UTC (rev 729) @@ -267,21 +267,31 @@ WorkspaceDataContainer dataContainer =3D (WorkspaceDataContainer) session.getContainer().getComponen= tInstanceOfType(WorkspaceDataContainer.class); = - List propertysData =3D dataManager.getChildPropertiesD= ata(testRoot); + // create node with property primary type. + TransientNodeData troot =3D + TransientNodeData.createNodeData(root, InternalQName.parse("[]nod= e_to_delete_by_id"), + Constants.NT_UNSTRUCTURED); = - assertNotNull(propertysData); - assertEquals(1, propertysData.size()); + TransientPropertyData pt =3D + TransientPropertyData.createPropertyData(troot, Constants.JCR_PRI= MARYTYPE, PropertyType.NAME, false, + new TransientValueData(Constants.NT_UNSTRUCTURED)); = - PropertyData primaryTypeData =3D propertysData.get(0); + PlainChangesLogImpl chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createAddedState(troot)); + chlog.add(ItemState.createAddedState(pt)); = + dataManager.save(new TransactionChangesLog(chlog)); + + // Delete node and property by ID. JDBCStorageConnection connection =3D (JDBCStorageConnection) dataCon= tainer.openConnection(); = - connection.deleteProperty(primaryTypeData.getIdentifier()); - connection.deleteNode(testRoot.getIdentifier()); + connection.deleteProperty(pt.getIdentifier()); + connection.deleteNode(troot.getIdentifier()); connection.commit(); = - assertNull(dataManager.getItemData(testRoot.getIdentifier())); - assertNull(dataManager.getItemData(primaryTypeData.getIdentifier())); + //check + assertNull(dataManager.getItemData(troot.getIdentifier())); + assertNull(dataManager.getItemData(pt.getIdentifier())); } = } --===============1106255386414053801==-- From do-not-reply at jboss.org Tue Nov 17 11:51:35 2009 Content-Type: multipart/mixed; boundary="===============9203784800599739341==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r730 - ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl. Date: Tue, 17 Nov 2009 11:51:35 -0500 Message-ID: <200911171651.nAHGpZxT027406@svn01.web.mwc.hst.phx2.redhat.com> --===============9203784800599739341== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2009-11-17 11:51:35 -0500 (Tue, 17 Nov 2009) New Revision: 730 Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/im= pl/InputHeadersMap.java Log: EXOJCR-255 : method size() return size of back-end map. Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/= rest/impl/InputHeadersMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/i= mpl/InputHeadersMap.java 2009-11-17 16:42:18 UTC (rev 729) +++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/i= mpl/InputHeadersMap.java 2009-11-17 16:51:35 UTC (rev 730) @@ -255,6 +255,14 @@ throw new UnsupportedOperationException(); } = + /** + * {@inheritDoc} + */ + public int size() + { + return m.size(); + } + // MultivaluedMap = /** @@ -281,7 +289,7 @@ { throw new UnsupportedOperationException(); } - + = // helpers methods = /** --===============9203784800599739341==-- From do-not-reply at jboss.org Tue Nov 17 11:51:56 2009 Content-Type: multipart/mixed; boundary="===============6192480492332369228==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r731 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directory. Date: Tue, 17 Nov 2009 11:51:55 -0500 Message-ID: <200911171651.nAHGptCr027451@svn01.web.mwc.hst.phx2.redhat.com> --===============6192480492332369228== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 11:51:55 -0500 (Tue, 17 Nov 2009) New Revision: 731 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-203: JDBC conn new methods Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-17 16:51:35 UTC (rev = 730) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-17 16:51:55 UTC (rev = 731) @@ -131,6 +131,11 @@ * FIND_PROPERTIES_BY_PARENTID. */ protected String FIND_PROPERTIES_BY_PARENTID; + = + /** + * FIND_PROPERTIES_IDNAME_BY_PARENTID. + */ + protected String FIND_PROPERTIES_IDNAME_BY_PARENTID; = /** * INSERT_NODE. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 16:51:35= UTC (rev 730) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 16:51:55= UTC (rev 731) @@ -2009,7 +2009,22 @@ public List getChildProperties(String parentId) throw= s RepositoryException, IllegalStateException { = - return new ArrayList(); // TODO + checkIfOpened(); + = + List children =3D new ArrayList(= ); + try + { + ResultSet prop =3D findChildPropertiesIdNameByParentIdentifier(ge= tInternalId(parentId)); + while (prop.next()) { + //children.add((PropertyData)itemData(parent.getQPath(), prop,= I_CLASS_PROPERTY, null)); + } + + return children; + } + catch (SQLException e) + { + throw new RepositoryException(e); + } } = public List getChildNodeNames(String parentId) throws Repositor= yException, IllegalStateException @@ -2081,6 +2096,8 @@ protected abstract ResultSet findChildNodesByParentIdentifier(String pa= rentIdentifier) throws SQLException; = protected abstract ResultSet findChildPropertiesByParentIdentifier(Stri= ng parentIdentifier) throws SQLException; + = + protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentIdentifier) throws SQLException; = protected abstract int addReference(PropertyData data) throws SQLExcept= ion, IOException; = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 7 16:51:35 UTC (rev 730) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 7 16:51:55 UTC (rev 731) @@ -83,6 +83,8 @@ "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D1= and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D2= and CONTAINER_NAME=3D?" + " order by ID"; + FIND_PROPERTIES_IDNAME_BY_PARENTID =3D + "select ID, NAME from JCR_SITEM" + " where PARENT_ID=3D? and I_CL= ASS=3D2 and CONTAINER_NAME=3D?"; } = /** @@ -151,4 +153,20 @@ findPropertiesByParentId.setString(2, containerName); return findPropertiesByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findChildPropertiesIdNameByParentIdentifier(String = parentCid) throws SQLException + { + if (findPropertiesIdNameByParentId =3D=3D null) + findPropertiesIdNameByParentId =3D dbConnection.prepareStatement(= FIND_PROPERTIES_IDNAME_BY_PARENTID); + else + findPropertiesIdNameByParentId.clearParameters(); + + findPropertiesIdNameByParentId.setString(1, parentCid); + findPropertiesIdNameByParentId.setString(2, containerName); + return findPropertiesIdNameByParentId.executeQuery(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-17 16:51= :35 UTC (rev 730) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-17 16:51= :55 UTC (rev 731) @@ -79,6 +79,8 @@ protected PreparedStatement findNodesByParentId; = protected PreparedStatement findPropertiesByParentId; + = + protected PreparedStatement findPropertiesIdNameByParentId; = protected PreparedStatement insertNode; = @@ -187,6 +189,8 @@ FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where I_CLA= SS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; + = + FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_MIT= EM" + " where I_CLASS=3D2 and PARENT_ID=3D?"; = INSERT_NODE =3D "insert into JCR_MITEM(ID, PARENT_ID, NAME, VERSION, I_CLASS, I_I= NDEX, N_ORDER_NUM) VALUES(?,?,?,?," @@ -439,6 +443,17 @@ return findPropertiesByParentId.executeQuery(); } = + protected ResultSet findChildPropertiesIdNameByParentIdentifier(String = parentIdentifier) throws SQLException + { + if (findPropertiesIdNameByParentId =3D=3D null) + findPropertiesIdNameByParentId =3D dbConnection.prepareStatement(= FIND_PROPERTIES_IDNAME_BY_PARENTID); + else + findPropertiesIdNameByParentId.clearParameters(); + + findPropertiesIdNameByParentId.setString(1, parentIdentifier); + return findPropertiesIdNameByParentId.executeQuery(); + } + // -------- values processing ------------ = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-17 16:5= 1:35 UTC (rev 730) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-17 16:5= 1:55 UTC (rev 731) @@ -76,6 +76,8 @@ protected PreparedStatement findNodesByParentId; = protected PreparedStatement findPropertiesByParentId; + = + protected PreparedStatement findPropertiesIdNameByParentId; = protected PreparedStatement insertItem; = @@ -196,6 +198,9 @@ FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by ID"; = + FIND_PROPERTIES_IDNAME_BY_PARENTID =3D + "select ID, NAME from JCR_SITEM" + " where I_CLASS=3D2 and CONTAI= NER_NAME=3D? and PARENT_ID=3D?"; + INSERT_NODE =3D "insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSI= ON, I_CLASS, I_INDEX, N_ORDER_NUM) VALUES(?,?,?,?,?," + I_CLASS_NODE + ",?,?)"; @@ -350,7 +355,22 @@ findPropertiesByParentId.setString(2, parentCid); return findPropertiesByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + protected ResultSet findChildPropertiesIdNameByParentIdentifier(String = parentCid) throws SQLException + { + if (findPropertiesIdNameByParentId =3D=3D null) + findPropertiesIdNameByParentId =3D dbConnection.prepareStatement(= FIND_PROPERTIES_IDNAME_BY_PARENTID); + else + findPropertiesIdNameByParentId.clearParameters(); = + findPropertiesIdNameByParentId.setString(1, containerName); + findPropertiesIdNameByParentId.setString(2, parentCid); + return findPropertiesIdNameByParentId.executeQuery(); + } + /** * {@inheritDoc} */ --===============6192480492332369228==-- From do-not-reply at jboss.org Tue Nov 17 11:58:03 2009 Content-Type: multipart/mixed; boundary="===============2308276916564332443==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r732 - ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl. Date: Tue, 17 Nov 2009 11:58:03 -0500 Message-ID: <200911171658.nAHGw3pZ028383@svn01.web.mwc.hst.phx2.redhat.com> --===============2308276916564332443== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2009-11-17 11:58:03 -0500 (Tue, 17 Nov 2009) New Revision: 732 Modified: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/service= s/rest/impl/InputHeadersMap.java Log: EXOJCR-255 : method size() return size of back-end map. Modified: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/= services/rest/impl/InputHeadersMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/impl/InputHeadersMap.java 2009-11-17 16:51:55 UTC (rev 731) +++ ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/impl/InputHeadersMap.java 2009-11-17 16:58:03 UTC (rev 732) @@ -254,6 +254,14 @@ { throw new UnsupportedOperationException(); } + = + /** + * {@inheritDoc} + */ + public int size() + { + return m.size(); + } = // MultivaluedMap = --===============2308276916564332443==-- From do-not-reply at jboss.org Tue Nov 17 11:58:22 2009 Content-Type: multipart/mixed; boundary="===============6225002662242570356==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r733 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 17 Nov 2009 11:58:22 -0500 Message-ID: <200911171658.nAHGwM5m028440@svn01.web.mwc.hst.phx2.redhat.com> --===============6225002662242570356== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-17 11:58:22 -0500 (Tue, 17 Nov 2009) New Revision: 733 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 16:58:03= UTC (rev 732) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 16:58:22= UTC (rev 733) @@ -127,7 +127,7 @@ break; case REMOVE_NODE : = - doRemove(m, conn); + doRemove(m, (JDBCStorageConnection) conn); = break; case MOVE : @@ -183,27 +183,21 @@ * @throws IllegalStateException * @throws RepositoryException */ - private void doRemove(Modification modification, WorkspaceStorageConnec= tion conn) throws IllegalStateException, - RepositoryException + private void doRemove(Modification modification, JDBCStorageConnection = conn) throws IllegalStateException, + RepositoryException { - - if (modification.getFqn().size() =3D=3D 2 - && (modification.getFqn().get(0).equals(JBossCacheStorage.NODES) = || modification.getFqn().get(0).equals( - JBossCacheStorage.PROPS))) + if (modification.getFqn().size() =3D=3D 2) { + String identifier =3D (String) modification.getFqn().get(1); = - // TODO The removed ItemData was setting to value in prepareModif= ications(); - // That is need because we do not get NodeData from DB if we dele= te property with primaytype. = - - // String identifier =3D (String) modification.getFqn().g= et(1); - // ItemData itemData =3D jdbcConnection.getItemData(ident= ifier); - - ItemData itemData =3D (ItemData)modification.getValue(); - - if (itemData instanceof NodeData) - conn.delete((NodeData)itemData); - if (itemData instanceof PropertyData) - conn.delete((PropertyData)itemData); + if (modification.getFqn().get(0).equals(JBossCacheStorage.NODES)) + { + conn.deleteNode(identifier); + } + else if (modification.getFqn().get(0).equals(JBossCacheStorage.PR= OPS)) + { + conn.deleteProperty(identifier); + } } } = @@ -607,7 +601,7 @@ /** * Prepare list of modifications. * = - * Will be checked the UPDATE, ADD, REMOVE. + * Will be checked the UPDATE or ADD. * = * @param modifications * @throws RepositoryException @@ -646,20 +640,6 @@ modifications.get(i).setOldValue(itemData); } } - else if (m.getType() =3D=3D ModificationType.REMOVE_NODE) - { - if (m.getFqn().size() =3D=3D 2 - && (m.getFqn().get(0).equals(JBossCacheStorage.NODES) ||= m.getFqn().get(0).equals( - JBossCacheStorage.PROPS))) - { - String id =3D (String)m.getFqn().get(1); - ItemData removedItemData =3D conn.getItemData(id); - - // Set valueData for update property or node. - if (removedItemData !=3D null) - modifications.get(i).setValue(removedItemData); - } - } } } finally --===============6225002662242570356==-- From do-not-reply at jboss.org Tue Nov 17 12:00:53 2009 Content-Type: multipart/mixed; boundary="===============8355846022364290307==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r734 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc and 1 other directory. Date: Tue, 17 Nov 2009 12:00:53 -0500 Message-ID: <200911171700.nAHH0ruJ029126@svn01.web.mwc.hst.phx2.redhat.com> --===============8355846022364290307== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-17 12:00:52 -0500 (Tue, 17 Nov 2009) New Revision: 734 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/PropertyDataInfo.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java Log: EXOJCR-248: get child props optimization Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 16:58:22= UTC (rev 733) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-17 17:00:52= UTC (rev 734) @@ -25,6 +25,7 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; +import org.exoplatform.services.jcr.impl.storage.jdbc.PropertyDataInfo; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -277,7 +278,7 @@ if (nodeData !=3D null) { // TODO use dedicated select, not child datas - List childProps =3D conn.getChildProper= tiesData(nodeData); + List childProps =3D conn.getChildPr= operties(nodeId); if (childProps.size() <=3D 0) { throw new JDBCCacheLoaderException("FATAL Empty at= tributes for Node " + nodeId + " '" + name @@ -286,9 +287,9 @@ = attrs =3D new LinkedHashMap(); attrs.put(JBossCacheStorage.ITEM_DATA, nodeData); - for (PropertyData prop : childProps) + for (PropertyDataInfo prop : childProps) { - attrs.put(prop.getQPath().getName().getAsString(),= prop.getIdentifier()); + attrs.put(prop.getPropertyName(), prop.getProperty= Id()); } } else Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 16:58:22= UTC (rev 733) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 17:00:52= UTC (rev 734) @@ -1894,7 +1894,7 @@ } = // for JBC etc. - = + /** * Deletes NodeData by identifier. * = @@ -1994,29 +1994,34 @@ exceptionHandler.handleDeleteException(e, identifier, true); } } - = + public String getItemIdentifier(String parentId, String name) throws Re= positoryException, IllegalStateException { - = + return null; // TODO } - = - class PropertyDataInfo { - String propertyId; - String propertyName; - } - = + + /** + * Get child properties id and name. + * + * @param parentId parent Node id. + * @return List of PropertyDataInfo + * @throws RepositoryException if error + * @throws IllegalStateException if the parent in illegal state + */ public List getChildProperties(String parentId) throw= s RepositoryException, IllegalStateException { - = + checkIfOpened(); - = - List children =3D new ArrayList(= ); + try { + List children =3D new ArrayList(); + = ResultSet prop =3D findChildPropertiesIdNameByParentIdentifier(ge= tInternalId(parentId)); - while (prop.next()) { - //children.add((PropertyData)itemData(parent.getQPath(), prop,= I_CLASS_PROPERTY, null)); + while (prop.next()) + { + children.add(new PropertyDataInfo(prop.getString(COLUMN_ID), p= rop.getString(COLUMN_NAME))); } = return children; @@ -2026,7 +2031,7 @@ throw new RepositoryException(e); } } - = + public List getChildNodeNames(String parentId) throws Repositor= yException, IllegalStateException { checkIfOpened(); @@ -2035,7 +2040,7 @@ ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= (parentId)); List childrens =3D new ArrayList(); //while (node.next()) - //childrens.add((NodeData)itemData(parent.getQPath(), node, I_= CLASS_NODE, parent.getACL())); + //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); = return childrens; } @@ -2044,7 +2049,7 @@ throw new RepositoryException(e); } } - = + public List getAllPropertyIdentifiers() throws RepositoryExcept= ion, IllegalStateException { checkIfOpened(); @@ -2053,7 +2058,7 @@ ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); List childrens =3D new ArrayList(); //while (node.next()) - //childrens.add((NodeData)itemData(parent.getQPath(), node, I_= CLASS_NODE, parent.getACL())); + //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); = return childrens; } @@ -2062,7 +2067,7 @@ throw new RepositoryException(e); } } - = + public List getAllNodeIdentifiers() throws RepositoryException,= IllegalStateException { checkIfOpened(); @@ -2071,7 +2076,7 @@ ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); List childrens =3D new ArrayList(); //while (node.next()) - //childrens.add((NodeData)itemData(parent.getQPath(), node, I_= CLASS_NODE, parent.getACL())); + //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); = return childrens; } @@ -2096,9 +2101,10 @@ protected abstract ResultSet findChildNodesByParentIdentifier(String pa= rentIdentifier) throws SQLException; = protected abstract ResultSet findChildPropertiesByParentIdentifier(Stri= ng parentIdentifier) throws SQLException; - = - protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentIdentifier) throws SQLException; = + protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentIdentifier) + throws SQLException; + protected abstract int addReference(PropertyData data) throws SQLExcept= ion, IOException; = protected abstract int renameNode(NodeData data) throws SQLException; Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jdbc/PropertyDataInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/PropertyDataInfo.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/PropertyDataInfo.java 2009-11-17 17:00:52 UTC = (rev 734) @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 3 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jdbc; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 17.11.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class PropertyDataInfo +{ + private final String propertyId; + private final String propertyName; + = + PropertyDataInfo(String propertyId, String propertyName) { + this.propertyId =3D propertyId; + this.propertyName =3D propertyName; + } + + public String getPropertyId() + { + return propertyId; + } + + public String getPropertyName() + { + return propertyName; + } + = + = +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/storage/jdbc/PropertyDataInfo.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id --===============8355846022364290307==-- From do-not-reply at jboss.org Wed Nov 18 01:44:11 2009 Content-Type: multipart/mixed; boundary="===============4055410659147905191==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r735 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/inmemory and 4 other directories. Date: Wed, 18 Nov 2009 01:44:11 -0500 Message-ID: <200911180644.nAI6iBUe027446@svn01.web.mwc.hst.phx2.redhat.com> --===============4055410659147905191== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-18 01:44:11 -0500 (Wed, 18 Nov 2009) New Revision: 735 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/storage/WorkspaceStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-201: remove deprecated $SESSION stub Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-17 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 06:44:11 UTC (rev 735) @@ -74,124 +74,85 @@ WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; = - // prepare changes log list - List chengesLogList =3D new ArrayList(); - if (changesLog instanceof PlainChangesLog) - { - chengesLogList.add((PlainChangesLog)changesLog); - } - else if (changesLog instanceof CompositeChangesLog) - { - for (ChangesLogIterator iter =3D ((CompositeChangesLog)changesLog= ).getLogIterator(); iter.hasNextLog();) - { - chengesLogList.add(iter.nextLog()); - } - } - try { - for (PlainChangesLog currChangesLog : chengesLogList) + for (Iterator iter =3D changesLog.getAllStates().itera= tor(); iter.hasNext();) { - boolean systemConnSessionInfoAdded =3D false; - boolean thisConnSessionInfoAdded =3D false; + ItemState itemState =3D iter.next(); = - for (Iterator iter =3D currChangesLog.getAllStates(= ).iterator(); iter.hasNext();) - { - ItemState itemState =3D iter.next(); + if (!itemState.isPersisted()) + continue; = - if (!itemState.isPersisted()) - continue; + long start =3D System.currentTimeMillis(); = - long start =3D System.currentTimeMillis(); + TransientItemData data =3D (TransientItemData)itemState.getDat= a(); = - TransientItemData data =3D (TransientItemData)itemState.get= Data(); + WorkspaceStorageConnection conn =3D null; + if (isSystemDescendant(data.getQPath())) + { + conn =3D systemConnection =3D=3D null + // we need system connection but it's not exist + ? systemConnection =3D (systemDataContainer !=3D dataCon= tainer + // if it's different container instances + ? systemDataContainer.equals(dataContainer) && thisCo= nnection !=3D null + // but container confugrations are same and non-syste= m connnection open + // reuse this connection as system + ? systemDataContainer.reuseConnection(thisConnecti= on) + // or open one new system + : systemDataContainer.openConnection() + // else if it's same container instances (system and = this) + : thisConnection =3D=3D null + // and non-system connection doens't exist - open it + ? thisConnection =3D dataContainer.openConnection() + // if already open - use it + : thisConnection) + // system connection opened - use it + : systemConnection; + } + else + { + conn =3D thisConnection =3D=3D null + // we need this conatiner conection + ? thisConnection =3D (systemDataContainer !=3D dataConta= iner + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && system= Connection !=3D null + // but container confugrations are same and system co= nnnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnection) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (system and = this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openConnectio= n() + // if already open - use it + : systemConnection) + // this connection opened - use it + : thisConnection; + } = - WorkspaceStorageConnection conn =3D null; - if (isSystemDescendant(data.getQPath())) - { - conn =3D systemConnection =3D=3D null - // we need system connection but it's not exist - ? systemConnection =3D (systemDataContainer !=3D data= Container - // if it's different container instances - ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null - // but container confugrations are same and non-sy= stem connnection open - // reuse this connection as system - ? systemDataContainer.reuseConnection(thisConne= ction) - // or open one new system - : systemDataContainer.openConnection() - // else if it's same container instances (system a= nd this) - : thisConnection =3D=3D null - // and non-system connection doens't exist - open = it - ? thisConnection =3D dataContainer.openConnecti= on() - // if already open - use it - : thisConnection) - // system connection opened - use it - : systemConnection; + data.increasePersistedVersion(); = - if (!systemConnSessionInfoAdded) - { - if (!systemConnection.equals(thisConnection)) - systemConnection.addSessionInfo(currChangesLog.get= SessionId()); - systemConnSessionInfoAdded =3D true; - } - } - else - { - conn =3D thisConnection =3D=3D null - // we need this conatiner conection - ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer - // if it's different container instances - ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null - // but container confugrations are same and system= connnection open - // reuse system connection as this - ? dataContainer.reuseConnection(systemConnectio= n) - // or open one new - : dataContainer.openConnection() - // else if it's same container instances (system a= nd this) - : systemConnection =3D=3D null - // and system connection doens't exist - open it - ? systemConnection =3D dataContainer.openConnec= tion() - // if already open - use it - : systemConnection) - // this connection opened - use it - : thisConnection; - - if (!thisConnSessionInfoAdded) - { - if (!thisConnection.equals(systemConnection)) - thisConnection.addSessionInfo(currChangesLog.getSe= ssionId()); - thisConnSessionInfoAdded =3D true; - } - } - - data.increasePersistedVersion(); - - if (itemState.isAdded()) - { - doAdd(data, conn, addedNodes); - } - else if (itemState.isUpdated()) - { - doUpdate(data, conn); - } - else if (itemState.isDeleted()) - { - doDelete(data, conn); - } - else if (itemState.isRenamed()) - { - doRename(data, conn, addedNodes); - } - - if (LOG.isDebugEnabled()) - LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) - + "ms, " + data.getQPath().getAsString()); + if (itemState.isAdded()) + { + doAdd(data, conn, addedNodes); } - //TODO rainf0x - /*if (thisConnection !=3D null) - thisConnection.removeSessionInfo(); - if (systemConnection !=3D null && !systemConnection.equals(thi= sConnection)) - systemConnection.removeSessionInfo();*/ + else if (itemState.isUpdated()) + { + doUpdate(data, conn); + } + else if (itemState.isDeleted()) + { + doDelete(data, conn); + } + else if (itemState.isRenamed()) + { + doRename(data, conn, addedNodes); + } + + if (LOG.isDebugEnabled()) + LOG.debug(ItemState.nameFromValue(itemState.getState()) + "= " + (System.currentTimeMillis() - start) + + "ms, " + data.getQPath().getAsString()); } if (thisConnection !=3D null) thisConnection.commit(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-17 = 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-18 = 06:44:11 UTC (rev 735) @@ -212,20 +212,6 @@ { } = - /** - * {@inheritDoc} - */ - public void addSessionInfo(String sessionId) throws RepositoryException - { - } - - /** - * {@inheritDoc} - */ - public void removeSessionInfo() throws RepositoryException - { - } - public boolean isOpened() { return false; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-17 17:00:= 52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-18 06:44:= 11 UTC (rev 735) @@ -35,6 +35,7 @@ public abstract class JBossCacheStorage { = + @Deprecated public static final String SESSION =3D "$SESSION".intern(); = public static final String NODES =3D "$NODES".intern(); @@ -47,30 +48,28 @@ = public static final String ITEM_ID =3D "$id".intern(); = + @Deprecated public static final String SESSION_ID =3D "$sessionId".intern(); = + @Deprecated public static final String USER_ID =3D "$userId".intern(); - = + public static final String LOCK_DATA =3D "$lock".intern(); = protected final Node nodesRoot; = protected final Node propsRoot; = - protected final Node sessionRoot; - = protected final Node locksRoot; = protected JBossCacheStorage(Node nodesRoot, Node<= Serializable, Object> propsRoot, - Node sessionRoot, Node l= ocksRoot) + Node locksRoot) { this.nodesRoot =3D nodesRoot; = this.propsRoot =3D propsRoot; = - this.sessionRoot =3D sessionRoot; - = - this.locksRoot =3D locksRoot; = + this.locksRoot =3D locksRoot; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -17 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -18 06:44:11 UTC (rev 735) @@ -74,9 +74,9 @@ * @param cache Cache */ public JBossCacheStorageConnection(Cache cache, N= ode nodesRoot, - Node propsRoot, Node ses= sionRoot, Node locksRoot) + Node propsRoot, Node loc= ksRoot) { - super(nodesRoot, propsRoot, sessionRoot, locksRoot); + super(nodesRoot, propsRoot, locksRoot); = this.cache =3D cache; } @@ -646,38 +646,6 @@ } = /** - * {@inheritDoc} - */ - public void addSessionInfo(String sessionId) throws RepositoryException - { - startBatch(); - - if (sessionRoot.getData().size() !=3D 0) - { - throw new RepositoryException("Session attributes already exists = in cache storage."); - } - - // add attributes - sessionRoot.put(JBossCacheStorage.SESSION_ID, sessionId); - } - - /** - * {@inheritDoc} - */ - public void removeSessionInfo() throws InvalidItemStateException, Repos= itoryException - { - startBatch(); - - if (sessionRoot.getData().size() =3D=3D 0) - { - throw new RepositoryException("Session attributes not exists in c= ache storage."); - } - - // remove attributes - sessionRoot.clearData(); - } - - /** * Start batching. */ private void startBatch() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-17 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-18 06:44:11 UTC (rev 735) @@ -395,20 +395,6 @@ } = /** - * {@inheritDoc} - */ - public void addSessionInfo(String sessionId) throws RepositoryException - { - } - - /** - * {@inheritDoc} - */ - public void removeSessionInfo() throws InvalidItemStateException, Repos= itoryException - { - } - - /** * Start batching. */ private void startBatch() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-17 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-18 06:44:11 UTC (rev 735) @@ -72,8 +72,6 @@ = private Node properties; = - private Node session; - private Node locks; = /** @@ -131,7 +129,6 @@ cache.startBatch(); this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .NODES)); this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheSt= orage.PROPS)); - this.session =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStora= ge.SESSION)); // TODO remove it this.locks =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .LOCKS)); cache.endBatch(true); } @@ -182,7 +179,7 @@ // throw new RepositoryException("Container is not started"); // } = - return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion, locks); + return new JBossCacheStorageConnection(cache, nodes, properties, loc= ks); } = /** @@ -196,7 +193,7 @@ // throw new RepositoryException("Container is not started"); // } = - return new JBossCacheStorageConnection(cache, nodes, properties, ses= sion, locks); + return new JBossCacheStorageConnection(cache, nodes, properties, loc= ks); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-17 17:00:52= UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 06:44:11= UTC (rev 735) @@ -716,20 +716,6 @@ return null; } = - /** - * {@inheritDoc} - */ - public void addSessionInfo(String sessionId) throws RepositoryException - { - } - - /** - * {@inheritDoc} - */ - public void removeSessionInfo() throws RepositoryException - { - } - // ------------------ Private methods --------------- = /** @@ -2017,7 +2003,7 @@ try { List children =3D new ArrayList(); - = + ResultSet prop =3D findChildPropertiesIdNameByParentIdentifier(ge= tInternalId(parentId)); while (prop.next()) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-17 17:00:52 UTC = (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-18 06:44:11 UTC = (rev 735) @@ -259,7 +259,7 @@ */ void delete(NodeData data) throws RepositoryException, UnsupportedOpera= tionException, InvalidItemStateException, IllegalStateException; - = + /** * Deletes PropertyData. * = @@ -310,38 +310,19 @@ void close() throws IllegalStateException, RepositoryException; = /** - * Add session information to cache storage. = - * - * @param sessionId - * the session identifier to be added = - * = - * @throws RepositoryException - * if some exception occured - */ - void addSessionInfo(String sessionId) throws RepositoryException; - - /** - * Remove session information from cache storage. = - * - * @throws RepositoryException - * if some exception occured - */ - void removeSessionInfo() throws RepositoryException; - - /** * Returns true if connection can be used. * = * @return boolean, true if connection is open and ready, false - other= wise */ boolean isOpened(); - = + /** * @param identifier * @return * LockData by given node uuid, or null if not present */ LockData getLockData(String identifier); - = + /** * @return * List of all locks. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-17 = 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-18 = 06:44:11 UTC (rev 735) @@ -162,7 +162,7 @@ list.add(modification); return list; } - = + /** * Returns {@link Modification} like as node update. = * = @@ -172,21 +172,24 @@ * @param data * @return */ - public List updateNode(NodeData data) { + public List updateNode(NodeData data) + { = - List list =3D new ArrayList(); = - Fqn fqn =3D Fqn.fromElements(JBossCacheStorage.NODES, data.getParent= Identifier(), data.getQPath().getEntries()[data.getQPath().getEntries().len= gth - 1].getAsString(true)); - = + List list =3D new ArrayList(); + Fqn fqn =3D + Fqn.fromElements(JBossCacheStorage.NODES, data.getParentIdentifie= r(), data.getQPath().getEntries()[data + .getQPath().getEntries().length - 1].getAsString(true)); + Modification modification =3D new Modification(ModificationType.PUT_KEY_VALUE, fqn, JBossCacheS= torage.ITEM_ID, data.getIdentifier()); list.add(modification); - = + fqn =3D Fqn.fromElements(JBossCacheStorage.NODES, data.getIdentifier= ()); modification =3D new Modification(ModificationType.PUT_KEY_VALUE, fq= n, JBossCacheStorage.ITEM_DATA, data); modification.setOldValue(data); list.add(modification); - = - return list; = + + return list; } = /** @@ -227,6 +230,7 @@ * @param userId * @return */ + @Deprecated public List addSessionInfo(String sessionId, String userI= d) { List list =3D new ArrayList(); @@ -247,6 +251,7 @@ * = * @return */ + @Deprecated public List removeSessionInfo() { List list =3D new ArrayList(); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-17 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-18 06:44:11 UTC (rev 735) @@ -59,8 +59,6 @@ = protected Node props; = - protected Node session; - protected Node locks; = protected String jbcConfig; @@ -88,11 +86,10 @@ // prepare cache structures nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); - session =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.SESS= ION)); - locks =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.SESSIO= N)); + locks =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.LOCKS)= ); = // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props, sessio= n, locks); + conn =3D new JBossCacheStorageConnection(cache, nodes, props, locks); } = protected void initJBCConfig() Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 17 17:00:52 UTC (rev 734) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 18 06:44:11 UTC (rev 735) @@ -473,10 +473,6 @@ storage.put(data.getIdentifier(), data); } = - public void addSessionInfo(String sessionId, String userId) throws R= epositoryException - { - } - public void close() throws IllegalStateException, RepositoryException { } @@ -529,10 +525,6 @@ return null; } = - public void removeSessionInfo() throws RepositoryException - { - } - public void rename(NodeData data) throws RepositoryException, Unsupp= ortedOperationException, InvalidItemStateException, IllegalStateException { @@ -552,10 +544,6 @@ { } = - public void addSessionInfo(String sessionId) throws RepositoryExcept= ion - { - } - /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnect= ion#getLockData(java.lang.String) */ --===============4055410659147905191==-- From do-not-reply at jboss.org Wed Nov 18 03:03:57 2009 Content-Type: multipart/mixed; boundary="===============4577863783127527163==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r736 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/inmemory and 4 other directories. Date: Wed, 18 Nov 2009 03:03:57 -0500 Message-ID: <200911180803.nAI83vpe010924@svn01.web.mwc.hst.phx2.redhat.com> --===============4577863783127527163== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 03:03:56 -0500 (Wed, 18 Nov 2009) New Revision: 736 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/storage/WorkspaceStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java Log: EXOJCR-242: WorkspaceStorageConnection (and all their implementators) exten= ded with addLockData() and removeLockData(). JBossCacheStorageConnection fi= lled with logic: locks are written and removed to or from /$LOCKS subtree o= f cache. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 06:44:11 UTC (rev 735) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 08:03:56 UTC (rev 736) @@ -18,11 +18,8 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = -import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; -import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; -import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; @@ -31,10 +28,8 @@ import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; = -import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; -import java.util.List; import java.util.Set; = import javax.jcr.RepositoryException; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-18 = 06:44:11 UTC (rev 735) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2009-11-18 = 08:03:56 UTC (rev 736) @@ -249,7 +249,7 @@ /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) */ - public LockData getLockData(String identifier) + public LockData getLockData(String identifier) throws RepositoryExcepti= on { return null; } @@ -257,9 +257,23 @@ /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLocksData() */ - public List getLocksData() + public List getLocksData() throws RepositoryException { return null; } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #addLockData(org.exoplatform.services.jcr.impl.core.lock.LockData) + */ + public void addLockData(LockData lockData) throws RepositoryException + { + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #removeLockData(java.lang.String) + */ + public void removeLockData(String identifier) throws RepositoryException + { + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -18 06:44:11 UTC (rev 735) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -18 08:03:56 UTC (rev 736) @@ -38,6 +38,7 @@ = import javax.jcr.InvalidItemStateException; import javax.jcr.RepositoryException; +import javax.jcr.lock.LockException; = /** * Created by The eXo Platform SAS. @@ -660,7 +661,7 @@ /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) */ - public LockData getLockData(String identifier) + public LockData getLockData(String identifier) throws RepositoryExcepti= on { LockData lockData =3D null; Node node =3D locksRoot.getChild(makeNodeFqn(i= dentifier)); @@ -674,7 +675,7 @@ /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLocksData() */ - public List getLocksData() + public List getLocksData() throws RepositoryException { Set> lockSet =3D locksRoot.getChildren(); List locksData =3D new ArrayList(); @@ -691,4 +692,44 @@ } return locksData; } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #addLockData(org.exoplatform.services.jcr.impl.core.lock.LockData) + */ + public void addLockData(LockData lockData) throws RepositoryException + { + if (lockData =3D=3D null) + { + throw new RepositoryException("Lock data to write can't be null!"= ); + } + // check that there is no lock data for given node + Node oldNode =3D locksRoot.getChild(makeNodeFq= n(lockData.getNodeIdentifier())); + if (oldNode.get(JBossCacheStorage.LOCK_DATA) !=3D null) + { + throw new LockException("Unable to write lock data. Node [" + loc= kData.getNodeIdentifier() + + "] already has LockData!"); + } + // try to write LockData = + Node node =3D locksRoot.addChild(makeNodeFqn(l= ockData.getNodeIdentifier())); + if (node =3D=3D null) + { + throw new RepositoryException("Unable to write to cache!"); + } + // this will prevent from deleting it by eviction. + node.setResident(true); + node.put(JBossCacheStorage.LOCK_DATA, lockData); + + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #removeLockData(java.lang.String) + */ + public void removeLockData(String identifier) throws RepositoryException + { + if (identifier !=3D null) + { + throw new RepositoryException("Item ID to clear lock can't be nul= l!"); + } + locksRoot.removeChild(makeNodeFqn(identifier)); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-18 06:44:11 UTC (rev 735) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-18 08:03:56 UTC (rev 736) @@ -422,4 +422,22 @@ throw new UnsupportedOperationException(); } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #addLockData(org.exoplatform.services.jcr.impl.core.lock.LockData) + */ + public void addLockData(LockData lockData) throws RepositoryException + { + // TODO Auto-generated method stub + = + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #removeLockData(java.lang.String) + */ + public void removeLockData(String identifier) throws RepositoryException + { + // TODO Auto-generated method stub + = + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 06:44:11= UTC (rev 735) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 08:03:56= UTC (rev 736) @@ -716,6 +716,22 @@ return null; } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #addLockData(org.exoplatform.services.jcr.impl.core.lock.LockData) + */ + public void addLockData(LockData lockData) throws RepositoryException + { + // TODO Add logic HERE! Need to store locks some where + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #removeLockData(java.lang.String) + */ + public void removeLockData(String identifier) throws RepositoryException + { + // TODO Add logic HERE! Need to store locks some where + } + // ------------------ Private methods --------------- = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-18 06:44:11 UTC = (rev 735) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java 2009-11-18 08:03:56 UTC = (rev 736) @@ -321,11 +321,27 @@ * @return * LockData by given node uuid, or null if not present */ - LockData getLockData(String identifier); + LockData getLockData(String identifier) throws RepositoryException; = /** * @return * List of all locks. */ - List getLocksData(); + List getLocksData() throws RepositoryException; + + /** + * Writes lock data + * = + * @param lockData + * @throws RepositoryException + */ + void addLockData(LockData lockData) throws RepositoryException; + + /** + * Removes lock data + * = + * @param identifier + * @throws RepositoryException + */ + void removeLockData(String identifier) throws RepositoryException; } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 18 06:44:11 UTC (rev 735) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ObservationCacheLoaderTest.java 2009-11-= 18 08:03:56 UTC (rev 736) @@ -547,7 +547,7 @@ /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnect= ion#getLockData(java.lang.String) */ - public LockData getLockData(String identifier) + public LockData getLockData(String identifier) throws RepositoryExce= ption { return null; } @@ -555,11 +555,25 @@ /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnect= ion#getLocksData() */ - public List getLocksData() + public List getLocksData() throws RepositoryException { return null; } = + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnect= ion#addLockData(org.exoplatform.services.jcr.impl.core.lock.LockData) + */ + public void addLockData(LockData lockData) throws RepositoryException + { + } + + /** + * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnect= ion#removeLockData(java.lang.String) + */ + public void removeLockData(String identifier) throws RepositoryExcep= tion + { + } + } = } --===============4577863783127527163==-- From do-not-reply at jboss.org Wed Nov 18 03:33:14 2009 Content-Type: multipart/mixed; boundary="===============0482903738404702054==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r737 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session. Date: Wed, 18 Nov 2009 03:33:14 -0500 Message-ID: <200911180833.nAI8XE12017907@svn01.web.mwc.hst.phx2.redhat.com> --===============0482903738404702054== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 03:33:14 -0500 (Wed, 18 Nov 2009) New Revision: 737 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java Log: EXOJCR-242: LocalWorkspaceStorageDataManagerProxy updated to re-pack PlainC= hangesLog ad LockPlainChangesLog if it's type is ExtendedEvent.LOCK. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProx= y.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java= 2009-11-18 08:03:56 UTC (rev 736) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java= 2009-11-18 08:33:14 UTC (rev 737) @@ -23,6 +23,7 @@ import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; @@ -38,6 +39,7 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; +import org.exoplatform.services.jcr.observation.ExtendedEvent; = import java.util.ArrayList; import java.util.Calendar; @@ -92,7 +94,18 @@ .getAncestorToSave(), change.isInternallyCreated(), change.= isPersisted())); } = - newLog.addLog(new PlainChangesLogImpl(states, changes.getSessionI= d(), changes.getEventType())); + // if it is a lockPlainChangesLog then pack it as following + if (changes.getEventType() =3D=3D ExtendedEvent.LOCK) + { + LockPlainChangesLogImpl lockChangesLog =3D + new LockPlainChangesLogImpl(states, changes.getSessionId(),= changes.getEventType()); + lockChangesLog.setLockData(((LockPlainChangesLogImpl)changes).= getLockData()); + newLog.addLog(lockChangesLog); + } + else + { + newLog.addLog(new PlainChangesLogImpl(states, changes.getSessi= onId(), changes.getEventType())); + } } = storageDataManager.save(newLog); --===============0482903738404702054==-- From do-not-reply at jboss.org Wed Nov 18 03:43:13 2009 Content-Type: multipart/mixed; boundary="===============1708871706682707118==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r738 - in kernel/trunk: exo.kernel.commons and 5 other directories. Date: Wed, 18 Nov 2009 03:43:13 -0500 Message-ID: <200911180843.nAI8hDHH019933@svn01.web.mwc.hst.phx2.redhat.com> --===============1708871706682707118== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-18 03:43:13 -0500 (Wed, 18 Nov 2009) New Revision: 738 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/pom.xml Log: EXOJCR-162 Modules dependencies cleaned Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-18 08:33:14 UTC (rev 73= 7) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-18 08:43:13 UTC (rev 73= 8) @@ -1,67 +1,58 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.commons - - eXo Kernel :: Commons Utils - eXo Commons - - - - commons-lang - commons-lang - - - - xpp3 - xpp3 - - - - commons-logging - commons-logging - - - - org.slf4j - slf4j-api - - - - org.slf4j - slf4j-log4j12 - - - - log4j - log4j - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.commons + + eXo Kernel :: Commons Utils + eXo Commons + + + + xpp3 + xpp3 + + + commons-logging + commons-logging + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + log4j + log4j + + + Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-18 08:33:14 UTC= (rev 737) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-18 08:43:13 UTC= (rev 738) @@ -1,51 +1,50 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.cache - - eXo Kernel :: Component :: Cache Service - exoplatform Cache services implementation - - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.kernel - exo.kernel.component.remote - - - org.exoplatform.kernel - exo.kernel.component.common - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.component.cache + + eXo Kernel :: Component :: Cache Service + exoplatform Cache services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.commons + + + \ No newline at end of file Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-18 08:33:14 U= TC (rev 737) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-18 08:43:13 U= TC (rev 738) @@ -1,54 +1,64 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.command - - eXo Kernel :: Component :: Command Service - exoplatform command services implementation - - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - commons-chain - commons-chain - - - xml-apis - xml-apis - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.component.command + + eXo Kernel :: Component :: Command Service + exoplatform command services implementation + + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + commons-chain + commons-chain + + + xml-apis + xml-apis + + + + + commons-digester + commons-digester + + + xml-apis + xml-apis + + + \ No newline at end of file Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-18 08:33:14 UT= C (rev 737) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-18 08:43:13 UT= C (rev 738) @@ -1,84 +1,90 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.common - - eXo Kernel :: Component :: Common Service - exoplatform common services implementation - - - - org.exoplatform.kernel - exo.kernel.container - - - - javax.activation - activation - - - - jotm - jotm - - - javax.resource - connector - - - log4j - log4j - - - - - - javax.resource - connector-api - provided - - - - quartz - quartz - - - - javax.mail - mail - - - - javax.transaction - jta - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.component.common + + eXo Kernel :: Component :: Common Service + exoplatform common services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.commons + + + javax.activation + activation + + + jotm + jotm + + + javax.resource + connector + + + log4j + log4j + + + + + javax.resource + connector-api + provided + + + quartz + quartz + + + picocontainer + picocontainer + + + javax.mail + mail + + + javax.transaction + jta + + + + Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-18 08:33:14 UT= C (rev 737) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-18 08:43:13 UT= C (rev 738) @@ -1,47 +1,54 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.remote - - eXo Kernel :: Component :: Remote Service - exoplatform remote services implementation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - jgroups - jgroups - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.component.remote + + eXo Kernel :: Component :: Remote Service + exoplatform remote services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + = + + jgroups + jgroups + + + Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-18 08:33:14 UTC (rev = 737) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-18 08:43:13 UTC (rev = 738) @@ -1,122 +1,120 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.container - - eXo Kernel :: Container - eXo Kernel Container - = - - - org.exoplatform.kernel - exo.kernel.commons - - - - org.exoplatform.tool - exo.tool.framework.junit - compile - - - - javax.servlet - servlet-api - - - - picocontainer - picocontainer - - - - commons-beanutils - commons-beanutils - - - - org.jibx - jibx-run - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-bind - - - org.codehaus.woodstox - wstx-asl - - - - - - org.jibx - jibx-extras - - - - - - - org.jibx - maven-jibx-plugin - - src/main/resources - - binding.xml - - - - - - bind - - - - - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.container + + eXo Kernel :: Container + eXo Kernel Container + = + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.tool + exo.tool.framework.junit + compile + + + javax.servlet + servlet-api + + + picocontainer + picocontainer + + + commons-beanutils + commons-beanutils + + + org.jibx + jibx-run + + + org.codehaus.woodstox + wstx-asl + + + + + org.jibx + jibx-bind + + + org.codehaus.woodstox + wstx-asl + + + + + org.jibx + jibx-extras + + + xpp3 + xpp3 + 1.1.3.4.O + + + + + + + org.jibx + maven-jibx-plugin + + src/main/resources + + binding.xml + + + + + + bind + + + + + + + + + \ No newline at end of file Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-18 08:33:14 UTC (rev 737) +++ kernel/trunk/pom.xml 2009-11-18 08:43:13 UTC (rev 738) @@ -1,224 +1,199 @@ - - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - pom - - eXo Kernel - - - exo-kernel - 2.2 - always - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk - http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk - - - - exo.kernel.container - exo.kernel.commons - exo.kernel.component.common - exo.kernel.component.remote - exo.kernel.component.cache - exo.kernel.component.command - packaging/module - - - - - - - org.exoplatform.kernel - exo.kernel.container - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.commons - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.component.common - ${project.version} - - - - org.exoplatform.kernel - exo.kernel.component.remote - ${project.version} - - - - org.exoplatform.tool - exo.tool.framework.junit - 1.2.0 - - - - commons-lang - commons-lang - 2.3 - - - - commons-chain - commons-chain - 1.0 - - - - xpp3 - xpp3 - 1.1.3.4.O - - - - commons-logging - commons-logging - 1.0.4 - - - - jgroups - jgroups - 2.6.10.GA - - - - org.slf4j - slf4j-api - 1.5.6 - - - - org.slf4j - slf4j-log4j12 - 1.5.6 - - - - log4j - log4j - 1.2.14 - - - - picocontainer - picocontainer - 1.1 - - - - commons-beanutils - commons-beanutils - 1.6 - - - - org.jibx - jibx-run - ${jibx.plugin.version} - - - - org.jibx - jibx-bind - ${jibx.plugin.version} - - - - org.jibx - jibx-extras - ${jibx.plugin.version} - - - - javax.activation - activation - 1.1 - - - - javax.resource - connector-api - 1.5 - - - - jotm - jotm - 2.0.10 - - - - quartz - quartz - 1.5.0-RC2 - - - - javax.mail - mail - 1.4 - - - - javax.servlet - servlet-api - 2.5 - provided - - - - javax.transaction - jta - 1.0.1B - - - - - - - junit - junit - test - - - - + + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + pom + + eXo Kernel + + + exo-kernel + 2.2 + always + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk + http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk + + + + exo.kernel.container + exo.kernel.commons + exo.kernel.component.common + exo.kernel.component.remote + exo.kernel.component.cache + exo.kernel.component.command + packaging/module + + + + + + org.exoplatform.tool + exo.tool.framework.junit + 1.2.0 + + + org.exoplatform.kernel + exo.kernel.container + ${project.version} + + + org.exoplatform.kernel + exo.kernel.commons + ${project.version} + + + org.exoplatform.kernel + exo.kernel.component.remote + ${project.version} + + + xpp3 + xpp3 + 1.1.3.4.O + + + commons-logging + commons-logging + 1.0.4 + + + commons-beanutils + commons-beanutils + 1.6 + + + commons-chain + commons-chain + 1.0 + + + commons-digester + commons-digester + 1.6 + + + org.slf4j + slf4j-api + 1.5.6 + + + org.slf4j + slf4j-log4j12 + 1.5.6 + + + log4j + log4j + 1.2.14 + + + xml-apis + xml-apis + 1.0.b2 + + + quartz + quartz + 1.5.0-RC2 + + + javax.mail + mail + 1.4 + + + javax.activation + activation + 1.1 + + + javax.resource + connector-api + 1.5 + + + javax.transaction + jta + 1.0.1B + + + picocontainer + picocontainer + 1.1 + + + javax.servlet + servlet-api + 2.5 + provided + + + jgroups + jgroups + 2.6.10.GA + + + org.jibx + jibx-bind + ${jibx.plugin.version} + + + org.jibx + jibx-extras + ${jibx.plugin.version} + + + org.jibx + jibx-run + ${jibx.plugin.version} + + + jotm + jotm + 2.0.10 + + + + + + + junit + junit + test + + + + --===============1708871706682707118==-- From do-not-reply at jboss.org Wed Nov 18 04:01:34 2009 Content-Type: multipart/mixed; boundary="===============7985731085101044459==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r739 - in core/trunk: exo.core.component.database and 10 other directories. Date: Wed, 18 Nov 2009 04:01:34 -0500 Message-ID: <200911180901.nAI91YX3024629@svn01.web.mwc.hst.phx2.redhat.com> --===============7985731085101044459== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-18 04:01:34 -0500 (Wed, 18 Nov 2009) New Revision: 739 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: EXOJCR-162 Modules dependencies cleaned Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2009-11-18 08:43:13 UTC = (rev 738) +++ core/trunk/exo.core.component.database/pom.xml 2009-11-18 09:01:34 UTC = (rev 739) @@ -1,146 +1,116 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.database - - eXo Core :: Component :: Database Service - exoplatform database services implementation - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - - javax.resource - connector-api - test - - - - hsqldb - hsqldb - runtime - - - - com.experlog - xapool - - - - c3p0 - c3p0 - runtime - - - - commons-dbcp - commons-dbcp - provided - - - - org.hibernate - hibernate-core - - - org.slf4j - slf4j-api - - = - - - - xdoclet - xdoclet-hibernate-module - - - - xdoclet - xdoclet - - - - xdoclet - xdoclet-xdoclet-module - - - - xdoclet - xjavadoc - - - - commons-collections - commons-collections - runtime - - = - - javassist - javassist - - - - org.hibernate - hibernate-annotations - - - org.slf4j - slf4j-api - - = - - = - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/DBCreatorTest.java - - - - = - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.database + + eXo Core :: Component :: Database Service + exoplatform database services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.component.cache + + + javax.resource + connector-api + test + + + javax.transaction + jta + + + pull-parser + pull-parser + + + hsqldb + hsqldb + runtime + + + com.experlog + xapool + + + org.hibernate + hibernate-core + + + org.slf4j + slf4j-api + + = + + + org.hibernate + hibernate-annotations + + + org.slf4j + slf4j-api + + = + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/DBCreatorTest.java + + + + = + + + Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2009-11-18 08:43:13 UTC = (rev 738) +++ core/trunk/exo.core.component.document/pom.xml 2009-11-18 09:01:34 UTC = (rev 739) @@ -1,104 +1,112 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.document - - eXo Core :: Component :: Demo Service - eXo demo service Impl - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - pdfbox - pdfbox - - - - com.lowagie - itext - - - - org.htmlparser - htmlparser - - - - org.apache.poi - poi - - - log4j - log4j - - - - - - org.apache.poi - poi-scratchpad - - - log4j - log4j - - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.drl - **/*.vm - **/*.doc - **/*.dot - **/*.xls - **/*.ppt - **/*.txt - **/*.tiff - **/*.pdf - **/*.odt - **/*.html - **/*.msg - **/*.pst - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.document + + eXo Core :: Component :: Demo Service + eXo demo service Impl + + + + + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + + pdfbox + pdfbox + + + com.lowagie + itext + + + org.htmlparser + htmlparser + + + org.apache.poi + poi + + + log4j + log4j + + + + + org.apache.poi + poi-scratchpad + + + log4j + log4j + + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.drl + **/*.vm + **/*.doc + **/*.dot + **/*.xls + **/*.ppt + **/*.txt + **/*.tiff + **/*.pdf + **/*.odt + **/*.html + **/*.msg + **/*.pst + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-18 08:43:13 UTC (rev= 738) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-18 09:01:34 UTC (rev= 739) @@ -1,66 +1,82 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.ldap - - eXo Core :: Component :: LDAP Service - eXo LDAP impl - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - com.novell.ldap - jldap - test - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - - - - = - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.ldap + + eXo Core :: Component :: LDAP Service + eXo LDAP impl + + + = + + org.exoplatform.tool + exo.tool.framework.junit + + = + + org.exoplatform.kernel + exo.kernel.component.common + + = + + org.exoplatform.kernel + exo.kernel.commons + + = + + org.exoplatform.kernel + exo.kernel.container + + + + com.novell.ldap + jldap + test + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + + + + = + + + Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-18 08:43= :13 UTC (rev 738) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-18 09:01= :34 UTC (rev 739) @@ -1,133 +1,133 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.organization.api - - eXo Core :: Component :: Organization Service API - eXo Organization Service API - - - - org.exoplatform.kernel - exo.kernel.container - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - - org.exoplatform.core - exo.core.component.security.core - - - - javax.ejb - ejb - - - - xdoclet - xdoclet-hibernate-module - - - - xdoclet - xdoclet - - - - xdoclet - xdoclet-xdoclet-module - - - - xdoclet - xjavadoc - - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - compile - - - - - - - - - - - - - - - - - run - - - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.organization.api + + eXo Core :: Component :: Organization Service API + eXo Organization Service API + + + + org.exoplatform.kernel + exo.kernel.container + + + + org.exoplatform.kernel + exo.kernel.commons + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + + org.exoplatform.core + exo.core.component.security.core + + + + xdoclet + xdoclet-hibernate-module + + + + xdoclet + xdoclet-xdoclet-module + + + + xdoclet + xjavadoc + + = + + xstream + xstream + + = + + picocontainer + picocontainer + + + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + compile + + + + + + + + + + + + + + + + + run + + + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-18 08:4= 3:13 UTC (rev 738) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-18 09:0= 1:34 UTC (rev 739) @@ -1,89 +1,130 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.organization.jdbc - - eXo Core :: Component :: Organization Service JDBC - eXo Organization Service JDBC - - - - org.exoplatform.core - exo.core.component.database - - - - org.exoplatform.core - exo.core.component.organization.api - - - - javax.resource - connector-api - test - - - - com.microsoft - sqljdbc - test - - - - com.ibm.db2 - db2jcc - test - - - - com.ibm.db2 - db2jcc_license_cu - test - - - - oracle - ojdbc - test - - - - postgresql - postgresql - test - - - - mysql - mysql-connector-java - test - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.organization.jdbc + + eXo Core :: Component :: Organization Service JDBC + eXo Organization Service JDBC + + + + + org.exoplatform.tool + exo.tool.framework.junit + + + + org.exoplatform.kernel + exo.kernel.component.common + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + + org.exoplatform.kernel + exo.kernel.commons + + + + org.exoplatform.kernel + exo.kernel.container + + + + xstream + xstream + + + + picocontainer + picocontainer + + + + org.hibernate + hibernate-core + + + + org.exoplatform.core + exo.core.component.database + + + + org.exoplatform.core + exo.core.component.organization.api + + + + javax.resource + connector-api + test + + + + com.microsoft + sqljdbc + test + + + + com.ibm.db2 + db2jcc + test + + + + com.ibm.db2 + db2jcc_license_cu + test + + + + oracle + ojdbc + test + + + + postgresql + postgresql + test + + + + mysql + mysql-connector-java + test + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-18 08:4= 3:13 UTC (rev 738) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-18 09:0= 1:34 UTC (rev 739) @@ -1,66 +1,83 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.organization.ldap - - eXo Core :: Component :: Organization Service LDAP - eXo Organization Service LDAP - - - - org.exoplatform.core - exo.core.component.ldap - - - org.exoplatform.core - exo.core.component.organization.api - - - org.exoplatform.core - exo.core.component.organization.jdbc - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestOrganizationService.java - - - - = - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.organization.ldap + + eXo Core :: Component :: Organization Service LDAP + eXo Organization Service LDAP + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.core + exo.core.component.ldap + + + org.exoplatform.core + exo.core.component.database + ${project.version} + + + org.exoplatform.core + exo.core.component.organization.api + + + org.exoplatform.core + exo.core.component.organization.jdbc + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestOrganizationService.java + + + + = + + \ No newline at end of file Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-18 08:43:13= UTC (rev 738) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-18 09:01:34= UTC (rev 739) @@ -1,46 +1,50 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.script.groovy - - eXo Core :: Component :: Groovy Scripts Instantiator - Load and compile Groovy script - - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.codehaus.groovy - groovy-all - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.script.groovy + + eXo Core :: Component :: Groovy Scripts Instantiator + Load and compile Groovy script + + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + org.codehaus.groovy + groovy-all + + \ No newline at end of file Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-18 08:43:13= UTC (rev 738) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-18 09:01:34= UTC (rev 739) @@ -1,62 +1,83 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.security.core - - eXo Core :: Component :: Security Service - eXo Security - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.security.core + + eXo Core :: Component :: Security Service + eXo Security + + + + org.exoplatform.kernel + exo.kernel.component.common + + = + + org.exoplatform.kernel + exo.kernel.commons + + = + + org.exoplatform.kernel + exo.kernel.container + + = + + javax.servlet + servlet-api + + = + + commons-lang + commons-lang + + = + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-18 08:43:13 UTC (= rev 738) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-18 09:01:34 UTC (= rev 739) @@ -1,53 +1,53 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.web.css - - eXo Core :: Component :: Web CSS - Stylesheet engine - - - - org.w3c - sac - - - - batik - batik-util - - - - batik - batik-css - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.web.css + + eXo Core :: Component :: Web CSS + Stylesheet engine + + + + org.w3c + sac + + + + batik + batik-util + + + + batik + batik-css + + + + Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-18 08:43:1= 3 UTC (rev 738) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-18 09:01:3= 4 UTC (rev 739) @@ -1,103 +1,108 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.xml-processing - - eXo Core :: Component :: XML Processing Service - eXo XML Processing Services - - - - org.exoplatform.kernel - exo.kernel.component.common - - - - jtidy - jtidy - - - - xml-resolver - xml-resolver - - - - - - - src/main/java - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - src/main/resources - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - src/test/java - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + exo.core.component.xml-processing + + eXo Core :: Component :: XML Processing Service + eXo XML Processing Services + + + + org.exoplatform.kernel + exo.kernel.commons + + = + + org.exoplatform.kernel + exo.kernel.container + + + + jtidy + jtidy + + + + picocontainer + picocontainer + + + + + + + src/main/java + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + src/main/resources + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + src/test/java + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + \ No newline at end of file Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2009-11-18 08:43:13 UTC (rev 738) +++ core/trunk/packaging/module/pom.xml 2009-11-18 09:01:34 UTC (rev 739) @@ -1,77 +1,77 @@ - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - 4.0.0 - core.packaging.module - pom - eXo Core Build module - - - core - module - - - - - org.exoplatform.coreexo= .core.component.database2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04-SNAPSHOT= - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04-SNAPSHO= T - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04-SNAPSHOT - - = - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + + + 4.0.0 + core.packaging.module + pom + eXo Core Build module + + + core + module + + + + + org.exoplatform.coreexo= .core.component.database2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04-SNAPSHOT= + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04-SNAPSHO= T + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04-SNAPSHOT + + = + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = = \ No newline at end of file Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-18 08:43:13 UTC (rev 738) +++ core/trunk/pom.xml 2009-11-18 09:01:34 UTC (rev 739) @@ -1,396 +1,358 @@ - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - pom - - eXo Core - - - exo-core - 2.3 - = - 2.2.0-Beta03 - *Test* - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk - http://fisheye.jboss.org/browse/exo-jcr/core/trunk - - - - exo.core.component.security.core - exo.core.component.database - exo.core.component.document - exo.core.component.ldap - exo.core.component.organization.api - exo.core.component.organization.jdbc - exo.core.component.organization.ldap - exo.core.component.xml-processing - exo.core.component.script.groovy - exo.core.component.web.css - packaging/module - - - - - = - - org.exoplatform.core - exo.core.component.security.core - ${project.version} - - - - org.exoplatform.core - exo.core.component.database - ${project.version} - - - - org.exoplatform.core - exo.core.component.ldap - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.api - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.jdbc - ${project.version} - - = - - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} - - - - org.exoplatform.kernel - exo.kernel.container - ${org.exoplatform.kernel.version} - - - - org.exoplatform.kernel - exo.kernel.component.cache - ${org.exoplatform.kernel.version} - - - - javax.resource - connector-api - 1.5 - - - - hsqldb - hsqldb - 1.8.0.7 - - - - com.experlog - xapool - 1.5.0 - - - - c3p0 - c3p0 - 0.9.1.2 - - - - commons-dbcp - commons-dbcp - 1.2.2 - - - - org.hibernate - hibernate-core - 3.3.1.GA - - - - xdoclet - xdoclet-hibernate-module - 1.2.3 - - - - xdoclet - xdoclet - 1.2.3 - - - - xdoclet - xdoclet-xdoclet-module - 1.2 - - - - xdoclet - xjavadoc - 1.0.3 - - - - commons-collections - commons-collections - 3.1 - - - - pdfbox - pdfbox - 0.7.3 - compile - - - - com.lowagie - itext - 2.1.0 - compile - - - - org.htmlparser - htmlparser - 1.6 - compile - - - com.sun - tools - - - - - - org.apache.poi - poi - 3.0.2-FINAL - - - - org.apache.poi - poi-scratchpad - 3.0.2-FINAL - - - - com.novell.ldap - jldap - 4.3 - - - - javax.ejb - ejb - 2.1 - - - - xdoclet - xdoclet-hibernate-module - 1.2.3 - compile - - - - xdoclet - xdoclet - 1.2.3 - - - - xdoclet - xdoclet-xdoclet-module - 1.2 - - - - xdoclet - xjavadoc - 1.0.3 - - - - javax.resource - connector-api - 1.5 - - - - com.microsoft - sqljdbc - 1.1.1501 - - - - com.ibm.db2 - db2jcc - 9.1 - - - - com.ibm.db2 - db2jcc_license_cu - 9.1 - - - - oracle - ojdbc - 1.4 - - - - postgresql - postgresql - 8.3-603.jdbc3 - - - - mysql - mysql-connector-java - 5.0.8 - - - - org.codehaus.groovy - groovy-all - 1.6.5 - - - - org.w3c - sac - 1.3 - - - - batik - batik-util - 1.7 - - - - batik - batik-css - 1.7 - - - - jtidy - jtidy - 4aug2000r7-dev - - - - xml-resolver - xml-resolver - 1.1 - - - - commons-logging - commons-logging - 1.1 - - - - javassist - javassist - 3.4.GA - - = - - org.hibernate - hibernate-annotations - 3.4.0.GA - - - - - - - - junit - junit - test - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - always - - **/*$* - **/DBCreatorTest.java - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - - - - - - - + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04-SNAPSHOT + pom + + eXo Core + + + exo-core + 2.3 + = + 2.2.0-Beta04-SNAPSHOT + *Test* + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk + http://fisheye.jboss.org/browse/exo-jcr/core/trunk + + + + exo.core.component.security.core + exo.core.component.database + exo.core.component.document + exo.core.component.ldap + exo.core.component.organization.api + exo.core.component.organization.jdbc + exo.core.component.organization.ldap + exo.core.component.xml-processing + exo.core.component.script.groovy + exo.core.component.web.css + packaging/module + + + + + = + + org.exoplatform.tool + exo.tool.framework.junit + 1.2.0 + + = + + org.exoplatform.kernel + exo.kernel.commons + ${org.exoplatform.kernel.version} + = + = + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + = + + + org.exoplatform.kernel + exo.kernel.container + ${org.exoplatform.kernel.version} + + = + + org.exoplatform.kernel + exo.kernel.component.cache + ${org.exoplatform.kernel.version} + + = + + org.exoplatform.core + exo.core.component.database + ${project.version} + + = + + org.exoplatform.core + exo.core.component.ldap + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.api + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.jdbc + ${project.version} + + = + + org.exoplatform.core + exo.core.component.security.core + ${project.version} + + + + javax.resource + connector-api + 1.5 + + + + javax.servlet + servlet-api + 2.4 = + + = + + javax.transaction + jta + 1.0.1B = + + = + + pull-parser + pull-parser + 2 = + + = + + commons-lang + commons-lang + 2.3 + + = + + hsqldb + hsqldb + 1.8.0.7 + + + + com.experlog + xapool + 1.5.0 + + = + + org.hibernate + hibernate-core + 3.3.1.GA + + = + + xstream + xstream + 1.0.2 + + = + + picocontainer + picocontainer + 1.1 = + + = + + xdoclet + xdoclet-hibernate-module + 1.2.3 + + + + xdoclet + xdoclet-xdoclet-module + 1.2 + + + + xdoclet + xjavadoc + 1.0.3 + + = + + com.microsoft + sqljdbc + 1.1.1501 + + + + com.ibm.db2 + db2jcc + 9.1 + + + + com.ibm.db2 + db2jcc_license_cu + 9.1 + + + + oracle + ojdbc + 1.4 + + + + postgresql + postgresql + 8.3-603.jdbc3 + + + + mysql + mysql-connector-java + 5.0.8 + + = + + org.codehaus.groovy + groovy-all + 1.6.5 + + = + + org.hibernate + hibernate-annotations + 3.4.0.GA + + = + + pdfbox + pdfbox + 0.7.3 + + = + + com.lowagie + itext + 2.1.0 + compile + + = + + org.htmlparser + htmlparser + 1.6 + compile + + + com.sun + tools + + + + + + org.apache.poi + poi + 3.0.2-FINAL + + + + org.apache.poi + poi-scratchpad + 3.0.2-FINAL + + = + + com.novell.ldap + jldap + 4.3 + + = + + jtidy + jtidy + 4aug2000r7-dev + + = + + org.w3c + sac + 1.3 + + + + batik + batik-util + 1.7 + + + + batik + batik-css + 1.7 + + + + + + + + junit + junit + test + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + always + + **/*$* + **/DBCreatorTest.java + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + - - - org.exoplatform.tool exo.tool.framework.junit Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-18 09:01:34 UTC (rev= 739) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-18 09:09:44 UTC (rev= 740) @@ -34,27 +34,22 @@ eXo LDAP impl = - = org.exoplatform.tool exo.tool.framework.junit - = org.exoplatform.kernel exo.kernel.component.common - = org.exoplatform.kernel exo.kernel.commons - = org.exoplatform.kernel exo.kernel.container - com.novell.ldap jldap Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-18 09:01= :34 UTC (rev 739) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-18 09:09= :44 UTC (rev 740) @@ -38,47 +38,38 @@ org.exoplatform.kernel exo.kernel.container - org.exoplatform.kernel exo.kernel.commons - org.exoplatform.kernel exo.kernel.component.cache - org.exoplatform.core exo.core.component.security.core - xdoclet xdoclet-hibernate-module - xdoclet xdoclet-xdoclet-module - xdoclet xjavadoc - = xstream xstream - = picocontainer picocontainer - = Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-18 09:0= 1:34 UTC (rev 739) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-18 09:0= 9:44 UTC (rev 740) @@ -34,93 +34,76 @@ eXo Organization Service JDBC = - org.exoplatform.tool exo.tool.framework.junit - org.exoplatform.kernel exo.kernel.component.common - org.exoplatform.kernel exo.kernel.component.cache - org.exoplatform.kernel exo.kernel.commons - org.exoplatform.kernel exo.kernel.container - xstream xstream - picocontainer picocontainer - org.hibernate hibernate-core - org.exoplatform.core exo.core.component.database - org.exoplatform.core exo.core.component.organization.api - javax.resource connector-api test - com.microsoft sqljdbc test - com.ibm.db2 db2jcc test - com.ibm.db2 db2jcc_license_cu test - oracle ojdbc test - postgresql postgresql test - mysql mysql-connector-java Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-18 09:01:34= UTC (rev 739) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-18 09:09:44= UTC (rev 740) @@ -38,27 +38,22 @@ org.exoplatform.kernel exo.kernel.component.common - = org.exoplatform.kernel exo.kernel.commons - = org.exoplatform.kernel exo.kernel.container - = javax.servlet servlet-api - = commons-lang commons-lang - = = Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-18 09:01:34 UTC (= rev 739) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-18 09:09:44 UTC (= rev 740) @@ -38,16 +38,13 @@ org.w3c sac - batik batik-util - batik batik-css - Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-18 09:01:3= 4 UTC (rev 739) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-18 09:09:4= 4 UTC (rev 740) @@ -38,17 +38,14 @@ org.exoplatform.kernel exo.kernel.commons - = org.exoplatform.kernel exo.kernel.container - jtidy jtidy - picocontainer picocontainer --===============5199435530829502139==-- From do-not-reply at jboss.org Wed Nov 18 04:12:07 2009 Content-Type: multipart/mixed; boundary="===============3644829691029894275==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r741 - in ws/trunk: exo.ws.commons and 4 other directories. Date: Wed, 18 Nov 2009 04:12:07 -0500 Message-ID: <200911180912.nAI9C7OF027342@svn01.web.mwc.hst.phx2.redhat.com> --===============3644829691029894275== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-18 04:12:07 -0500 (Wed, 18 Nov 2009) New Revision: 741 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/pom.xml Log: EXOJCR-162 Modules dependencies cleaned Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-18 09:09:44 UTC (rev 740) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-18 09:12:07 UTC (rev 741) @@ -35,15 +35,19 @@ org.exoplatform.kernel - exo.kernel.component.common + exo.kernel.commons + = - com.sun.xml.stream - sjsxp + javax.xml.stream + stax-api + = - stax - stax-api + junit + junit + test + = Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-18 09:09:44 UTC (rev 74= 0) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-18 09:12:07 UTC (rev 74= 1) @@ -35,8 +35,9 @@ = - org.exoplatform.kernel - exo.kernel.component.common + junit + junit + test = Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-18 09:09:44 UTC (rev= 740) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-18 09:12:07 UTC (rev= 741) @@ -41,5 +41,14 @@ org.exoplatform.kernel exo.kernel.component.common + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + = + = Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-18 09:09:44 UTC (rev 740) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-18 09:12:07 UTC (rev 741) @@ -35,11 +35,11 @@ org.exoplatform.kernel - exo.kernel.component.common + exo.kernel.commons - org.exoplatform.core - exo.core.component.xml-processing + org.exoplatform.kernel + exo.kernel.container org.exoplatform.ws @@ -49,16 +49,45 @@ org.exoplatform.ws exo.ws.testframework test + = + + junit + junit + test + = + + javax.servlet + servlet-api - javax.xml.bind - jaxb-api + javax.xml.stream + stax-api + = + + javax.mail + mail - com.sun.xml.bind - jaxb-impl + javax.activation + activation + picocontainer + picocontainer + + + jtidy + jtidy + + + xpp3 + xpp3 = + + + javax.xml.bind + jaxb-api + + = org.jvnet.jaxb2.maven2 maven-jaxb2-plugin test @@ -71,10 +100,6 @@ commons-fileupload commons-fileupload - - commons-io - commons-io - = Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-18 09:09:44 UTC (rev 740) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-18 09:12:07 UTC (rev 741) @@ -34,6 +34,18 @@ = + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.core + exo.core.component.xml-processing + + org.exoplatform.ws exo.ws.commons @@ -45,5 +57,26 @@ javax.annotation jsr250-api + + jtidy + jtidy + + + junit + junit + + + javax.ws.rs + jsr311-api + + + javax.xml.stream + stax-api + 1.0 + + + xpp3 + xpp3 + = Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-18 09:09:44 UTC (rev 740) +++ ws/trunk/pom.xml 2009-11-18 09:12:07 UTC (rev 741) @@ -45,8 +45,8 @@ exo-ws 2.1 = - 2.2.0-Beta03 - 2.3.0-Beta03 + 2.2.0-Beta04-SNAPSHOT + 2.3.0-Beta04-SNAPSHOT = *Test* @@ -62,89 +62,112 @@ = - + + org.exoplatform.kernel + exo.kernel.commons + ${org.exoplatform.kernel.version} + + + org.exoplatform.kernel + exo.kernel.container + ${org.exoplatform.kernel.version} + = + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + + + org.exoplatform.core + exo.core.component.xml-processing + ${org.exoplatform.core.version} + = + org.exoplatform.ws exo.ws.frameworks.json ${project.version} - + org.exoplatform.ws - exo.ws.commons + exo.ws.testframework ${project.version} - + = org.exoplatform.ws - exo.ws.rest.core + exo.ws.commons ${project.version} org.exoplatform.ws - exo.ws.testframework + exo.ws.rest.core ${project.version} - + = + = + + = + + javax.xml.stream + stax-api + 1.0 + - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} - + javax.servlet + servlet-api + 2.4 + - org.exoplatform.core - exo.core.component.xml-processing - ${org.exoplatform.core.version} - - + javax.mail + mail + 1.4 + - com.sun.xml.stream - sjsxp - 1.0 - + javax.activation + activation + 1.1 + - com.sun.xml.bind - jaxb-impl - 2.1.7 = - - - stax - stax-api - 1.0 - - javax.xml.bind jaxb-api 2.1 - + = + + picocontainer + picocontainer + 1.1 = + + + jtidy + jtidy + 4aug2000r7-dev = + = org.jvnet.jaxb2.maven2 maven-jaxb2-plugin 0.4 - + = - javax.ws.rs - jsr311-api - 1.0 - - commons-fileupload commons-fileupload 1.0 - + = - commons-io - commons-io - 1.3.2 - + javax.ws.rs + jsr311-api + 1.0 + javax.annotation jsr250-api 1.0 - - - javax.servlet - servlet-api - 2.4 - + = + + xpp3 + xpp3 + 1.1.3.4.O + = + --===============3644829691029894275==-- From do-not-reply at jboss.org Wed Nov 18 04:19:29 2009 Content-Type: multipart/mixed; boundary="===============0699429884538665948==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r742 - in ws/trunk: exo.ws.commons and 1 other directories. Date: Wed, 18 Nov 2009 04:19:29 -0500 Message-ID: <200911180919.nAI9JTE9029207@svn01.web.mwc.hst.phx2.redhat.com> --===============0699429884538665948== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-18 04:19:29 -0500 (Wed, 18 Nov 2009) New Revision: 742 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/pom.xml Log: EXOJCR-162 Modules dependencies cleaned Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-18 09:12:07 UTC (rev 741) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-18 09:19:29 UTC (rev 742) @@ -37,17 +37,14 @@ org.exoplatform.kernel exo.kernel.commons - = javax.xml.stream stax-api - = junit junit test - = Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-18 09:12:07 UTC (rev= 741) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-18 09:19:29 UTC (rev= 742) @@ -49,6 +49,5 @@ org.exoplatform.kernel exo.kernel.container = - = Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-18 09:12:07 UTC (rev 741) +++ ws/trunk/pom.xml 2009-11-18 09:19:29 UTC (rev 742) @@ -103,9 +103,6 @@ exo.ws.rest.core ${project.version} = - = - - = javax.xml.stream stax-api --===============0699429884538665948==-- From do-not-reply at jboss.org Wed Nov 18 05:06:52 2009 Content-Type: multipart/mixed; boundary="===============3264311915423133962==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r743 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 18 Nov 2009 05:06:52 -0500 Message-ID: <200911181006.nAIA6qrg006736@svn01.web.mwc.hst.phx2.redhat.com> --===============3264311915423133962== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-18 05:06:51 -0500 (Wed, 18 Nov 2009) New Revision: 743 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-201: prepare changes log list Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 09:19:29 UTC (rev 742) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 10:06:51 UTC (rev 743) @@ -18,9 +18,13 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; +import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; +import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; @@ -28,8 +32,10 @@ import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; = +import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Set; = import javax.jcr.RepositoryException; @@ -69,85 +75,102 @@ WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; = + // prepare changes log list + List chengesLogList =3D new ArrayList(); + if (changesLog instanceof PlainChangesLog) + { + chengesLogList.add((PlainChangesLog)changesLog); + } + else if (changesLog instanceof CompositeChangesLog) + { + for (ChangesLogIterator iter =3D ((CompositeChangesLog)changesLog= ).getLogIterator(); iter.hasNextLog();) + { + chengesLogList.add(iter.nextLog()); + } + } + try { - for (Iterator iter =3D changesLog.getAllStates().itera= tor(); iter.hasNext();) + for (PlainChangesLog curChangesLog : chengesLogList) { - ItemState itemState =3D iter.next(); + for (Iterator iter =3D curChangesLog.getAllStates()= .iterator(); iter.hasNext();) + { + ItemState itemState =3D iter.next(); = - if (!itemState.isPersisted()) - continue; + if (!itemState.isPersisted()) + continue; = - long start =3D System.currentTimeMillis(); + long start =3D System.currentTimeMillis(); = - TransientItemData data =3D (TransientItemData)itemState.getDat= a(); + TransientItemData data =3D (TransientItemData)itemState.get= Data(); = - WorkspaceStorageConnection conn =3D null; - if (isSystemDescendant(data.getQPath())) - { - conn =3D systemConnection =3D=3D null - // we need system connection but it's not exist - ? systemConnection =3D (systemDataContainer !=3D dataCon= tainer - // if it's different container instances - ? systemDataContainer.equals(dataContainer) && thisCo= nnection !=3D null - // but container confugrations are same and non-syste= m connnection open - // reuse this connection as system - ? systemDataContainer.reuseConnection(thisConnecti= on) - // or open one new system - : systemDataContainer.openConnection() - // else if it's same container instances (system and = this) - : thisConnection =3D=3D null - // and non-system connection doens't exist - open it - ? thisConnection =3D dataContainer.openConnection() - // if already open - use it - : thisConnection) - // system connection opened - use it - : systemConnection; - } - else - { - conn =3D thisConnection =3D=3D null - // we need this conatiner conection - ? thisConnection =3D (systemDataContainer !=3D dataConta= iner - // if it's different container instances - ? dataContainer.equals(systemDataContainer) && system= Connection !=3D null - // but container confugrations are same and system co= nnnection open - // reuse system connection as this - ? dataContainer.reuseConnection(systemConnection) - // or open one new - : dataContainer.openConnection() - // else if it's same container instances (system and = this) - : systemConnection =3D=3D null - // and system connection doens't exist - open it - ? systemConnection =3D dataContainer.openConnectio= n() - // if already open - use it - : systemConnection) - // this connection opened - use it - : thisConnection; - } + WorkspaceStorageConnection conn =3D null; + if (isSystemDescendant(data.getQPath())) + { + conn =3D systemConnection =3D=3D null + // we need system connection but it's not exist + ? systemConnection =3D (systemDataContainer !=3D data= Container + // if it's different container instances + ? systemDataContainer.equals(dataContainer) && thi= sConnection !=3D null + // but container confugrations are same and non-sy= stem connnection open + // reuse this connection as system + ? systemDataContainer.reuseConnection(thisConne= ction) + // or open one new system + : systemDataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : thisConnection =3D=3D null + // and non-system connection doens't exist - open = it + ? thisConnection =3D dataContainer.openConnecti= on() + // if already open - use it + : thisConnection) + // system connection opened - use it + : systemConnection; + } + else + { + conn =3D thisConnection =3D=3D null + // we need this conatiner conection + ? thisConnection =3D (systemDataContainer !=3D dataCo= ntainer + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && sys= temConnection !=3D null + // but container confugrations are same and system= connnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnectio= n) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (system a= nd this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openConnec= tion() + // if already open - use it + : systemConnection) + // this connection opened - use it + : thisConnection; + } = - data.increasePersistedVersion(); + data.increasePersistedVersion(); = - if (itemState.isAdded()) - { - doAdd(data, conn, addedNodes); + if (itemState.isAdded()) + { + doAdd(data, conn, addedNodes); + } + else if (itemState.isUpdated()) + { + doUpdate(data, conn); + } + else if (itemState.isDeleted()) + { + doDelete(data, conn); + } + else if (itemState.isRenamed()) + { + doRename(data, conn, addedNodes); + } + + if (LOG.isDebugEnabled()) + LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) + + "ms, " + data.getQPath().getAsString()); } - else if (itemState.isUpdated()) - { - doUpdate(data, conn); - } - else if (itemState.isDeleted()) - { - doDelete(data, conn); - } - else if (itemState.isRenamed()) - { - doRename(data, conn, addedNodes); - } - - if (LOG.isDebugEnabled()) - LOG.debug(ItemState.nameFromValue(itemState.getState()) + "= " + (System.currentTimeMillis() - start) - + "ms, " + data.getQPath().getAsString()); } if (thisConnection !=3D null) thisConnection.commit(); --===============3264311915423133962==-- From do-not-reply at jboss.org Wed Nov 18 05:36:42 2009 Content-Type: multipart/mixed; boundary="===============4473909843929901741==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r744 - in jcr/trunk: applications/java/exo.jcr.applications.backupconsole and 12 other directories. Date: Wed, 18 Nov 2009 05:36:42 -0500 Message-ID: <200911181036.nAIAag5n012416@svn01.web.mwc.hst.phx2.redhat.com> --===============4473909843929901741== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-18 05:36:41 -0500 (Wed, 18 Nov 2009) New Revision: 744 Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml jcr/trunk/applications/java/exo.jcr.ear/pom.xml jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ftp/pom.xml jcr/trunk/exo.jcr.component.webdav/pom.xml jcr/trunk/exo.jcr.connectors.localadapter/pom.xml jcr/trunk/exo.jcr.framework.command/pom.xml jcr/trunk/exo.jcr.framework.ftpclient/pom.xml jcr/trunk/exo.jcr.framework.web/pom.xml jcr/trunk/pom.xml Log: EXOJCR-162 Modules dependencies cleaned Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/po= m.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-18 10:06:51 UTC (rev 743) +++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-18 10:36:41 UTC (rev 744) @@ -39,26 +39,30 @@ = + org.exoplatform.jcr + exo.jcr.component.core + + + org.exoplatform.jcr + exo.jcr.component.ext + = + org.exoplatform.ws exo.ws.commons - - org.apache.ws.commons - ws-commons-util - - - xml-apis - xml-apis - - - - + org.exoplatform.ws + exo.ws.frameworks.json + ${org.exoplatform.ws.version} + = - org.exoplatform.jcr - exo.jcr.component.ext + org.jibx + jibx-run + = + + javax.ws.rs + jsr311-api - = Modified: jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-18 10:06:51 UTC (rev 743) +++ jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-18 10:36:41 UTC (rev 744) @@ -34,19 +34,46 @@ eXo JCR :: Application :: Browser Demo = - + org.exoplatform.kernel + exo.kernel.container + provided + + + org.exoplatform.kernel + exo.kernel.commons + provided + + + org.exoplatform.core + exo.core.component.security.core + provided + + org.exoplatform.jcr exo.jcr.component.core provided - org.exoplatform.jcr + exo.jcr.component.ext + provided + + + org.exoplatform.jcr exo.jcr.framework.web provided - + + javax.jcr + jcr + provided + = + + javax.servlet + servlet-api + provided + = = Modified: jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-18 10:06:51 UTC (rev 743) +++ jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-18 10:36:41 UTC (rev 744) @@ -35,19 +35,16 @@ eXo simple CMS web app = - org.exoplatform.jcr exo.jcr.component.core provided - org.exoplatform.jcr exo.jcr.framework.web provided - = Modified: jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-1= 8 10:06:51 UTC (rev 743) +++ jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-1= 8 10:36:41 UTC (rev 744) @@ -35,13 +35,11 @@ eXo JCR Rest web application = - org.exoplatform.jcr exo.jcr.framework.web provided - = Modified: jcr/trunk/applications/java/exo.jcr.ear/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-18 10:06:51 UTC= (rev 743) +++ jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-18 10:36:41 UTC= (rev 744) @@ -40,28 +40,24 @@ rar runtime - org.exoplatform.jcr exo.jcr.applications.rest war runtime - org.exoplatform.jcr exo.jcr.applications.browser war runtime - org.exoplatform.jcr exo.jcr.applications.fckeditor war runtime - org.exoplatform.jcr exo.jcr.component.webdav Modified: jcr/trunk/exo.jcr.component.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-18 10:06:51 UTC (rev 7= 43) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-18 10:36:41 UTC (rev 7= 44) @@ -43,72 +43,54 @@ javax.jcr jcr - - org.exoplatform.kernel exo.kernel.container - org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel exo.kernel.component.command - org.exoplatform.kernel exo.kernel.component.common - - - org.exoplatform.kernel exo.kernel.component.cache - org.exoplatform.core exo.core.component.organization.api - org.exoplatform.core exo.core.component.document - org.exoplatform.core exo.core.component.security.core - - - org.apache.lucene lucene-core - org.apache.lucene lucene-spellchecker - org.apache.lucene lucene-memory - - javax.xml.stream - stax-api - - - com.sun.xml.stream sjsxp - commons-dbcp commons-dbcp @@ -119,40 +101,51 @@ - - - - - + commons-lang + commons-lang + + + commons-chain + commons-chain + + + xml-apis + xml-apis + + + org.slf4j + slf4j-api + + + stax + stax-api + = + + org.jibx + jibx-run + + + picocontainer + picocontainer + + javax.resource connector-api - javax.transaction jta - concurrent concurrent - commons-collections commons-collections - - commons-codec - commons-codec - - - org.apache.ws.commons ws-commons-util @@ -166,7 +159,6 @@ - org.apache.jackrabbit @@ -184,15 +176,12 @@ slf4j-log4j12 test - - hsqldb hsqldb test - mysql @@ -200,7 +189,6 @@ 5.0.5 test - postgresql @@ -208,7 +196,6 @@ 8.2-504.jdbc3 test - - - net.sourceforge.jtds @@ -244,7 +229,6 @@ 1.2 test - - org.apache.derby @@ -260,7 +243,6 @@ 10.2.2.0 test - - - - = = Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-18 10:06:51 UTC (rev 74= 3) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-18 10:36:41 UTC (rev 74= 4) @@ -35,6 +35,30 @@ = + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.component.command + = + + org.exoplatform.core + exo.core.component.document + + + org.exoplatform.core + exo.core.component.organization.api + + + org.exoplatform.core + exo.core.component.security.core + = + org.exoplatform.jcr exo.jcr.component.core @@ -61,6 +85,22 @@ exo.ws.commons + org.exoplatform.ws + exo.ws.frameworks.json + = + + javax.jcr + jcr + + + javax.annotation + jsr250-api + = + + stax + stax-api + = + commons-chain commons-chain @@ -77,6 +117,18 @@ commons-fileupload + picocontainer + picocontainer + + + jtidy + jtidy + + + xml-apis + xml-apis + + hsqldb hsqldb test Modified: jcr/trunk/exo.jcr.component.ftp/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-18 10:06:51 UTC (rev 74= 3) +++ jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-18 10:36:41 UTC (rev 74= 4) @@ -38,24 +38,53 @@ = - + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.component.command + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.core + exo.core.component.security.core + ${org.exoplatform.core.version} + = + org.exoplatform.jcr + exo.jcr.component.ext + + + org.exoplatform.jcr exo.jcr.component.core - org.exoplatform.jcr exo.jcr.framework.command provided - = + javax.jcr + jcr + + + commons-chain + commons-chain + = + + picocontainer + picocontainer + = + hsqldb hsqldb test - = Modified: jcr/trunk/exo.jcr.component.webdav/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-18 10:06:51 UTC (rev= 743) +++ jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-18 10:36:41 UTC (rev= 744) @@ -35,6 +35,18 @@ = + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.core + exo.core.component.security.core + = + org.exoplatform.ws exo.ws.rest.core @@ -55,6 +67,30 @@ exo.jcr.component.core + javax.ws.rs + jsr311-api + + + javax.servlet + servlet-api + = + + javax.jcr + jcr + = + + stax + stax-api + = + + xml-apis + xml-apis + = + + jtidy + jtidy + = + hsqldb hsqldb test @@ -72,7 +108,6 @@ **/TestUtils.java - **/TestUtils.java **/TestEncoding.java **/TestPropFindContent.java Modified: jcr/trunk/exo.jcr.connectors.localadapter/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-18 10:06:51 U= TC (rev 743) +++ jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-18 10:36:41 U= TC (rev 744) @@ -50,72 +50,70 @@ runtime - + org.exoplatform.kernel + exo.kernel.commons + ${org.exoplatform.kernel.version} + + org.exoplatform.jcr exo.jcr.component.ext runtime - org.exoplatform.jcr exo.jcr.component.webdav runtime - org.exoplatform.jcr exo.jcr.component.ftp runtime - org.exoplatform.jcr exo.jcr.framework.command runtime - org.exoplatform.jcr exo.jcr.framework.ftpclient runtime - org.exoplatform.jcr exo.jcr.framework.web runtime - org.exoplatform.ws exo.ws.frameworks.servlet runtime - com.sun.xml.bind jaxb-impl runtime - commons-collections commons-collections runtime - javax.resource connector - - org.exoplatform.kernel - exo.kernel.component.common + javax.transaction + jta - + javax.resource + connector-api + 1.5 + = + org.exoplatform.kernel exo.kernel.container Modified: jcr/trunk/exo.jcr.framework.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-18 10:06:51 UTC (re= v 743) +++ jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-18 10:36:41 UTC (re= v 744) @@ -34,39 +34,65 @@ eXo JCR command framework = - + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + ${org.exoplatform.kernel.version} + + org.exoplatform.jcr exo.jcr.component.core - org.exoplatform.jcr exo.jcr.component.ext - org.exoplatform.kernel exo.kernel.component.command - + org.exoplatform.core + exo.core.component.security.core + = + commons-fileupload commons-fileupload - + commons-io + commons-io + + javax.servlet servlet-api provided - = + javax.jcr + jcr + + + commons-chain + commons-chain + + + jtidy + jtidy + + + xml-apis + xml-apis + + hsqldb hsqldb test - = Modified: jcr/trunk/exo.jcr.framework.ftpclient/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-18 10:06:51 UTC (= rev 743) +++ jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-18 10:36:41 UTC (= rev 744) @@ -38,12 +38,10 @@ = - org.exoplatform.kernel - exo.kernel.component.command + exo.kernel.commons - = Modified: jcr/trunk/exo.jcr.framework.web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-18 10:06:51 UTC (rev 74= 3) +++ jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-18 10:36:41 UTC (rev 74= 4) @@ -35,7 +35,19 @@ = + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.component.command + + org.exoplatform.jcr + exo.jcr.component.core + + + org.exoplatform.jcr exo.jcr.component.ext @@ -48,15 +60,23 @@ provided - org.exoplatform.kernel - exo.kernel.component.common - provided + org.exoplatform.core + exo.core.component.security.core + = + + javax.jcr + jcr + 1.0 javax.servlet servlet-api provided + + commons-chain + commons-chain + = = Modified: jcr/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/pom.xml 2009-11-18 10:06:51 UTC (rev 743) +++ jcr/trunk/pom.xml 2009-11-18 10:36:41 UTC (rev 744) @@ -38,9 +38,9 @@ exo-jcr 1.12 - 2.2.0-Beta03 - 2.3.0-Beta03 - 2.1.0-Beta03 + 2.2.0-Beta04-SNAPSHOT + 2.3.0-Beta04-SNAPSHOT + 2.1.0-Beta04-SNAPSHOT = @@ -72,253 +72,313 @@ = - - = + - org.exoplatform.jcr - exo.jcr.applications.fckeditor - ${project.version} - war + org.exoplatform.kernel + exo.kernel.commons + ${org.exoplatform.kernel.version} - = - org.exoplatform.jcr - exo.jcr.applications.browser - ${project.version} - war + org.exoplatform.kernel + exo.kernel.component.command + ${org.exoplatform.kernel.version} - = + org.exoplatform.kernel + exo.kernel.container + ${org.exoplatform.kernel.version} + + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + + + org.exoplatform.kernel + exo.kernel.component.cache + ${org.exoplatform.kernel.version} + = + + org.exoplatform.core + exo.core.component.document + ${org.exoplatform.core.version} + + + org.exoplatform.core + exo.core.component.organization.api + ${org.exoplatform.core.version} + + + org.exoplatform.core + exo.core.component.security.core + ${org.exoplatform.core.version} + = + + org.exoplatform.core + exo.core.component.script.groovy + ${org.exoplatform.core.version} + + + org.exoplatform.ws + exo.ws.rest.core + ${org.exoplatform.ws.version} + + + org.exoplatform.ws + exo.ws.rest.ext + ${org.exoplatform.ws.version} + + + org.exoplatform.ws + exo.ws.commons + ${org.exoplatform.ws.version} + = + + org.exoplatform.ws + exo.ws.frameworks.json + ${org.exoplatform.ws.version} + + + org.exoplatform.ws + exo.ws.frameworks.servlet + ${org.exoplatform.ws.version} + = + org.exoplatform.jcr - exo.jcr.applications.rest + exo.jcr.component.ext ${project.version} - war - = org.exoplatform.jcr exo.jcr.component.core ${project.version} - = org.exoplatform.jcr - exo.jcr.component.ext + exo.jcr.framework.command ${project.version} - = org.exoplatform.jcr exo.jcr.component.ftp ${project.version} - - = + = org.exoplatform.jcr exo.jcr.component.webdav ${project.version} - = org.exoplatform.jcr - exo.jcr.framework.command + exo.jcr.framework.web ${project.version} - = org.exoplatform.jcr - exo.jcr.framework.web + exo.jcr.framework.ftpclient ${project.version} - = org.exoplatform.jcr - exo.jcr.framework.ftpclient + exo.jcr.applications.fckeditor ${project.version} + war - = - = org.exoplatform.jcr - exo.jcr.connectors.localadapter - rar + exo.jcr.applications.browser ${project.version} + war - = - org.exoplatform.kernel - exo.kernel.container - ${org.exoplatform.kernel.version} + org.exoplatform.jcr + exo.jcr.applications.rest + ${project.version} + war - - org.exoplatform.kernel - exo.kernel.component.command - ${org.exoplatform.kernel.version} - - + org.exoplatform.jcr + exo.jcr.connectors.localadapter + rar + ${project.version} + = - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} + commons-lang + commons-lang + 2.3 - - org.exoplatform.kernel - exo.kernel.component.cache - ${org.exoplatform.kernel.version} + commons-chain + commons-chain + 1.0 - - org.exoplatform.core - exo.core.component.organization.api - ${org.exoplatform.core.version} + org.jibx + jibx-run + 1.2.1 - - org.exoplatform.core - exo.core.component.document - ${org.exoplatform.core.version} + picocontainer + picocontainer + 1.1 - - org.exoplatform.core - exo.core.component.security.core - ${org.exoplatform.core.version} + xml-apis + xml-apis + 1.0.b2 - - org.exoplatform.core - exo.core.component.script.groovy - ${org.exoplatform.core.version} + org.slf4j + slf4j-api + 1.5.6 - - org.exoplatform.ws - exo.ws.commons - ${org.exoplatform.ws.version} - - + stax + stax-api + 1.0.1 + = - org.exoplatform.ws - exo.ws.rest.core - ${org.exoplatform.ws.version} + javax.jcr + jcr + 1.0 - - org.exoplatform.ws - exo.ws.rest.ext - ${org.exoplatform.ws.version} - - + javax.servlet + servlet-api + 2.4 + = - org.exoplatform.ws - exo.ws.frameworks.servlet - ${org.exoplatform.ws.version} - - - - javax.jcr - jcr + javax.annotation + jsr250-api 1.0 - javax.ws.rs jsr311-api 1.0 - - org.apache.jackrabbit - jackrabbit-jcr-tests - 1.6.0 + javax.transaction + jta + 1.0.1B - - - org.slf4j - slf4j-log4j12 - 1.5.6 + javax.resource + connector-api + 1.5 + = + + jtidy + jtidy + 4aug2000r7-dev - org.apache.lucene lucene-core 2.4.1 - org.apache.lucene lucene-spellchecker 2.4.1 - org.apache.lucene lucene-memory 2.4.1 - - + = - javax.xml.stream - stax-api - 1.0 - - - com.sun.xml.stream sjsxp 1.0 + = + + commons-dbcp + commons-dbcp + 1.2.1 - + concurrent + concurrent + 1.3.4 + + + commons-collections + commons-collections + 3.1 + + + org.apache.ws.commons + ws-commons-util + 1.0.1 + + + org.apache.jackrabbit + jackrabbit-jcr-tests + 1.6.0 + + + org.slf4j + slf4j-log4j12 + 1.5.6 + + hsqldb hsqldb 1.8.0.7 - - commons-dbcp - commons-dbcp + jgroups + jgroups + 2.6.10.GA + + + commons-fileupload + commons-fileupload 1.2.1 - - jotm - jotm - 2.0.10 - - - javax.resource - connector - - + com.sun.xml.bind + jaxb-impl + 2.1.7 - javax.resource - connector-api + connector 1.5 + + commons-io + commons-io + 1.3 + + = + = + = --===============4473909843929901741==-- From do-not-reply at jboss.org Wed Nov 18 05:40:34 2009 Content-Type: multipart/mixed; boundary="===============3838559515421139894==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r745 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 18 Nov 2009 05:40:33 -0500 Message-ID: <200911181040.nAIAeXav012911@svn01.web.mwc.hst.phx2.redhat.com> --===============3838559515421139894== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 05:40:33 -0500 (Wed, 18 Nov 2009) New Revision: 745 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-242:JbossCache WorkspaceDataManager updated to handle changes logs o= f ExtendedEvent.LOCK an UNLOCK types. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 10:36:41 UTC (rev 744) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 10:40:33 UTC (rev 745) @@ -22,13 +22,16 @@ import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; +import org.exoplatform.services.jcr.observation.ExtendedEvent; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; = @@ -93,6 +96,43 @@ { for (PlainChangesLog curChangesLog : chengesLogList) { + // if this is LOCK or UNLOCK changes log, then put or remove l= ock data from cache + if (curChangesLog.getEventType() =3D=3D ExtendedEvent.LOCK + || curChangesLog.getEventType() =3D=3D ExtendedEvent.UNLOCK) + { + WorkspaceStorageConnection conn =3D thisConnection =3D=3D n= ull + // we need this container connection + ? thisConnection =3D (systemDataContainer !=3D dataConta= iner + // if it's different container instances + ? dataContainer.equals(systemDataContainer) && system= Connection !=3D null + // but container configurations are same and system c= onnection open + // reuse system connection as this + ? dataContainer.reuseConnection(systemConnection) + // or open one new + : dataContainer.openConnection() + // else if it's same container instances (system and = this) + : systemConnection =3D=3D null + // and system connection doens't exist - open it + ? systemConnection =3D dataContainer.openConnectio= n() + // if already open - use it + : systemConnection) + // this connection opened - use it + : thisConnection; + + switch (curChangesLog.getEventType()) + { + case ExtendedEvent.LOCK : + // put lock data to cache = + LockData lockData =3D ((LockPlainChangesLogImpl)curCh= angesLog).getLockData(); + conn.addLockData(lockData); + break; + case ExtendedEvent.UNLOCK : + // remove lock data from cache + conn.removeLockData(curChangesLog.getAllStates().get(= 0).getData().getParentIdentifier()); + break; + } + } + for (Iterator iter =3D curChangesLog.getAllStates()= .iterator(); iter.hasNext();) { ItemState itemState =3D iter.next(); --===============3838559515421139894==-- From do-not-reply at jboss.org Wed Nov 18 06:18:08 2009 Content-Type: multipart/mixed; boundary="===============6003935223450575109==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r746 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 18 Nov 2009 06:18:08 -0500 Message-ID: <200911181118.nAIBI805018549@svn01.web.mwc.hst.phx2.redhat.com> --===============6003935223450575109== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-18 06:18:07 -0500 (Wed, 18 Nov 2009) New Revision: 746 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-249 : The method exists(Fqn name) was changed in JDBCCacheLoader. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 10:40:33= UTC (rev 745) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 11:18:07= UTC (rev 746) @@ -386,14 +386,100 @@ public boolean exists(Fqn name) throws Exception { // TODO Will be created specialization code to checking exist node o= r property in DB without getting NodeData or PropertyData from DB. + JDBCStorageConnection conn =3D (JDBCStorageConnection) dataContainer= .openConnection(); + = + boolean exists; + = try { - return get(name) !=3D null; + if (name.size() > 1) + { + if (name.get(0).equals(JBossCacheStorage.NODES)) + { + // /$NODES/ + if (name.size() =3D=3D 2) + { + String nodeId =3D name.getLastElementAsString(); + String nodeName =3D "" /* =3D conn.getNodeName(nodeId)*/; + = + if (nodeName !=3D null) + { + exists =3D true; = + } + else + { + exists =3D false; + } + } + // /$NODES// + else if (name.size() =3D=3D 3) + { + QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); + String parentId =3D (String)name.get(1); + + String nodeId =3D "" /* =3D conn.getIdentifier(parentId,= childNodeName)*/; + if (nodeId !=3D null) + { + exists =3D true; + } + else + { + exists =3D false; + } + } + else + { + exists =3D false; + LOG.warn("Unexpected Fqn asked " + name); + } + } + // /$PROPS/ + else if (name.get(0).equals(JBossCacheStorage.PROPS)) + { + if (name.size() =3D=3D 2) + { + String propertyId =3D name.getLastElementAsString(); + String propertyName =3D "" /* =3D conn.getPropertyName(n= odeId)*/; + = + if (propertyName !=3D null) + { + exists =3D true; = + } + else + { + exists =3D false; + } + } + else + { + exists =3D false; + LOG.warn("Unexpected Fqn asked " + name); + } + } + else + { + exists =3D false; + LOG.warn("Unexpected Fqn asked " + name); + } + } + else if (name.equals(Fqn.ROOT) || name.equals(JBossCacheStorage.P= ROPS) || name.equals(JBossCacheStorage.NODES) + || name.equals(JBossCacheStorage.LOCKS)) + { + // roots, like NODES, PROPS etc = + exists =3D true; + } + else + { + exists =3D false; + LOG.warn("Unexpected Fqn asked " + name); + } } - catch (JDBCCacheLoaderException e) + finally { - return false; + conn.close(); } + + return exists; } = /** --===============6003935223450575109==-- From do-not-reply at jboss.org Wed Nov 18 06:28:17 2009 Content-Type: multipart/mixed; boundary="===============4515110116736732938==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r747 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/lock and 1 other directories. Date: Wed, 18 Nov 2009 06:28:17 -0500 Message-ID: <200911181128.nAIBSHnV020378@svn01.web.mwc.hst.phx2.redhat.com> --===============4515110116736732938== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 06:28:16 -0500 (Wed, 18 Nov 2009) New Revision: 747 Removed: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/lock/TestLockImpl.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/SessionImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java Log: EXOJCR-243: Updated LockData and LockImpl to new design. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/SessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionImpl.java 2009-11-18 11:18:07 UTC (rev 746) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionImpl.java 2009-11-18 11:28:16 UTC (rev 747) @@ -176,8 +176,10 @@ = this.workspace =3D new WorkspaceImpl(workspaceName, container, this,= observationManager); = - // TODO: try to get lock time out from workspace configuration, as i= t was before - this.sessionLockManager =3D new SessionLockManager(this, SessionLock= Manager.DEFAULT_LOCK_TIMEOUT); + // TODO: try to get lock timeout from workspace configuration, as it= was before + this.sessionLockManager =3D + new SessionLockManager(this.getId(), this.getUserID(), this.getTr= ansientNodesManager(), + SessionLockManager.DEFAULT_LOCK_TIMEOUT); = this.lifecycleListeners =3D new ArrayList(= ); this.registerLifecycleListener((ObservationManagerImpl)observationMa= nager); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-18 11:18:07 UTC (rev 746) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-18 11:28:16 UTC (rev 747) @@ -148,7 +148,7 @@ @Override public int hashCode() { - return super.hashCode() + tokenHash.hashCode(); + return tokenHash.hashCode(); } = public boolean isDeep() @@ -157,14 +157,6 @@ } = /** - * @return the live - */ - public boolean isLive() - { - return live; - } - - /** * @return */ public boolean isSessionScoped() @@ -173,23 +165,6 @@ } = /** - * = - */ - public void refresh() - { - birthday =3D System.currentTimeMillis(); - } - - /** - * @param the - * live to set - */ - public void setLive(boolean live) - { - this.live =3D live; - } - - /** * @return */ protected long getTimeOut() @@ -197,11 +172,4 @@ return timeOut; } = - /** - * @param timeOut - */ - protected void setTimeOut(long timeOut) - { - this.timeOut =3D timeOut; - } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-18 11:18:07 UTC (rev 746) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-18 11:28:16 UTC (rev 747) @@ -19,7 +19,7 @@ package org.exoplatform.services.jcr.impl.core.lock; = import org.exoplatform.services.jcr.core.lock.ExtendedLock; -import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.SessionDataManager; = import javax.jcr.Node; import javax.jcr.RepositoryException; @@ -36,8 +36,10 @@ { private LockData lockData; = - private SessionImpl session; + private boolean live; = + private SessionDataManager sessionDataManager; + // Token is not stored in lockData any more private String token; = @@ -45,11 +47,12 @@ * @param session * @param lockData */ - public LockImpl(SessionImpl session, LockData lockData, String token) + public LockImpl(SessionDataManager sessionDataManager, LockData lockDat= a, String token) { this.lockData =3D lockData; - this.session =3D session; + this.sessionDataManager =3D sessionDataManager; this.token =3D token; + this.live =3D true; } = /** @@ -73,7 +76,32 @@ */ public boolean isLive() { - return lockData.isLive(); + // it is already not alive + if (!live) + { + return false; + } + // update from cache. If it is not present there - means it is not l= ive + try + { + // node unlocked and/or re-locked with another session = + LockData newlockData =3D sessionDataManager.getLockData(lockData.= getNodeIdentifier()); + if (newlockData =3D=3D null || newlockData.getTokenHash() !=3D lo= ckData.getTokenHash()) + { + live =3D false; + return false; + } + else + { + // update, whether time to death changed, or whatever + this.lockData =3D newlockData; + return true; + } + } + catch (RepositoryException e) + { + return false; + } } = /** @@ -83,7 +111,7 @@ { if (!isLive()) throw new LockException("Lock is not live"); - lockData.refresh(); + // TODO: recreate lockData } = /** @@ -93,7 +121,7 @@ { try { - return (Node)session.getTransientNodesManager().getItemByIdentifi= er(lockData.getNodeIdentifier(), true); + return (Node)sessionDataManager.getItemByIdentifier(lockData.getN= odeIdentifier(), true); } catch (RepositoryException e) { @@ -134,12 +162,4 @@ return lockData; } = - /** - * @param timeOut - */ - protected void setTimeOut(long timeOut) - { - lockData.setTimeOut(timeOut); - } - } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-18 11:18:07 UTC (= rev 746) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-18 11:28:16 UTC (= rev 747) @@ -30,7 +30,7 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.observation.ExtendedEvent; @@ -76,13 +76,14 @@ */ private static final int SEARCH_CHILD =3D 4; = - /** - * Session through which this lock manager is created - */ - private final SessionImpl session; + private String sessionID; = - protected final Log log =3D ExoLogger.getLogger(this.getClass().getName= ()); + private String userId; = + private SessionDataManager sessionDataManager; + + private final Log log =3D ExoLogger.getLogger(this.getClass().getName()= ); + /** * Holds session's tokens and their hashes to avoid calculation every t= ime. * Token <--> Hash = @@ -105,10 +106,12 @@ * @param session * @param lockTimeOut */ - public SessionLockManager(SessionImpl session, long lockTimeOut) + public SessionLockManager(String sessionID, String userId, SessionDataM= anager sessionDataManager, long lockTimeOut) { - this.session =3D session; this.lockTimeOut =3D lockTimeOut; + this.sessionID =3D sessionID; + this.userId =3D userId; + this.sessionDataManager =3D sessionDataManager; // TODO: configured lock timeout should be acquired from WSconfig /* if (config.getLockManager() !=3D null) { @@ -158,7 +161,7 @@ throw new LockException("Node not locked: " + node.getQPath()); } // if session doesn't have token, null will be returned - return new LockImpl(session, lockData, tokenHash.get(lockData.getTok= enHash())); + return new LockImpl(sessionDataManager, lockData, tokenHash.get(lock= Data.getTokenHash())); } = /** @@ -237,21 +240,20 @@ String hash =3D getHash(token); = LockData lockData =3D - new LockData(node.getIdentifier(), hash, isDeep, isSessionScoped,= session.getUserID(), timeOut > 0 ? timeOut - : lockTimeOut); + new LockData(node.getIdentifier(), hash, isDeep, isSessionScoped,= userId, timeOut > 0 ? timeOut : lockTimeOut); = tokens.put(token, hash); tokenHash.put(hash, token); = // Create and pass changes log = LockPlainChangesLogImpl changesLog =3D - new LockPlainChangesLogImpl(new ArrayList(), session.g= etId(), ExtendedEvent.LOCK); + new LockPlainChangesLogImpl(new ArrayList(), sessionID= , ExtendedEvent.LOCK); = changesLog.setLockData(lockData); = PropertyData propData =3D TransientPropertyData.createPropertyData(node, Constants.JCR_LOCK= OWNER, PropertyType.STRING, false, - new TransientValueData(session.getUserID())); + new TransientValueData(userId)); changesLog.add(ItemState.createAddedState(propData)); = propData =3D @@ -259,9 +261,9 @@ new TransientValueData(isDeep)); changesLog.add(ItemState.createAddedState(propData)); = - LockImpl newLock =3D new LockImpl(session, lockData, token); + LockImpl newLock =3D new LockImpl(sessionDataManager, lockData, toke= n); = - session.getTransientNodesManager().getTransactManager().save(changes= Log); + sessionDataManager.getTransactManager().save(changesLog); return newLock; } = @@ -273,20 +275,17 @@ */ public void unlock(NodeData node) throws RepositoryException { - PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), session.getId= (), ExtendedEvent.UNLOCK); + PlainChangesLog changesLog =3D new PlainChangesLogImpl(new ArrayList= (), sessionID, ExtendedEvent.UNLOCK); = - ItemData lockOwner =3D - session.getTransientNodesManager().getItemData(node, new QPathEnt= ry(Constants.JCR_LOCKOWNER, 0)); + ItemData lockOwner =3D sessionDataManager.getItemData(node, new QPat= hEntry(Constants.JCR_LOCKOWNER, 0)); = changesLog.add(ItemState.createDeletedState(lockOwner)); = - ItemData lockIsDeep =3D - session.getTransientNodesManager().getItemData(node, new QPathEnt= ry(Constants.JCR_LOCKISDEEP, 0)); + ItemData lockIsDeep =3D sessionDataManager.getItemData(node, new QPa= thEntry(Constants.JCR_LOCKISDEEP, 0)); = changesLog.add(ItemState.createDeletedState(lockIsDeep)); = - session.getTransientNodesManager().getTransactManager().save(changes= Log); + sessionDataManager.getTransactManager().save(changesLog); } = /** @@ -330,15 +329,15 @@ { if ((searchType & SEARCH_EXACMATCH) !=3D 0) { - retval =3D session.getTransientNodesManager().getLockData(data= .getIdentifier()); + retval =3D sessionDataManager.getLockData(data.getIdentifier()= ); } if (retval =3D=3D null && (searchType & SEARCH_PARENT) !=3D 0) { = - NodeData parentData =3D (NodeData)session.getTransientNodesMan= ager().getItemData(data.getParentIdentifier()); + NodeData parentData =3D (NodeData)sessionDataManager.getItemDa= ta(data.getParentIdentifier()); if (parentData !=3D null) { - retval =3D session.getTransientNodesManager().getLockData(p= arentData.getIdentifier()); + retval =3D sessionDataManager.getLockData(parentData.getIde= ntifier()); // parent not found try to find upper if (retval =3D=3D null) { @@ -349,10 +348,10 @@ if (retval =3D=3D null && (searchType & SEARCH_CHILD) !=3D 0) { = - List childData =3D session.getTransientNodesManager(= ).getChildNodesData(data); + List childData =3D sessionDataManager.getChildNodesD= ata(data); for (NodeData nodeData : childData) { - retval =3D session.getTransientNodesManager().getLockData(n= odeData.getIdentifier()); + retval =3D sessionDataManager.getLockData(nodeData.getIdent= ifier()); if (retval !=3D null) break; } @@ -384,7 +383,7 @@ */ private boolean isLockHolder(LockData lockData) { - return (SystemIdentity.SYSTEM.equals(session.getId()) || tokenHash.g= et(lockData.getTokenHash()) !=3D null); + return (SystemIdentity.SYSTEM.equals(sessionID) || tokenHash.get(loc= kData.getTokenHash()) !=3D null); } = /** @@ -392,7 +391,35 @@ */ public void onCloseSession(ExtendedSession session) { - // TODO: remove session scoped locks + // the logic as it was before, if session holds token for lock, and = lock is open scoped - remove it. = + List lockDatas; + try + { + lockDatas =3D sessionDataManager.getLocksData(); + } + catch (RepositoryException e) + { + // exception getting list of locks, return. + log.error(e.getMessage(), e); + return; + } + // list acquired, traversing to cleanup; + for (LockData lockData : lockDatas) + { + if (lockData.isSessionScoped() && isLockHolder(lockData)) + { + NodeData node; + try + { + node =3D (NodeData)sessionDataManager.getItemData(lockData.= getNodeIdentifier()); + unlock(node); + } + catch (RepositoryException e) + { + log.error("Can't unlock node:" + lockData.getNodeIdentifier= (), e); + } + } + } } = } Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/core/lock/TestLockImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestLockImpl.java 2009-11-18 11:18:07 UTC (rev 74= 6) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestLockImpl.java 2009-11-18 11:28:16 UTC (rev 74= 7) @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.core.lock; - -import org.exoplatform.services.jcr.JcrImplBaseTest; -import org.exoplatform.services.jcr.core.ExtendedNode; -import org.exoplatform.services.jcr.impl.core.NodeImpl; - -import javax.jcr.RepositoryException; - -/** - * @author Sergey Kabashn= yuk - * @version $Id$ - */ -public class TestLockImpl extends JcrImplBaseTest -{ - private ExtendedNode lockedNode =3D null; - - private static final long LOCK_TIMEOUT =3D 5; // sec - - //private static final long LOCK_REMOVER_WAIT =3D LockRemover.DEFAULT_T= HREAD_TIMEOUT + (LOCK_TIMEOUT + 1) * 1000; // 15 - private static final long LOCK_REMOVER_WAIT =3D (LOCK_TIMEOUT + 30) * 1= 000; // - - // sec - - public void setUp() throws Exception - { - - super.setUp(); - - if (lockedNode =3D=3D null) - try - { - lockedNode =3D (ExtendedNode)root.addNode("locked node"); - if (lockedNode.canAddMixin("mix:lockable")) - lockedNode.addMixin("mix:lockable"); - root.save(); - } - catch (RepositoryException e) - { - fail("Child node must be accessible and readable. But error oc= curs: " + e); - } - } - - public void testNonSessionScopedLockRemoveOnTimeOut() - { - try - { - LockImpl lock =3D (LockImpl)lockedNode.lock(true, false); - - assertTrue(lockedNode.isLocked()); - lock.setTimeOut(LOCK_TIMEOUT);// 5 sec - if (log.isDebugEnabled()) - log.debug("Stoping thread. Wait for removing lock for node " - + ((NodeImpl)lockedNode).getData().getIdentifier() + "by Lo= ckRemover"); - Thread.sleep(LOCK_REMOVER_WAIT); - assertFalse(lockedNode.isLocked()); - - } - catch (RepositoryException e) - { - fail(e.getLocalizedMessage()); - } - catch (InterruptedException e) - { - fail(e.getLocalizedMessage()); - } - } - - public void testSessionScopedLockRemoveOnTimeOut() - { - try - { - LockImpl lock =3D (LockImpl)lockedNode.lock(true, true); - assertTrue(lockedNode.isLocked()); - lock.setTimeOut(LOCK_TIMEOUT); // sec - if (log.isDebugEnabled()) - log.debug("Stoping thread. Wait for removing lock by LockRemov= er"); - Thread.sleep(LOCK_REMOVER_WAIT); - assertTrue(lockedNode.isLocked()); - lockedNode.unlock(); - } - catch (RepositoryException e) - { - fail(e.getLocalizedMessage()); - } - catch (InterruptedException e) - { - fail(e.getLocalizedMessage()); - } - } - -} --===============4515110116736732938==-- From do-not-reply at jboss.org Wed Nov 18 06:54:25 2009 Content-Type: multipart/mixed; boundary="===============6705967526940716916==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r748 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/lock. Date: Wed, 18 Nov 2009 06:54:25 -0500 Message-ID: <200911181154.nAIBsPmt024101@svn01.web.mwc.hst.phx2.redhat.com> --===============6705967526940716916== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 06:54:25 -0500 (Wed, 18 Nov 2009) New Revision: 748 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockData.java Log: EXOJCR-243: Updated LockData to be Externalizable. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-18 11:28:16 UTC (rev 747) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-18 11:54:25 UTC (rev 748) @@ -18,6 +18,13 @@ */ package org.exoplatform.services.jcr.impl.core.lock; = +import org.exoplatform.services.jcr.impl.Constants; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; + /** * Created by The eXo Platform SAS. * = @@ -25,7 +32,7 @@ * @version $Id$ */ = -public class LockData +public class LockData implements Externalizable { /** * The time of birth. From this time we start count the time of death. = death =3D birthday+TIME_OUT; @@ -36,14 +43,9 @@ * If isDeep is true then the lock applies to this node and all its des= cendant nodes; if false, * the lock applies only to this, the holding node. */ - private final boolean deep; + private boolean deep; = /** - * = - */ - private boolean live; - - /** * A lock token is a string that uniquely identifies a particular lock = and acts as a =E2=80=9Ckey=E2=80=9D * allowing a user to alter a locked node. LockData stores only token h= ash. */ @@ -65,7 +67,7 @@ * expire until explicitly unlocked or automatically unlocked due to a = implementation-specific * limitation, such as a timeout. */ - private final boolean sessionScoped; + private boolean sessionScoped; = /** * 8.4.9 Timing Out An implementation may unlock any lock at any= time due to @@ -73,6 +75,13 @@ */ private long timeOut; = + // Need for Externalizable + public LockData() + { + this.sessionScoped =3D false; + this.deep =3D false; + } + /** * @param nodeIdentifier * @param lockToken @@ -90,7 +99,6 @@ this.sessionScoped =3D sessionScoped; this.owner =3D owner; this.timeOut =3D timeOut; - this.live =3D true; this.birthday =3D System.currentTimeMillis() / 1000; } = @@ -172,4 +180,58 @@ return timeOut; } = + /** + * @see java.io.Externalizable#readExternal(java.io.ObjectInput) + */ + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + // read boolean + this.deep =3D in.readBoolean(); + this.sessionScoped =3D in.readBoolean(); + // read long + this.birthday =3D in.readLong(); + this.timeOut =3D in.readLong(); + //read strings + // read uuid + byte[] buf; + buf =3D new byte[in.readInt()]; + in.readFully(buf); + this.nodeIdentifier =3D new String(buf, Constants.DEFAULT_ENCODING); + // read uuid + buf =3D new byte[in.readInt()]; + in.readFully(buf); + this.owner =3D new String(buf, Constants.DEFAULT_ENCODING); + // read uuid + buf =3D new byte[in.readInt()]; + in.readFully(buf); + this.tokenHash =3D new String(buf, Constants.DEFAULT_ENCODING); + } + + /** + * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) + */ + public void writeExternal(ObjectOutput out) throws IOException + { + // write boolean + out.writeBoolean(deep); + out.writeBoolean(sessionScoped); + // write long + out.writeLong(birthday); + out.writeLong(timeOut); + // write string + // node uuid + byte[] ptbuf =3D nodeIdentifier.getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(ptbuf.length); + out.write(ptbuf); + // node uuid + ptbuf =3D owner.getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(ptbuf.length); + out.write(ptbuf); + // node uuid + ptbuf =3D tokenHash.getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(ptbuf.length); + out.write(ptbuf); + + } + } --===============6705967526940716916==-- From do-not-reply at jboss.org Wed Nov 18 07:08:02 2009 Content-Type: multipart/mixed; boundary="===============7553368040571702287==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r749 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jdbc and 2 other directories. Date: Wed, 18 Nov 2009 07:08:02 -0500 Message-ID: <200911181208.nAIC827T026320@svn01.web.mwc.hst.phx2.redhat.com> --===============7553368040571702287== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-18 07:08:01 -0500 (Wed, 18 Nov 2009) New Revision: 749 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCStorageConnectionTest.java Log: EXOJCR-247: getters optimization Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 11:54:25= UTC (rev 748) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 12:08:01= UTC (rev 749) @@ -128,7 +128,7 @@ break; case REMOVE_NODE : = - doRemove(m, (JDBCStorageConnection) conn); + doRemove(m, (JDBCStorageConnection)conn); = break; case MOVE : @@ -185,11 +185,11 @@ * @throws RepositoryException */ private void doRemove(Modification modification, JDBCStorageConnection = conn) throws IllegalStateException, - RepositoryException + RepositoryException { if (modification.getFqn().size() =3D=3D 2) { - String identifier =3D (String) modification.getFqn().get(1); + String identifier =3D (String)modification.getFqn().get(1); = if (modification.getFqn().get(0).equals(JBossCacheStorage.NODES)) { @@ -262,7 +262,7 @@ = Map attrs; = - JDBCStorageConnection conn =3D (JDBCStorageConnection) dataContainer= .openConnection(); + JDBCStorageConnection conn =3D (JDBCStorageConnection)dataContainer.= openConnection(); try { = @@ -277,7 +277,7 @@ NodeData nodeData =3D (NodeData)conn.getItemData(nodeId); if (nodeData !=3D null) { - // TODO use dedicated select, not child datas + // TODO get child props info List childProps =3D conn.getChildPr= operties(nodeId); if (childProps.size() <=3D 0) { @@ -300,29 +300,19 @@ // /$NODES// else if (name.size() =3D=3D 3) { - QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); + String childNodeName =3D name.getLastElementAsString(); String parentId =3D (String)name.get(1); = - // TODO use non-data method, check ACL creation - NodeData parentData =3D (NodeData)conn.getItemData(paren= tId); - if (parentData !=3D null) + String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName); + if (nodeId !=3D null) { - NodeData nodeData =3D (NodeData)conn.getItemData(pare= ntData, childNodeName); - if (nodeData !=3D null) - { - attrs =3D new LinkedHashMap(); - attrs.put(JBossCacheStorage.ITEM_ID, nodeData.getI= dentifier()); - } - else - { - throw new JDBCCacheLoaderException("FATAL Child No= de data not found " - + parentData.getQPath().getAsString() + childNo= deName.getAsString(true) + " for '" + name - + "'"); - } + attrs =3D new LinkedHashMap(); + attrs.put(JBossCacheStorage.ITEM_ID, nodeId); } else { - throw new JDBCCacheLoaderException("FATAL Parent not = found " + parentId + " for '" + name + "'"); + throw new JDBCCacheLoaderException("FATAL Child Node = data not found, parent " + nodeId + " child " + + childNodeName + " for '" + name + "'"); } } else @@ -386,10 +376,10 @@ public boolean exists(Fqn name) throws Exception { // TODO Will be created specialization code to checking exist node o= r property in DB without getting NodeData or PropertyData from DB. - JDBCStorageConnection conn =3D (JDBCStorageConnection) dataContainer= .openConnection(); - = + JDBCStorageConnection conn =3D (JDBCStorageConnection)dataContainer.= openConnection(); + boolean exists; - = + try { if (name.size() > 1) @@ -400,11 +390,11 @@ if (name.size() =3D=3D 2) { String nodeId =3D name.getLastElementAsString(); - String nodeName =3D "" /* =3D conn.getNodeName(nodeId)*/; - = + String nodeName =3D conn.getItemName(nodeId); + if (nodeName !=3D null) { - exists =3D true; = + exists =3D true; } else { @@ -414,10 +404,10 @@ // /$NODES// else if (name.size() =3D=3D 3) { - QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); + String childNodeName =3D name.getLastElementAsString(); String parentId =3D (String)name.get(1); = - String nodeId =3D "" /* =3D conn.getIdentifier(parentId,= childNodeName)*/; + String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName); if (nodeId !=3D null) { exists =3D true; @@ -439,11 +429,11 @@ if (name.size() =3D=3D 2) { String propertyId =3D name.getLastElementAsString(); - String propertyName =3D "" /* =3D conn.getPropertyName(n= odeId)*/; - = + String propertyName =3D conn.getItemName(propertyId); + if (propertyName !=3D null) { - exists =3D true; = + exists =3D true; } else { @@ -494,25 +484,16 @@ // /$NODES/ if (name.size() =3D=3D 2) { - JDBCStorageConnection conn =3D (JDBCStorageConnection) dataContai= ner.openConnection(); + JDBCStorageConnection conn =3D (JDBCStorageConnection)dataContain= er.openConnection(); try { String nodeId =3D (String)name.get(1); - NodeData parentData =3D (NodeData)conn.getItemData(nodeId); - if (parentData !=3D null) + childs =3D new LinkedHashSet(); + = + for (String nodeName : conn.getChildNodeNames(nodeId)) { - childs =3D new LinkedHashSet(); - // TODO get child nodes by parent Id, we need only id and n= ame - for (NodeData node : conn.getChildNodesData(parentData)) - { - childs.add(node.getQPath().getEntries()[node.getQPath().= getEntries().length - 1].getAsString(true)); - } + childs.add(nodeName); } - else - { - // TODO by JBC API we can just retur null, but it will not = be normal for this loader contract = - throw new JDBCCacheLoaderException("FATAL Parent not found = " + nodeId + " '" + name + "'"); - } } finally { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-18 11:54:25 UTC (rev = 748) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-18 12:08:01 UTC (rev = 749) @@ -136,6 +136,16 @@ * FIND_PROPERTIES_IDNAME_BY_PARENTID. */ protected String FIND_PROPERTIES_IDNAME_BY_PARENTID; + = + /** + * FIND_ITEM_IDENTIFIER. + */ + protected String FIND_ITEM_IDENTIFIER; + = + /** + * FIND_ITEM_NAME. + */ + protected String FIND_ITEM_NAME; = /** * INSERT_NODE. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 11:54:25= UTC (rev 748) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 12:08:01= UTC (rev 749) @@ -1957,7 +1957,7 @@ * @throws RepositoryException * if some exception occured * @throws IllegalStateException - * if connection is closed + * if connection closed */ public void deleteProperty(String identifier) throws RepositoryExceptio= n, UnsupportedOperationException, InvalidItemStateException, IllegalStateException @@ -1997,10 +1997,62 @@ } } = + /** + * Find Item ID in database. + * + * @param parentId parent Node id + * @param name Item name + * @return String with ID + * @throws RepositoryException if database error occurs + * @throws IllegalStateException if connection closed + */ public String getItemIdentifier(String parentId, String name) throws Re= positoryException, IllegalStateException { + checkIfOpened(); + = + try + { + ResultSet item =3D findItemIdentifier(getInternalId(parentId), na= me); + if (item.next()) + { + return item.getString(COLUMN_ID); + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + = + return null; + } = - return null; // TODO + /** + * Find Item name in database. + * + * @param propertyId String + * @return String with name + * @throws RepositoryException if database error occurs + * @throws IllegalStateException if connection closed + */ + public String getItemName(String propertyId) throws RepositoryException= , IllegalStateException + { + + checkIfOpened(); + = + try + { + ResultSet item =3D findItemName(getInternalId(propertyId)); + if (item.next()) + { + return item.getString(COLUMN_NAME); + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + = + return null; } = /** @@ -2009,7 +2061,7 @@ * @param parentId parent Node id. * @return List of PropertyDataInfo * @throws RepositoryException if error - * @throws IllegalStateException if the parent in illegal state + * @throws IllegalStateException if connection closed */ public List getChildProperties(String parentId) throw= s RepositoryException, IllegalStateException { @@ -2134,4 +2186,11 @@ = @Deprecated protected abstract ResultSet findValueByPropertyIdOrderNumber(String ci= d, int orderNumb) throws SQLException; + + // JBC related + + protected abstract ResultSet findItemIdentifier(String parentCid, Strin= g name) throws SQLException; + + protected abstract ResultSet findItemName(String cid) throws SQLExcepti= on; + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 11:54= :25 UTC (rev 748) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 12:08= :01 UTC (rev 749) @@ -79,9 +79,13 @@ protected PreparedStatement findNodesByParentId; = protected PreparedStatement findPropertiesByParentId; - = + protected PreparedStatement findPropertiesIdNameByParentId; = + protected PreparedStatement findItemIdentifier; + + protected PreparedStatement findItemName; + protected PreparedStatement insertNode; = protected PreparedStatement insertProperty; @@ -189,8 +193,12 @@ FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where I_CLA= SS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; + + FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_MIT= EM" + " where I_CLASS=3D2 and PARENT_ID=3D?"; = - FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_MIT= EM" + " where I_CLASS=3D2 and PARENT_ID=3D?"; + FIND_ITEM_IDENTIFIER =3D "select ID from JCR_MITEM" + " where PARENT= _ID=3D? and NAME=3D?"; + = + FIND_ITEM_NAME =3D "select NAME from JCR_MITEM" + " where ID=3D?"; = INSERT_NODE =3D "insert into JCR_MITEM(ID, PARENT_ID, NAME, VERSION, I_CLASS, I_I= NDEX, N_ORDER_NUM) VALUES(?,?,?,?," @@ -564,4 +572,35 @@ findValuesStorageDescriptorsByPropertyId.setString(1, cid); return findValuesStorageDescriptorsByPropertyId.executeQuery(); } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findItemIdentifier(String parentCid, String name) t= hrows SQLException + { + if (findItemIdentifier =3D=3D null) + findItemIdentifier =3D dbConnection.prepareStatement(FIND_ITEM_ID= ENTIFIER); + else + findItemIdentifier.clearParameters(); + + findItemIdentifier.setString(1, parentCid); + findItemIdentifier.setString(2, name); + return findItemIdentifier.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findItemName(String cid) throws SQLException + { + if (findItemName =3D=3D null) + findItemName =3D dbConnection.prepareStatement(FIND_ITEM_NAME); + else + findItemName.clearParameters(); + + findItemName.setString(1, cid); + return findItemName.executeQuery(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 11:5= 4:25 UTC (rev 748) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 12:0= 8:01 UTC (rev 749) @@ -76,9 +76,13 @@ protected PreparedStatement findNodesByParentId; = protected PreparedStatement findPropertiesByParentId; - = + protected PreparedStatement findPropertiesIdNameByParentId; = + protected PreparedStatement findItemIdentifier; + + protected PreparedStatement findItemName; + protected PreparedStatement insertItem; = protected PreparedStatement insertNode; @@ -201,6 +205,10 @@ FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_SITEM" + " where I_CLASS=3D2 and CONTAI= NER_NAME=3D? and PARENT_ID=3D?"; = + FIND_ITEM_IDENTIFIER =3D "select ID from JCR_SITEM" + " where CONTAI= NER_NAME=3D? and PARENT_ID=3D? and NAME=3D?"; + + FIND_ITEM_NAME =3D "select NAME from JCR_SITEM" + " where ID=3D?"; + INSERT_NODE =3D "insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSI= ON, I_CLASS, I_INDEX, N_ORDER_NUM) VALUES(?,?,?,?,?," + I_CLASS_NODE + ",?,?)"; @@ -355,7 +363,7 @@ findPropertiesByParentId.setString(2, parentCid); return findPropertiesByParentId.executeQuery(); } - = + /** * {@inheritDoc} */ @@ -583,4 +591,36 @@ renameNode.setString(6, getInternalId(data.getIdentifier())); return renameNode.executeUpdate(); } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findItemIdentifier(String parentCid, String name) t= hrows SQLException + { + if (findItemIdentifier =3D=3D null) + findItemIdentifier =3D dbConnection.prepareStatement(FIND_ITEM_ID= ENTIFIER); + else + findItemIdentifier.clearParameters(); + + findItemIdentifier.setString(1, containerName); + findItemIdentifier.setString(2, parentCid); + findItemIdentifier.setString(3, name); + return findItemIdentifier.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findItemName(String cid) throws SQLException + { + if (findItemName =3D=3D null) + findItemName =3D dbConnection.prepareStatement(FIND_ITEM_NAME); + else + findItemName.clearParameters(); + + findItemName.setString(1, cid); + return findItemName.executeQuery(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCStorageConnectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-18 11:54:25 = UTC (rev 748) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-18 12:08:01 = UTC (rev 749) @@ -289,7 +289,7 @@ connection.deleteNode(troot.getIdentifier()); connection.commit(); = - //check + // check assertNull(dataManager.getItemData(troot.getIdentifier())); assertNull(dataManager.getItemData(pt.getIdentifier())); } --===============7553368040571702287==-- From do-not-reply at jboss.org Wed Nov 18 08:59:56 2009 Content-Type: multipart/mixed; boundary="===============8318384333818657226==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r750 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 18 Nov 2009 08:59:56 -0500 Message-ID: <200911181359.nAIDxugK016764@svn01.web.mwc.hst.phx2.redhat.com> --===============8318384333818657226== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 08:59:56 -0500 (Wed, 18 Nov 2009) New Revision: 750 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-242: added locking tests for JBossCacheStorageConnection. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-18 12:08:01 UTC (rev 749) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-18 13:59:56 UTC (rev 750) @@ -27,6 +27,7 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; @@ -40,6 +41,8 @@ import java.io.UnsupportedEncodingException; import java.util.List; = +import javax.jcr.lock.LockException; + /** * Created by The eXo Platform SAS. * = @@ -773,4 +776,73 @@ = } = + public void testAddLock() throws Exception + { + // ordinary add lock + LockData lockData =3D new LockData("testAddLock", "token's hash", tr= ue, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testAddLock"= ).getTokenHash()); + } + + public void testAddLockTwice() throws Exception + { + // ordinary add lock + { + LockData lockData =3D new LockData("testAddLockTwice", "token's h= ash", true, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testAddLo= ckTwice").getTokenHash()); + } + // try to lock once more + try + { + // add lock to the same node twice + LockData lockData =3D new LockData("testAddLockTwice", "other tok= en's hash", true, true, "owner", 1000); + conn.addLockData(lockData); + fail("exception expected, because can't lock node twice"); + } + catch (LockException e) + { + } + } + + public void testRefreshLock() throws Exception + { + // ordinary add lock + { + LockData lockData =3D new LockData("testRefreshLock", "token's ha= sh", true, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testRefre= shLock").getTokenHash()); + } + // try to refresh lock (updates creation time to extend lifetime) + // refresh is performed by writing new lock data (only difference is= changed creation time) + { + LockData lockData =3D new LockData("testRefreshLock", "token's ha= sh", true, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testRefre= shLock").getTokenHash()); + } + } + + public void testGetLocks() throws Exception + { + // clean up any existing + List locks =3D conn.getLocksData(); + for (LockData lock : locks) + { + conn.removeLockData(lock.getNodeIdentifier()); + } + // check empty + locks =3D conn.getLocksData(); + assertEquals(0, locks.size()); + // fill + int count =3D 3; + for (int i =3D 0; i < count; i++) + { + LockData lockData =3D new LockData("testGetLocks" + i, "token's h= ash " + i, true, true, "owner", 1000); + conn.addLockData(lockData); + } + // assert + locks =3D conn.getLocksData(); + assertEquals(count, locks.size()); + } + } --===============8318384333818657226==-- From do-not-reply at jboss.org Wed Nov 18 09:10:56 2009 Content-Type: multipart/mixed; boundary="===============3412101852556112837==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r751 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc and 1 other directories. Date: Wed, 18 Nov 2009 09:10:56 -0500 Message-ID: <200911181410.nAIEAu9X019351@svn01.web.mwc.hst.phx2.redhat.com> --===============3412101852556112837== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-18 09:10:55 -0500 (Wed, 18 Nov 2009) New Revision: 751 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-248: get childs optimization Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 13:59:56= UTC (rev 750) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 14:10:55= UTC (rev 751) @@ -277,7 +277,6 @@ NodeData nodeData =3D (NodeData)conn.getItemData(nodeId); if (nodeData !=3D null) { - // TODO get child props info List childProps =3D conn.getChildPr= operties(nodeId); if (childProps.size() <=3D 0) { @@ -375,7 +374,6 @@ */ public boolean exists(Fqn name) throws Exception { - // TODO Will be created specialization code to checking exist node o= r property in DB without getting NodeData or PropertyData from DB. JDBCStorageConnection conn =3D (JDBCStorageConnection)dataContainer.= openConnection(); = boolean exists; @@ -479,55 +477,48 @@ { // return child nodes names = - Set childs; - - // /$NODES/ - if (name.size() =3D=3D 2) + JDBCStorageConnection conn =3D (JDBCStorageConnection)dataContainer.= openConnection(); + try { - JDBCStorageConnection conn =3D (JDBCStorageConnection)dataContain= er.openConnection(); - try + // /$NODES/ + if (name.size() =3D=3D 2) { String nodeId =3D (String)name.get(1); - childs =3D new LinkedHashSet(); + return conn.getChildNodeNames(nodeId); + } + else if (name.equals(JBossCacheStorage.NODES)) + { + // TODO return all Nodes in workspace + return new LinkedHashSet(); = - for (String nodeName : conn.getChildNodeNames(nodeId)) - { - childs.add(nodeName); - } } - finally + else if (name.equals(JBossCacheStorage.PROPS)) { - conn.close(); + // TODO return all Properties in workspace + return new LinkedHashSet(); } + else if (name.equals(JBossCacheStorage.LOCKS)) + { + // TODO return all Locks in workspace + return new LinkedHashSet(); + } + else if (name.equals(Fqn.ROOT)) + { + Set childs =3D new LinkedHashSet(); + childs.add(JBossCacheStorage.NODES); + childs.add(JBossCacheStorage.PROPS); + childs.add(JBossCacheStorage.LOCKS); + return childs; + } + else + { + return null; + } } - else if (name.equals(JBossCacheStorage.NODES)) + finally { - // TODO return all Nodes in workspace - childs =3D new LinkedHashSet(); + conn.close(); } - else if (name.equals(JBossCacheStorage.PROPS)) - { - // TODO return all Properties in workspace - childs =3D new LinkedHashSet(); - } - else if (name.equals(JBossCacheStorage.LOCKS)) - { - // TODO return all Locks in workspace - childs =3D new LinkedHashSet(); - } - else if (name.equals(Fqn.ROOT)) - { - childs =3D new LinkedHashSet(); - childs.add(JBossCacheStorage.NODES); - childs.add(JBossCacheStorage.PROPS); - childs.add(JBossCacheStorage.LOCKS); - } - else - { - childs =3D null; - } - - return childs; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-18 13:59:56 UTC (rev = 750) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-18 14:10:55 UTC (rev = 751) @@ -126,6 +126,11 @@ * FIND_NODES_BY_PARENTID. */ protected String FIND_NODES_BY_PARENTID; + = + /** + * FIND_NODES_NAME_BY_PARENTID. + */ + protected String FIND_NODES_NAME_BY_PARENTID; = /** * FIND_PROPERTIES_BY_PARENTID. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 13:59:56= UTC (rev 750) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 14:10:55= UTC (rev 751) @@ -58,7 +58,9 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.LinkedHashSet; import java.util.List; +import java.util.Set; import java.util.StringTokenizer; = import javax.jcr.InvalidItemStateException; @@ -2009,7 +2011,7 @@ public String getItemIdentifier(String parentId, String name) throws Re= positoryException, IllegalStateException { checkIfOpened(); - = + try { ResultSet item =3D findItemIdentifier(getInternalId(parentId), na= me); @@ -2022,7 +2024,7 @@ { throw new RepositoryException(e); } - = + return null; } = @@ -2038,7 +2040,7 @@ { = checkIfOpened(); - = + try { ResultSet item =3D findItemName(getInternalId(propertyId)); @@ -2051,7 +2053,7 @@ { throw new RepositoryException(e); } - = + return null; } = @@ -2086,15 +2088,31 @@ } } = - public List getChildNodeNames(String parentId) throws Repositor= yException, IllegalStateException + /** + * Get child nodes names set. + * + * @param parentId parent Node id. + * @return Set of String (id) + * @throws RepositoryException if error + * @throws IllegalStateException if connection closed + */ + public Set getChildNodeNames(String parentId) throws Repository= Exception, IllegalStateException { checkIfOpened(); + try { - ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= (parentId)); - List childrens =3D new ArrayList(); - //while (node.next()) - //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); + ResultSet node =3D findChildNodesNameByParentIdentifier(getIntern= alId(parentId)); + Set childrens =3D new LinkedHashSet(); + while (node.next()) + { + String childName =3D node.getString(COLUMN_NAME); + if (!childrens.add(childName)) + { + throw new RepositoryException("FATAL Child node name dublic= ated '" + childName + "' on parent " + + parentId); + } + } = return childrens; } @@ -2104,13 +2122,13 @@ } } = - public List getAllPropertyIdentifiers() throws RepositoryExcept= ion, IllegalStateException + public Set getAllPropertyIdentifiers() throws RepositoryExcepti= on, IllegalStateException { checkIfOpened(); try { ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); - List childrens =3D new ArrayList(); + Set childrens =3D new LinkedHashSet(); //while (node.next()) //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); = @@ -2122,13 +2140,13 @@ } } = - public List getAllNodeIdentifiers() throws RepositoryException,= IllegalStateException + public Set getAllNodeIdentifiers() throws RepositoryException, = IllegalStateException { checkIfOpened(); try { ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); - List childrens =3D new ArrayList(); + Set childrens =3D new LinkedHashSet(); //while (node.next()) //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); = @@ -2156,9 +2174,6 @@ = protected abstract ResultSet findChildPropertiesByParentIdentifier(Stri= ng parentIdentifier) throws SQLException; = - protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentIdentifier) - throws SQLException; - protected abstract int addReference(PropertyData data) throws SQLExcept= ion, IOException; = protected abstract int renameNode(NodeData data) throws SQLException; @@ -2189,6 +2204,11 @@ = // JBC related = + protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentIdentifier) + throws SQLException; + + protected abstract ResultSet findChildNodesNameByParentIdentifier(Strin= g parentIdentifier) throws SQLException; + protected abstract ResultSet findItemIdentifier(String parentCid, Strin= g name) throws SQLException; = protected abstract ResultSet findItemName(String cid) throws SQLExcepti= on; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 13:59= :56 UTC (rev 750) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 14:10= :55 UTC (rev 751) @@ -78,6 +78,8 @@ = protected PreparedStatement findNodesByParentId; = + protected PreparedStatement findNodesNameByParentId; + protected PreparedStatement findPropertiesByParentId; = protected PreparedStatement findPropertiesIdNameByParentId; @@ -192,12 +194,14 @@ = FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where I_CLA= SS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = + FIND_NODES_NAME_BY_PARENTID =3D "select NAME from JCR_MITEM" + " whe= re I_CLASS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; + = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; = FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_MIT= EM" + " where I_CLASS=3D2 and PARENT_ID=3D?"; - = + FIND_ITEM_IDENTIFIER =3D "select ID from JCR_MITEM" + " where PARENT= _ID=3D? and NAME=3D?"; - = + FIND_ITEM_NAME =3D "select NAME from JCR_MITEM" + " where ID=3D?"; = INSERT_NODE =3D @@ -451,17 +455,6 @@ return findPropertiesByParentId.executeQuery(); } = - protected ResultSet findChildPropertiesIdNameByParentIdentifier(String = parentIdentifier) throws SQLException - { - if (findPropertiesIdNameByParentId =3D=3D null) - findPropertiesIdNameByParentId =3D dbConnection.prepareStatement(= FIND_PROPERTIES_IDNAME_BY_PARENTID); - else - findPropertiesIdNameByParentId.clearParameters(); - - findPropertiesIdNameByParentId.setString(1, parentIdentifier); - return findPropertiesIdNameByParentId.executeQuery(); - } - // -------- values processing ------------ = /** @@ -577,13 +570,34 @@ * {@inheritDoc} */ @Override + protected ResultSet findChildPropertiesIdNameByParentIdentifier(String = parentIdentifier) throws SQLException + { + if (findPropertiesIdNameByParentId =3D=3D null) + { + findPropertiesIdNameByParentId =3D dbConnection.prepareStatement(= FIND_PROPERTIES_IDNAME_BY_PARENTID); + } + else + { + findPropertiesIdNameByParentId.clearParameters(); + } + findPropertiesIdNameByParentId.setString(1, parentIdentifier); + return findPropertiesIdNameByParentId.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override protected ResultSet findItemIdentifier(String parentCid, String name) t= hrows SQLException { if (findItemIdentifier =3D=3D null) + { findItemIdentifier =3D dbConnection.prepareStatement(FIND_ITEM_ID= ENTIFIER); + } else + { findItemIdentifier.clearParameters(); - + } findItemIdentifier.setString(1, parentCid); findItemIdentifier.setString(2, name); return findItemIdentifier.executeQuery(); @@ -596,11 +610,32 @@ protected ResultSet findItemName(String cid) throws SQLException { if (findItemName =3D=3D null) + { findItemName =3D dbConnection.prepareStatement(FIND_ITEM_NAME); + } else + { findItemName.clearParameters(); - + } findItemName.setString(1, cid); return findItemName.executeQuery(); } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findChildNodesNameByParentIdentifier(String parentI= dentifier) throws SQLException + { + if (findNodesNameByParentId =3D=3D null) + { + findNodesNameByParentId =3D dbConnection.prepareStatement(FIND_NO= DES_NAME_BY_PARENTID); + } + else + { + findNodesNameByParentId.clearParameters(); + } + findNodesNameByParentId.setString(1, parentIdentifier); + return findNodesNameByParentId.executeQuery(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 13:5= 9:56 UTC (rev 750) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 14:1= 0:55 UTC (rev 751) @@ -75,6 +75,8 @@ = protected PreparedStatement findNodesByParentId; = + protected PreparedStatement findNodesNameByParentId; + protected PreparedStatement findPropertiesByParentId; = protected PreparedStatement findPropertiesIdNameByParentId; @@ -199,6 +201,9 @@ FIND_NODES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = + FIND_NODES_NAME_BY_PARENTID =3D + "select NAME from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_= NAME=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; + FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by ID"; = @@ -623,4 +628,22 @@ findItemName.setString(1, cid); return findItemName.executeQuery(); } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findChildNodesNameByParentIdentifier(String parentI= dentifier) throws SQLException + { + if (findNodesNameByParentId =3D=3D null) + { + findNodesNameByParentId =3D dbConnection.prepareStatement(FIND_NO= DES_NAME_BY_PARENTID); + } + else + { + findNodesNameByParentId.clearParameters(); + } + findNodesNameByParentId.setString(1, parentIdentifier); + return findNodesNameByParentId.executeQuery(); + } } --===============3412101852556112837==-- From do-not-reply at jboss.org Wed Nov 18 09:15:31 2009 Content-Type: multipart/mixed; boundary="===============1020209012485892960==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r752 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directory. Date: Wed, 18 Nov 2009 09:15:31 -0500 Message-ID: <200911181415.nAIEFVIf020294@svn01.web.mwc.hst.phx2.redhat.com> --===============1020209012485892960== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-18 09:15:30 -0500 (Wed, 18 Nov 2009) New Revision: 752 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-248: get childs optimization (HSQLDB tunning) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 14:10:55= UTC (rev 751) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 14:15:30= UTC (rev 752) @@ -2204,10 +2204,10 @@ = // JBC related = - protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentIdentifier) + protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentCid) throws SQLException; = - protected abstract ResultSet findChildNodesNameByParentIdentifier(Strin= g parentIdentifier) throws SQLException; + protected abstract ResultSet findChildNodesNameByParentIdentifier(Strin= g parentCid) throws SQLException; = protected abstract ResultSet findItemIdentifier(String parentCid, Strin= g name) throws SQLException; = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-18= 14:10:55 UTC (rev 751) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-18= 14:15:30 UTC (rev 752) @@ -74,6 +74,9 @@ "select V.DATA" + " from JCR_MITEM I, JCR_MVALUE V" + " where I.PARENT_ID=3D? and I.I_CLASS=3D2 and I.NAME=3D? and= I.ID=3DV.PROPERTY_ID order by V.ORDER_NUM"; FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where PAREN= T_ID=3D? and I_CLASS=3D1" + " order by N_ORDER_NUM"; + = + FIND_NODES_NAME_BY_PARENTID =3D "select NAME from JCR_MITEM" + " whe= re PARENT_ID=3D? and I_CLASS=3D1" + " order by N_ORDER_NUM"; + = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = PARENT_ID=3D? and I_CLASS=3D2" + " order by ID"; } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 8 14:10:55 UTC (rev 751) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 8 14:15:30 UTC (rev 752) @@ -81,6 +81,10 @@ + " where I.PARENT_ID=3D? and I.I_CLASS=3D2 and I.CONTAINER_NA= ME=3D? and I.NAME=3D? and I.ID=3DV.PROPERTY_ID order by V.ORDER_NUM"; FIND_NODES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D1= and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; + = + FIND_NODES_NAME_BY_PARENTID =3D + "select NAME from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS= =3D1 and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; + = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D2= and CONTAINER_NAME=3D?" + " order by ID"; FIND_PROPERTIES_IDNAME_BY_PARENTID =3D @@ -169,4 +173,23 @@ findPropertiesIdNameByParentId.setString(2, containerName); return findPropertiesIdNameByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findChildNodesNameByParentIdentifier(String parentC= id) throws SQLException + { + if (findNodesNameByParentId =3D=3D null) + { + findNodesNameByParentId =3D dbConnection.prepareStatement(FIND_NO= DES_NAME_BY_PARENTID); + } + else + { + findNodesNameByParentId.clearParameters(); + } + findNodesNameByParentId.setString(1, parentCid); + findNodesNameByParentId.setString(2, containerName); + return findNodesNameByParentId.executeQuery(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 14:1= 0:55 UTC (rev 751) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 14:1= 5:30 UTC (rev 752) @@ -633,7 +633,7 @@ * {@inheritDoc} */ @Override - protected ResultSet findChildNodesNameByParentIdentifier(String parentI= dentifier) throws SQLException + protected ResultSet findChildNodesNameByParentIdentifier(String parentC= id) throws SQLException { if (findNodesNameByParentId =3D=3D null) { @@ -643,7 +643,8 @@ { findNodesNameByParentId.clearParameters(); } - findNodesNameByParentId.setString(1, parentIdentifier); + findNodesNameByParentId.setString(1, containerName); + findNodesNameByParentId.setString(2, parentCid); return findNodesNameByParentId.executeQuery(); } } --===============1020209012485892960==-- From do-not-reply at jboss.org Wed Nov 18 11:03:41 2009 Content-Type: multipart/mixed; boundary="===============4526871111082716708==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r753 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc and 1 other directories. Date: Wed, 18 Nov 2009 11:03:41 -0500 Message-ID: <200911181603.nAIG3f9W003244@svn01.web.mwc.hst.phx2.redhat.com> --===============4526871111082716708== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-18 11:03:40 -0500 (Wed, 18 Nov 2009) New Revision: 753 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-248: get childs optimization Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 14:15:30= UTC (rev 752) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:03:40= UTC (rev 753) @@ -299,10 +299,10 @@ // /$NODES// else if (name.size() =3D=3D 3) { - String childNodeName =3D name.getLastElementAsString(); + QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); String parentId =3D (String)name.get(1); = - String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName); + String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName.getAsString(false), childNodeName.getIndex()); if (nodeId !=3D null) { attrs =3D new LinkedHashMap(); @@ -402,10 +402,10 @@ // /$NODES// else if (name.size() =3D=3D 3) { - String childNodeName =3D name.getLastElementAsString(); + QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); String parentId =3D (String)name.get(1); = - String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName); + String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName.getAsString(false), childNodeName.getIndex()); if (nodeId !=3D null) { exists =3D true; @@ -488,14 +488,16 @@ } else if (name.equals(JBossCacheStorage.NODES)) { - // TODO return all Nodes in workspace - return new LinkedHashSet(); - = + // TODO should never be called + LOG.warn("conn.getAllNodeIdentifiers()"); + return conn.getAllNodeIdentifiers(); + } else if (name.equals(JBossCacheStorage.PROPS)) { - // TODO return all Properties in workspace - return new LinkedHashSet(); + // TODO should never be called + LOG.warn("conn.getAllPropertyIdentifiers()"); + return conn.getAllPropertyIdentifiers(); } else if (name.equals(JBossCacheStorage.LOCKS)) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-18 14:15:30 UTC (rev = 752) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-18 16:03:40 UTC (rev = 753) @@ -151,6 +151,16 @@ * FIND_ITEM_NAME. */ protected String FIND_ITEM_NAME; + = + /** + * FIND_ALL_NODES. + */ + protected String FIND_ALL_NODES; + = + /** + * FIND_ALL_PROPERTIES. + */ + protected String FIND_ALL_PROPERTIES; = /** * INSERT_NODE. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 14:15:30= UTC (rev 752) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 16:03:40= UTC (rev 753) @@ -2002,19 +2002,20 @@ /** * Find Item ID in database. * - * @param parentId parent Node id - * @param name Item name + * @param parentId String, parent Node id + * @param name Item, name + * @param index int, path index (actual for nodes, 1 for properties) * @return String with ID * @throws RepositoryException if database error occurs * @throws IllegalStateException if connection closed */ - public String getItemIdentifier(String parentId, String name) throws Re= positoryException, IllegalStateException + public String getItemIdentifier(String parentId, String name, int index= ) throws RepositoryException, IllegalStateException { checkIfOpened(); = try { - ResultSet item =3D findItemIdentifier(getInternalId(parentId), na= me); + ResultSet item =3D findItemIdentifier(getInternalId(parentId), na= me, index); if (item.next()) { return item.getString(COLUMN_ID); @@ -2093,7 +2094,7 @@ * * @param parentId parent Node id. * @return Set of String (id) - * @throws RepositoryException if error + * @throws RepositoryException if database error occurs * @throws IllegalStateException if connection closed */ public Set getChildNodeNames(String parentId) throws Repository= Exception, IllegalStateException @@ -2122,15 +2123,30 @@ } } = + /** + * Return all Properties in workspace. + * TODO check if it used, should not! + * + * @return Set of String (id) + * @throws RepositoryException if database error occurs + * @throws IllegalStateException if connection closed + */ public Set getAllPropertyIdentifiers() throws RepositoryExcepti= on, IllegalStateException { checkIfOpened(); + try { - ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); + ResultSet node =3D findAllPropertyIdentifiers(); Set childrens =3D new LinkedHashSet(); - //while (node.next()) - //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); + while (node.next()) + { + String propId =3D node.getString(COLUMN_ID); + if (!childrens.add(propId)) + { + throw new RepositoryException("FATAL Property id dublicated= " + propId); + } + } = return childrens; } @@ -2140,15 +2156,30 @@ } } = + /** + * Return all Nodes in workspace. + * TODO check if it used, should not! + * + * @return Set of String (id) + * @throws RepositoryException if database error occurs + * @throws IllegalStateException if connection closed + */ public Set getAllNodeIdentifiers() throws RepositoryException, = IllegalStateException { checkIfOpened(); + try { - ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= ("???")); + ResultSet node =3D findAllNodeIdentifiers(); Set childrens =3D new LinkedHashSet(); - //while (node.next()) - //childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLA= SS_NODE, parent.getACL())); + while (node.next()) + { + String nodeId =3D node.getString(COLUMN_ID); + if (!childrens.add(nodeId)) + { + throw new RepositoryException("FATAL Node id dublicated " += nodeId); + } + } = return childrens; } @@ -2209,8 +2240,12 @@ = protected abstract ResultSet findChildNodesNameByParentIdentifier(Strin= g parentCid) throws SQLException; = - protected abstract ResultSet findItemIdentifier(String parentCid, Strin= g name) throws SQLException; + protected abstract ResultSet findItemIdentifier(String parentCid, Strin= g name, int index) throws SQLException; = protected abstract ResultSet findItemName(String cid) throws SQLExcepti= on; + = + protected abstract ResultSet findAllPropertyIdentifiers() throws SQLExc= eption; + = + protected abstract ResultSet findAllNodeIdentifiers() throws SQLExcepti= on; = } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 14:15= :30 UTC (rev 752) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 16:03= :40 UTC (rev 753) @@ -87,6 +87,10 @@ protected PreparedStatement findItemIdentifier; = protected PreparedStatement findItemName; + = + protected PreparedStatement findAllProperties; + = + protected PreparedStatement findAllNodes; = protected PreparedStatement insertNode; = @@ -194,13 +198,18 @@ = FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where I_CLA= SS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = - FIND_NODES_NAME_BY_PARENTID =3D "select NAME from JCR_MITEM" + " whe= re I_CLASS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; + FIND_ALL_NODES =3D "select ID from JCR_MITEM where I_CLASS=3D1"; = + FIND_NODES_NAME_BY_PARENTID =3D + "select NAME from JCR_MITEM" + " where I_CLASS=3D1 and PARENT_ID= =3D?" + " order by N_ORDER_NUM"; + FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; = FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_MIT= EM" + " where I_CLASS=3D2 and PARENT_ID=3D?"; + = + FIND_ALL_PROPERTIES =3D "select ID from JCR_MITEM where I_CLASS=3D2"; = - FIND_ITEM_IDENTIFIER =3D "select ID from JCR_MITEM" + " where PARENT= _ID=3D? and NAME=3D?"; + FIND_ITEM_IDENTIFIER =3D "select ID from JCR_MITEM" + " where PARENT= _ID=3D? and NAME=3D? and I_INDEX=3D?"; = FIND_ITEM_NAME =3D "select NAME from JCR_MITEM" + " where ID=3D?"; = @@ -588,7 +597,7 @@ * {@inheritDoc} */ @Override - protected ResultSet findItemIdentifier(String parentCid, String name) t= hrows SQLException + protected ResultSet findItemIdentifier(String parentCid, String name, i= nt index) throws SQLException { if (findItemIdentifier =3D=3D null) { @@ -600,6 +609,7 @@ } findItemIdentifier.setString(1, parentCid); findItemIdentifier.setString(2, name); + findItemIdentifier.setInt(3, index); return findItemIdentifier.executeQuery(); } = @@ -607,7 +617,7 @@ * {@inheritDoc} */ @Override - protected ResultSet findItemName(String cid) throws SQLException + protected ResultSet findItemName(String id) throws SQLException { if (findItemName =3D=3D null) { @@ -617,7 +627,7 @@ { findItemName.clearParameters(); } - findItemName.setString(1, cid); + findItemName.setString(1, id); return findItemName.executeQuery(); } = @@ -625,7 +635,7 @@ * {@inheritDoc} */ @Override - protected ResultSet findChildNodesNameByParentIdentifier(String parentI= dentifier) throws SQLException + protected ResultSet findChildNodesNameByParentIdentifier(String parentI= d) throws SQLException { if (findNodesNameByParentId =3D=3D null) { @@ -635,7 +645,41 @@ { findNodesNameByParentId.clearParameters(); } - findNodesNameByParentId.setString(1, parentIdentifier); + findNodesNameByParentId.setString(1, parentId); return findNodesNameByParentId.executeQuery(); } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findAllNodeIdentifiers() throws SQLException + { + if (findAllNodes =3D=3D null) + { + findAllNodes =3D dbConnection.prepareStatement(FIND_ALL_NODES); + } + else + { + findAllNodes.clearParameters(); + } + return findAllNodes.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findAllPropertyIdentifiers() throws SQLException + { + if (findAllProperties =3D=3D null) + { + findAllProperties =3D dbConnection.prepareStatement(FIND_ALL_PROP= ERTIES); + } + else + { + findAllProperties.clearParameters(); + } + return findAllProperties.executeQuery(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 14:1= 5:30 UTC (rev 752) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 16:0= 3:40 UTC (rev 753) @@ -85,6 +85,10 @@ = protected PreparedStatement findItemName; = + protected PreparedStatement findAllProperties; + + protected PreparedStatement findAllNodes; + protected PreparedStatement insertItem; = protected PreparedStatement insertNode; @@ -202,15 +206,20 @@ "select * from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_NODES_NAME_BY_PARENTID =3D - "select NAME from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_= NAME=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; + "select NAME from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_= NAME=3D? and PARENT_ID=3D?" + + " order by N_ORDER_NUM"; = + FIND_ALL_NODES =3D "select ID from JCR_SITEM where I_CLASS=3D1 and C= ONTAINER_NAME=3D?"; + = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by ID"; = FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_SITEM" + " where I_CLASS=3D2 and CONTAI= NER_NAME=3D? and PARENT_ID=3D?"; = - FIND_ITEM_IDENTIFIER =3D "select ID from JCR_SITEM" + " where CONTAI= NER_NAME=3D? and PARENT_ID=3D? and NAME=3D?"; + FIND_ALL_PROPERTIES =3D "select ID from JCR_SITEM where I_CLASS=3D2 = and CONTAINER_NAME=3D?"; + = + FIND_ITEM_IDENTIFIER =3D "select ID from JCR_SITEM" + " where CONTAI= NER_NAME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D?"; = FIND_ITEM_NAME =3D "select NAME from JCR_SITEM" + " where ID=3D?"; = @@ -601,7 +610,7 @@ * {@inheritDoc} */ @Override - protected ResultSet findItemIdentifier(String parentCid, String name) t= hrows SQLException + protected ResultSet findItemIdentifier(String parentCid, String name, i= nt index) throws SQLException { if (findItemIdentifier =3D=3D null) findItemIdentifier =3D dbConnection.prepareStatement(FIND_ITEM_ID= ENTIFIER); @@ -611,6 +620,7 @@ findItemIdentifier.setString(1, containerName); findItemIdentifier.setString(2, parentCid); findItemIdentifier.setString(3, name); + findItemIdentifier.setInt(4, index); return findItemIdentifier.executeQuery(); } = @@ -647,4 +657,40 @@ findNodesNameByParentId.setString(2, parentCid); return findNodesNameByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findAllNodeIdentifiers() throws SQLException + { + if (findAllNodes =3D=3D null) + { + findAllNodes =3D dbConnection.prepareStatement(FIND_ALL_NODES); + } + else + { + findAllNodes.clearParameters(); + } + findAllNodes.setString(1, containerName); + return findAllNodes.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findAllPropertyIdentifiers() throws SQLException + { + if (findAllProperties =3D=3D null) + { + findAllProperties =3D dbConnection.prepareStatement(FIND_ALL_PROP= ERTIES); + } + else + { + findAllProperties.clearParameters(); + } + findAllProperties.setString(1, containerName); + return findAllProperties.executeQuery(); + } = } --===============4526871111082716708==-- From do-not-reply at jboss.org Wed Nov 18 11:16:19 2009 Content-Type: multipart/mixed; boundary="===============4025454720489590431==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r754 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory. Date: Wed, 18 Nov 2009 11:16:19 -0500 Message-ID: <200911181616.nAIGGJsY005380@svn01.web.mwc.hst.phx2.redhat.com> --===============4025454720489590431== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 11:16:19 -0500 (Wed, 18 Nov 2009) New Revision: 754 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-242: small updates of locking code Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 16:03:40 UTC (rev 753) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-18 16:16:19 UTC (rev 754) @@ -25,7 +25,6 @@ import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; -import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockData; @@ -96,7 +95,7 @@ { for (PlainChangesLog curChangesLog : chengesLogList) { - // if this is LOCK or UNLOCK changes log, then put or remove l= ock data from cache + // if this is LOCK or UNLOCK changes log, then put or remove l= ock data to or from cache if (curChangesLog.getEventType() =3D=3D ExtendedEvent.LOCK || curChangesLog.getEventType() =3D=3D ExtendedEvent.UNLOCK) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -18 16:03:40 UTC (rev 753) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -18 16:16:19 UTC (rev 754) @@ -703,22 +703,32 @@ throw new RepositoryException("Lock data to write can't be null!"= ); } // check that there is no lock data for given node - Node oldNode =3D locksRoot.getChild(makeNodeFq= n(lockData.getNodeIdentifier())); - if (oldNode.get(JBossCacheStorage.LOCK_DATA) !=3D null) + Node node =3D locksRoot.getChild(makeNodeFqn(l= ockData.getNodeIdentifier())); + // node is not null: check if lockData exists + if (node !=3D null) { - throw new LockException("Unable to write lock data. Node [" + loc= kData.getNodeIdentifier() - + "] already has LockData!"); + LockData oldLockData =3D (LockData)node.get(JBossCacheStorage.LOC= K_DATA); + // if old data exists and hash differs, then it was newly locked!= Exception, can't lock + // already locked node. + if (oldLockData !=3D null && oldLockData.getTokenHash() !=3D lock= Data.getTokenHash()) + { + throw new LockException("Unable to write lock data. Node [" + = lockData.getNodeIdentifier() + + "] already has LockData!"); + } } + else + { + // JBoss node doesn't exists, create it + node =3D locksRoot.addChild(makeNodeFqn(lockData.getNodeIdentifie= r())); + node.setResident(true); + } // try to write LockData = - Node node =3D locksRoot.addChild(makeNodeFqn(l= ockData.getNodeIdentifier())); if (node =3D=3D null) { throw new RepositoryException("Unable to write to cache!"); } // this will prevent from deleting it by eviction. - node.setResident(true); node.put(JBossCacheStorage.LOCK_DATA, lockData); - } = /** --===============4025454720489590431==-- From do-not-reply at jboss.org Wed Nov 18 11:17:23 2009 Content-Type: multipart/mixed; boundary="===============6817394920074266867==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r755 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/core/lock and 1 other directory. Date: Wed, 18 Nov 2009 11:17:23 -0500 Message-ID: <200911181617.nAIGHNuB005502@svn01.web.mwc.hst.phx2.redhat.com> --===============6817394920074266867== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-18 11:17:22 -0500 (Wed, 18 Nov 2009) New Revision: 755 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/lock/TestSessionLockManager.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java Log: EXOJCR-243: Updated LockManager, LockImpl: added refresh functionality. Add= ed tests. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-18 16:16:19 UTC (rev 754) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-18 16:17:22 UTC (rev 755) @@ -197,11 +197,11 @@ buf =3D new byte[in.readInt()]; in.readFully(buf); this.nodeIdentifier =3D new String(buf, Constants.DEFAULT_ENCODING); - // read uuid + // read owner buf =3D new byte[in.readInt()]; in.readFully(buf); this.owner =3D new String(buf, Constants.DEFAULT_ENCODING); - // read uuid + // read token buf =3D new byte[in.readInt()]; in.readFully(buf); this.tokenHash =3D new String(buf, Constants.DEFAULT_ENCODING); @@ -223,11 +223,11 @@ byte[] ptbuf =3D nodeIdentifier.getBytes(Constants.DEFAULT_ENCODING); out.writeInt(ptbuf.length); out.write(ptbuf); - // node uuid + // node owner ptbuf =3D owner.getBytes(Constants.DEFAULT_ENCODING); out.writeInt(ptbuf.length); out.write(ptbuf); - // node uuid + // node token ptbuf =3D tokenHash.getBytes(Constants.DEFAULT_ENCODING); out.writeInt(ptbuf.length); out.write(ptbuf); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-18 16:16:19 UTC (rev 754) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-18 16:17:22 UTC (rev 755) @@ -19,8 +19,13 @@ package org.exoplatform.services.jcr.impl.core.lock; = import org.exoplatform.services.jcr.core.lock.ExtendedLock; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.impl.core.SessionDataManager; +import org.exoplatform.services.jcr.observation.ExtendedEvent; = +import java.util.ArrayList; + import javax.jcr.Node; import javax.jcr.RepositoryException; import javax.jcr.lock.LockException; @@ -43,16 +48,19 @@ // Token is not stored in lockData any more private String token; = + private String sessionId; + /** * @param session * @param lockData */ - public LockImpl(SessionDataManager sessionDataManager, LockData lockDat= a, String token) + public LockImpl(SessionDataManager sessionDataManager, LockData lockDat= a, String token, String sessionId) { this.lockData =3D lockData; this.sessionDataManager =3D sessionDataManager; this.token =3D token; this.live =3D true; + this.sessionId =3D sessionId; } = /** @@ -111,7 +119,16 @@ { if (!isLive()) throw new LockException("Lock is not live"); - // TODO: recreate lockData + + // add new lock data. Storage connection will recognize it as a upda= te, because lock token is the same + LockPlainChangesLogImpl addChangesLog =3D + new LockPlainChangesLogImpl(new ArrayList(), sessionId= , ExtendedEvent.LOCK); + LockData newLockData =3D + new LockData(lockData.getNodeIdentifier(), lockData.getTokenHash(= ), lockData.isDeep(), lockData + .isSessionScoped(), lockData.getOwner(), lockData.getTimeOut()= ); + addChangesLog.setLockData(newLockData); + sessionDataManager.getWorkspaceDataManager().save(addChangesLog); + this.lockData =3D newLockData; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-18 16:16:19 UTC (= rev 754) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-18 16:17:22 UTC (= rev 755) @@ -161,7 +161,7 @@ throw new LockException("Node not locked: " + node.getQPath()); } // if session doesn't have token, null will be returned - return new LockImpl(sessionDataManager, lockData, tokenHash.get(lock= Data.getTokenHash())); + return new LockImpl(sessionDataManager, lockData, tokenHash.get(lock= Data.getTokenHash()), sessionID); } = /** @@ -261,7 +261,7 @@ new TransientValueData(isDeep)); changesLog.add(ItemState.createAddedState(propData)); = - LockImpl newLock =3D new LockImpl(sessionDataManager, lockData, toke= n); + LockImpl newLock =3D new LockImpl(sessionDataManager, lockData, toke= n, sessionID); = sessionDataManager.getTransactManager().save(changesLog); return newLock; Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/core/lock/TestSessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-18 16:17:22 U= TC (rev 755) @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core.lock; + +import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.core.CredentialsImpl; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.NodeImpl; +import org.exoplatform.services.jcr.impl.core.SessionImpl; + +import javax.jcr.RepositoryException; +import javax.jcr.lock.Lock; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class TestSessionLockManager extends JcrImplBaseTest +{ + NodeImpl testRoot; + + @Override + public void setUp() throws Exception + { + super.setUp(); + testRoot =3D (NodeImpl)root.addNode("TestSessionLockManager"); + session.save(); + } + + @Override + protected void tearDown() throws Exception + { + testRoot.remove(); + session.save(); + super.tearDown(); + } + + public void testAddLockToken() throws RepositoryException + { + NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testAddLockToken"); + node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + session.save(); + // lock through session1 + Lock lock1 =3D node1.lock(false, true); + + // create new session2 + CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); + SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); + + NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + // check node locked + assertTrue(node2.isLocked()); + // check session2 has NO access to lock = + assertFalse(session2.getLockManager().isLockHolder((NodeData)node2.g= etData())); + // add token and check session2 has access to lock + session2.addLockToken(lock1.getLockToken()); + assertTrue(session2.getLockManager().isLockHolder((NodeData)node2.ge= tData())); + node2.unlock(); + session2.logout(); + } + + public void testRemoveOnLogOut() throws RepositoryException + { + NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testRemoveOnLogOut"); + node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + session.save(); + // create new session2 + CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); + SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); + + NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + // lock through session2 + Lock lock2 =3D node2.lock(false, true); + // check session2 has access to lock = + assertTrue(node2.isLocked()); + assertTrue(session2.getLockManager().isLockHolder((NodeData)node2.ge= tData())); + + // session2 logout + session2.logout(); + // lock should be removed and node should be unlocked + assertFalse(lock2.isLive()); + assertFalse(node2.isLocked()); + assertFalse(node1.isLocked()); + } + + public void testRemoveByTimeOut() throws RepositoryException + { + int REMOVER_SCHEDULE_TIME =3D 10000; // 10s?! need to place correct = value + int lockTimeOut =3D 2000; + NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testRemoveByTimeOut"); + node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + session.save(); + // set time out 2s + node1.lock(false, lockTimeOut); + try + { + // sleep for Remover period time + lockTimeOut + 1s for stability + Thread.sleep(REMOVER_SCHEDULE_TIME + lockTimeOut + 1000); + } + catch (InterruptedException e) + { + } + assertFalse(node1.isLocked()); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/core/lock/TestSessionLockManager.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native --===============6817394920074266867==-- From do-not-reply at jboss.org Wed Nov 18 11:27:30 2009 Content-Type: multipart/mixed; boundary="===============8525105419714857404==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r756 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc: db and 1 other directory. Date: Wed, 18 Nov 2009 11:27:30 -0500 Message-ID: <200911181627.nAIGRU7v007168@svn01.web.mwc.hst.phx2.redhat.com> --===============8525105419714857404== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-18 11:27:30 -0500 (Wed, 18 Nov 2009) New Revision: 756 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-248: get childs optimization (index fix) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 16:17:22= UTC (rev 755) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-18 16:27:30= UTC (rev 756) @@ -2107,10 +2107,12 @@ Set childrens =3D new LinkedHashSet(); while (node.next()) { - String childName =3D node.getString(COLUMN_NAME); - if (!childrens.add(childName)) + String nodeName =3D node.getString(COLUMN_NAME); + int nodeIndex =3D node.getInt(COLUMN_INDEX); + QPathEntry name =3D new QPathEntry(InternalQName.parse(nodeNam= e), nodeIndex); + if (!childrens.add(name.getAsString(true))) { - throw new RepositoryException("FATAL Child node name dublic= ated '" + childName + "' on parent " + throw new RepositoryException("FATAL Child node name dublic= ated '" + nodeName + "' on parent " + parentId); } } @@ -2121,6 +2123,10 @@ { throw new RepositoryException(e); } + catch (IllegalNameException e) + { + throw new RepositoryException(e); + } } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-18= 16:17:22 UTC (rev 755) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-18= 16:27:30 UTC (rev 756) @@ -74,9 +74,10 @@ "select V.DATA" + " from JCR_MITEM I, JCR_MVALUE V" + " where I.PARENT_ID=3D? and I.I_CLASS=3D2 and I.NAME=3D? and= I.ID=3DV.PROPERTY_ID order by V.ORDER_NUM"; FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where PAREN= T_ID=3D? and I_CLASS=3D1" + " order by N_ORDER_NUM"; - = - FIND_NODES_NAME_BY_PARENTID =3D "select NAME from JCR_MITEM" + " whe= re PARENT_ID=3D? and I_CLASS=3D1" + " order by N_ORDER_NUM"; - = + + FIND_NODES_NAME_BY_PARENTID =3D + "select NAME, I_INDEX from JCR_MITEM" + " where PARENT_ID=3D? and= I_CLASS=3D1" + " order by N_ORDER_NUM"; + FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = PARENT_ID=3D? and I_CLASS=3D2" + " order by ID"; } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 8 16:17:22 UTC (rev 755) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 8 16:27:30 UTC (rev 756) @@ -83,7 +83,7 @@ "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D1= and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; = FIND_NODES_NAME_BY_PARENTID =3D - "select NAME from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS= =3D1 and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; + "select NAME, I_INDEX from JCR_SITEM" + " where PARENT_ID=3D? and= I_CLASS=3D1 and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D2= and CONTAINER_NAME=3D?" + " order by ID"; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 16:17= :22 UTC (rev 755) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-18 16:27= :30 UTC (rev 756) @@ -201,7 +201,7 @@ FIND_ALL_NODES =3D "select ID from JCR_MITEM where I_CLASS=3D1"; = FIND_NODES_NAME_BY_PARENTID =3D - "select NAME from JCR_MITEM" + " where I_CLASS=3D1 and PARENT_ID= =3D?" + " order by N_ORDER_NUM"; + "select NAME, I_INDEX from JCR_MITEM" + " where I_CLASS=3D1 and P= ARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 16:1= 7:22 UTC (rev 755) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-18 16:2= 7:30 UTC (rev 756) @@ -206,7 +206,7 @@ "select * from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_NODES_NAME_BY_PARENTID =3D - "select NAME from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_= NAME=3D? and PARENT_ID=3D?" + "select NAME, I_INDEX from JCR_SITEM" + " where I_CLASS=3D1 and C= ONTAINER_NAME=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_ALL_NODES =3D "select ID from JCR_SITEM where I_CLASS=3D1 and C= ONTAINER_NAME=3D?"; --===============8525105419714857404==-- From do-not-reply at jboss.org Wed Nov 18 11:28:54 2009 Content-Type: multipart/mixed; boundary="===============0903723705175513687==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r757 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Wed, 18 Nov 2009 11:28:54 -0500 Message-ID: <200911181628.nAIGSsl7007326@svn01.web.mwc.hst.phx2.redhat.com> --===============0903723705175513687== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-18 11:28:53 -0500 (Wed, 18 Nov 2009) New Revision: 757 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java Log: EXOJCR-248 : The AbstractCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:27:30= UTC (rev 756) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:28:53= UTC (rev 757) @@ -114,7 +114,7 @@ break; case PUT_KEY_VALUE : = - if (m.getOldValue() !=3D null) + if (isUpdate(m, conn)) doUpdate(m, conn); else doAdd(m, conn); @@ -141,6 +141,19 @@ } = /** + * Check update item or add item. + * = + * @param m + * @param conn + * @return boolean + * return true if update + */ + private boolean isUpdate(Modification m, JDBCStorageConnection conn) th= rows RepositoryException + { + return (conn.getItemName((String)m.getFqn().get(1)) =3D=3D null ? fa= lse : true); + } + + /** * {@inheritDoc} */ public void put(List modifications) throws Exception Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-18 = 16:27:30 UTC (rev 756) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-18 = 16:28:53 UTC (rev 757) @@ -158,7 +158,6 @@ String fqn =3D "/" + JBossCacheStorage.PROPS + "/" + data.getIdentif= ier(); Modification modification =3D new Modification(ModificationType.PUT_KEY_VALUE, Fqn.fromString(f= qn), JBossCacheStorage.ITEM_DATA, data); - modification.setOldValue(data); list.add(modification); return list; } @@ -186,7 +185,6 @@ = fqn =3D Fqn.fromElements(JBossCacheStorage.NODES, data.getIdentifier= ()); modification =3D new Modification(ModificationType.PUT_KEY_VALUE, fq= n, JBossCacheStorage.ITEM_DATA, data); - modification.setOldValue(data); list.add(modification); = return list; --===============0903723705175513687==-- From do-not-reply at jboss.org Wed Nov 18 11:29:25 2009 Content-Type: multipart/mixed; boundary="===============7221767566325715316==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r758 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 18 Nov 2009 11:29:25 -0500 Message-ID: <200911181629.nAIGTPAc007384@svn01.web.mwc.hst.phx2.redhat.com> --===============7221767566325715316== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-18 11:29:24 -0500 (Wed, 18 Nov 2009) New Revision: 758 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-248 : The AbstractCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:28:53= UTC (rev 757) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:29:24= UTC (rev 758) @@ -114,7 +114,7 @@ break; case PUT_KEY_VALUE : = - if (isUpdate(m, conn)) + if (isUpdate(m, (JDBCStorageConnection) conn)) doUpdate(m, conn); else doAdd(m, conn); --===============7221767566325715316==-- From do-not-reply at jboss.org Wed Nov 18 11:33:41 2009 Content-Type: multipart/mixed; boundary="===============0162233581239540421==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r759 - in jcr/branches/1.12.0-JBC/component/core/src: test/resources/conf/standalone and 1 other directory. Date: Wed, 18 Nov 2009 11:33:41 -0500 Message-ID: <200911181633.nAIGXf2d008823@svn01.web.mwc.hst.phx2.redhat.com> --===============0162233581239540421== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-18 11:33:41 -0500 (Wed, 18 Nov 2009) New Revision: 759 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-jdbcloader.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config.xml Log: EXOJCR-248 : The JDBCCacheLoader was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:29:24= UTC (rev 758) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:33:41= UTC (rev 759) @@ -114,10 +114,15 @@ break; case PUT_KEY_VALUE : = - if (isUpdate(m, (JDBCStorageConnection) conn)) - doUpdate(m, conn); - else - doAdd(m, conn); + if (m.getFqn().size() =3D=3D 2) { + if (isUpdate(m, (JDBCStorageConnection) conn)) { + doUpdate(m, conn); + } + else + { + doAdd(m, conn); + } + } = break; case REMOVE_DATA : Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-jdbcloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-jdbcloader.xml 2009-11-18 16:29:24 UTC (rev 758) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-jdbcloader.xml 2009-11-18 16:33:41 UTC (rev 759) @@ -9,7 +9,7 @@ = - - + = - + = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jcr-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-18 16:29:24 UTC (rev 758) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-18 16:33:41 UTC (rev 759) @@ -30,7 +30,7 @@ - + --===============0162233581239540421==-- From do-not-reply at jboss.org Wed Nov 18 11:40:16 2009 Content-Type: multipart/mixed; boundary="===============2298833463524108556==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r760 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone. Date: Wed, 18 Nov 2009 11:40:16 -0500 Message-ID: <200911181640.nAIGeG4o010636@svn01.web.mwc.hst.phx2.redhat.com> --===============2298833463524108556== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-18 11:40:15 -0500 (Wed, 18 Nov 2009) New Revision: 760 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-jdbcloader.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config.xml Log: EXOJCR-248 : Revert configuration files to revision 758. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-jdbcloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-jdbcloader.xml 2009-11-18 16:33:41 UTC (rev 759) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-jdbcloader.xml 2009-11-18 16:40:15 UTC (rev 760) @@ -9,7 +9,7 @@ = - + = - - + = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jcr-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-18 16:33:41 UTC (rev 759) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-18 16:40:15 UTC (rev 760) @@ -30,7 +30,7 @@ - + --===============2298833463524108556==-- From do-not-reply at jboss.org Thu Nov 19 04:21:18 2009 Content-Type: multipart/mixed; boundary="===============1356083339161486578==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r761 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 04:21:17 -0500 Message-ID: <200911190921.nAJ9LHmg022225@svn01.web.mwc.hst.phx2.redhat.com> --===============1356083339161486578== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 04:21:17 -0500 (Thu, 19 Nov 2009) New Revision: 761 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-247: getters optimization Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-18 16:40:15= UTC (rev 760) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-19 09:21:17= UTC (rev 761) @@ -325,12 +325,9 @@ { attrs =3D new LinkedHashMap(); attrs.put(JBossCacheStorage.ITEM_ID, nodeId); + } else { + attrs =3D null; } - else - { - throw new JDBCCacheLoaderException("FATAL Child Node = data not found, parent " + nodeId + " child " - + childNodeName + " for '" + name + "'"); - } } else { @@ -727,18 +724,5 @@ } } = - @Deprecated - private QPathEntry[] makeNodePath(Fqn nodeFqn) throws NumberFor= matException, IllegalNameException - { - List elements =3D nodeFqn.peekElements(); - QPathEntry[] path =3D new QPathEntry[elements.size()]; = - for (int i =3D 0; i < elements.size(); i++) - { - path[i] =3D QPathEntry.parse(elements.get(i)); - } - - return path; - } - } \ No newline at end of file --===============1356083339161486578==-- From do-not-reply at jboss.org Thu Nov 19 04:22:38 2009 Content-Type: multipart/mixed; boundary="===============4976849497671176395==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r762 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/lock and 1 other directories. Date: Thu, 19 Nov 2009 04:22:38 -0500 Message-ID: <200911190922.nAJ9Mc9v022387@svn01.web.mwc.hst.phx2.redhat.com> --===============4976849497671176395== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-19 04:22:38 -0500 (Thu, 19 Nov 2009) New Revision: 762 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/SessionImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/lock/TestSessionLockManager.java Log: EXOJCR-243: Default lock timeout from config is now handled. Tests updated. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/SessionImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionImpl.java 2009-11-19 09:21:17 UTC (rev 761) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionImpl.java 2009-11-19 09:22:38 UTC (rev 762) @@ -176,10 +176,8 @@ = this.workspace =3D new WorkspaceImpl(workspaceName, container, this,= observationManager); = - // TODO: try to get lock timeout from workspace configuration, as it= was before this.sessionLockManager =3D - new SessionLockManager(this.getId(), this.getUserID(), this.getTr= ansientNodesManager(), - SessionLockManager.DEFAULT_LOCK_TIMEOUT); + new SessionLockManager(this.getId(), this.getUserID(), this.getTr= ansientNodesManager(), wsConfig); = this.lifecycleListeners =3D new ArrayList(= ); this.registerLifecycleListener((ObservationManagerImpl)observationMa= nager); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-19 09:21:17 UTC (= rev 761) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-19 09:22:38 UTC (= rev 762) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.core.lock; = import org.exoplatform.services.jcr.access.SystemIdentity; +import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.ExtendedSession; import org.exoplatform.services.jcr.core.SessionLifecycleListener; import org.exoplatform.services.jcr.dataflow.ItemState; @@ -106,20 +107,19 @@ * @param session * @param lockTimeOut */ - public SessionLockManager(String sessionID, String userId, SessionDataM= anager sessionDataManager, long lockTimeOut) + public SessionLockManager(String sessionID, String userId, SessionDataM= anager sessionDataManager, + WorkspaceEntry wsConfig) { - this.lockTimeOut =3D lockTimeOut; this.sessionID =3D sessionID; this.userId =3D userId; this.sessionDataManager =3D sessionDataManager; - // TODO: configured lock timeout should be acquired from WSconfig - /* if (config.getLockManager() !=3D null) + if (wsConfig.getLockManager() !=3D null) { - lockTimeOut =3D - config.getLockManager().getTimeout() > 0 ? config.getLockManag= er().getTimeout() : DEFAULT_LOCK_TIMEOUT; + this.lockTimeOut =3D + wsConfig.getLockManager().getTimeout() > 0 ? wsConfig.getLockM= anager().getTimeout() : DEFAULT_LOCK_TIMEOUT; } else - lockTimeOut =3D DEFAULT_LOCK_TIMEOUT;*/ + lockTimeOut =3D DEFAULT_LOCK_TIMEOUT; } = /** @@ -403,12 +403,13 @@ log.error(e.getMessage(), e); return; } - // list acquired, traversing to cleanup; + // list acquired, traversing to cleanup locks; for (LockData lockData : lockDatas) { if (lockData.isSessionScoped() && isLockHolder(lockData)) { NodeData node; + // if can't unlock this, still try to unlock the next one try { node =3D (NodeData)sessionDataManager.getItemData(lockData.= getNodeIdentifier()); @@ -416,7 +417,7 @@ } catch (RepositoryException e) { - log.error("Can't unlock node:" + lockData.getNodeIdentifier= (), e); + log.error("Can't unlock node on session logout, id:" + lock= Data.getNodeIdentifier(), e); } } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/core/lock/TestSessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-19 09:21:17 U= TC (rev 761) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-19 09:22:38 U= TC (rev 762) @@ -77,8 +77,50 @@ session2.logout(); } = + public void testLockUnlock() throws RepositoryException + { + NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testLockUnlock"); + node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + session.save(); + // lock through session1 + Lock lock1 =3D node1.lock(false, false); + + // create new session2 + CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); + SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); + + NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + // check node locked + assertTrue(node1.isLocked()); + assertTrue(node2.isLocked()); + // add lock token + session2.addLockToken(lock1.getLockToken()); + // unlock through session2 + node2.unlock(); + // asset not locked = + assertFalse(node1.isLocked()); + assertFalse(node2.isLocked()); + + session2.logout(); + } + + public void testGetLock() throws RepositoryException + { + NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testGetLock"); + node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + session.save(); + // lock = + Lock lock1 =3D node1.lock(false, false); + // get lock + Lock lock2 =3D node1.getLock(); + assertEquals(lock1.getLockToken(), lock2.getLockToken()); + //unlock + node1.unlock(); + } + public void testRemoveOnLogOut() throws RepositoryException { + // checks that session-scoped locks are removed on logout NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testRemoveOnLogOut"); node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); session.save(); @@ -87,7 +129,7 @@ SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); = NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); - // lock through session2 + // lock through session2, as session-scoped Lock lock2 =3D node2.lock(false, true); // check session2 has access to lock = assertTrue(node2.isLocked()); @@ -101,6 +143,35 @@ assertFalse(node1.isLocked()); } = + public void testNotRemoveOnLogOut() throws RepositoryException + { + // checks that open-scoped locks are not removed on logout + NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testNotRemoveOnLogOut= "); + node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + session.save(); + // create new session2 + CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); + SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); + + NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + // lock through session2, as open-scoped + Lock lock2 =3D node2.lock(false, false); + // check session2 has access to lock = + assertTrue(node2.isLocked()); + assertTrue(session2.getLockManager().isLockHolder((NodeData)node2.ge= tData())); + + // session2 logout + session2.logout(); + // lock should NOT be removed and node should be unlocked + assertTrue(lock2.isLive()); + assertTrue(node2.isLocked()); + assertTrue(node1.isLocked()); + + session.addLockToken(lock2.getLockToken()); + node1.unlock(); + assertFalse(node1.isLocked()); + } + public void testRemoveByTimeOut() throws RepositoryException { int REMOVER_SCHEDULE_TIME =3D 10000; // 10s?! need to place correct = value --===============4976849497671176395==-- From do-not-reply at jboss.org Thu Nov 19 04:25:25 2009 Content-Type: multipart/mixed; boundary="===============5818505897350823530==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r763 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage. Date: Thu, 19 Nov 2009 04:25:25 -0500 Message-ID: <200911190925.nAJ9PPtD022816@svn01.web.mwc.hst.phx2.redhat.com> --===============5818505897350823530== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-19 04:25:25 -0500 (Thu, 19 Nov 2009) New Revision: 763 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCStorageConnectionTest.java Log: EXOJCR-248 : The test JCRStorageConnectionTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCStorageConnectionTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-19 09:22:38 = UTC (rev 762) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCStorageConnectionTest.java 2009-11-19 09:25:25 = UTC (rev 763) @@ -22,6 +22,7 @@ import org.exoplatform.services.jcr.access.AccessControlEntry; import org.exoplatform.services.jcr.access.PermissionType; import org.exoplatform.services.jcr.access.SystemIdentity; +import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.dataflow.DataManager; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; @@ -38,8 +39,15 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; +import org.exoplatform.services.naming.InitialContextInitializer; = +import java.io.IOException; +import java.io.InputStream; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.ArrayList; import java.util.List; = @@ -264,9 +272,19 @@ = public void testDeleteItemsById() throws Exception { - WorkspaceDataContainer dataContainer =3D - (WorkspaceDataContainer) session.getContainer().getComponen= tInstanceOfType(WorkspaceDataContainer.class); = + WorkspaceEntry we =3D null; + = + for (WorkspaceEntry wsConfig : repository.getConfiguration().getWork= spaceEntries()) = + if (wsConfig.getName().equals(session.getWorkspace().getName())) = + we =3D wsConfig; + = + InitialContextInitializer contextInit =3D (InitialContextInitializer= ) session.getContainer().getComponentInstanceOfType(InitialContextInitializ= er.class); + ValueStoragePluginProvider valueStorageProvider =3D (ValueStoragePlu= ginProvider) session.getContainer().getComponentInstanceOfType(ValueStorage= PluginProvider.class); + = + JDBCWorkspaceDataContainer dataContainer =3D new JDBCWorkspaceDataCo= ntainer(we, repository.getConfiguration(), contextInit, valueStorageProvide= r); + = + = // create node with property primary type. TransientNodeData troot =3D TransientNodeData.createNodeData(root, InternalQName.parse("[]nod= e_to_delete_by_id"), @@ -276,14 +294,14 @@ TransientPropertyData.createPropertyData(troot, Constants.JCR_PRI= MARYTYPE, PropertyType.NAME, false, new TransientValueData(Constants.NT_UNSTRUCTURED)); = - PlainChangesLogImpl chlog =3D new PlainChangesLogImpl(); - chlog.add(ItemState.createAddedState(troot)); - chlog.add(ItemState.createAddedState(pt)); + JDBCStorageConnection connection =3D (JDBCStorageConnection) dataCon= tainer.openConnection(); = - dataManager.save(new TransactionChangesLog(chlog)); - + connection.add(troot); + connection.add(pt); + connection.commit(); + = // Delete node and property by ID. - JDBCStorageConnection connection =3D (JDBCStorageConnection) dataCon= tainer.openConnection(); + connection =3D (JDBCStorageConnection) dataContainer.openConnection(= ); = connection.deleteProperty(pt.getIdentifier()); connection.deleteNode(troot.getIdentifier()); --===============5818505897350823530==-- From do-not-reply at jboss.org Thu Nov 19 05:56:40 2009 Content-Type: multipart/mixed; boundary="===============7214349411988289322==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r764 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 05:56:40 -0500 Message-ID: <200911191056.nAJAuesO008906@svn01.web.mwc.hst.phx2.redhat.com> --===============7214349411988289322== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 05:56:39 -0500 (Thu, 19 Nov 2009) New Revision: 764 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-248: get childs optimization (some fixes) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 09:25:25 UTC (rev 763) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 10:56:39 UTC (rev 764) @@ -190,40 +190,46 @@ */ public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException { + List childs =3D new ArrayList(); = Node parentNode =3D nodesRoot.getChild(makeNod= eFqn(parent.getIdentifier())); - if (parentNode =3D=3D null) + if (parentNode !=3D null) { - throw new IllegalStateException("FATAL Get child Nodes: parent no= t found " + parent.getQPath().getAsString()); - } = - Set> childNodes =3D parentNode.getChildre= n(); - - List childs =3D new ArrayList(); - for (Node child : childNodes) - { - String nodeId =3D (String)child.get(ITEM_ID); - if (nodeId =3D=3D null) + Set> childNodes =3D parentNode.getChil= dren(); + for (Node child : childNodes) { - throw new RepositoryException("FATAL Child Node Id key is null= . Parent " + parent.getQPath().getAsString()); - } + String nodeId =3D (String)child.get(ITEM_ID); + if (nodeId =3D=3D null) + { + throw new RepositoryException("FATAL Child Node Id key is n= ull. Parent " + + parent.getQPath().getAsString()); + } = - // TODO NodeData or PropertyData? As ItemData check then and cast. - Node node =3D nodesRoot.getChild(makeNodeFq= n(nodeId)); - if (node =3D=3D null) - { - throw new RepositoryException("FATAL Node record not found(" += nodeId + "), but listed in proprties of " - + parent.getQPath().getAsString()); + // TODO NodeData or PropertyData? As ItemData check then and c= ast. + Node node =3D nodesRoot.getChild(makeNod= eFqn(nodeId)); + if (node =3D=3D null) + { + throw new RepositoryException("FATAL Node record not found(= " + nodeId + "), but listed in proprties of " + + parent.getQPath().getAsString()); + } + NodeData nodeData =3D (NodeData)node.get(ITEM_DATA); + if (nodeData =3D=3D null) + { + // TODO should not occurs by contract + throw new RepositoryException("Child node data is null. Par= ent " + parent.getQPath().getAsString()); + } + childs.add(nodeData); } - NodeData nodeData =3D (NodeData)node.get(ITEM_DATA); - if (nodeData =3D=3D null) - { - // TODO should not occurs by contract - throw new RepositoryException("Child node data is null. Parent= " + parent.getQPath().getAsString()); - } - childs.add(nodeData); } + else + { + LOG.warn("FATAL Get child Nodes: parent not found " + parent.getQ= Path().getAsString()); = + // TODO should be Exception, but after OPT branch optimization me= rge, current impl requires it as null returned + // throw new RepositoryException("FATAL Get child Nodes: parent n= ot found " + parent.getQPath().getAsString()); + } + return childs; } = @@ -248,43 +254,50 @@ */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException { + List childs =3D new ArrayList(); + Node parentNode =3D nodesRoot.getChild(makeNod= eFqn(parent.getIdentifier())); - if (parentNode =3D=3D null) + if (parentNode !=3D null) { - throw new IllegalStateException("FATAL Get child Properties: pare= nt not found " - + parent.getQPath().getAsString()); - } = - List childs =3D new ArrayList(); - - for (Serializable key : parentNode.getKeys()) - { - if (!key.equals(ITEM_DATA)) + for (Serializable key : parentNode.getKeys()) { - String propId =3D (String)parentNode.get(key); - if (propId =3D=3D null) + if (!key.equals(ITEM_DATA)) { - throw new RepositoryException("FATAL Child Property Id key = is null. Parent " - + parent.getQPath().getAsString()); - } + String propId =3D (String)parentNode.get(key); + if (propId =3D=3D null) + { + throw new RepositoryException("FATAL Child Property Id k= ey is null. Parent " + + parent.getQPath().getAsString()); + } = - Node prop =3D propsRoot.getChild(makePro= pFqn(propId)); - if (prop =3D=3D null) - { - throw new RepositoryException("FATAL Property record not fo= und(" + propId - + "), but listed in proprties of " + parent.getQPath().g= etAsString()); - } + Node prop =3D propsRoot.getChild(make= PropFqn(propId)); + if (prop =3D=3D null) + { + throw new RepositoryException("FATAL Property record not= found(" + propId + + "), but listed in proprties of " + parent.getQPath(= ).getAsString()); + } = - PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); - if (propData =3D=3D null) - { - throw new RepositoryException("FATAL Property data is null.= Parent " + parent.getQPath().getAsString()); + PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); + if (propData =3D=3D null) + { + throw new RepositoryException("FATAL Property data is nu= ll. Parent " + + parent.getQPath().getAsString()); + } + + childs.add(propData); } - - childs.add(propData); } } + else + { + LOG.warn("FATAL Get child Properties: parent not found " + parent= .getQPath().getAsString()); = + // TODO should be Exception, but after OPT branch optimization me= rge, current impl requires it as null returned + //throw new IllegalStateException("FATAL Get child Properties: pa= rent not found " + // + parent.getQPath().getAsString()); + } + return childs; } = @@ -369,8 +382,12 @@ } else { - throw new RepositoryException("FATAL Parent not found " + pare= ntData.getQPath().getAsString() + " for " - + name.getAsString(true)); + LOG + .warn("FATAL Parent not found " + parentData.getQPath().get= AsString() + " for " + name.getAsString(true)); + + // TODO should be Exception, but after OPT branch optimization= merge, current impl requires it as null returned = + //throw new RepositoryException("FATAL Parent not found " + pa= rentData.getQPath().getAsString() + " for " + // + name.getAsString(true)); } } = @@ -448,7 +465,7 @@ NodeData oldNodeData =3D (NodeData)node.put(ITEM_DATA, data); if (oldNodeData =3D=3D null) { - throw new RepositoryException("FATAL NodeData is empty " + data.= getQPath().getAsString()); + throw new RepositoryException("FATAL NodeData is empty " + data.g= etQPath().getAsString()); } = // 2. remove renamed node from child list of previous parent node Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-19 09:25:25= UTC (rev 763) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-19 10:56:39= UTC (rev 764) @@ -107,7 +107,7 @@ switch (m.getType()) { case PUT_DATA : - LOG.warn("PUT_DATA modification"); + //LOG.warn("PUT_DATA modification"); break; case PUT_DATA_ERASE : LOG.warn("PUT_DATA_ERASE modification"); --===============7214349411988289322==-- From do-not-reply at jboss.org Thu Nov 19 06:07:58 2009 Content-Type: multipart/mixed; boundary="===============4725167169031167518==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r765 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/lock. Date: Thu, 19 Nov 2009 06:07:57 -0500 Message-ID: <200911191107.nAJB7vPX012302@svn01.web.mwc.hst.phx2.redhat.com> --===============4725167169031167518== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-19 06:07:57 -0500 (Thu, 19 Nov 2009) New Revision: 765 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java Log: EXOJCR-243: Check list not null Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-19 10:56:39 UTC (= rev 764) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-19 11:07:57 UTC (= rev 765) @@ -404,21 +404,24 @@ return; } // list acquired, traversing to cleanup locks; - for (LockData lockData : lockDatas) + if (lockDatas !=3D null) { - if (lockData.isSessionScoped() && isLockHolder(lockData)) + for (LockData lockData : lockDatas) { - NodeData node; - // if can't unlock this, still try to unlock the next one - try + if (lockData.isSessionScoped() && isLockHolder(lockData)) { - node =3D (NodeData)sessionDataManager.getItemData(lockData.= getNodeIdentifier()); - unlock(node); + NodeData node; + // if can't unlock this, still try to unlock the next one + try + { + node =3D (NodeData)sessionDataManager.getItemData(lockDa= ta.getNodeIdentifier()); + unlock(node); + } + catch (RepositoryException e) + { + log.error("Can't unlock node on session logout, id:" + l= ockData.getNodeIdentifier(), e); + } } - catch (RepositoryException e) - { - log.error("Can't unlock node on session logout, id:" + lock= Data.getNodeIdentifier(), e); - } } } } --===============4725167169031167518==-- From do-not-reply at jboss.org Thu Nov 19 06:32:39 2009 Content-Type: multipart/mixed; boundary="===============0899826137630042421==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r766 - jcr/trunk/exo.jcr.component.ext/src/main/resources/conf. Date: Thu, 19 Nov 2009 06:32:39 -0500 Message-ID: <200911191132.nAJBWd3e018169@svn01.web.mwc.hst.phx2.redhat.com> --===============0899826137630042421== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: vparfonov Date: 2009-11-19 06:32:39 -0500 (Thu, 19 Nov 2009) New Revision: 766 Modified: jcr/trunk/exo.jcr.component.ext/src/main/resources/conf/ext-nodetypes-co= nfig.xml Log: EXOJCR-257 : node type definition changed Modified: jcr/trunk/exo.jcr.component.ext/src/main/resources/conf/ext-nodet= ypes-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/src/main/resources/conf/ext-nodetypes-c= onfig.xml 2009-11-19 11:07:57 UTC (rev 765) +++ jcr/trunk/exo.jcr.component.ext/src/main/resources/conf/ext-nodetypes-c= onfig.xml 2009-11-19 11:32:39 UTC (rev 766) @@ -215,16 +215,19 @@ = - - - nt:resource - - - - - - + = + + + nt:resource + + + + + + false + + + = \ No newline at end of file --===============0899826137630042421==-- From do-not-reply at jboss.org Thu Nov 19 06:51:16 2009 Content-Type: multipart/mixed; boundary="===============2618049494290545398==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r767 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc and 1 other directories. Date: Thu, 19 Nov 2009 06:51:16 -0500 Message-ID: <200911191151.nAJBpGSW022728@svn01.web.mwc.hst.phx2.redhat.com> --===============2618049494290545398== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 06:51:16 -0500 (Thu, 19 Nov 2009) New Revision: 767 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-203: rework of exceptions, childs search, items existsence. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 11:32:39 UTC (rev 766) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 11:51:16 UTC (rev 767) @@ -224,7 +224,10 @@ } else { - LOG.warn("FATAL Get child Nodes: parent not found " + parent.getQ= Path().getAsString()); + if (LOG.isDebugEnabled()) + { + LOG.debug("FATAL Get child Nodes: parent not found " + parent.= getQPath().getAsString()); + } = // TODO should be Exception, but after OPT branch optimization me= rge, current impl requires it as null returned // throw new RepositoryException("FATAL Get child Nodes: parent n= ot found " + parent.getQPath().getAsString()); @@ -291,7 +294,10 @@ } else { - LOG.warn("FATAL Get child Properties: parent not found " + parent= .getQPath().getAsString()); + if (LOG.isDebugEnabled()) + { + LOG.debug("FATAL Get child Properties: parent not found " + pa= rent.getQPath().getAsString()); + } = // TODO should be Exception, but after OPT branch optimization me= rge, current impl requires it as null returned //throw new IllegalStateException("FATAL Get child Properties: pa= rent not found " @@ -382,8 +388,10 @@ } else { - LOG - .warn("FATAL Parent not found " + parentData.getQPath().get= AsString() + " for " + name.getAsString(true)); + if (LOG.isDebugEnabled()) + { + LOG.debug("FATAL Parent not found " + parentData.getQPath()= .getAsString() + " for " + name.getAsString(true)); + } = // TODO should be Exception, but after OPT branch optimization= merge, current impl requires it as null returned = //throw new RepositoryException("FATAL Parent not found " + pa= rentData.getQPath().getAsString() + " for " Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-19 11:32:39= UTC (rev 766) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-19 11:51:16= UTC (rev 767) @@ -114,8 +114,10 @@ break; case PUT_KEY_VALUE : = - if (m.getFqn().size() =3D=3D 2) { - if (isUpdate(m, (JDBCStorageConnection) conn)) { + if (m.getFqn().size() =3D=3D 2) + { + if (isUpdate(m, (JDBCStorageConnection)conn)) + { doUpdate(m, conn); } else @@ -148,14 +150,14 @@ /** * Check update item or add item. * = - * @param m - * @param conn + * @param m Modification + * @param conn JDBCStorageConnection * @return boolean - * return true if update + * return true if update, false if add */ private boolean isUpdate(Modification m, JDBCStorageConnection conn) th= rows RepositoryException { - return (conn.getItemName((String)m.getFqn().get(1)) =3D=3D null ? fa= lse : true); + return conn.itemExists((String)m.getFqn().get(1), m.getValue() insta= nceof NodeData); } = /** @@ -320,12 +322,15 @@ QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); String parentId =3D (String)name.get(1); = - String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName.getAsString(false), childNodeName.getIndex()); + String nodeId =3D + conn.getNodeIdentifier(parentId, childNodeName.getAsS= tring(false), childNodeName.getIndex()); if (nodeId !=3D null) { attrs =3D new LinkedHashMap(); attrs.put(JBossCacheStorage.ITEM_ID, nodeId); - } else { + } + else + { attrs =3D null; } } @@ -403,7 +408,7 @@ if (name.size() =3D=3D 2) { String nodeId =3D name.getLastElementAsString(); - String nodeName =3D conn.getItemName(nodeId); + String nodeName =3D conn.getNodeName(nodeId); = if (nodeName !=3D null) { @@ -420,7 +425,8 @@ QPathEntry childNodeName =3D QPathEntry.parse(name.getLa= stElementAsString()); String parentId =3D (String)name.get(1); = - String nodeId =3D conn.getItemIdentifier(parentId, child= NodeName.getAsString(false), childNodeName.getIndex()); + String nodeId =3D + conn.getNodeIdentifier(parentId, childNodeName.getAsS= tring(false), childNodeName.getIndex()); if (nodeId !=3D null) { exists =3D true; @@ -442,7 +448,7 @@ if (name.size() =3D=3D 2) { String propertyId =3D name.getLastElementAsString(); - String propertyName =3D conn.getItemName(propertyId); + String propertyName =3D conn.getPropertyName(propertyId); = if (propertyName !=3D null) { @@ -724,5 +730,4 @@ } } = - } \ No newline at end of file Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-19 11:32:39 UTC (rev = 766) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-19 11:51:16 UTC (rev = 767) @@ -145,9 +145,14 @@ /** * FIND_ITEM_IDENTIFIER. */ - protected String FIND_ITEM_IDENTIFIER; + protected String FIND_NODE_IDENTIFIER; = /** + * FIND_PROPERTY_IDENTIFIER. + */ + protected String FIND_PROPERTY_IDENTIFIER; + = + /** * FIND_ITEM_NAME. */ protected String FIND_ITEM_NAME; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-19 11:32:39= UTC (rev 766) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-19 11:51:16= UTC (rev 767) @@ -2000,22 +2000,23 @@ } = /** - * Find Item ID in database. + * Find Node ID in database. * * @param parentId String, parent Node id - * @param name Item, name - * @param index int, path index (actual for nodes, 1 for properties) + * @param name String, Node name + * @param index int, path index = * @return String with ID * @throws RepositoryException if database error occurs * @throws IllegalStateException if connection closed */ - public String getItemIdentifier(String parentId, String name, int index= ) throws RepositoryException, IllegalStateException + public String getNodeIdentifier(String parentId, String name, int index= ) throws RepositoryException, + IllegalStateException { checkIfOpened(); = try { - ResultSet item =3D findItemIdentifier(getInternalId(parentId), na= me, index); + ResultSet item =3D findNodeIdentifier(getInternalId(parentId), na= me, index); if (item.next()) { return item.getString(COLUMN_ID); @@ -2030,14 +2031,108 @@ } = /** - * Find Item name in database. + * Find Property ID in database. * + * TODO not used! + * + * @param parentId String, parent Node id + * @param name String, Property name + * @return String with ID + * @throws RepositoryException if database error occurs + * @throws IllegalStateException if connection closed + */ + @Deprecated + public String getPropertyIdentifier(String parentId, String name) throw= s RepositoryException, IllegalStateException + { + checkIfOpened(); + + try + { + ResultSet item =3D findPropertyIdentifier(getInternalId(parentId)= , name); + if (item.next()) + { + return item.getString(COLUMN_ID); + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + + return null; + } + + /** + * Check if Item exists in database. isNode flag will be u= sed to filter Node or Property asked. + * + * @param itemId String + * @param isNode boolean, true if Node asked, false if Property + * @return boolean, true if Item exists, false otherwise + * @throws RepositoryException if database error occurs + * @throws IllegalStateException if connection closed + */ + public boolean itemExists(String itemId, boolean isNode) throws Reposit= oryException, IllegalStateException + { + + checkIfOpened(); + + try + { + ResultSet item =3D findItemName(getInternalId(itemId)); + if (item.next()) + { + return item.getInt(COLUMN_CLASS) =3D=3D (isNode ? I_CLASS_NODE= : I_CLASS_PROPERTY); + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + + return false; + } + + /** + * Find Node name in database. + * + * @param nodeId String + * @return String with name + * @throws RepositoryException if database error occurs + * @throws IllegalStateException if connection closed + */ + public String getNodeName(String nodeId) throws RepositoryException, Il= legalStateException + { + + checkIfOpened(); + + try + { + ResultSet item =3D findItemName(getInternalId(nodeId)); + if (item.next()) + { + if (item.getInt(COLUMN_CLASS) =3D=3D I_CLASS_NODE) + { + return item.getString(COLUMN_NAME); + } + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + + return null; + } + + /** + * Find Property name in database. + * * @param propertyId String * @return String with name * @throws RepositoryException if database error occurs * @throws IllegalStateException if connection closed */ - public String getItemName(String propertyId) throws RepositoryException= , IllegalStateException + public String getPropertyName(String propertyId) throws RepositoryExcep= tion, IllegalStateException { = checkIfOpened(); @@ -2047,7 +2142,10 @@ ResultSet item =3D findItemName(getInternalId(propertyId)); if (item.next()) { - return item.getString(COLUMN_NAME); + if (item.getInt(COLUMN_CLASS) =3D=3D I_CLASS_PROPERTY) + { + return item.getString(COLUMN_NAME); + } } } catch (SQLException e) @@ -2241,17 +2339,19 @@ = // JBC related = - protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentCid) - throws SQLException; + protected abstract ResultSet findChildPropertiesIdNameByParentIdentifie= r(String parentCid) throws SQLException; = protected abstract ResultSet findChildNodesNameByParentIdentifier(Strin= g parentCid) throws SQLException; = - protected abstract ResultSet findItemIdentifier(String parentCid, Strin= g name, int index) throws SQLException; + protected abstract ResultSet findNodeIdentifier(String parentCid, Strin= g name, int index) throws SQLException; = + @Deprecated + protected abstract ResultSet findPropertyIdentifier(String parentCid, S= tring name) throws SQLException; + protected abstract ResultSet findItemName(String cid) throws SQLExcepti= on; - = + protected abstract ResultSet findAllPropertyIdentifiers() throws SQLExc= eption; - = + protected abstract ResultSet findAllNodeIdentifiers() throws SQLExcepti= on; = } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 9 11:32:39 UTC (rev 766) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-1= 9 11:51:16 UTC (rev 767) @@ -87,8 +87,13 @@ = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D2= and CONTAINER_NAME=3D?" + " order by ID"; + = FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_SITEM" + " where PARENT_ID=3D? and I_CL= ASS=3D2 and CONTAINER_NAME=3D?"; + = + FIND_NODE_IDENTIFIER =3D "select ID from JCR_SITEM" + " where PARENT= _ID=3D? and I_CLASS=3D1 and CONTAINER_NAME=3D? and NAME=3D? and I_INDEX=3D?= "; + = + FIND_PROPERTY_IDENTIFIER =3D "select ID from JCR_SITEM" + " where PA= RENT_ID=3D? and I_CLASS=3D2 and CONTAINER_NAME=3D? and NAME=3D? and I_INDEX= =3D1"; } = /** @@ -192,4 +197,45 @@ findNodesNameByParentId.setString(2, containerName); return findNodesNameByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findNodeIdentifier(String parentCid, String name, i= nt index) throws SQLException + { + if (findNodeIdentifier =3D=3D null) + { + findNodeIdentifier =3D dbConnection.prepareStatement(FIND_NODE_ID= ENTIFIER); + } + else + { + findNodeIdentifier.clearParameters(); + } + findNodeIdentifier.setString(1, parentCid); + findNodeIdentifier.setString(2, containerName); + findNodeIdentifier.setString(3, name); + findNodeIdentifier.setInt(4, index); + return findNodeIdentifier.executeQuery(); + } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findPropertyIdentifier(String parentCid, String nam= e) throws SQLException + { + if (findPropertyIdentifier =3D=3D null) + { + findPropertyIdentifier =3D dbConnection.prepareStatement(FIND_PRO= PERTY_IDENTIFIER); + } + else + { + findPropertyIdentifier.clearParameters(); + } + findPropertyIdentifier.setString(1, parentCid); + findPropertyIdentifier.setString(2, containerName); + findPropertyIdentifier.setString(3, name); + return findPropertyIdentifier.executeQuery(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-19 11:32= :39 UTC (rev 766) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-19 11:51= :16 UTC (rev 767) @@ -84,7 +84,9 @@ = protected PreparedStatement findPropertiesIdNameByParentId; = - protected PreparedStatement findItemIdentifier; + protected PreparedStatement findNodeIdentifier; + = + protected PreparedStatement findPropertyIdentifier; = protected PreparedStatement findItemName; = @@ -209,9 +211,11 @@ = FIND_ALL_PROPERTIES =3D "select ID from JCR_MITEM where I_CLASS=3D2"; = - FIND_ITEM_IDENTIFIER =3D "select ID from JCR_MITEM" + " where PARENT= _ID=3D? and NAME=3D? and I_INDEX=3D?"; + FIND_NODE_IDENTIFIER =3D "select ID from JCR_MITEM" + " where I_CLAS= S=3D1 and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D?"; + = + FIND_PROPERTY_IDENTIFIER =3D "select ID from JCR_MITEM" + " where I_= CLASS=3D2 and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D1"; = - FIND_ITEM_NAME =3D "select NAME from JCR_MITEM" + " where ID=3D?"; + FIND_ITEM_NAME =3D "select NAME, I_CLASS from JCR_MITEM" + " where I= D=3D?"; = INSERT_NODE =3D "insert into JCR_MITEM(ID, PARENT_ID, NAME, VERSION, I_CLASS, I_I= NDEX, N_ORDER_NUM) VALUES(?,?,?,?," @@ -597,21 +601,40 @@ * {@inheritDoc} */ @Override - protected ResultSet findItemIdentifier(String parentCid, String name, i= nt index) throws SQLException + protected ResultSet findNodeIdentifier(String parentCid, String name, i= nt index) throws SQLException { - if (findItemIdentifier =3D=3D null) + if (findNodeIdentifier =3D=3D null) { - findItemIdentifier =3D dbConnection.prepareStatement(FIND_ITEM_ID= ENTIFIER); + findNodeIdentifier =3D dbConnection.prepareStatement(FIND_NODE_ID= ENTIFIER); } else { - findItemIdentifier.clearParameters(); + findNodeIdentifier.clearParameters(); } - findItemIdentifier.setString(1, parentCid); - findItemIdentifier.setString(2, name); - findItemIdentifier.setInt(3, index); - return findItemIdentifier.executeQuery(); + findNodeIdentifier.setString(1, parentCid); + findNodeIdentifier.setString(2, name); + findNodeIdentifier.setInt(3, index); + return findNodeIdentifier.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findPropertyIdentifier(String parentCid, String nam= e) throws SQLException + { + if (findPropertyIdentifier =3D=3D null) + { + findPropertyIdentifier =3D dbConnection.prepareStatement(FIND_PRO= PERTY_IDENTIFIER); + } + else + { + findPropertyIdentifier.clearParameters(); + } + findPropertyIdentifier.setString(1, parentCid); + findPropertyIdentifier.setString(2, name); + return findPropertyIdentifier.executeQuery(); + } = /** * {@inheritDoc} Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-19 11:3= 2:39 UTC (rev 766) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-19 11:5= 1:16 UTC (rev 767) @@ -81,7 +81,9 @@ = protected PreparedStatement findPropertiesIdNameByParentId; = - protected PreparedStatement findItemIdentifier; + protected PreparedStatement findNodeIdentifier; + = + protected PreparedStatement findPropertyIdentifier; = protected PreparedStatement findItemName; = @@ -219,9 +221,11 @@ = FIND_ALL_PROPERTIES =3D "select ID from JCR_SITEM where I_CLASS=3D2 = and CONTAINER_NAME=3D?"; = - FIND_ITEM_IDENTIFIER =3D "select ID from JCR_SITEM" + " where CONTAI= NER_NAME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D?"; + FIND_NODE_IDENTIFIER =3D "select ID from JCR_SITEM" + " where I_CLAS= S=3D1 and CONTAINER_NAME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D?= "; + = + FIND_PROPERTY_IDENTIFIER =3D "select ID from JCR_SITEM" + " where I_= CLASS=3D2 and CONTAINER_NAME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX= =3D1"; = - FIND_ITEM_NAME =3D "select NAME from JCR_SITEM" + " where ID=3D?"; + FIND_ITEM_NAME =3D "select NAME, I_CLASS from JCR_SITEM" + " where I= D=3D?"; = INSERT_NODE =3D "insert into JCR_SITEM(ID, PARENT_ID, NAME, CONTAINER_NAME, VERSI= ON, I_CLASS, I_INDEX, N_ORDER_NUM) VALUES(?,?,?,?,?," @@ -610,19 +614,42 @@ * {@inheritDoc} */ @Override - protected ResultSet findItemIdentifier(String parentCid, String name, i= nt index) throws SQLException + protected ResultSet findNodeIdentifier(String parentCid, String name, i= nt index) throws SQLException { - if (findItemIdentifier =3D=3D null) - findItemIdentifier =3D dbConnection.prepareStatement(FIND_ITEM_ID= ENTIFIER); + if (findNodeIdentifier =3D=3D null) + { + findNodeIdentifier =3D dbConnection.prepareStatement(FIND_NODE_ID= ENTIFIER); + } else - findItemIdentifier.clearParameters(); - - findItemIdentifier.setString(1, containerName); - findItemIdentifier.setString(2, parentCid); - findItemIdentifier.setString(3, name); - findItemIdentifier.setInt(4, index); - return findItemIdentifier.executeQuery(); + { + findNodeIdentifier.clearParameters(); + } + findNodeIdentifier.setString(1, containerName); + findNodeIdentifier.setString(2, parentCid); + findNodeIdentifier.setString(3, name); + findNodeIdentifier.setInt(4, index); + return findNodeIdentifier.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findPropertyIdentifier(String parentCid, String nam= e) throws SQLException + { + if (findPropertyIdentifier =3D=3D null) + { + findPropertyIdentifier =3D dbConnection.prepareStatement(FIND_PRO= PERTY_IDENTIFIER); + } + else + { + findPropertyIdentifier.clearParameters(); + } + findPropertyIdentifier.setString(1, containerName); + findPropertyIdentifier.setString(2, parentCid); + findPropertyIdentifier.setString(3, name); + return findPropertyIdentifier.executeQuery(); + } = /** * {@inheritDoc} --===============2618049494290545398==-- From do-not-reply at jboss.org Thu Nov 19 07:09:53 2009 Content-Type: multipart/mixed; boundary="===============6815606192095618887==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r768 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/lock. Date: Thu, 19 Nov 2009 07:09:53 -0500 Message-ID: <200911191209.nAJC9rg8027301@svn01.web.mwc.hst.phx2.redhat.com> --===============6815606192095618887== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-19 07:09:52 -0500 (Thu, 19 Nov 2009) New Revision: 768 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java Log: EXOJCR-243: Updated LockManager, fixed map creation Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-19 11:51:16 UTC (= rev 767) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-19 12:09:52 UTC (= rev 768) @@ -43,6 +43,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; = @@ -120,6 +121,8 @@ } else lockTimeOut =3D DEFAULT_LOCK_TIMEOUT; + this.tokens =3D new HashMap(); = + this.tokenHash =3D new HashMap(); } = /** --===============6815606192095618887==-- From do-not-reply at jboss.org Thu Nov 19 07:19:06 2009 Content-Type: multipart/mixed; boundary="===============8729913737883825118==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r769 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/core/lock. Date: Thu, 19 Nov 2009 07:19:06 -0500 Message-ID: <200911191219.nAJCJ6OO029005@svn01.web.mwc.hst.phx2.redhat.com> --===============8729913737883825118== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-19 07:19:05 -0500 (Thu, 19 Nov 2009) New Revision: 769 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/lock/TestSessionLockManager.java Log: EXOJCR-243: test updated. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/core/lock/TestSessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-19 12:09:52 U= TC (rev 768) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-19 12:19:05 U= TC (rev 769) @@ -56,7 +56,7 @@ public void testAddLockToken() throws RepositoryException { NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testAddLockToken"); - node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + node1.addMixin("mix:lockable"); session.save(); // lock through session1 Lock lock1 =3D node1.lock(false, true); @@ -80,7 +80,7 @@ public void testLockUnlock() throws RepositoryException { NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testLockUnlock"); - node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + node1.addMixin("mix:lockable"); session.save(); // lock through session1 Lock lock1 =3D node1.lock(false, false); @@ -107,7 +107,7 @@ public void testGetLock() throws RepositoryException { NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testGetLock"); - node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + node1.addMixin("mix:lockable"); session.save(); // lock = Lock lock1 =3D node1.lock(false, false); @@ -122,7 +122,7 @@ { // checks that session-scoped locks are removed on logout NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testRemoveOnLogOut"); - node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + node1.addMixin("mix:lockable"); session.save(); // create new session2 CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); @@ -147,7 +147,7 @@ { // checks that open-scoped locks are not removed on logout NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testNotRemoveOnLogOut= "); - node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + node1.addMixin("mix:lockable"); session.save(); // create new session2 CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); @@ -177,7 +177,7 @@ int REMOVER_SCHEDULE_TIME =3D 10000; // 10s?! need to place correct = value int lockTimeOut =3D 2000; NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testRemoveByTimeOut"); - node1.addMixin(Constants.MIX_LOCKABLE.getAsString()); + node1.addMixin("mix:lockable"); session.save(); // set time out 2s node1.lock(false, lockTimeOut); --===============8729913737883825118==-- From do-not-reply at jboss.org Thu Nov 19 07:53:35 2009 Content-Type: multipart/mixed; boundary="===============0596387126076254071==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r770 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 2 other directories. Date: Thu, 19 Nov 2009 07:53:35 -0500 Message-ID: <200911191253.nAJCrZFu000856@svn01.web.mwc.hst.phx2.redhat.com> --===============0596387126076254071== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-19 07:53:34 -0500 (Thu, 19 Nov 2009) New Revision: 770 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/dataflow/LockPlainChangesLogImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/lock/TestSessionLockManager.java Log: EXOJCR-242: Updated low-level locking logic. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/dataflow/LockPlainChangesLogImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/LockPlainChangesLogImpl.java 2009-11-19 12:19:05 UTC (r= ev 769) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/LockPlainChangesLogImpl.java 2009-11-19 12:53:34 UTC (r= ev 770) @@ -44,6 +44,12 @@ super(items, sessionId, eventType); } = + public LockPlainChangesLogImpl(List items, String sessionId,= int eventType, LockData lockData) + { + super(items, sessionId, eventType); + this.lockData =3D lockData; + } + public LockData getLockData() { return lockData; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 20= 09-11-19 12:19:05 UTC (rev 769) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 20= 09-11-19 12:53:34 UTC (rev 770) @@ -22,6 +22,7 @@ import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.DataManager; import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PairChangesLog; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; @@ -32,9 +33,8 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.observation.ExtendedEvent; import org.exoplatform.services.jcr.util.IdGenerator; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; = import java.util.ArrayList; import java.util.List; @@ -118,40 +118,40 @@ return super.getItemData(parentData, name); } = -// /** -// * {@inheritDoc} -// */ -// public ItemData getItemData(String identifier) throws RepositoryExcep= tion -// { -// // from cache at first -// ItemData cdata =3D persistentManager.getCachedItemData(identifier); -// if (cdata !=3D null) -// return super.getItemData(identifier); -// -// if (!this.equals(versionDataManager) && !identifier.equals(Constan= ts.ROOT_UUID)) -// { -// // search in System cache for /jcr:system nodes only -// cdata =3D versionDataManager.persistentManager.getCachedItemDat= a(identifier); -// if (cdata !=3D null) -// if (isSystemDescendant(cdata.getQPath())) -// return versionDataManager.getItemData(identifier); -// else -// return null; -// } -// -// // then from persistence -// ItemData data =3D super.getItemData(identifier); -// if (data !=3D null) -// return data; -// else if (!this.equals(versionDataManager)) -// { -// // try from version storage if not the same -// data =3D versionDataManager.getItemData(identifier); -// if (data !=3D null && isSystemDescendant(data.getQPath())) -// return data; -// } -// return null; -// } + // /** + // * {@inheritDoc} + // */ + // public ItemData getItemData(String identifier) throws RepositoryEx= ception + // { + // // from cache at first + // ItemData cdata =3D persistentManager.getCachedItemData(identifi= er); + // if (cdata !=3D null) + // return super.getItemData(identifier); + // + // if (!this.equals(versionDataManager) && !identifier.equals(Cons= tants.ROOT_UUID)) + // { + // // search in System cache for /jcr:system nodes only + // cdata =3D versionDataManager.persistentManager.getCachedItem= Data(identifier); + // if (cdata !=3D null) + // if (isSystemDescendant(cdata.getQPath())) + // return versionDataManager.getItemData(identifier); + // else + // return null; + // } + // + // // then from persistence + // ItemData data =3D super.getItemData(identifier); + // if (data !=3D null) + // return data; + // else if (!this.equals(versionDataManager)) + // { + // // try from version storage if not the same + // data =3D versionDataManager.getItemData(identifier); + // if (data !=3D null && isSystemDescendant(data.getQPath())) + // return data; + // } + // return null; + // } = public void save(CompositeChangesLog changesLog) throws RepositoryExcep= tion, InvalidItemStateException { @@ -185,18 +185,39 @@ = if (vstates.size() > 0) { - versionLog.addLog((pairId !=3D null) ? new PairChangesLog(vsta= tes, changes.getSessionId(), changes - .getEventType(), pairId) : new PlainChangesLogImpl(vstates,= changes.getSessionId(), changes - .getEventType())); + if (pairId !=3D null) + { + versionLog.addLog(new PairChangesLog(vstates, changes.getSe= ssionId(), changes.getEventType(), pairId)); + } + else if (changes.getEventType() =3D=3D ExtendedEvent.LOCK) + { + versionLog.addLog(new LockPlainChangesLogImpl(vstates, chan= ges.getSessionId(), changes.getEventType(), + ((LockPlainChangesLogImpl)changes).getLockData())); + } + else + { + versionLog.addLog(new PlainChangesLogImpl(vstates, changes.= getSessionId(), changes.getEventType())); + } saveVersions =3D true; } = if (nvstates.size() > 0) { - nonVersionLog.addLog((pairId !=3D null) ? new PairChangesLog(n= vstates, changes.getSessionId(), changes - .getEventType(), pairId) : new PlainChangesLogImpl(nvstates= , changes.getSessionId(), changes - .getEventType())); = + if (pairId !=3D null) + { + nonVersionLog + .addLog(new PairChangesLog(nvstates, changes.getSessionI= d(), changes.getEventType(), pairId)); + } + else if (changes.getEventType() =3D=3D ExtendedEvent.LOCK) + { + nonVersionLog.addLog(new LockPlainChangesLogImpl(nvstates, = changes.getSessionId(), changes + .getEventType(), ((LockPlainChangesLogImpl)changes).getL= ockData())); + } + else + { + nonVersionLog.addLog(new PlainChangesLogImpl(nvstates, chan= ges.getSessionId(), changes.getEventType())); + } saveNonVersions =3D true; } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 12:19:05 UTC (rev 769) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 12:53:34 UTC (rev 770) @@ -390,7 +390,8 @@ { if (LOG.isDebugEnabled()) { - LOG.debug("FATAL Parent not found " + parentData.getQPath()= .getAsString() + " for " + name.getAsString(true)); + LOG.debug("FATAL Parent not found " + parentData.getQPath()= .getAsString() + " for " + + name.getAsString(true)); } = // TODO should be Exception, but after OPT branch optimization= merge, current impl requires it as null returned = @@ -723,6 +724,7 @@ */ public void addLockData(LockData lockData) throws RepositoryException { + startBatch(); if (lockData =3D=3D null) { throw new RepositoryException("Lock data to write can't be null!"= ); @@ -761,7 +763,8 @@ */ public void removeLockData(String identifier) throws RepositoryException { - if (identifier !=3D null) + startBatch(); + if (identifier =3D=3D null) { throw new RepositoryException("Item ID to clear lock can't be nul= l!"); } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/core/lock/TestSessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-19 12:19:05 U= TC (rev 769) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-19 12:53:34 U= TC (rev 770) @@ -21,7 +21,6 @@ import org.exoplatform.services.jcr.JcrImplBaseTest; import org.exoplatform.services.jcr.core.CredentialsImpl; import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.NodeImpl; import org.exoplatform.services.jcr.impl.core.SessionImpl; = @@ -65,7 +64,7 @@ CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); = - NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + NodeImpl node2 =3D (NodeImpl)session2.getItem(node1.getPath()); // check node locked assertTrue(node2.isLocked()); // check session2 has NO access to lock = @@ -89,7 +88,7 @@ CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); = - NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + NodeImpl node2 =3D (NodeImpl)session2.getItem(node1.getPath()); // check node locked assertTrue(node1.isLocked()); assertTrue(node2.isLocked()); @@ -128,7 +127,7 @@ CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); = - NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + NodeImpl node2 =3D (NodeImpl)session2.getItem(node1.getPath()); // lock through session2, as session-scoped Lock lock2 =3D node2.lock(false, true); // check session2 has access to lock = @@ -153,7 +152,7 @@ CredentialsImpl credentials =3D new CredentialsImpl("admin", "admin"= .toCharArray()); SessionImpl session2 =3D (SessionImpl)repository.login(credentials, = "ws"); = - NodeImpl node2 =3D (NodeImpl)session2.getNodeByUUID(node1.getUUID()); + NodeImpl node2 =3D (NodeImpl)session2.getItem(node1.getPath()); // lock through session2, as open-scoped Lock lock2 =3D node2.lock(false, false); // check session2 has access to lock = --===============0596387126076254071==-- From do-not-reply at jboss.org Thu Nov 19 08:59:33 2009 Content-Type: multipart/mixed; boundary="===============8420824426838793190==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r771 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 08:59:33 -0500 Message-ID: <200911191359.nAJDxXfn010306@svn01.web.mwc.hst.phx2.redhat.com> --===============8420824426838793190== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 08:59:33 -0500 (Thu, 19 Nov 2009) New Revision: 771 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.j= ava Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-203: conn tests Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTe= st.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java 2009-11-19 13:59:33 UTC (rev 771) @@ -0,0 +1,200 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import junit.framework.TestCase; + +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; +import org.jboss.cache.Cache; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; + +import java.io.IOException; +import java.io.Serializable; +import java.io.UnsupportedEncodingException; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 25.10.2009 + * + * @author
Peter N= edonosko = + * @version $Id$ + */ +public abstract class AbstractJBossCacheStorageConnectionTest extends Test= Case +{ + + protected JBossCacheStorageConnection conn; + + protected Cache cache; + + protected Node nodes; + + protected Node props; + + protected Node locks; + + protected String jbcConfig; + + /** + * {@inheritDoc} + */ + protected void setUp() throws Exception + { + super.setUp(); + + // JBossCache = + initJBCConfig(); + + cache =3D new DefaultCacheFactory().createCach= e(jbcConfig, false); + + initJBC(); + + // run cache + cache.create(); + cache.start(); + + Node cacheRoot =3D cache.getRoot(); + + // prepare cache structures + nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); + props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); + locks =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.LOCKS)= ); + + // JCR connection + conn =3D new JBossCacheStorageConnection(cache, nodes, props, locks); + } + + protected void initJBCConfig() + { + jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; + } + + protected void initJBC() throws Exception + { + // empty here + } + + /** + * {@inheritDoc} + */ + protected void tearDown() throws Exception + { + + cache.stop(); + cache.destroy(); + + super.tearDown(); + } + + protected void treePrint(Node node) + { + for (Node child : node.getChildren()) + { + System.out.println(child.toString()); + for (Serializable key : child.getKeys()) + { + System.out.println("\t" + key + "=3D" + child.get(key)); + } + if (!child.isLeaf()) + { + treePrint(child); + } + } + } + + protected void checkNode(Node rootNode, String no= deId, QPath nodePath) + { + Node node =3D nodes.getChild(Fqn.fromElements(= nodeId)); + + // check Node + Object dataObject =3D node.get(JBossCacheStorageConnection.ITEM_DATA= ); + assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); + + NodeData data =3D (NodeData)dataObject; + assertEquals("Node id wrong", nodeId, data.getIdentifier()); + assertEquals("Node path wrong", nodePath, data.getQPath()); + } + + protected void checkProp(String propId, QPath propPath, Object propValu= e) throws UnsupportedEncodingException, + IllegalStateException, IOException + { + Node prop =3D props.getChild(Fqn.fromElements(= propId)); + Object dataObject =3D prop.get(JBossCacheStorage.ITEM_DATA); + assertNotNull("Property item data should exists", dataObject); + assertTrue("Property item data is not a Property", dataObject instan= ceof PropertyData); + + PropertyData propData =3D (PropertyData)dataObject; + assertEquals("Property id wrong", propId, propData.getIdentifier()); + assertEquals("Property path wrong", propPath, propData.getQPath()); + assertEquals("Property Value wrong", propValue, new String(propData.= getValues().get(0).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + } + + protected void checkChildProp(Node node, Internal= QName propName, String propId, QPath propPath, + Object propValue) throws UnsupportedEncodingException, IllegalStateE= xception, IOException + { + String pid =3D (String)node.get(propName.getAsString()); + + assertNotNull("Property ID should exists", pid); + assertEquals("Property ID wrong", propId, pid); + + checkProp(propId, propPath, propValue); + } + + protected void checkChildNode(Node rootNode, Stri= ng childId, QPath childPath) + { + checkChildNode(rootNode, childId, childPath, -1, -1); + } + + protected void checkChildNode(Node rootNode, Stri= ng childId, QPath childPath, int orderNum, + int version) + { + Node childNode =3D + rootNode.getChild(Fqn + .fromElements(childPath.getEntries()[childPath.getEntries().le= ngth - 1].getAsString(true))); + + assertNotNull("Child Node should exists", childNode); + String childNodeId =3D (String)childNode.get(JBossCacheStorage.ITEM_= ID); + Node node =3D nodes.getChild(Fqn.fromElements(= childNodeId)); + assertNotNull("Node by ID should exists", node); + + Object childNodeObject =3D node.get(JBossCacheStorage.ITEM_DATA); + assertTrue("Node item data is not a Node", childNodeObject instanceo= f NodeData); + NodeData childNodeData =3D (NodeData)childNodeObject; + assertEquals("Node id wrong", childId, childNodeData.getIdentifier()= ); + assertEquals("Node path wrong", childPath, childNodeData.getQPath()); + + if (orderNum >=3D 0) + { + assertEquals("Node order number wrong", orderNum, childNodeData.g= etOrderNumber()); + } + + if (version >=3D 0) + { + assertEquals("Node persisted version wrong", version, childNodeDa= ta.getPersistedVersion()); + } + } + = +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/AbstractJBossCacheStora= geConnectionTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 12:53:34 UTC (rev 770) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 13:59:33 UTC (rev 771) @@ -51,161 +51,9 @@ * @author Peter N= edonosko = * @version $Id$ */ -public class JBossCacheStorageConnectionTest extends TestCase +public class JBossCacheStorageConnectionTest extends AbstractJBossCacheSto= rageConnectionTest { = - protected JBossCacheStorageConnection conn; - - protected Cache cache; - - protected Node nodes; - - protected Node props; - - protected Node locks; - - protected String jbcConfig; - - /** - * {@inheritDoc} - */ - protected void setUp() throws Exception - { - super.setUp(); - - // JBossCache = - initJBCConfig(); - - cache =3D new DefaultCacheFactory().createCach= e(jbcConfig, false); - - initJBC(); - - // run cache - cache.create(); - cache.start(); - - Node cacheRoot =3D cache.getRoot(); - - // prepare cache structures - nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); - props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); - locks =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.LOCKS)= ); - - // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props, locks); - } - - protected void initJBCConfig() - { - jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; - } - - protected void initJBC() throws Exception - { - // empty here - } - - /** - * {@inheritDoc} - */ - protected void tearDown() throws Exception - { - - cache.stop(); - cache.destroy(); - - super.tearDown(); - } - - private void treePrint(Node node) - { - for (Node child : node.getChildren()) - { - System.out.println(child.toString()); - for (Serializable key : child.getKeys()) - { - System.out.println("\t" + key + "=3D" + child.get(key)); - } - if (!child.isLeaf()) - { - treePrint(child); - } - } - } - - private void checkNode(Node rootNode, String node= Id, QPath nodePath) - { - Node node =3D nodes.getChild(Fqn.fromElements(= nodeId)); - - // check Node - Object dataObject =3D node.get(JBossCacheStorageConnection.ITEM_DATA= ); - assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); - - NodeData data =3D (NodeData)dataObject; - assertEquals("Node id wrong", nodeId, data.getIdentifier()); - assertEquals("Node path wrong", nodePath, data.getQPath()); - } - - private void checkProp(String propId, QPath propPath, Object propValue)= throws UnsupportedEncodingException, - IllegalStateException, IOException - { - Node prop =3D props.getChild(Fqn.fromElements(= propId)); - Object dataObject =3D prop.get(JBossCacheStorage.ITEM_DATA); - assertNotNull("Property item data should exists", dataObject); - assertTrue("Property item data is not a Property", dataObject instan= ceof PropertyData); - - PropertyData propData =3D (PropertyData)dataObject; - assertEquals("Property id wrong", propId, propData.getIdentifier()); - assertEquals("Property path wrong", propPath, propData.getQPath()); - assertEquals("Property Value wrong", propValue, new String(propData.= getValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - } - - private void checkChildProp(Node node, InternalQN= ame propName, String propId, QPath propPath, - Object propValue) throws UnsupportedEncodingException, IllegalStateE= xception, IOException - { - String pid =3D (String)node.get(propName.getAsString()); - - assertNotNull("Property ID should exists", pid); - assertEquals("Property ID wrong", propId, pid); - - checkProp(propId, propPath, propValue); - } - - private void checkChildNode(Node rootNode, String= childId, QPath childPath) - { - checkChildNode(rootNode, childId, childPath, -1, -1); - } - - private void checkChildNode(Node rootNode, String= childId, QPath childPath, int orderNum, - int version) - { - Node childNode =3D - rootNode.getChild(Fqn - .fromElements(childPath.getEntries()[childPath.getEntries().le= ngth - 1].getAsString(true))); - - assertNotNull("Child Node should exists", childNode); - String childNodeId =3D (String)childNode.get(JBossCacheStorage.ITEM_= ID); - Node node =3D nodes.getChild(Fqn.fromElements(= childNodeId)); - assertNotNull("Node by ID should exists", node); - - Object childNodeObject =3D node.get(JBossCacheStorage.ITEM_DATA); - assertTrue("Node item data is not a Node", childNodeObject instanceo= f NodeData); - NodeData childNodeData =3D (NodeData)childNodeObject; - assertEquals("Node id wrong", childId, childNodeData.getIdentifier()= ); - assertEquals("Node path wrong", childPath, childNodeData.getQPath()); - - if (orderNum >=3D 0) - { - assertEquals("Node order number wrong", orderNum, childNodeData.g= etOrderNumber()); - } - - if (version >=3D 0) - { - assertEquals("Node persisted version wrong", version, childNodeDa= ta.getPersistedVersion()); - } - } - public void testAddNode() throws Exception { // add root (/) --===============8420824426838793190==-- From do-not-reply at jboss.org Thu Nov 19 09:02:09 2009 Content-Type: multipart/mixed; boundary="===============1675949524322341443==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r772 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Thu, 19 Nov 2009 09:02:09 -0500 Message-ID: <200911191402.nAJE29Gt010957@svn01.web.mwc.hst.phx2.redhat.com> --===============1675949524322341443== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 09:02:09 -0500 (Thu, 19 Nov 2009) New Revision: 772 Removed: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java Log: EXOJCR-203: tree based impl deleted Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java 2009-11-19 13= :59:33 UTC (rev 771) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorage.java 2009-11-19 14= :02:09 UTC (rev 772) @@ -1,112 +0,0 @@ -/* - * 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. - */ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.jboss.cache.Fqn; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 31.10.2009 - * - * @author Peter N= edonosko = - * @version $Id$ - */ -(a)Deprecated -public abstract class JBossCacheTreeStorage -{ - - @Deprecated - public static final String TREE =3D "$TREE".intern(); - - @Deprecated - public static final String ITEMS =3D "$ITEMS".intern(); - = - public static final String ITEM_DATA =3D "$data".intern(); - - public static final String ITEM_ID =3D "$id".intern(); - - @Deprecated - protected final Fqn treeRoot; - - protected final Fqn itemsRoot; - - @Deprecated - protected JBossCacheTreeStorage(Fqn treeRoot, Fqn items= Root) - { - this.itemsRoot =3D itemsRoot; - = - this.treeRoot =3D treeRoot; - } - - @Deprecated - protected Fqn makeNodeFqn(QPath nodePath) - { - QPathEntry[] path =3D nodePath.getEntries(); - String[] fqns =3D new String[path.length]; - - for (int i =3D 0; i < path.length; i++) - { - fqns[i] =3D path[i].getAsString(true); - } - - return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); - } - - @Deprecated - protected Fqn makeParentFqn(QPath propertyPath) - { - QPathEntry[] path =3D propertyPath.getEntries(); - int pathLen =3D path.length - 1; - String[] fqns =3D new String[pathLen]; - - for (int i =3D 0; i < pathLen; i++) - { - fqns[i] =3D path[i].getAsString(true); - } - - return Fqn.fromRelativeFqn(treeRoot, Fqn.fromElements(fqns)); - } - = - protected Fqn makeItemFqn(String nodeId) - { - return Fqn.fromRelativeFqn(itemsRoot, Fqn.fromString(nodeId)); - } - -} Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-19 13:59:33 UTC (rev 771) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnection.java 200= 9-11-19 14:02:09 UTC (rev 772) @@ -1,443 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.core.lock.LockData; -import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.cache.Cache; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - -/** - * DEPRECATED - DO NOT USE! - * = - * Created by The eXo Platform SAS. - * = - *
Date: 23.10.2009
- * - * Cache contains several regions:
- * Workspace tree. /$ROOT: On each leaf (JBossCache Node) an JCR Item Id s= tored.
- * Items map. /$ITEMS: Key=3DId, Value =3D ItemData.
- * References map ??? /$REFS: Key=3DNodeId, Value =3D PropertyId.
- * - * @author Peter N= edonosko = - * @version $Id$ - */ -(a)Deprecated -public class JBossCacheTreeStorageConnection extends JBossCacheTreeStorage= implements WorkspaceStorageConnection -{ - - protected static final Log LOG =3D ExoLogger.getLogger("jcr.JBossCacheS= torageConnection"); - - private final Cache cache; - - //private final Node treeRoot; - - //private final Node itemsRoot; - - /** - * Start batching flag. 'true' if batching was started, 'false' if bat= ching is not start. = - */ - private boolean batchStarted =3D false; - - /** - * JBossCacheStorageConnection constructor. - * - * @param cache Cache - */ - @Deprecated - public JBossCacheTreeStorageConnection(Cache cach= e, Node treeRoot, - Node itemsRoot) - { - super(treeRoot.getFqn(), itemsRoot.getFqn()); - - this.cache =3D cache; - //this.itemsRoot =3D itemsRoot; - //this.treeRoot =3D treeRoot; - } - - /** - * {@inheritDoc} - */ - public void add(NodeData data) throws RepositoryException, UnsupportedO= perationException, InvalidItemStateException, - IllegalStateException - { - startBatch(); - cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, data.getIdentifier(= )); - cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, data); // tr= eePrint(treeRoot); - } - - /** - * {@inheritDoc} - */ - public void add(PropertyData data) throws RepositoryException, Unsuppor= tedOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - Fqn parentFqn =3D makeParentFqn(data.getQPath()); - - // add an attr to the parent node as key=3DPropertyName value=3DProp= ertyId - cache.put(parentFqn, data.getQPath().getName().getAsString(), data.g= etIdentifier()); - cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, data); - } - - /** - * {@inheritDoc} - */ - public void delete(NodeData data) throws RepositoryException, Unsupport= edOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - cache.removeNode(makeNodeFqn(data.getQPath())); - cache.removeNode(makeItemFqn(data.getIdentifier())); - } - - /** - * {@inheritDoc} - */ - public void delete(PropertyData data) throws RepositoryException, Unsup= portedOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - // delete attr on parent by key=3DPropertyName - cache.remove(makeParentFqn(data.getQPath()), data.getQPath().getName= ().getAsString()); - cache.removeNode(makeItemFqn(data.getIdentifier())); - } - - /** - * {@inheritDoc} - */ - public List getChildNodesData(NodeData parent) throws Reposit= oryException, IllegalStateException - { - //Set childNames =3D cache.getChildrenNames(makeNodeFqn(pare= nt.getQPath())); - Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); - } - - Set> childNodes =3D parentNode.getChildre= n(); - - List childs =3D new ArrayList(); - for (Node child : childNodes) - { - String childId =3D (String)child.get(ITEM_ID); - - // TODO NodeData or PropertyData? As ItemData check then and cast. - NodeData node =3D (NodeData)cache.get(makeItemFqn(childId), ITEM_= DATA); - if (node =3D=3D null) - { - throw new RepositoryException("One of childs is null. Parent "= + parent.getQPath().getAsString()); - } - childs.add(node); - } - - return childs; - } - - private void treePrint(Node node) - { - for (Node child : node.getChildren()) - { - System.out.println(child.toString()); - for (Serializable key : child.getKeys()) - { - System.out.println("\t" + key + "=3D" + child.get(key)); - } - if (!child.isLeaf()) - { - treePrint(child); - } - } - } - - /** - * {@inheritDoc} - */ - public List getChildPropertiesData(NodeData parent) throw= s RepositoryException, IllegalStateException - { - // TODO treeRoot.getChild(f) possible if f not a direct child??? = - Node parentNode =3D cache.getNode(makeNodeFqn(= parent.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get child Nodes error: parent no= t found " + parent.getQPath().getAsString()); - } - - List childs =3D new ArrayList(); - - for (Serializable key : parentNode.getKeys()) - { - if (!key.equals(ITEM_ID)) - { - String propId =3D (String)parentNode.get(key); - // TODO NodeData or PropertyData? As ItemData check then and c= ast. = - PropertyData property =3D (PropertyData)cache.get(makeItemFqn(= propId), ITEM_DATA); - if (property =3D=3D null) - { - throw new RepositoryException("One of childs is null. Paren= t " + parent.getQPath().getAsString()); - } - childs.add(property); - } - } - - return childs; - } - - /** - * {@inheritDoc} - */ - public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException, IllegalStateException - { - // TODO it's same as getChild... now - return getChildPropertiesData(parent); - } - - /** - * {@inheritDoc} - */ - public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException, IllegalStateException - { - Node parentNode =3D cache.getNode(makeNodeFqn(= parentData.getQPath())); - if (parentNode =3D=3D null) - { - throw new IllegalStateException("Get Item data error: parent not = found " + parentData.getQPath().getAsString()); - } - - // TODO check performance of Node vs Property get - - String propertyId =3D (String)parentNode.get(name.getAsString()); - if (propertyId !=3D null) - { - // it's Property Item - return (PropertyData)cache.get(makeItemFqn(propertyId), ITEM_DATA= ); - } - else - { - // it's Node Item - Node node =3D parentNode.getChild(name.getA= sString(true)); // TODO String not Fqn? - if (node !=3D null) - { - String nodeId =3D (String)node.get(ITEM_ID); - if (nodeId !=3D null) - { - return (NodeData)cache.get(makeItemFqn(nodeId), ITEM_DATA); - } - } - } - - return null; - } - - /** - * {@inheritDoc} - */ - public ItemData getItemData(String identifier) throws RepositoryExcepti= on, IllegalStateException - { - return (ItemData)cache.get(makeItemFqn(identifier), ITEM_DATA); - } - - /** - * {@inheritDoc} - */ - public List getReferencesData(String nodeIdentifier) thro= ws RepositoryException, - IllegalStateException, UnsupportedOperationException - { - // TODO refs impl - return new ArrayList(); - } - - /** - * {@inheritDoc} - */ - public void rename(NodeData data) throws RepositoryException, Unsupport= edOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - // TODO move Node to a new position at the tree, - // but prev location was in prev DELETE. - } - - /** - * {@inheritDoc} - */ - public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - - // TODO it's put anyway.. but with check? - Object prev =3D cache.put(makeNodeFqn(data.getQPath()), ITEM_ID, dat= a.getIdentifier()); - if (prev =3D=3D null) - { - throw new IllegalStateException("Node was deleted (tree)"); - } - - prev =3D cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, dat= a); - if (prev =3D=3D null) - { - throw new IllegalStateException("Node was deleted (items)"); - } - } - - /** - * {@inheritDoc} - */ - public void update(PropertyData data) throws RepositoryException, Unsup= portedOperationException, - InvalidItemStateException, IllegalStateException - { - startBatch(); - - // TODO it's put anyway.. but with check? - Fqn parentFqn =3D makeParentFqn(data.getQPath()); - Object prev =3D cache.put(parentFqn, data.getQPath().getName().getAs= String(), data.getIdentifier()); - if (prev =3D=3D null) - { - throw new IllegalStateException("Property was deleted (tree)"); - } - - prev =3D cache.put(makeItemFqn(data.getIdentifier()), ITEM_DATA, dat= a); - if (prev =3D=3D null) - { - throw new IllegalStateException("Property was deleted (items)"); - } - } - - /** - * {@inheritDoc} - */ - public void commit() throws IllegalStateException, RepositoryException - { - if (LOG.isDebugEnabled()) - { - LOG.debug("commit " + batchStarted); - } - - // end batch - if (batchStarted) - { - this.cache.endBatch(true); // treePrint(treeRoot); - batchStarted =3D false; - } - else - { - // TODO - LOG.warn("Commit call without changes made."); - } - } - - /** - * {@inheritDoc} - */ - public void rollback() throws IllegalStateException, RepositoryException - { - if (LOG.isDebugEnabled()) - { - LOG.debug("rollback " + batchStarted); - } - - // rollback batch - if (batchStarted) - { - this.cache.endBatch(false); - batchStarted =3D false; - } - else - { - // TODO - LOG.warn("Rollback call without changes made."); - } - } - - /** - * {@inheritDoc} - */ - public boolean isOpened() - { - return true; - } - - /** - * {@inheritDoc} - */ - public void close() throws IllegalStateException, RepositoryException - { - // TODO Auto-generated method stub - } - - /** - * Start batching. - */ - private void startBatch() - { - if (!batchStarted) - { - batchStarted =3D true; - this.cache.startBatch(); - } - } - - /** - * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) - */ - public LockData getLockData(String identifier) - { - throw new UnsupportedOperationException(); - } - - /** - * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLocksData() - */ - public List getLocksData() - { - throw new UnsupportedOperationException(); - } - - /** - * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #addLockData(org.exoplatform.services.jcr.impl.core.lock.LockData) - */ - public void addLockData(LockData lockData) throws RepositoryException - { - // TODO Auto-generated method stub - = - } - - /** - * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #removeLockData(java.lang.String) - */ - public void removeLockData(String identifier) throws RepositoryException - { - // TODO Auto-generated method stub - = - } - -} Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java= 2009-11-19 13:59:33 UTC (rev 771) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheTreeStorageConnectionTest.java= 2009-11-19 14:02:09 UTC (rev 772) @@ -1,685 +0,0 @@ -/* - * 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. - */ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import junit.framework.TestCase; - -import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.QPathEntry; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; -import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.jboss.cache.Cache; -import org.jboss.cache.DefaultCacheFactory; -import org.jboss.cache.Fqn; -import org.jboss.cache.Node; - -import java.io.Serializable; -import java.util.List; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 25.10.2009 - * - * @author Peter N= edonosko = - * @version $Id$ - */ -public class JBossCacheTreeStorageConnectionTest extends TestCase -{ - - protected JBossCacheTreeStorageConnection conn; - - protected Cache cache; - - protected Node tree; - - protected Node items; - = - protected String jbcConfig; = - - /** - * {@inheritDoc} - */ - protected void setUp() throws Exception - { - super.setUp(); - - // JBossCache = - initJBCConfig(); - = - cache =3D new DefaultCacheFactory().createCach= e(jbcConfig); - - Node cacheRoot =3D cache.getRoot(); - //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements("repo", "ws")); - - // prepare cache structures - tree =3D cacheRoot.addChild(Fqn.fromString(JBossCacheTreeStorage.TRE= E)); - items =3D cacheRoot.addChild(Fqn.fromString(JBossCacheTreeStorage.IT= EMS)); - - // run cache - cache.create(); - cache.start(); - - // JCR connection - conn =3D new JBossCacheTreeStorageConnection(cache, tree, items); - } - = - protected void initJBCConfig() { - jbcConfig =3D "conf/standalone/test-jbosscache-config-jdbcloader.xml= "; - } - - /** - * {@inheritDoc} - */ - protected void tearDown() throws Exception - { - - cache.stop(); - cache.destroy(); - - super.tearDown(); - } - - private void treePrint(Node node) - { - for (Node child : node.getChildren()) - { - System.out.println(child.toString()); - for (Serializable key : child.getKeys()) - { - System.out.println("\t" + key + "=3D" + child.get(key)); - } - if (!child.isLeaf()) - { - treePrint(child); - } - } - } - - private Fqn makeFqn(Node root, QPath node= Path) - { - QPathEntry[] path =3D nodePath.getEntries(); - String[] fqns =3D new String[path.length]; - - for (int i =3D 0; i < path.length; i++) - { - fqns[i] =3D path[i].getAsString(true); - } - - return Fqn.fromRelativeFqn(root.getFqn(), Fqn.fromElements(fqns)); - } - - public void testAddNode() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check in tree - treePrint(tree); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertNotNull("Node expected", rootNode); - - assertEquals("Childs expected", 2, rootNode.getChildren().size()); - - for (Node child : rootNode.getChildren()) - { - String nodeName =3D child.getFqn().getLastElementAsString(); - String nodeId =3D (String)child.get(JBossCacheStorageConnection.I= TEM_ID); - if (nodeName.equals(node1path.getEntries()[node1path.getEntries()= .length - 1].getAsString(true))) - { - assertEquals("Node id wrong", node1id, nodeId); - } - else if (nodeName - .equals(Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_S= YSTEM_PATH.getEntries().length - 1] - .getAsString(true))) - { - assertEquals("Node id wrong", Constants.SYSTEM_UUID, nodeId); - } - else - { - fail("Wrong Node name " + nodeName); - } - } - - // check in items - treePrint(items); - - Node itemsNode =3D items.getChild(Fqn.fromElem= ents(node1id)); - assertNotNull("Node item data should exists", itemsNode); - - Object dataObject =3D itemsNode.get(JBossCacheStorageConnection.ITEM= _DATA); - assertTrue("Node item data is not a Node", dataObject instanceof Nod= eData); - - NodeData data =3D (NodeData)dataObject; - assertEquals("Node id wrong", node1id, data.getIdentifier()); - assertEquals("Node path wrong", node1path, data.getQPath()); - } - - public void testAddProperty() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); - String propValue1 =3D "Property value #1"; - propData1.setValue(new TransientValueData(propValue1)); - conn.add(propData1); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); - TransientPropertyData propData2 =3D new TransientPropertyData(propPa= th2, propId2, 1, 1, Constants.ROOT_UUID, false); - String propValue2 =3D "Property value #2"; - propData2.setValue(new TransientValueData(propValue2)); - conn.add(propData2); - - // check in tree - treePrint(tree); - - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertEquals("Attributes ammount wrong", 3, rootNode.getKeys().size(= )); - - String pid1 =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAs= String()); - assertNotNull("Property ID should exists", pid1); - assertEquals("Property ID wrong", propId1, pid1); - - String pid2 =3D (String)rootNode.get(Constants.JCR_MIXINTYPES.getAsS= tring()); - assertNotNull("Property ID should exists", pid2); - assertEquals("Property ID wrong", propId2, pid2); - - // TODO check order - int index =3D 0; - for (Serializable key : rootNode.getKeys()) - { - //System.out.println(key); - //index++; - } - - // check in items - treePrint(items); - - Node itemsProp1 =3D items.getChild(Fqn.fromEle= ments(propId1)); - Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data1Object); - assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); - - PropertyData data1 =3D (PropertyData)data1Object; - assertEquals("Property id wrong", propId1, data1.getIdentifier()); - assertEquals("Property path wrong", propPath1, data1.getQPath()); - assertEquals("Property Value wrong", propValue1, new String(data1.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - - Node itemsProp2 =3D items.getChild(Fqn.fromEle= ments(propId2)); - Object data2Object =3D itemsProp2.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data2Object); - assertTrue("Property item data is not a Property", data2Object insta= nceof PropertyData); - - PropertyData data2 =3D (PropertyData)data2Object; - assertEquals("Property id wrong", propId2, data2.getIdentifier()); - assertEquals("Property path wrong", propPath2, data2.getQPath()); - assertEquals("Property Value wrong", propValue2, new String(data2.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - } - - public void testDeleteNode() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertEquals("Number of childs wrong", 2, rootNode.getChildren().siz= e()); - - // delete /node - conn.delete(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // check in tree - treePrint(tree); - - Node node =3D - rootNode.getChild(Fqn - .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); - - assertNull("Node should be deleted", node); - - assertEquals("Childs expected", 1, rootNode.getChildren().size()); - - Node child =3D rootNode.getChildren().iterator= ().next(); - assertEquals("Node name wrong", - Constants.JCR_SYSTEM_PATH.getEntries()[Constants.JCR_SYSTEM_PATH.= getEntries().length - 1].getAsString(true), - child.getFqn().getLastElementAsString()); - - assertEquals("Node id wrong", Constants.SYSTEM_UUID, (String)child.g= et(JBossCacheStorageConnection.ITEM_ID)); - - // check in items - treePrint(items); - - assertNull("Node item data should not exists", items.getChild(Fqn.fr= omElements(node1id))); - assertNotNull("Node item data should exists", items.getChild(Fqn.fro= mElements(Constants.SYSTEM_UUID))); - } - - public void testDeleteProperty() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, - 1, 1, Constants.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, - 1, 1, Constants.ROOT_UUID, false)); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - // delete /jcr:primaryType - conn.delete(new TransientPropertyData(QPath.makeChildPath(Constants.= ROOT_PATH, Constants.JCR_PRIMARYTYPE), - propId1, 1, 1, Constants.ROOT_UUID, false)); - - // check in tree - treePrint(tree); - - assertEquals("Number of childs wrong", 2, rootNode.getKeys().size()); - - assertNull("Property should be deleted", rootNode.get(Constants.JCR_= PRIMARYTYPE.getAsString())); - - assertNotNull("Property should exists", rootNode.get(Constants.JCR_M= IXINTYPES.getAsString())); - - // check in items - treePrint(items); - - assertNull("Property item data should not exists", items.getChild(Fq= n.fromElements(propId1))); - assertNotNull("Property item data should exists", items.getChild(Fqn= .fromElements(propId2))); - } - - public void testUpdateNode() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // get root node ([]:1) - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - // update /node (order number) - int nodeOrderNumb =3D 1; - conn.update(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], - nodeOrderNumb, Constants.ROOT_UUID, new AccessControlList())); - - // check in tree - treePrint(tree); - - Node node =3D - rootNode.getChild(Fqn - .fromElements(node1path.getEntries()[node1path.getEntries().le= ngth - 1].getAsString(true))); - - assertNotNull("Node should exists", node); - assertEquals("Child expected", 1, rootNode.getChildren().size()); - - // check in items - treePrint(items); - - Node itemNode =3D items.getChild(Fqn.fromEleme= nts(node1id)); - assertNotNull("Node item data should exists", itemNode); - - Object dataObject =3D itemNode.get(JBossCacheStorageConnection.ITEM_= DATA); - assertTrue("Node item data should be a NodeData", dataObject instanc= eof NodeData); - assertEquals("Node id wrong", node1id, ((NodeData)dataObject).getIde= ntifier()); - assertEquals("Node path wrong", node1path, ((NodeData)dataObject).ge= tQPath()); - assertEquals("Node order number wrong", nodeOrderNumb, ((NodeData)da= taObject).getOrderNumber()); - } - - public void testUpdateProperty() throws Exception - { - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/prop1) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); - String propValue1 =3D "Property value #1"; - propData1.setValue(new TransientValueData(propValue1)); - conn.add(propData1); - - // update property (/prop1) with new value - TransientPropertyData propDataU =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); - String propValueU =3D "Updated Property value #1"; - propDataU.setValue(new TransientValueData(propValueU)); - conn.update(propDataU); - - // check in tree - treePrint(tree); - - Node rootNode =3D - tree.getChild(Fqn.fromElements(Constants.ROOT_PATH.getEntries()[C= onstants.ROOT_PATH.getEntries().length - 1] - .getAsString(true))); - - assertEquals("Attributes ammount wrong", 2, rootNode.getKeys().size(= )); - - String pid =3D (String)rootNode.get(Constants.JCR_PRIMARYTYPE.getAsS= tring()); - assertEquals("Property ID wrong", propId1, pid); - - // check in items - treePrint(items); - - Node itemsProp1 =3D items.getChild(Fqn.fromEle= ments(propId1)); - Object data1Object =3D itemsProp1.get(JBossCacheStorageConnection.IT= EM_DATA); - assertNotNull("Property item data should exists", data1Object); - assertTrue("Property item data is not a Property", data1Object insta= nceof PropertyData); - - PropertyData data1 =3D (PropertyData)data1Object; - assertEquals("Property id wrong", propId1, data1.getIdentifier()); - assertEquals("Property path wrong", propPath1, data1.getQPath()); - assertEquals("Property Value wrong", propValueU, new String(data1.ge= tValues().get(0).getAsByteArray(), - Constants.DEFAULT_ENCODING)); - } - - public void testGetNodeByName() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check = - ItemData nodeItem =3D - conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), - node1path.getEntries()[node1path.getEntries().length - 1]); - - assertTrue("Node expected", nodeItem.isNode()); - assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); - assertEquals("Node path wrong", node1path, nodeItem.getQPath()); - } - - public void testGetPropertyByName() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); - conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); - - // check = - ItemData propItem =3D - conn.getItemData(new TransientNodeData(Constants.ROOT_PATH, Const= ants.ROOT_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new Acces= sControlList()), - propPath1.getEntries()[propPath1.getEntries().length - 1]); - - assertFalse("Proeprty expected", propItem.isNode()); - assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); - assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); - } - - public void testGetNodeById() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check = - ItemData nodeItem =3D conn.getItemData(node1id); - - assertTrue("Node expected", nodeItem.isNode()); - assertEquals("Node id wrong", node1id, nodeItem.getIdentifier()); - assertEquals("Node path wrong", node1path, nodeItem.getQPath()); - } - - public void testGetPropertyById() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); - conn.add(new TransientPropertyData(propPath1, propId1, 1, 1, Constan= ts.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - QPath propPath2 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_MIXINTYPES); - conn.add(new TransientPropertyData(propPath2, propId2, 1, 1, Constan= ts.ROOT_UUID, false)); - - // check = - ItemData propItem =3D conn.getItemData(propId1); - - assertFalse("Proeprty expected", propItem.isNode()); - assertEquals("Proeprty id wrong", propId1, propItem.getIdentifier()); - assertEquals("Proeprty path wrong", propPath1, propItem.getQPath()); - } - - public void testGetChildNodes() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add node (/node) - String node1id =3D "1"; - QPath node1path =3D QPath.parse("[]:1[]node:1"); - conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - - // add /jcr:system - conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - - // check in tree - treePrint(tree); - - List childs =3D - conn.getChildNodesData(new TransientNodeData(Constants.ROOT_PATH,= Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); - - assertEquals("Childs amount wrong", 2, childs.size()); - - for (NodeData child : childs) - { - if (child.getQPath().equals(node1path)) - { - assertEquals("Node id wrong", node1id, child.getIdentifier()); - } - else if (child.getQPath().equals(Constants.JCR_SYSTEM_PATH)) - { - assertEquals("Node id wrong", Constants.SYSTEM_UUID, child.get= Identifier()); - } - else - { - fail("Wrong Node found"); - } - } - } - - public void testGetChildProperties() throws Exception - { - // TODO prepare using JCR WDC API (not a right way, JBC API better..= . but read assumes the write works) - // add root (/) - conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_PARENT_UUID, new AccessCo= ntrolList())); - - // add property (/jcr:primaryType) - String propId1 =3D "1"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, - 1, 1, Constants.ROOT_UUID, false)); - - // add property (/jcr:mixinTypes) - String propId2 =3D "2"; - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_MIXINTYPES), propId2, - 1, 1, Constants.ROOT_UUID, false)); - - // add property (/a) - String propId3 =3D "3"; - InternalQName propName3 =3D InternalQName.parse("[]a"); - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName3), propId3, 1, 1, - Constants.ROOT_UUID, false)); - - // add property (/b) - String propId4 =3D "4"; - InternalQName propName4 =3D InternalQName.parse("[]b"); - conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, propName4), propId4, 1, 1, - Constants.ROOT_UUID, false)); - - // check - treePrint(tree); - - List childs =3D - conn.getChildPropertiesData(new TransientNodeData(Constants.ROOT_= PATH, Constants.ROOT_UUID, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.= ROOT_PARENT_UUID, new AccessControlList())); - - assertEquals("Childs amount wrong", 4, childs.size()); - - for (PropertyData child : childs) - { - if (child.getQPath().getName().equals(Constants.JCR_PRIMARYTYPE)) - { - assertEquals("Property id wrong", propId1, child.getIdentifier= ()); - } - else if (child.getQPath().getName().equals(Constants.JCR_MIXINTYP= ES)) - { - assertEquals("Property id wrong", propId2, child.getIdentifier= ()); - } - else if (child.getQPath().getName().equals(propName3)) - { - assertEquals("Property id wrong", propId3, child.getIdentifier= ()); - } - else if (child.getQPath().getName().equals(propName4)) - { - assertEquals("Property id wrong", propId4, child.getIdentifier= ()); - } - else - { - fail("Wrong Property found"); - } - } - } - -} --===============1675949524322341443==-- From do-not-reply at jboss.org Thu Nov 19 09:03:58 2009 Content-Type: multipart/mixed; boundary="===============8875193672684043827==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r773 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 09:03:57 -0500 Message-ID: <200911191403.nAJE3vVC011171@svn01.web.mwc.hst.phx2.redhat.com> --===============8875193672684043827== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 09:03:57 -0500 (Thu, 19 Nov 2009) New Revision: 773 Removed: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java Log: EXOJCR-203: tree based impl deleted Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java 2009-11-1= 9 14:02:09 UTC (rev 772) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/ExoJCRTreeCacheLoaderTest.java 2009-11-1= 9 14:03:57 UTC (rev 773) @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 3 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - - -/** - * Created by The eXo Platform SAS. - * = - *
Date: 30.10.2009 - * - * @author Peter N= edonosko = - * @version $Id$ - */ -public class ExoJCRTreeCacheLoaderTest extends JBossCacheTreeStorageConnec= tionTest -{ - - @Override - protected void initJBCConfig() - { - jbcConfig =3D "conf/standalone/test-jbosscache-config-exoloader.xml"; - } - - = - = -} --===============8875193672684043827==-- From do-not-reply at jboss.org Thu Nov 19 09:07:11 2009 Content-Type: multipart/mixed; boundary="===============0304282916078196900==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r774 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 09:07:11 -0500 Message-ID: <200911191407.nAJE7BDt011849@svn01.web.mwc.hst.phx2.redhat.com> --===============0304282916078196900== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-19 09:07:11 -0500 (Thu, 19 Nov 2009) New Revision: 774 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-203 : The test JBossCacheStorageConnectionTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 14:03:57 UTC (rev 773) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 14:07:11 UTC (rev 774) @@ -693,4 +693,31 @@ assertEquals(count, locks.size()); } = + public void testAddNodeFail() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); + = + = + try { + // add /jcr:system twice = + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constan= ts.SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new Access= ControlList())); + = + fail("The node jcr:system shouldnot be save"); + } catch (Exception e) { + //ok + } + } } --===============0304282916078196900==-- From do-not-reply at jboss.org Thu Nov 19 09:22:41 2009 Content-Type: multipart/mixed; boundary="===============6549438759980211631==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r775 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 09:22:41 -0500 Message-ID: <200911191422.nAJEMfcV015175@svn01.web.mwc.hst.phx2.redhat.com> --===============6549438759980211631== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-19 09:22:41 -0500 (Thu, 19 Nov 2009) New Revision: 775 Removed: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java Log: EXOJCR-202: IndexerCacheLoaderRuntime test removed Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-19 14:07:11 UTC (rev 774) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderRuntimeTest.java 2009-= 11-19 14:22:41 UTC (rev 775) @@ -1,922 +0,0 @@ -/* - * Copyright (C) 2003-2009 eXo Platform SAS. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see. - */ -package org.exoplatform.services.jcr.impl.storage.jbosscache; - -import org.apache.commons.dbcp.BasicDataSourceFactory; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.Term; -import org.apache.lucene.search.Hits; -import org.apache.lucene.search.IndexSearcher; -import org.apache.lucene.search.Query; -import org.apache.lucene.search.TermQuery; -import org.exoplatform.container.configuration.ConfigurationManager; -import org.exoplatform.container.configuration.ConfigurationManagerImpl; -import org.exoplatform.services.document.DocumentReaderService; -import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; -import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.config.ContainerEntry; -import org.exoplatform.services.jcr.config.QueryHandlerEntry; -import org.exoplatform.services.jcr.config.RepositoryEntry; -import org.exoplatform.services.jcr.config.SimpleParameterEntry; -import org.exoplatform.services.jcr.config.ValueStorageEntry; -import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; -import org.exoplatform.services.jcr.datamodel.ValueData; -import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.LocationFactory; -import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; -import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManager= Impl; -import org.exoplatform.services.jcr.impl.core.nodetype.registration.JcrNod= eTypeDataPersister; -import org.exoplatform.services.jcr.impl.core.nodetype.registration.NodeTy= peDataPersister; -import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; -import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; -import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; -import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; -import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.dataflow.persistent.JBossCacheWor= kspaceDataManager; -import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; -import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; -import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; -import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; -import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; -import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; -import org.exoplatform.services.jcr.util.IdGenerator; -import org.jboss.cache.Modification; - -import java.io.InputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.sql.DataSource; - -/** - * Created by The eXo Platform SAS. - * = - *
Date: = - * - * @author Karpenko Sergiy = - * @version $Id: IndexerCacheLoaderRuntimeTest.java 111 2008-11-11 11:11:1= 1Z serg $ - */ -public class IndexerCacheLoaderRuntimeTest extends AbstractCacheLoaderTest -{ - - private JDBCWorkspaceDataContainer persistentContainer; - - private IndexerCacheLoader loader; - - SearchManager manager; - - //IndexInterceptorHolder holder; - - public void createNewDataSource(String dataSourceName) throws Exception - { - - Properties properties =3D new Properties(); - - properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); - String newurl =3D "jdbc:hsqldb:file:target/temp/data/" + dataSourceN= ame; - - properties.setProperty("url", newurl); - properties.setProperty("username", "sa"); - properties.setProperty("password", ""); - DataSource bds =3D BasicDataSourceFactory.createDataSource(propertie= s); - if (!newurl.contains("hsqldb")) - { - createDatabase(bds, dataSourceName); - } - - new InitialContext().rebind(dataSourceName, bds); - } - - public void setUp() throws Exception - { - super.setUp(); - - initPersistence(); - - loader =3D new IndexerCacheLoader(); - //loader.injectDependencies(holder); - - initJCRRoot(); - - manager.start(); - } - - public void testAddNode() throws Exception - { - List modifications =3D new ArrayList(); - - // prepare add node to storage - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - String node1id =3D IdGenerator.generate(); - QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); - - // add node (/) with jcr:primaryType - NodeData nodeData =3D - new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList()); - conn.add(nodeData); - modifications.addAll(this.addNode(nodeData)); - - // add property (/jcr:primaryType) - TransientPropertyData propData =3D - createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); - conn.add(propData); - modifications.addAll(this.addProperty(propData)); - - conn.commit(); - loader.put(modifications); - - // check do we really have node and its property - conn =3D persistentContainer.openConnection(); - NodeData nd =3D (NodeData)conn.getItemData(node1id); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - - PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); - assertNotNull(pd); - assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); - - // find node by search engine - SearchIndex index =3D ((SearchIndex)manager.getHandler()); - IndexReader reader =3D index.getIndexReader(); - - IndexSearcher searcher =3D new IndexSearcher(reader); - - Query query =3D new TermQuery(new Term("_:UUID", node1id)); - Hits hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - } - - public void testRemoveNode() throws Exception - { - List modifications =3D new ArrayList(); - - // prepare add node to storage - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - String node1id =3D IdGenerator.generate(); - QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); - - // add node (/) with jcr:primaryType - NodeData nodeData =3D - new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList()); - conn.add(nodeData); - modifications.addAll(this.addNode(nodeData)); - - // add property (/jcr:primaryType) - TransientPropertyData propData =3D - createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); - conn.add(propData); - modifications.addAll(this.addProperty(propData)); - - conn.commit(); - loader.put(modifications); - - // check do we really have node and its property - conn =3D persistentContainer.openConnection(); - NodeData nd =3D (NodeData)conn.getItemData(node1id); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - - PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); - assertNotNull(pd); - assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); - - // find node by search engine - SearchIndex index =3D ((SearchIndex)manager.getHandler()); - IndexReader reader =3D index.getIndexReader(); - - IndexSearcher searcher =3D new IndexSearcher(reader); - - Query query =3D new TermQuery(new Term("_:UUID", node1id)); - Hits hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - // remove node1 - modifications.clear(); - - // PropertyData prop =3D (PropertyData)node.get(1); - // NodeData n =3D (NodeData)node.get(0); - - conn.delete(pd); - modifications.addAll(removeProperty(pd)); - conn.delete(nd); - modifications.addAll(removeNode(nd)); - conn.commit(); - - // check removing - conn =3D persistentContainer.openConnection(); - nd =3D (NodeData)conn.getItemData(node1id); - assertNull(nd); - - loader.put(modifications); - - // check index; - reader =3D index.getIndexReader(); - - searcher =3D new IndexSearcher(reader); - hit =3D searcher.search(query); - assertEquals(0, hit.length()); - } - - // public void testRenameNode() throws Exception - // { - // List modifications =3D new ArrayList(); - // - // // prepare add node to storage - // WorkspaceStorageConnection conn =3D persistentContainer.openCon= nection(); - // - // String node1id =3D IdGenerator.generate(); - // QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[= ]node:1"); - // - // // add node (/) with jcr:primaryType - // NodeData nodeData =3D - // new TransientNodeData(node1path, node1id, 1, Constants.NT_UN= STRUCTURED, new InternalQName[0], 0, - // Constants.ROOT_UUID, new AccessControlList()); - // conn.add(nodeData); - // modifications.addAll(this.addNode(nodeData)); - // - // // add property (/jcr:primaryType) - // TransientPropertyData propData =3D - // createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE= , Constants.NT_UNSTRUCTURED, false); - // conn.add(propData); - // modifications.addAll(this.addProperty(propData)); - // - // conn.commit(); - // loader.put(modifications); - // - // // check do we really have node and its property - // conn =3D persistentContainer.openConnection(); - // NodeData nd =3D (NodeData)conn.getItemData(node1id); - // assertNotNull(nd); - // assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - // - // PropertyData pd =3D (PropertyData)conn.getItemData(propData.get= Identifier()); - // assertNotNull(pd); - // assertEquals(propData.getQPath().getAsString(), pd.getQPath().g= etAsString()); - // - // // find node by search engine - // SearchIndex index =3D ((SearchIndex)manager.getHandler()); - // IndexReader reader =3D index.getIndexReader(); - // - // IndexSearcher searcher =3D new IndexSearcher(reader); - // - // Query query =3D new TermQuery(new Term("_:UUID", node1id)); - // Hits hit =3D searcher.search(query); - // assertEquals(1, hit.length()); - // - // modifications.clear(); - // - // conn =3D persistentContainer.openConnection(); - // - // QPath newnode1path =3D QPath.makeChildPath(Constants.ROOT_PATH,= "[]node:1"); - // NodeData newnodeData =3D - // new TransientNodeData(newnode1path, node1id, 1, Constants.NT= _UNSTRUCTURED, new InternalQName[0], 0, - // Constants.ROOT_UUID, new AccessControlList()); - // - // conn.rename(newnodeData); - // - // } - - public void testUpdateAddProperty() throws Exception - { - - List modifications =3D new ArrayList(); - - // prepare add node to storage - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - String node1id =3D IdGenerator.generate(); - QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); - - // add node (/) with jcr:primaryType - NodeData nodeData =3D - new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList()); - conn.add(nodeData); - modifications.addAll(this.addNode(nodeData)); - - // add property (/jcr:primaryType) - TransientPropertyData propData =3D - createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); - conn.add(propData); - modifications.addAll(this.addProperty(propData)); - - conn.commit(); - loader.put(modifications); - - // check do we really have node and its property - conn =3D persistentContainer.openConnection(); - NodeData nd =3D (NodeData)conn.getItemData(node1id); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - - PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); - assertNotNull(pd); - assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); - - // find node by search engine - SearchIndex index =3D ((SearchIndex)manager.getHandler()); - IndexReader reader =3D index.getIndexReader(); - - IndexSearcher searcher =3D new IndexSearcher(reader); - - Query query =3D new TermQuery(new Term("_:UUID", node1id)); - Hits hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - modifications.clear(); - // prepare - TransientPropertyData newPropData =3D - createProperty(node1path, node1id, new InternalQName(Constants.NS= _DEFAULT_URI, "myProp"), "JCR DATA VALUE", - false); - - conn =3D persistentContainer.openConnection(); - conn.add(newPropData); - modifications.addAll(addProperty(newPropData)); - conn.commit(); - - loader.put(modifications); - - // tests it - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); - - PropertyData destPropData =3D (PropertyData)connection.getItemData(n= ewPropData.getIdentifier()); - - assertNotNull(destPropData); - assertEquals(newPropData.getIdentifier(), destPropData.getIdentifier= ()); - assertEquals(newPropData.getParentIdentifier(), destPropData.getPare= ntIdentifier()); - assertEquals(newPropData.getPersistedVersion(), destPropData.getPers= istedVersion()); - assertEquals(newPropData.getType(), destPropData.getType()); - assertEquals(newPropData.getQPath(), destPropData.getQPath()); - assertEquals(newPropData.getValues().size(), destPropData.getValues(= ).size()); - assertEquals(1, destPropData.getValues().size()); - - ValueData valueData =3D destPropData.getValues().get(0); - assertEquals("JCR DATA VALUE", new String(valueData.getAsByteArray()= , "UTF-8")); - - reader =3D index.getIndexReader(); - - searcher =3D new IndexSearcher(reader); - - query =3D new TermQuery(new Term("_:UUID", node1id)); - hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - query =3D new TermQuery(new Term("FULL:myProp", "data")); - hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - } - - public void testUpdateRemoveProperty() throws Exception - { - - List modifications =3D new ArrayList(); - - // prepare add node to storage - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - String node1id =3D IdGenerator.generate(); - QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); - - // add node (/) with jcr:primaryType - NodeData nodeData =3D - new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList()); - conn.add(nodeData); - modifications.addAll(this.addNode(nodeData)); - - // add property (/jcr:primaryType) - TransientPropertyData propData =3D - createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); - conn.add(propData); - modifications.addAll(this.addProperty(propData)); - - // add additonal property - TransientPropertyData propData2 =3D - createProperty(node1path, node1id, new InternalQName(Constants.NS= _DEFAULT_URI, "myProp2"), "JCR DATA VALUE", - false); - conn.add(propData2); - modifications.addAll(addProperty(propData2)); - - conn.commit(); - loader.put(modifications); - - // check do we really have node and its property - conn =3D persistentContainer.openConnection(); - NodeData nd =3D (NodeData)conn.getItemData(node1id); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - - PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); - assertNotNull(pd); - assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); - - // find node by search engine - SearchIndex index =3D ((SearchIndex)manager.getHandler()); - IndexReader reader =3D index.getIndexReader(); - - IndexSearcher searcher =3D new IndexSearcher(reader); - - Query query =3D new TermQuery(new Term("_:UUID", node1id)); - Hits hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - query =3D new TermQuery(new Term("FULL:myProp2", "data")); - hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - modifications.clear(); - - // remove property - conn =3D persistentContainer.openConnection(); - conn.delete(propData2); - modifications.addAll(removeProperty(propData2)); - conn.commit(); - - loader.put(modifications); - - // tests it - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); - - PropertyData destPropData =3D (PropertyData)connection.getItemData(p= ropData2.getIdentifier()); - - assertNull(destPropData); - - reader =3D index.getIndexReader(); - - searcher =3D new IndexSearcher(reader); - - query =3D new TermQuery(new Term("_:UUID", node1id)); - hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - query =3D new TermQuery(new Term("FULL:myProp2", "data")); - hit =3D searcher.search(query); - assertEquals(0, hit.length()); - - } - - public void testUpdateProperty() throws Exception - { - - List modifications =3D new ArrayList(); - - // prepare add node to storage - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - String node1id =3D IdGenerator.generate(); - QPath node1path =3D QPath.makeChildPath(Constants.ROOT_PATH, "[]node= :1"); - - // add node (/) with jcr:primaryType - NodeData nodeData =3D - new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList()); - conn.add(nodeData); - modifications.addAll(this.addNode(nodeData)); - - // add property (/jcr:primaryType) - TransientPropertyData propData =3D - createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); - conn.add(propData); - modifications.addAll(this.addProperty(propData)); - - // add additonal property - TransientPropertyData propData2 =3D - createProperty(node1path, node1id, new InternalQName(Constants.NS= _DEFAULT_URI, "myProp2"), "JCR DATA VALUE", - false); - conn.add(propData2); - modifications.addAll(addProperty(propData2)); - - conn.commit(); - loader.put(modifications); - - // check do we really have node and its property - conn =3D persistentContainer.openConnection(); - NodeData nd =3D (NodeData)conn.getItemData(node1id); - assertNotNull(nd); - assertEquals("[]:1[]node:1", nd.getQPath().getAsString()); - - PropertyData pd =3D (PropertyData)conn.getItemData(propData.getIdent= ifier()); - assertNotNull(pd); - assertEquals(propData.getQPath().getAsString(), pd.getQPath().getAsS= tring()); - - // find node by search engine - SearchIndex index =3D ((SearchIndex)manager.getHandler()); - IndexReader reader =3D index.getIndexReader(); - - IndexSearcher searcher =3D new IndexSearcher(reader); - - Query query =3D new TermQuery(new Term("_:UUID", node1id)); - Hits hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - query =3D new TermQuery(new Term("FULL:myProp2", "data")); - hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - modifications.clear(); - - // update property - conn =3D persistentContainer.openConnection(); - - TransientPropertyData newpropData2 =3D - new TransientPropertyData(propData2.getQPath(), propData2.getIden= tifier(), propData2.getPersistedVersion(), - propData2.getType(), propData2.getParentIdentifier(), propData= 2.isMultiValued()); - - newpropData2.setValue(new TransientValueData("newvalue")); - - conn.update(newpropData2); - modifications.addAll(updateProperty(newpropData2)); - conn.commit(); - - loader.put(modifications); - - // tests it - WorkspaceStorageConnection connection =3D persistentContainer.openCo= nnection(); - - PropertyData destPropData =3D (PropertyData)connection.getItemData(p= ropData2.getIdentifier()); - - assertNotNull(destPropData); - - reader =3D index.getIndexReader(); - - searcher =3D new IndexSearcher(reader); - - query =3D new TermQuery(new Term("_:UUID", node1id)); - hit =3D searcher.search(query); - assertEquals(1, hit.length()); - - query =3D new TermQuery(new Term("FULL:myProp2", "data")); - hit =3D searcher.search(query); - assertEquals(0, hit.length()); - - query =3D new TermQuery(new Term("FULL:myProp2", "newvalue")); - hit =3D searcher.search(query); - assertEquals(1, hit.length()); - } - - /** - * Add Property to the connection but doesn't save it. - * - * @param conn WorkspaceStorageConnection - * @param root QPath - * @param nodeId String - * @param primaryType InternalQName - * @throws Exception - */ - private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, String parentId, - InternalQName primaryType) throws Exception - { - // add root (/) - conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, parentId, - new AccessControlList())); - - // add property (/jcr:primaryType) - addDbProperty(conn, root, nodeId, Constants.JCR_PRIMARYTYPE, primary= Type, false); - } - - /** - * Add Property to the connection but doesn't save it. - * - * @param conn WorkspaceStorageConnection - * @param nodePath QPath - * @param nodeId String - * @param propertyName InternalQName - * @param propertyValue Object - * @return TransientPropertyData - * @throws Exception - */ - private TransientPropertyData addDbProperty(WorkspaceStorageConnection = conn, QPath nodePath, String nodeId, - InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception - { - TransientPropertyData propData =3D createProperty(nodePath, nodeId, = propertyName, propertyValue, multiValued); - - conn.add(propData); - - return propData; - } - - private void createDatabase(DataSource ds, String dbName) throws SQLExc= eption - { - Connection connection =3D ds.getConnection(); - PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); - st.executeQuery(); - } - - /** - * Create Node to the connection but doesn't save it. - * - * @param path QPath - * @param nodeId String - * @param primaryType InternalQName - * @param mixinTypeNames InternalQName = - * @throws Exception - */ - private List createNode(QPath path, String nodeId, InternalQN= ame primaryType, - InternalQName[] mixinTypeNames) throws Exception - { - List list =3D new ArrayList(); - - // add node = - list.add(new TransientNodeData(path, nodeId, 1, primaryType, (mixinT= ypeNames =3D=3D null ? new InternalQName[0] - : null), 0, null, new AccessControlList())); - - // add property (/jcr:primaryType) - list.add(createProperty(path, Constants.ROOT_UUID, Constants.JCR_PRI= MARYTYPE, primaryType, false)); - - return list; - } - - /** - * Create Property. - * - * @param nodePath QPath - * @param nodeId String - * @param propertyName InternalQName - * @param propertyValue Object - * @return TransientPropertyData - * @throws Exception - */ - private TransientPropertyData createProperty(QPath nodePath, String nod= eId, InternalQName propertyName, - Object propertyValue, boolean multiValued) throws Exception - { - String propId =3D IdGenerator.generate(); - QPath propPath =3D QPath.makeChildPath(nodePath, propertyName); - TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, nodeId, multiValued); - - List values =3D new ArrayList(); - if (multiValued) - { - if (propertyValue instanceof List) - { - values.addAll((List)propertyValue); - } - else - throw new Exception("propertyValue should be a List"); - } - else - { - values.add(propertyValue); - } - - for (Object value : values) - { - if (value instanceof InternalQName) - { - propData.setValue(new TransientValueData((InternalQName)value)= ); - } - else if (value instanceof String) - { - propData.setValue(new TransientValueData((String)value)); - } - else if (value instanceof InputStream) - { - propData.setValue(new TransientValueData((InputStream)value)); - } - } - - return propData; - } - - /** - * Delete Property to the connection but doesn't save it. - * - * @param conn WorkspaceStorageConnection - * @param root QPath - * @param nodeId String - * @param primaryType InternalQName - * @throws Exception - */ - private void deleteDbNode(WorkspaceStorageConnection conn, QPath root, = String nodeId, InternalQName primaryType) - throws Exception - { - // add property (/jcr:primaryType) - addDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARY= TYPE, primaryType, false); - - // add root (/) - conn.delete(new TransientNodeData(root, nodeId, 1, primaryType, new = InternalQName[0], 0, null, - new AccessControlList())); - } - - private void deleteJCRRoot() throws Exception - { - // prepare = - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, null, Cons= tants.NT_UNSTRUCTURED); - - // add property (/jcr:mixinTypes) - List mixins =3D new ArrayList(); - mixins.add(Constants.MIX_REFERENCEABLE); - mixins.add(Constants.EXO_PRIVILEGEABLE); - mixins.add(Constants.EXO_OWNEABLE); - addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); - - conn.commit(); - } - - private void initJCRRoot() throws Exception - { - // prepare = - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, null, Cons= tants.NT_UNSTRUCTURED); - - // add property (/jcr:mixinTypes) - //List mixins =3D new ArrayList(); - // mixins.add(Constants.MIX_REFERENCEABLE); - // mixins.add(Constants.EXO_PRIVILEGEABLE); - // mixins.add(Constants.EXO_OWNEABLE); - //addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Cons= tants.JCR_MIXINTYPES, mixins, true); - - conn.commit(); - } - - protected WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Str= ing dsName, String vsPath, - ContainerEntry entry) throws Exception - { - - List params =3D new ArrayList(); - - params.add(new SimpleParameterEntry("sourceName", dsName)); - params.add(new SimpleParameterEntry("db-type", "generic")); - params.add(new SimpleParameterEntry("multi-db", isMultiDb ? "true" := "false")); - params.add(new SimpleParameterEntry("update-storage", "true")); - params.add(new SimpleParameterEntry("max-buffer-size", "204800")); - - if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != =3D null) - { - params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB= _DIALECT, entry - .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT))); - } - - String oldSwap =3D entry.getParameterValue("swap-directory"); - String newSwap =3D oldSwap.substring(0, oldSwap.lastIndexOf('/')) + = '/' + wsName; - - params.add(new SimpleParameterEntry("swap-directory", newSwap)); - - ContainerEntry containerEntry =3D - new ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdb= c.JDBCWorkspaceDataContainer", - (ArrayList)params); - containerEntry.setParameters(params); - - if (vsPath !=3D null) - { - - ArrayList vsparams =3D new ArrayList(); - ValueStorageFilterEntry filterEntry =3D new ValueStorageFilterEnt= ry(); - filterEntry.setPropertyType("Binary"); - vsparams.add(filterEntry); - - ValueStorageEntry valueStorageEntry =3D - new ValueStorageEntry("org.exoplatform.services.jcr.impl.stora= ge.value.fs.SimpleFileValueStorage", vsparams); - ArrayList spe =3D new ArrayList(); - spe.add(new SimpleParameterEntry("path", vsPath)); - valueStorageEntry.setId(IdGenerator.generate()); - valueStorageEntry.setParameters(spe); - valueStorageEntry.setFilters(vsparams); - - // containerEntry.setValueStorages(); - containerEntry.setParameters(params); - ArrayList list =3D new ArrayList(1); - list.add(valueStorageEntry); - - containerEntry.setValueStorages(list); - - } - - WorkspaceEntry workspaceEntry =3D - new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); - workspaceEntry.setContainer(containerEntry); - - // Indexer - ArrayList qParams =3D new ArrayList(); - qParams.add(new SimpleParameterEntry("indexDir", "target/temp/index/= db1/ws" + IdGenerator.generate())); - QueryHandlerEntry qEntry =3D - new QueryHandlerEntry("org.exoplatform.services.jcr.impl.core.que= ry.lucene.SearchIndex", qParams); - workspaceEntry.setQueryHandler(qEntry); - - // ArrayList cacheParams =3D new ArrayList(); - // - // cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); - // cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); - // CacheEntry cacheEntry =3D new CacheEntry(cacheParams); - // cacheEntry.setType("org.exoplatform.services.jcr.impl.datafl= ow.persistent.LinkedWorkspaceStorageCacheImpl"); - // - // workspaceEntry.setCache(cacheEntry); - - // LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); - // lockManagerEntry.setTimeout(900000); - // LockPersisterEntry persisterEntry =3D new LockPersisterEntry= (); - // persisterEntry.setType("org.exoplatform.services.jcr.impl.co= re.lock.FileSystemLockPersister"); - // ArrayList lpParams =3D new ArrayList(); - // lpParams.add(new SimpleParameterEntry("path", "../temp/lock"= )); - // persisterEntry.setParameters(lpParams); - // lockManagerEntry.setPersister(persisterEntry); - // workspaceEntry.setLockManager(lockManagerEntry); - - // workspaceEntry - return workspaceEntry; - } - - protected void initPersistence() throws Exception - { - //holder =3D new IndexInterceptorHolder(); - - // Create WorkspaceEntry - ContainerEntry containerEntry =3D new ContainerEntry(); - List params =3D new ArrayList(); - params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); - params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); - containerEntry.setParameters(params); - - // Initialize id generator. - new IdGenerator(new IDGeneratorServiceImpl()); - - // Set system property Context.INITIAL_CONTEXT_FACTORY to initial co= ntext. = - System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); - - // Create data source. Will be created new data source to new test. = - String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); - createNewDataSource(dataSourceName); - - WorkspaceEntry ws =3D - getNewWs("ws_to_jbdc_cache_loader", true, dataSourceName, "/targe= t/temp/ws_to_jbdc_cache_loader/lalues", - containerEntry); - - RepositoryEntry re =3D new RepositoryEntry(); - re.addWorkspace(ws); - - ValueStoragePluginProvider valueStoragePluginProvider =3D new Standa= loneStoragePluginProvider(ws); - - persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); - - NamespaceRegistryImpl nsReg =3D new NamespaceRegistryImpl(); - nsReg.start(); - SystemDataContainerHolder systemDataContaine= rHolder =3D - new SystemDataContainerHolder(persistentContainer); - - WorkspacePersistentDataManager itemMgr =3D - new JBossCacheWorkspaceDataManager(persistentContainer, systemDat= aContainerHolder); - - RepositoryIndexSearcherHolder indexSearcherHolder =3D new Repository= IndexSearcherHolder(); - - NodeTypeDataPersister persister =3D new JcrNodeTypeDataPersister(ite= mMgr, false); - NodeTypeDataManager ntReg =3D - new NodeTypeDataManagerImpl(re, new LocationFactory(nsReg), nsReg= , persister, itemMgr, indexSearcherHolder); - - SystemSearchManagerHolder parentSearchManager =3D null; - DocumentReaderService extractor =3D null; - ConfigurationManager cfm =3D new ConfigurationManagerImpl(); - - // manager =3D - // new SearchManager(ws.getQueryHandler(), nsReg, ntReg, ite= mMgr, parentSearchManager, extractor, cfm, - // indexSearcherHolder, holder); - } - - @Override - protected void tearDown() throws Exception - { - // delete all in DB - super.tearDown(); - } - -} --===============6549438759980211631==-- From do-not-reply at jboss.org Thu Nov 19 09:29:05 2009 Content-Type: multipart/mixed; boundary="===============4640292054210143898==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r776 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 09:29:05 -0500 Message-ID: <200911191429.nAJET5dX016389@svn01.web.mwc.hst.phx2.redhat.com> --===============4640292054210143898== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-19 09:29:05 -0500 (Thu, 19 Nov 2009) New Revision: 776 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-242: Locking tests moved to another class Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java= (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java= 2009-11-19 14:29:05 UTC (rev 776) @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import org.exoplatform.services.jcr.impl.core.lock.LockData; + +import java.util.List; + +import javax.jcr.lock.LockException; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class JBossCacheStorageConnectionLockTest extends AbstractJBossCach= eStorageConnectionTest +{ + public void testAddLock() throws Exception + { + // ordinary add lock + LockData lockData =3D new LockData("testAddLock", "token's hash", tr= ue, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testAddLock"= ).getTokenHash()); + } + + public void testAddLockTwice() throws Exception + { + // ordinary add lock + { + LockData lockData =3D new LockData("testAddLockTwice", "token's h= ash", true, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testAddLo= ckTwice").getTokenHash()); + } + // try to lock once more + try + { + // add lock to the same node twice + LockData lockData =3D new LockData("testAddLockTwice", "other tok= en's hash", true, true, "owner", 1000); + conn.addLockData(lockData); + fail("exception expected, because can't lock node twice"); + } + catch (LockException e) + { + } + } + + public void testRefreshLock() throws Exception + { + // ordinary add lock + { + LockData lockData =3D new LockData("testRefreshLock", "token's ha= sh", true, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testRefre= shLock").getTokenHash()); + } + // try to refresh lock (updates creation time to extend lifetime) + // refresh is performed by writing new lock data (only difference is= changed creation time) + { + LockData lockData =3D new LockData("testRefreshLock", "token's ha= sh", true, true, "owner", 1000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData("testRefre= shLock").getTokenHash()); + } + } + + public void testGetLocks() throws Exception + { + // clean up any existing + List locks =3D conn.getLocksData(); + for (LockData lock : locks) + { + conn.removeLockData(lock.getNodeIdentifier()); + } + // check empty + locks =3D conn.getLocksData(); + assertEquals(0, locks.size()); + // fill + int count =3D 3; + for (int i =3D 0; i < count; i++) + { + LockData lockData =3D new LockData("testGetLocks" + i, "token's h= ash " + i, true, true, "owner", 1000); + conn.addLockData(lockData); + } + // assert + locks =3D conn.getLocksData(); + assertEquals(count, locks.size()); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnec= tionLockTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 14:22:41 UTC (rev 775) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 14:29:05 UTC (rev 776) @@ -624,75 +624,6 @@ = } = - public void testAddLock() throws Exception - { - // ordinary add lock - LockData lockData =3D new LockData("testAddLock", "token's hash", tr= ue, true, "owner", 1000); - conn.addLockData(lockData); - assertEquals(lockData.getTokenHash(), conn.getLockData("testAddLock"= ).getTokenHash()); - } - - public void testAddLockTwice() throws Exception - { - // ordinary add lock - { - LockData lockData =3D new LockData("testAddLockTwice", "token's h= ash", true, true, "owner", 1000); - conn.addLockData(lockData); - assertEquals(lockData.getTokenHash(), conn.getLockData("testAddLo= ckTwice").getTokenHash()); - } - // try to lock once more - try - { - // add lock to the same node twice - LockData lockData =3D new LockData("testAddLockTwice", "other tok= en's hash", true, true, "owner", 1000); - conn.addLockData(lockData); - fail("exception expected, because can't lock node twice"); - } - catch (LockException e) - { - } - } - - public void testRefreshLock() throws Exception - { - // ordinary add lock - { - LockData lockData =3D new LockData("testRefreshLock", "token's ha= sh", true, true, "owner", 1000); - conn.addLockData(lockData); - assertEquals(lockData.getTokenHash(), conn.getLockData("testRefre= shLock").getTokenHash()); - } - // try to refresh lock (updates creation time to extend lifetime) - // refresh is performed by writing new lock data (only difference is= changed creation time) - { - LockData lockData =3D new LockData("testRefreshLock", "token's ha= sh", true, true, "owner", 1000); - conn.addLockData(lockData); - assertEquals(lockData.getTokenHash(), conn.getLockData("testRefre= shLock").getTokenHash()); - } - } - - public void testGetLocks() throws Exception - { - // clean up any existing - List locks =3D conn.getLocksData(); - for (LockData lock : locks) - { - conn.removeLockData(lock.getNodeIdentifier()); - } - // check empty - locks =3D conn.getLocksData(); - assertEquals(0, locks.size()); - // fill - int count =3D 3; - for (int i =3D 0; i < count; i++) - { - LockData lockData =3D new LockData("testGetLocks" + i, "token's h= ash " + i, true, true, "owner", 1000); - conn.addLockData(lockData); - } - // assert - locks =3D conn.getLocksData(); - assertEquals(count, locks.size()); - } - public void testAddNodeFail() throws Exception { // add root (/) --===============4640292054210143898==-- From do-not-reply at jboss.org Thu Nov 19 09:40:34 2009 Content-Type: multipart/mixed; boundary="===============5883527960320553096==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r777 - in jcr/branches/1.12.0-JBC/component/core/src/test: java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directories. Date: Thu, 19 Nov 2009 09:40:34 -0500 Message-ID: <200911191440.nAJEeYnP018561@svn01.web.mwc.hst.phx2.redhat.com> --===============5883527960320553096== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 09:40:34 -0500 (Thu, 19 Nov 2009) New Revision: 777 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.j= ava jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader.xml Log: EXOJCR-203: JDBC & JBC conn tests reorg Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java 2009-11-19 = 14:40:34 UTC (rev 777) @@ -0,0 +1,340 @@ +package org.exoplatform.services.jcr.impl.storage; + +import org.apache.commons.dbcp.BasicDataSourceFactory; +import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.config.ContainerEntry; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.SimpleParameterEntry; +import org.exoplatform.services.jcr.config.ValueStorageEntry; +import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; +import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; +import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; +import org.exoplatform.services.jcr.util.IdGenerator; + +import java.io.InputStream; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.sql.DataSource; + +import junit.framework.TestCase; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 19.11.2009 + * + * @author
Peter N= edonosko = + * @version $Id$ + */ +public class JDBCWorkspaceDataContainerTestBase extends TestCase +{ + + protected JDBCWorkspaceDataContainer persistentContainer; + + @Override + protected void setUp() throws Exception + { + super.setUp(); + = + initPersistence(); + } + + protected void initPersistence() throws Exception + { + // Create WorkspaceEntry + ContainerEntry containerEntry =3D new ContainerEntry(); + List params =3D new ArrayList(); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB_DI= ALECT, "hsqldb")); + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.SWAPD= IR_PROP, "/target/temp/swap/ws")); + containerEntry.setParameters(params); + + // Initialize id generator. + new IdGenerator(new IDGeneratorServiceImpl()); + + // Set system property Context.INITIAL_CONTEXT_FACTORY to initial co= ntext. = + System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); + + // Create data source. Will be created new data source to new test. = + String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); + createNewDataSource(dataSourceName); + + WorkspaceEntry ws =3D + getNewWs("ws_to_jbdc_cache_loader", true, dataSourceName, "/targe= t/temp/ws_to_jbdc_cache_loader/values", + containerEntry); + + RepositoryEntry re =3D new RepositoryEntry(); + re.addWorkspace(ws); + + ValueStoragePluginProvider valueStoragePluginProvider =3D new Standa= loneStoragePluginProvider(ws); + + persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); + } + + protected WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Str= ing dsName, String vsPath, ContainerEntry entry) + throws Exception + { + List params =3D new ArrayList(); + + params.add(new SimpleParameterEntry("sourceName", dsName)); + params.add(new SimpleParameterEntry("db-type", "generic")); + params.add(new SimpleParameterEntry("multi-db", isMultiDb ? "true" := "false")); + params.add(new SimpleParameterEntry("update-storage", "true")); + params.add(new SimpleParameterEntry("max-buffer-size", "204800")); + + if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != =3D null) + { + params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB= _DIALECT, entry + .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT))); + } + + String oldSwap =3D entry.getParameterValue("swap-directory"); + String newSwap =3D oldSwap.substring(0, oldSwap.lastIndexOf('/')) + = '/' + wsName; + + params.add(new SimpleParameterEntry("swap-directory", newSwap)); + + ContainerEntry containerEntry =3D + new ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdb= c.JDBCWorkspaceDataContainer", + (ArrayList)params); + containerEntry.setParameters(params); + + if (vsPath !=3D null) + { + ArrayList vsparams =3D new ArrayList(); + ValueStorageFilterEntry filterEntry =3D new ValueStorageFilterEnt= ry(); + filterEntry.setPropertyType("Binary"); + vsparams.add(filterEntry); + + ValueStorageEntry valueStorageEntry =3D + new ValueStorageEntry("org.exoplatform.services.jcr.impl.stora= ge.value.fs.SimpleFileValueStorage", vsparams); + ArrayList spe =3D new ArrayList(); + spe.add(new SimpleParameterEntry("path", vsPath)); + valueStorageEntry.setId(IdGenerator.generate()); + valueStorageEntry.setParameters(spe); + valueStorageEntry.setFilters(vsparams); + + // containerEntry.setValueStorages(); + containerEntry.setParameters(params); + ArrayList list =3D new ArrayList(1); + list.add(valueStorageEntry); + + containerEntry.setValueStorages(list); + } + + WorkspaceEntry workspaceEntry =3D + new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); + workspaceEntry.setContainer(containerEntry); + + // // Indexer + // ArrayList qParams =3D new ArrayList(); + // qParams.add(new SimpleParameterEntry("indexDir", "../temp/in= dex/" + IdGenerator.generate())); + // QueryHandlerEntry qEntry =3D + // new QueryHandlerEntry("org.exoplatform.services.jcr.impl.= core.query.lucene.SearchIndex", qParams); + // workspaceEntry.setQueryHandler(qEntry); + // + // // cache + // ArrayList cacheParams =3D new ArrayList(); + // cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); + // cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); + // CacheEntry cacheEntry =3D new CacheEntry(cacheParams); + // cacheEntry.setType("org.exoplatform.services.jcr.impl.datafl= ow.persistent.LinkedWorkspaceStorageCacheImpl"); + // workspaceEntry.setCache(cacheEntry); + // = + // // lock + // LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); + // lockManagerEntry.setTimeout(900000); + // LockPersisterEntry persisterEntry =3D new LockPersisterEntry= (); + // persisterEntry.setType("org.exoplatform.services.jcr.impl.co= re.lock.FileSystemLockPersister"); + // ArrayList lpParams =3D new ArrayList(); + // lpParams.add(new SimpleParameterEntry("path", "../temp/lock"= )); + // persisterEntry.setParameters(lpParams); + // lockManagerEntry.setPersister(persisterEntry); + // workspaceEntry.setLockManager(lockManagerEntry); + + // workspaceEntry + return workspaceEntry; + } + + protected void createNewDataSource(String dataSourceName) throws Except= ion + { + Properties properties =3D new Properties(); + + properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); + String newurl =3D "jdbc:hsqldb:file:target/temp/data/" + dataSourceN= ame; + + properties.setProperty("url", newurl); + properties.setProperty("username", "sa"); + properties.setProperty("password", ""); + DataSource bds =3D BasicDataSourceFactory.createDataSource(propertie= s); + if (!newurl.contains("hsqldb")) + { + createDatabase(bds, dataSourceName); + } + + new InitialContext().rebind(dataSourceName, bds); + } + + protected void createDatabase(DataSource ds, String dbName) throws SQLE= xception + { + Connection connection =3D ds.getConnection(); + PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); + st.executeQuery(); + } + + protected void initJCRRoot() throws Exception + { + // prepare = + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + + // add root (/) with jcr:primaryType + addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, Constants.ROOT_PARENT_UUID); + + // add property (/jcr:mixinTypes) + List mixins =3D new ArrayList(); + mixins.add(Constants.MIX_REFERENCEABLE); + mixins.add(Constants.EXO_PRIVILEGEABLE); + mixins.add(Constants.EXO_OWNEABLE); + addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); + + conn.commit(); + } + + protected void deleteJCRRoot() throws Exception + { + // prepare = + = + // delete root (/) etc + } + + /** + * Add Node to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param root QPath + * @param nodeId String + * @param primaryType InternalQName + * @throws Exception + */ + protected void addDbNode(WorkspaceStorageConnection conn, QPath root, S= tring nodeId, InternalQName primaryType, String parentNodeId) + throws Exception + { + // add root (/) + conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, parentNodeId, + new AccessControlList())); + + // add property (/jcr:primaryType) + conn.add(createProperty(root, nodeId, Constants.JCR_PRIMARYTYPE, pri= maryType, false)); + } + + /** + * Add Property to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param nodePath QPath + * @param nodeId String + * @param propertyName InternalQName + * @param propertyValue Object + * @return TransientPropertyData + * @throws Exception + */ + protected TransientPropertyData addDbProperty(WorkspaceStorageConnectio= n conn, QPath nodePath, String nodeId, + InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception + { + TransientPropertyData propData =3D createProperty(nodePath, nodeId, = propertyName, propertyValue, multiValued); + + conn.add(propData); + + return propData; + } + + /** + * Create Property data. + * + * @param nodePath QPath + * @param nodeId String + * @param propertyName InternalQName + * @param propertyValue Object + * @return TransientPropertyData + * @throws Exception + */ + protected TransientPropertyData createProperty(QPath nodePath, String n= odeId, InternalQName propertyName, + Object propertyValue, boolean multiValued) throws Exception + { + String propId =3D IdGenerator.generate(); + QPath propPath =3D QPath.makeChildPath(nodePath, propertyName); + TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, nodeId, multiValued); + + List values =3D new ArrayList(); + if (multiValued) + { + if (propertyValue instanceof List) + { + values.addAll((List)propertyValue); + } + else + throw new Exception("propertyValue should be a List"); + } + else + { + values.add(propertyValue); + } + + for (Object value : values) + { + if (value instanceof InternalQName) + { + propData.setValue(new TransientValueData((InternalQName)value)= ); + } + else if (value instanceof String) + { + propData.setValue(new TransientValueData((String)value)); + } + else if (value instanceof InputStream) + { + propData.setValue(new TransientValueData((InputStream)value)); + } + } + + return propData; + } + + /** + * Delete Property to the connection but doesn't save it. + * + * NOT IMPLEMENTED! + * + * @param conn WorkspaceStorageConnection + * @param root QPath + * @param nodeId String + * @param primaryType InternalQName + * @throws Exception + */ + protected void deleteDbNode(WorkspaceStorageConnection conn, QPath root= , String nodeId, InternalQName primaryType) + throws Exception + { + // add property (/jcr:primaryType) + //deleteDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PR= IMARYTYPE, primaryType, false); + + // dlete root (/) + //conn.delete(new TransientNodeData(root, nodeId, 1, primaryType, ne= w InternalQName[0], 0, null, + // new AccessControlList())); + } + + = +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase= .java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-19 = 14:29:05 UTC (rev 776) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractCacheLoaderTest.java 2009-11-19 = 14:40:34 UTC (rev 777) @@ -18,22 +18,16 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import junit.framework.TestCase; - import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.impl.storage.JDBCWorkspaceDataContaine= rTestBase; import org.jboss.cache.Fqn; import org.jboss.cache.Modification; -import org.jboss.cache.Node; import org.jboss.cache.Modification.ModificationType; = -import java.io.Serializable; import java.util.ArrayList; import java.util.List; = -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - /** * This abstract class contains only methods for creating a fake {@link Mo= dification} instances. It doesn't use real cache. * = @@ -41,14 +35,9 @@ * @version $Id$ * */ -public abstract class AbstractCacheLoaderTest extends TestCase +public abstract class AbstractCacheLoaderTest extends JDBCWorkspaceDataCon= tainerTestBase { = - public void setUp() throws Exception - { - super.setUp(); - } - /** * Returns {@link Modification} like as node added. NodeData is written= to /$NODE/IDxxxx as an attribute by key ITEM_DATA. * = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectio= nTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java 2009-11-19 14:29:05 UTC (rev 776) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java 2009-11-19 14:40:34 UTC (rev 777) @@ -18,14 +18,16 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import junit.framework.TestCase; - import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.storage.JDBCWorkspaceDataContaine= rTestBase; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; +import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.jboss.cache.Cache; +import org.jboss.cache.CacheSPI; import org.jboss.cache.DefaultCacheFactory; import org.jboss.cache.Fqn; import org.jboss.cache.Node; @@ -42,7 +44,7 @@ * @author Peter N= edonosko = * @version $Id$ */ -public abstract class AbstractJBossCacheStorageConnectionTest extends Test= Case +public abstract class AbstractJBossCacheStorageConnectionTest extends JDBC= WorkspaceDataContainerTestBase { = protected JBossCacheStorageConnection conn; @@ -93,7 +95,9 @@ = protected void initJBC() throws Exception { - // empty here + // inject JDBC DC via JBC ComponentRegistry = + ((CacheSPI)cache).getComponentRegistry().regis= terComponent(this.persistentContainer, + WorkspaceDataContainer.class); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 14:29:05 UTC (rev 776) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 14:40:34 UTC (rev 777) @@ -18,8 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import junit.framework.TestCase; - import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.ItemData; @@ -31,14 +29,10 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.jboss.cache.Cache; -import org.jboss.cache.DefaultCacheFactory; import org.jboss.cache.Fqn; import org.jboss.cache.Node; = -import java.io.IOException; import java.io.Serializable; -import java.io.UnsupportedEncodingException; import java.util.List; = import javax.jcr.lock.LockException; Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-19 14:2= 9:05 UTC (rev 776) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-19 14:4= 0:34 UTC (rev 777) @@ -18,17 +18,13 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.config.ContainerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.SimpleParameterEntry; -import org.exoplatform.services.jcr.config.ValueStorageEntry; -import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; @@ -45,19 +41,12 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Modification; = -import java.io.InputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.Properties; import java.util.Set; = import javax.naming.Context; -import javax.naming.InitialContext; -import javax.sql.DataSource; = /** * @author Alex Reshetnyak<= /a> @@ -126,264 +115,6 @@ persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); } = - private WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Strin= g dsName, String vsPath, ContainerEntry entry) - throws Exception - { - List params =3D new ArrayList(); - - params.add(new SimpleParameterEntry("sourceName", dsName)); - params.add(new SimpleParameterEntry("db-type", "generic")); - params.add(new SimpleParameterEntry("multi-db", isMultiDb ? "true" := "false")); - params.add(new SimpleParameterEntry("update-storage", "true")); - params.add(new SimpleParameterEntry("max-buffer-size", "204800")); - - if (entry.getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT) != =3D null) - { - params.add(new SimpleParameterEntry(JDBCWorkspaceDataContainer.DB= _DIALECT, entry - .getParameterValue(JDBCWorkspaceDataContainer.DB_DIALECT))); - } - - String oldSwap =3D entry.getParameterValue("swap-directory"); - String newSwap =3D oldSwap.substring(0, oldSwap.lastIndexOf('/')) + = '/' + wsName; - - params.add(new SimpleParameterEntry("swap-directory", newSwap)); - - ContainerEntry containerEntry =3D - new ContainerEntry("org.exoplatform.services.jcr.impl.storage.jdb= c.JDBCWorkspaceDataContainer", - (ArrayList)params); - containerEntry.setParameters(params); - - if (vsPath !=3D null) - { - ArrayList vsparams =3D new ArrayList(); - ValueStorageFilterEntry filterEntry =3D new ValueStorageFilterEnt= ry(); - filterEntry.setPropertyType("Binary"); - vsparams.add(filterEntry); - - ValueStorageEntry valueStorageEntry =3D - new ValueStorageEntry("org.exoplatform.services.jcr.impl.stora= ge.value.fs.SimpleFileValueStorage", vsparams); - ArrayList spe =3D new ArrayList(); - spe.add(new SimpleParameterEntry("path", vsPath)); - valueStorageEntry.setId(IdGenerator.generate()); - valueStorageEntry.setParameters(spe); - valueStorageEntry.setFilters(vsparams); - - // containerEntry.setValueStorages(); - containerEntry.setParameters(params); - ArrayList list =3D new ArrayList(1); - list.add(valueStorageEntry); - - containerEntry.setValueStorages(list); - } - - WorkspaceEntry workspaceEntry =3D - new WorkspaceEntry(wsName !=3D null ? wsName : IdGenerator.genera= te(), "nt:unstructured"); - workspaceEntry.setContainer(containerEntry); - - // // Indexer - // ArrayList qParams =3D new ArrayList(); - // qParams.add(new SimpleParameterEntry("indexDir", "../temp/in= dex/" + IdGenerator.generate())); - // QueryHandlerEntry qEntry =3D - // new QueryHandlerEntry("org.exoplatform.services.jcr.impl.= core.query.lucene.SearchIndex", qParams); - // workspaceEntry.setQueryHandler(qEntry); - // - // // cache - // ArrayList cacheParams =3D new ArrayList(); - // cacheParams.add(new SimpleParameterEntry("maxSize", "2000")); - // cacheParams.add(new SimpleParameterEntry("liveTime", "20m")); - // CacheEntry cacheEntry =3D new CacheEntry(cacheParams); - // cacheEntry.setType("org.exoplatform.services.jcr.impl.datafl= ow.persistent.LinkedWorkspaceStorageCacheImpl"); - // workspaceEntry.setCache(cacheEntry); - // = - // // lock - // LockManagerEntry lockManagerEntry =3D new LockManagerEntry(); - // lockManagerEntry.setTimeout(900000); - // LockPersisterEntry persisterEntry =3D new LockPersisterEntry= (); - // persisterEntry.setType("org.exoplatform.services.jcr.impl.co= re.lock.FileSystemLockPersister"); - // ArrayList lpParams =3D new ArrayList(); - // lpParams.add(new SimpleParameterEntry("path", "../temp/lock"= )); - // persisterEntry.setParameters(lpParams); - // lockManagerEntry.setPersister(persisterEntry); - // workspaceEntry.setLockManager(lockManagerEntry); - - // workspaceEntry - return workspaceEntry; - } - - private void createNewDataSource(String dataSourceName) throws Exception - { - Properties properties =3D new Properties(); - - properties.setProperty("driverClassName", "org.hsqldb.jdbcDriver"); - String newurl =3D "jdbc:hsqldb:file:target/temp/data/" + dataSourceN= ame; - - properties.setProperty("url", newurl); - properties.setProperty("username", "sa"); - properties.setProperty("password", ""); - DataSource bds =3D BasicDataSourceFactory.createDataSource(propertie= s); - if (!newurl.contains("hsqldb")) - { - createDatabase(bds, dataSourceName); - } - - new InitialContext().rebind(dataSourceName, bds); - } - - private void createDatabase(DataSource ds, String dbName) throws SQLExc= eption - { - Connection connection =3D ds.getConnection(); - PreparedStatement st =3D connection.prepareStatement("create databas= e " + dbName); - st.executeQuery(); - } - - private void initJCRRoot() throws Exception - { - // prepare = - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, Constants.ROOT_PARENT_UUID); - - // add property (/jcr:mixinTypes) - List mixins =3D new ArrayList(); - mixins.add(Constants.MIX_REFERENCEABLE); - mixins.add(Constants.EXO_PRIVILEGEABLE); - mixins.add(Constants.EXO_OWNEABLE); - addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); - - conn.commit(); - } - - private void deleteJCRRoot() throws Exception - { - // prepare = - WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - - // add root (/) with jcr:primaryType - addDbNode(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Constants.= NT_UNSTRUCTURED, Constants.ROOT_PARENT_UUID); - - // add property (/jcr:mixinTypes) - List mixins =3D new ArrayList(); - mixins.add(Constants.MIX_REFERENCEABLE); - mixins.add(Constants.EXO_PRIVILEGEABLE); - mixins.add(Constants.EXO_OWNEABLE); - addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); - - conn.commit(); - } - - /** - * Add Node to the connection but doesn't save it. - * - * @param conn WorkspaceStorageConnection - * @param root QPath - * @param nodeId String - * @param primaryType InternalQName - * @throws Exception - */ - private void addDbNode(WorkspaceStorageConnection conn, QPath root, Str= ing nodeId, InternalQName primaryType, String parentNodeId) - throws Exception - { - // add root (/) - conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, parentNodeId, - new AccessControlList())); - - // add property (/jcr:primaryType) - conn.add(createProperty(root, nodeId, Constants.JCR_PRIMARYTYPE, pri= maryType, false)); - } - - /** - * Add Property to the connection but doesn't save it. - * - * @param conn WorkspaceStorageConnection - * @param nodePath QPath - * @param nodeId String - * @param propertyName InternalQName - * @param propertyValue Object - * @return TransientPropertyData - * @throws Exception - */ - private TransientPropertyData addDbProperty(WorkspaceStorageConnection = conn, QPath nodePath, String nodeId, - InternalQName propertyName, Object propertyValue, boolean multiValue= d) throws Exception - { - TransientPropertyData propData =3D createProperty(nodePath, nodeId, = propertyName, propertyValue, multiValued); - - conn.add(propData); - - return propData; - } - - /** - * Create Property data. - * - * @param nodePath QPath - * @param nodeId String - * @param propertyName InternalQName - * @param propertyValue Object - * @return TransientPropertyData - * @throws Exception - */ - private TransientPropertyData createProperty(QPath nodePath, String nod= eId, InternalQName propertyName, - Object propertyValue, boolean multiValued) throws Exception - { - String propId =3D IdGenerator.generate(); - QPath propPath =3D QPath.makeChildPath(nodePath, propertyName); - TransientPropertyData propData =3D new TransientPropertyData(propPat= h, propId, 1, 1, nodeId, multiValued); - - List values =3D new ArrayList(); - if (multiValued) - { - if (propertyValue instanceof List) - { - values.addAll((List)propertyValue); - } - else - throw new Exception("propertyValue should be a List"); - } - else - { - values.add(propertyValue); - } - - for (Object value : values) - { - if (value instanceof InternalQName) - { - propData.setValue(new TransientValueData((InternalQName)value)= ); - } - else if (value instanceof String) - { - propData.setValue(new TransientValueData((String)value)); - } - else if (value instanceof InputStream) - { - propData.setValue(new TransientValueData((InputStream)value)); - } - } - - return propData; - } - - /** - * Delete Property to the connection but doesn't save it. - * - * @param conn WorkspaceStorageConnection - * @param root QPath - * @param nodeId String - * @param primaryType InternalQName - * @throws Exception - */ - private void deleteDbNode(WorkspaceStorageConnection conn, QPath root, = String nodeId, InternalQName primaryType) - throws Exception - { - // add property (/jcr:primaryType) - addDbProperty(conn, root, Constants.ROOT_UUID, Constants.JCR_PRIMARY= TYPE, primaryType, false); - - // add root (/) - conn.delete(new TransientNodeData(root, nodeId, 1, primaryType, new = InternalQName[0], 0, null, - new AccessControlList())); - } - // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D TESTS =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D = public void testAddNode() throws Exception Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-exoloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-19 14:29:05 UTC (rev 776) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-19 14:40:34 UTC (rev 777) @@ -21,7 +21,7 @@ use_incoming_packet_handler=3D"true" /> = - --===============3061699380965456505== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 09:55:06 -0500 (Thu, 19 Nov 2009) New Revision: 778 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.j= ava Log: EXOJCR-203: JBC init fix in test Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-19 14:40:34= UTC (rev 777) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-19 14:55:06= UTC (rev 778) @@ -637,7 +637,8 @@ */ public Object put(Fqn name, Object key, Object value) throws Exception { - LOG.error("The method 'put(Fqn name, Object key, Object value))' sho= uld not be called."); + LOG.error("The method 'put(Fqn name, Object key, Object value))' sho= uld not be called. " + name + " " + key + " " + + value); throw new JDBCCacheLoaderException("The method 'put(Fqn name, Object= key, Object value))' should not be called."); } = @@ -646,7 +647,8 @@ */ public void put(Fqn name, Map attributes) throws Except= ion { - LOG.error("The method 'put(Fqn name, Map attributes)= ' should not be called."); + LOG.error("The method 'put(Fqn name, Map attributes)= ' should not be called. " + name + " " + + attributes); throw new JDBCCacheLoaderException( "The method 'put(Fqn name, Map attributes)' shoul= d not be called."); } @@ -656,7 +658,7 @@ */ public Object remove(Fqn fqn, Object key) throws Exception { - LOG.error("The method 'remove(Fqn fqn, Object key)' should not be ca= lled."); + LOG.error("The method 'remove(Fqn fqn, Object key)' should not be ca= lled. " + fqn + " " + key); throw new JDBCCacheLoaderException("The method 'remove(Fqn fqn, Obje= ct key)' should not be called."); } = @@ -665,7 +667,7 @@ */ public void remove(Fqn fqn) throws Exception { - LOG.error("The method 'remove(Fqn fqn)' should not be called."); + LOG.error("The method 'remove(Fqn fqn)' should not be called. " + fq= n); throw new JDBCCacheLoaderException("The method 'remove(Fqn fqn)' sho= uld not be called."); } = @@ -674,7 +676,7 @@ */ public void removeData(Fqn fqn) throws Exception { - LOG.error("The method 'removeData(Fqn fqn)' should not be called."); + LOG.error("The method 'removeData(Fqn fqn)' should not be called. " = + fqn); throw new JDBCCacheLoaderException("The method 'removeData(Fqn fqn)'= should not be called."); } = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectio= nTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java 2009-11-19 14:40:34 UTC (rev 777) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java 2009-11-19 14:55:06 UTC (rev 778) @@ -80,10 +80,11 @@ Node cacheRoot =3D cache.getRoot(); = // prepare cache structures + cache.startBatch(); nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); locks =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.LOCKS)= ); - + cache.endBatch(true); // JCR connection conn =3D new JBossCacheStorageConnection(cache, nodes, props, locks); } --===============3061699380965456505==-- From do-not-reply at jboss.org Thu Nov 19 10:15:18 2009 Content-Type: multipart/mixed; boundary="===============2930589871860401125==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r779 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Thu, 19 Nov 2009 10:15:18 -0500 Message-ID: <200911191515.nAJFFIpj025922@svn01.web.mwc.hst.phx2.redhat.com> --===============2930589871860401125== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-19 10:15:17 -0500 (Thu, 19 Nov 2009) New Revision: 779 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-203: Item existence detecting in add/delete Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 14:55:06 UTC (rev 778) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 15:15:17 UTC (rev 779) @@ -29,6 +29,7 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; +import org.jboss.cache.Fqn; import org.jboss.cache.Node; = import java.io.Serializable; @@ -37,6 +38,7 @@ import java.util.Set; = import javax.jcr.InvalidItemStateException; +import javax.jcr.ItemExistsException; import javax.jcr.RepositoryException; import javax.jcr.lock.LockException; = @@ -99,12 +101,21 @@ throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); } = - // add child to Parent = - Node childNode =3D - parent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[= data.getQPath().getEntries().length - 1])); + final Fqn name =3D + makeChildNodeFqn(data.getQPath().getEntries()[data.getQPath().= getEntries().length - 1]); = - // set child id attr = - childNode.put(ITEM_ID, data.getIdentifier()); + if (parent.hasChild(name)) + { + throw new ItemExistsException("Node already exists " + data.ge= tQPath().getAsString()); + } + else + { + // add child to Parent = + Node childNode =3D parent.addChild(name); + + // set child id attr = + childNode.put(ITEM_ID, data.getIdentifier()); + } } = // add in NODES @@ -124,11 +135,19 @@ Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) { - throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); + throw new RepositoryException("Property's parent doesn't exist " = + data.getQPath().getAsString()); } = // add to parent's properties attr - parent.put(data.getQPath().getName().getAsString(), data.getIdentifi= er()); + String propName =3D data.getQPath().getName().getAsString(); + if (parent.get(propName) =3D=3D null) + { + parent.put(propName, data.getIdentifier()); + } + else + { + throw new ItemExistsException("Property already exists " + data.g= etQPath().getAsString()); + } = // add in PROPERTIES Node prop =3D propsRoot.addChild(makePropFqn(d= ata.getIdentifier())); @@ -153,9 +172,12 @@ } = // remove child on Parent - // TODO validate does deleted - boolean removed =3D - parent.removeChild(makeChildNodeFqn(data.getQPath().getEntries= ()[data.getQPath().getEntries().length - 1])); + if (!parent + .removeChild(makeChildNodeFqn(data.getQPath().getEntries()[dat= a.getQPath().getEntries().length - 1]))) + { + throw new InvalidItemStateException("Node's doesn't exist or d= eleted by another Session " + + data.getQPath().getAsString()); + } } = // remove from NODES @@ -179,7 +201,11 @@ = // remove from parent's properties attr // TODO validate does deleted - Object prev =3D parent.remove(data.getQPath().getName().getAsString(= )); + if (parent.remove(data.getQPath().getName().getAsString()) =3D=3D nu= ll) + { + throw new InvalidItemStateException("Property doesn't exist or de= leted by another Session " + + data.getQPath().getAsString()); + } = // remove from PROPERTIES boolean removed =3D propsRoot.removeChild(makePropFqn(data.getIdenti= fier())); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 14:55:06 UTC (rev 778) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 15:15:17 UTC (rev 779) @@ -640,6 +640,8 @@ conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constan= ts.SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.ROOT_UUID, new Access= ControlList())); = + conn.commit(); + = fail("The node jcr:system shouldnot be save"); } catch (Exception e) { //ok --===============2930589871860401125==-- From do-not-reply at jboss.org Thu Nov 19 10:32:10 2009 Content-Type: multipart/mixed; boundary="===============7424409829191147073==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r780 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 10:32:10 -0500 Message-ID: <200911191532.nAJFWAXB029225@svn01.web.mwc.hst.phx2.redhat.com> --===============7424409829191147073== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-19 10:32:09 -0500 (Thu, 19 Nov 2009) New Revision: 780 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-203 : The test JBossCacheStorageConnectionTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 15:15:17 UTC (rev 779) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 15:32:09 UTC (rev 780) @@ -35,6 +35,7 @@ import java.io.Serializable; import java.util.List; = +import javax.jcr.ItemExistsException; import javax.jcr.lock.LockException; = /** @@ -643,8 +644,36 @@ conn.commit(); = fail("The node jcr:system shouldnot be save"); - } catch (Exception e) { + } catch (ItemExistsException e) { //ok } } + = + public void testAddPropertyFail() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + QPath propPath1 =3D QPath.makeChildPath(Constants.ROOT_PATH, Constan= ts.JCR_PRIMARYTYPE); + TransientPropertyData propData1 =3D new TransientPropertyData(propPa= th1, propId1, 1, 1, Constants.ROOT_UUID, false); + String propValue1 =3D "Property value #1"; + propData1.setValue(new TransientValueData(propValue1)); + conn.add(propData1); + + = + = + try { + // add property (/jcr:primaryType) twice = + conn.add(propData1); + = + conn.commit(); + = + fail("The property (/jcr:primaryType) shouldnot be save"); + } catch (ItemExistsException e) { + //ok + } + } } --===============7424409829191147073==-- From do-not-reply at jboss.org Thu Nov 19 10:56:17 2009 Content-Type: multipart/mixed; boundary="===============5392853019507051704==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r781 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 19 Nov 2009 10:56:17 -0500 Message-ID: <200911191556.nAJFuH1c001504@svn01.web.mwc.hst.phx2.redhat.com> --===============5392853019507051704== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-19 10:56:16 -0500 (Thu, 19 Nov 2009) New Revision: 781 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-203 : The test JBossCacheStorageConnectionTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 15:32:09 UTC (rev 780) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 15:56:16 UTC (rev 781) @@ -35,6 +35,7 @@ import java.io.Serializable; import java.util.List; = +import javax.jcr.InvalidItemStateException; import javax.jcr.ItemExistsException; import javax.jcr.lock.LockException; = @@ -643,7 +644,7 @@ = conn.commit(); = - fail("The node jcr:system shouldnot be save"); + fail("The node jcr:system should not be save"); } catch (ItemExistsException e) { //ok } @@ -671,9 +672,70 @@ = conn.commit(); = - fail("The property (/jcr:primaryType) shouldnot be save"); + fail("The property (/jcr:primaryType) should not be save"); } catch (ItemExistsException e) { //ok } } + = + public void testDeleteNodeFail() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + // add /jcr:system + conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessCon= trolList())); + + // delete /node + conn.delete(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + = + try { + // delete node /node twice = + conn.delete(new TransientNodeData(node1path, node1id, 1, Constant= s.NT_UNSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + = + conn.commit(); + = + fail("The node (/node) should not be delete"); + } catch (InvalidItemStateException e) { + //ok + } + } + = + public void testDeletePropertyFail() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add property (/jcr:primaryType) + String propId1 =3D "1"; + conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, + 1, 1, Constants.ROOT_UUID, false)); + + // delete /jcr:primaryType + conn.delete(new TransientPropertyData(QPath.makeChildPath(Constants.= ROOT_PATH, Constants.JCR_PRIMARYTYPE), + propId1, 1, 1, Constants.ROOT_UUID, false)); + + try { + // delete /jcr:primaryType twice = + conn.delete(new TransientPropertyData(QPath.makeChildPath(Constan= ts.ROOT_PATH, Constants.JCR_PRIMARYTYPE), + propId1, 1, 1, Constants.ROOT_UUID, false)); + = + conn.commit(); + = + fail("The property (/jcr:primaryType) should not be delete"); + } catch (InvalidItemStateException e) { + //ok + } + } } --===============5392853019507051704==-- From do-not-reply at jboss.org Thu Nov 19 11:19:28 2009 Content-Type: multipart/mixed; boundary="===============8647392047544890350==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r782 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Thu, 19 Nov 2009 11:19:28 -0500 Message-ID: <200911191619.nAJGJScL006899@svn01.web.mwc.hst.phx2.redhat.com> --===============8647392047544890350== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-19 11:19:28 -0500 (Thu, 19 Nov 2009) New Revision: 782 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.j= ava jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-246: reference support added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-19 15:56:= 16 UTC (rev 781) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-19 16:19:= 28 UTC (rev 782) @@ -44,6 +44,8 @@ = public static final String LOCKS =3D "$LOCKS".intern(); = + public static final String REFS =3D "$REFS".intern(); + public static final String ITEM_DATA =3D "$data".intern(); = public static final String ITEM_ID =3D "$id".intern(); @@ -62,14 +64,18 @@ = protected final Node locksRoot; = + protected final Node refsRoot; + protected JBossCacheStorage(Node nodesRoot, Node<= Serializable, Object> propsRoot, - Node locksRoot) + Node locksRoot, Node ref= sRoot) { this.nodesRoot =3D nodesRoot; = this.propsRoot =3D propsRoot; = this.locksRoot =3D locksRoot; + + this.refsRoot =3D refsRoot; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 15:56:16 UTC (rev 781) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -19 16:19:28 UTC (rev 782) @@ -18,13 +18,17 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.datamodel.ValueData; +import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.ValueDataConvertor; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -32,13 +36,17 @@ import org.jboss.cache.Fqn; import org.jboss.cache.Node; = +import java.io.IOException; import java.io.Serializable; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Set; = import javax.jcr.InvalidItemStateException; import javax.jcr.ItemExistsException; +import javax.jcr.PropertyType; import javax.jcr.RepositoryException; import javax.jcr.lock.LockException; = @@ -75,11 +83,12 @@ * JBossCacheStorageConnection constructor. * * @param cache Cache + * @param refs = */ public JBossCacheStorageConnection(Cache cache, N= ode nodesRoot, - Node propsRoot, Node loc= ksRoot) + Node propsRoot, Node loc= ksRoot, Node refsRoot) { - super(nodesRoot, propsRoot, locksRoot); + super(nodesRoot, propsRoot, locksRoot, refsRoot); = this.cache =3D cache; } @@ -138,6 +147,43 @@ throw new RepositoryException("Property's parent doesn't exist " = + data.getQPath().getAsString()); } = + if (data.getType() =3D=3D PropertyType.REFERENCE) + { + Fqn propUUID =3D makeNodeFqn(data.getIdentifier()); + + for (ValueData value : data.getValues()) + { + + String refNodeUUID; + try + { + refNodeUUID =3D ValueDataConvertor.readString(value); + } + catch (UnsupportedEncodingException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + + Fqn refNode =3D makeNodeFqn(refNodeUUID); + + // add to $REFS map + Node refParent =3D refsRoot.getChild(ref= Node); + if (refParent =3D=3D null) + { + refParent =3D refsRoot.addChild(refNode); + } + + refParent.addChild(propUUID); + } + + } + // add to parent's properties attr String propName =3D data.getQPath().getName().getAsString(); if (parent.get(propName) =3D=3D null) @@ -162,6 +208,23 @@ { startBatch(); = + for (InternalQName mixin : data.getMixinTypeNames()) + { + if (mixin.equals(Constants.MIX_REFERENCEABLE)) + { + // check and release references + Node node =3D refsRoot.addChild(Fqn.from= Elements(data.getIdentifier())); + if (node !=3D null) + { + if (node.getChildrenNames().size() !=3D 0) + { + throw new RepositoryException("Referenceable node remove= d but still have live references."); + } + } + break; + } + } + if (data.getParentIdentifier() !=3D null) { // check if parent is cached @@ -199,6 +262,46 @@ throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); } = + if (data.getType() =3D=3D PropertyType.REFERENCE) + { + Fqn propUUID =3D makeNodeFqn(data.getIdentifier()); + + for (ValueData value : data.getValues()) + { + + String refNodeUUID; + try + { + refNodeUUID =3D ValueDataConvertor.readString(value); + } + catch (UnsupportedEncodingException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + + // remove property from referencedNode in $REFS map + + Node refParent =3D refsRoot.getChild(mak= eNodeFqn(refNodeUUID)); + if (refParent !=3D null) + { + refParent.removeChild(propUUID); + } + // check is there is no more references + if (refParent.getChildrenNames().size() =3D=3D 0) + { + //TODO remove children + refsRoot.removeChild(makeNodeFqn(refNodeUUID)); + } + } + + } + // remove from parent's properties attr // TODO validate does deleted if (parent.remove(data.getQPath().getName().getAsString()) =3D=3D nu= ll) @@ -474,8 +577,33 @@ public List getReferencesData(String nodeIdentifier) thro= ws RepositoryException, IllegalStateException, UnsupportedOperationException { - // TODO refs impl - return new ArrayList(); + ArrayList references =3D new ArrayList(); + + Node node =3D this.refsRoot.getChild(Fqn.fromE= lements(nodeIdentifier)); + if (node !=3D null) + { + Set props =3D node.getChildrenNames(); + + for (Object o : props) + { + String propUUID =3D (String)o; + Node prop =3D propsRoot.getChild(Fqn.fro= mElements(propUUID)); + if (prop =3D=3D null) + { + throw new RepositoryException("FATAL Property record not fo= und(" + propUUID + + "), but listed in reference properties of node " + nod= eIdentifier); + } + + PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); + if (propData =3D=3D null) + { + throw new RepositoryException("FATAL Property data is null.= Property UUID " + propUUID); + } + + references.add(propData); + } + } + return references; } = /** @@ -625,13 +753,107 @@ { startBatch(); = + Fqn propFqn =3D Fqn.fromElements(data.getIdentifier()); + // update in PROPERTIES - Node prop =3D propsRoot.getChild(makePropFqn(d= ata.getIdentifier())); + Node prop =3D propsRoot.getChild(propFqn); if (prop =3D=3D null) { throw new IllegalStateException("Property was deleted " + data.ge= tQPath().getAsString()); } = + if (data.getType() =3D=3D PropertyType.REFERENCE) + { + PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); + if (propData =3D=3D null) + { + throw new RepositoryException("FATAL Property data is null. Pa= rent " + data.getQPath().getAsString()); + } + + //get Set of old values + Set removeSet =3D new HashSet(); + for (ValueData value : propData.getValues()) + { + try + { + removeSet.add(ValueDataConvertor.readString(value)); + } + catch (UnsupportedEncodingException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + } + + Set addSet =3D new HashSet(); + // check new = + for (ValueData value : data.getValues()) + { + try + { + addSet.add(ValueDataConvertor.readString(value)); + } + catch (UnsupportedEncodingException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + } + + String[] added =3D new String[addSet.size()]; + addSet.toArray(added); + + for (String id : added) + { + if (removeSet.contains(id)) + { + removeSet.remove(id); + addSet.remove(id); + } + } + + // remove references to nodes + for (String id : removeSet) + { + Node node =3D refsRoot.getChild(Fqn.from= Elements(id)); + if (!node.removeChild(propFqn)) + { + throw new RepositoryException("FATAL Reference property was= not removed from REFS table of node " + id); + } + + // check node + if (node.getChildrenNames().size() =3D=3D 0) + { + //TODO remove children + refsRoot.removeChild(Fqn.fromElements(id)); + } + } + + // add references to nodes + for (String id : addSet) + { + Fqn nodeFqn =3D Fqn.fromElements(id); + Node node =3D refsRoot.getChild(nodeFqn); + + if (node =3D=3D null) + { + node =3D refsRoot.addChild(nodeFqn); + } + node.addChild(propFqn); + } + } + + // remove prop.put(ITEM_DATA, data); } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-19 15:56:16 UTC (rev 781) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-19 16:19:28 UTC (rev 782) @@ -74,6 +74,8 @@ = private Node locks; = + private Node refs; + /** * JBossWorkspaceDataContainer constructor. * @@ -130,6 +132,7 @@ this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .NODES)); this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheSt= orage.PROPS)); this.locks =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage= .LOCKS)); + this.refs =3D cacheRoot.addChild(Fqn.fromElements(JBossCacheStorage.= REFS)); cache.endBatch(true); } = @@ -179,7 +182,7 @@ // throw new RepositoryException("Container is not started"); // } = - return new JBossCacheStorageConnection(cache, nodes, properties, loc= ks); + return new JBossCacheStorageConnection(cache, nodes, properties, loc= ks, refs); } = /** @@ -193,7 +196,7 @@ // throw new RepositoryException("Container is not started"); // } = - return new JBossCacheStorageConnection(cache, nodes, properties, loc= ks); + return new JBossCacheStorageConnection(cache, nodes, properties, loc= ks, refs); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectio= nTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java 2009-11-19 15:56:16 UTC (rev 781) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/AbstractJBossCacheStorageConnectionTest.= java 2009-11-19 16:19:28 UTC (rev 782) @@ -24,7 +24,6 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.storage.JDBCWorkspaceDataContaine= rTestBase; -import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.jboss.cache.Cache; import org.jboss.cache.CacheSPI; @@ -57,6 +56,8 @@ = protected Node locks; = + protected Node refs; + protected String jbcConfig; = /** @@ -84,9 +85,10 @@ nodes =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.NODES)= ); props =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.PROPS)= ); locks =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.LOCKS)= ); + refs =3D cacheRoot.addChild(Fqn.fromString(JBossCacheStorage.REFS)); cache.endBatch(true); // JCR connection - conn =3D new JBossCacheStorageConnection(cache, nodes, props, locks); + conn =3D new JBossCacheStorageConnection(cache, nodes, props, locks,= refs); } = protected void initJBCConfig() @@ -157,8 +159,8 @@ Constants.DEFAULT_ENCODING)); } = - protected void checkChildProp(Node node, Internal= QName propName, String propId, QPath propPath, - Object propValue) throws UnsupportedEncodingException, IllegalStateE= xception, IOException + protected void checkChildProp(Node node, Internal= QName propName, String propId, + QPath propPath, Object propValue) throws UnsupportedEncodingExceptio= n, IllegalStateException, IOException { String pid =3D (String)node.get(propName.getAsString()); = @@ -201,5 +203,5 @@ assertEquals("Node persisted version wrong", version, childNodeDa= ta.getPersistedVersion()); } } - = + } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 15:56:16 UTC (rev 781) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-19 16:19:28 UTC (rev 782) @@ -24,8 +24,8 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; @@ -33,11 +33,14 @@ import org.jboss.cache.Node; = import java.io.Serializable; +import java.util.ArrayList; import java.util.List; = import javax.jcr.InvalidItemStateException; import javax.jcr.ItemExistsException; import javax.jcr.lock.LockException; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; = /** * Created by The eXo Platform SAS. @@ -635,13 +638,13 @@ // add /jcr:system conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); - = - = - try { + + try + { // add /jcr:system twice = conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constan= ts.SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new Access= ControlList())); - = + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessContro= lList())); + conn.commit(); = fail("The node jcr:system should not be save"); @@ -738,4 +741,98 @@ //ok } } + + public void testGetReferences() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add refernceable node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]firstParent:1"); + + NodeData node1 =3D + new TransientNodeData(node1path, node1id, 1, Constants.NT_UNSTRUC= TURED, + new InternalQName[]{Constants.MIX_REFERENCEABLE}, 0, Constants= .ROOT_UUID, new AccessControlList()); + conn.add(node1); + + // add node2 with reference on node + String node2id =3D "2"; + QPath node2path =3D QPath.parse("[]:1[]secondParent:1"); + conn.add(new TransientNodeData(node2path, node2id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + + String refpropid =3D "21"; + TransientPropertyData prop =3D + new TransientPropertyData(QPath.makeChildPath(node2path, "[]refpr= op:1"), refpropid, 0, PropertyType.REFERENCE, + node2id, false); + + prop.setValue(new TransientValueData(node1id)); + conn.add(prop); + + String node3id =3D "3"; + QPath node3path =3D QPath.parse("[]:1[]node3:1"); + + NodeData node3 =3D + new TransientNodeData(node3path, node3id, 1, Constants.NT_UNSTRUC= TURED, + new InternalQName[]{Constants.MIX_REFERENCEABLE}, 0, Constants= .ROOT_UUID, new AccessControlList()); + conn.add(node3); + + // check in nodes + treePrint(nodes); + + // get root node ([]:1) + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + assertNotNull("Node expected", rootNode); + + // check root Node + checkNode(rootNode, Constants.ROOT_UUID, Constants.ROOT_PATH); + + // cechk childs + assertEquals("Childs expected", 3, rootNode.getChildren().size()); + checkChildNode(rootNode, node1id, node1path); + checkChildNode(rootNode, node2id, node2path); + checkChildNode(rootNode, node3id, node3path); + + List props =3D conn.getReferencesData(node1id); + assertEquals("References expected", 1, props.size()); + props =3D conn.getReferencesData(node3id); + assertEquals("References expected", 0, props.size()); + + // try remove referenced node + try + { + conn.delete(node1); + fail(); + } + catch (RepositoryException e) + { + //ok + } + + // update reference property + + TransientPropertyData updateProp =3D + new TransientPropertyData(prop.getQPath(), prop.getIdentifier(), = 0, PropertyType.REFERENCE, prop + .getParentIdentifier(), false); + + List list =3D new ArrayList(); + list.add(new TransientValueData(node1id)); + list.add(new TransientValueData(node3id)); + + // ValueData[]{new TransientValueData(node1id)} + updateProp.setValues(list); + conn.update(updateProp); + + // check + props =3D conn.getReferencesData(node1id); + assertEquals("References expected", 1, props.size()); + props =3D conn.getReferencesData(node3id); + assertEquals("References expected", 1, props.size()); + + conn.delete(updateProp); + conn.delete(node1); + conn.delete(node3); + } } --===============8647392047544890350==-- From do-not-reply at jboss.org Fri Nov 20 03:28:45 2009 Content-Type: multipart/mixed; boundary="===============0263400632418314933==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r783 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/lock and 1 other directories. Date: Fri, 20 Nov 2009 03:28:45 -0500 Message-ID: <200911200828.nAK8SjMD009465@svn01.web.mwc.hst.phx2.redhat.com> --===============0263400632418314933== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-20 03:28:44 -0500 (Fri, 20 Nov 2009) New Revision: 783 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockRemover.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/PersistentLockManager.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/RepositoryContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/lock/TestSessionLockManager.java Log: EXOJCR-243: Added lock removing logic on timeout. This added through persis= tent lock manager, that creates worker thread to remove locks. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/RepositoryContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-19 16:19:28 UTC (rev 782) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-20 08:28:44 UTC (rev 783) @@ -40,6 +40,7 @@ import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.core.WorkspaceInitializer; import org.exoplatform.services.jcr.impl.core.access.DefaultAccessManagerI= mpl; +import org.exoplatform.services.jcr.impl.core.lock.PersistentLockManager; import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManager= Impl; import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerImpl; import org.exoplatform.services.jcr.impl.core.nodetype.registration.JcrNod= eTypeDataPersister; @@ -286,6 +287,10 @@ } } = + // persistent lock manager + + workspaceContainer.registerComponentImplementation(PersistentLock= Manager.class); + // initializer Class initilizerType; if (wsConfig.getInitializer() !=3D null && wsConfig.getInitialize= r().getType() !=3D null) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-19 16:19:28 UTC (rev 782) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-20 08:28:44 UTC (rev 783) @@ -89,6 +89,7 @@ * @param sessionScoped * @param owner * @param timeOut + * is seconds! */ public LockData(String nodeIdentifier, String lockToken, boolean deep, = boolean sessionScoped, String owner, long timeOut) Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/lock/LockRemover.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockRemover.java (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockRemover.java 2009-11-20 08:28:44 UTC (rev 783) @@ -0,0 +1,62 @@ +package org.exoplatform.services.jcr.impl.core.lock; + +/* + * 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. + */ + +import org.exoplatform.services.jcr.impl.proccess.WorkerThread; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; + +/** + * Created by The eXo Platform SAS. + * = + * @author Sergey Kabashn= yuk + * @version $Id$ + */ +public class LockRemover extends WorkerThread +{ + + private final Log log =3D ExoLogger.getLogger("jcr.lock.LockRemover"); + + public static final long DEFAULT_THREAD_TIMEOUT =3D 30000; // 30 + + private final PersistentLockManager persistentLockManager; + + public LockRemover(PersistentLockManager persistentLockManager) + { + this(persistentLockManager, DEFAULT_THREAD_TIMEOUT); + } + + private LockRemover(PersistentLockManager persistentLockManager, long t= imeout) + { + super(timeout); + this.persistentLockManager =3D persistentLockManager; + setName("LockRemover " + getId()); + setDaemon(true); + start(); + if (log.isDebugEnabled()) + log.debug("LockRemover instantiated name=3D " + getName() + " tim= eout=3D " + timeout); + } + + @Override + protected void callPeriodically() throws Exception + { + persistentLockManager.removeExpired(); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/core/lock/LockRemover.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/lock/PersistentLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/PersistentLockManager.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/PersistentLockManager.java 2009-11-20 08:28:44 UT= C (rev 783) @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core.lock; + +import org.exoplatform.services.jcr.access.SystemIdentity; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; +import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; +import org.exoplatform.services.jcr.observation.ExtendedEvent; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.picocontainer.Startable; + +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.RepositoryException; + +/** + * This is a persistent lock manager, that currently is responsible for re= moving expired locks + * = + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class PersistentLockManager implements Startable +{ + private final Log log =3D ExoLogger.getLogger(this.getClass().getName()= ); + + /** + * Lock remover thread. + */ + private LockRemover lockRemover; + + /** + * Workspace data manager + */ + WorkspacePersistentDataManager dataManager; + + /** + * creates persistent lock manager = + */ + public PersistentLockManager(WorkspacePersistentDataManager dataManager) + { + this.dataManager =3D dataManager; + } + + /** + * @see org.picocontainer.Startable#start() + */ + public void start() + { + lockRemover =3D new LockRemover(this); + } + + /** + * @see org.picocontainer.Startable#stop() + */ + public void stop() + { + lockRemover.halt(); + lockRemover.interrupt(); + } + + /** + * Removes all expired locks + */ + protected void removeExpired() + { + List lockDatas; + try + { + lockDatas =3D dataManager.getLocksData(); + } + catch (RepositoryException e) + { + // exception getting list of locks, return + log.error(e.getMessage(), e); + return; + } + + if (lockDatas !=3D null) + { + for (LockData lockData : lockDatas) + { + System.out.println(" found sucg lock: " + lockData.getNodeIden= tifier()); + System.out.println(" it's expir time: " + lockData.getTimeToDe= ath()); + if (lockData.getTimeToDeath() < 0) + { + // try to remove node, if unsuccessful then, at least, try = to remove other expired locks + try + { + NodeData node =3D (NodeData)dataManager.getItemData(lock= Data.getNodeIdentifier()); + + PlainChangesLog changesLog =3D + new PlainChangesLogImpl(new ArrayList(), S= ystemIdentity.SYSTEM, ExtendedEvent.UNLOCK); + ItemData lockOwner =3D dataManager.getItemData(node, new= QPathEntry(Constants.JCR_LOCKOWNER, 0)); + changesLog.add(ItemState.createDeletedState(lockOwner)); + ItemData lockIsDeep =3D dataManager.getItemData(node, ne= w QPathEntry(Constants.JCR_LOCKISDEEP, 0)); + changesLog.add(ItemState.createDeletedState(lockIsDeep)); + + dataManager.save(changesLog); + } + catch (RepositoryException e) + { + log.error("Error removing expired lock from node : " + l= ockData.getNodeIdentifier()); + } + } + } + } + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/core/lock/PersistentLockManager.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-19 16:19:28 UTC (= rev 782) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-20 08:28:44 UTC (= rev 783) @@ -61,7 +61,7 @@ /** * Default lock time out. 30min */ - public static final long DEFAULT_LOCK_TIMEOUT =3D 1000 * 60 * 30; + public static final long DEFAULT_LOCK_TIMEOUT =3D 60 * 30; = /** * Search lockData for given node = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/core/lock/TestSessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-19 16:19:28 U= TC (rev 782) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/lock/TestSessionLockManager.java 2009-11-20 08:28:44 U= TC (rev 783) @@ -173,8 +173,7 @@ = public void testRemoveByTimeOut() throws RepositoryException { - int REMOVER_SCHEDULE_TIME =3D 10000; // 10s?! need to place correct = value - int lockTimeOut =3D 2000; + int lockTimeOut =3D 2; NodeImpl node1 =3D (NodeImpl)testRoot.addNode("testRemoveByTimeOut"); node1.addMixin("mix:lockable"); session.save(); @@ -183,7 +182,7 @@ try { // sleep for Remover period time + lockTimeOut + 1s for stability - Thread.sleep(REMOVER_SCHEDULE_TIME + lockTimeOut + 1000); + Thread.sleep(LockRemover.DEFAULT_THREAD_TIMEOUT + lockTimeOut * 1= 000 + 5000); } catch (InterruptedException e) { --===============0263400632418314933==-- From do-not-reply at jboss.org Fri Nov 20 04:48:12 2009 Content-Type: multipart/mixed; boundary="===============8607765552368504840==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r784 - in jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage: jbosscache and 1 other directory. Date: Fri, 20 Nov 2009 04:48:12 -0500 Message-ID: <200911200948.nAK9mCEK022730@svn01.web.mwc.hst.phx2.redhat.com> --===============8607765552368504840== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-20 04:48:12 -0500 (Fri, 20 Nov 2009) New Revision: 784 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-203 : The test JDBCCacheLoaderTest was fixed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java 2009-11-20 = 08:28:44 UTC (rev 783) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java 2009-11-20 = 09:48:12 UTC (rev 784) @@ -72,7 +72,7 @@ System.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.exoplatform= .services.naming.SimpleContextFactory"); = // Create data source. Will be created new data source to new test. = - String dataSourceName =3D "jdbcjcr_" + IdGenerator.generate(); + String dataSourceName =3D getDataSourceName(); createNewDataSource(dataSourceName); = WorkspaceEntry ws =3D @@ -86,6 +86,10 @@ = persistentContainer =3D new JDBCWorkspaceDataContainer(ws, re, null,= valueStoragePluginProvider); } + = + protected String getDataSourceName() { + return "jdbcjcr_" + IdGenerator.generate(); + } = = protected WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Str= ing dsName, String vsPath, ContainerEntry entry) throws Exception Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-20 08:2= 8:44 UTC (rev 783) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-20 09:4= 8:12 UTC (rev 784) @@ -56,8 +56,6 @@ public class JDBCCacheLoaderTest extends AbstractCacheLoaderTest { = - private JDBCWorkspaceDataContainer persistentContainer; - private JDBCCacheLoader loader; = /** --===============8607765552368504840==-- From do-not-reply at jboss.org Fri Nov 20 04:50:38 2009 Content-Type: multipart/mixed; boundary="===============5886121335091823566==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r785 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 20 Nov 2009 04:50:38 -0500 Message-ID: <200911200950.nAK9ocGD023157@svn01.web.mwc.hst.phx2.redhat.com> --===============5886121335091823566== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-20 04:50:37 -0500 (Fri, 20 Nov 2009) New Revision: 785 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorage.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-203: Node.move re-view & commented the impl, TODO on the problem of = cache reload; = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-20 09:48:= 12 UTC (rev 784) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorage.java 2009-11-20 09:50:= 37 UTC (rev 785) @@ -49,6 +49,8 @@ public static final String ITEM_DATA =3D "$data".intern(); = public static final String ITEM_ID =3D "$id".intern(); + = + public static final String INVALID_DATA =3D "$invalidData".intern(); = @Deprecated public static final String SESSION_ID =3D "$sessionId".intern(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 09:48:12 UTC (rev 784) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 09:50:37 UTC (rev 785) @@ -93,6 +93,54 @@ this.cache =3D cache; } = + // helpers + @Deprecated + protected NodeData getNodeData(Node node) + { + Object data =3D node.get(ITEM_DATA); + if (data !=3D null) + { + // check if invalid + if (data.equals(INVALID_DATA)) + { + // evict to force read from DB + cache.evict(node.getFqn(), true); + Thread.yield(); + + // and ask again = + Node freshNode =3D cache.getNode(node.ge= tFqn()); + if (freshNode !=3D null) + { + Object freshData =3D freshNode.get(ITEM_DATA); + if (freshData !=3D null) + { + return (NodeData)freshData; + } + else + { + // TODO + return null; + } + } + else + { + // TODO + return null; + } + } + else + { + return (NodeData)data; + } + } + else + { + return null; + } + } + + // Connection API + /** * {@inheritDoc} */ @@ -259,7 +307,7 @@ Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) { - throw new RepositoryException("Property parent doesn't exist " + = data.getQPath().getAsString()); + throw new RepositoryException("Property's parent doesn't exist " = + data.getQPath().getAsString()); } = if (data.getType() =3D=3D PropertyType.REFERENCE) @@ -339,8 +387,8 @@ Node node =3D nodesRoot.getChild(makeNod= eFqn(nodeId)); if (node =3D=3D null) { - throw new RepositoryException("FATAL Node record not found(= " + nodeId + "), but listed in proprties of " - + parent.getQPath().getAsString()); + throw new RepositoryException("FATAL Node record not found(= " + nodeId + + "), but listed in child nodes of " + parent.getQPath()= .getAsString()); } NodeData nodeData =3D (NodeData)node.get(ITEM_DATA); if (nodeData =3D=3D null) @@ -548,6 +596,7 @@ } else { + // TODO move usecase: re-load on demand, try cache.evict(node.= getFqn()); throw new RepositoryException("FATAL NodeData empty " + identi= fier); } } @@ -614,94 +663,88 @@ { //TODO we expecting that on session.move() there will be only one re= name() method call = - startBatch(); - - String nodeUUID =3D data.getIdentifier(); - - //1. Update renamed node and also get old nodeData - Node node =3D nodesRoot.getChild(makeNodeFqn(n= odeUUID)); - if (node =3D=3D null) - { - throw new RepositoryException("FATAL renamed node is not exist" += data.getQPath().getAsString()); - } - - NodeData oldNodeData =3D (NodeData)node.put(ITEM_DATA, data); - if (oldNodeData =3D=3D null) - { - throw new RepositoryException("FATAL NodeData is empty " + data.g= etQPath().getAsString()); - } - - // 2. remove renamed node from child list of previous parent node - // check if parent is cached - Node oldparent =3D nodesRoot.getChild(makeNode= Fqn(oldNodeData.getParentIdentifier())); - if (oldparent =3D=3D null) - { - throw new RepositoryException("Nodes old parent doesn't exist " += data.getQPath().getAsString()); - } - - // remove node form old parent child list - boolean removed =3D - oldparent - .removeChild(makeChildNodeFqn(oldNodeData.getQPath().getEntrie= s()[oldNodeData.getQPath().getEntries().length - 1])); - if (!removed) - { - throw new RepositoryException("Node was not removed from child li= st of old parent " - + data.getQPath().getAsString()); - } - - // 3. add node to child list of new parent node - if (data.getParentIdentifier() !=3D null) - { - // check if parent is cached - Node newparent =3D nodesRoot.getChild(makeN= odeFqn(data.getParentIdentifier())); - if (newparent =3D=3D null) - { - throw new RepositoryException("Nodes new parent doesn't exist = " + data.getQPath().getAsString()); - } - - // add child to Parent = - Node childNode =3D - newparent.addChild(makeChildNodeFqn(data.getQPath().getEntries= ()[data.getQPath().getEntries().length - 1])); - - // set child id attr = - childNode.put(ITEM_ID, data.getIdentifier()); - } - - // 4. update all child nodes - Set> childNodes =3D node.getChildren(); - - for (Node child : childNodes) - { - String childNodeId =3D (String)child.get(ITEM_ID); - if (childNodeId =3D=3D null) - { - throw new RepositoryException("FATAL Child Node Id key is null= . Parent " + data.getQPath().getAsString()); - } - - // TODO NodeData or PropertyData? As ItemData check then and cast. - Node childnode =3D nodesRoot.getChild(makeN= odeFqn(childNodeId)); - if (childnode =3D=3D null) - { - throw new RepositoryException("FATAL Node record not found(" += childNodeId + "), but listed in childs of " - + data.getQPath().getAsString()); - } - NodeData nodeData =3D (NodeData)childnode.get(ITEM_DATA); - if (nodeData =3D=3D null) - { - // TODO should not occurs by contract - throw new RepositoryException("Child node data is null. Parent= " + data.getQPath().getAsString()); - } - - //repack child NodeData with new QPath - //TODO check it - QPath newPath =3D QPath.makeChildPath(data.getQPath(), nodeData.g= etQPath().getName()); - TransientNodeData newNodeData =3D - new TransientNodeData(newPath, nodeData.getIdentifier(), nodeD= ata.getPersistedVersion(), nodeData - .getPrimaryTypeName(), nodeData.getMixinTypeNames(), nodeDa= ta.getOrderNumber(), nodeData - .getParentIdentifier(), nodeData.getACL()); - childnode.put(ITEM_DATA, newNodeData); - } - +// startBatch(); +// +// String nodeId =3D data.getIdentifier(); +// +// //1. Update renamed node and also get old nodeData +// Node node =3D nodesRoot.getChild(makeNodeFqn= (nodeId)); +// if (node =3D=3D null) +// { +// throw new InvalidItemStateException("Renamed node is not exist"= + data.getQPath().getAsString()); +// } +// +// NodeData prevData =3D (NodeData)node.put(ITEM_DATA, data); +// if (prevData =3D=3D null) +// { +// throw new RepositoryException("FATAL NodeData is empty " + data= .getQPath().getAsString()); +// } +// +// // 2. remove renamed node from child list of previous parent node +// // check if parent is cached +// Node prevParent =3D nodesRoot.getChild(makeN= odeFqn(prevData.getParentIdentifier())); +// if (prevParent =3D=3D null) +// { +// throw new InvalidItemStateException("Node's previous parent doe= sn't exist " +// + prevData.getQPath().getAsString() + ". Node " + data.getQP= ath().getAsString()); +// } +// +// // remove node form old parent child list +// if (!prevParent +// .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[= prevData.getQPath().getEntries().length - 1]))) +// { +// throw new RepositoryException("FATAL Node doesn't listed in chi= ldren nodes of previous parent " +// + prevData.getQPath().getAsString() + ". Node " + data.getQP= ath().getAsString()); +// } +// +// // 3. add node to child list of new parent node +// // check if parent is cached +// Node newParent =3D nodesRoot.getChild(makeNo= deFqn(data.getParentIdentifier())); +// if (newParent =3D=3D null) +// { +// throw new InvalidItemStateException("Node's new parent doesn't = exist " + data.getParentIdentifier() +// + ". Node " + data.getQPath().getAsString()); +// } +// +// // add child to Parent = +// Node childNode =3D +// newParent.addChild(makeChildNodeFqn(data.getQPath().getEntries(= )[data.getQPath().getEntries().length - 1])); +// +// // set child id attr = +// childNode.put(ITEM_ID, data.getIdentifier()); +// +// // 4. update all child nodes +// for (Node child : node.getChildren()) +// { +// String childNodeId =3D (String)child.get(ITEM_ID); +// if (childNodeId =3D=3D null) +// { +// throw new RepositoryException("FATAL Child Node Id key is nu= ll. Parent " + data.getQPath().getAsString()); +// } +// +// // TODO NodeData or PropertyData? As ItemData check then and ca= st. +// Node childnode =3D nodesRoot.getChild(mak= eNodeFqn(childNodeId)); //cache.evict(fqn) +// if (childnode =3D=3D null) +// { +// throw new RepositoryException("FATAL Node record not found("= + childNodeId + "), but listed in childs of " +// + data.getQPath().getAsString()); +// } +// NodeData nodeData =3D (NodeData)childnode.get(ITEM_DATA); +// if (nodeData =3D=3D null) +// { +// // TODO should not occurs by contract +// throw new RepositoryException("Child node data is null. Pare= nt " + data.getQPath().getAsString()); +// } +// +// //repack child NodeData with new QPath +// //TODO check it +// QPath newPath =3D QPath.makeChildPath(data.getQPath(), nodeData= .getQPath().getName()); +// TransientNodeData newNodeData =3D +// new TransientNodeData(newPath, nodeData.getIdentifier(), nod= eData.getPersistedVersion(), nodeData +// .getPrimaryTypeName(), nodeData.getMixinTypeNames(), node= Data.getOrderNumber(), nodeData +// .getParentIdentifier(), nodeData.getACL()); +// childnode.put(ITEM_DATA, newNodeData); +// } } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-20 09:48:12 UTC (rev 784) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-20 09:50:37 UTC (rev 785) @@ -125,7 +125,6 @@ this.cache.addInterceptor(indexInterceptor, CacheStoreInterceptor.cl= ass); = Node cacheRoot =3D cache.getRoot(); - //Node wsRoot =3D cacheRoot.addChild(Fqn.fromE= lements(repositoryName, containerName)); = // prepare cache structures cache.startBatch(); @@ -138,25 +137,13 @@ = public void start() { - - // TODO started on init, due to RepositoryContainer logic - // if (persistentContainer instanceof Startable) - // { - // ((Startable)persistentContainer).start(); - // } - // - // this.cache.start(); - // = - // Node cacheRoot =3D cache.getRoot(); - // //Node wsRoot =3D cacheRoot.addChild(F= qn.fromElements(repositoryName, containerName)); - // - // // prepare cache structures - // this.nodes =3D cacheRoot.addChild(Fqn.fromElements(JBossCach= eStorage.NODES)); - // this.properties =3D cacheRoot.addChild(Fqn.fromElements(JBos= sCacheStorage.PROPS)); } = public void stop() { + this.cache.stop(); + this.cache.destroy(); + = if (persistentContainer instanceof Startable) { ((Startable)persistentContainer).stop(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 09:48:12= UTC (rev 784) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 09:50:37= UTC (rev 785) @@ -113,7 +113,6 @@ LOG.warn("PUT_DATA_ERASE modification"); break; case PUT_KEY_VALUE : - if (m.getFqn().size() =3D=3D 2) { if (isUpdate(m, (JDBCStorageConnection)conn)) --===============5886121335091823566==-- From do-not-reply at jboss.org Fri Nov 20 06:17:03 2009 Content-Type: multipart/mixed; boundary="===============0342904854778665817==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r786 - in jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage: jbosscache and 1 other directory. Date: Fri, 20 Nov 2009 06:17:03 -0500 Message-ID: <200911201117.nAKBH3uv003374@svn01.web.mwc.hst.phx2.redhat.com> --===============0342904854778665817== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-20 06:17:03 -0500 (Fri, 20 Nov 2009) New Revision: 786 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java Log: EXOJCR-203 : The test JBossCacheRestartTest was added. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java 2009-11-20 = 09:50:37 UTC (rev 785) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java 2009-11-20 = 11:17:03 UTC (rev 786) @@ -215,6 +215,9 @@ mixins.add(Constants.EXO_PRIVILEGEABLE); mixins.add(Constants.EXO_OWNEABLE); addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.JCR_MIXINTYPES, mixins, true); + = + // add property exo:owner + addDbProperty(conn, Constants.ROOT_PATH, Constants.ROOT_UUID, Consta= nts.EXO_OWNER, "admin", false); = conn.commit(); } Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java 2009-11-20 11= :17:03 UTC (rev 786) @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.storage.jbosscache; + +import java.io.Serializable; + +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author
Alex Re= shetnyak = + * @version $Id$ + */ +public class JBossCacheRestartTest + extends AbstractJBossCacheStorageConnectionTest +{ + protected String getDataSourceName() + { + return "jdbc_name"; + } + = + public void testAddNode() throws Exception + { + // add root (/) + initJCRRoot(); + = + // check before stop + Node rNode =3D cache.getRoot().getChild(Fqn.fr= omElements(JBossCacheStorage.NODES, Constants.ROOT_UUID)); + assertNotNull("Node expected", rNode); + checkNode(rNode, Constants.ROOT_UUID, Constants.ROOT_PATH); + = + // stop cache + cache.stop(); + cache.destroy(); + = + // start cache + super.setUp(); + = + // check after restart + rNode =3D cache.getRoot().getChild(Fqn.fromElements(JBossCacheStorag= e.NODES, Constants.ROOT_UUID)); + assertNotNull("Node expected", rNode); + checkNode(rNode, Constants.ROOT_UUID, Constants.ROOT_PATH); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheRestartTest.j= ava ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============0342904854778665817==-- From do-not-reply at jboss.org Fri Nov 20 06:36:15 2009 Content-Type: multipart/mixed; boundary="===============1218156896246833012==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r787 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/lock. Date: Fri, 20 Nov 2009 06:36:15 -0500 Message-ID: <200911201136.nAKBaFBe007643@svn01.web.mwc.hst.phx2.redhat.com> --===============1218156896246833012== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-20 06:36:15 -0500 (Fri, 20 Nov 2009) New Revision: 787 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/LockImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/PersistentLockManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/SessionLockManager.java Log: EXOJCR-243: small fix related to refresh() and getLockToken() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-20 11:17:03 UTC (rev 786) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockData.java 2009-11-20 11:36:15 UTC (rev 787) @@ -121,11 +121,6 @@ return false; } = - public String getTokenHash() - { - return tokenHash; - } - /** * @return the nodeIdentifier */ @@ -150,6 +145,11 @@ return birthday + timeOut - System.currentTimeMillis() / 1000; } = + public String getTokenHash() + { + return tokenHash; + } + /* * (non-Javadoc) * @see java.lang.Object#hashCode() @@ -174,14 +174,6 @@ } = /** - * @return - */ - protected long getTimeOut() - { - return timeOut; - } - - /** * @see java.io.Externalizable#readExternal(java.io.ObjectInput) */ public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException @@ -235,4 +227,12 @@ = } = + /** + * @return + */ + protected long getTimeOut() + { + return timeOut; + } + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/LockImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-20 11:17:03 UTC (rev 786) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockImpl.java 2009-11-20 11:36:15 UTC (rev 787) @@ -21,6 +21,7 @@ import org.exoplatform.services.jcr.core.lock.ExtendedLock; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; +import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.observation.ExtendedEvent; = @@ -45,8 +46,7 @@ = private SessionDataManager sessionDataManager; = - // Token is not stored in lockData any more - private String token; + private SessionLockManager lockManager; = private String sessionId; = @@ -54,11 +54,12 @@ * @param session * @param lockData */ - public LockImpl(SessionDataManager sessionDataManager, LockData lockDat= a, String token, String sessionId) + public LockImpl(SessionLockManager lockManager, SessionDataManager sess= ionDataManager, LockData lockData, + String sessionId) { this.lockData =3D lockData; this.sessionDataManager =3D sessionDataManager; - this.token =3D token; + this.lockManager =3D lockManager; this.live =3D true; this.sessionId =3D sessionId; } @@ -76,7 +77,7 @@ */ public String getLockToken() { - return token; + return lockManager.getLockToken(lockData); } = /** @@ -127,7 +128,9 @@ new LockData(lockData.getNodeIdentifier(), lockData.getTokenHash(= ), lockData.isDeep(), lockData .isSessionScoped(), lockData.getOwner(), lockData.getTimeOut()= ); addChangesLog.setLockData(newLockData); - sessionDataManager.getWorkspaceDataManager().save(addChangesLog); + TransactionChangesLog log =3D new TransactionChangesLog(); + log.addLog(addChangesLog); + sessionDataManager.getWorkspaceDataManager().save(log); this.lockData =3D newLockData; } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/PersistentLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/PersistentLockManager.java 2009-11-20 11:17:03 UT= C (rev 786) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/PersistentLockManager.java 2009-11-20 11:36:15 UT= C (rev 787) @@ -38,7 +38,7 @@ import javax.jcr.RepositoryException; = /** - * This is a persistent lock manager, that currently is responsible for re= moving expired locks + * This is a persistent lock manager (workspace-layer), that currently is = responsible for removing expired locks * = * @author Nikolay Zamosenchuk * @version $Id$ @@ -89,6 +89,7 @@ protected void removeExpired() { List lockDatas; + // try to acquire list of locks try { lockDatas =3D dataManager.getLocksData(); @@ -99,7 +100,7 @@ log.error(e.getMessage(), e); return; } - + // if acquired, try to remove each expired if (lockDatas !=3D null) { for (LockData lockData : lockDatas) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/SessionLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-20 11:17:03 UTC (= rev 786) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/SessionLockManager.java 2009-11-20 11:36:15 UTC (= rev 787) @@ -52,6 +52,8 @@ import javax.jcr.lock.LockException; = /** + * Session-layer lock manager. + * = * @author Nikolay Zamosenchuk * @version $Id$ * @@ -121,7 +123,7 @@ } else lockTimeOut =3D DEFAULT_LOCK_TIMEOUT; - this.tokens =3D new HashMap(); = + this.tokens =3D new HashMap(); this.tokenHash =3D new HashMap(); } = @@ -137,17 +139,6 @@ } = /** - * Removes token from current session - * @param token - */ - public void removeLockToken(String token) - { - String hash =3D getHash(token); - tokens.remove(token); - tokenHash.remove(hash); - } - - /** * Tries to get Lock for node. Is node is not a lockholder, then parent= with deep lock is looked for. = * = * @param node @@ -164,7 +155,7 @@ throw new LockException("Node not locked: " + node.getQPath()); } // if session doesn't have token, null will be returned - return new LockImpl(sessionDataManager, lockData, tokenHash.get(lock= Data.getTokenHash()), sessionID); + return new LockImpl(this, sessionDataManager, lockData, sessionID); } = /** @@ -177,28 +168,26 @@ } = /** - * Checks if node actually has a lock. = + * Returns real token, if session has it * = - * @param node + * @param lockData * @return - * @throws RepositoryException */ - public boolean holdsLock(NodeData node) throws RepositoryException + public String getLockToken(LockData lockData) { - return getLockData(node, SEARCH_EXACMATCH) !=3D null; + return tokenHash.get(lockData.getTokenHash()); } = /** - * Checks if current session has a token (access) for this node. + * Checks if node actually has a lock. = * = * @param node * @return * @throws RepositoryException */ - public boolean isLockHolder(NodeData node) throws RepositoryException + public boolean holdsLock(NodeData node) throws RepositoryException { - LockData lockData =3D getLockData(node, SEARCH_EXACMATCH | SEARCH_PA= RENT); - return lockData !=3D null && isLockHolder(lockData); + return getLockData(node, SEARCH_EXACMATCH) !=3D null; } = /** @@ -219,6 +208,19 @@ } = /** + * Checks if current session has a token (access) for this node. + * = + * @param node + * @return + * @throws RepositoryException + */ + public boolean isLockHolder(NodeData node) throws RepositoryException + { + LockData lockData =3D getLockData(node, SEARCH_EXACMATCH | SEARCH_PA= RENT); + return lockData !=3D null && isLockHolder(lockData); + } + + /** * Actually locks the node, adding jcr:lockOwner and jcr:lockIsDeep pro= perties to node and adds lock token * to current session. = * = @@ -264,13 +266,71 @@ new TransientValueData(isDeep)); changesLog.add(ItemState.createAddedState(propData)); = - LockImpl newLock =3D new LockImpl(sessionDataManager, lockData, toke= n, sessionID); + LockImpl newLock =3D new LockImpl(this, sessionDataManager, lockData= , sessionID); = sessionDataManager.getTransactManager().save(changesLog); return newLock; } = /** + * @see org.exoplatform.services.jcr.core.SessionLifecycleListener#onCl= oseSession(org.exoplatform.services.jcr.core.ExtendedSession) + */ + public void onCloseSession(ExtendedSession session) + { + // the logic as it was before, if session holds token for lock, and = lock is open scoped - remove it. = + List lockDatas; + try + { + lockDatas =3D sessionDataManager.getLocksData(); + } + catch (RepositoryException e) + { + // exception getting list of locks, return. + log.error(e.getMessage(), e); + return; + } + // list acquired, traversing to cleanup locks; + if (lockDatas !=3D null) + { + for (LockData lockData : lockDatas) + { + if (lockData.isSessionScoped() && isLockHolder(lockData)) + { + NodeData node; + // if can't unlock this, still try to unlock the next one + try + { + node =3D (NodeData)sessionDataManager.getItemData(lockDa= ta.getNodeIdentifier()); + if (node !=3D null) + { + unlock(node); + } + else + { + log.error("Node with uuid=3D" + lockData.getNodeIdent= ifier() + " is null!"); + } + } + catch (RepositoryException e) + { + log.error("Can't unlock node on session logout, id:" + l= ockData.getNodeIdentifier(), e); + } + } + } + } + } + + /** + * Removes token from current session + * @param token + */ + public void removeLockToken(String token) + { + String hash =3D getHash(token); + tokens.remove(token); + tokenHash.remove(hash); + } + + /** * Actually unlock the node also removing jcr:lockOwner and jcr:lockIsD= eep properties * = * @param node @@ -389,44 +449,4 @@ return (SystemIdentity.SYSTEM.equals(sessionID) || tokenHash.get(loc= kData.getTokenHash()) !=3D null); } = - /** - * @see org.exoplatform.services.jcr.core.SessionLifecycleListener#onCl= oseSession(org.exoplatform.services.jcr.core.ExtendedSession) - */ - public void onCloseSession(ExtendedSession session) - { - // the logic as it was before, if session holds token for lock, and = lock is open scoped - remove it. = - List lockDatas; - try - { - lockDatas =3D sessionDataManager.getLocksData(); - } - catch (RepositoryException e) - { - // exception getting list of locks, return. - log.error(e.getMessage(), e); - return; - } - // list acquired, traversing to cleanup locks; - if (lockDatas !=3D null) - { - for (LockData lockData : lockDatas) - { - if (lockData.isSessionScoped() && isLockHolder(lockData)) - { - NodeData node; - // if can't unlock this, still try to unlock the next one - try - { - node =3D (NodeData)sessionDataManager.getItemData(lockDa= ta.getNodeIdentifier()); - unlock(node); - } - catch (RepositoryException e) - { - log.error("Can't unlock node on session logout, id:" + l= ockData.getNodeIdentifier(), e); - } - } - } - } - } - } --===============1218156896246833012==-- From do-not-reply at jboss.org Fri Nov 20 07:27:00 2009 Content-Type: multipart/mixed; boundary="===============8177783581340425220==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r788 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Fri, 20 Nov 2009 07:27:00 -0500 Message-ID: <200911201227.nAKCR0NU017404@svn01.web.mwc.hst.phx2.redhat.com> --===============8177783581340425220== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-20 07:27:00 -0500 (Fri, 20 Nov 2009) New Revision: 788 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-246: reference delete property fixed Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 11:36:15 UTC (rev 787) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 12:27:00 UTC (rev 788) @@ -18,14 +18,12 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = -import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; -import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.ValueDataConvertor; @@ -197,7 +195,7 @@ = if (data.getType() =3D=3D PropertyType.REFERENCE) { - Fqn propUUID =3D makeNodeFqn(data.getIdentifier()); + Fqn propIdentifier =3D Fqn.fromElements(data.getIdentifier()); = for (ValueData value : data.getValues()) { @@ -227,7 +225,7 @@ refParent =3D refsRoot.addChild(refNode); } = - refParent.addChild(propUUID); + refParent.addChild(propIdentifier); } = } @@ -256,22 +254,25 @@ { startBatch(); = - for (InternalQName mixin : data.getMixinTypeNames()) - { - if (mixin.equals(Constants.MIX_REFERENCEABLE)) - { - // check and release references - Node node =3D refsRoot.addChild(Fqn.from= Elements(data.getIdentifier())); - if (node !=3D null) - { - if (node.getChildrenNames().size() !=3D 0) - { - throw new RepositoryException("Referenceable node remove= d but still have live references."); - } - } - break; - } - } + // TODO remove this check + // for (InternalQName mixin : data.getMixinTypeNames()) + // { + // + // + // if (mixin.equals(Constants.MIX_REFERENCEABLE)) + // { + // // check and release references + // Node node =3D refsRoot.addChild(= Fqn.fromElements(data.getIdentifier())); + // if (node !=3D null) + // { + // if (node.getChildrenNames().size() !=3D 0) + // { + // throw new RepositoryException("Referenceable nod= e removed but still have live references."); + // } + // } + // break; + // } + // } = if (data.getParentIdentifier() !=3D null) { @@ -312,11 +313,20 @@ = if (data.getType() =3D=3D PropertyType.REFERENCE) { + // get values from cahce + Fqn propUUID =3D makeNodeFqn(data.getIdentifier()); = - for (ValueData value : data.getValues()) + Node prop =3D propsRoot.getChild(propUUID); + PropertyData oldData =3D (PropertyData)prop.get(ITEM_DATA); + if (oldData =3D=3D null) { + throw new RepositoryException("FATAL PropertyData already empt= y " + data.getQPath().getAsString()); + } = + for (ValueData value : oldData.getValues()) + { + String refNodeUUID; try { --===============8177783581340425220==-- From do-not-reply at jboss.org Fri Nov 20 08:04:44 2009 Content-Type: multipart/mixed; boundary="===============1542434551274476265==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r789 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing. Date: Fri, 20 Nov 2009 08:04:43 -0500 Message-ID: <200911201304.nAKD4hR2026116@svn01.web.mwc.hst.phx2.redhat.com> --===============1542434551274476265== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-20 08:04:43 -0500 (Fri, 20 Nov 2009) New Revision: 789 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/writing/TestSetProperty.java Log: EXOJCR-203 : The test TestSetProperty was fixed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/writing/TestSetProperty.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSetProperty.java 2009-11-20 12:27:00 UTC (rev 78= 8) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSetProperty.java 2009-11-20 13:04:43 UTC (rev 78= 9) @@ -18,16 +18,6 @@ */ package org.exoplatform.services.jcr.api.writing; = -import org.exoplatform.services.jcr.JcrAPIBaseTest; -import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; -import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; -import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; -import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; -import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.core.value.NameValue; -import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; - import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; @@ -43,6 +33,16 @@ import javax.jcr.ValueFormatException; import javax.jcr.version.OnParentVersionAction; = +import org.exoplatform.services.jcr.JcrAPIBaseTest; +import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; +import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; +import org.exoplatform.services.jcr.impl.core.SessionImpl; +import org.exoplatform.services.jcr.impl.core.value.NameValue; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; + /** * Created by The eXo Platform SAS. * = @@ -63,8 +63,8 @@ super.setUp(); = WorkspaceContainerFacade wsc =3D repository.getWorkspaceContainer(se= ssion.getWorkspace().getName()); - CacheableWorkspaceDataManager dm =3D - (CacheableWorkspaceDataManager)wsc.getComponent(CacheableWorkspac= eDataManager.class); + WorkspacePersistentDataManager dm =3D + (WorkspacePersistentDataManager)wsc.getComponent(WorkspacePersist= entDataManager.class); dm.addItemPersistenceListener(this); } = --===============1542434551274476265==-- From do-not-reply at jboss.org Fri Nov 20 08:45:41 2009 Content-Type: multipart/mixed; boundary="===============6868851427822783945==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r790 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query and 3 other directories. Date: Fri, 20 Nov 2009 08:45:40 -0500 Message-ID: <200911201345.nAKDjeSj002424@svn01.web.mwc.hst.phx2.redhat.com> --===============6868851427822783945== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-20 08:45:40 -0500 (Fri, 20 Nov 2009) New Revision: 790 Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/jbosscache/ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/jbosscache/IndexerInterceptor.java Removed: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/cacheloader/ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/jbosscache/IndexInterceptor.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/RepositoryContainer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/IndexingTree.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SystemSearchManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java Log: EXOJCR-241 : IndexInterceptor update. Fixed duplication on delete. Code reo= rganize Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/RepositoryContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-20 13:04:43 UTC (rev 789) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryContainer.java 2009-11-20 13:45:40 UTC (rev 790) @@ -50,7 +50,7 @@ import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManager; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHol= der; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; +import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInte= rceptor; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.dataflow.persistent.JBossCacheWor= kspaceDataManager; import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; @@ -221,7 +221,7 @@ //so IndexerCacheLoader will use it. //registerComponentInstance(new SearchManagerHolder()); // workspaceContainer.registerComponentImplementation(SearchMa= nagerHolder.class); - workspaceContainer.registerComponentImplementation(IndexInterc= eptor.class); + workspaceContainer.registerComponentImplementation(IndexerInte= rceptor.class); = if (isSystem) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/IndexingTree.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/IndexingTree.java 2009-11-20 13:04:43 UTC (rev 7= 89) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/IndexingTree.java 2009-11-20 13:45:40 UTC (rev 7= 90) @@ -32,87 +32,94 @@ * @version $Id$ * = */ -public class IndexingTree { - private final QPath indexingRootQpath; - private final NodeData indexingRoot; +public class IndexingTree +{ + private final QPath indexingRootQpath; = - private final List excludedPaths; + private final NodeData indexingRoot; = - /** - * @param indexingRoot - * @param excludedPaths - */ - public IndexingTree(NodeData indexingRoot, List excludedPaths) { - super(); - this.indexingRoot =3D indexingRoot; - this.indexingRootQpath =3D indexingRoot.getQPath(); - this.excludedPaths =3D excludedPaths; - } + private final List excludedPaths; = - /** - * @param indexingRoot - * @param excludedPaths - */ - public IndexingTree(NodeData indexingRoot) { - super(); - this.indexingRoot =3D indexingRoot; - this.indexingRootQpath =3D indexingRoot.getQPath(); - this.excludedPaths =3D new ArrayList(); - } + /** + * @param indexingRoot + * @param excludedPaths + */ + public IndexingTree(NodeData indexingRoot, List excludedPaths) + { + super(); + this.indexingRoot =3D indexingRoot; + this.indexingRootQpath =3D indexingRoot.getQPath(); + this.excludedPaths =3D excludedPaths; + } = - /** - * @return the excludedPaths - */ - public List getExcludedPaths() { - return excludedPaths; - } + /** + * @param indexingRoot + * @param excludedPaths + */ + public IndexingTree(NodeData indexingRoot) + { + super(); + this.indexingRoot =3D indexingRoot; + this.indexingRootQpath =3D indexingRoot.getQPath(); + this.excludedPaths =3D new ArrayList(); + } = - /** - * @return the indexingRoot - */ - public NodeData getIndexingRoot() { - return indexingRoot; - } + /** + * @return the excludedPaths + */ + public List getExcludedPaths() + { + return excludedPaths; + } = - /** - * Checks if the given event should be excluded based on the - * {@link #excludePath} setting. - * = - * @param event - * observation event - * @return true if the event should be excluded, - * false otherwise - */ - public boolean isExcluded(ItemState event) { + /** + * @return the indexingRoot + */ + public NodeData getIndexingRoot() + { + return indexingRoot; + } = - for (QPath excludedPath : excludedPaths) { - if (event.getData().getQPath().isDescendantOf(excludedPath) - || event.getData().getQPath().equals(excludedPath)) - return true; - } + /** + * Checks if the given event should be excluded based on the + * {@link #excludePath} setting. + * = + * @param event + * observation event + * @return true if the event should be excluded, + * false otherwise + */ + public boolean isExcluded(ItemState event) + { = - return !event.getData().getQPath().isDescendantOf(indexingRootQpath) - && !event.getData().getQPath().equals(indexingRootQpath); - } + for (QPath excludedPath : excludedPaths) + { + if (event.getData().getQPath().isDescendantOf(excludedPath) || ev= ent.getData().getQPath().equals(excludedPath)) + return true; + } = - /** - * Checks if the given event should be excluded based on the - * {@link #excludePath} setting. - * = - * @param event - * observation event - * @return true if the event should be excluded, - * false otherwise - */ - public boolean isExcluded(ItemData eventData) { + return !event.getData().getQPath().isDescendantOf(indexingRootQpath) + && !event.getData().getQPath().equals(indexingRootQpath); + } = - for (QPath excludedPath : excludedPaths) { - if (eventData.getQPath().isDescendantOf(excludedPath) - || eventData.getQPath().equals(excludedPath)) - return true; - } + /** + * Checks if the given event should be excluded based on the + * {@link #excludePath} setting. + * = + * @param event + * observation event + * @return true if the event should be excluded, + * false otherwise + */ + public boolean isExcluded(ItemData eventData) + { = - return !eventData.getQPath().isDescendantOf(indexingRootQpath) - && !eventData.getQPath().equals(indexingRootQpath); - } + for (QPath excludedPath : excludedPaths) + { + if (eventData.getQPath().isDescendantOf(excludedPath) || eventDat= a.getQPath().equals(excludedPath)) + return true; + } + + return !eventData.getQPath().isDescendantOf(indexingRootQpath) && !e= ventData.getQPath().equals(indexingRootQpath); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-20 13:04:43 UTC (rev = 789) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java 2009-11-20 13:45:40 UTC (rev = 790) @@ -42,8 +42,8 @@ import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexModif= icationsBuilder; +import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexModifi= cationsBuilder; +import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInte= rceptor; import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTa= bleResolver; import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; @@ -168,7 +168,7 @@ public SearchManager(QueryHandlerEntry config, NamespaceRegistryImpl ns= Reg, NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder pa= rentSearchManager, DocumentReaderService extractor, ConfigurationManager cfm, - final RepositoryIndexSearcherHolder indexSearcherHolder, IndexInterc= eptor indexInterceptor) + final RepositoryIndexSearcherHolder indexSearcherHolder, IndexerInte= rceptor indexInterceptor) throws RepositoryException, RepositoryConfigurationException { = @@ -181,8 +181,6 @@ this.cfm =3D cfm; this.virtualTableResolver =3D new LuceneVirtualTableResolver(nodeTyp= eDataManager, nsReg); this.parentSearchManager =3D parentSearchManager !=3D null ? parentS= earchManager.get() : null; - //itemMgr.addItemPersistenceListener(this); - //searchManagerHolder.put(this); indexInterceptor.addIndexInterceptorListener(this); } = @@ -432,7 +430,10 @@ if (item !=3D null) { if (item.isNode()) - return (NodeData)item; // return node + { + if (!indexingTree.isExcluded(item)) + return (NodeData)item; + } else log.warn("Node not found, but property " + id += ", " + item.getQPath().getAsString() + " found. "); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SystemSearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-20 13:04:43 UTC= (rev 789) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-20 13:45:40 UTC= (rev 790) @@ -26,7 +26,7 @@ import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; +import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInte= rceptor; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -65,7 +65,7 @@ = public SystemSearchManager(QueryHandlerEntry config, NamespaceRegistryI= mpl nsReg, NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, DocumentReaderService servic= e, ConfigurationManager cfm, - RepositoryIndexSearcherHolder indexSearcherHolder, IndexInterceptor = indexInterceptor) throws RepositoryException, + RepositoryIndexSearcherHolder indexSearcherHolder, IndexerIntercepto= r indexInterceptor) throws RepositoryException, RepositoryConfigurationException { super(config, nsReg, ntReg, itemMgr, null, service, cfm, indexSearch= erHolder, indexInterceptor); Copied: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/query/jbosscache (from rev 782, jcr/branches/1.12.= 0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/q= uery/cacheloader) Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/jbosscache/IndexInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexInterceptor.java 2009-11-19 16:= 19:28 UTC (rev 782) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/IndexInterceptor.java 2009-11-20 13:4= 5:40 UTC (rev 790) @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.core.query.cacheloader; - -import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.cache.InvocationContext; -import org.jboss.cache.commands.tx.PrepareCommand; -import org.jboss.cache.interceptors.base.CommandInterceptor; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Sergey K= abashnyuk - * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ - * - */ -public class IndexInterceptor extends CommandInterceptor -{ - private final Log log =3D ExoLogger.getLogger(IndexInterceptor.class); - - /** - * List of index interceptor listeners. - */ - private final List indexInterceptorListners; - - /** - * Default constructor. - */ - public IndexInterceptor() - { - super(); - this.indexInterceptorListners =3D new ArrayList(); - } - - /** - * @see org.jboss.cache.commands.AbstractVisitor#visitPrepareCommand(or= g.jboss.cache.InvocationContext, org.jboss.cache.commands.tx.PrepareCommand) - */ - @Override - public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand= command) throws Throwable - { - // try - // { - // if (ctx.getTransactionContext().getModifications().size()= > 0) - // { - // for (SearchManager searchManager : indexInterceptorLis= tners) - // { - // searchManager.onSaveItems(ctx.getTransactionContext= ().getModifications()); - // } - // } - // } - // catch (RepositoryException e) - // { - // //TODO handle rollback - // log.error(e.getLocalizedMessage()); - // } - - return invokeNextInterceptor(ctx, command); - } - - /** - * Add new SearchManager to the indexInterceptorListners list. - * @param searchManager - search manager. - */ - public void addIndexInterceptorListener(SearchManager searchManager) - { - indexInterceptorListners.add(searchManager); - } - - /** - * Add new SearchManager to the indexInterceptorListners list. - * @param searchManager - search manager. - */ - public boolean removeIndexInterceptorListener(SearchManager searchManag= er) - { - return indexInterceptorListners.remove(searchManager); - } -} Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexModificationsBuilder.java 2009-= 11-19 16:19:28 UTC (rev 782) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java 2009-1= 1-20 13:45:40 UTC (rev 790) @@ -16,7 +16,7 @@ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ -package org.exoplatform.services.jcr.impl.core.query.cacheloader; +package org.exoplatform.services.jcr.impl.core.query.jbosscache; = import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= age; @@ -53,13 +53,8 @@ public IndexModificationsBuilder(HashSet addedNodes, HashSet removedNodes, HashSet updateNodes) { - // nodes that need to be removed from the index. this.removedNodes =3D removedNodes; - - // nodes that need to be added to the index. this.addedNodes =3D addedNodes; - - // node thst must be updated this.updateNodes =3D updateNodes; = } @@ -95,10 +90,6 @@ //add second addedNodes.add(parseUUID(command.getTo())); } - else - { - // this is property - do nothing - } } return null; } @@ -117,10 +108,6 @@ String uuid =3D parseUUID(fqn); addedNodes.add(uuid); } - else - { - // this is property - do nothing - } } return null; } @@ -179,16 +166,19 @@ { // add node String uuid =3D parseUUID(fqn); + updateNodes.remove(uuid); + addedNodes.remove(uuid); removedNodes.add(uuid); } - else - { - // this is property - do nothing - } } return null; } = + /** + * = + * @param fqn + * @return true if fqn is the path to the node, false if fqn is the pat= h to the property. + */ private boolean isNode(Fqn fqn) { String items =3D (String)fqn.get(0); @@ -196,6 +186,11 @@ return s.equals(JBossCacheStorage.NODES); } = + /** + * = + * @param fqn + * @return Return uuid of item from fqn + */ private String parseUUID(Fqn fqn) { if (fqn.size() > 1) @@ -206,10 +201,9 @@ //remove slash return uuid; } - else - { - return null; - } + + return null; + } = } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-19 1= 6:19:28 UTC (rev 782) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java 2009-11-20 13= :45:40 UTC (rev 790) @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see. */ -package org.exoplatform.services.jcr.impl.core.query.cacheloader; +package org.exoplatform.services.jcr.impl.core.query.jbosscache; = import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteO= nlyCacheLoader; Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform= /services/jcr/impl/core/query/jbosscache/IndexerInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/IndexerInterceptor.java = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/IndexerInterceptor.java 2009-11-20 13= :45:40 UTC (rev 790) @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core.query.jbosscache; + +import org.exoplatform.services.jcr.impl.core.query.SearchManager; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.cache.InvocationContext; +import org.jboss.cache.commands.tx.PrepareCommand; +import org.jboss.cache.commands.tx.RollbackCommand; +import org.jboss.cache.interceptors.base.CommandInterceptor; + +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.RepositoryException; + +/** + * @author Sergey K= abashnyuk + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ks= m $ + * + */ +public class IndexerInterceptor extends CommandInterceptor +{ + private final Log log =3D ExoLogger.getLogger(IndexerInterceptor.class); + + /** + * List of index interceptor listeners. + */ + private final List indexInterceptorListners; + + /** + * Default constructor. + */ + public IndexerInterceptor() + { + super(); + this.indexInterceptorListners =3D new ArrayList(); + } + + /** + * Add new SearchManager to the indexInterceptorListners list. + * @param searchManager - search manager. + */ + public void addIndexInterceptorListener(SearchManager searchManager) + { + indexInterceptorListners.add(searchManager); + } + + /** + * Add new SearchManager to the indexInterceptorListners list. + * @param searchManager - search manager. + */ + public boolean removeIndexInterceptorListener(SearchManager searchManag= er) + { + return indexInterceptorListners.remove(searchManager); + } + + /** + * @see org.jboss.cache.commands.AbstractVisitor#visitPrepareCommand(or= g.jboss.cache.InvocationContext, org.jboss.cache.commands.tx.PrepareCommand) + */ + @Override + public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand= command) throws Throwable + { + try + { + if (ctx.getTransactionContext().getModifications().size() > 0) + { + for (SearchManager searchManager : indexInterceptorListners) + { + searchManager.onSaveItems(ctx.getTransactionContext().getMo= difications()); + } + } + } + catch (RepositoryException e) + { + //TODO handle rollback + log.error(e.getLocalizedMessage()); + } + + return invokeNextInterceptor(ctx, command); + } + + /** + * @see org.jboss.cache.commands.AbstractVisitor#visitRollbackCommand(o= rg.jboss.cache.InvocationContext, org.jboss.cache.commands.tx.RollbackComma= nd) + */ + @Override + public Object visitRollbackCommand(InvocationContext ctx, RollbackComma= nd command) throws Throwable + { + //TODO new feature rollBack + return super.visitRollbackCommand(ctx, command); + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/o= rg/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerInterceptor.j= ava ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-20 13:04:43 UTC (rev 789) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 20= 09-11-20 13:45:40 UTC (rev 790) @@ -21,7 +21,7 @@ import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInter= ceptor; +import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInte= rceptor; import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBas= e; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; @@ -82,7 +82,7 @@ */ public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, Reposi= toryEntry repConfig, InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider, - IndexInterceptor indexInterceptor) throws RepositoryConfigurationExc= eption, NamingException, RepositoryException, + IndexerInterceptor indexInterceptor) throws RepositoryConfigurationE= xception, NamingException, RepositoryException, IOException { this.repositoryName =3D repConfig.getName(); Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-20 1= 3:04:43 UTC (rev 789) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-20 1= 3:45:40 UTC (rev 790) @@ -31,7 +31,7 @@ import org.exoplatform.services.jcr.impl.core.query.QueryHandler; import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearche= rHolder; import org.exoplatform.services.jcr.impl.core.query.SearchManager; -import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCac= heLoader; +import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerCach= eLoader; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.jboss.cache.Modification; --===============6868851427822783945==-- From do-not-reply at jboss.org Fri Nov 20 08:53:19 2009 Content-Type: multipart/mixed; boundary="===============8470440978735802295==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r791 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing. Date: Fri, 20 Nov 2009 08:53:19 -0500 Message-ID: <200911201353.nAKDrJSa003527@svn01.web.mwc.hst.phx2.redhat.com> --===============8470440978735802295== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-20 08:53:18 -0500 (Fri, 20 Nov 2009) New Revision: 791 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/writing/TestSetProperty.java Log: EXOJCR-203 : The test TestSetProperty was fixed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/writing/TestSetProperty.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSetProperty.java 2009-11-20 13:45:40 UTC (rev 79= 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSetProperty.java 2009-11-20 13:53:18 UTC (rev 79= 1) @@ -382,13 +382,13 @@ tempFiles[1] =3D tmpFile2; tempFiles[2] =3D tmpFile3; = - for (int i =3D 2; i < cLog.getAllStates().size(); i++) - { - ItemState item =3D cLog.getAllStates().get(i); +// for (int i =3D 2; i < cLog.getAllStates().size(); i++) +// { +// ItemState item =3D cLog.getAllStates().get(i); // TODO doesn't pass with FileTree VS, ok with CAS if contents di= fferent //compareStream(((PropertyData) item.getData()).getValues().get(0= ).getAsStream(), // new FileInputStream(tempFiles[i - 2])); - } +// } } = public void onSaveItems(ItemStateChangesLog itemStates) --===============8470440978735802295==-- From do-not-reply at jboss.org Fri Nov 20 09:08:02 2009 Content-Type: multipart/mixed; boundary="===============3847711036037233494==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r792 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing. Date: Fri, 20 Nov 2009 09:08:01 -0500 Message-ID: <200911201408.nAKE81YU006697@svn01.web.mwc.hst.phx2.redhat.com> --===============3847711036037233494== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-20 09:08:01 -0500 (Fri, 20 Nov 2009) New Revision: 792 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/writing/TestSetProperty.java Log: EXOJCR-203 : The test TestSetProperty was fixed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/writing/TestSetProperty.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSetProperty.java 2009-11-20 13:53:18 UTC (rev 79= 1) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSetProperty.java 2009-11-20 14:08:01 UTC (rev 79= 2) @@ -382,13 +382,13 @@ tempFiles[1] =3D tmpFile2; tempFiles[2] =3D tmpFile3; = -// for (int i =3D 2; i < cLog.getAllStates().size(); i++) -// { -// ItemState item =3D cLog.getAllStates().get(i); + for (int i =3D 2; i < cLog.getAllStates().size(); i++) + { + ItemState item =3D cLog.getAllStates().get(i); // TODO doesn't pass with FileTree VS, ok with CAS if contents di= fferent //compareStream(((PropertyData) item.getData()).getValues().get(0= ).getAsStream(), // new FileInputStream(tempFiles[i - 2])); -// } + } } = public void onSaveItems(ItemStateChangesLog itemStates) --===============3847711036037233494==-- From do-not-reply at jboss.org Fri Nov 20 09:09:54 2009 Content-Type: multipart/mixed; boundary="===============8306591738276148427==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r793 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Fri, 20 Nov 2009 09:09:54 -0500 Message-ID: <200911201409.nAKE9srJ007345@svn01.web.mwc.hst.phx2.redhat.com> --===============8306591738276148427== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-20 09:09:54 -0500 (Fri, 20 Nov 2009) New Revision: 793 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-203 : The notifySaveItems was added in JBossCacheWorkspaceDataManage= r.save. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-20 14:08:01 UTC (rev 792) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-20 14:09:54 UTC (rev 793) @@ -226,6 +226,8 @@ // help to GC addedNodes.clear(); } + = + notifySaveItems(changesLog); } = /** --===============8306591738276148427==-- From do-not-reply at jboss.org Fri Nov 20 09:15:29 2009 Content-Type: multipart/mixed; boundary="===============5526237049780256073==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r794 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Fri, 20 Nov 2009 09:15:29 -0500 Message-ID: <200911201415.nAKEFTex009277@svn01.web.mwc.hst.phx2.redhat.com> --===============5526237049780256073== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-20 09:15:28 -0500 (Fri, 20 Nov 2009) New Revision: 794 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java Log: EXOJCR-203 : Add printing to log the added listentrs in WorkspacePersistent= DataManager. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-20 14:09:54 UTC (rev 793) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-20 14:15:28 UTC (rev 794) @@ -522,8 +522,8 @@ mandatoryListeners.add((MandatoryItemsPersistenceListener)listene= r); else listeners.add(listener); - if (LOG.isDebugEnabled()) - LOG.debug("Workspace '" + this.dataContainer.getName() + "' liste= ner registered: " + listener); +// if (LOG.isDebugEnabled()) + LOG.info("Workspace '" + this.dataContainer.getName() + "' listen= er registered: " + listener); } = public void removeItemPersistenceListener(ItemsPersistenceListener list= ener) --===============5526237049780256073==-- From do-not-reply at jboss.org Fri Nov 20 09:25:21 2009 Content-Type: multipart/mixed; boundary="===============4019377435165324580==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r795 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache. Date: Fri, 20 Nov 2009 09:25:20 -0500 Message-ID: <200911201425.nAKEPKQW011730@svn01.web.mwc.hst.phx2.redhat.com> --===============4019377435165324580== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-20 09:25:20 -0500 (Fri, 20 Nov 2009) New Revision: 795 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java Log: EXOJCR-241 : Lock's handling Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java 2009-1= 1-20 14:15:28 UTC (rev 794) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java 2009-1= 1-20 14:25:20 UTC (rev 795) @@ -119,15 +119,16 @@ if (fqn.size() =3D=3D 2) { String uuid =3D parseUUID(fqn); - if (!isNode(fqn)) + if (isProperty(fqn)) { PropertyData property =3D (PropertyData)command.getValue(); uuid =3D property.getParentIdentifier(); + + if (!addedNodes.contains(uuid)) + { + updateNodes.add(uuid); + } } - if (!addedNodes.contains(uuid)) - { - updateNodes.add(uuid); - } = } return null; @@ -189,6 +190,18 @@ /** * = * @param fqn + * @return true if fqn is the path to the node, false if fqn is the pat= h to the property. + */ + private boolean isProperty(Fqn fqn) + { + String items =3D (String)fqn.get(0); + String s =3D items.toString(); + return s.equals(JBossCacheStorage.PROPS); + } + + /** + * = + * @param fqn * @return Return uuid of item from fqn */ private String parseUUID(Fqn fqn) --===============4019377435165324580==-- From do-not-reply at jboss.org Fri Nov 20 11:15:38 2009 Content-Type: multipart/mixed; boundary="===============6414836353560635751==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r796 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc and 1 other directories. Date: Fri, 20 Nov 2009 11:15:38 -0500 Message-ID: <200911201615.nAKGFcKa032662@svn01.web.mwc.hst.phx2.redhat.com> --===============6414836353560635751== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-20 11:15:37 -0500 (Fri, 20 Nov 2009) New Revision: 796 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-246: JDBCCacheLoader reference support added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 14:25:20 UTC (rev 795) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 16:15:37 UTC (rev 796) @@ -21,11 +21,9 @@ import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.core.lock.LockData; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.ValueDataConvertor; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -349,13 +347,13 @@ if (refParent !=3D null) { refParent.removeChild(propUUID); + // check is there is no more references + if (refParent.getChildrenNames().size() =3D=3D 0) + { + //TODO remove children + refsRoot.removeChild(makeNodeFqn(refNodeUUID)); + } } - // check is there is no more references - if (refParent.getChildrenNames().size() =3D=3D 0) - { - //TODO remove children - refsRoot.removeChild(makeNodeFqn(refNodeUUID)); - } } = } @@ -673,88 +671,88 @@ { //TODO we expecting that on session.move() there will be only one re= name() method call = -// startBatch(); -// -// String nodeId =3D data.getIdentifier(); -// -// //1. Update renamed node and also get old nodeData -// Node node =3D nodesRoot.getChild(makeNodeFqn= (nodeId)); -// if (node =3D=3D null) -// { -// throw new InvalidItemStateException("Renamed node is not exist"= + data.getQPath().getAsString()); -// } -// -// NodeData prevData =3D (NodeData)node.put(ITEM_DATA, data); -// if (prevData =3D=3D null) -// { -// throw new RepositoryException("FATAL NodeData is empty " + data= .getQPath().getAsString()); -// } -// -// // 2. remove renamed node from child list of previous parent node -// // check if parent is cached -// Node prevParent =3D nodesRoot.getChild(makeN= odeFqn(prevData.getParentIdentifier())); -// if (prevParent =3D=3D null) -// { -// throw new InvalidItemStateException("Node's previous parent doe= sn't exist " -// + prevData.getQPath().getAsString() + ". Node " + data.getQP= ath().getAsString()); -// } -// -// // remove node form old parent child list -// if (!prevParent -// .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[= prevData.getQPath().getEntries().length - 1]))) -// { -// throw new RepositoryException("FATAL Node doesn't listed in chi= ldren nodes of previous parent " -// + prevData.getQPath().getAsString() + ". Node " + data.getQP= ath().getAsString()); -// } -// -// // 3. add node to child list of new parent node -// // check if parent is cached -// Node newParent =3D nodesRoot.getChild(makeNo= deFqn(data.getParentIdentifier())); -// if (newParent =3D=3D null) -// { -// throw new InvalidItemStateException("Node's new parent doesn't = exist " + data.getParentIdentifier() -// + ". Node " + data.getQPath().getAsString()); -// } -// -// // add child to Parent = -// Node childNode =3D -// newParent.addChild(makeChildNodeFqn(data.getQPath().getEntries(= )[data.getQPath().getEntries().length - 1])); -// -// // set child id attr = -// childNode.put(ITEM_ID, data.getIdentifier()); -// -// // 4. update all child nodes -// for (Node child : node.getChildren()) -// { -// String childNodeId =3D (String)child.get(ITEM_ID); -// if (childNodeId =3D=3D null) -// { -// throw new RepositoryException("FATAL Child Node Id key is nu= ll. Parent " + data.getQPath().getAsString()); -// } -// -// // TODO NodeData or PropertyData? As ItemData check then and ca= st. -// Node childnode =3D nodesRoot.getChild(mak= eNodeFqn(childNodeId)); //cache.evict(fqn) -// if (childnode =3D=3D null) -// { -// throw new RepositoryException("FATAL Node record not found("= + childNodeId + "), but listed in childs of " -// + data.getQPath().getAsString()); -// } -// NodeData nodeData =3D (NodeData)childnode.get(ITEM_DATA); -// if (nodeData =3D=3D null) -// { -// // TODO should not occurs by contract -// throw new RepositoryException("Child node data is null. Pare= nt " + data.getQPath().getAsString()); -// } -// -// //repack child NodeData with new QPath -// //TODO check it -// QPath newPath =3D QPath.makeChildPath(data.getQPath(), nodeData= .getQPath().getName()); -// TransientNodeData newNodeData =3D -// new TransientNodeData(newPath, nodeData.getIdentifier(), nod= eData.getPersistedVersion(), nodeData -// .getPrimaryTypeName(), nodeData.getMixinTypeNames(), node= Data.getOrderNumber(), nodeData -// .getParentIdentifier(), nodeData.getACL()); -// childnode.put(ITEM_DATA, newNodeData); -// } + // startBatch(); + // + // String nodeId =3D data.getIdentifier(); + // + // //1. Update renamed node and also get old nodeData + // Node node =3D nodesRoot.getChild(makeN= odeFqn(nodeId)); + // if (node =3D=3D null) + // { + // throw new InvalidItemStateException("Renamed node is not = exist" + data.getQPath().getAsString()); + // } + // + // NodeData prevData =3D (NodeData)node.put(ITEM_DATA, data); + // if (prevData =3D=3D null) + // { + // throw new RepositoryException("FATAL NodeData is empty " = + data.getQPath().getAsString()); + // } + // + // // 2. remove renamed node from child list of previous parent= node + // // check if parent is cached + // Node prevParent =3D nodesRoot.getChild= (makeNodeFqn(prevData.getParentIdentifier())); + // if (prevParent =3D=3D null) + // { + // throw new InvalidItemStateException("Node's previous pare= nt doesn't exist " + // + prevData.getQPath().getAsString() + ". Node " + data= .getQPath().getAsString()); + // } + // + // // remove node form old parent child list + // if (!prevParent + // .removeChild(makeChildNodeFqn(prevData.getQPath().getEntr= ies()[prevData.getQPath().getEntries().length - 1]))) + // { + // throw new RepositoryException("FATAL Node doesn't listed = in children nodes of previous parent " + // + prevData.getQPath().getAsString() + ". Node " + data= .getQPath().getAsString()); + // } + // + // // 3. add node to child list of new parent node + // // check if parent is cached + // Node newParent =3D nodesRoot.getChild(= makeNodeFqn(data.getParentIdentifier())); + // if (newParent =3D=3D null) + // { + // throw new InvalidItemStateException("Node's new parent do= esn't exist " + data.getParentIdentifier() + // + ". Node " + data.getQPath().getAsString()); + // } + // + // // add child to Parent = + // Node childNode =3D + // newParent.addChild(makeChildNodeFqn(data.getQPath().getEn= tries()[data.getQPath().getEntries().length - 1])); + // + // // set child id attr = + // childNode.put(ITEM_ID, data.getIdentifier()); + // + // // 4. update all child nodes + // for (Node child : node.getChildren()) + // { + // String childNodeId =3D (String)child.get(ITEM_ID); + // if (childNodeId =3D=3D null) + // { + // throw new RepositoryException("FATAL Child Node Id key= is null. Parent " + data.getQPath().getAsString()); + // } + // + // // TODO NodeData or PropertyData? As ItemData check then = and cast. + // Node childnode =3D nodesRoot.getChi= ld(makeNodeFqn(childNodeId)); //cache.evict(fqn) + // if (childnode =3D=3D null) + // { + // throw new RepositoryException("FATAL Node record not f= ound(" + childNodeId + "), but listed in childs of " + // + data.getQPath().getAsString()); + // } + // NodeData nodeData =3D (NodeData)childnode.get(ITEM_DATA); + // if (nodeData =3D=3D null) + // { + // // TODO should not occurs by contract + // throw new RepositoryException("Child node data is null= . Parent " + data.getQPath().getAsString()); + // } + // + // //repack child NodeData with new QPath + // //TODO check it + // QPath newPath =3D QPath.makeChildPath(data.getQPath(), no= deData.getQPath().getName()); + // TransientNodeData newNodeData =3D + // new TransientNodeData(newPath, nodeData.getIdentifier(= ), nodeData.getPersistedVersion(), nodeData + // .getPrimaryTypeName(), nodeData.getMixinTypeNames()= , nodeData.getOrderNumber(), nodeData + // .getParentIdentifier(), nodeData.getACL()); + // childnode.put(ITEM_DATA, newNodeData); + // } } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 14:25:20= UTC (rev 795) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 16:15:37= UTC (rev 796) @@ -19,7 +19,6 @@ package org.exoplatform.services.jcr.impl.storage.jbosscache; = import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; @@ -108,6 +107,11 @@ { case PUT_DATA : //LOG.warn("PUT_DATA modification"); + // Process references + // if (m.getFqn().get(0).equals(JBossCacheSto= rage.REFS)) + // { + // addReferences((JDBCStorageConnection)co= nn, m); + // } break; case PUT_DATA_ERASE : LOG.warn("PUT_DATA_ERASE modification"); @@ -134,7 +138,14 @@ break; case REMOVE_NODE : = + // if (m.getFqn().get(0).equals(JBossCacheSto= rage.REFS)) + // { + // removeReference((JDBCStorageConnection)= conn, m); + // } + // else + // { doRemove(m, (JDBCStorageConnection)conn); + // } = break; case MOVE : @@ -362,14 +373,53 @@ LOG.warn("Unexpected Fqn asked " + name); } } + else if (name.get(0).equals(JBossCacheStorage.REFS)) + { + // get reference + if (name.size() =3D=3D 3) + { + + // do we have such property reference + String nodeID =3D String.valueOf(name.get(1)); + String propID =3D String.valueOf(name.get(2)); + + if (conn.hasReference(nodeID, propID)) + { + attrs =3D new LinkedHashMap(); + } + else + { + attrs =3D null; + } + } + else if (name.size() =3D=3D 2) + { + // do we have node with any reference + String nodeID =3D name.getLastElementAsString(); + if (conn.getReferenceIdentifiers(nodeID).size() > 0) + { + attrs =3D new LinkedHashMap(); + } + else + { + attrs =3D null; + } + } + else + { + attrs =3D null; + } + + } else { attrs =3D null; LOG.warn("Unexpected Fqn asked " + name); } } - else if (name.equals(Fqn.ROOT) || name.equals(JBossCacheStorage.P= ROPS) || name.equals(JBossCacheStorage.NODES) - || name.equals(JBossCacheStorage.LOCKS)) + else if (name.get(0).equals(Fqn.ROOT) || name.get(0).equals(JBoss= CacheStorage.PROPS) + || name.get(0).equals(JBossCacheStorage.NODES) || name.get(0).= equals(JBossCacheStorage.LOCKS) + || name.get(0).equals(JBossCacheStorage.REFS)) { // roots, like NODES, PROPS etc = attrs =3D new LinkedHashMap(); @@ -464,14 +514,37 @@ LOG.warn("Unexpected Fqn asked " + name); } } + else if (name.get(0).equals(JBossCacheStorage.REFS)) + { + // /$REFS/ + if (name.size() =3D=3D 2) + { + String nodeId =3D name.getLastElementAsString(); + exists =3D conn.getReferenceIdentifiers(nodeId).size() >= 0; + } + // /$REFS// + else if (name.size() =3D=3D 3) + { + String refPropertyId =3D name.getLastElementAsString(); + String nodeId =3D (String)name.get(1); + + exists =3D conn.hasReference(nodeId, refPropertyId); + } + else + { + exists =3D false; + LOG.warn("Unexpected Fqn asked " + name); + } + } else { exists =3D false; LOG.warn("Unexpected Fqn asked " + name); } } - else if (name.equals(Fqn.ROOT) || name.equals(JBossCacheStorage.P= ROPS) || name.equals(JBossCacheStorage.NODES) - || name.equals(JBossCacheStorage.LOCKS)) + else if (name.get(0).equals(Fqn.ROOT) || name.get(0).equals(JBoss= CacheStorage.PROPS) + || name.get(0).equals(JBossCacheStorage.NODES) || name.get(0).= equals(JBossCacheStorage.LOCKS) + || name.get(0).equals(JBossCacheStorage.REFS)) { // roots, like NODES, PROPS etc = exists =3D true; @@ -504,32 +577,53 @@ if (name.size() =3D=3D 2) { String nodeId =3D (String)name.get(1); - return conn.getChildNodeNames(nodeId); + if (name.get(0).equals(JBossCacheStorage.NODES)) + { + return conn.getChildNodeNames(nodeId); + } + else if (name.get(0).equals(JBossCacheStorage.REFS)) + { + List references =3D conn.getReferenceIdentifiers(no= deId); + Set result =3D new LinkedHashSet(); + result.addAll(references); + return result; + } + else + { + // TODO this a property on any unexpected part of cache thr= ow Exception + return null; + } } - else if (name.equals(JBossCacheStorage.NODES)) + else if (name.get(0).equals(JBossCacheStorage.NODES)) { // TODO should never be called LOG.warn("conn.getAllNodeIdentifiers()"); return conn.getAllNodeIdentifiers(); = } - else if (name.equals(JBossCacheStorage.PROPS)) + else if (name.get(0).equals(JBossCacheStorage.PROPS)) { // TODO should never be called LOG.warn("conn.getAllPropertyIdentifiers()"); return conn.getAllPropertyIdentifiers(); } - else if (name.equals(JBossCacheStorage.LOCKS)) + else if (name.get(0).equals(JBossCacheStorage.LOCKS)) { // TODO return all Locks in workspace return new LinkedHashSet(); } - else if (name.equals(Fqn.ROOT)) + else if (name.get(0).equals(JBossCacheStorage.REFS)) { + // TODO return all referenced nodes in workspace + return new LinkedHashSet(); + } + else if (name.get(0).equals(Fqn.ROOT)) + { Set childs =3D new LinkedHashSet(); childs.add(JBossCacheStorage.NODES); childs.add(JBossCacheStorage.PROPS); childs.add(JBossCacheStorage.LOCKS); + childs.add(JBossCacheStorage.REFS); return childs; } else @@ -541,6 +635,7 @@ { conn.close(); } + // return null; } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-20 14:25:20 UTC (rev = 795) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-20 16:15:37 UTC (rev = 796) @@ -126,7 +126,7 @@ * FIND_NODES_BY_PARENTID. */ protected String FIND_NODES_BY_PARENTID; - = + /** * FIND_NODES_NAME_BY_PARENTID. */ @@ -136,32 +136,32 @@ * FIND_PROPERTIES_BY_PARENTID. */ protected String FIND_PROPERTIES_BY_PARENTID; - = + /** * FIND_PROPERTIES_IDNAME_BY_PARENTID. */ protected String FIND_PROPERTIES_IDNAME_BY_PARENTID; - = + /** * FIND_ITEM_IDENTIFIER. */ protected String FIND_NODE_IDENTIFIER; - = + /** * FIND_PROPERTY_IDENTIFIER. */ protected String FIND_PROPERTY_IDENTIFIER; - = + /** * FIND_ITEM_NAME. */ protected String FIND_ITEM_NAME; - = + /** * FIND_ALL_NODES. */ protected String FIND_ALL_NODES; - = + /** * FIND_ALL_PROPERTIES. */ @@ -217,6 +217,11 @@ */ protected String DELETE_REF; = + /** + * FIND_REFERENCE + */ + protected String FIND_REFERENCE; + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D ITEMS table =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D = /** * COLUMN_ID. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-20 14:25:20= UTC (rev 795) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-20 16:15:37= UTC (rev 796) @@ -700,6 +700,39 @@ } } = + public List getReferenceIdentifiers(String nodeIdentifier) thro= ws RepositoryException, IllegalStateException + { + checkIfOpened(); + try + { + ResultSet refProps =3D findReferences(nodeIdentifier); + List references =3D new ArrayList(); + while (refProps.next()) + { + references.add(getIdentifier(refProps.getString(COLUMN_ID))); + } + return references; + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } + + public boolean hasReference(String nodeIdentifier, String refPropertyId= entifier) throws RepositoryException, + IllegalStateException + { + checkIfOpened(); + try + { + return hasReferenceRecord(nodeIdentifier, refPropertyIdentifier); + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } + /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) */ @@ -2317,6 +2350,9 @@ = protected abstract ResultSet findReferences(String nodeIdentifier) thro= ws SQLException; = + protected abstract boolean hasReferenceRecord(String nodeIdentifier, St= ring refPropertyIdentifier) + throws SQLException; + protected abstract int deleteItemByIdentifier(String identifier) throws= SQLException; = protected abstract int updateNodeByIdentifier(int version, int index, i= nt orderNumb, String identifier) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-20 14:25= :20 UTC (rev 795) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-20 16:15= :37 UTC (rev 796) @@ -85,13 +85,13 @@ protected PreparedStatement findPropertiesIdNameByParentId; = protected PreparedStatement findNodeIdentifier; - = + protected PreparedStatement findPropertyIdentifier; = protected PreparedStatement findItemName; - = + protected PreparedStatement findAllProperties; - = + protected PreparedStatement findAllNodes; = protected PreparedStatement insertNode; @@ -124,6 +124,8 @@ = protected PreparedStatement renameNode; = + protected PreparedStatement findReference; + /** * Multidatabase JDBC Connection constructor. * = @@ -191,6 +193,8 @@ "select P.ID, P.PARENT_ID, P.VERSION, P.P_TYPE, P.P_MULTIVALUED, = P.NAME" + " from JCR_MREF R, JCR_MITEM P" + " where R.NODE_ID=3D? and P.ID=3DR.PROPERTY_ID and P.I_CLASS= =3D2"; = + FIND_REFERENCE =3D "select P.ID from JCR_MREF R, JCR_MITEM P where R= .NODE_ID=3D? and R.PROPERTY_ID=3D?"; + FIND_VALUES_BY_PROPERTYID =3D "select PROPERTY_ID, ORDER_NUM, DATA, STORAGE_DESC from JCR_MVALU= E where PROPERTY_ID=3D? order by ORDER_NUM"; = @@ -201,20 +205,21 @@ FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where I_CLA= SS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_ALL_NODES =3D "select ID from JCR_MITEM where I_CLASS=3D1"; - = + FIND_NODES_NAME_BY_PARENTID =3D "select NAME, I_INDEX from JCR_MITEM" + " where I_CLASS=3D1 and P= ARENT_ID=3D?" + " order by N_ORDER_NUM"; = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; = FIND_PROPERTIES_IDNAME_BY_PARENTID =3D "select ID, NAME from JCR_MIT= EM" + " where I_CLASS=3D2 and PARENT_ID=3D?"; - = + FIND_ALL_PROPERTIES =3D "select ID from JCR_MITEM where I_CLASS=3D2"; = FIND_NODE_IDENTIFIER =3D "select ID from JCR_MITEM" + " where I_CLAS= S=3D1 and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D?"; - = - FIND_PROPERTY_IDENTIFIER =3D "select ID from JCR_MITEM" + " where I_= CLASS=3D2 and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D1"; = + FIND_PROPERTY_IDENTIFIER =3D + "select ID from JCR_MITEM" + " where I_CLASS=3D2 and PARENT_ID=3D= ? and NAME=3D? and I_INDEX=3D1"; + FIND_ITEM_NAME =3D "select NAME, I_CLASS from JCR_MITEM" + " where I= D=3D?"; = INSERT_NODE =3D @@ -616,7 +621,7 @@ findNodeIdentifier.setInt(3, index); return findNodeIdentifier.executeQuery(); } - = + /** * {@inheritDoc} */ @@ -705,4 +710,20 @@ } return findAllProperties.executeQuery(); } + + @Override + protected boolean hasReferenceRecord(String nodeIdentifier, String refP= ropertyIdentifier) throws SQLException + { + // TODO make query + if (findReference =3D=3D null) + findReference =3D dbConnection.prepareStatement(FIND_REFERENCE); + else + findReference.clearParameters(); + + findReference.setString(1, nodeIdentifier); + findReference.setString(1, refPropertyIdentifier); + ResultSet result =3D findReference.executeQuery(); + + return result.next(); + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-20 14:2= 5:20 UTC (rev 795) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-20 16:1= 5:37 UTC (rev 796) @@ -82,7 +82,7 @@ protected PreparedStatement findPropertiesIdNameByParentId; = protected PreparedStatement findNodeIdentifier; - = + protected PreparedStatement findPropertyIdentifier; = protected PreparedStatement findItemName; @@ -212,7 +212,7 @@ + " order by N_ORDER_NUM"; = FIND_ALL_NODES =3D "select ID from JCR_SITEM where I_CLASS=3D1 and C= ONTAINER_NAME=3D?"; - = + FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by ID"; = @@ -220,11 +220,13 @@ "select ID, NAME from JCR_SITEM" + " where I_CLASS=3D2 and CONTAI= NER_NAME=3D? and PARENT_ID=3D?"; = FIND_ALL_PROPERTIES =3D "select ID from JCR_SITEM where I_CLASS=3D2 = and CONTAINER_NAME=3D?"; - = - FIND_NODE_IDENTIFIER =3D "select ID from JCR_SITEM" + " where I_CLAS= S=3D1 and CONTAINER_NAME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D?= "; - = - FIND_PROPERTY_IDENTIFIER =3D "select ID from JCR_SITEM" + " where I_= CLASS=3D2 and CONTAINER_NAME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX= =3D1"; = + FIND_NODE_IDENTIFIER =3D + "select ID from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_NA= ME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D?"; + + FIND_PROPERTY_IDENTIFIER =3D + "select ID from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NA= ME=3D? and PARENT_ID=3D? and NAME=3D? and I_INDEX=3D1"; + FIND_ITEM_NAME =3D "select NAME, I_CLASS from JCR_SITEM" + " where I= D=3D?"; = INSERT_NODE =3D @@ -630,7 +632,7 @@ findNodeIdentifier.setInt(4, index); return findNodeIdentifier.executeQuery(); } - = + /** * {@inheritDoc} */ @@ -684,7 +686,7 @@ findNodesNameByParentId.setString(2, parentCid); return findNodesNameByParentId.executeQuery(); } - = + /** * {@inheritDoc} */ @@ -719,5 +721,12 @@ } findAllProperties.setString(1, containerName); return findAllProperties.executeQuery(); - } = + } + + @Override + protected boolean hasReferenceRecord(String nodeId, String refPropertyI= d) throws SQLException + { + // TODO Auto-generated method stub + return false; + } } --===============6414836353560635751==-- From do-not-reply at jboss.org Fri Nov 20 11:35:03 2009 Content-Type: multipart/mixed; boundary="===============3097048641356040448==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r797 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing. Date: Fri, 20 Nov 2009 11:35:02 -0500 Message-ID: <200911201635.nAKGZ2Ss003916@svn01.web.mwc.hst.phx2.redhat.com> --===============3097048641356040448== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-20 11:35:02 -0500 (Fri, 20 Nov 2009) New Revision: 797 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/writing/TestSiblingsRemove.java Log: EXOJCR-199: Added test on SNS operations Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/api/writing/TestSiblingsRemove.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSiblingsRemove.java (rev= 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSiblingsRemove.java 2009-11-20 16:35:02 UTC (rev= 797) @@ -0,0 +1,62 @@ +/* + * 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.api.writing; + +import org.exoplatform.services.jcr.JcrAPIBaseTest; +import org.exoplatform.services.jcr.impl.core.NodeImpl; + +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.RepositoryException; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class TestSiblingsRemove extends JcrAPIBaseTest +{ + + public void testRemoveSameNameSiblings() throws RepositoryException + { + String nodeName1 =3D "name"; + NodeImpl testRootNode =3D (NodeImpl)root.addNode("testroot"); + root.save(); + + testRootNode.addNode(nodeName1); + testRootNode.addNode(nodeName1); + testRootNode.save(); + + for (NodeIterator children =3D testRootNode.getNodes(); children.has= Next();) + { + Node child =3D children.nextNode(); + child.remove(); + } + + root.save(); + + for (NodeIterator children =3D testRootNode.getNodes(); children.has= Next();) + { + Node child =3D children.nextNode(); + child.remove(); + } + root.save(); + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native --===============3097048641356040448==-- From do-not-reply at jboss.org Fri Nov 20 11:39:32 2009 Content-Type: multipart/mixed; boundary="===============4470684650388690739==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r798 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing. Date: Fri, 20 Nov 2009 11:39:32 -0500 Message-ID: <200911201639.nAKGdW2t004779@svn01.web.mwc.hst.phx2.redhat.com> --===============4470684650388690739== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-20 11:39:32 -0500 (Fri, 20 Nov 2009) New Revision: 798 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/writing/TestSiblingsRemove.java Log: EXOJCR-199: Added test on SNS operations Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/writing/TestSiblingsRemove.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSiblingsRemove.java 2009-11-20 16:35:02 UTC (rev= 797) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestSiblingsRemove.java 2009-11-20 16:39:32 UTC (rev= 798) @@ -35,28 +35,35 @@ = public void testRemoveSameNameSiblings() throws RepositoryException { - String nodeName1 =3D "name"; - NodeImpl testRootNode =3D (NodeImpl)root.addNode("testroot"); - root.save(); + try + { + String nodeName1 =3D "name"; + NodeImpl testRootNode =3D (NodeImpl)root.addNode("testroot"); + root.save(); = - testRootNode.addNode(nodeName1); - testRootNode.addNode(nodeName1); - testRootNode.save(); + testRootNode.addNode(nodeName1); + testRootNode.addNode(nodeName1); + testRootNode.save(); = - for (NodeIterator children =3D testRootNode.getNodes(); children.has= Next();) - { - Node child =3D children.nextNode(); - child.remove(); - } + for (NodeIterator children =3D testRootNode.getNodes(); children.= hasNext();) + { + Node child =3D children.nextNode(); + child.remove(); + } = - root.save(); + root.save(); = - for (NodeIterator children =3D testRootNode.getNodes(); children.has= Next();) + for (NodeIterator children =3D testRootNode.getNodes(); children.= hasNext();) + { + Node child =3D children.nextNode(); + child.remove(); + } + root.save(); + } + catch (RepositoryException e) { - Node child =3D children.nextNode(); - child.remove(); + fail("Unexpected exception: " + e.getMessage()); } - root.save(); } = } --===============4470684650388690739==-- From do-not-reply at jboss.org Fri Nov 20 12:01:07 2009 Content-Type: multipart/mixed; boundary="===============0019416367561182868==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r799 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/impl/storage/jbosscache and 1 other directory. Date: Fri, 20 Nov 2009 12:01:07 -0500 Message-ID: <200911201701.nAKH17LZ010733@svn01.web.mwc.hst.phx2.redhat.com> --===============0019416367561182868== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-20 12:01:06 -0500 (Fri, 20 Nov 2009) New Revision: 799 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-248: fixes of SNS delete/update (not final: OrderBefore/Move tests f= ail) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 16:39:32 UTC (rev 798) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -20 17:01:06 UTC (rev 799) @@ -151,7 +151,8 @@ Node parent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); if (parent =3D=3D null) { - throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); + throw new InvalidItemStateException("Node's parent doesn't exi= st or removed by another Session " + + data.getQPath().getAsString()); } = final Fqn name =3D @@ -188,7 +189,8 @@ Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) { - throw new RepositoryException("Property's parent doesn't exist " = + data.getQPath().getAsString()); + throw new InvalidItemStateException("Property's parent doesn't ex= ist or removed by another Session " + + data.getQPath().getAsString()); } = if (data.getType() =3D=3D PropertyType.REFERENCE) @@ -272,26 +274,48 @@ // } // } = - if (data.getParentIdentifier() !=3D null) + // get parent + Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); + if (parent =3D=3D null) { - // check if parent is cached - Node parent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); - if (parent =3D=3D null) + throw new InvalidItemStateException("Node's parent doesn't exist = or removed by another Session " + + data.getQPath().getAsString()); + } + + // remove child on Parent + if (!parent.removeChild(makeChildNodeFqn(data.getQPath().getEntries(= )[data.getQPath().getEntries().length - 1]))) + { + // TODO [PN] if not removed, try by Id stored in the cache (seems= it's workaround, better solution should be) + Node thisStoredNode =3D nodesRoot.getChild(= makeNodeFqn(data.getIdentifier())); + if (thisStoredNode !=3D null) { - throw new RepositoryException("Node parent doesn't exist " + d= ata.getQPath().getAsString()); + NodeData storedData =3D (NodeData)thisStoredNode.get(ITEM_DATA= ); + if (storedData !=3D null) + { + // it's same-name siblings re-ordering, delete previous chi= ld + if (!parent.removeChild(makeChildNodeFqn(storedData.getQPat= h().getEntries()[storedData.getQPath() + .getEntries().length - 1]))) + { + throw new InvalidItemStateException( + "Node's doesn't exist or deleted by another Session b= ut listed in children nodes " + + data.getQPath().getAsString()); + } + } } - - // remove child on Parent - if (!parent - .removeChild(makeChildNodeFqn(data.getQPath().getEntries()[dat= a.getQPath().getEntries().length - 1]))) + else { throw new InvalidItemStateException("Node's doesn't exist or d= eleted by another Session " + data.getQPath().getAsString()); } } = + //treePrint(parent); + // remove from NODES - boolean removed =3D nodesRoot.removeChild(makeNodeFqn(data.getIdenti= fier())); + if (!nodesRoot.removeChild(makeNodeFqn(data.getIdentifier()))) + { + LOG.warn("Node was not deleted " + data.getQPath().getAsString()); + } } = /** @@ -301,12 +325,13 @@ InvalidItemStateException, IllegalStateException { startBatch(); - + // propsRoot.getChild(makePropFqn(data.getIdentifier())) // check if parent is cached Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) { - throw new RepositoryException("Property's parent doesn't exist " = + data.getQPath().getAsString()); + throw new InvalidItemStateException("Property's parent doesn't ex= ist or removed by another Session " + + data.getQPath().getAsString()); } = if (data.getType() =3D=3D PropertyType.REFERENCE) @@ -355,7 +380,6 @@ } } } - } = // remove from parent's properties attr @@ -367,7 +391,10 @@ } = // remove from PROPERTIES - boolean removed =3D propsRoot.removeChild(makePropFqn(data.getIdenti= fier())); + if (!propsRoot.removeChild(makePropFqn(data.getIdentifier()))) + { + LOG.warn("Property want not deleted " + data.getQPath().getAsStri= ng()); + } } = /** @@ -771,26 +798,55 @@ throw new InvalidItemStateException("Node was updated previously = or removed " + data.getQPath().getAsString()); } = - if (data.getParentIdentifier() !=3D null) + // check if parent is cached + Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); + if (parent =3D=3D null) { - // check if parent is cached - Node parent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); - if (parent =3D=3D null) + throw new RepositoryException("FATAL Node's parent not found " + = data.getQPath().getAsString()); + } + + // update child on Parent + NodeData prevData =3D (NodeData)node.get(ITEM_DATA); + if (prevData !=3D null) + { + // TODO (new logic) get previously cached NodeData and using its = name remove child on the parent + Fqn prevPath =3D + makeChildNodeFqn(prevData.getQPath().getEntries()[prevData.get= QPath().getEntries().length - 1]); + Node prevNameNode =3D parent.getChild(prevP= ath); + if (prevNameNode !=3D null) { - throw new RepositoryException("FATAL Node's parent not found "= + data.getQPath().getAsString()); - } + String prevNameNodeId =3D (String)prevNameNode.get(ITEM_ID); + if (prevNameNodeId !=3D null) + { + if (prevNameNodeId.equals(data.getIdentifier())) + { + // it's same-name siblings re-ordering, delete previous = child + if (!parent.removeChild(prevPath)) + { + throw new RepositoryException("FATAL Node not extists= as child but update asked " + + data.getQPath().getAsString()); + } + } // else ok + } + else + { + throw new RepositoryException("FATAL Child Node extists but= ITEM_ID is empty " + prevNameNode.getFqn() + + ". Update of " + data.getQPath().getAsString()); + } + } // else ok + } + else + { + throw new RepositoryException("FATAL Node's current data not foun= d " + data.getQPath().getAsString()); + } = - // update child on Parent - // TODO (wrong logic) get previously cached NodeData and using it= s name remove child on the parent - //boolean removed =3D - // parent.removeChild(makeChildNodeFqn(prevPath.getEntries()[pr= evPath.getEntries().length - 1])); + Node childNode =3D + parent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[dat= a.getQPath().getEntries().length - 1])); = - Node childNode =3D - parent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[= data.getQPath().getEntries().length - 1])); + // set child id attr = + childNode.put(ITEM_ID, data.getIdentifier()); = - // set child id attr = - childNode.put(ITEM_ID, data.getIdentifier()); - } + //treePrint(parent); = // update in NODES node.put(ITEM_DATA, data); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 16:39:32= UTC (rev 798) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 17:01:06= UTC (rev 799) @@ -230,6 +230,10 @@ conn.deleteProperty(identifier); } } + else + { + // remove of child node, we're not interested in such info for pe= rsistence + } } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-20 16:39:32 UTC (rev 798) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-20 17:01:06 UTC (rev 799) @@ -272,9 +272,9 @@ treePrint(nodes); = // get /snsNode:1 from childs of root / - checkChildNode(rootNode, node1id, node2path); - checkChildNode(rootNode, node2id, node1path); - checkChildNode(rootNode, node3id, node3path); + checkChildNode(rootNode, node1id, node2path, newNode1OrderNumb, newN= ode1version); + checkChildNode(rootNode, node2id, node1path, newNode2OrderNumb, newN= ode2version); + checkChildNode(rootNode, node3id, node3path, newNode3OrderNumb, newN= ode3version); = // Node childNode1 =3D // rootNode.getChild(Fqn @@ -317,6 +317,78 @@ // assertEquals("Node order number wrong", nodeOrderNumb, ((Nod= eData)dataObject).getOrderNumber()); } = + public void testDeleteUpdateNode() throws Exception + { + // add root (/) + conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, + new InternalQName[0], 0, null, new AccessControlList())); + + // add node (/node) + String node1id =3D "1"; + QPath node1path =3D QPath.parse("[]:1[]snsNode:1"); + int node1OrderNumb =3D 0; + int node1version =3D 1; + conn.add(new TransientNodeData(node1path, node1id, node1version, Con= stants.NT_UNSTRUCTURED, new InternalQName[0], + node1OrderNumb, Constants.ROOT_UUID, new AccessControlList())); + + String node2id =3D "2"; + QPath node2path =3D QPath.parse("[]:1[]snsNode:2"); + int node2OrderNumb =3D 1; + conn.add(new TransientNodeData(node2path, node2id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], + node2OrderNumb, Constants.ROOT_UUID, new AccessControlList())); + + String node3id =3D "3"; + QPath node3path =3D QPath.parse("[]:1[]snsNode:3"); + int node3OrderNumb =3D 2; + conn.add(new TransientNodeData(node3path, node3id, 1, Constants.NT_B= ASE, new InternalQName[0], node3OrderNumb, + Constants.ROOT_UUID, new AccessControlList())); + + // get root node ([]:1) + Node rootNode =3D nodes.getChild(Fqn.fromEleme= nts(Constants.ROOT_UUID)); + + // before + treePrint(nodes); + + // do /snsNode:1 delete, = + // update /snsNode:2 -> /snsNode:1, /snsNode:3 -> /snsNode:2 (order = number, version and index) = + conn.delete(new TransientNodeData(node1path, node1id, node1version, = Constants.NT_UNSTRUCTURED, + new InternalQName[0], node1OrderNumb, Constants.ROOT_UUID, new Ac= cessControlList())); + + // update /snsNode:2 (order number, version and index) to /snsNode:1 = + QPath newNode2path =3D QPath.parse("[]:1[]snsNode:1"); + int newNode2OrderNumb =3D 0; + int newNode2version =3D 2; + conn.update(new TransientNodeData(newNode2path, node2id, newNode2ver= sion, Constants.NT_UNSTRUCTURED, + new InternalQName[0], newNode2OrderNumb, Constants.ROOT_UUID, new= AccessControlList())); + + // update /snsNode:3 (order number, version and index) to /snsNode:2 = + QPath newNode3path =3D QPath.parse("[]:1[]snsNode:2"); + int newNode3OrderNumb =3D 1; + int newNode3version =3D 2; + conn.update(new TransientNodeData(newNode3path, node3id, newNode3ver= sion, Constants.NT_BASE, + new InternalQName[0], newNode3OrderNumb, Constants.ROOT_UUID, new= AccessControlList())); + + // after + treePrint(nodes); + + // check + + // /snsNode:1 exists + assertEquals("Childs expected", 2, rootNode.getChildren().size()); + assertNull("Child Node should be deleted", rootNode.getChild(Fqn.fro= mElements(node3path.getEntries()[node3path + .getEntries().length - 1].getAsString(true)))); + assertNotNull("Child Node should exists", rootNode.getChild(Fqn.from= Elements(node1path.getEntries()[node1path + .getEntries().length - 1].getAsString(true)))); + assertNotNull("Child Node should exists", rootNode.getChild(Fqn.from= Elements(node1path.getEntries()[node2path + .getEntries().length - 1].getAsString(true)))); + + // /snsNode:2 -> /snsNode:1 + checkChildNode(rootNode, node2id, node1path, newNode2OrderNumb, newN= ode2version); + + // /snsNode:3 -> /snsNode:2 + checkChildNode(rootNode, node3id, node2path, newNode3OrderNumb, newN= ode3version); + } + public void testUpdateProperty() throws Exception { // add root (/) @@ -646,13 +718,15 @@ new InternalQName[0], 0, Constants.ROOT_UUID, new AccessContro= lList())); = conn.commit(); - = + fail("The node jcr:system should not be save"); - } catch (ItemExistsException e) { + } + catch (ItemExistsException e) + { //ok } } - = + public void testAddPropertyFail() throws Exception { // add root (/) @@ -667,77 +741,84 @@ propData1.setValue(new TransientValueData(propValue1)); conn.add(propData1); = - = - = - try { + try + { // add property (/jcr:primaryType) twice = conn.add(propData1); - = + conn.commit(); - = + fail("The property (/jcr:primaryType) should not be save"); - } catch (ItemExistsException e) { + } + catch (ItemExistsException e) + { //ok } } - = + public void testDeleteNodeFail() throws Exception { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, null, new AccessControlList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add node (/node) String node1id =3D "1"; QPath node1path =3D QPath.parse("[]:1[]node:1"); conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); + Constants.ROOT_UUID, new AccessControlList())); = // add /jcr:system conn.add(new TransientNodeData(Constants.JCR_SYSTEM_PATH, Constants.= SYSTEM_UUID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, Constants.ROOT_UUID, new AccessCon= trolList())); + new InternalQName[0], 0, Constants.ROOT_UUID, new AccessControlLi= st())); = // delete /node conn.delete(new TransientNodeData(node1path, node1id, 1, Constants.N= T_UNSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - = - try { + Constants.ROOT_UUID, new AccessControlList())); + + try + { // delete node /node twice = conn.delete(new TransientNodeData(node1path, node1id, 1, Constant= s.NT_UNSTRUCTURED, new InternalQName[0], 0, - Constants.ROOT_UUID, new AccessControlList())); - = + Constants.ROOT_UUID, new AccessControlList())); + conn.commit(); - = + fail("The node (/node) should not be delete"); - } catch (InvalidItemStateException e) { + } + catch (InvalidItemStateException e) + { //ok } } - = + public void testDeletePropertyFail() throws Exception { // add root (/) conn.add(new TransientNodeData(Constants.ROOT_PATH, Constants.ROOT_U= UID, 1, Constants.NT_UNSTRUCTURED, - new InternalQName[0], 0, null, new AccessControlList())); + new InternalQName[0], 0, null, new AccessControlList())); = // add property (/jcr:primaryType) String propId1 =3D "1"; conn.add(new TransientPropertyData(QPath.makeChildPath(Constants.ROO= T_PATH, Constants.JCR_PRIMARYTYPE), propId1, - 1, 1, Constants.ROOT_UUID, false)); + 1, 1, Constants.ROOT_UUID, false)); = // delete /jcr:primaryType conn.delete(new TransientPropertyData(QPath.makeChildPath(Constants.= ROOT_PATH, Constants.JCR_PRIMARYTYPE), - propId1, 1, 1, Constants.ROOT_UUID, false)); + propId1, 1, 1, Constants.ROOT_UUID, false)); = - try { + try + { // delete /jcr:primaryType twice = conn.delete(new TransientPropertyData(QPath.makeChildPath(Constan= ts.ROOT_PATH, Constants.JCR_PRIMARYTYPE), - propId1, 1, 1, Constants.ROOT_UUID, false)); - = + propId1, 1, 1, Constants.ROOT_UUID, false)); + conn.commit(); - = + fail("The property (/jcr:primaryType) should not be delete"); - } catch (InvalidItemStateException e) { + } + catch (InvalidItemStateException e) + { //ok } } --===============0019416367561182868==-- From do-not-reply at jboss.org Mon Nov 23 03:24:16 2009 Content-Type: multipart/mixed; boundary="===============5074743949293437376==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r800 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/lock. Date: Mon, 23 Nov 2009 03:24:16 -0500 Message-ID: <200911230824.nAN8OGRQ007579@svn01.web.mwc.hst.phx2.redhat.com> --===============5074743949293437376== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-23 03:24:15 -0500 (Mon, 23 Nov 2009) New Revision: 800 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/lock/PersistentLockManager.java Log: EXOJCR-243: remove useless output. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/lock/PersistentLockManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/PersistentLockManager.java 2009-11-20 17:01:06 UT= C (rev 799) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/PersistentLockManager.java 2009-11-23 08:24:15 UT= C (rev 800) @@ -105,8 +105,6 @@ { for (LockData lockData : lockDatas) { - System.out.println(" found sucg lock: " + lockData.getNodeIden= tifier()); - System.out.println(" it's expir time: " + lockData.getTimeToDe= ath()); if (lockData.getTimeToDeath() < 0) { // try to remove node, if unsuccessful then, at least, try = to remove other expired locks --===============5074743949293437376==-- From do-not-reply at jboss.org Mon Nov 23 04:53:45 2009 Content-Type: multipart/mixed; boundary="===============8039607010916917278==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r801 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 23 Nov 2009 04:53:45 -0500 Message-ID: <200911230953.nAN9rj2X027630@svn01.web.mwc.hst.phx2.redhat.com> --===============8039607010916917278== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-23 04:53:45 -0500 (Mon, 23 Nov 2009) New Revision: 801 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java Log: EXOJCR-246: JBossCacheStorageConnectionTest updated Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-23 08:24:15 UTC (rev 800) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionTest.java 200= 9-11-23 09:53:45 UTC (rev 801) @@ -38,9 +38,7 @@ = import javax.jcr.InvalidItemStateException; import javax.jcr.ItemExistsException; -import javax.jcr.lock.LockException; import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; = /** * Created by The eXo Platform SAS. @@ -881,17 +879,6 @@ props =3D conn.getReferencesData(node3id); assertEquals("References expected", 0, props.size()); = - // try remove referenced node - try - { - conn.delete(node1); - fail(); - } - catch (RepositoryException e) - { - //ok - } - // update reference property = TransientPropertyData updateProp =3D --===============8039607010916917278==-- From do-not-reply at jboss.org Mon Nov 23 05:00:17 2009 Content-Type: multipart/mixed; boundary="===============8474164133858152123==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r802 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone. Date: Mon, 23 Nov 2009 05:00:17 -0500 Message-ID: <200911231000.nANA0HtY028810@svn01.web.mwc.hst.phx2.redhat.com> --===============8474164133858152123== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-23 05:00:16 -0500 (Mon, 23 Nov 2009) New Revision: 802 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config.xml Log: EXOJCR-199 : All ws on JBC Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jbosscache-config-exoloader.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-23 09:53:45 UTC (rev 801) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader.xml 2009-11-23 10:00:16 UTC (rev 802) @@ -6,51 +6,8 @@ = - - = - - - = - - - - = - - - - - - - - - - - - - - - - - - = + = - + + @@ -96,12 +98,7 @@ - - - - - - + @@ -116,8 +113,9 @@ = - + + @@ -136,12 +134,7 @@ - - - - - - + @@ -158,8 +151,9 @@ + class=3D"org.exoplatform.services.jcr.impl.storage.jbosscache.JBossC= acheWorkspaceDataContainer"> + @@ -204,13 +198,6 @@ - - - - - - @@ -239,8 +226,9 @@ - + + @@ -265,12 +253,6 @@ - - - - - - @@ -294,8 +276,9 @@ = - + + @@ -320,12 +303,6 @@ - - - - - - @@ -340,8 +317,9 @@ = - + + @@ -366,12 +344,6 @@ - - - - - - --===============8474164133858152123==-- From do-not-reply at jboss.org Mon Nov 23 06:10:55 2009 Content-Type: multipart/mixed; boundary="===============8531020363240001071==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r803 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 23 Nov 2009 06:10:55 -0500 Message-ID: <200911231110.nANBAtkK007405@svn01.web.mwc.hst.phx2.redhat.com> --===============8531020363240001071== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-23 06:10:55 -0500 (Mon, 23 Nov 2009) New Revision: 803 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java Log: EXOJCR-203 : The test JBossCacheRestartTest was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java 2009-11-23 10= :00:16 UTC (rev 802) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheRestartTest.java 2009-11-23 11= :10:55 UTC (rev 803) @@ -20,14 +20,18 @@ = import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.util.IdGenerator; import org.jboss.cache.Fqn; import org.jboss.cache.Node; = +import com.thoughtworks.xstream.core.ReferenceByIdMarshaller.IDGenerator; + /** * Created by The eXo Platform SAS. * = @@ -49,11 +53,30 @@ // add root (/) initJCRRoot(); = + // add node (/node) + String node1id =3D IdGenerator.generate(); + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + = + PropertyData primaryType =3D + createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); + conn.add(primaryType); + conn.commit(); + = // check before stop Node rNode =3D cache.getRoot().getChild(Fqn.fr= omElements(JBossCacheStorage.NODES, Constants.ROOT_UUID)); assertNotNull("Node expected", rNode); checkNode(rNode, Constants.ROOT_UUID, Constants.ROOT_PATH); = + Node node1 =3D cache.getRoot().getChild(Fqn.fr= omElements(JBossCacheStorage.NODES, node1id)); + assertNotNull("Node '/node1' expected", node1); + checkNode(node1, node1id, node1path); + = + Node prop1 =3D cache.getRoot().getChild(Fqn.fr= omElements(JBossCacheStorage.PROPS, primaryType.getIdentifier())); + assertNotNull("Property '/node1/jcr:primaryType' expected", prop1); + checkProp(primaryType.getIdentifier(), primaryType.getQPath(), new S= tring(primaryType.getValues().get(0).getAsByteArray(),Constants.DEFAULT_ENC= ODING)); + = // stop cache cache.stop(); cache.destroy(); @@ -65,5 +88,13 @@ rNode =3D cache.getRoot().getChild(Fqn.fromElements(JBossCacheStorag= e.NODES, Constants.ROOT_UUID)); assertNotNull("Node expected", rNode); checkNode(rNode, Constants.ROOT_UUID, Constants.ROOT_PATH); + = + node1 =3D cache.getRoot().getChild(Fqn.fromElements(JBossCacheStorag= e.NODES, node1id)); + assertNotNull("Node '/node1' expected", node1); + checkNode(node1, node1id, node1path); + = + prop1 =3D cache.getRoot().getChild(Fqn.fromElements(JBossCacheStorag= e.PROPS, primaryType.getIdentifier())); + assertNotNull("Property '/node1/jcr:primaryType' expected", prop1); + checkProp(primaryType.getIdentifier(), primaryType.getQPath(), new S= tring(primaryType.getValues().get(0).getAsByteArray(),Constants.DEFAULT_ENC= ODING)); } } --===============8531020363240001071==-- From do-not-reply at jboss.org Mon Nov 23 06:22:30 2009 Content-Type: multipart/mixed; boundary="===============3828631873721245830==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r804 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/storage/jdbc and 3 other directories. Date: Mon, 23 Nov 2009 06:22:30 -0500 Message-ID: <200911231122.nANBMUWJ009271@svn01.web.mwc.hst.phx2.redhat.com> --===============3828631873721245830== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-23 06:22:30 -0500 (Mon, 23 Nov 2009) New Revision: 804 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/DBConstants.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java Log: EXOJCR-246: JDBCCahceLoader getChildNames implemented for /$REFS Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 11:10:55= UTC (rev 803) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 11:22:30= UTC (rev 804) @@ -412,6 +412,7 @@ else { attrs =3D null; + LOG.warn("Unexpected Fqn asked " + name); } = } @@ -618,8 +619,7 @@ } else if (name.get(0).equals(JBossCacheStorage.REFS)) { - // TODO return all referenced nodes in workspace - return new LinkedHashSet(); + return conn.getAllRefencedNodeIdentifiers(); } else if (name.get(0).equals(Fqn.ROOT)) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-23 11:10:55 UTC (rev = 803) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java 2009-11-23 11:22:30 UTC (rev = 804) @@ -222,6 +222,11 @@ */ protected String FIND_REFERENCE; = + /** + * FIND_REFERENCED_NODES + */ + protected String FIND_REFERENCED_NODES; + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D ITEMS table =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D = /** * COLUMN_ID. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-23 11:10:55= UTC (rev 803) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-23 11:22:30= UTC (rev 804) @@ -2293,6 +2293,28 @@ } } = + public Set getAllRefencedNodeIdentifiers() throws RepositoryExc= eption, IllegalStateException + { + checkIfOpened(); + + try + { + ResultSet node =3D findAllReferencedNodeIdentifiers(); + Set childrens =3D new LinkedHashSet(); + while (node.next()) + { + String nodeId =3D node.getString(COLUMN_ID); //"NODE_ID");// + childrens.add(nodeId); + } + + return childrens; + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } + /** * Return all Nodes in workspace. * TODO check if it used, should not! @@ -2390,4 +2412,6 @@ = protected abstract ResultSet findAllNodeIdentifiers() throws SQLExcepti= on; = + protected abstract ResultSet findAllReferencedNodeIdentifiers() throws = SQLException; + } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-23 11:10= :55 UTC (rev 803) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-23 11:22= :30 UTC (rev 804) @@ -126,6 +126,8 @@ = protected PreparedStatement findReference; = + protected PreparedStatement findAllReferencedNodes; + /** * Multidatabase JDBC Connection constructor. * = @@ -195,6 +197,8 @@ = FIND_REFERENCE =3D "select P.ID from JCR_MREF R, JCR_MITEM P where R= .NODE_ID=3D? and R.PROPERTY_ID=3D?"; = + FIND_REFERENCED_NODES =3D "select N.ID from JCR_MREF R, JCR_MITEM N= where N.ID=3DR.NODE_ID"; + FIND_VALUES_BY_PROPERTYID =3D "select PROPERTY_ID, ORDER_NUM, DATA, STORAGE_DESC from JCR_MVALU= E where PROPERTY_ID=3D? order by ORDER_NUM"; = @@ -241,6 +245,7 @@ DELETE_ITEM =3D "delete from JCR_MITEM where ID=3D?"; DELETE_VALUE =3D "delete from JCR_MVALUE where PROPERTY_ID=3D?"; DELETE_REF =3D "delete from JCR_MREF where PROPERTY_ID=3D?"; + } = /** @@ -726,4 +731,18 @@ = return result.next(); } + + @Override + protected ResultSet findAllReferencedNodeIdentifiers() throws SQLExcept= ion + { + // TODO make query + if (findAllReferencedNodes =3D=3D null) + findAllReferencedNodes =3D dbConnection.prepareStatement(this.FIN= D_REFERENCED_NODES); + else + findAllReferencedNodes.clearParameters(); + + ResultSet result =3D findAllReferencedNodes.executeQuery(); + + return result; + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-23 11:1= 0:55 UTC (rev 803) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-23 11:2= 2:30 UTC (rev 804) @@ -729,4 +729,11 @@ // TODO Auto-generated method stub return false; } + + @Override + protected ResultSet findAllReferencedNodeIdentifiers() throws SQLExcept= ion + { + // TODO Auto-generated method stub + return null; + } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java 2009-11-23 = 11:10:55 UTC (rev 803) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWorkspaceDataContainerTestBase.java 2009-11-23 = 11:22:30 UTC (rev 804) @@ -1,5 +1,7 @@ package org.exoplatform.services.jcr.impl.storage; = +import junit.framework.TestCase; + import org.apache.commons.dbcp.BasicDataSourceFactory; import org.exoplatform.services.idgenerator.impl.IDGeneratorServiceImpl; import org.exoplatform.services.jcr.access.AccessControlList; @@ -33,8 +35,6 @@ import javax.naming.InitialContext; import javax.sql.DataSource; = -import junit.framework.TestCase; - /** * Created by The eXo Platform SAS. * = @@ -52,7 +52,7 @@ protected void setUp() throws Exception { super.setUp(); - = + initPersistence(); } = @@ -91,8 +91,8 @@ return "jdbcjcr_" + IdGenerator.generate(); } = = - protected WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Str= ing dsName, String vsPath, ContainerEntry entry) - throws Exception + protected WorkspaceEntry getNewWs(String wsName, boolean isMultiDb, Str= ing dsName, String vsPath, + ContainerEntry entry) throws Exception { List params =3D new ArrayList(); = @@ -225,7 +225,7 @@ protected void deleteJCRRoot() throws Exception { // prepare = - = + // delete root (/) etc } = @@ -238,8 +238,8 @@ * @param primaryType InternalQName * @throws Exception */ - protected void addDbNode(WorkspaceStorageConnection conn, QPath root, S= tring nodeId, InternalQName primaryType, String parentNodeId) - throws Exception + protected void addDbNode(WorkspaceStorageConnection conn, QPath root, S= tring nodeId, InternalQName primaryType, + String parentNodeId) throws Exception { // add root (/) conn.add(new TransientNodeData(root, nodeId, 1, primaryType, new Int= ernalQName[0], 0, parentNodeId, @@ -250,6 +250,25 @@ } = /** + * Add Node to the connection but doesn't save it. + * + * @param conn WorkspaceStorageConnection + * @param root QPath + * @param nodeId String + * @param primaryType InternalQName + * @throws Exception + */ + protected void addDbNodeWithMixin(WorkspaceStorageConnection conn, QPat= h root, String nodeId, + InternalQName primaryType, InternalQName[] mixins, String parentNode= Id) throws Exception + { + // add root (/) + conn.add(new TransientNodeData(root, nodeId, 1, primaryType, mixins,= 0, parentNodeId, new AccessControlList())); + + // add property (/jcr:primaryType) + conn.add(createProperty(root, nodeId, Constants.JCR_PRIMARYTYPE, pri= maryType, false)); + } + + /** * Add Property to the connection but doesn't save it. * * @param conn WorkspaceStorageConnection @@ -343,5 +362,4 @@ // new AccessControlList())); } = - = } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-23 11:1= 0:55 UTC (rev 803) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoaderTest.java 2009-11-23 11:2= 2:30 UTC (rev 804) @@ -42,10 +42,12 @@ import org.jboss.cache.Modification; = import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; = +import javax.jcr.PropertyType; import javax.naming.Context; = /** @@ -186,11 +188,12 @@ WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); String baseNodeId =3D IdGenerator.generate(); - addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); - = + addDbNode(conn, baseNodePath, baseNodeId, Constants.NT_UNSTRUCTURED,= Constants.ROOT_UUID); + // add child nodes [node1] = String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, + Constants.NT_UNSTRUCTURED, baseNodeId); conn.commit(); = List modifications =3D new ArrayList(); @@ -261,24 +264,24 @@ QPath nodePath =3D QPath.parse("[]:1[]node:1"); addDbNode(conn, nodePath, nodeId, Constants.NT_UNSTRUCTURED, Constan= ts.ROOT_UUID); conn.commit(); - = + conn =3D persistentContainer.openConnection(); - = + NodeData nodeData =3D new TransientNodeData(nodePath, nodeId, 1, Constants.NT_UNSTRUCTU= RED, new InternalQName[0], 2, Constants.ROOT_UUID, new AccessControlList()); - = + List modifications =3D new ArrayList(); = modifications.addAll(updateNode(nodeData)); - = + loader.put(modifications); = // tests it conn =3D persistentContainer.openConnection(); - = - NodeData destNodeData =3D (NodeData) conn.getItemData(nodeId); - = + + NodeData destNodeData =3D (NodeData)conn.getItemData(nodeId); + assertNotNull(destNodeData); assertEquals(2, destNodeData.getOrderNumber()); } @@ -292,26 +295,29 @@ String nodeId =3D IdGenerator.generate(); QPath nodePath =3D QPath.parse("[]:1[]node:1"); addDbNode(conn, nodePath, nodeId, Constants.NT_UNSTRUCTURED, Constan= ts.ROOT_UUID); - = - TransientPropertyData propData =3D addDbProperty(conn, nodePath, nod= eId, InternalQName.parse("[]prop"), "JCR DATA VALUE [base]", false); - = + + TransientPropertyData propData =3D + addDbProperty(conn, nodePath, nodeId, InternalQName.parse("[]prop= "), "JCR DATA VALUE [base]", false); + conn.commit(); = // create update property - TransientPropertyData updatePropData =3D new TransientPropertyData(Q= Path.makeChildPath(nodePath, InternalQName.parse("[]prop")), propData.getId= entifier(), 1, 1, nodeId, false); + TransientPropertyData updatePropData =3D + new TransientPropertyData(QPath.makeChildPath(nodePath, InternalQ= Name.parse("[]prop")), propData + .getIdentifier(), 1, 1, nodeId, false); updatePropData.setValue(new TransientValueData("JCR DATA VALUE [upda= ted]")); - = + List modifications =3D new ArrayList(); - = + modifications.addAll(updateProperty(updatePropData)); - = + loader.put(modifications); = // tests it conn =3D persistentContainer.openConnection(); - = - PropertyData destPropData =3D (PropertyData) conn.getItemData(propDa= ta.getIdentifier()); - = + + PropertyData destPropData =3D (PropertyData)conn.getItemData(propDat= a.getIdentifier()); + assertNotNull(destPropData); ValueData valueData =3D destPropData.getValues().get(0); assertEquals("JCR DATA VALUE [updated]", new String(valueData.getAsB= yteArray(), "UTF-8")); @@ -362,25 +368,26 @@ = // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - = + QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); String baseNodeId =3D IdGenerator.generate(); - addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); - = + addDbNode(conn, baseNodePath, baseNodeId, Constants.NT_UNSTRUCTURED,= Constants.ROOT_UUID); + // add child nodes [node1] = String nodeId =3D IdGenerator.generate(); - addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, + Constants.NT_UNSTRUCTURED, baseNodeId); conn.commit(); - = + // tests it Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, baseNodeId, "[]node1:1")); - = + assertNotNull(attrebutes); - = - String destNodeId =3D (String) attrebutes.get(JBossCacheStorage.ITEM= _ID); - = + + String destNodeId =3D (String)attrebutes.get(JBossCacheStorage.ITEM_= ID); + assertNotNull(destNodeId); - assertEquals(nodeId, destNodeId); = + assertEquals(nodeId, destNodeId); } = public void testGetPropertyByIdentifier() throws Exception @@ -395,8 +402,7 @@ connection.commit(); = // tests it - Map attrebutes =3D - loader.get(Fqn.fromElements(JBossCacheStorage.PROPS, propData.get= Identifier())); + Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.PROPS, propData.getIdentifier())); = assertNotNull(attrebutes); = @@ -433,19 +439,22 @@ = QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); String baseNodeId =3D IdGenerator.generate(); - addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); - = + addDbNode(conn, baseNodePath, baseNodeId, Constants.NT_UNSTRUCTURED,= Constants.ROOT_UUID); + // add child nodes [node1, node2, node3] = - addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), IdGenerator.generate(), Constants.NT_UNSTRUCTURED, baseNodeI= d); - addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node2")), IdGenerator.generate(), Constants.NT_UNSTRUCTURED, baseNodeI= d); - addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node3")), IdGenerator.generate(), Constants.NT_UNSTRUCTURED, baseNodeI= d); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), IdGenerator.generate(), + Constants.NT_UNSTRUCTURED, baseNodeId); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node2")), IdGenerator.generate(), + Constants.NT_UNSTRUCTURED, baseNodeId); + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node3")), IdGenerator.generate(), + Constants.NT_UNSTRUCTURED, baseNodeId); conn.commit(); = // tests it - Set childs =3D (Set) loader.getChildrenNames(Fqn.fro= mElements(JBossCacheStorage.NODES, baseNodeId)); - = + Set childs =3D (Set)loader.getChildrenNames(Fqn.from= Elements(JBossCacheStorage.NODES, baseNodeId)); + assertNotNull(childs); - = + assertEquals(3, childs.size()); assertTrue(childs.contains("[]node1:1")); assertTrue(childs.contains("[]node2:1")); @@ -460,24 +469,27 @@ = QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); String baseNodeId =3D IdGenerator.generate(); - addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); + addDbNode(conn, baseNodePath, baseNodeId, Constants.NT_UNSTRUCTURED,= Constants.ROOT_UUID); = - TransientPropertyData propData1 =3D addDbProperty(conn, baseNodePath= , baseNodeId, InternalQName.parse("[]prop1"), "JCR DATA VALUE 1", false); - TransientPropertyData propData2 =3D addDbProperty(conn, baseNodePath= , baseNodeId, InternalQName.parse("[]prop2"), "JCR DATA VALUE 2", false); - TransientPropertyData propData3 =3D addDbProperty(conn, baseNodePath= , baseNodeId, InternalQName.parse("[]prop3"), "JCR DATA VALUE 3", false); + TransientPropertyData propData1 =3D + addDbProperty(conn, baseNodePath, baseNodeId, InternalQName.parse= ("[]prop1"), "JCR DATA VALUE 1", false); + TransientPropertyData propData2 =3D + addDbProperty(conn, baseNodePath, baseNodeId, InternalQName.parse= ("[]prop2"), "JCR DATA VALUE 2", false); + TransientPropertyData propData3 =3D + addDbProperty(conn, baseNodePath, baseNodeId, InternalQName.parse= ("[]prop3"), "JCR DATA VALUE 3", false); = conn.commit(); - = + // tests it Map attrebutes =3D loader.get(Fqn.fromElements(JBoss= CacheStorage.NODES, baseNodeId)); - = + assertNotNull(attrebutes); - = + assertTrue(attrebutes.containsKey(Constants.JCR_PRIMARYTYPE.getAsStr= ing())); assertTrue(attrebutes.containsKey("[]prop1")); assertTrue(attrebutes.containsKey("[]prop2")); assertTrue(attrebutes.containsKey("[]prop3")); - = + assertEquals(propData1.getIdentifier(), attrebutes.get("[]prop1")); assertEquals(propData2.getIdentifier(), attrebutes.get("[]prop2")); assertEquals(propData3.getIdentifier(), attrebutes.get("[]prop3")); @@ -487,54 +499,142 @@ { = // prepare + String nodeId =3D IdGenerator.generate(); = + QPath nodePath =3D QPath.parse("[]:1[]node:1"); + NodeData node =3D + new TransientNodeData(nodePath, nodeId, 1, Constants.NT_UNSTRUCTU= RED, + new InternalQName[]{Constants.MIX_REFERENCEABLE}, 0, Constants= .ROOT_UUID, new AccessControlList()); + + PropertyData primaryType =3D + createProperty(nodePath, nodeId, Constants.JCR_PRIMARYTYPE, Const= ants.NT_UNSTRUCTURED, false); + + List modifications =3D new ArrayList(); + modifications.addAll(addNode(node)); + modifications.addAll(addProperty(primaryType)); + + loader.put(modifications); + + // make node with refernce + String refnodeId =3D IdGenerator.generate(); + + QPath refnodePath =3D QPath.parse("[]:1[]node2:1"); + NodeData refnode =3D + new TransientNodeData(refnodePath, refnodeId, 1, Constants.NT_UNS= TRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList()); + + PropertyData refprimaryType =3D + createProperty(refnodePath, refnodeId, Constants.JCR_PRIMARYTYPE,= Constants.NT_UNSTRUCTURED, false); + + String refPropId1 =3D IdGenerator.generate(); + TransientPropertyData propData =3D + new TransientPropertyData(QPath.makeChildPath(refnodePath, "[]ref= prop1"), refPropId1, 1, + PropertyType.REFERENCE, refnodeId, false); + propData.setValue(new TransientValueData(nodeId)); + + modifications.clear(); + modifications.addAll(addNode(refnode)); + modifications.addAll(addProperty(refprimaryType)); + loader.put(modifications); + + WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); + + // NodeData destNodeData =3D (NodeData)conn.getItemData(nodeId); + // + // assertNotNull(destNodeData); + // assertEquals(node.getIdentifier(), destNodeData.getIdentifie= r()); + // assertEquals(node.getOrderNumber(), destNodeData.getOrderNum= ber()); + // assertEquals(node.getParentIdentifier(), destNodeData.getPar= entIdentifier()); + // assertEquals(node.getPersistedVersion(), destNodeData.getPer= sistedVersion()); + // assertEquals(node.getQPath().getAsString(), destNodeData.get= QPath().getAsString()); + // assertEquals(node.getPrimaryTypeName().getAsString(), destNo= deData.getPrimaryTypeName().getAsString()); + + modifications.clear(); + modifications.addAll(addProperty(propData)); + loader.put(modifications); + + String refPropId2 =3D IdGenerator.generate(); + TransientPropertyData propData2 =3D + new TransientPropertyData(QPath.makeChildPath(refnodePath, "[]ref= prop2"), refPropId2, 1, + PropertyType.REFERENCE, refnodeId, false); + propData2.setValue(new TransientValueData(nodeId)); + + modifications.clear(); + modifications.addAll(addProperty(propData2)); + loader.put(modifications); + // tests it = + Set names =3D loader.getChildrenNames(Fqn.fromString("/$REFS/" + nod= eId)); + + assertTrue(names.size() =3D=3D 2); + + Iterator it =3D names.iterator(); + + assertEquals(refPropId1, (String)it.next()); + assertEquals(refPropId2, (String)it.next()); + + Set referncedNodes =3D loader.getChildrenNames(Fqn.fromString("/$REF= S")); + + assertTrue(referncedNodes.size() =3D=3D 1); + + it =3D referncedNodes.iterator(); + + assertEquals(nodeId, (String)it.next()); + + conn =3D persistentContainer.openConnection(); + + // tests it + List refs =3D conn.getReferencesData(nodeId); + + assertEquals(2, refs.size()); + assertEquals(refPropId1, refs.get(0).getIdentifier()); + assertEquals(refPropId2, refs.get(1).getIdentifier()); } - = + public void testExistNode() throws Exception { = // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - = + QPath baseNodePath =3D QPath.makeChildPath(Constants.ROOT_PATH, Inte= rnalQName.parse("[]baseNode")); String baseNodeId =3D IdGenerator.generate(); - addDbNode(conn, baseNodePath, baseNodeId,Constants.NT_UNSTRUCTURED, = Constants.ROOT_UUID); + addDbNode(conn, baseNodePath, baseNodeId, Constants.NT_UNSTRUCTURED,= Constants.ROOT_UUID); conn.commit(); - = + // tests it String nodeId =3D IdGenerator.generate(); - = + assertFalse(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, = nodeId))); assertFalse(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, = baseNodeId, "[]node1:1"))); - = + conn =3D persistentContainer.openConnection(); - = - addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, Constants.NT_UNSTRUCTURED, baseNodeId); + + addDbNode(conn, QPath.makeChildPath(baseNodePath, InternalQName.pars= e("[]node1")), nodeId, + Constants.NT_UNSTRUCTURED, baseNodeId); conn.commit(); - = + assertTrue(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, n= odeId))); assertTrue(loader.exists(Fqn.fromElements(JBossCacheStorage.NODES, b= aseNodeId, "[]node1:1"))); } - = + public void testExistProperty() throws Exception { = // prepare WorkspaceStorageConnection conn =3D persistentContainer.openConnecti= on(); - = + TransientPropertyData propData =3D - createProperty(Constants.ROOT_PATH, Constants.ROOT_UUID, Constant= s.JCR_DATA, "JCR DATA VALUE", - false); - = + createProperty(Constants.ROOT_PATH, Constants.ROOT_UUID, Constant= s.JCR_DATA, "JCR DATA VALUE", false); + // tests it assertFalse(loader.exists(Fqn.fromElements(JBossCacheStorage.PROPS, = propData.getIdentifier()))); - = + // commit in DB conn.add(propData); conn.commit(); - = + assertTrue(loader.exists(Fqn.fromElements(JBossCacheStorage.PROPS, p= ropData.getIdentifier()))); } = --===============3828631873721245830==-- From do-not-reply at jboss.org Mon Nov 23 06:41:40 2009 Content-Type: multipart/mixed; boundary="===============4780572521959656027==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r805 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 23 Nov 2009 06:41:40 -0500 Message-ID: <200911231141.nANBfelM012282@svn01.web.mwc.hst.phx2.redhat.com> --===============4780572521959656027== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-23 06:41:40 -0500 (Mon, 23 Nov 2009) New Revision: 805 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-246: JDBCCahceLoader getChildNames updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 11:22:30= UTC (rev 804) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 11:41:40= UTC (rev 805) @@ -599,6 +599,13 @@ return null; } } + else if (name.size() > 2) + { + // seems it is fqn like /$NODES/nodeUUID/childname[/...] or /$= REFS/nodeUUID/propUUUIS[/...] + // TODO this is unexpected part of cache throw Exception + LOG.warn("This is unexpected FQN " + name); + return null; + } else if (name.get(0).equals(JBossCacheStorage.NODES)) { // TODO should never be called --===============4780572521959656027==-- From do-not-reply at jboss.org Mon Nov 23 06:43:28 2009 Content-Type: multipart/mixed; boundary="===============3097629729891457871==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r806 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone. Date: Mon, 23 Nov 2009 06:43:28 -0500 Message-ID: <200911231143.nANBhSpG012378@svn01.web.mwc.hst.phx2.redhat.com> --===============3097629729891457871== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-23 06:43:27 -0500 (Mon, 23 Nov 2009) New Revision: 806 Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader_db1_ws.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader_db1_ws1.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader_db1_ws2.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader_db1_ws3.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader_db1tck_ws.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader_db1tck_ws1.xml jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jbosscache-config-exoloader_db1tck_ws2.xml Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config.xml Log: EXOJCR-203 : Add difernt configiration to JBossCache was added. Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-jbosscache-config-exoloader_db1_ws.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws.xml (rev= 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws.xml 2009-11-23 11:43:27 UTC (rev= 806) @@ -0,0 +1,80 @@ + + + + + + + + = + + + = + + + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-jbosscache-config-exoloader_db1_ws.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-jbosscache-config-exoloader_db1_ws1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws1.xml (re= v 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws1.xml 2009-11-23 11:43:27 UTC (re= v 806) @@ -0,0 +1,80 @@ + + + + + + + + = + + + = + + + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-jbosscache-config-exoloader_db1_ws1.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-jbosscache-config-exoloader_db1_ws2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws2.xml (re= v 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws2.xml 2009-11-23 11:43:27 UTC (re= v 806) @@ -0,0 +1,80 @@ + + + + + + + + = + + + = + + + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-jbosscache-config-exoloader_db1_ws2.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-jbosscache-config-exoloader_db1_ws3.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws3.xml (re= v 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1_ws3.xml 2009-11-23 11:43:27 UTC (re= v 806) @@ -0,0 +1,80 @@ + + + + + + + + = + + + = + + + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-jbosscache-config-exoloader_db1_ws3.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-jbosscache-config-exoloader_db1tck_ws.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1tck_ws.xml (= rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1tck_ws.xml 2009-11-23 11:43:27 UTC (= rev 806) @@ -0,0 +1,84 @@ + + + + + + + + = + + + = + + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + = + = + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-jbosscache-config-exoloader_db1tck_ws.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-jbosscache-config-exoloader_db1tck_ws1.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1tck_ws1.xml = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1tck_ws1.xml 2009-11-23 11:43:27 UTC = (rev 806) @@ -0,0 +1,84 @@ + + + + + + + + = + + + = + + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + = + = + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-jbosscache-config-exoloader_db1tck_ws1.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/stand= alone/test-jbosscache-config-exoloader_db1tck_ws2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1tck_ws2.xml = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jbosscache-config-exoloader_db1tck_ws2.xml 2009-11-23 11:43:27 UTC = (rev 806) @@ -0,0 +1,84 @@ + + + + + + + + = + + + = + + + = + + + + + + + + + + + + + + + + + + + = + + + = + + + + = + = + = + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/resour= ces/conf/standalone/test-jbosscache-config-exoloader_db1tck_ws2.xml ___________________________________________________________________ Name: svn:eol-style + native Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jcr-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-23 11:41:40 UTC (rev 805) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config.xml 2009-11-23 11:43:27 UTC (rev 806) @@ -32,7 +32,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -115,7 +115,7 @@ - + @@ -153,7 +153,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -278,7 +278,7 @@ - + @@ -319,7 +319,7 @@ - + --===============3097629729891457871==-- From do-not-reply at jboss.org Mon Nov 23 08:24:28 2009 Content-Type: multipart/mixed; boundary="===============2598717371254372562==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r807 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc. Date: Mon, 23 Nov 2009 08:24:28 -0500 Message-ID: <200911231324.nANDOSuP001061@svn01.web.mwc.hst.phx2.redhat.com> --===============2598717371254372562== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-23 08:24:28 -0500 (Mon, 23 Nov 2009) New Revision: 807 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java Log: EXOJCR-203 : Fix in JDBCStorageConnection - convert internal id to identifi= er. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-23 11:43:27= UTC (rev 806) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-23 13:24:28= UTC (rev 807) @@ -2209,7 +2209,7 @@ ResultSet prop =3D findChildPropertiesIdNameByParentIdentifier(ge= tInternalId(parentId)); while (prop.next()) { - children.add(new PropertyDataInfo(prop.getString(COLUMN_ID), p= rop.getString(COLUMN_NAME))); + children.add(new PropertyDataInfo(prop.getString(COLUMN_ID), g= etIdentifier(prop.getString(COLUMN_NAME)))); } = return children; @@ -2279,7 +2279,7 @@ while (node.next()) { String propId =3D node.getString(COLUMN_ID); - if (!childrens.add(propId)) + if (!childrens.add(getIdentifier(propId))) { throw new RepositoryException("FATAL Property id dublicated= " + propId); } @@ -2304,7 +2304,7 @@ while (node.next()) { String nodeId =3D node.getString(COLUMN_ID); //"NODE_ID");// - childrens.add(nodeId); + childrens.add(getIdentifier(nodeId)); } = return childrens; @@ -2334,7 +2334,7 @@ while (node.next()) { String nodeId =3D node.getString(COLUMN_ID); - if (!childrens.add(nodeId)) + if (!childrens.add(getIdentifier(nodeId))) { throw new RepositoryException("FATAL Node id dublicated " += nodeId); } --===============2598717371254372562==-- From do-not-reply at jboss.org Mon Nov 23 08:32:27 2009 Content-Type: multipart/mixed; boundary="===============0063068180342557094==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r808 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc. Date: Mon, 23 Nov 2009 08:32:27 -0500 Message-ID: <200911231332.nANDWROm003168@svn01.web.mwc.hst.phx2.redhat.com> --===============0063068180342557094== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-23 08:32:26 -0500 (Mon, 23 Nov 2009) New Revision: 808 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java Log: EXOJCR-203 : Fix in JDBCStorageConnection - convert internal id to identifi= er. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-23 13:24:28= UTC (rev 807) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-23 13:32:26= UTC (rev 808) @@ -2052,7 +2052,7 @@ ResultSet item =3D findNodeIdentifier(getInternalId(parentId), na= me, index); if (item.next()) { - return item.getString(COLUMN_ID); + return getIdentifier(item.getString(COLUMN_ID)); } } catch (SQLException e) @@ -2084,7 +2084,7 @@ ResultSet item =3D findPropertyIdentifier(getInternalId(parentId)= , name); if (item.next()) { - return item.getString(COLUMN_ID); + return getIdentifier(item.getString(COLUMN_ID)); } } catch (SQLException e) @@ -2209,7 +2209,7 @@ ResultSet prop =3D findChildPropertiesIdNameByParentIdentifier(ge= tInternalId(parentId)); while (prop.next()) { - children.add(new PropertyDataInfo(prop.getString(COLUMN_ID), g= etIdentifier(prop.getString(COLUMN_NAME)))); + children.add(new PropertyDataInfo(getIdentifier(prop.getString= (COLUMN_ID)), prop.getString(COLUMN_NAME))); } = return children; --===============0063068180342557094==-- From do-not-reply at jboss.org Mon Nov 23 08:46:17 2009 Content-Type: multipart/mixed; boundary="===============7677093365045934717==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r809 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 23 Nov 2009 08:46:17 -0500 Message-ID: <200911231346.nANDkHuJ005477@svn01.web.mwc.hst.phx2.redhat.com> --===============7677093365045934717== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-23 08:46:17 -0500 (Mon, 23 Nov 2009) New Revision: 809 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-246: JBossCacheStorageConnection updateProperty fixed Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 13:32:26 UTC (rev 808) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 13:46:17 UTC (rev 809) @@ -334,19 +334,19 @@ + data.getQPath().getAsString()); } = - if (data.getType() =3D=3D PropertyType.REFERENCE) + Fqn propUUID =3D makePropFqn(data.getIdentifier()); + + Node prop =3D propsRoot.getChild(propUUID); + PropertyData oldData =3D (PropertyData)prop.get(ITEM_DATA); + if (oldData =3D=3D null) { + throw new RepositoryException("FATAL PropertyData already empty "= + data.getQPath().getAsString()); + } + + if (oldData.getType() =3D=3D PropertyType.REFERENCE) + { // get values from cahce = - Fqn propUUID =3D makeNodeFqn(data.getIdentifier()); - - Node prop =3D propsRoot.getChild(propUUID); - PropertyData oldData =3D (PropertyData)prop.get(ITEM_DATA); - if (oldData =3D=3D null) - { - throw new RepositoryException("FATAL PropertyData already empt= y " + data.getQPath().getAsString()); - } - for (ValueData value : oldData.getValues()) { = @@ -869,52 +869,61 @@ throw new IllegalStateException("Property was deleted " + data.ge= tQPath().getAsString()); } = - if (data.getType() =3D=3D PropertyType.REFERENCE) + // get old PropertyData + prop.get(ITEM_DATA); + PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); + if (propData =3D=3D null) { - PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); - if (propData =3D=3D null) - { - throw new RepositoryException("FATAL Property data is null. Pa= rent " + data.getQPath().getAsString()); - } + throw new RepositoryException("FATAL Old Property data is null. P= arent " + data.getQPath().getAsString()); + } = + if (propData.getType() =3D=3D PropertyType.REFERENCE || data.getType= () =3D=3D PropertyType.REFERENCE) + { + //get Set of old values Set removeSet =3D new HashSet(); - for (ValueData value : propData.getValues()) + if (propData.getType() =3D=3D PropertyType.REFERENCE) { - try + for (ValueData value : propData.getValues()) { - removeSet.add(ValueDataConvertor.readString(value)); + try + { + removeSet.add(ValueDataConvertor.readString(value)); + } + catch (UnsupportedEncodingException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } } - catch (UnsupportedEncodingException e) - { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); - } - catch (IOException e) - { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); - } } = + // check new Set addSet =3D new HashSet(); - // check new = - for (ValueData value : data.getValues()) + if (data.getType() =3D=3D PropertyType.REFERENCE) { - try + for (ValueData value : data.getValues()) { - addSet.add(ValueDataConvertor.readString(value)); + try + { + addSet.add(ValueDataConvertor.readString(value)); + } + catch (UnsupportedEncodingException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } + catch (IOException e) + { + // TODO Auto-generated catch block + throw new RepositoryException(e.getMessage(), e); + } } - catch (UnsupportedEncodingException e) - { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); - } - catch (IOException e) - { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); - } } = String[] added =3D new String[addSet.size()]; --===============7677093365045934717==-- From do-not-reply at jboss.org Mon Nov 23 09:29:50 2009 Content-Type: multipart/mixed; boundary="===============7602491046282754398==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r810 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Mon, 23 Nov 2009 09:29:50 -0500 Message-ID: <200911231429.nANETogD012215@svn01.web.mwc.hst.phx2.redhat.com> --===============7602491046282754398== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-23 09:29:49 -0500 (Mon, 23 Nov 2009) New Revision: 810 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java Log: EXOJCR-200: impl of getItemData by Id for version manager Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.j= ava =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 20= 09-11-23 13:46:17 UTC (rev 809) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 20= 09-11-23 14:29:49 UTC (rev 810) @@ -118,41 +118,41 @@ return super.getItemData(parentData, name); } = - // /** - // * {@inheritDoc} - // */ - // public ItemData getItemData(String identifier) throws RepositoryEx= ception - // { - // // from cache at first - // ItemData cdata =3D persistentManager.getCachedItemData(identifi= er); - // if (cdata !=3D null) - // return super.getItemData(identifier); - // - // if (!this.equals(versionDataManager) && !identifier.equals(Cons= tants.ROOT_UUID)) - // { - // // search in System cache for /jcr:system nodes only - // cdata =3D versionDataManager.persistentManager.getCachedItem= Data(identifier); - // if (cdata !=3D null) - // if (isSystemDescendant(cdata.getQPath())) - // return versionDataManager.getItemData(identifier); - // else - // return null; - // } - // - // // then from persistence - // ItemData data =3D super.getItemData(identifier); - // if (data !=3D null) - // return data; - // else if (!this.equals(versionDataManager)) - // { - // // try from version storage if not the same - // data =3D versionDataManager.getItemData(identifier); - // if (data !=3D null && isSystemDescendant(data.getQPath())) - // return data; - // } - // return null; - // } + /** + * {@inheritDoc} + */ + public ItemData getItemData(String identifier) throws RepositoryExcepti= on + { +// // from cache at first +// ItemData cdata =3D persistentManager.getCachedItemData(identifier); +// if (cdata !=3D null) +// return super.getItemData(identifier); +// +// if (!this.equals(versionDataManager) && !identifier.equals(Constan= ts.ROOT_UUID)) +// { +// // search in System cache for /jcr:system nodes only +// cdata =3D versionDataManager.persistentManager.getCachedItemDat= a(identifier); +// if (cdata !=3D null) +// if (isSystemDescendant(cdata.getQPath())) +// return versionDataManager.getItemData(identifier); +// else +// return null; +// } = + // then from persistence + ItemData data =3D super.getItemData(identifier); + if (data !=3D null) + return data; + else if (!this.equals(versionDataManager)) + { + // try from version storage if not the same + data =3D versionDataManager.getItemData(identifier); + if (data !=3D null && isSystemDescendant(data.getQPath())) + return data; + } + return null; + } + public void save(CompositeChangesLog changesLog) throws RepositoryExcep= tion, InvalidItemStateException { = --===============7602491046282754398==-- From do-not-reply at jboss.org Mon Nov 23 09:43:39 2009 Content-Type: multipart/mixed; boundary="===============0225196808488686108==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r811 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 23 Nov 2009 09:43:39 -0500 Message-ID: <200911231443.nANEhdd0014624@svn01.web.mwc.hst.phx2.redhat.com> --===============0225196808488686108== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-23 09:43:39 -0500 (Mon, 23 Nov 2009) New Revision: 811 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java Log: EXOJCR-203 : To JBossCacheStorageConnectionLockTest was added use case with= cache restart. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTes= t.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java= 2009-11-23 14:29:49 UTC (rev 810) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnectionLockTest.java= 2009-11-23 14:43:39 UTC (rev 811) @@ -18,7 +18,14 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockData; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.util.IdGenerator; = import java.util.List; = @@ -99,4 +106,39 @@ locks =3D conn.getLocksData(); assertEquals(count, locks.size()); } + = + public void testCheckLockAfterRestart() throws Exception + { + // add root (/) + initJCRRoot(); + = + // add node (/node) + String node1id =3D IdGenerator.generate(); + QPath node1path =3D QPath.parse("[]:1[]node:1"); + conn.add(new TransientNodeData(node1path, node1id, 1, Constants.NT_U= NSTRUCTURED, new InternalQName[0], 0, + Constants.ROOT_UUID, new AccessControlList())); + = + PropertyData primaryType =3D + createProperty(node1path, node1id, Constants.JCR_PRIMARYTYPE, Con= stants.NT_UNSTRUCTURED, false); + conn.add(primaryType); + conn.commit(); + = + // add lock to node '/node' = + LockData lockData =3D new LockData(node1id, "token's hash", true, fa= lse, "owner", 10000); + conn.addLockData(lockData); + assertEquals(lockData.getTokenHash(), conn.getLockData(node1id).getT= okenHash()); + = + // stop cache + cache.stop(); + cache.destroy(); + = + // start cache + super.setUp(); + = + // check + // after restart the lock should be removed. + //TODO should be removed fail after created locks persistent. + fail("This fail should be removed after created locks persistent."); + assertNull(conn.getLockData(node1id)); + } } --===============0225196808488686108==-- From do-not-reply at jboss.org Mon Nov 23 10:07:11 2009 Content-Type: multipart/mixed; boundary="===============3420677562762426418==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r812 - in jcr/branches/1.12.0-JBC/component/core/src: test/java/org/exoplatform/services/jcr/api/writing and 1 other directories. Date: Mon, 23 Nov 2009 10:07:11 -0500 Message-ID: <200911231507.nANF7B6F018529@svn01.web.mwc.hst.phx2.redhat.com> --===============3420677562762426418== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-23 10:07:10 -0500 (Mon, 23 Nov 2009) New Revision: 812 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/usecases/TestGetReference.java Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/writing/TestNodeReference.java Log: EXOJCR-246: TestGetReference added. TestNodeReference updated. JBossCacheSt= orageConnection fix Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 14:43:39 UTC (rev 811) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 15:07:10 UTC (rev 812) @@ -347,13 +347,14 @@ { // get values from cahce = + Set remNodes =3D new HashSet(); + for (ValueData value : oldData.getValues()) { = - String refNodeUUID; try { - refNodeUUID =3D ValueDataConvertor.readString(value); + remNodes.add(ValueDataConvertor.readString(value)); } catch (UnsupportedEncodingException e) { @@ -365,18 +366,28 @@ // TODO Auto-generated catch block throw new RepositoryException(e.getMessage(), e); } + } = + for (String refNodeUUID : remNodes) + { // remove property from referencedNode in $REFS map = Node refParent =3D refsRoot.getChild(mak= eNodeFqn(refNodeUUID)); if (refParent !=3D null) { - refParent.removeChild(propUUID); + if (!refParent.removeChild(propUUID)) + { + throw new RepositoryException("FATAL Reference property = was not removed from REFS table of node " + + refNodeUUID); + + } // check is there is no more references if (refParent.getChildrenNames().size() =3D=3D 0) { - //TODO remove children - refsRoot.removeChild(makeNodeFqn(refNodeUUID)); + if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID))) + { + throw new RepositoryException("FATAL Node record was = node removed from REFS table " + refNodeUUID); + } } } } Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/writing/TestNodeReference.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestNodeReference.java 2009-11-23 14:43:39 UTC (rev = 811) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestNodeReference.java 2009-11-23 15:07:10 UTC (rev = 812) @@ -161,7 +161,7 @@ = log.debug(testNode1.getPath() + " ref >>> " + p.getPath()); } - assertEquals(5, testNode1.getReferences().getSize()); + assertEquals(4, testNode1.getReferences().getSize()); // not 5 be= cause p1_multiple occures onlu once = refs =3D testNode2.getReferences(); if (log.isDebugEnabled()) Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/usecases/TestGetReference.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/usecases/TestGetReference.java (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/usecases/TestGetReference.java 2009-11-23 15:07:10 UTC (rev 812) @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.usecases; + +import org.apache.jackrabbit.test.NotExecutableException; + +import javax.jcr.Node; +import javax.jcr.RepositoryException; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author
Karpenko Sergiy = + * @version $Id: TestGetReference.java 111 2008-11-11 11:11:11Z serg $ + */ +public class TestGetReference extends BaseUsecasesTest +{ + + /** + * Tests Property.getNode(); + */ + public void testReferenceTarget() throws RepositoryException, NotExecut= ableException + { + String nodeName1 =3D "node1"; + String nodeName2 =3D "node2"; + String propertyName1 =3D "prop1"; + String testNodeType =3D "nt:unstructured"; + + Node n1 =3D root.addNode(nodeName1, testNodeType); + n1.addMixin("mix:referenceable"); + + // with some impls. the mixin type has only affect upon save + root.save(); + + // make sure the node is now referenceable + assertTrue("test node should be mix:referenceable", n1.isNodeType("m= ix:referenceable")); + + // create references: n2.p1 -> n1 + Node n2 =3D root.addNode(nodeName2, testNodeType); + + n2.setProperty(propertyName1, n1); + root.save(); + assertEquals("Wrong reference target.", n2.getProperty(propertyName1= ).getNode(), n1); + n2.remove(); + root.save(); + + assertTrue(n1.getReferences().getSize() =3D=3D 0); + } + +} --===============3420677562762426418==-- From do-not-reply at jboss.org Mon Nov 23 12:05:28 2009 Content-Type: multipart/mixed; boundary="===============2156282071794552236==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r813 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 23 Nov 2009 12:05:27 -0500 Message-ID: <200911231705.nANH5RMe012077@svn01.web.mwc.hst.phx2.redhat.com> --===============2156282071794552236== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-23 12:05:27 -0500 (Mon, 23 Nov 2009) New Revision: 813 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-246: JBossCacheStorageConnection remove references fixed Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 15:07:10 UTC (rev 812) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 17:05:27 UTC (rev 813) @@ -371,29 +371,44 @@ for (String refNodeUUID : remNodes) { // remove property from referencedNode in $REFS map + Node refParent =3D refsRoot.getChild(mak= eNodeFqn(refNodeUUID)); = - Node refParent =3D refsRoot.getChild(mak= eNodeFqn(refNodeUUID)); if (refParent !=3D null) { - if (!refParent.removeChild(propUUID)) + if (refParent.hasChild(propUUID)) { - throw new RepositoryException("FATAL Reference property = was not removed from REFS table of node " - + refNodeUUID); + // do we need remove node record also + boolean removeParent =3D (refParent.getChildrenNames().s= ize() =3D=3D 1); = - } - // check is there is no more references - if (refParent.getChildrenNames().size() =3D=3D 0) - { - if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID))) + if (!refParent.removeChild(propUUID)) { - throw new RepositoryException("FATAL Node record was = node removed from REFS table " + refNodeUUID); + throw new RepositoryException("FATAL Reference proper= ty was not removed from REFS table of node " + + refNodeUUID); } + + if (removeParent) + { + if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID))) + { + throw new RepositoryException("FATAL Node record w= as node removed from REFS table " + + refNodeUUID); + } + } } + else + { + LOG.warn("Property reference " + data.getIdentifier() + = " to node " + refNodeUUID + + " was already removed."); + } } + else + { + LOG.warn("Reference record of node " + refNodeUUID + " was = already removed."); + } } } = - // remove from parent's properties attr + // remove from parent's properties attributes // TODO validate does deleted if (parent.remove(data.getQPath().getName().getAsString()) =3D=3D nu= ll) { @@ -1059,6 +1074,11 @@ } } = + private void removePropertyReferenceToNode(String nodeId, Fqn propFqn) + { + + } + /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) */ --===============2156282071794552236==-- From do-not-reply at jboss.org Mon Nov 23 12:09:13 2009 Content-Type: multipart/mixed; boundary="===============3483550562505766612==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r814 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: dataflow and 2 other directories. Date: Mon, 23 Nov 2009 12:09:13 -0500 Message-ID: <200911231709.nANH9D92013411@svn01.web.mwc.hst.phx2.redhat.com> --===============3483550562505766612== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-23 12:09:12 -0500 (Mon, 23 Nov 2009) New Revision: 814 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/NodeImpl.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/TransientItemData.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-245: node move new impl. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java 2009-11-23 17:05:27 UTC (rev 813) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java 2009-11-23 17:09:12 UTC (rev 814) @@ -29,7 +29,6 @@ import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; import org.exoplatform.services.jcr.datamodel.Identifier; @@ -58,7 +57,6 @@ import org.exoplatform.services.jcr.impl.dataflow.session.SessionChangesLo= g; import org.exoplatform.services.jcr.impl.dataflow.session.TransactionableD= ataManager; import org.exoplatform.services.jcr.impl.util.EntityCollection; -import org.exoplatform.services.jcr.observation.ExtendedEvent; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/TransientItemData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TransientItemData.java 2009-11-23 17:05:27 UTC (re= v 813) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TransientItemData.java 2009-11-23 17:09:12 UTC (re= v 814) @@ -41,6 +41,26 @@ public abstract class TransientItemData implements MutableItemData, Extern= alizable { = + /** + * Transitive state: is not set. + */ + public static final int TRANSITIVE_NONE =3D 0; + = + /** + * Transitive state: Item path updated. + */ + public static final int TRANSITIVE_PATH_UPDATED =3D 1; + = + /** + * Transitive state: Node mixin updated. + */ + public static final int TRANSITIVE_MIXIN_UPDATED =3D 2; + = + /** + * Transitive state: Node ACL updated. + */ + public static final int TRANSITIVE_ACL_UPDATED =3D 4; + = protected static final Log LOG =3D ExoLogger.getLogger("jcr.TransientIt= emData"); = protected String identifier; @@ -49,18 +69,28 @@ = protected int persistedVersion; = + /** + * For transitive state storing. Used in JBossCache. + */ + protected int state =3D TRANSITIVE_NONE; + protected QPath qpath; = private int NOT_NULL_VALUE =3D 1; = private int NULL_VALUE =3D -1; = - // serializable -------------- + /** + * Serializable TransientItemData constructor. + * + */ TransientItemData() { } = /** + * TransientItemData contructor. + * = * @param path QPath * @param identifier id * @param version persisted version @@ -74,10 +104,8 @@ this.persistedVersion =3D version; } = - /* - * (non-Javadoc) - * = - * @see java.lang.Object#equals(java.lang.Object) + /** + * {@inheritDoc} */ @Override public boolean equals(Object obj) @@ -97,30 +125,24 @@ return false; } = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.datamodel.ItemData#getIdentifier() + /** + * {@inheritDoc} */ public String getIdentifier() { return identifier; } = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.datamodel.ItemData#getParentUUID() + /** + * {@inheritDoc} */ public String getParentIdentifier() { return parentIdentifier; } = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.datamodel.ItemData#getPersistedVer= sion() + /** + * {@inheritDoc} */ public int getPersistedVersion() { @@ -135,26 +157,52 @@ return qpath.getName(); } = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.datamodel.ItemData#getQPath() + /** + * {@inheritDoc} */ public QPath getQPath() { return qpath; } = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.datamodel.MutableItemData#increase= PersistedVersion() + /** + * {@inheritDoc} */ public void increasePersistedVersion() { this.persistedVersion++; } = + /** + * Return transitive state. Used in JBossCache. + * = + * @return the state + */ + public int getState() + { + return state; + } + + /** + * Set transitive state. Used in JBossCache. + * = + * @param state the state to set + */ + public void setState(int state) + { + this.state =3D state; + } + + /** + * Add transitive state to existing one using OR operation. Used in JBo= ssCache. + * = + * @param state the state to add to existing + */ + public void addState(int state) + { + this.state =3D this.state | state; + } + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException { byte[] buf; @@ -195,6 +243,8 @@ } = persistedVersion =3D in.readInt(); + + state =3D in.readInt(); } = public void writeExternal(ObjectOutput out) throws IOException @@ -216,6 +266,8 @@ out.writeInt(NULL_VALUE); = out.writeInt(persistedVersion); + + out.writeInt(state); } = } Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-23 17:05:27 UTC (rev 813) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-23 17:09:12 UTC (rev 814) @@ -72,7 +72,7 @@ if (readOnly && !(changesLog instanceof ReadOnlyThroughChanges)) throw new ReadOnlyWorkspaceException("Workspace container '" + da= taContainer.getName() + "' is read-only."); = - final Set addedNodes =3D new HashSet(); + final Set addedNodes =3D new HashSet(); //TODO LOG.inf= o(changesLog.dump()); = WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 17:05:27 UTC (rev 813) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 17:09:12 UTC (rev 814) @@ -21,9 +21,12 @@ import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.core.lock.LockData; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; +import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.ValueDataConvertor; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -91,7 +94,7 @@ = // helpers @Deprecated - protected NodeData getNodeData(Node node) + protected ItemData readItemData(Node node) { Object data =3D node.get(ITEM_DATA); if (data !=3D null) @@ -110,7 +113,7 @@ Object freshData =3D freshNode.get(ITEM_DATA); if (freshData !=3D null) { - return (NodeData)freshData; + return (ItemData)freshData; } else { @@ -126,7 +129,7 @@ } else { - return (NodeData)data; + return (ItemData)data; } } else @@ -451,6 +454,7 @@ throw new RepositoryException("FATAL Node record not found(= " + nodeId + "), but listed in child nodes of " + parent.getQPath()= .getAsString()); } + NodeData nodeData =3D (NodeData)node.get(ITEM_DATA); if (nodeData =3D=3D null) { @@ -474,6 +478,11 @@ return childs; } = + /** + * Print tree of given node. For dev purpose only (TODO). + * + * @param node Node + */ private void treePrint(Node node) { for (Node child : node.getChildren()) @@ -550,7 +559,7 @@ */ public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException, IllegalStateException { - // TODO it's same as getChild... now + // TODO it's same as getChild... now, but should be without ValueData return getChildPropertiesData(parent); } = @@ -571,10 +580,10 @@ Node node =3D nodesRoot.getChild(makeNod= eFqn(nodeId)); if (node !=3D null) { - Object itemData =3D node.get(ITEM_DATA); + NodeData itemData =3D (NodeData)node.get(ITEM_DATA); if (itemData !=3D null) { - return (NodeData)itemData; + return itemData; } else { @@ -650,10 +659,10 @@ Node node =3D nodesRoot.getChild(makeNodeFqn(i= dentifier)); if (node !=3D null) { - Object itemData =3D node.get(ITEM_DATA); + NodeData itemData =3D (NodeData)node.get(ITEM_DATA); if (itemData !=3D null) { - return (NodeData)itemData; + return itemData; } else { @@ -724,57 +733,60 @@ { //TODO we expecting that on session.move() there will be only one re= name() method call = - // startBatch(); - // - // String nodeId =3D data.getIdentifier(); - // - // //1. Update renamed node and also get old nodeData - // Node node =3D nodesRoot.getChild(makeN= odeFqn(nodeId)); - // if (node =3D=3D null) - // { - // throw new InvalidItemStateException("Renamed node is not = exist" + data.getQPath().getAsString()); - // } - // - // NodeData prevData =3D (NodeData)node.put(ITEM_DATA, data); - // if (prevData =3D=3D null) - // { - // throw new RepositoryException("FATAL NodeData is empty " = + data.getQPath().getAsString()); - // } - // - // // 2. remove renamed node from child list of previous parent= node - // // check if parent is cached - // Node prevParent =3D nodesRoot.getChild= (makeNodeFqn(prevData.getParentIdentifier())); - // if (prevParent =3D=3D null) - // { - // throw new InvalidItemStateException("Node's previous pare= nt doesn't exist " - // + prevData.getQPath().getAsString() + ". Node " + data= .getQPath().getAsString()); - // } - // - // // remove node form old parent child list - // if (!prevParent - // .removeChild(makeChildNodeFqn(prevData.getQPath().getEntr= ies()[prevData.getQPath().getEntries().length - 1]))) - // { - // throw new RepositoryException("FATAL Node doesn't listed = in children nodes of previous parent " - // + prevData.getQPath().getAsString() + ". Node " + data= .getQPath().getAsString()); - // } - // - // // 3. add node to child list of new parent node - // // check if parent is cached - // Node newParent =3D nodesRoot.getChild(= makeNodeFqn(data.getParentIdentifier())); - // if (newParent =3D=3D null) - // { - // throw new InvalidItemStateException("Node's new parent do= esn't exist " + data.getParentIdentifier() - // + ". Node " + data.getQPath().getAsString()); - // } - // - // // add child to Parent = - // Node childNode =3D - // newParent.addChild(makeChildNodeFqn(data.getQPath().getEn= tries()[data.getQPath().getEntries().length - 1])); - // - // // set child id attr = - // childNode.put(ITEM_ID, data.getIdentifier()); - // - // // 4. update all child nodes + startBatch(); + + String nodeId =3D data.getIdentifier(); + + //1. Update renamed node and also get old nodeData + Node node =3D nodesRoot.getChild(makeNodeFqn(n= odeId)); + if (node =3D=3D null) + { + throw new InvalidItemStateException("Renamed node is not exist" += data.getQPath().getAsString()); + } + + NodeData prevData =3D (NodeData)node.put(ITEM_DATA, data); + if (prevData =3D=3D null) + { + throw new RepositoryException("FATAL NodeData is empty " + data.g= etQPath().getAsString()); + } + + // 2. remove renamed node from child list of previous parent node + // check if parent is cached + Node prevParent =3D nodesRoot.getChild(makeNod= eFqn(prevData.getParentIdentifier())); + if (prevParent =3D=3D null) + { + throw new InvalidItemStateException("Node's previous parent doesn= 't exist " + + prevData.getQPath().getAsString() + ". Node " + data.getQPat= h().getAsString()); + } + + // remove node form old parent child list + if (!prevParent + .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[pr= evData.getQPath().getEntries().length - 1]))) + { + throw new RepositoryException("FATAL Node doesn't listed in child= ren nodes of previous parent " + + prevData.getQPath().getAsString() + ". Node " + data.getQPat= h().getAsString()); + } + + // 3. add node to child list of new parent node + // check if parent is cached + Node newParent =3D nodesRoot.getChild(makeNode= Fqn(data.getParentIdentifier())); + if (newParent =3D=3D null) + { + throw new InvalidItemStateException("Node's new parent doesn't ex= ist " + data.getParentIdentifier() + + ". Node " + data.getQPath().getAsString()); + } + + // add child to Parent = + Node childNode =3D + newParent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[= data.getQPath().getEntries().length - 1])); + + // set child id attr = + childNode.put(ITEM_ID, data.getIdentifier()); + + // 4. update all child nodes + updateTreePath(node, data.getQPath());//treePrint(node) + + // TODO cleanup // for (Node child : node.getChildren()) // { // String childNodeId =3D (String)child.get(ITEM_ID); @@ -809,6 +821,123 @@ } = /** + * Update Nodes tree with new path. + * + * @param node Node - cache node containing root of JCR subtree. = + * @throws RepositoryException on error state detected + */ + protected void updateTreePath(Node node, QPath ro= otPath) + throws RepositoryException + { + QPath nodePath =3D rootPath; + + // update path of properties + for (Object key : node.getKeys()) + { + if (key.equals(ITEM_DATA)) + { + NodeData prevData =3D (NodeData)node.get(ITEM_DATA); + if (prevData =3D=3D null) + { + throw new RepositoryException("FATAL Node data " + rootPath= + " is empty at " + node.getFqn()); + } + + if (!prevData.getQPath().equals(nodePath)) + { + // recreate with new path for child Nodes only + nodePath =3D + QPath.makeChildPath(rootPath, prevData.getQPath().getEnt= ries()[prevData.getQPath() + .getEntries().length - 1]); + TransientNodeData newData =3D + new TransientNodeData(nodePath, prevData.getIdentifier()= , prevData.getPersistedVersion(), + prevData.getPrimaryTypeName(), prevData.getMixinTypeN= ames(), prevData + .getOrderNumber(), prevData.getParentIdentifier(),= prevData.getACL()); + newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDA= TED); + node.put(ITEM_DATA, newData); + } + } + else + { + // property + String propId =3D (String)node.get((String)key); + if (propId !=3D null) + { + Node prop =3D propsRoot.getChild(Fqn.= fromElements(propId)); + if (prop =3D=3D null) + { + throw new IllegalStateException("Property not exists or = was deleted by another Session " + rootPath + + key); + } + + // get prev PropertyData + PropertyData prevData =3D (PropertyData)prop.get(ITEM_DATA); + if (prevData =3D=3D null) + { + throw new RepositoryException("FATAL Property data is em= pty " + rootPath + key); + } + + // recreate the property data with new path + QPath newPath =3D + QPath.makeChildPath(rootPath, prevData.getQPath().getEnt= ries()[prevData.getQPath() + .getEntries().length - 1]); + TransientPropertyData newData =3D + new TransientPropertyData(newPath, prevData.getIdentifie= r(), prevData.getPersistedVersion(), + prevData.getType(), prevData.getParentIdentifier(), p= revData.isMultiValued()); + newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDA= TED); + newData.setValues(prevData.getValues()); + prop.put(ITEM_DATA, newData); + } + else + { + throw new RepositoryException("FATAL Property extists but I= TEM_ID is empty " + node.getFqn() + + ". Update of " + rootPath); + } + } + } + + if (nodePath =3D=3D null) + { + throw new RepositoryException("FATAL Broken JCR Nodes tree. Node'= s ITEM_DATA was not found at " + + node.getFqn() + ". Update of " + rootPath); + } + + // update path of child nodes + for (Node child : node.getChildren()) + { + String childNodeId =3D (String)child.get(ITEM_ID); + if (childNodeId =3D=3D null) + { + throw new RepositoryException("FATAL Child Node Id key is null= . Parent " + rootPath); + } + + Node childNode =3D nodesRoot.getChild(makeN= odeFqn(childNodeId)); + if (childNode =3D=3D null) + { + throw new RepositoryException("FATAL Node record not found (" = + childNodeId + "), but listed in childs of " + + rootPath); + } + + updateTreePath(childNode, nodePath); + + // TODO cleanup + // NodeData cacheNodeData =3D (NodeData)childNode.get(ITE= M_DATA); + // if (cacheNodeData =3D=3D null) + // { + // throw new RepositoryException("Child node data is n= ull. Parent " + rootPath); + // } + // + // // recreate child Node with new path + // QPath newPath =3D QPath.makeChildPath(rootPath, cacheN= odeData.getQPath().getName()); + // TransientNodeData newNodeData =3D + // new TransientNodeData(newPath, cacheNodeData.getIde= ntifier(), cacheNodeData.getPersistedVersion(), + // cacheNodeData.getPrimaryTypeName(), cacheNodeDat= a.getMixinTypeNames(), cacheNodeData.getOrderNumber(), + // cacheNodeData.getParentIdentifier(), cacheNodeDa= ta.getACL()); + // newNodeData.addState(TransientPropertyData.TRANSITIVE_= PATH_UPDATED); + // childNode.put(ITEM_DATA, newNodeData); + } + } + + /** * {@inheritDoc} */ public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, @@ -886,7 +1015,7 @@ { startBatch(); = - Fqn propFqn =3D Fqn.fromElements(data.getIdentifier()); + final Fqn propFqn =3D Fqn.fromElements(data.getIdentifier()); = // update in PROPERTIES Node prop =3D propsRoot.getChild(propFqn); @@ -895,22 +1024,21 @@ throw new IllegalStateException("Property was deleted " + data.ge= tQPath().getAsString()); } = - // get old PropertyData - prop.get(ITEM_DATA); - PropertyData propData =3D (PropertyData)prop.get(ITEM_DATA); - if (propData =3D=3D null) + // get prev PropertyData + PropertyData prevData =3D (PropertyData)prop.get(ITEM_DATA); + if (prevData =3D=3D null) { throw new RepositoryException("FATAL Old Property data is null. P= arent " + data.getQPath().getAsString()); } = - if (propData.getType() =3D=3D PropertyType.REFERENCE || data.getType= () =3D=3D PropertyType.REFERENCE) + if (prevData.getType() =3D=3D PropertyType.REFERENCE || data.getType= () =3D=3D PropertyType.REFERENCE) { = //get Set of old values Set removeSet =3D new HashSet(); - if (propData.getType() =3D=3D PropertyType.REFERENCE) + if (prevData.getType() =3D=3D PropertyType.REFERENCE) { - for (ValueData value : propData.getValues()) + for (ValueData value : prevData.getValues()) { try { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 17:05:27= UTC (rev 813) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-23 17:09:12= UTC (rev 814) @@ -23,6 +23,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.impl.storage.jdbc.PropertyDataInfo; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; @@ -272,20 +273,30 @@ private void doUpdate(Modification modification, WorkspaceStorageConnec= tion conn) throws IllegalStateException, RepositoryException { - if (modification.getValue() instanceof NodeData) + if (modification.getValue() instanceof ItemData) { - //update node data - NodeData nodeData =3D (NodeData)modification.getValue(); + TransientItemData item =3D (TransientItemData)modification.getVal= ue(); = - conn.update(nodeData); + if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED)= =3D=3D 0) + { + // update if it's non transitive update + if (item.isNode()) + { + //update node data + conn.update((NodeData)item); + } + else + { + //update property data + conn.update((PropertyData)item); + } + } + else + { + // TODO for debug + LOG.info("TRANSITIVE_PATH_UPDATED " + item.getQPath().getAsStr= ing()); + } } - else if (modification.getValue() instanceof PropertyData) - { - //update property data - PropertyData propertyData =3D (PropertyData)modification.getValue= (); - - conn.update(propertyData); - } } = /** --===============3483550562505766612==-- From do-not-reply at jboss.org Tue Nov 24 02:45:22 2009 Content-Type: multipart/mixed; boundary="===============1216219284592075856==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r815 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 24 Nov 2009 02:45:22 -0500 Message-ID: <200911240745.nAO7jM6p027973@svn01.web.mwc.hst.phx2.redhat.com> --===============1216219284592075856== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 02:45:22 -0500 (Tue, 24 Nov 2009) New Revision: 815 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-246: References handling on the end ofoperations Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -23 17:09:12 UTC (rev 814) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 07:45:22 UTC (rev 815) @@ -196,6 +196,22 @@ + data.getQPath().getAsString()); } = + // add to parent's properties attr + String propName =3D data.getQPath().getName().getAsString(); + if (parent.get(propName) =3D=3D null) + { + parent.put(propName, data.getIdentifier()); + } + else + { + throw new ItemExistsException("Property already exists " + data.g= etQPath().getAsString()); + } + + // add in PROPERTIES + Node prop =3D propsRoot.addChild(makePropFqn(d= ata.getIdentifier())); + prop.put(ITEM_DATA, data); + + // REFERENCEs hadnling if (data.getType() =3D=3D PropertyType.REFERENCE) { Fqn propIdentifier =3D Fqn.fromElements(data.getIdentifier()); @@ -210,16 +226,14 @@ } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } catch (IOException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } = - Fqn refNode =3D makeNodeFqn(refNodeUUID); + Fqn refNode =3D makeNodeFqn(refNodeUUID); = // add to $REFS map Node refParent =3D refsRoot.getChild(ref= Node); @@ -230,23 +244,7 @@ = refParent.addChild(propIdentifier); } - - } - - // add to parent's properties attr - String propName =3D data.getQPath().getName().getAsString(); - if (parent.get(propName) =3D=3D null) - { - parent.put(propName, data.getIdentifier()); - } - else - { - throw new ItemExistsException("Property already exists " + data.g= etQPath().getAsString()); - } - - // add in PROPERTIES - Node prop =3D propsRoot.addChild(makePropFqn(d= ata.getIdentifier())); - prop.put(ITEM_DATA, data); + } = } = /** @@ -337,37 +335,49 @@ + data.getQPath().getAsString()); } = - Fqn propUUID =3D makePropFqn(data.getIdentifier()); + Fqn propUUID =3D makePropFqn(data.getIdentifier()); = Node prop =3D propsRoot.getChild(propUUID); - PropertyData oldData =3D (PropertyData)prop.get(ITEM_DATA); - if (oldData =3D=3D null) + PropertyData prevData =3D (PropertyData)prop.get(ITEM_DATA); + if (prevData =3D=3D null) { throw new RepositoryException("FATAL PropertyData already empty "= + data.getQPath().getAsString()); } = - if (oldData.getType() =3D=3D PropertyType.REFERENCE) + // remove from parent's properties attributes + // TODO validate does deleted + if (parent.remove(data.getQPath().getName().getAsString()) =3D=3D nu= ll) { + throw new InvalidItemStateException("Property doesn't exist or de= leted by another Session " + + data.getQPath().getAsString()); + } + + // remove from PROPERTIES + if (!propsRoot.removeChild(makePropFqn(data.getIdentifier()))) + { + LOG.warn("Property want not deleted " + data.getQPath().getAsStri= ng()); + } + = + // REFERENCEs handling + if (prevData.getType() =3D=3D PropertyType.REFERENCE) + { // get values from cahce = Set remNodes =3D new HashSet(); = - for (ValueData value : oldData.getValues()) + for (ValueData value : prevData.getValues()) { - try { remNodes.add(ValueDataConvertor.readString(value)); } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } catch (IOException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } } = @@ -409,21 +419,7 @@ LOG.warn("Reference record of node " + refNodeUUID + " was = already removed."); } } - } - - // remove from parent's properties attributes - // TODO validate does deleted - if (parent.remove(data.getQPath().getName().getAsString()) =3D=3D nu= ll) - { - throw new InvalidItemStateException("Property doesn't exist or de= leted by another Session " - + data.getQPath().getAsString()); - } - - // remove from PROPERTIES - if (!propsRoot.removeChild(makePropFqn(data.getIdentifier()))) - { - LOG.warn("Property want not deleted " + data.getQPath().getAsStri= ng()); - } + } = } = /** @@ -826,8 +822,7 @@ * @param node Node - cache node containing root of JCR subtree. = * @throws RepositoryException on error state detected */ - protected void updateTreePath(Node node, QPath ro= otPath) - throws RepositoryException + protected void updateTreePath(Node node, QPath ro= otPath) throws RepositoryException { QPath nodePath =3D rootPath; = @@ -846,12 +841,12 @@ { // recreate with new path for child Nodes only nodePath =3D - QPath.makeChildPath(rootPath, prevData.getQPath().getEnt= ries()[prevData.getQPath() - .getEntries().length - 1]); + QPath.makeChildPath(rootPath, + prevData.getQPath().getEntries()[prevData.getQPath().= getEntries().length - 1]); TransientNodeData newData =3D - new TransientNodeData(nodePath, prevData.getIdentifier()= , prevData.getPersistedVersion(), - prevData.getPrimaryTypeName(), prevData.getMixinTypeN= ames(), prevData - .getOrderNumber(), prevData.getParentIdentifier(),= prevData.getACL()); + new TransientNodeData(nodePath, prevData.getIdentifier()= , prevData.getPersistedVersion(), prevData + .getPrimaryTypeName(), prevData.getMixinTypeNames(), = prevData.getOrderNumber(), prevData + .getParentIdentifier(), prevData.getACL()); newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDA= TED); node.put(ITEM_DATA, newData); } @@ -878,11 +873,11 @@ = // recreate the property data with new path QPath newPath =3D - QPath.makeChildPath(rootPath, prevData.getQPath().getEnt= ries()[prevData.getQPath() - .getEntries().length - 1]); + QPath.makeChildPath(rootPath, + prevData.getQPath().getEntries()[prevData.getQPath().= getEntries().length - 1]); TransientPropertyData newData =3D - new TransientPropertyData(newPath, prevData.getIdentifie= r(), prevData.getPersistedVersion(), - prevData.getType(), prevData.getParentIdentifier(), p= revData.isMultiValued()); + new TransientPropertyData(newPath, prevData.getIdentifie= r(), prevData.getPersistedVersion(), prevData + .getType(), prevData.getParentIdentifier(), prevData.= isMultiValued()); newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDA= TED); newData.setValues(prevData.getValues()); prop.put(ITEM_DATA, newData); @@ -918,22 +913,6 @@ } = updateTreePath(childNode, nodePath); - - // TODO cleanup - // NodeData cacheNodeData =3D (NodeData)childNode.get(ITE= M_DATA); - // if (cacheNodeData =3D=3D null) - // { - // throw new RepositoryException("Child node data is n= ull. Parent " + rootPath); - // } - // - // // recreate child Node with new path - // QPath newPath =3D QPath.makeChildPath(rootPath, cacheN= odeData.getQPath().getName()); - // TransientNodeData newNodeData =3D - // new TransientNodeData(newPath, cacheNodeData.getIde= ntifier(), cacheNodeData.getPersistedVersion(), - // cacheNodeData.getPrimaryTypeName(), cacheNodeDat= a.getMixinTypeNames(), cacheNodeData.getOrderNumber(), - // cacheNodeData.getParentIdentifier(), cacheNodeDa= ta.getACL()); - // newNodeData.addState(TransientPropertyData.TRANSITIVE_= PATH_UPDATED); - // childNode.put(ITEM_DATA, newNodeData); } } = @@ -1028,13 +1007,16 @@ PropertyData prevData =3D (PropertyData)prop.get(ITEM_DATA); if (prevData =3D=3D null) { - throw new RepositoryException("FATAL Old Property data is null. P= arent " + data.getQPath().getAsString()); + throw new RepositoryException("FATAL Previous Property data is nu= ll. Parent " + data.getQPath().getAsString()); } = + // update data + prop.put(ITEM_DATA, data); + + // REFERENCEs handling if (prevData.getType() =3D=3D PropertyType.REFERENCE || data.getType= () =3D=3D PropertyType.REFERENCE) { - - //get Set of old values + // get Set of old values Set removeSet =3D new HashSet(); if (prevData.getType() =3D=3D PropertyType.REFERENCE) { @@ -1046,13 +1028,11 @@ } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } catch (IOException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } } } @@ -1069,13 +1049,11 @@ } catch (UnsupportedEncodingException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } catch (IOException e) { - // TODO Auto-generated catch block - throw new RepositoryException(e.getMessage(), e); + throw new RepositoryException(e); } } } @@ -1122,9 +1100,6 @@ node.addChild(propFqn); } } - - // remove - prop.put(ITEM_DATA, data); } = /** @@ -1187,7 +1162,7 @@ */ public void close() throws IllegalStateException, RepositoryException { - // TODO Auto-generated method stub + // not actual } = /** --===============1216219284592075856==-- From do-not-reply at jboss.org Tue Nov 24 03:28:08 2009 Content-Type: multipart/mixed; boundary="===============8943256062601992136==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r816 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/core. Date: Tue, 24 Nov 2009 03:28:08 -0500 Message-ID: <200911240828.nAO8S8EQ004501@svn01.web.mwc.hst.phx2.redhat.com> --===============8943256062601992136== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-24 03:28:08 -0500 (Tue, 24 Nov 2009) New Revision: 816 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/TestMoveNode.java Log: EXOJCR-199: added test on node move and then delete Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/core/TestMoveNode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/TestMoveNode.java 2009-11-24 07:45:22 UTC (rev 815) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/TestMoveNode.java 2009-11-24 08:28:08 UTC (rev 816) @@ -30,8 +30,11 @@ import java.util.Random; = import javax.jcr.Node; +import javax.jcr.NodeIterator; import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.nodetype.NodeDefinition; = /** * @author Sergey Kabashn= yuk @@ -114,6 +117,47 @@ assertTrue(node2.isModified()); } = + public void testMoveAndDelete() throws Exception + { + // +TestRoot + // +node1 + // +node11 + // +node2 + + // after move: + + // +TestRoot + // +node1 + // +node2 + // +node11 + + // create structure + Node testRoot =3D root.addNode("TestRoot"); + session.save(); + Node node1 =3D testRoot.addNode("node1"); + Node node2 =3D node1.addNode("node11"); + Node node3 =3D testRoot.addNode("node2"); + session.save(); + + // move + String newPath =3D node3.getPath() + "/" + node2.getName(); + session.move(node2.getPath(), newPath); + session.save(); + + // try to remove /TestRoot + for (NodeIterator children =3D testRoot.getNodes(); children.hasNext= ();) + { + Node child =3D children.nextNode(); + NodeDefinition nodeDef =3D child.getDefinition(); + if (!nodeDef.isMandatory() && !nodeDef.isProtected()) + { + child.remove(); + } + } + session.save(); + + } + public void _testMoveAndRefreshTrue() throws Exception { Node node1 =3D root.addNode("node1"); --===============8943256062601992136==-- From do-not-reply at jboss.org Tue Nov 24 03:44:16 2009 Content-Type: multipart/mixed; boundary="===============7867275456626171264==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r817 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 24 Nov 2009 03:44:16 -0500 Message-ID: <200911240844.nAO8iGm7007013@svn01.web.mwc.hst.phx2.redhat.com> --===============7867275456626171264== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-24 03:44:16 -0500 (Tue, 24 Nov 2009) New Revision: 817 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-246: JBossCacheStorageConnection references fixed Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 08:28:08 UTC (rev 816) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 08:44:16 UTC (rev 817) @@ -214,37 +214,8 @@ // REFERENCEs hadnling if (data.getType() =3D=3D PropertyType.REFERENCE) { - Fqn propIdentifier =3D Fqn.fromElements(data.getIdentifier()); - - for (ValueData value : data.getValues()) - { - - String refNodeUUID; - try - { - refNodeUUID =3D ValueDataConvertor.readString(value); - } - catch (UnsupportedEncodingException e) - { - throw new RepositoryException(e); - } - catch (IOException e) - { - throw new RepositoryException(e); - } - - Fqn refNode =3D makeNodeFqn(refNodeUUID); - - // add to $REFS map - Node refParent =3D refsRoot.getChild(ref= Node); - if (refParent =3D=3D null) - { - refParent =3D refsRoot.addChild(refNode); - } - - refParent.addChild(propIdentifier); - } - } = + addReferences(data); + } } = /** @@ -344,6 +315,12 @@ throw new RepositoryException("FATAL PropertyData already empty "= + data.getQPath().getAsString()); } = + // REFERENCEs handling + if (prevData.getType() =3D=3D PropertyType.REFERENCE) + { + removeReferences(prevData); + } + // remove from parent's properties attributes // TODO validate does deleted if (parent.remove(data.getQPath().getName().getAsString()) =3D=3D nu= ll) @@ -357,69 +334,7 @@ { LOG.warn("Property want not deleted " + data.getQPath().getAsStri= ng()); } - = - // REFERENCEs handling - if (prevData.getType() =3D=3D PropertyType.REFERENCE) - { - // get values from cahce = - Set remNodes =3D new HashSet(); - - for (ValueData value : prevData.getValues()) - { - try - { - remNodes.add(ValueDataConvertor.readString(value)); - } - catch (UnsupportedEncodingException e) - { - throw new RepositoryException(e); - } - catch (IOException e) - { - throw new RepositoryException(e); - } - } - - for (String refNodeUUID : remNodes) - { - // remove property from referencedNode in $REFS map - Node refParent =3D refsRoot.getChild(mak= eNodeFqn(refNodeUUID)); - - if (refParent !=3D null) - { - if (refParent.hasChild(propUUID)) - { - // do we need remove node record also - boolean removeParent =3D (refParent.getChildrenNames().s= ize() =3D=3D 1); - - if (!refParent.removeChild(propUUID)) - { - throw new RepositoryException("FATAL Reference proper= ty was not removed from REFS table of node " - + refNodeUUID); - } - - if (removeParent) - { - if (!refsRoot.removeChild(makeNodeFqn(refNodeUUID))) - { - throw new RepositoryException("FATAL Node record w= as node removed from REFS table " - + refNodeUUID); - } - } - } - else - { - LOG.warn("Property reference " + data.getIdentifier() + = " to node " + refNodeUUID - + " was already removed."); - } - } - else - { - LOG.warn("Reference record of node " + refNodeUUID + " was = already removed."); - } - } - } = } = /** @@ -1010,96 +925,14 @@ throw new RepositoryException("FATAL Previous Property data is nu= ll. Parent " + data.getQPath().getAsString()); } = - // update data - prop.put(ITEM_DATA, data); - // REFERENCEs handling if (prevData.getType() =3D=3D PropertyType.REFERENCE || data.getType= () =3D=3D PropertyType.REFERENCE) { - // get Set of old values - Set removeSet =3D new HashSet(); - if (prevData.getType() =3D=3D PropertyType.REFERENCE) - { - for (ValueData value : prevData.getValues()) - { - try - { - removeSet.add(ValueDataConvertor.readString(value)); - } - catch (UnsupportedEncodingException e) - { - throw new RepositoryException(e); - } - catch (IOException e) - { - throw new RepositoryException(e); - } - } - } + updateReferences(prevData, data); + } = - // check new - Set addSet =3D new HashSet(); - if (data.getType() =3D=3D PropertyType.REFERENCE) - { - for (ValueData value : data.getValues()) - { - try - { - addSet.add(ValueDataConvertor.readString(value)); - } - catch (UnsupportedEncodingException e) - { - throw new RepositoryException(e); - } - catch (IOException e) - { - throw new RepositoryException(e); - } - } - } - - String[] added =3D new String[addSet.size()]; - addSet.toArray(added); - - for (String id : added) - { - if (removeSet.contains(id)) - { - removeSet.remove(id); - addSet.remove(id); - } - } - - // remove references to nodes - for (String id : removeSet) - { - Node node =3D refsRoot.getChild(Fqn.from= Elements(id)); - if (!node.removeChild(propFqn)) - { - throw new RepositoryException("FATAL Reference property was= not removed from REFS table of node " + id); - } - - // check node - if (node.getChildrenNames().size() =3D=3D 0) - { - //TODO remove children - refsRoot.removeChild(Fqn.fromElements(id)); - } - } - - // add references to nodes - for (String id : addSet) - { - Fqn nodeFqn =3D Fqn.fromElements(id); - Node node =3D refsRoot.getChild(nodeFqn); - - if (node =3D=3D null) - { - node =3D refsRoot.addChild(nodeFqn); - } - node.addChild(propFqn); - } - } + // update data + prop.put(ITEM_DATA, data); } = /** @@ -1177,11 +1010,182 @@ } } = - private void removePropertyReferenceToNode(String nodeId, Fqn propFqn) + private void removeReferences(PropertyData prevData) throws RepositoryE= xception { + // get values from cahce + Set remNodes =3D new HashSet(); + for (ValueData value : prevData.getValues()) + { + try + { + remNodes.add(ValueDataConvertor.readString(value)); + } + catch (UnsupportedEncodingException e) + { + throw new RepositoryException(e); + } + catch (IOException e) + { + throw new RepositoryException(e); + } + } = + String propUUID =3D prevData.getIdentifier(); + for (String refNodeUUID : remNodes) + { + removePropertyReferenceToNode(refNodeUUID, propUUID); + } } = + private void addReferences(PropertyData data) throws RepositoryException + { + Fqn propIdentifier =3D Fqn.fromElements(data.getIdentifier()); + + for (ValueData value : data.getValues()) + { + + String refNodeUUID; + try + { + refNodeUUID =3D ValueDataConvertor.readString(value); + } + catch (UnsupportedEncodingException e) + { + throw new RepositoryException(e); + } + catch (IOException e) + { + throw new RepositoryException(e); + } + + Fqn refNode =3D makeNodeFqn(refNodeUUID); + + // add to $REFS map + Node refParent =3D refsRoot.getChild(refNod= e); + if (refParent =3D=3D null) + { + refParent =3D refsRoot.addChild(refNode); + } + + refParent.addChild(propIdentifier); + } + } + + private void updateReferences(PropertyData prevData, PropertyData newDa= ta) throws RepositoryException + { + // get Set of old values + Set removeSet =3D new HashSet(); + if (prevData.getType() =3D=3D PropertyType.REFERENCE) + { + for (ValueData value : prevData.getValues()) + { + try + { + removeSet.add(ValueDataConvertor.readString(value)); + } + catch (UnsupportedEncodingException e) + { + throw new RepositoryException(e); + } + catch (IOException e) + { + throw new RepositoryException(e); + } + } + } + + // check new + Set addSet =3D new HashSet(); + if (newData.getType() =3D=3D PropertyType.REFERENCE) + { + for (ValueData value : newData.getValues()) + { + try + { + addSet.add(ValueDataConvertor.readString(value)); + } + catch (UnsupportedEncodingException e) + { + throw new RepositoryException(e); + } + catch (IOException e) + { + throw new RepositoryException(e); + } + } + } + + String[] added =3D new String[addSet.size()]; + addSet.toArray(added); + + for (String id : added) + { + if (removeSet.contains(id)) + { + removeSet.remove(id); + addSet.remove(id); + } + } + + // remove references to nodes + for (String id : removeSet) + { + removePropertyReferenceToNode(id, newData.getIdentifier()); + } + + Fqn propFqn =3D Fqn.fromElements(newData.getIdentifier()); + + // add references to nodes + for (String id : addSet) + { + Fqn nodeFqn =3D Fqn.fromElements(id); + Node node =3D refsRoot.getChild(nodeFqn); + + if (node =3D=3D null) + { + node =3D refsRoot.addChild(nodeFqn); + } + node.addChild(propFqn); + } + } + + private void removePropertyReferenceToNode(String nodeId, String propId= ) throws RepositoryException + { + // remove property from referencedNode in $REFS map + Node refParent =3D refsRoot.getChild(makeNodeF= qn(nodeId)); + + if (refParent !=3D null) + { + if (refParent.hasChild(propId)) + { + // do we need remove node record also + boolean removeParent =3D (refParent.getChildrenNames().size() = =3D=3D 1); + + if (!refParent.removeChild(propId)) + { + throw new RepositoryException("FATAL Reference property was= not removed from REFS table of node " + + nodeId); + } + + if (removeParent) + { + if (!refsRoot.removeChild(makeNodeFqn(nodeId))) + { + throw new RepositoryException("FATAL Node record was nod= e removed from REFS table " + nodeId); + } + } + } + else + { + LOG.warn("Property reference " + propId + " to node " + nodeId= + " was already removed."); + } + } + else + { + LOG.warn("Reference record of node " + nodeId + " was already rem= oved."); + } + } + /** * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection= #getLockData(java.lang.String) */ --===============7867275456626171264==-- From do-not-reply at jboss.org Tue Nov 24 03:57:13 2009 Content-Type: multipart/mixed; boundary="===============0657197778137506328==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r818 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 24 Nov 2009 03:57:13 -0500 Message-ID: <200911240857.nAO8vD5q008696@svn01.web.mwc.hst.phx2.redhat.com> --===============0657197778137506328== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-24 03:57:13 -0500 (Tue, 24 Nov 2009) New Revision: 818 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-246: JBossCacheStorageConnection exception throwing updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 08:44:16 UTC (rev 817) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 08:57:13 UTC (rev 818) @@ -309,10 +309,16 @@ Fqn propUUID =3D makePropFqn(data.getIdentifier()); = Node prop =3D propsRoot.getChild(propUUID); + if (prop =3D=3D null) + { + throw new InvalidItemStateException("Property doesn't exist or re= moved by another Session " + + data.getQPath().getAsString()); + } PropertyData prevData =3D (PropertyData)prop.get(ITEM_DATA); if (prevData =3D=3D null) { - throw new RepositoryException("FATAL PropertyData already empty "= + data.getQPath().getAsString()); + throw new InvalidItemStateException("FATAL. Property record exist= but PropertyData already empty " + + data.getQPath().getAsString()); } = // REFERENCEs handling @@ -851,7 +857,7 @@ Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) { - throw new RepositoryException("FATAL Node's parent not found " + = data.getQPath().getAsString()); + throw new InvalidItemStateException("FATAL Node's parent not foun= d " + data.getQPath().getAsString()); } = // update child on Parent @@ -1163,7 +1169,7 @@ = if (!refParent.removeChild(propId)) { - throw new RepositoryException("FATAL Reference property was= not removed from REFS table of node " + throw new InvalidItemStateException("Reference property was= not removed from REFS table of node " + nodeId); } = @@ -1171,7 +1177,7 @@ { if (!refsRoot.removeChild(makeNodeFqn(nodeId))) { - throw new RepositoryException("FATAL Node record was nod= e removed from REFS table " + nodeId); + throw new InvalidItemStateException("Node record was nod= e removed from REFS table " + nodeId); } } } --===============0657197778137506328==-- From do-not-reply at jboss.org Tue Nov 24 04:04:34 2009 Content-Type: multipart/mixed; boundary="===============7222850679217423681==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r819 - in core/trunk/exo.core.component.database/src: main/resources/conf/portal and 2 other directories. Date: Tue, 24 Nov 2009 04:04:34 -0500 Message-ID: <200911240904.nAO94Yax011163@svn01.web.mwc.hst.phx2.redhat.com> --===============7222850679217423681== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-24 04:04:33 -0500 (Tue, 24 Nov 2009) New Revision: 819 Added: core/trunk/exo.core.component.database/src/test/resources/conf/standalon= e/ Removed: core/trunk/exo.core.component.database/src/main/resources/conf/portal/te= st-configuration.xml core/trunk/exo.core.component.database/src/main/resources/conf/standalon= e/ Modified: core/trunk/exo.core.component.database/src/test/resources/conf/portal/te= st-configuration.xml Log: EXOJCR-259 test configuration moved Deleted: core/trunk/exo.core.component.database/src/main/resources/conf/por= tal/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/src/main/resources/conf/portal/t= est-configuration.xml 2009-11-24 08:57:13 UTC (rev 818) +++ core/trunk/exo.core.component.database/src/main/resources/conf/portal/t= est-configuration.xml 2009-11-24 09:04:33 UTC (rev 819) @@ -1,70 +0,0 @@ - - - - - org.exoplatform.services.database.HibernateService - org.exoplatform.services.database.impl.HibernateServiceImpl - - - hibernate.properties - Default Hibernate Service - - - - - - - - - - - - - - - - - jcr.datasource - org.exoplatform.services.database.impl.HibernateServiceImpl - - - hibernate.properties - JCR Workspace datasource - - - - - - - - - - - - - - - - - classpath:/conf/standalone/test-configuration.xml - \ No newline at end of file Modified: core/trunk/exo.core.component.database/src/test/resources/conf/po= rtal/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/src/test/resources/conf/portal/t= est-configuration.xml 2009-11-24 08:57:13 UTC (rev 818) +++ core/trunk/exo.core.component.database/src/test/resources/conf/portal/t= est-configuration.xml 2009-11-24 09:04:33 UTC (rev 819) @@ -79,4 +79,51 @@ + = + + org.exoplatform.services.database.HibernateService + org.exoplatform.services.database.impl.HibernateServiceImpl + + + hibernate.properties + Default Hibernate Service + + + + + + + + + + + + + + + + + jcr.datasource + org.exoplatform.services.database.impl.HibernateServiceImpl + + + hibernate.properties + JCR Workspace datasource + + + + + + + + + + + + + + + + + classpath:/conf/standalone/test-configuration.xml Copied: core/trunk/exo.core.component.database/src/test/resources/conf/stan= dalone (from rev 817, core/trunk/exo.core.component.database/src/main/resou= rces/conf/standalone) --===============7222850679217423681==-- From do-not-reply at jboss.org Tue Nov 24 04:34:45 2009 Content-Type: multipart/mixed; boundary="===============1647333131478555378==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r820 - in core/tags/2.3.0-Beta03/exo.core.component.database/src: main/resources/conf/portal and 2 other directories. Date: Tue, 24 Nov 2009 04:34:45 -0500 Message-ID: <200911240934.nAO9Yjwe016567@svn01.web.mwc.hst.phx2.redhat.com> --===============1647333131478555378== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-24 04:34:44 -0500 (Tue, 24 Nov 2009) New Revision: 820 Added: core/tags/2.3.0-Beta03/exo.core.component.database/src/test/resources/co= nf/standalone/ Removed: core/tags/2.3.0-Beta03/exo.core.component.database/src/main/resources/co= nf/portal/test-configuration.xml core/tags/2.3.0-Beta03/exo.core.component.database/src/main/resources/co= nf/standalone/ Modified: core/tags/2.3.0-Beta03/exo.core.component.database/src/test/resources/co= nf/portal/test-configuration.xml Log: EXOJCR-259 test configuration moved Deleted: core/tags/2.3.0-Beta03/exo.core.component.database/src/main/resour= ces/conf/portal/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/tags/2.3.0-Beta03/exo.core.component.database/src/main/resources/c= onf/portal/test-configuration.xml 2009-11-24 09:04:33 UTC (rev 819) +++ core/tags/2.3.0-Beta03/exo.core.component.database/src/main/resources/c= onf/portal/test-configuration.xml 2009-11-24 09:34:44 UTC (rev 820) @@ -1,70 +0,0 @@ - - - - - org.exoplatform.services.database.HibernateService - org.exoplatform.services.database.impl.HibernateServiceImpl - - - hibernate.properties - Default Hibernate Service - - - - - - - - - - - - - - - - - jcr.datasource - org.exoplatform.services.database.impl.HibernateServiceImpl - - - hibernate.properties - JCR Workspace datasource - - - - - - - - - - - - - - - - - classpath:/conf/standalone/test-configuration.xml - \ No newline at end of file Modified: core/tags/2.3.0-Beta03/exo.core.component.database/src/test/resou= rces/conf/portal/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/tags/2.3.0-Beta03/exo.core.component.database/src/test/resources/c= onf/portal/test-configuration.xml 2009-11-24 09:04:33 UTC (rev 819) +++ core/tags/2.3.0-Beta03/exo.core.component.database/src/test/resources/c= onf/portal/test-configuration.xml 2009-11-24 09:34:44 UTC (rev 820) @@ -79,4 +79,50 @@ + + org.exoplatform.services.database.HibernateService + org.exoplatform.services.database.impl.HibernateServiceImpl + + + hibernate.properties + Default Hibernate Service + + + + + + + + + + + + + + + + + jcr.datasource + org.exoplatform.services.database.impl.HibernateServiceImpl + + + hibernate.properties + JCR Workspace datasource + + + + + + + + + + + + + + + + + classpath:/conf/standalone/test-configuration.xml Copied: core/tags/2.3.0-Beta03/exo.core.component.database/src/test/resourc= es/conf/standalone (from rev 819, core/tags/2.3.0-Beta03/exo.core.component= .database/src/main/resources/conf/standalone) --===============1647333131478555378==-- From do-not-reply at jboss.org Tue Nov 24 04:45:34 2009 Content-Type: multipart/mixed; boundary="===============6681745552393108006==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r821 - in jcr/tags/1.12.0-Beta03/applications: java/exo.jcr.applications.backupconsole/bin and 1 other directory. Date: Tue, 24 Nov 2009 04:45:33 -0500 Message-ID: <200911240945.nAO9jXqX019239@svn01.web.mwc.hst.phx2.redhat.com> --===============6681745552393108006== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-24 04:45:33 -0500 (Tue, 24 Nov 2009) New Revision: 821 Modified: jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.backupcons= ole/bin/jcrbackup.cmd jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.backupcons= ole/bin/jcrbackup.sh jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jboss-ear.xml jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jonas-ear.xml jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-tomcat6.xml Log: EXOJCR-234 Assemblies and scripts updated Modified: jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.bac= kupconsole/bin/jcrbackup.cmd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.backupcon= sole/bin/jcrbackup.cmd 2009-11-24 09:34:44 UTC (rev 820) +++ jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.backupcon= sole/bin/jcrbackup.cmd 2009-11-24 09:45:33 UTC (rev 821) @@ -1 +1 @@ -java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03-SNAPSHOT.jar %* +java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03.jar %* Modified: jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.bac= kupconsole/bin/jcrbackup.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.backupcon= sole/bin/jcrbackup.sh 2009-11-24 09:34:44 UTC (rev 820) +++ jcr/tags/1.12.0-Beta03/applications/java/exo.jcr.applications.backupcon= sole/bin/jcrbackup.sh 2009-11-24 09:45:33 UTC (rev 821) @@ -1,3 +1,3 @@ #!/bin/sh = -java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03-SNAPSHOT.jar $* +java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03.jar $* Modified: jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jboss-ear.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jboss-ear.xml 20= 09-11-24 09:34:44 UTC (rev 820) +++ jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jboss-ear.xml 20= 09-11-24 09:45:33 UTC (rev 821) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = 4.0.0 @@ -36,7 +36,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 ear runtime Modified: jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jonas-ear.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jonas-ear.xml 20= 09-11-24 09:34:44 UTC (rev 820) +++ jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-jonas-ear.xml 20= 09-11-24 09:45:33 UTC (rev 821) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = 4.0.0 @@ -36,7 +36,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 ear runtime Modified: jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-tomcat6.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-tomcat6.xml 2009= -11-24 09:34:44 UTC (rev 820) +++ jcr/tags/1.12.0-Beta03/applications/product-exo-jcr-as-tomcat6.xml 2009= -11-24 09:45:33 UTC (rev 821) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta03 = 4.0.0 --===============6681745552393108006==-- From do-not-reply at jboss.org Tue Nov 24 04:49:17 2009 Content-Type: multipart/mixed; boundary="===============0864735435443108282==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r822 - in jcr/trunk/applications: java/exo.jcr.applications.backupconsole/bin and 1 other directory. Date: Tue, 24 Nov 2009 04:49:17 -0500 Message-ID: <200911240949.nAO9nHM5019642@svn01.web.mwc.hst.phx2.redhat.com> --===============0864735435443108282== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-24 04:49:16 -0500 (Tue, 24 Nov 2009) New Revision: 822 Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrba= ckup.cmd jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrba= ckup.sh jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml Log: EXOJCR-234 Assemblies and scripts updated Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bi= n/jcrbackup.cmd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrb= ackup.cmd 2009-11-24 09:45:33 UTC (rev 821) +++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrb= ackup.cmd 2009-11-24 09:49:16 UTC (rev 822) @@ -1 +1 @@ -java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03-SNAPSHOT.jar %* +java -jar exo.jcr.applications.backupconsole-1.12.0-Beta04-SNAPSHOT.jar %* Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bi= n/jcrbackup.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrb= ackup.sh 2009-11-24 09:45:33 UTC (rev 821) +++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/bin/jcrb= ackup.sh 2009-11-24 09:49:16 UTC (rev 822) @@ -1,3 +1,3 @@ #!/bin/sh = -java -jar exo.jcr.applications.backupconsole-1.12.0-Beta03-SNAPSHOT.jar $* +java -jar exo.jcr.applications.backupconsole-1.12.0-Beta04-SNAPSHOT.jar $* Modified: jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml 2009-11-24 09:4= 5:33 UTC (rev 821) +++ jcr/trunk/applications/product-exo-jcr-as-jboss-ear.xml 2009-11-24 09:4= 9:16 UTC (rev 822) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta04-SNAPSHOT = 4.0.0 @@ -36,7 +36,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta04-SNAPSHOT ear runtime Modified: jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml 2009-11-24 09:4= 5:33 UTC (rev 821) +++ jcr/trunk/applications/product-exo-jcr-as-jonas-ear.xml 2009-11-24 09:4= 9:16 UTC (rev 822) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta04-SNAPSHOT = 4.0.0 @@ -36,7 +36,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta04-SNAPSHOT ear runtime Modified: jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml 2009-11-24 09:45:= 33 UTC (rev 821) +++ jcr/trunk/applications/product-exo-jcr-as-tomcat6.xml 2009-11-24 09:49:= 16 UTC (rev 822) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-Beta04-SNAPSHOT = 4.0.0 --===============0864735435443108282==-- From do-not-reply at jboss.org Tue Nov 24 05:01:09 2009 Content-Type: multipart/mixed; boundary="===============4928510077550755770==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r823 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf. Date: Tue, 24 Nov 2009 05:01:09 -0500 Message-ID: <200911241001.nAOA198c022078@svn01.web.mwc.hst.phx2.redhat.com> --===============4928510077550755770== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-24 05:01:08 -0500 (Tue, 24 Nov 2009) New Revision: 823 Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/load/perf/TestGetNodesPerf.java Log: EXOJCR-221: getNodes from different session perfomance test Added: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/load/perf/TestGetNodesPerf.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java = (rev 0) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-24 10:01:08 UTC = (rev 823) @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.load.perf; + +import org.exoplatform.services.jcr.JcrAPIBaseTest; +import org.exoplatform.services.jcr.impl.core.SessionImpl; + +import java.io.File; +import java.io.PrintWriter; + +import javax.jcr.Node; +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.Session; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Anatoliy= Bazko = + * @version $Id$ + */ +public class TestGetNodesPerf extends JcrAPIBaseTest +{ + private static final String testName =3D "testRoot"; + + private static final int sessionCount =3D 20; + + private Session[] sessions =3D new Session[sessionCount]; + + private GetNodesThread[] threads =3D new GetNodesThread[sessionCount]; + + public void testGetNodes() throws Exception + { + for (int i =3D 0; i < sessionCount; i++) + { + sessions[i] =3D (SessionImpl)repository.login(credentials, "ws"); + } + + Node testRoot =3D session.getRootNode().addNode(testName); + session.save(); + + log.info("adding..."); + int nodesCount =3D 50000; + for (int i =3D 0; i < nodesCount; i++) + { + testRoot.addNode("_" + i + "_node"); + } + log.info("saving..."); + session.save(); + + log.info("waiting for 10 seconds..."); + Thread.sleep(10000); + + log.info("getting nodes..."); + for (int i =3D 0; i < sessionCount; i++) + { + threads[i] =3D new GetNodesThread(sessions[i]); + threads[i].start(); + } + + outer : while (true) + { + for (int i =3D 0; i < sessionCount; i++) + { + if (threads[i].isAlive()) + { + Thread.sleep(1000); + continue outer; + } + } + + break; + } + + log.info("Test finished"); + } + + private class GetNodesThread extends Thread + { + private final Session curSession; + + GetNodesThread(Session session) + { + this.curSession =3D session; + } + + @Override + public void run() + { + try + { + Node testRoot =3D curSession.getRootNode().getNode(testName); + + long startTime =3D System.currentTimeMillis(); + testRoot.getNodes(); + log.info("Total time: " + (System.currentTimeMillis() - startT= ime) / 1000 + "s"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + } + } + } +} Property changes on: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/tes= t/java/org/exoplatform/services/jcr/load/perf/TestGetNodesPerf.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native --===============4928510077550755770==-- From do-not-reply at jboss.org Tue Nov 24 05:10:05 2009 Content-Type: multipart/mixed; boundary="===============3227041465019418766==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r824 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 24 Nov 2009 05:10:05 -0500 Message-ID: <200911241010.nAOAA50w024550@svn01.web.mwc.hst.phx2.redhat.com> --===============3227041465019418766== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-24 05:10:05 -0500 (Tue, 24 Nov 2009) New Revision: 824 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-199: move operation fix. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 10:01:08= UTC (rev 823) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 10:10:05= UTC (rev 824) @@ -282,8 +282,16 @@ // update if it's non transitive update if (item.isNode()) { + // conn.rename() is used to update all the fields in DB. + // Original conn.update() will be matched as deprecated, = + // and conn.rename() should be renamed to update. This + // is done to solve the issue, when we need to guess each + // time whether node is moved or just updated. This + // solution is used as the fastest among other. = + conn.rename((NodeData)item); + //update node data - conn.update((NodeData)item); + //conn.update((NodeData)item); } else { --===============3227041465019418766==-- From do-not-reply at jboss.org Tue Nov 24 05:11:15 2009 Content-Type: multipart/mixed; boundary="===============0708479110940481646==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r825 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 24 Nov 2009 05:11:15 -0500 Message-ID: <200911241011.nAOABFMb025066@svn01.web.mwc.hst.phx2.redhat.com> --===============0708479110940481646== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-24 05:11:15 -0500 (Tue, 24 Nov 2009) New Revision: 825 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-199 : TODO for ACL check Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 10:10:05 UTC (rev 824) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 10:11:15 UTC (rev 825) @@ -761,6 +761,7 @@ if (!prevData.getQPath().equals(nodePath)) { // recreate with new path for child Nodes only + // TODO check ACL nodePath =3D QPath.makeChildPath(rootPath, prevData.getQPath().getEntries()[prevData.getQPath().= getEntries().length - 1]); --===============0708479110940481646==-- From do-not-reply at jboss.org Tue Nov 24 05:26:20 2009 Content-Type: multipart/mixed; boundary="===============5720764592508938889==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r826 - core/trunk. Date: Tue, 24 Nov 2009 05:26:19 -0500 Message-ID: <200911241026.nAOAQJav028414@svn01.web.mwc.hst.phx2.redhat.com> --===============5720764592508938889== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-24 05:26:19 -0500 (Tue, 24 Nov 2009) New Revision: 826 Modified: core/trunk/pom.xml Log: hibernate dependency updated to 3.3.2.GA Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-24 10:11:15 UTC (rev 825) +++ core/trunk/pom.xml 2009-11-24 10:26:19 UTC (rev 826) @@ -170,7 +170,7 @@ org.hibernate hibernate-core - 3.3.1.GA + 3.3.2.GA = --===============5720764592508938889==-- From do-not-reply at jboss.org Tue Nov 24 08:22:16 2009 Content-Type: multipart/mixed; boundary="===============0065395122991636811==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r827 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: storage/jbosscache and 1 other directory. Date: Tue, 24 Nov 2009 08:22:16 -0500 Message-ID: <200911241322.nAODMGNu001632@svn01.web.mwc.hst.phx2.redhat.com> --===============0065395122991636811== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-24 08:22:15 -0500 (Tue, 24 Nov 2009) New Revision: 827 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-246 : NodeData update if mixin changed Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-24 10:26:19 UTC (rev 826) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-24 13:22:15 UTC (rev 827) @@ -205,6 +205,10 @@ { doRename(data, conn, addedNodes); } + else if (itemState.isMixinChanged()) + { + doUpdateMixin(data, conn); + } = if (LOG.isDebugEnabled()) LOG.debug(ItemState.nameFromValue(itemState.getState()) = + " " + (System.currentTimeMillis() - start) @@ -226,7 +230,7 @@ // help to GC addedNodes.clear(); } - = + notifySaveItems(changesLog); } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-24 10:26:19 UTC (rev 826) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 200= 9-11-24 13:22:15 UTC (rev 827) @@ -18,12 +18,9 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = -import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; -import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; import org.exoplatform.services.jcr.dataflow.PersistentDataManager; -import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stenerFilter; @@ -37,6 +34,7 @@ import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; +import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStor= ageConnection; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -449,6 +447,29 @@ } = /** + * Performs updating of node data after mixin update. + * = + * @param item + * to update + * @param con + * connection + * @throws RepositoryException + * @throws InvalidItemStateException + * if the item not found TODO compare persistedVersion number + */ + protected void doUpdateMixin(final TransientItemData item, final Worksp= aceStorageConnection con) + throws RepositoryException, InvalidItemStateException + { + + if (item.isNode()) + { + //TODO remove cast + ((JBossCacheStorageConnection)con).updateMixin((NodeData)item); + } + + } + + /** * Performs actual item data adding. * = * @param item @@ -522,8 +543,8 @@ mandatoryListeners.add((MandatoryItemsPersistenceListener)listene= r); else listeners.add(listener); -// if (LOG.isDebugEnabled()) - LOG.info("Workspace '" + this.dataContainer.getName() + "' listen= er registered: " + listener); + // if (LOG.isDebugEnabled()) + LOG.info("Workspace '" + this.dataContainer.getName() + "' listener = registered: " + listener); } = public void removeItemPersistenceListener(ItemsPersistenceListener list= ener) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 10:26:19 UTC (rev 826) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 13:22:15 UTC (rev 827) @@ -737,6 +737,32 @@ // } } = + //Update NodeData after update mixin + public void updateMixin(NodeData data) throws RepositoryException + { + startBatch(); + + String nodeId =3D data.getIdentifier(); + + //1. Update node and also get old nodeData + Node node =3D nodesRoot.getChild(makeNodeFqn(n= odeId)); + if (node =3D=3D null) + { + throw new InvalidItemStateException("Node is not exist" + data.ge= tQPath().getAsString()); + } + + NodeData prevData =3D (NodeData)node.put(ITEM_DATA, data); + if (prevData =3D=3D null) + { + throw new RepositoryException("FATAL NodeData is empty " + data.g= etQPath().getAsString()); + } + + if (data instanceof TransientNodeData) + { + ((TransientNodeData)data).setState(TransientNodeData.TRANSITIVE_M= IXIN_UPDATED); + } + } + /** * Update Nodes tree with new path. * Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 10:26:19= UTC (rev 826) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 13:22:15= UTC (rev 827) @@ -120,6 +120,17 @@ case PUT_KEY_VALUE : if (m.getFqn().size() =3D=3D 2) { + // if (m.getValue() instanceof Transien= tNodeData) + // { + // //Check flag it's mixin update fo= r node, if this flag set we have node need to = + // // update node + // int skipMask =3D TransientNodeDat= a.TRANSITIVE_MIXIN_UPDATED; + // if ((((TransientNodeData)m.getVal= ue()).getState() & skipMask) > 0) + // { + // + // continue; + // } + // } if (isUpdate(m, (JDBCStorageConnection)conn)) { doUpdate(m, conn); --===============0065395122991636811==-- From do-not-reply at jboss.org Tue Nov 24 08:50:28 2009 Content-Type: multipart/mixed; boundary="===============0131407776753111949==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r828 - in jcr/branches/1.12.0-JBC/component/core/src: test/resources/conf/standalone and 1 other directory. Date: Tue, 24 Nov 2009 08:50:28 -0500 Message-ID: <200911241350.nAODoSYc008845@svn01.web.mwc.hst.phx2.redhat.com> --===============0131407776753111949== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 08:50:27 -0500 (Tue, 24 Nov 2009) New Revision: 828 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-configuration.xml Log: EXOJCR-199: LOG warn to debug; javadocs Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 13:22:15 UTC (rev 827) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 13:50:27 UTC (rev 828) @@ -701,7 +701,7 @@ childNode.put(ITEM_ID, data.getIdentifier()); = // 4. update all child nodes - updateTreePath(node, data.getQPath());//treePrint(node) + updateTreePath(node, data.getQPath()); //treePrint(node) = // TODO cleanup // for (Node child : node.getChildren()) @@ -737,7 +737,12 @@ // } } = - //Update NodeData after update mixin + /** + * Update NodeData after update mixin. Used for JBossCache persistence = only. + * + * @param data NodeData + * @throws RepositoryException if error occurs. + */ public void updateMixin(NodeData data) throws RepositoryException { startBatch(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 13:22:15= UTC (rev 827) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 13:50:27= UTC (rev 828) @@ -107,7 +107,10 @@ switch (m.getType()) { case PUT_DATA : - //LOG.warn("PUT_DATA modification"); + if (LOG.isDebugEnabled()) + { + LOG.debug("PUT_DATA modification"); + } // Process references // if (m.getFqn().get(0).equals(JBossCacheSto= rage.REFS)) // { @@ -115,7 +118,10 @@ // } break; case PUT_DATA_ERASE : - LOG.warn("PUT_DATA_ERASE modification"); + if (LOG.isDebugEnabled()) + { + LOG.debug("PUT_DATA_ERASE modification"); + } break; case PUT_KEY_VALUE : if (m.getFqn().size() =3D=3D 2) @@ -143,10 +149,16 @@ = break; case REMOVE_DATA : - LOG.warn("REMOVE_DATA modification"); + if (LOG.isDebugEnabled()) + { + LOG.debug("REMOVE_DATA modification"); + } break; case REMOVE_KEY_VALUE : - LOG.warn("REMOVE_KEY_VALUE modification"); + if (LOG.isDebugEnabled()) + { + LOG.debug("REMOVE_KEY_VALUE modification"); + } break; case REMOVE_NODE : = @@ -161,7 +173,10 @@ = break; case MOVE : - LOG.warn("MOVE modification"); + if (LOG.isDebugEnabled()) + { + LOG.debug("MOVE modification"); + } break; default : throw new CacheException("Unknown modification " + m.getTyp= e()); @@ -300,9 +315,6 @@ // time whether node is moved or just updated. This // solution is used as the fastest among other. = conn.rename((NodeData)item); - - //update node data - //conn.update((NodeData)item); } else { @@ -449,7 +461,10 @@ else { attrs =3D null; - LOG.warn("Unexpected Fqn asked " + name); + if (LOG.isDebugEnabled()) + { + LOG.warn("Unexpected Fqn asked " + name); + } } } else if (name.get(0).equals(Fqn.ROOT) || name.get(0).equals(JBoss= CacheStorage.PROPS) @@ -574,7 +589,10 @@ else { exists =3D false; - LOG.warn("Unexpected Fqn asked " + name); + if (LOG.isDebugEnabled()) + { + LOG.debug("Unexpected Fqn asked " + name); + } } } else if (name.get(0).equals(Fqn.ROOT) || name.get(0).equals(JBoss= CacheStorage.PROPS) Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-configuration.xml 2009-11-24 13:22:15 UTC (rev 827) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-configuration.xml 2009-11-24 13:50:27 UTC (rev 828) @@ -54,7 +54,8 @@ = - + + = = = --===============0131407776753111949==-- From do-not-reply at jboss.org Tue Nov 24 08:56:05 2009 Content-Type: multipart/mixed; boundary="===============2793059424019969120==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r829 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc/db and 1 other directory. Date: Tue, 24 Nov 2009 08:56:05 -0500 Message-ID: <200911241356.nAODu5Ae010156@svn01.web.mwc.hst.phx2.redhat.com> --===============2793059424019969120== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-24 08:56:05 -0500 (Tue, 24 Nov 2009) New Revision: 829 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-246: JBossCacheStorageConnection remove commented code. SingleJDBC -= reference query added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 13:50:27 UTC (rev 828) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 13:56:05 UTC (rev 829) @@ -226,26 +226,6 @@ { startBatch(); = - // TODO remove this check - // for (InternalQName mixin : data.getMixinTypeNames()) - // { - // - // - // if (mixin.equals(Constants.MIX_REFERENCEABLE)) - // { - // // check and release references - // Node node =3D refsRoot.addChild(= Fqn.fromElements(data.getIdentifier())); - // if (node !=3D null) - // { - // if (node.getChildrenNames().size() !=3D 0) - // { - // throw new RepositoryException("Referenceable nod= e removed but still have live references."); - // } - // } - // break; - // } - // } - // get parent Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) @@ -703,38 +683,6 @@ // 4. update all child nodes updateTreePath(node, data.getQPath()); //treePrint(node) = - // TODO cleanup - // for (Node child : node.getChildren()) - // { - // String childNodeId =3D (String)child.get(ITEM_ID); - // if (childNodeId =3D=3D null) - // { - // throw new RepositoryException("FATAL Child Node Id key= is null. Parent " + data.getQPath().getAsString()); - // } - // - // // TODO NodeData or PropertyData? As ItemData check then = and cast. - // Node childnode =3D nodesRoot.getChi= ld(makeNodeFqn(childNodeId)); //cache.evict(fqn) - // if (childnode =3D=3D null) - // { - // throw new RepositoryException("FATAL Node record not f= ound(" + childNodeId + "), but listed in childs of " - // + data.getQPath().getAsString()); - // } - // NodeData nodeData =3D (NodeData)childnode.get(ITEM_DATA); - // if (nodeData =3D=3D null) - // { - // // TODO should not occurs by contract - // throw new RepositoryException("Child node data is null= . Parent " + data.getQPath().getAsString()); - // } - // - // //repack child NodeData with new QPath - // //TODO check it - // QPath newPath =3D QPath.makeChildPath(data.getQPath(), no= deData.getQPath().getName()); - // TransientNodeData newNodeData =3D - // new TransientNodeData(newPath, nodeData.getIdentifier(= ), nodeData.getPersistedVersion(), nodeData - // .getPrimaryTypeName(), nodeData.getMixinTypeNames()= , nodeData.getOrderNumber(), nodeData - // .getParentIdentifier(), nodeData.getACL()); - // childnode.put(ITEM_DATA, newNodeData); - // } } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 13:50:27= UTC (rev 828) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 13:56:05= UTC (rev 829) @@ -111,11 +111,6 @@ { LOG.debug("PUT_DATA modification"); } - // Process references - // if (m.getFqn().get(0).equals(JBossCacheSto= rage.REFS)) - // { - // addReferences((JDBCStorageConnection)co= nn, m); - // } break; case PUT_DATA_ERASE : if (LOG.isDebugEnabled()) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-24 13:5= 0:27 UTC (rev 828) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-24 13:5= 6:05 UTC (rev 829) @@ -123,6 +123,10 @@ = protected PreparedStatement renameNode; = + protected PreparedStatement findReference; + + protected PreparedStatement findAllReferencedNodes; + /** * Singledatabase JDBC Connection constructor. * = @@ -197,6 +201,11 @@ "select P.ID, P.PARENT_ID, P.VERSION, P.P_TYPE, P.P_MULTIVALUED, = P.NAME" + " from JCR_SREF R, JCR_SITEM P" + " where R.NODE_ID=3D? and P.CONTAINER_NAME=3D? and P.ID=3DR.= PROPERTY_ID and P.I_CLASS=3D2"; = + FIND_REFERENCE =3D + "select P.ID from JCR_SREF R, JCR_SITEM P where R.NODE_ID=3D? and= R.PROPERTY_ID=3D? and P.ID =3D R.PROPERTY_ID"; + + FIND_REFERENCED_NODES =3D "select N.ID from JCR_SREF R, JCR_SITEM N= where N.ID=3DR.NODE_ID"; + FIND_VALUES_BY_PROPERTYID =3D "select PROPERTY_ID, ORDER_NUM, DATA, STORAGE_DESC from JCR_SVALU= E where PROPERTY_ID=3D? order by ORDER_NUM"; = @@ -724,16 +733,32 @@ } = @Override - protected boolean hasReferenceRecord(String nodeId, String refPropertyI= d) throws SQLException + protected boolean hasReferenceRecord(String nodeIdentifier, String refP= ropertyIdentifier) throws SQLException { - // TODO Auto-generated method stub - return false; + // TODO check queries + if (findReference =3D=3D null) + findReference =3D dbConnection.prepareStatement(FIND_REFERENCE); + else + findReference.clearParameters(); + + findReference.setString(1, nodeIdentifier); + findReference.setString(1, refPropertyIdentifier); + ResultSet result =3D findReference.executeQuery(); + + return result.next(); } = @Override protected ResultSet findAllReferencedNodeIdentifiers() throws SQLExcept= ion { - // TODO Auto-generated method stub - return null; + // TODO check queries + if (findAllReferencedNodes =3D=3D null) + findAllReferencedNodes =3D dbConnection.prepareStatement(this.FIN= D_REFERENCED_NODES); + else + findAllReferencedNodes.clearParameters(); + + ResultSet result =3D findAllReferencedNodes.executeQuery(); + + return result; } } --===============2793059424019969120==-- From do-not-reply at jboss.org Tue Nov 24 09:49:52 2009 Content-Type: multipart/mixed; boundary="===============7215880727061336043==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r830 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 24 Nov 2009 09:49:52 -0500 Message-ID: <200911241449.nAOEnq9G022750@svn01.web.mwc.hst.phx2.redhat.com> --===============7215880727061336043== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 09:49:52 -0500 (Tue, 24 Nov 2009) New Revision: 830 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-203: updateMixin in conn and loader Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 13:56:05 UTC (rev 829) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -24 14:49:52 UTC (rev 830) @@ -712,7 +712,7 @@ = if (data instanceof TransientNodeData) { - ((TransientNodeData)data).setState(TransientNodeData.TRANSITIVE_M= IXIN_UPDATED); + ((TransientNodeData)data).addState(TransientNodeData.TRANSITIVE_M= IXIN_UPDATED); } } = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 13:56:05= UTC (rev 829) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 14:49:52= UTC (rev 830) @@ -119,29 +119,7 @@ } break; case PUT_KEY_VALUE : - if (m.getFqn().size() =3D=3D 2) - { - // if (m.getValue() instanceof Transien= tNodeData) - // { - // //Check flag it's mixin update fo= r node, if this flag set we have node need to = - // // update node - // int skipMask =3D TransientNodeDat= a.TRANSITIVE_MIXIN_UPDATED; - // if ((((TransientNodeData)m.getVal= ue()).getState() & skipMask) > 0) - // { - // - // continue; - // } - // } - if (isUpdate(m, (JDBCStorageConnection)conn)) - { - doUpdate(m, conn); - } - else - { - doAdd(m, conn); - } - } - + doUpdate(m, (JDBCStorageConnection)conn); break; case REMOVE_DATA : if (LOG.isDebugEnabled()) @@ -180,19 +158,6 @@ } = /** - * Check update item or add item. - * = - * @param m Modification - * @param conn JDBCStorageConnection - * @return boolean - * return true if update, false if add - */ - private boolean isUpdate(Modification m, JDBCStorageConnection conn) th= rows RepositoryException - { - return conn.itemExists((String)m.getFqn().get(1), m.getValue() insta= nceof NodeData); - } - - /** * {@inheritDoc} */ public void put(List modifications) throws Exception @@ -285,44 +250,54 @@ } = /** - * Performs UPDATE to NodeData and PropertyData. - * @param modification - * @param conn - * @throws IllegalStateException - * @throws RepositoryException + * Performs UPDATE to NodeData or PropertyData. + * = + * @param modification Modification + * @param conn WorkspaceStorageConnection + * @throws IllegalStateException if connection closed + * @throws RepositoryException if error occurs */ - private void doUpdate(Modification modification, WorkspaceStorageConnec= tion conn) throws IllegalStateException, + private void doUpdate(Modification m, JDBCStorageConnection conn) throw= s IllegalStateException, RepositoryException { - if (modification.getValue() instanceof ItemData) + if (m.getFqn().size() =3D=3D 2 && m.getValue() instanceof TransientI= temData) { - TransientItemData item =3D (TransientItemData)modification.getVal= ue(); + //Check flag it's mixin update for node, if this flag set we have= node need to = + TransientItemData item =3D (TransientItemData)m.getValue(); = - if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED)= =3D=3D 0) + // TODO try + // if ((item.getState() =3D=3D TransientItemData.TRANSITIVE_NONE) + + if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED)= =3D=3D 0 + || (item.getState() & TransientItemData.TRANSITIVE_MIXIN_UPDAT= ED) =3D=3D 0) { - // update if it's non transitive update - if (item.isNode()) + if (conn.itemExists((String)m.getFqn().get(1), item.isNode())) + //if (isUpdate(m, (JDBCStorageConnection)conn)) { - // conn.rename() is used to update all the fields in DB. - // Original conn.update() will be matched as deprecated, = - // and conn.rename() should be renamed to update. This - // is done to solve the issue, when we need to guess each - // time whether node is moved or just updated. This - // solution is used as the fastest among other. = - conn.rename((NodeData)item); + // update if it's non transitive update + if (item.isNode()) + { + // TODO conn.rename() is used to update all the fields i= n DB. + // Original conn.update() will be matched as deprecated, = + // and conn.rename() should be renamed to update. This + // is done to solve the issue, when we need to guess each + // time whether node is moved or just updated. This + // solution is used as the fastest among other. = + conn.rename((NodeData)item); + } + else + { + //update property data + conn.update((PropertyData)item); + } } else { - //update property data - conn.update((PropertyData)item); + doAdd(m, conn); } } - else - { - // TODO for debug - LOG.info("TRANSITIVE_PATH_UPDATED " + item.getQPath().getAsStr= ing()); - } } + } = /** --===============7215880727061336043==-- From do-not-reply at jboss.org Tue Nov 24 10:28:04 2009 Content-Type: multipart/mixed; boundary="===============5728963693306350283==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r831 - in kernel/trunk: exo.kernel.commons and 6 other directories. Date: Tue, 24 Nov 2009 10:28:04 -0500 Message-ID: <200911241528.nAOFS4TR030447@svn01.web.mwc.hst.phx2.redhat.com> --===============5728963693306350283== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:28:04 -0500 (Tue, 24 Nov 2009) New Revision: 831 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.2.0-Beta04 Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-24 14:49:52 UTC (rev 83= 0) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-24 15:28:04 UTC (rev 83= 1) @@ -1,58 +1,58 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.commons - - eXo Kernel :: Commons Utils - eXo Commons - - - - xpp3 - xpp3 - - - commons-logging - commons-logging - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - log4j - log4j - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04 + + + exo.kernel.commons + + eXo Kernel :: Commons Utils + eXo Commons + + + + xpp3 + xpp3 + + + commons-logging + commons-logging + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + log4j + log4j + + + Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-24 14:49:52 UTC= (rev 830) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-24 15:28:04 UTC= (rev 831) @@ -1,50 +1,50 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.cache - - eXo Kernel :: Component :: Cache Service - exoplatform Cache services implementation - - - - org.exoplatform.tool - exo.tool.framework.junit - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.kernel - exo.kernel.commons - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04 + + + exo.kernel.component.cache + + eXo Kernel :: Component :: Cache Service + exoplatform Cache services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.commons + + \ No newline at end of file Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-24 14:49:52 U= TC (rev 830) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-24 15:28:04 U= TC (rev 831) @@ -1,64 +1,64 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.command - - eXo Kernel :: Component :: Command Service - exoplatform command services implementation - - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - commons-chain - commons-chain - - - xml-apis - xml-apis - - - - - commons-digester - commons-digester - - - xml-apis - xml-apis - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04 + + + exo.kernel.component.command + + eXo Kernel :: Component :: Command Service + exoplatform command services implementation + + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + commons-chain + commons-chain + + + xml-apis + xml-apis + + + + + commons-digester + commons-digester + + + xml-apis + xml-apis + + \ No newline at end of file Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-24 14:49:52 UT= C (rev 830) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-24 15:28:04 UT= C (rev 831) @@ -1,90 +1,90 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.common - - eXo Kernel :: Component :: Common Service - exoplatform common services implementation - - - - org.exoplatform.tool - exo.tool.framework.junit - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.kernel - exo.kernel.commons - - - javax.activation - activation - - - jotm - jotm - - - javax.resource - connector - - - log4j - log4j - - - - - javax.resource - connector-api - provided - - - quartz - quartz - - - picocontainer - picocontainer - - - javax.mail - mail - - - javax.transaction - jta - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04 + + + exo.kernel.component.common + + eXo Kernel :: Component :: Common Service + exoplatform common services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.commons + + + javax.activation + activation + + + jotm + jotm + + + javax.resource + connector + + + log4j + log4j + + + + + javax.resource + connector-api + provided + + + quartz + quartz + + + picocontainer + picocontainer + + + javax.mail + mail + + + javax.transaction + jta + + + + Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-24 14:49:52 UT= C (rev 830) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-24 15:28:04 UT= C (rev 831) @@ -1,54 +1,54 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.component.remote - - eXo Kernel :: Component :: Remote Service - exoplatform remote services implementation - - - - org.exoplatform.tool - exo.tool.framework.junit - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - = - - jgroups - jgroups - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04 + + + exo.kernel.component.remote + + eXo Kernel :: Component :: Remote Service + exoplatform remote services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + = + + jgroups + jgroups + + + Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-24 14:49:52 UTC (rev = 830) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-24 15:28:04 UTC (rev = 831) @@ -1,120 +1,120 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - exo.kernel.container - - eXo Kernel :: Container - eXo Kernel Container - = - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.tool - exo.tool.framework.junit - compile - - - javax.servlet - servlet-api - - - picocontainer - picocontainer - - - commons-beanutils - commons-beanutils - - - org.jibx - jibx-run - - - org.codehaus.woodstox - wstx-asl - - - - - org.jibx - jibx-bind - - - org.codehaus.woodstox - wstx-asl - - - - - org.jibx - jibx-extras - - - xpp3 - xpp3 - 1.1.3.4.O - - - - - - - org.jibx - maven-jibx-plugin - - src/main/resources - - binding.xml - - - - - - bind - - - - - - - - + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04 + + + exo.kernel.container + + eXo Kernel :: Container + eXo Kernel Container + = + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.tool + exo.tool.framework.junit + compile + + + javax.servlet + servlet-api + + + picocontainer + picocontainer + + + commons-beanutils + commons-beanutils + + + org.jibx + jibx-run + + + org.codehaus.woodstox + wstx-asl + + + + + org.jibx + jibx-bind + + + org.codehaus.woodstox + wstx-asl + + + + + org.jibx + jibx-extras + + + xpp3 + xpp3 + 1.1.3.4.O + + + + + + + org.jibx + maven-jibx-plugin + + src/main/resources + + binding.xml + + + + + + bind + + + + + + + + \ No newline at end of file Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2009-11-24 14:49:52 UTC (rev 830) +++ kernel/trunk/packaging/module/pom.xml 2009-11-24 15:28:04 UTC (rev 831) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta04 = 4.0.0 Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-24 14:49:52 UTC (rev 830) +++ kernel/trunk/pom.xml 2009-11-24 15:28:04 UTC (rev 831) @@ -1,199 +1,199 @@ - - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - pom - - eXo Kernel - - - exo-kernel - 2.2 - always - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk - http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk - - - - exo.kernel.container - exo.kernel.commons - exo.kernel.component.common - exo.kernel.component.remote - exo.kernel.component.cache - exo.kernel.component.command - packaging/module - - - - - - org.exoplatform.tool - exo.tool.framework.junit - 1.2.0 - - - org.exoplatform.kernel - exo.kernel.container - ${project.version} - - - org.exoplatform.kernel - exo.kernel.commons - ${project.version} - - - org.exoplatform.kernel - exo.kernel.component.remote - ${project.version} - - - xpp3 - xpp3 - 1.1.3.4.O - - - commons-logging - commons-logging - 1.0.4 - - - commons-beanutils - commons-beanutils - 1.6 - - - commons-chain - commons-chain - 1.0 - - - commons-digester - commons-digester - 1.6 - - - org.slf4j - slf4j-api - 1.5.6 - - - org.slf4j - slf4j-log4j12 - 1.5.6 - - - log4j - log4j - 1.2.14 - - - xml-apis - xml-apis - 1.0.b2 - - - quartz - quartz - 1.5.0-RC2 - - - javax.mail - mail - 1.4 - - - javax.activation - activation - 1.1 - - - javax.resource - connector-api - 1.5 - - - javax.transaction - jta - 1.0.1B - - - picocontainer - picocontainer - 1.1 - - - javax.servlet - servlet-api - 2.5 - provided - - - jgroups - jgroups - 2.6.10.GA - - - org.jibx - jibx-bind - ${jibx.plugin.version} - - - org.jibx - jibx-extras - ${jibx.plugin.version} - - - org.jibx - jibx-run - ${jibx.plugin.version} - - - jotm - jotm - 2.0.10 - - - - - - - junit - junit - test - - - - + + + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04 + pom + + eXo Kernel + + + exo-kernel + 2.2 + always + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.0-Beta04 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.0-Beta04 + http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.0-Beta0= 4 + + + + exo.kernel.container + exo.kernel.commons + exo.kernel.component.common + exo.kernel.component.remote + exo.kernel.component.cache + exo.kernel.component.command + packaging/module + + + + + + org.exoplatform.tool + exo.tool.framework.junit + 1.2.0 + + + org.exoplatform.kernel + exo.kernel.container + ${project.version} + + + org.exoplatform.kernel + exo.kernel.commons + ${project.version} + + + org.exoplatform.kernel + exo.kernel.component.remote + ${project.version} + + + xpp3 + xpp3 + 1.1.3.4.O + + + commons-logging + commons-logging + 1.0.4 + + + commons-beanutils + commons-beanutils + 1.6 + + + commons-chain + commons-chain + 1.0 + + + commons-digester + commons-digester + 1.6 + + + org.slf4j + slf4j-api + 1.5.6 + + + org.slf4j + slf4j-log4j12 + 1.5.6 + + + log4j + log4j + 1.2.14 + + + xml-apis + xml-apis + 1.0.b2 + + + quartz + quartz + 1.5.0-RC2 + + + javax.mail + mail + 1.4 + + + javax.activation + activation + 1.1 + + + javax.resource + connector-api + 1.5 + + + javax.transaction + jta + 1.0.1B + + + picocontainer + picocontainer + 1.1 + + + javax.servlet + servlet-api + 2.5 + provided + + + jgroups + jgroups + 2.6.10.GA + + + org.jibx + jibx-bind + ${jibx.plugin.version} + + + org.jibx + jibx-extras + ${jibx.plugin.version} + + + org.jibx + jibx-run + ${jibx.plugin.version} + + + jotm + jotm + 2.0.10 + + + + + + + junit + junit + test + + + + --===============5728963693306350283==-- From do-not-reply at jboss.org Tue Nov 24 10:28:15 2009 Content-Type: multipart/mixed; boundary="===============6198534084241555695==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r832 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Tue, 24 Nov 2009 10:28:15 -0500 Message-ID: <200911241528.nAOFSFHQ030467@svn01.web.mwc.hst.phx2.redhat.com> --===============6198534084241555695== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:28:15 -0500 (Tue, 24 Nov 2009) New Revision: 832 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201: loader cleanup; rely on JDBC storage impl Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 15:28:04= UTC (rev 831) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-24 15:28:15= UTC (rev 832) @@ -62,8 +62,7 @@ /** * Storage connections involved in transactions. */ - protected Map transactions =3D - new ConcurrentHashMap(); + protected Map transactions =3D new Concu= rrentHashMap(); = private IndividualCacheLoaderConfig config; = @@ -93,12 +92,12 @@ * Apply all Modifications to JDBC database, but don't commite them. * * @param modifications List if Modification - * @param conn WorkspaceStorageConnection + * @param conn JDBCStorageConnection * @throws RepositoryException if error = */ - protected void apply(WorkspaceStorageConnection conn, List modifications) throws RepositoryException + protected void apply(List modifications, JDBCStorageConne= ction conn) throws RepositoryException { - // Prepare modifications list. + // TODO Prepare modifications list. // Will be added oldValueData to modification for UPDATE. = //prepareModifications(modifications); = @@ -119,7 +118,7 @@ } break; case PUT_KEY_VALUE : - doUpdate(m, (JDBCStorageConnection)conn); + doUpdate(m, conn); break; case REMOVE_DATA : if (LOG.isDebugEnabled()) @@ -134,16 +133,7 @@ } break; case REMOVE_NODE : - - // if (m.getFqn().get(0).equals(JBossCacheSto= rage.REFS)) - // { - // removeReference((JDBCStorageConnection)= conn, m); - // } - // else - // { - doRemove(m, (JDBCStorageConnection)conn); - // } - + doRemove(m, conn); break; case MOVE : if (LOG.isDebugEnabled()) @@ -167,20 +157,21 @@ LOG.debug("Modifications list size =3D " + modifications.size()); } = - WorkspaceStorageConnection conn =3D dataContainer.openConnection(); + JDBCStorageConnection conn =3D (JDBCStorageConnection)dataContainer.= openConnection(); + try { - apply(conn, modifications); + apply(modifications, conn); conn.commit(); } catch (RepositoryException e) { - LOG.error("RepositoryException: ", e); // TODO don't catch + LOG.error("RepositoryException: ", e); // TODO don't catch, but b= e sure it will be thrown to JCR throw new RepositoryException(e); } catch (IllegalStateException e) { - LOG.error("IllegalStateException: ", e); // TODO don't catch + LOG.error("IllegalStateException: ", e); // TODO don't catch, but= be sure it will be thrown to JCR throw new IllegalStateException(e); } finally @@ -195,11 +186,10 @@ /** * Remove NodeData or PropertyData. * = - * @param modification - * @param conn - * @param identifier - * @throws IllegalStateException - * @throws RepositoryException + * @param modification Modification + * @param conn JDBCStorageConnection + * @throws IllegalStateException if connection closed + * @throws RepositoryException if error occurs */ private void doRemove(Modification modification, JDBCStorageConnection = conn) throws IllegalStateException, RepositoryException @@ -225,12 +215,13 @@ = /** * Performs ADD to NodeData and PropertyData. - * @param modification - * @param conn - * @throws IllegalStateException - * @throws RepositoryException + * = + * @param modification Modification + * @param conn JDBCStorageConnection + * @throws IllegalStateException if connection closed + * @throws RepositoryException if error occurs */ - private void doAdd(Modification modification, WorkspaceStorageConnectio= n conn) throws IllegalStateException, + private void doAdd(Modification modification, JDBCStorageConnection con= n) throws IllegalStateException, RepositoryException { if (modification.getValue() instanceof NodeData) @@ -253,12 +244,11 @@ * Performs UPDATE to NodeData or PropertyData. * = * @param modification Modification - * @param conn WorkspaceStorageConnection + * @param conn JDBCStorageConnection * @throws IllegalStateException if connection closed * @throws RepositoryException if error occurs */ - private void doUpdate(Modification m, JDBCStorageConnection conn) throw= s IllegalStateException, - RepositoryException + private void doUpdate(Modification m, JDBCStorageConnection conn) throw= s IllegalStateException, RepositoryException { if (m.getFqn().size() =3D=3D 2 && m.getValue() instanceof TransientI= temData) { @@ -272,7 +262,6 @@ || (item.getState() & TransientItemData.TRANSITIVE_MIXIN_UPDAT= ED) =3D=3D 0) { if (conn.itemExists((String)m.getFqn().get(1), item.isNode())) - //if (isUpdate(m, (JDBCStorageConnection)conn)) { // update if it's non transitive update if (item.isNode()) @@ -297,7 +286,6 @@ } } } - } = /** @@ -693,23 +681,23 @@ { if (onePhase) { - final WorkspaceStorageConnection conn =3D dataContainer.openConne= ction(); - apply(conn, modifications); + final JDBCStorageConnection conn =3D (JDBCStorageConnection)dataC= ontainer.openConnection(); + apply(modifications, conn); conn.commit(); // same immediately = } else { - final WorkspaceStorageConnection exconn =3D transactions.remove(t= x); + final JDBCStorageConnection exconn =3D transactions.remove(tx); if (exconn !=3D null) { // apply in existed connection associated with tx - apply(exconn, modifications); + apply(modifications, exconn); } else { // open new tx conn, apply in it, save the conn - final WorkspaceStorageConnection conn =3D dataContainer.openCo= nnection(); - apply(conn, modifications); + final JDBCStorageConnection conn =3D (JDBCStorageConnection)da= taContainer.openConnection(); + apply(modifications, conn); transactions.put(tx, conn); } } --===============6198534084241555695==-- From do-not-reply at jboss.org Tue Nov 24 10:28:33 2009 Content-Type: multipart/mixed; boundary="===============6600230994270238557==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r833 - kernel/tags. Date: Tue, 24 Nov 2009 10:28:32 -0500 Message-ID: <200911241528.nAOFSWn1030493@svn01.web.mwc.hst.phx2.redhat.com> --===============6600230994270238557== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:28:32 -0500 (Tue, 24 Nov 2009) New Revision: 833 Added: kernel/tags/2.2.0-Beta04/ Log: [maven-scm] copy for tag 2.2.0-Beta04 Copied: kernel/tags/2.2.0-Beta04 (from rev 831, kernel/trunk) --===============6600230994270238557==-- From do-not-reply at jboss.org Tue Nov 24 10:28:54 2009 Content-Type: multipart/mixed; boundary="===============6075785962442493330==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r834 - in kernel/trunk: exo.kernel.commons and 6 other directories. Date: Tue, 24 Nov 2009 10:28:54 -0500 Message-ID: <200911241528.nAOFSsR4030522@svn01.web.mwc.hst.phx2.redhat.com> --===============6075785962442493330== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:28:54 -0500 (Tue, 24 Nov 2009) New Revision: 834 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.remote/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: kernel/trunk/exo.kernel.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.commons/pom.xml 2009-11-24 15:28:32 UTC (rev 83= 3) +++ kernel/trunk/exo.kernel.commons/pom.xml 2009-11-24 15:28:54 UTC (rev 83= 4) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT = exo.kernel.commons Modified: kernel/trunk/exo.kernel.component.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-24 15:28:32 UTC= (rev 833) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2009-11-24 15:28:54 UTC= (rev 834) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT = exo.kernel.component.cache Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-24 15:28:32 U= TC (rev 833) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2009-11-24 15:28:54 U= TC (rev 834) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT = exo.kernel.component.command Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-24 15:28:32 UT= C (rev 833) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2009-11-24 15:28:54 UT= C (rev 834) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT = exo.kernel.component.common Modified: kernel/trunk/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-24 15:28:32 UT= C (rev 833) +++ kernel/trunk/exo.kernel.component.remote/pom.xml 2009-11-24 15:28:54 UT= C (rev 834) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT = exo.kernel.component.remote Modified: kernel/trunk/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.container/pom.xml 2009-11-24 15:28:32 UTC (rev = 833) +++ kernel/trunk/exo.kernel.container/pom.xml 2009-11-24 15:28:54 UTC (rev = 834) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT = exo.kernel.container Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2009-11-24 15:28:32 UTC (rev 833) +++ kernel/trunk/packaging/module/pom.xml 2009-11-24 15:28:54 UTC (rev 834) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT = 4.0.0 Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-24 15:28:32 UTC (rev 833) +++ kernel/trunk/pom.xml 2009-11-24 15:28:54 UTC (rev 834) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.0-Beta04 + 2.2.0-Beta05-SNAPSHOT pom = eXo Kernel @@ -42,9 +42,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.0-Beta04 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.0-Beta04 - http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.0-Beta0= 4 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk + http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk = --===============6075785962442493330==-- From do-not-reply at jboss.org Tue Nov 24 10:40:26 2009 Content-Type: multipart/mixed; boundary="===============7155879624394605118==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r835 - core/trunk. Date: Tue, 24 Nov 2009 10:40:26 -0500 Message-ID: <200911241540.nAOFeQmK032111@svn01.web.mwc.hst.phx2.redhat.com> --===============7155879624394605118== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:40:25 -0500 (Tue, 24 Nov 2009) New Revision: 835 Modified: core/trunk/pom.xml Log: EXOJCR-260: dependency on kernel-2.2.0-Beta04 Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-24 15:28:54 UTC (rev 834) +++ core/trunk/pom.xml 2009-11-24 15:40:25 UTC (rev 835) @@ -38,7 +38,7 @@ exo-core 2.3 = - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta04 *Test* = --===============7155879624394605118==-- From do-not-reply at jboss.org Tue Nov 24 10:42:19 2009 Content-Type: multipart/mixed; boundary="===============2191044496782473137==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r836 - in core/trunk: exo.core.component.database and 10 other directories. Date: Tue, 24 Nov 2009 10:42:19 -0500 Message-ID: <200911241542.nAOFgJpk032279@svn01.web.mwc.hst.phx2.redhat.com> --===============2191044496782473137== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:42:18 -0500 (Tue, 24 Nov 2009) New Revision: 836 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.3.0-Beta04 Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2009-11-24 15:40:25 UTC = (rev 835) +++ core/trunk/exo.core.component.database/pom.xml 2009-11-24 15:42:18 UTC = (rev 836) @@ -1,116 +1,116 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.database - - eXo Core :: Component :: Database Service - exoplatform database services implementation - - - - org.exoplatform.tool - exo.tool.framework.junit - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.kernel - exo.kernel.component.cache - - - javax.resource - connector-api - test - - - javax.transaction - jta - - - pull-parser - pull-parser - - - hsqldb - hsqldb - runtime - - - com.experlog - xapool - - - org.hibernate - hibernate-core - - - org.slf4j - slf4j-api - - = - - - org.hibernate - hibernate-annotations - - - org.slf4j - slf4j-api - - = - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/DBCreatorTest.java - - - - = - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.database + + eXo Core :: Component :: Database Service + exoplatform database services implementation + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.component.cache + + + javax.resource + connector-api + test + + + javax.transaction + jta + + + pull-parser + pull-parser + + + hsqldb + hsqldb + runtime + + + com.experlog + xapool + + + org.hibernate + hibernate-core + + + org.slf4j + slf4j-api + + = + + + org.hibernate + hibernate-annotations + + + org.slf4j + slf4j-api + + = + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/DBCreatorTest.java + + + + = + + + Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2009-11-24 15:40:25 UTC = (rev 835) +++ core/trunk/exo.core.component.document/pom.xml 2009-11-24 15:42:18 UTC = (rev 836) @@ -1,108 +1,108 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.document - - eXo Core :: Component :: Demo Service - eXo demo service Impl - - - - org.exoplatform.tool - exo.tool.framework.junit - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - - pdfbox - pdfbox - - - com.lowagie - itext - - - org.htmlparser - htmlparser - - - org.apache.poi - poi - - - log4j - log4j - - - - - org.apache.poi - poi-scratchpad - - - log4j - log4j - - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.drl - **/*.vm - **/*.doc - **/*.dot - **/*.xls - **/*.ppt - **/*.txt - **/*.tiff - **/*.pdf - **/*.odt - **/*.html - **/*.msg - **/*.pst - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.document + + eXo Core :: Component :: Demo Service + eXo demo service Impl + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + + pdfbox + pdfbox + + + com.lowagie + itext + + + org.htmlparser + htmlparser + + + org.apache.poi + poi + + + log4j + log4j + + + + + org.apache.poi + poi-scratchpad + + + log4j + log4j + + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.drl + **/*.vm + **/*.doc + **/*.dot + **/*.xls + **/*.ppt + **/*.txt + **/*.tiff + **/*.pdf + **/*.odt + **/*.html + **/*.msg + **/*.pst + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2009-11-24 15:40:25 UTC (rev= 835) +++ core/trunk/exo.core.component.ldap/pom.xml 2009-11-24 15:42:18 UTC (rev= 836) @@ -1,77 +1,77 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.ldap - - eXo Core :: Component :: LDAP Service - eXo LDAP impl - - - - org.exoplatform.tool - exo.tool.framework.junit - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - com.novell.ldap - jldap - test - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - - - - = - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.ldap + + eXo Core :: Component :: LDAP Service + eXo LDAP impl + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + com.novell.ldap + jldap + test + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + + + + = + + + Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2009-11-24 15:40= :25 UTC (rev 835) +++ core/trunk/exo.core.component.organization.api/pom.xml 2009-11-24 15:42= :18 UTC (rev 836) @@ -1,124 +1,124 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.organization.api - - eXo Core :: Component :: Organization Service API - eXo Organization Service API - - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.component.cache - - - org.exoplatform.core - exo.core.component.security.core - - - xdoclet - xdoclet-hibernate-module - - - xdoclet - xdoclet-xdoclet-module - - - xdoclet - xjavadoc - - - xstream - xstream - - - picocontainer - picocontainer - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - compile - - - - - - - - - - - - - - - - - run - - - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.organization.api + + eXo Core :: Component :: Organization Service API + eXo Organization Service API + + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.component.cache + + + org.exoplatform.core + exo.core.component.security.core + + + xdoclet + xdoclet-hibernate-module + + + xdoclet + xdoclet-xdoclet-module + + + xdoclet + xjavadoc + + + xstream + xstream + + + picocontainer + picocontainer + + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + compile + + + + + + + + + + + + + + + + + run + + + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-24 15:4= 0:25 UTC (rev 835) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2009-11-24 15:4= 2:18 UTC (rev 836) @@ -1,113 +1,113 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.organization.jdbc - - eXo Core :: Component :: Organization Service JDBC - eXo Organization Service JDBC - - - - org.exoplatform.tool - exo.tool.framework.junit - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.exoplatform.kernel - exo.kernel.component.cache - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - xstream - xstream - - - picocontainer - picocontainer - - - org.hibernate - hibernate-core - - - org.exoplatform.core - exo.core.component.database - - - org.exoplatform.core - exo.core.component.organization.api - - - javax.resource - connector-api - test - - - com.microsoft - sqljdbc - test - - - com.ibm.db2 - db2jcc - test - - - com.ibm.db2 - db2jcc_license_cu - test - - - oracle - ojdbc - test - - - postgresql - postgresql - test - - - mysql - mysql-connector-java - test - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.organization.jdbc + + eXo Core :: Component :: Organization Service JDBC + eXo Organization Service JDBC + + + + org.exoplatform.tool + exo.tool.framework.junit + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.exoplatform.kernel + exo.kernel.component.cache + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + xstream + xstream + + + picocontainer + picocontainer + + + org.hibernate + hibernate-core + + + org.exoplatform.core + exo.core.component.database + + + org.exoplatform.core + exo.core.component.organization.api + + + javax.resource + connector-api + test + + + com.microsoft + sqljdbc + test + + + com.ibm.db2 + db2jcc + test + + + com.ibm.db2 + db2jcc_license_cu + test + + + oracle + ojdbc + test + + + postgresql + postgresql + test + + + mysql + mysql-connector-java + test + + \ No newline at end of file Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-24 15:4= 0:25 UTC (rev 835) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2009-11-24 15:4= 2:18 UTC (rev 836) @@ -1,83 +1,83 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.organization.ldap - - eXo Core :: Component :: Organization Service LDAP - eXo Organization Service LDAP - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - org.exoplatform.core - exo.core.component.ldap - - - org.exoplatform.core - exo.core.component.database - ${project.version} - - - org.exoplatform.core - exo.core.component.organization.api - - - org.exoplatform.core - exo.core.component.organization.jdbc - - - = - - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/TestOrganizationService.java - - - - = - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.organization.ldap + + eXo Core :: Component :: Organization Service LDAP + eXo Organization Service LDAP + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + org.exoplatform.core + exo.core.component.ldap + + + org.exoplatform.core + exo.core.component.database + ${project.version} + + + org.exoplatform.core + exo.core.component.organization.api + + + org.exoplatform.core + exo.core.component.organization.jdbc + + + = + + + = + + org.apache.maven.plugins + maven-surefire-plugin + + + **/TestOrganizationService.java + + + + = + + \ No newline at end of file Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-24 15:40:25= UTC (rev 835) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2009-11-24 15:42:18= UTC (rev 836) @@ -1,50 +1,50 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.script.groovy - - eXo Core :: Component :: Groovy Scripts Instantiator - Load and compile Groovy script - - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - org.codehaus.groovy - groovy-all - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.script.groovy + + eXo Core :: Component :: Groovy Scripts Instantiator + Load and compile Groovy script + + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + org.codehaus.groovy + groovy-all + + \ No newline at end of file Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2009-11-24 15:40:25= UTC (rev 835) +++ core/trunk/exo.core.component.security.core/pom.xml 2009-11-24 15:42:18= UTC (rev 836) @@ -1,78 +1,78 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.security.core - - eXo Core :: Component :: Security Service - eXo Security - - - - org.exoplatform.kernel - exo.kernel.component.common - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - javax.servlet - servlet-api - - - commons-lang - commons-lang - - - - - - - src/test/java - - **/*.properties - **/*.xml - - - - src/test/resources - - **/*.properties - **/*.xml - **/login.conf - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.security.core + + eXo Core :: Component :: Security Service + eXo Security + + + + org.exoplatform.kernel + exo.kernel.component.common + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + javax.servlet + servlet-api + + + commons-lang + commons-lang + + + + + + + src/test/java + + **/*.properties + **/*.xml + + + + src/test/resources + + **/*.properties + **/*.xml + **/login.conf + + + + \ No newline at end of file Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2009-11-24 15:40:25 UTC (= rev 835) +++ core/trunk/exo.core.component.web.css/pom.xml 2009-11-24 15:42:18 UTC (= rev 836) @@ -1,50 +1,50 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.web.css - - eXo Core :: Component :: Web CSS - Stylesheet engine - - - - org.w3c - sac - - - batik - batik-util - - - batik - batik-css - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.web.css + + eXo Core :: Component :: Web CSS + Stylesheet engine + + + + org.w3c + sac + + + batik + batik-util + + + batik + batik-css + + + Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-24 15:40:2= 5 UTC (rev 835) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2009-11-24 15:42:1= 8 UTC (rev 836) @@ -1,105 +1,105 @@ - - - - 4.0.0 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - exo.core.component.xml-processing - - eXo Core :: Component :: XML Processing Service - eXo XML Processing Services - - - - org.exoplatform.kernel - exo.kernel.commons - - - org.exoplatform.kernel - exo.kernel.container - - - jtidy - jtidy - - - picocontainer - picocontainer - - - - - - - src/main/java - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - src/main/resources - - **/*.properties - **/*.xml - **/*.xsl - **/*.ent - **/*.dtd - **/*.xsd - - - - - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - src/test/java - - **/*.properties - **/*.xml - **/*.xhtml - **/*.html - **/*.xsl - - - - + + + + 4.0.0 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + exo.core.component.xml-processing + + eXo Core :: Component :: XML Processing Service + eXo XML Processing Services + + + + org.exoplatform.kernel + exo.kernel.commons + + + org.exoplatform.kernel + exo.kernel.container + + + jtidy + jtidy + + + picocontainer + picocontainer + + + + + + + src/main/java + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + src/main/resources + + **/*.properties + **/*.xml + **/*.xsl + **/*.ent + **/*.dtd + **/*.xsd + + + + + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + src/test/java + + **/*.properties + **/*.xml + **/*.xhtml + **/*.html + **/*.xsl + + + + \ No newline at end of file Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2009-11-24 15:40:25 UTC (rev 835) +++ core/trunk/packaging/module/pom.xml 2009-11-24 15:42:18 UTC (rev 836) @@ -1,77 +1,77 @@ - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - - - 4.0.0 - core.packaging.module - pom - eXo Core Build module - - - core - module - - - - - org.exoplatform.coreexo= .core.component.database2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04-SNAPSHOT= - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04-SNAPSHO= T - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04-SNAPSHOT - - = - - - - org.apache.maven.plugins - maven-resources-plugin - - - prepare - package - - copy-resources - - - target - - - src/main/javascript - true - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.3 - - - attach-artifacts - package - - attach-artifact - - - - - target/${exobuild.name}.packaging.${exobui= ld.type}.js - js - - - - - - - - = + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + + + 4.0.0 + core.packaging.module + pom + eXo Core Build module + + + core + module + + + + + org.exoplatform.coreexo= .core.component.database2.3.0-Beta04 + org.exoplatform.coreexo= .core.component.document2.3.0-Beta04 + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04 + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04 + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04 + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04<= /dependency> + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04 + + = + + + + org.apache.maven.plugins + maven-resources-plugin + + + prepare + package + + copy-resources + + + target + + + src/main/javascript + true + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.3 + + + attach-artifacts + package + + attach-artifact + + + + + target/${exobuild.name}.packaging.${exobui= ld.type}.js + js + + + + + + + + = = \ No newline at end of file Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-24 15:40:25 UTC (rev 835) +++ core/trunk/pom.xml 2009-11-24 15:42:18 UTC (rev 836) @@ -1,358 +1,358 @@ - - - 4.0.0 - - - org.exoplatform - foundation-parent - 3 - - - org.exoplatform.core - core-parent - 2.3.0-Beta04-SNAPSHOT - pom - - eXo Core - - - exo-core - 2.3 - = - 2.2.0-Beta04 - *Test* - - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk - http://fisheye.jboss.org/browse/exo-jcr/core/trunk - - - - exo.core.component.security.core - exo.core.component.database - exo.core.component.document - exo.core.component.ldap - exo.core.component.organization.api - exo.core.component.organization.jdbc - exo.core.component.organization.ldap - exo.core.component.xml-processing - exo.core.component.script.groovy - exo.core.component.web.css - packaging/module - - - - - = - - org.exoplatform.tool - exo.tool.framework.junit - 1.2.0 - - = - - org.exoplatform.kernel - exo.kernel.commons - ${org.exoplatform.kernel.version} - = - = - - org.exoplatform.kernel - exo.kernel.component.common - ${org.exoplatform.kernel.version} - = - - - org.exoplatform.kernel - exo.kernel.container - ${org.exoplatform.kernel.version} - - = - - org.exoplatform.kernel - exo.kernel.component.cache - ${org.exoplatform.kernel.version} - - = - - org.exoplatform.core - exo.core.component.database - ${project.version} - - = - - org.exoplatform.core - exo.core.component.ldap - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.api - ${project.version} - - - - org.exoplatform.core - exo.core.component.organization.jdbc - ${project.version} - - = - - org.exoplatform.core - exo.core.component.security.core - ${project.version} - - - - javax.resource - connector-api - 1.5 - - - - javax.servlet - servlet-api - 2.4 = - - = - - javax.transaction - jta - 1.0.1B = - - = - - pull-parser - pull-parser - 2 = - - = - - commons-lang - commons-lang - 2.3 - - = - - hsqldb - hsqldb - 1.8.0.7 - - - - com.experlog - xapool - 1.5.0 - - = - - org.hibernate - hibernate-core - 3.3.2.GA - - = - - xstream - xstream - 1.0.2 - - = - - picocontainer - picocontainer - 1.1 = - - = - - xdoclet - xdoclet-hibernate-module - 1.2.3 - - - - xdoclet - xdoclet-xdoclet-module - 1.2 - - - - xdoclet - xjavadoc - 1.0.3 - - = - - com.microsoft - sqljdbc - 1.1.1501 - - - - com.ibm.db2 - db2jcc - 9.1 - - - - com.ibm.db2 - db2jcc_license_cu - 9.1 - - - - oracle - ojdbc - 1.4 - - - - postgresql - postgresql - 8.3-603.jdbc3 - - - - mysql - mysql-connector-java - 5.0.8 - - = - - org.codehaus.groovy - groovy-all - 1.6.5 - - = - - org.hibernate - hibernate-annotations - 3.4.0.GA - - = - - pdfbox - pdfbox - 0.7.3 - - = - - com.lowagie - itext - 2.1.0 - compile - - = - - org.htmlparser - htmlparser - 1.6 - compile - - - com.sun - tools - - - - - - org.apache.poi - poi - 3.0.2-FINAL - - - - org.apache.poi - poi-scratchpad - 3.0.2-FINAL - - = - - com.novell.ldap - jldap - 4.3 - - = - - jtidy - jtidy - 4aug2000r7-dev - - = - - org.w3c - sac - 1.3 - - - - batik - batik-util - 1.7 - - - - batik - batik-css - 1.7 - - - - - - - - junit - junit - test - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - always - - **/*$* - **/DBCreatorTest.java - **/TestLDAPService.java - **/TestNovellLDAPAPI.java - **/TestStandardLDAPAPI.java - + + 4.0.0 + + + org.exoplatform + foundation-parent + 3 + + + org.exoplatform.core + core-parent + 2.3.0-Beta04 + pom + + eXo Core + + + exo-core + 2.3 + = + 2.2.0-Beta04 + *Test* + + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.0-Beta04 + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.0-Beta04 + http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.0-Beta04<= /url> + + + + exo.core.component.security.core + exo.core.component.database + exo.core.component.document + exo.core.component.ldap + exo.core.component.organization.api + exo.core.component.organization.jdbc + exo.core.component.organization.ldap + exo.core.component.xml-processing + exo.core.component.script.groovy + exo.core.component.web.css + packaging/module + + + + + = + + org.exoplatform.tool + exo.tool.framework.junit + 1.2.0 + + = + + org.exoplatform.kernel + exo.kernel.commons + ${org.exoplatform.kernel.version} + = + = + + org.exoplatform.kernel + exo.kernel.component.common + ${org.exoplatform.kernel.version} + = + + + org.exoplatform.kernel + exo.kernel.container + ${org.exoplatform.kernel.version} + + = + + org.exoplatform.kernel + exo.kernel.component.cache + ${org.exoplatform.kernel.version} + + = + + org.exoplatform.core + exo.core.component.database + ${project.version} + + = + + org.exoplatform.core + exo.core.component.ldap + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.api + ${project.version} + + + + org.exoplatform.core + exo.core.component.organization.jdbc + ${project.version} + + = + + org.exoplatform.core + exo.core.component.security.core + ${project.version} + + + + javax.resource + connector-api + 1.5 + + + + javax.servlet + servlet-api + 2.4 = + + = + + javax.transaction + jta + 1.0.1B = + + = + + pull-parser + pull-parser + 2 = + + = + + commons-lang + commons-lang + 2.3 + + = + + hsqldb + hsqldb + 1.8.0.7 + + + + com.experlog + xapool + 1.5.0 + + = + + org.hibernate + hibernate-core + 3.3.2.GA + + = + + xstream + xstream + 1.0.2 + + = + + picocontainer + picocontainer + 1.1 = + + = + + xdoclet + xdoclet-hibernate-module + 1.2.3 + + + + xdoclet + xdoclet-xdoclet-module + 1.2 + + + + xdoclet + xjavadoc + 1.0.3 + + = + + com.microsoft + sqljdbc + 1.1.1501 + + + + com.ibm.db2 + db2jcc + 9.1 + + + + com.ibm.db2 + db2jcc_license_cu + 9.1 + + + + oracle + ojdbc + 1.4 + + + + postgresql + postgresql + 8.3-603.jdbc3 + + + + mysql + mysql-connector-java + 5.0.8 + + = + + org.codehaus.groovy + groovy-all + 1.6.5 + + = + + org.hibernate + hibernate-annotations + 3.4.0.GA + + = + + pdfbox + pdfbox + 0.7.3 + + = + + com.lowagie + itext + 2.1.0 + compile + + = + + org.htmlparser + htmlparser + 1.6 + compile + + + com.sun + tools + + + + + + org.apache.poi + poi + 3.0.2-FINAL + + + + org.apache.poi + poi-scratchpad + 3.0.2-FINAL + + = + + com.novell.ldap + jldap + 4.3 + + = + + jtidy + jtidy + 4aug2000r7-dev + + = + + org.w3c + sac + 1.3 + + + + batik + batik-util + 1.7 + + + + batik + batik-css + 1.7 + + + + + + + + junit + junit + test + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + always + + **/*$* + **/DBCreatorTest.java + **/TestLDAPService.java + **/TestNovellLDAPAPI.java + **/TestStandardLDAPAPI.java + - org.exoplatform.coreexo= .core.component.database2.3.0-Beta04 - org.exoplatform.coreexo= .core.component.document2.3.0-Beta04 - org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta04 - org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta04 - org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta04 - org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta04<= /dependency> - org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta04 + org.exoplatform.coreexo= .core.component.database2.3.0-Beta05-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.0-Beta05-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.0-Beta05-SNAPSHOT= + org.exoplatform.coreexo= .core.component.organization.ldap2.3.0-Beta05-SNAPSHO= T + org.exoplatform.coreexo= .core.component.security.core2.3.0-Beta05-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.0-Beta05-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.3.0-Beta05-SNAPSHOT = Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2009-11-24 15:42:47 UTC (rev 837) +++ core/trunk/pom.xml 2009-11-24 15:43:13 UTC (rev 838) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.3.0-Beta04 + 2.3.0-Beta05-SNAPSHOT pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.0-Beta04 - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.0-Beta04 - http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.0-Beta04<= /url> + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/trun= k + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk + http://fisheye.jboss.org/browse/exo-jcr/core/trunk = --===============7320399879878162751==-- From do-not-reply at jboss.org Tue Nov 24 10:49:56 2009 Content-Type: multipart/mixed; boundary="===============1701244651440227147==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r839 - ws/trunk. Date: Tue, 24 Nov 2009 10:49:56 -0500 Message-ID: <200911241549.nAOFnuFC001226@svn01.web.mwc.hst.phx2.redhat.com> --===============1701244651440227147== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:49:56 -0500 (Tue, 24 Nov 2009) New Revision: 839 Modified: ws/trunk/pom.xml Log: EXOJCR-260: dependecy on kernel-2.2.0-Beta04, core-2.3.0-Beta04 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-24 15:43:13 UTC (rev 838) +++ ws/trunk/pom.xml 2009-11-24 15:49:56 UTC (rev 839) @@ -45,8 +45,8 @@ exo-ws 2.1 = - 2.2.0-Beta04-SNAPSHOT - 2.3.0-Beta04-SNAPSHOT + 2.2.0-Beta04 + 2.3.0-Beta04 = *Test* --===============1701244651440227147==-- From do-not-reply at jboss.org Tue Nov 24 10:51:30 2009 Content-Type: multipart/mixed; boundary="===============4773413455679816427==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r840 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Tue, 24 Nov 2009 10:51:30 -0500 Message-ID: <200911241551.nAOFpUZ9001680@svn01.web.mwc.hst.phx2.redhat.com> --===============4773413455679816427== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:51:29 -0500 (Tue, 24 Nov 2009) New Revision: 840 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.1.0-Beta04 Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-24 15:49:56 UTC (rev 839) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-24 15:51:29 UTC (rev 840) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 = exo.ws.commons Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-24 15:49:56 UTC (rev 83= 9) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-24 15:51:29 UTC (rev 84= 0) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 = exo.ws.frameworks.json Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-24 15:49:56 UTC (rev= 839) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-24 15:51:29 UTC (rev= 840) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 = exo.ws.frameworks.servlet Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-24 15:49:56 UTC (rev 839) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-24 15:51:29 UTC (rev 840) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 = exo.ws.rest.core Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-24 15:49:56 UTC (rev 839) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-24 15:51:29 UTC (rev 840) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 = exo.ws.rest.ext Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-24 15:49:56 UTC (rev 839) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-24 15:51:29 UTC (rev 840) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 = exo.ws.testframework Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2009-11-24 15:49:56 UTC (rev 839) +++ ws/trunk/packaging/module/pom.xml 2009-11-24 15:51:29 UTC (rev 840) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 = 4.0.0 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-24 15:49:56 UTC (rev 839) +++ ws/trunk/pom.xml 2009-11-24 15:51:29 UTC (rev 840) @@ -30,15 +30,15 @@ = org.exoplatform.ws ws-parent - 2.1.0-Beta04-SNAPSHOT + 2.1.0-Beta04 pom = eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk - http://fisheye.jboss.org/browse/exo-jcr/ws/trunk + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.0-Beta04 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.0-Beta04 + http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.0-Beta04 = @@ -62,37 +62,37 @@ = - + org.exoplatform.kernel exo.kernel.commons ${org.exoplatform.kernel.version} - + org.exoplatform.kernel exo.kernel.container ${org.exoplatform.kernel.version} - = + = org.exoplatform.kernel exo.kernel.component.common ${org.exoplatform.kernel.version} - + org.exoplatform.core exo.core.component.xml-processing ${org.exoplatform.core.version} - = + = org.exoplatform.ws exo.ws.frameworks.json ${project.version} - + org.exoplatform.ws exo.ws.testframework ${project.version} - = + = org.exoplatform.ws exo.ws.commons @@ -102,68 +102,68 @@ org.exoplatform.ws exo.ws.rest.core ${project.version} - = - - javax.xml.stream - stax-api - 1.0 - + = + javax.xml.stream + stax-api + 1.0 + + javax.servlet servlet-api 2.4 - + javax.mail mail 1.4 - + javax.activation activation 1.1 - + javax.xml.bind jaxb-api 2.1 - = - - picocontainer - picocontainer - 1.1 = - - - jtidy - jtidy - 4aug2000r7-dev = - = + = + picocontainer + picocontainer + 1.1 = + + + jtidy + jtidy + 4aug2000r7-dev = + = + org.jvnet.jaxb2.maven2 maven-jaxb2-plugin 0.4 - = + = commons-fileupload commons-fileupload 1.0 - = + = javax.ws.rs jsr311-api 1.0 - + javax.annotation jsr250-api 1.0 - = - - xpp3 - xpp3 - 1.1.3.4.O - = + = + + xpp3 + xpp3 + 1.1.3.4.O + = = --===============4773413455679816427==-- From do-not-reply at jboss.org Tue Nov 24 10:51:53 2009 Content-Type: multipart/mixed; boundary="===============3736190084071185470==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r841 - ws/tags. Date: Tue, 24 Nov 2009 10:51:53 -0500 Message-ID: <200911241551.nAOFprbK001709@svn01.web.mwc.hst.phx2.redhat.com> --===============3736190084071185470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:51:53 -0500 (Tue, 24 Nov 2009) New Revision: 841 Added: ws/tags/2.1.0-Beta04/ Log: [maven-scm] copy for tag 2.1.0-Beta04 Copied: ws/tags/2.1.0-Beta04 (from rev 840, ws/trunk) --===============3736190084071185470==-- From do-not-reply at jboss.org Tue Nov 24 10:52:13 2009 Content-Type: multipart/mixed; boundary="===============4924970611871844390==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r842 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Tue, 24 Nov 2009 10:52:13 -0500 Message-ID: <200911241552.nAOFqDOT001739@svn01.web.mwc.hst.phx2.redhat.com> --===============4924970611871844390== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 10:52:13 -0500 (Tue, 24 Nov 2009) New Revision: 842 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2009-11-24 15:51:53 UTC (rev 841) +++ ws/trunk/exo.ws.commons/pom.xml 2009-11-24 15:52:13 UTC (rev 842) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT = exo.ws.commons Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-24 15:51:53 UTC (rev 84= 1) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2009-11-24 15:52:13 UTC (rev 84= 2) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT = exo.ws.frameworks.json Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-24 15:51:53 UTC (rev= 841) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2009-11-24 15:52:13 UTC (rev= 842) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2009-11-24 15:51:53 UTC (rev 841) +++ ws/trunk/exo.ws.rest.core/pom.xml 2009-11-24 15:52:13 UTC (rev 842) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT = exo.ws.rest.core Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-24 15:51:53 UTC (rev 841) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2009-11-24 15:52:13 UTC (rev 842) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT = exo.ws.rest.ext Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2009-11-24 15:51:53 UTC (rev 841) +++ ws/trunk/exo.ws.testframework/pom.xml 2009-11-24 15:52:13 UTC (rev 842) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT = exo.ws.testframework Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2009-11-24 15:51:53 UTC (rev 841) +++ ws/trunk/packaging/module/pom.xml 2009-11-24 15:52:13 UTC (rev 842) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT = 4.0.0 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2009-11-24 15:51:53 UTC (rev 841) +++ ws/trunk/pom.xml 2009-11-24 15:52:13 UTC (rev 842) @@ -30,15 +30,15 @@ = org.exoplatform.ws ws-parent - 2.1.0-Beta04 + 2.1.0-Beta05-SNAPSHOT pom = eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.0-Beta04 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.0-Beta04 - http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.0-Beta04 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk + http://fisheye.jboss.org/browse/exo-jcr/ws/trunk = --===============4924970611871844390==-- From do-not-reply at jboss.org Tue Nov 24 11:14:20 2009 Content-Type: multipart/mixed; boundary="===============1022964552961011989==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r843 - jcr/trunk. Date: Tue, 24 Nov 2009 11:14:20 -0500 Message-ID: <200911241614.nAOGEKLV004962@svn01.web.mwc.hst.phx2.redhat.com> --===============1022964552961011989== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 11:14:20 -0500 (Tue, 24 Nov 2009) New Revision: 843 Modified: jcr/trunk/pom.xml Log: EXOJCR-260: dependecy on kernel-2.2.0-Beta04, core-2.3.0-Beta04, ws-2.1.0-B= eta04 Modified: jcr/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/pom.xml 2009-11-24 15:52:13 UTC (rev 842) +++ jcr/trunk/pom.xml 2009-11-24 16:14:20 UTC (rev 843) @@ -38,9 +38,9 @@ exo-jcr 1.12 - 2.2.0-Beta04-SNAPSHOT - 2.3.0-Beta04-SNAPSHOT - 2.1.0-Beta04-SNAPSHOT + 2.2.0-Beta04 + 2.3.0-Beta04 + 2.1.0-Beta04 = --===============1022964552961011989==-- From do-not-reply at jboss.org Tue Nov 24 11:21:59 2009 Content-Type: multipart/mixed; boundary="===============7581779414669992581==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r844 - in jcr/trunk: applications/exo.jcr.applications.config and 14 other directories. Date: Tue, 24 Nov 2009 11:21:59 -0500 Message-ID: <200911241621.nAOGLxev007057@svn01.web.mwc.hst.phx2.redhat.com> --===============7581779414669992581== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-24 11:21:59 -0500 (Tue, 24 Nov 2009) New Revision: 844 Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml jcr/trunk/applications/java/exo.jcr.ear/pom.xml jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ftp/pom.xml jcr/trunk/exo.jcr.component.webdav/pom.xml jcr/trunk/exo.jcr.connectors.localadapter/pom.xml jcr/trunk/exo.jcr.framework.command/pom.xml jcr/trunk/exo.jcr.framework.ftpclient/pom.xml jcr/trunk/exo.jcr.framework.web/pom.xml jcr/trunk/packaging/module/pom.xml jcr/trunk/pom.xml Log: [maven-release-plugin] prepare release 1.12.0-Beta04 Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2009-11-24 1= 6:14:20 UTC (rev 843) +++ jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2009-11-24 1= 6:21:59 UTC (rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.applications.config Modified: jcr/trunk/applications/java/exo.jcr.applications.backupconsole/po= m.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-24 16:14:20 UTC (rev 843) +++ jcr/trunk/applications/java/exo.jcr.applications.backupconsole/pom.xml = 2009-11-24 16:21:59 UTC (rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.applications.backupconsole Modified: jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-24 16:14:20 UTC (rev 843) +++ jcr/trunk/applications/java/exo.jcr.applications.browser/pom.xml 2009-1= 1-24 16:21:59 UTC (rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.applications.browser Modified: jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-24 16:14:20 UTC (rev 843) +++ jcr/trunk/applications/java/exo.jcr.applications.fckeditor/pom.xml 2009= -11-24 16:21:59 UTC (rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.applications.fckeditor Modified: jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-2= 4 16:14:20 UTC (rev 843) +++ jcr/trunk/applications/java/exo.jcr.applications.rest/pom.xml 2009-11-2= 4 16:21:59 UTC (rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.applications.rest Modified: jcr/trunk/applications/java/exo.jcr.ear/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-24 16:14:20 UTC= (rev 843) +++ jcr/trunk/applications/java/exo.jcr.ear/pom.xml 2009-11-24 16:21:59 UTC= (rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.ear Modified: jcr/trunk/exo.jcr.component.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-24 16:14:20 UTC (rev 8= 43) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2009-11-24 16:21:59 UTC (rev 8= 44) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.component.core Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-24 16:14:20 UTC (rev 84= 3) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2009-11-24 16:21:59 UTC (rev 84= 4) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.component.ext Modified: jcr/trunk/exo.jcr.component.ftp/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-24 16:14:20 UTC (rev 84= 3) +++ jcr/trunk/exo.jcr.component.ftp/pom.xml 2009-11-24 16:21:59 UTC (rev 84= 4) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.component.ftp Modified: jcr/trunk/exo.jcr.component.webdav/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-24 16:14:20 UTC (rev= 843) +++ jcr/trunk/exo.jcr.component.webdav/pom.xml 2009-11-24 16:21:59 UTC (rev= 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.component.webdav Modified: jcr/trunk/exo.jcr.connectors.localadapter/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-24 16:14:20 U= TC (rev 843) +++ jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2009-11-24 16:21:59 U= TC (rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.connectors.localadapter Modified: jcr/trunk/exo.jcr.framework.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-24 16:14:20 UTC (re= v 843) +++ jcr/trunk/exo.jcr.framework.command/pom.xml 2009-11-24 16:21:59 UTC (re= v 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.framework.command Modified: jcr/trunk/exo.jcr.framework.ftpclient/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-24 16:14:20 UTC (= rev 843) +++ jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2009-11-24 16:21:59 UTC (= rev 844) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.framework.ftpclient Modified: jcr/trunk/exo.jcr.framework.web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-24 16:14:20 UTC (rev 84= 3) +++ jcr/trunk/exo.jcr.framework.web/pom.xml 2009-11-24 16:21:59 UTC (rev 84= 4) @@ -25,7 +25,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = exo.jcr.framework.web Modified: jcr/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/packaging/module/pom.xml 2009-11-24 16:14:20 UTC (rev 843) +++ jcr/trunk/packaging/module/pom.xml 2009-11-24 16:21:59 UTC (rev 844) @@ -2,7 +2,7 @@ org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 = 4.0.0 Modified: jcr/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/pom.xml 2009-11-24 16:14:20 UTC (rev 843) +++ jcr/trunk/pom.xml 2009-11-24 16:21:59 UTC (rev 844) @@ -30,7 +30,7 @@ = org.exoplatform.jcr jcr-parent - 1.12.0-Beta04-SNAPSHOT + 1.12.0-Beta04 pom = eXo JCR @@ -44,9 +44,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/trunk= - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr= /trunk - https://svn.jboss.org/repos/exo-jcr/jcr/trunk + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/= 1.12.0-Beta04 + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr= /tags/1.12.0-Beta04 + https://svn.jboss.org/repos/exo-jcr/jcr/tags/1.12.0-Beta04 = @@ -72,7 +72,7 @@ = - + org.exoplatform.kernel exo.kernel.commons @@ -352,7 +352,7 @@ commons-io 1.3 - = + = = = - = --===============1726654500722862355==-- From do-not-reply at jboss.org Wed Nov 25 05:44:59 2009 Content-Type: multipart/mixed; boundary="===============7116236338393828089==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r853 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/version and 2 other directories. Date: Wed, 25 Nov 2009 05:44:59 -0500 Message-ID: <200911251044.nAPAix29032457@svn01.web.mwc.hst.phx2.redhat.com> --===============7116236338393828089== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-25 05:44:59 -0500 (Wed, 25 Nov 2009) New Revision: 853 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/ItemImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/NodeImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/PropertyImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/SessionDataManager.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/version/VersionHistoryImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/BaseStandaloneTest.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/load/perf/TestGetNodesPerf.java Log: EXOJRC-221: improvements with location & definitions Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/ItemImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-25 10:28:31 UTC (rev 852) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-25 10:44:59 UTC (rev 853) @@ -23,6 +23,7 @@ import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.access.PermissionType; import org.exoplatform.services.jcr.core.ExtendedPropertyType; +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; @@ -97,6 +98,11 @@ */ protected JCRPath location; = + /** + * Item QPath. + */ + protected QPath qpath; + protected SessionDataManager dataManager; = protected LocationFactory locationFactory; @@ -157,7 +163,7 @@ /** * {@inheritDoc} */ - public String getPath() + public String getPath() throws RepositoryException { return getLocation().getAsString(false); } @@ -165,7 +171,7 @@ /** * {@inheritDoc} */ - public String getName() + public String getName() throws RepositoryException { return getLocation().getName().getAsString(); } @@ -231,7 +237,7 @@ */ public int getDepth() { - return getLocation().getDepth(); + return qpath.getDepth(); } = /** @@ -741,8 +747,11 @@ * = * @return item JCRPath */ - public JCRPath getLocation() + public JCRPath getLocation() throws RepositoryException { + if (this.location =3D=3D null) + this.location =3D session.getLocationFactory().createJCRPath(qpat= h); + return this.location; } = @@ -758,6 +767,15 @@ = abstract void loadData(ItemData data) throws RepositoryException; = + abstract void loadData(ItemData data, ItemDefinitionData itemDefinition= Data) throws RepositoryException; + + /** + * Returns Item definition data. + * + * @return + */ + abstract ItemDefinitionData getItemDefinitionData(); + public boolean hasPermission(String action) throws RepositoryException { NodeData ndata; Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-25 10:28:31 UTC (rev 852) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-25 10:44:59 UTC (rev 853) @@ -24,6 +24,7 @@ import org.exoplatform.services.jcr.access.SystemIdentity; import org.exoplatform.services.jcr.core.ExtendedNode; import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; @@ -137,7 +138,7 @@ * = * @param data * Node data - * @param session + * @param session = * Session * @throws RepositoryException * if error occurs during the Node data loading @@ -150,6 +151,25 @@ } = /** + * NodeImpl constructor. + * = + * @param data + * Node data + * @param parent + * Parent node data + * @param session = + * Session + * @throws RepositoryException + * if error occurs during the Node data loading + */ + public NodeImpl(NodeData data, NodeData parent, SessionImpl session) th= rows RepositoryException + { + super(data, session); + this.sysLocFactory =3D session.getSystemLocationFactory(); + loadData(data, parent); + } + + /** * {@inheritDoc} */ public void accept(ItemVisitor visitor) throws RepositoryException @@ -1357,7 +1377,8 @@ throw new RepositoryException("ACL is NULL " + nodeData.getQPath(= ).getAsString()); = this.data =3D nodeData; - this.location =3D session.getLocationFactory().createJCRPath(getData= ().getQPath()); + this.qpath =3D nodeData.getQPath(); + this.location =3D null; = initDefinition(); } @@ -1365,6 +1386,84 @@ /** * {@inheritDoc} */ + private void loadData(ItemData data, NodeData parent) throws Repository= Exception, InvalidItemStateException, + ConstraintViolationException + { + + if (data =3D=3D null) + throw new InvalidItemStateException("Data is null for " + this.ge= tPath() + + " Probably was deleted by another session and can not be loa= ded from container "); + + if (!data.isNode()) + throw new RepositoryException("Load data failed: Node expected"); + + NodeData nodeData =3D (NodeData)data; + + // TODO do we need this three checks here? + if (nodeData.getPrimaryTypeName() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no primary= TypeName. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]") + " " + nodeData); + + if (nodeData.getMixinTypeNames() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no mixinTy= peNames. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]")); + + if (nodeData.getACL() =3D=3D null) + throw new RepositoryException("ACL is NULL " + nodeData.getQPath(= ).getAsString()); + + this.data =3D nodeData; + this.qpath =3D nodeData.getQPath(); + this.location =3D null; + + initDefinition(parent); + } + + /** + * {@inheritDoc} + */ + @Override + public void loadData(ItemData data, ItemDefinitionData itemDefinitionDa= ta) throws RepositoryException, + InvalidItemStateException, ConstraintViolationException + { + + if (data =3D=3D null) + throw new InvalidItemStateException("Data is null for " + this.ge= tPath() + + " Probably was deleted by another session and can not be loa= ded from container "); + + if (!data.isNode()) + throw new RepositoryException("Load data failed: Node expected"); + + NodeData nodeData =3D (NodeData)data; + + // TODO do we need this three checks here? + if (nodeData.getPrimaryTypeName() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no primary= TypeName. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]") + " " + nodeData); + + if (nodeData.getMixinTypeNames() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no mixinTy= peNames. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]")); + + if (nodeData.getACL() =3D=3D null) + throw new RepositoryException("ACL is NULL " + nodeData.getQPath(= ).getAsString()); + + this.data =3D nodeData; + this.location =3D null; + this.qpath =3D nodeData.getQPath(); + this.definition =3D (NodeDefinitionData)itemDefinitionData; + } + + /** + * {@inheritDoc} + */ + public ItemDefinitionData getItemDefinitionData() + { + return definition; + } + + /** + * {@inheritDoc} + */ public Lock lock(boolean isDeep, boolean isSessionScoped) throws Unsupp= ortedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException { @@ -2685,6 +2784,33 @@ throw new ConstraintViolationException("Node definition not found= for " + getPath()); } = + /** + * Init NodeDefinition. + * = + * @throws RepositoryException + * if error occurs + * @throws ConstraintViolationException + * if definition not found + */ + private void initDefinition(NodeData parent) throws RepositoryException= , ConstraintViolationException + { + + if (this.isRoot()) + { // root - no parent + this.definition =3D + new NodeDefinitionData(null, null, true, true, OnParentVersion= Action.ABORT, true, + new InternalQName[]{Constants.NT_BASE}, null, false); + return; + } + + this.definition =3D + session.getWorkspace().getNodeTypesHolder().getChildNodeDefinitio= n(getInternalName(), + parent.getPrimaryTypeName(), parent.getMixinTypeNames()); + + if (definition =3D=3D null) + throw new ConstraintViolationException("Node definition not found= for " + getPath()); + } + private void removeMergeFailed(Version version, PlainChangesLog changes= Log) throws RepositoryException { = Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/PropertyImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/PropertyImpl.java 2009-11-25 10:28:31 UTC (rev= 852) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/PropertyImpl.java 2009-11-25 10:44:59 UTC (rev= 853) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.core; = import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionDatas; import org.exoplatform.services.jcr.datamodel.InternalQName; @@ -93,14 +94,42 @@ this.propertyData =3D (TransientPropertyData)data; this.type =3D propertyData.getType(); = - this.location =3D session.getLocationFactory().createJCRPath(getData= ().getQPath()); - this.propertyDef =3D null; + this.qpath =3D data.getQPath(); + this.location =3D null; + initDefinitions(this.propertyData.isMultiValued()); } = /** * {@inheritDoc} */ + void loadData(ItemData data, ItemDefinitionData itemDefinitionData) thr= ows RepositoryException, + ConstraintViolationException + { + + if (!(data instanceof TransientPropertyData)) + throw new RepositoryException("Load data: TransientPropertyData i= s expected, but have " + data); + + this.data =3D data; + this.propertyData =3D (TransientPropertyData)data; + this.type =3D propertyData.getType(); + + this.location =3D null; + this.qpath =3D data.getQPath(); + this.propertyDef =3D (PropertyDefinitionData)itemDefinitionData; + } + + /** + * {@inheritDoc} + */ + public ItemDefinitionData getItemDefinitionData() + { + return propertyDef; + } + + /** + * {@inheritDoc} + */ public Value getValue() throws ValueFormatException, RepositoryException { = @@ -526,9 +555,10 @@ */ public String dump() { - String vals =3D "Property " + getPath() + " values: "; + String vals =3D "Property "; try { + vals =3D getPath() + " values: "; for (int i =3D 0; i < getValueArray().length; i++) { vals +=3D new String(((BaseValue)getValueArray()[i]).getIntern= alData().getAsByteArray()) + ";"; @@ -564,19 +594,4 @@ return false; } = - /** - * {@inheritDoc} - */ - @Override - public int hashCode() - { - try - { - return getLocation().getAsString(false).hashCode(); - } - catch (Exception e) - { - return super.hashCode(); - } - } } Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-25 10:28:31 UT= C (rev 852) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-25 10:44:59 UT= C (rev 853) @@ -578,7 +578,7 @@ = for (NodeData data : nodeDatas) { - NodeImpl item =3D itemFactory.createNode(data); + NodeImpl item =3D itemFactory.createNode(data, parent); = session.getActionHandler().postRead(item); = @@ -1729,7 +1729,7 @@ } else { - item.loadData(newItem.getData()); + item.loadData(newItem.getData(), newItem.getItemDefinitionData= ()); return item; } } @@ -1839,12 +1839,19 @@ String dump() { String str =3D "Items Pool: \n"; - for (ItemImpl item : items.values()) + try { - str +=3D - (item.isNode() ? "Node\t\t" : "Property\t") + "\t" + item.i= sValid() + "\t" + item.isNew() + "\t" - + item.getInternalIdentifier() + "\t" + item.getPath() += "\n"; + for (ItemImpl item : items.values()) + { + str +=3D + (item.isNode() ? "Node\t\t" : "Property\t") + "\t" + ite= m.isValid() + "\t" + item.isNew() + "\t" + + item.getInternalIdentifier() + "\t" + item.getPath(= ) + "\n"; + } } + catch (Exception e) + { + e.printStackTrace(); + } = return str; } @@ -1880,10 +1887,26 @@ return node; } = + private NodeImpl createNode(NodeData data, NodeData parent) throws R= epositoryException + { + NodeImpl node =3D new NodeImpl(data, parent, session); + if (node.isNodeType(Constants.NT_VERSION)) + { + return new VersionImpl(data, session); + } + else if (node.isNodeType(Constants.NT_VERSIONHISTORY)) + { + return new VersionHistoryImpl(data, session); + } + else + return node; + } + private PropertyImpl createProperty(ItemData data) throws Repository= Exception { return new PropertyImpl(data, session); } + } = /** Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/version/VersionHistoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/version/VersionHistoryImpl.java 2009-11-25 10:= 28:31 UTC (rev 852) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/version/VersionHistoryImpl.java 2009-11-25 10:= 44:59 UTC (rev 853) @@ -629,7 +629,7 @@ = } = - public boolean isVersionBelongToThis(Version version) + public boolean isVersionBelongToThis(Version version) throws Repository= Exception { return ((VersionImpl)version).getLocation().isDescendantOf(getLocati= on(), false); } Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/BaseStandaloneTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/BaseStandaloneTest.java 2009-11-25 10:28:31 UTC (rev 852) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/BaseStandaloneTest.java 2009-11-25 10:44:59 UTC (rev 853) @@ -387,7 +387,7 @@ return testFile; } = - protected void checkMixins(String[] mixins, NodeImpl node) + protected void checkMixins(String[] mixins, NodeImpl node) throws Repos= itoryException { try { Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/load/perf/TestGetNodesPerf.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-25 10:28:31 UTC = (rev 852) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-25 10:44:59 UTC = (rev 853) @@ -19,11 +19,7 @@ import org.exoplatform.services.jcr.JcrAPIBaseTest; import org.exoplatform.services.jcr.impl.core.SessionImpl; = -import java.io.File; -import java.io.PrintWriter; - import javax.jcr.Node; -import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; import javax.jcr.Session; = @@ -39,14 +35,17 @@ { private static final String testName =3D "testRoot"; = - private static final int sessionCount =3D 20; + private static final int sessionCount =3D 1; = + private static final int tryCount =3D 10; + private Session[] sessions =3D new Session[sessionCount]; = private GetNodesThread[] threads =3D new GetNodesThread[sessionCount]; = public void testGetNodes() throws Exception { + for (int i =3D 0; i < sessionCount; i++) { sessions[i] =3D (SessionImpl)repository.login(credentials, "ws"); @@ -67,6 +66,10 @@ log.info("waiting for 10 seconds..."); Thread.sleep(10000); = + System.gc(); + Runtime rt =3D Runtime.getRuntime(); + long usedMemory =3D rt.totalMemory() - rt.freeMemory(); + log.info("getting nodes..."); for (int i =3D 0; i < sessionCount; i++) { @@ -87,8 +90,7 @@ = break; } - - log.info("Test finished"); + log.info("Memory used: " + (rt.totalMemory() - rt.freeMemory() - use= dMemory) / 1024 + "Kb"); } = private class GetNodesThread extends Thread @@ -107,9 +109,12 @@ { Node testRoot =3D curSession.getRootNode().getNode(testName); = - long startTime =3D System.currentTimeMillis(); - testRoot.getNodes(); - log.info("Total time: " + (System.currentTimeMillis() - startT= ime) / 1000 + "s"); + for (int k =3D 0; k < tryCount; k++) + { + long startTime =3D System.currentTimeMillis(); + testRoot.getNodes(); + log.info("Total time: " + (System.currentTimeMillis() - sta= rtTime) / 1000 + "s"); + } } catch (RepositoryException e) { --===============7116236338393828089==-- From do-not-reply at jboss.org Wed Nov 25 05:57:22 2009 Content-Type: multipart/mixed; boundary="===============7597606631693700642==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r854 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core. Date: Wed, 25 Nov 2009 05:57:22 -0500 Message-ID: <200911251057.nAPAvMsx002199@svn01.web.mwc.hst.phx2.redhat.com> --===============7597606631693700642== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-25 05:57:20 -0500 (Wed, 25 Nov 2009) New Revision: 854 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/BackupWorkspaceInitializer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/SysViewWorkspaceInitializer.java Log: EXOJCR-203 : In SysViewWorkspaceinitializer and BackupWorkspaceInitializer = was changed dependency from CacheableWorkspaceDataManager to WorkspacePersi= stentDataManager. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/BackupWorkspaceInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/BackupWorkspaceInitializer.java 2009-11-25 10:44:59 UT= C (rev 853) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/BackupWorkspaceInitializer.java 2009-11-25 10:57:20 UT= C (rev 854) @@ -36,6 +36,7 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateExcept= ion; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.observation.ExtendedEvent; @@ -74,7 +75,7 @@ private FileCleaner fileCleaner; = public BackupWorkspaceInitializer(WorkspaceEntry config, RepositoryEntr= y repConfig, - CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl nam= espaceRegistry, + WorkspacePersistentDataManager dataManager, NamespaceRegistryImpl na= mespaceRegistry, LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager= , ValueFactoryImpl valueFactory, AccessManager accessManager) throws RepositoryConfigurationException= , PathNotFoundException, RepositoryException { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/SysViewWorkspaceInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SysViewWorkspaceInitializer.java 2009-11-25 10:44:59 U= TC (rev 853) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SysViewWorkspaceInitializer.java 2009-11-25 10:57:20 U= TC (rev 854) @@ -18,6 +18,28 @@ */ package org.exoplatform.services.jcr.impl.core; = +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Stack; + +import javax.jcr.NamespaceException; +import javax.jcr.PathNotFoundException; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.xml.stream.FactoryConfigurationError; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.XMLStreamReader; +import javax.xml.stream.events.StartElement; + import org.apache.ws.commons.util.Base64; import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; @@ -41,34 +63,13 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; +import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.jcr.impl.util.JCRDateFormat; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Stack; - -import javax.jcr.NamespaceException; -import javax.jcr.PathNotFoundException; -import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; -import javax.xml.stream.FactoryConfigurationError; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.events.StartElement; - /** * Created by The eXo Platform SAS.
* = @@ -357,7 +358,7 @@ * @param repConfig * RepositoryEntry * @param dataManager - * CacheableWorkspaceDataManager + * WorkspacePersistentDataManager * @param namespaceRegistry * NamespaceRegistryImpl * @param locationFactory @@ -376,9 +377,10 @@ * if Repository error */ public SysViewWorkspaceInitializer(WorkspaceEntry config, RepositoryEnt= ry repConfig, - CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl nam= espaceRegistry, - LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager= , ValueFactoryImpl valueFactory, - AccessManager accessManager) throws RepositoryConfigurationException= , PathNotFoundException, RepositoryException + WorkspacePersistentDataManager dataManager, NamespaceRegistryI= mpl namespaceRegistry, + LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeM= anager, ValueFactoryImpl valueFactory, + AccessManager accessManager) throws RepositoryConfigurationExc= eption, PathNotFoundException, + RepositoryException { = this.workspaceName =3D config.getName(); @@ -409,7 +411,7 @@ * @param repConfig * RepositoryEntry * @param dataManager - * CacheableWorkspaceDataManager + * WorkspacePersistentDataManager * @param namespaceRegistry * NamespaceRegistryImpl * @param locationFactory @@ -426,7 +428,7 @@ * if Repository error */ public SysViewWorkspaceInitializer(WorkspaceEntry config, RepositoryEnt= ry repConfig, - CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl nam= espaceRegistry, + WorkspacePersistentDataManager dataManager, NamespaceRegistryImpl na= mespaceRegistry, LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager= , ValueFactoryImpl valueFactory, AccessManager accessManager, String restorePath) throws RepositoryEx= ception { --===============7597606631693700642==-- From do-not-reply at jboss.org Wed Nov 25 05:59:30 2009 Content-Type: multipart/mixed; boundary="===============0979306549571961676==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r855 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 25 Nov 2009 05:59:30 -0500 Message-ID: <200911251059.nAPAxUID002571@svn01.web.mwc.hst.phx2.redhat.com> --===============0979306549571961676== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 05:59:29 -0500 (Wed, 25 Nov 2009) New Revision: 855 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-243: delete lock data on node deletion Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 10:57:20 UTC (rev 854) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 10:59:29 UTC (rev 855) @@ -76,6 +76,7 @@ = WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; + List removeLocksList =3D new ArrayList(); = // prepare changes log list List chengesLogList =3D new ArrayList(); @@ -192,18 +193,22 @@ if (itemState.isAdded()) { doAdd(data, conn, addedNodes); + removeLocksList.remove(data.getIdentifier()); } else if (itemState.isUpdated()) { doUpdate(data, conn); + removeLocksList.remove(data.getIdentifier()); } else if (itemState.isDeleted()) { doDelete(data, conn); + removeLocksList.add(data.getIdentifier()); } else if (itemState.isRenamed()) { doRename(data, conn, addedNodes); + removeLocksList.remove(data.getIdentifier()); } else if (itemState.isMixinChanged()) { @@ -215,6 +220,10 @@ + "ms, " + data.getQPath().getAsString()); } } + for (String identifier : removeLocksList) + { + thisConnection.removeLockData(identifier); + } if (thisConnection !=3D null) thisConnection.commit(); if (systemConnection !=3D null && !systemConnection.equals(thisCo= nnection)) --===============0979306549571961676==-- From do-not-reply at jboss.org Wed Nov 25 06:34:00 2009 Content-Type: multipart/mixed; boundary="===============7794948721186947267==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r856 - jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalone. Date: Wed, 25 Nov 2009 06:34:00 -0500 Message-ID: <200911251134.nAPBY0lH009402@svn01.web.mwc.hst.phx2.redhat.com> --===============7794948721186947267== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-25 06:33:59 -0500 (Wed, 25 Nov 2009) New Revision: 856 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalon= e/test-jcr-config-sjdbc.xml Log: EXOJCR-199: test-jcr-config-sjdbc - JBoss cache added Modified: jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/st= andalone/test-jcr-config-sjdbc.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config-sjdbc.xml 2009-11-25 10:59:29 UTC (rev 855) +++ jcr/branches/1.12.0-JBC/component/core/src/test/resources/conf/standalo= ne/test-jcr-config-sjdbc.xml 2009-11-25 11:33:59 UTC (rev 856) @@ -29,8 +29,9 @@ org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator - + + @@ -54,31 +55,32 @@ - + - + + = - + - + = @@ -101,12 +103,12 @@ - + @@ -121,9 +123,9 @@ = - + - + = @@ -146,12 +148,12 @@ - + @@ -167,8 +169,9 @@ = - + + @@ -208,12 +211,12 @@ - + @@ -237,8 +240,9 @@ org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator - + + @@ -264,12 +268,12 @@ value=3D"any read;*:/platform/administrators read;= *:/platform/administrators add_node;*:/platform/administrators set_property= ;*:/platform/administrators remove" /> - + @@ -293,8 +297,9 @@ = - + + @@ -320,12 +325,12 @@ value=3D"any read;*:/platform/administrators read;= *:/platform/administrators add_node;*:/platform/administrators set_property= ;*:/platform/administrators remove" /> - + @@ -340,8 +345,9 @@ = - + + @@ -367,12 +373,12 @@ value=3D"any read;*:/platform/administrators read;= *:/platform/administrators add_node;*:/platform/administrators set_property= ;*:/platform/administrators remove" /> - + --===============7794948721186947267==-- From do-not-reply at jboss.org Wed Nov 25 07:59:52 2009 Content-Type: multipart/mixed; boundary="===============5101863474022543870==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r857 - in jcr/branches/1.12.0-OPT: exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext and 1 other directories. Date: Wed, 25 Nov 2009 07:59:52 -0500 Message-ID: <200911251259.nAPCxqGo021118@svn01.web.mwc.hst.phx2.redhat.com> --===============5101863474022543870== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-25 07:59:51 -0500 (Wed, 25 Nov 2009) New Revision: 857 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/SessionDataManager.java jcr/branches/1.12.0-OPT/exo.jcr.component.ext/src/test/java/org/exoplatf= orm/services/jcr/ext/BaseStandaloneTest.java jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/src/test/java/org/exoplatf= orm/services/ftp/BaseStandaloneTest.java Log: EXOJCR-221: createNode improvement, dont call isNodeType method Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-25 11:33:59 UT= C (rev 856) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/SessionDataManager.java 2009-11-25 12:59:51 UT= C (rev 857) @@ -1890,11 +1890,11 @@ private NodeImpl createNode(NodeData data, NodeData parent) throws R= epositoryException { NodeImpl node =3D new NodeImpl(data, parent, session); - if (node.isNodeType(Constants.NT_VERSION)) + if (data.getPrimaryTypeName().equals(Constants.NT_VERSION)) { return new VersionImpl(data, session); } - else if (node.isNodeType(Constants.NT_VERSIONHISTORY)) + else if (data.getPrimaryTypeName().equals(Constants.NT_VERSIONHIS= TORY)) { return new VersionHistoryImpl(data, session); } Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.ext/src/test/java/org/e= xoplatform/services/jcr/ext/BaseStandaloneTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.ext/src/test/java/org/exoplat= form/services/jcr/ext/BaseStandaloneTest.java 2009-11-25 11:33:59 UTC (rev = 856) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.ext/src/test/java/org/exoplat= form/services/jcr/ext/BaseStandaloneTest.java 2009-11-25 12:59:51 UTC (rev = 857) @@ -388,7 +388,7 @@ return testFile; } = - protected void checkMixins(String[] mixins, NodeImpl node) + protected void checkMixins(String[] mixins, NodeImpl node) throws Repos= itoryException { try { Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/src/test/java/org/e= xoplatform/services/ftp/BaseStandaloneTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/src/test/java/org/exoplat= form/services/ftp/BaseStandaloneTest.java 2009-11-25 11:33:59 UTC (rev 856) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.ftp/src/test/java/org/exoplat= form/services/ftp/BaseStandaloneTest.java 2009-11-25 12:59:51 UTC (rev 857) @@ -343,7 +343,7 @@ return testFile; } = - protected void checkMixins(String[] mixins, NodeImpl node) + protected void checkMixins(String[] mixins, NodeImpl node) throws Repos= itoryException { try { --===============5101863474022543870==-- From do-not-reply at jboss.org Wed Nov 25 08:08:19 2009 Content-Type: multipart/mixed; boundary="===============7700138474941580479==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r858 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/lock. Date: Wed, 25 Nov 2009 08:08:18 -0500 Message-ID: <200911251308.nAPD8Ivu023163@svn01.web.mwc.hst.phx2.redhat.com> --===============7700138474941580479== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 08:08:18 -0500 (Wed, 25 Nov 2009) New Revision: 858 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/lock/TestLockCleanupOnRestart.java Log: EXOJCR-262: Added manual test for checking whether lock-properties are dele= ted on restart (startup) Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/api/lock/TestLockCleanupOnRestart.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java (= rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-25 13:08:18 UTC (= rev 858) @@ -0,0 +1,99 @@ +/* + * 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.api.lock; + +import org.exoplatform.services.jcr.JcrAPIBaseTest; +import org.exoplatform.services.jcr.impl.core.NodeImpl; +import org.hsqldb.DatabaseManager; + +import java.sql.Connection; +import java.sql.DriverManager; + +import javax.jcr.PathNotFoundException; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class TestLockCleanupOnRestart extends JcrAPIBaseTest +{ + + /* + * This test should be performed manually because it requires JCR tearD= own and startup without + * cleaning it's content. = + * = + * To check whether lock-properties are deleted as expected, first run: + * >mvn clean test -Dtest=3Dorg.exoplatform.services.jcr.api.lock.Te= stLockCleanupOnRestart + * then (without clean!) : + * >mvn test -Dtest=3Dorg.exoplatform.services.jcr.api.lock.TestLock= CleanupOnRestart + */ + + private static String testNodeName =3D "LockIt"; + + public void testLockCleanUp() throws Exception + { + log.info("/!\\ This test should be executed twice ('mvn clean test " + + "-Dtest=3D...' and then without 'clean') and separately from ot= her tests /!\\"); + NodeImpl node; + try + { + node =3D (NodeImpl)root.getNode(testNodeName); + log.info("Node \"/LockIt\" found, this is correct SECOND run."); + } + catch (PathNotFoundException e) + { + node =3D (NodeImpl)root.addNode(testNodeName); + node.addMixin("mix:lockable"); + log.info("Node \"/LockIt\" not found, this is probably FIRST run.= If not, " + + "ensure that \"clean\" is not invoked in \"maven test\"!"); + } + session.save(); + // locking the node with open-scoped deep lock. + // no exception should be thrown + try + { + node.lock(true, false); + // ok! + } + catch (Exception e) + { + fail("Unexpected exception" + e.getStackTrace()); + } + session.logout(); + } + + @Override + protected void tearDown() throws Exception + { + // super.tearDown in not invoked to prevent DB cleaning + // shutdown HSSQLDB :) + for (Object uri : DatabaseManager.getDatabaseURIs()) + { + try + { + Connection c =3D DriverManager.getConnection("jdbc:hsqldb:" + = uri.toString(), "sa", ""); + c.createStatement().execute("SHUTDOWN"); + } + catch (Throwable e) + { + } + } + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/api/lock/TestLockCleanupOnRestart.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native --===============7700138474941580479==-- From do-not-reply at jboss.org Wed Nov 25 08:55:16 2009 Content-Type: multipart/mixed; boundary="===============4952134202676572887==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r859 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 25 Nov 2009 08:55:16 -0500 Message-ID: <200911251355.nAPDtGBV030311@svn01.web.mwc.hst.phx2.redhat.com> --===============4952134202676572887== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-25 08:55:15 -0500 (Wed, 25 Nov 2009) New Revision: 859 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-199: updated(NodeData) - orderBefore check added Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 13:08:18 UTC (rev 858) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 13:55:15 UTC (rev 859) @@ -885,6 +885,14 @@ = // update in NODES node.put(ITEM_DATA, data); + + int currentDataIndex =3D data.getQPath().getEntries()[data.getQPath(= ).getEntries().length - 1].getIndex(); + int previousDataIndex =3D prevData.getQPath().getEntries()[data.getQ= Path().getEntries().length - 1].getIndex(); + if (currentDataIndex !=3D previousDataIndex) + { + // do update qpath of child nodes and properties + updateTreePath(node, data.getQPath()); + } } = /** --===============4952134202676572887==-- From do-not-reply at jboss.org Wed Nov 25 09:05:17 2009 Content-Type: multipart/mixed; boundary="===============5286709777225076683==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r860 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 25 Nov 2009 09:05:17 -0500 Message-ID: <200911251405.nAPE5HgU032533@svn01.web.mwc.hst.phx2.redhat.com> --===============5286709777225076683== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 09:05:17 -0500 (Wed, 25 Nov 2009) New Revision: 860 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-242: Added only javadoc comment for class Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 13:55:15 UTC (rev 859) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 14:05:17 UTC (rev 860) @@ -45,6 +45,8 @@ /** * Created by The eXo Platform SAS. * = + * Extends WorkspacePersistentDataManager, providing ability for storing l= ockData. + * = *
Date: 23.10.2009 * * @author
Peter N= edonosko = @@ -54,7 +56,7 @@ { = /** - * JBossCachePersistentDataManager constructor. + * JBossCacheWorkspaceDataManager constructor. * * @param dataContainer WorkspaceDataContainer * @param systemDataContainerHolder SystemDataContainerHolder @@ -65,6 +67,9 @@ super(dataContainer, systemDataContainerHolder); } = + /** + * @see org.exoplatform.services.jcr.impl.dataflow.persistent.Workspace= PersistentDataManager#save(org.exoplatform.services.jcr.dataflow.ItemStateC= hangesLog) + */ @Override public void save(ItemStateChangesLog changesLog) throws RepositoryExcep= tion { @@ -220,6 +225,7 @@ + "ms, " + data.getQPath().getAsString()); } } + // cleanup lockData for removed nodes for (String identifier : removeLocksList) { thisConnection.removeLockData(identifier); --===============5286709777225076683==-- From do-not-reply at jboss.org Wed Nov 25 09:35:01 2009 Content-Type: multipart/mixed; boundary="===============2210592631032656812==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r861 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 25 Nov 2009 09:35:01 -0500 Message-ID: <200911251435.nAPEZ1FG004843@svn01.web.mwc.hst.phx2.redhat.com> --===============2210592631032656812== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 09:35:01 -0500 (Wed, 25 Nov 2009) New Revision: 861 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-242: LockData removing logic changed. LockData is now removed on del= ete "jcr:lockIsDeep" Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 14:05:17 UTC (rev 860) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 14:35:01 UTC (rev 861) @@ -45,8 +45,6 @@ /** * Created by The eXo Platform SAS. * = - * Extends WorkspacePersistentDataManager, providing ability for storing l= ockData. - * = *
Date: 23.10.2009 * * @author Peter N= edonosko = @@ -56,7 +54,7 @@ { = /** - * JBossCacheWorkspaceDataManager constructor. + * JBossCachePersistentDataManager constructor. * * @param dataContainer WorkspaceDataContainer * @param systemDataContainerHolder SystemDataContainerHolder @@ -67,9 +65,6 @@ super(dataContainer, systemDataContainerHolder); } = - /** - * @see org.exoplatform.services.jcr.impl.dataflow.persistent.Workspace= PersistentDataManager#save(org.exoplatform.services.jcr.dataflow.ItemStateC= hangesLog) - */ @Override public void save(ItemStateChangesLog changesLog) throws RepositoryExcep= tion { @@ -81,7 +76,6 @@ = WorkspaceStorageConnection thisConnection =3D null; WorkspaceStorageConnection systemConnection =3D null; - List removeLocksList =3D new ArrayList(); = // prepare changes log list List chengesLogList =3D new ArrayList(); @@ -198,22 +192,22 @@ if (itemState.isAdded()) { doAdd(data, conn, addedNodes); - removeLocksList.remove(data.getIdentifier()); } else if (itemState.isUpdated()) { doUpdate(data, conn); - removeLocksList.remove(data.getIdentifier()); } else if (itemState.isDeleted()) { doDelete(data, conn); - removeLocksList.add(data.getIdentifier()); + if (!data.isNode() & data.getQName().equals(Constants.JC= R_LOCKISDEEP)) + { + conn.removeLockData(data.getIdentifier()); + } } else if (itemState.isRenamed()) { doRename(data, conn, addedNodes); - removeLocksList.remove(data.getIdentifier()); } else if (itemState.isMixinChanged()) { @@ -225,11 +219,6 @@ + "ms, " + data.getQPath().getAsString()); } } - // cleanup lockData for removed nodes - for (String identifier : removeLocksList) - { - thisConnection.removeLockData(identifier); - } if (thisConnection !=3D null) thisConnection.commit(); if (systemConnection !=3D null && !systemConnection.equals(thisCo= nnection)) @@ -261,4 +250,4 @@ return path.isDescendantOf(Constants.JCR_SYSTEM_PATH) || path.equals= (Constants.JCR_SYSTEM_PATH); } = -} +} \ No newline at end of file --===============2210592631032656812==-- From do-not-reply at jboss.org Wed Nov 25 09:53:11 2009 Content-Type: multipart/mixed; boundary="===============3013058986747102573==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r862 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Wed, 25 Nov 2009 09:53:11 -0500 Message-ID: <200911251453.nAPErBfc008526@svn01.web.mwc.hst.phx2.redhat.com> --===============3013058986747102573== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 09:53:11 -0500 (Wed, 25 Nov 2009) New Revision: 862 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java Log: EXOJCR-242: (refactoring) LockData is now removed on delete "jcr:lockIsDeep" Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 14:35:01 UTC (rev 861) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 200= 9-11-25 14:53:11 UTC (rev 862) @@ -25,6 +25,8 @@ import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.ReadOnlyThroughChanges; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockData; @@ -40,6 +42,7 @@ import java.util.List; import java.util.Set; = +import javax.jcr.InvalidItemStateException; import javax.jcr.RepositoryException; = /** @@ -200,10 +203,6 @@ else if (itemState.isDeleted()) { doDelete(data, conn); - if (!data.isNode() & data.getQName().equals(Constants.JC= R_LOCKISDEEP)) - { - conn.removeLockData(data.getIdentifier()); - } } else if (itemState.isRenamed()) { @@ -238,6 +237,26 @@ notifySaveItems(changesLog); } = + @Override + protected void doDelete(TransientItemData item, WorkspaceStorageConnect= ion con) throws RepositoryException, + InvalidItemStateException + { + if (item.isNode()) + { + con.delete((NodeData)item); + } + else + { + con.delete((PropertyData)item); + // if property JCR:LOCKISDEEP is removed then remove lockData als= o. + // This is the case, when locked node is deleted + if (item.getQName().equals(Constants.JCR_LOCKISDEEP)) + { + con.removeLockData(item.getIdentifier()); + } + } + } + /** * Tell if the path is jcr:system descendant. * = --===============3013058986747102573==-- From do-not-reply at jboss.org Wed Nov 25 09:56:58 2009 Content-Type: multipart/mixed; boundary="===============4198690668818549169==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r863 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db. Date: Wed, 25 Nov 2009 09:56:58 -0500 Message-ID: <200911251456.nAPEuwrb009163@svn01.web.mwc.hst.phx2.redhat.com> --===============4198690668818549169== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 09:56:57 -0500 (Wed, 25 Nov 2009) New Revision: 863 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java Log: EXOJCR-262: Cleanup lock data on startup: refactoring. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-25 14:53= :11 UTC (rev 862) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-25 14:56= :57 UTC (rev 863) @@ -763,8 +763,8 @@ if (deleteLockValues =3D=3D null) { deleteLockValues =3D dbConnection.prepareStatement(DELETE_LOCK_VA= LUES); - deleteLockValues.setString(1, "[" + Constants.NS_JCR_URI + "]" + = Constants.JCR_LOCKISDEEP.getName()); - deleteLockValues.setString(2, "[" + Constants.NS_JCR_URI + "]" + = Constants.JCR_LOCKOWNER.getName()); + deleteLockValues.setString(1, Constants.JCR_LOCKISDEEP.getAsStrin= g()); + deleteLockValues.setString(2, Constants.JCR_LOCKOWNER.getAsString= ()); } = deleteLockValues.executeUpdate(); @@ -773,8 +773,8 @@ if (deleteLockProperties =3D=3D null) { deleteLockProperties =3D dbConnection.prepareStatement(DELETE_LOC= K_PROPERTIES); - deleteLockProperties.setString(1, "[" + Constants.NS_JCR_URI + "]= " + Constants.JCR_LOCKISDEEP.getName()); - deleteLockProperties.setString(2, "[" + Constants.NS_JCR_URI + "]= " + Constants.JCR_LOCKOWNER.getName()); + deleteLockProperties.setString(1, Constants.JCR_LOCKISDEEP.getAsS= tring()); + deleteLockProperties.setString(2, Constants.JCR_LOCKOWNER.getAsSt= ring()); } = deleteLockProperties.executeUpdate(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-25 14:5= 3:11 UTC (rev 862) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-25 14:5= 6:57 UTC (rev 863) @@ -780,8 +780,8 @@ if (deleteLockValues =3D=3D null) { deleteLockValues =3D dbConnection.prepareStatement(DELETE_LOCK_VA= LUES); - deleteLockValues.setString(1, "[" + Constants.NS_JCR_URI + "]" + = Constants.JCR_LOCKISDEEP.getName()); - deleteLockValues.setString(2, "[" + Constants.NS_JCR_URI + "]" + = Constants.JCR_LOCKOWNER.getName()); + deleteLockValues.setString(1, Constants.JCR_LOCKISDEEP.getAsStrin= g()); + deleteLockValues.setString(2, Constants.JCR_LOCKOWNER.getAsString= ()); } = deleteLockValues.executeUpdate(); @@ -790,8 +790,8 @@ if (deleteLockProperties =3D=3D null) { deleteLockProperties =3D dbConnection.prepareStatement(DELETE_LOC= K_PROPERTIES); - deleteLockProperties.setString(1, "[" + Constants.NS_JCR_URI + "]= " + Constants.JCR_LOCKISDEEP.getName()); - deleteLockProperties.setString(2, "[" + Constants.NS_JCR_URI + "]= " + Constants.JCR_LOCKOWNER.getName()); + deleteLockProperties.setString(1, Constants.JCR_LOCKISDEEP.getAsS= tring()); + deleteLockProperties.setString(2, Constants.JCR_LOCKOWNER.getAsSt= ring()); } = deleteLockProperties.executeUpdate(); --===============4198690668818549169==-- From do-not-reply at jboss.org Wed Nov 25 10:15:05 2009 Content-Type: multipart/mixed; boundary="===============4229488301478752609==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r864 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/lock. Date: Wed, 25 Nov 2009 10:15:05 -0500 Message-ID: <200911251515.nAPFF5eR012631@svn01.web.mwc.hst.phx2.redhat.com> --===============4229488301478752609== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 10:15:04 -0500 (Wed, 25 Nov 2009) New Revision: 864 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/lock/TestLockCleanupOnRestart.java Log: EXOJCR-262: test excluded Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/lock/TestLockCleanupOnRestart.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-25 14:56:57 UTC (= rev 863) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-25 15:15:04 UTC (= rev 864) @@ -47,7 +47,7 @@ = private static String testNodeName =3D "LockIt"; = - public void testLockCleanUp() throws Exception + public void _testLockCleanUp() throws Exception { log.info("/!\\ This test should be executed twice ('mvn clean test " + "-Dtest=3D...' and then without 'clean') and separately from ot= her tests /!\\"); @@ -76,7 +76,6 @@ { fail("Unexpected exception" + e.getStackTrace()); } - session.logout(); } = @Override --===============4229488301478752609==-- From do-not-reply at jboss.org Wed Nov 25 10:17:50 2009 Content-Type: multipart/mixed; boundary="===============3447961767899810406==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r865 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/lock. Date: Wed, 25 Nov 2009 10:17:50 -0500 Message-ID: <200911251517.nAPFHoJD013338@svn01.web.mwc.hst.phx2.redhat.com> --===============3447961767899810406== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 10:17:49 -0500 (Wed, 25 Nov 2009) New Revision: 865 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/lock/TestLockCleanupOnRestart.java Log: EXOJCR-262: session.logOut - removed. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/lock/TestLockCleanupOnRestart.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-25 15:15:04 UTC (= rev 864) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-25 15:17:49 UTC (= rev 865) @@ -47,7 +47,7 @@ = private static String testNodeName =3D "LockIt"; = - public void _testLockCleanUp() throws Exception + public void testLockCleanUp() throws Exception { log.info("/!\\ This test should be executed twice ('mvn clean test " + "-Dtest=3D...' and then without 'clean') and separately from ot= her tests /!\\"); --===============3447961767899810406==-- From do-not-reply at jboss.org Wed Nov 25 10:24:48 2009 Content-Type: multipart/mixed; boundary="===============1054404132847796965==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r866 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/lock. Date: Wed, 25 Nov 2009 10:24:48 -0500 Message-ID: <200911251524.nAPFOmCW014683@svn01.web.mwc.hst.phx2.redhat.com> --===============1054404132847796965== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 10:24:48 -0500 (Wed, 25 Nov 2009) New Revision: 866 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/lock/TestLockCleanupOnRestart.java Log: EXOJCR-262: test fully commented Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/api/lock/TestLockCleanupOnRestart.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-25 15:17:49 UTC (= rev 865) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-25 15:24:48 UTC (= rev 866) @@ -37,7 +37,7 @@ = /* * This test should be performed manually because it requires JCR tearD= own and startup without - * cleaning it's content. = + * cleaning it's content. BEFORE TESTING UNCOMMENT TEST BODY and TEAR D= OWN = * = * To check whether lock-properties are deleted as expected, first run: * >mvn clean test -Dtest=3Dorg.exoplatform.services.jcr.api.lock.Te= stLockCleanupOnRestart @@ -49,50 +49,50 @@ = public void testLockCleanUp() throws Exception { - log.info("/!\\ This test should be executed twice ('mvn clean test " - + "-Dtest=3D...' and then without 'clean') and separately from ot= her tests /!\\"); - NodeImpl node; - try - { - node =3D (NodeImpl)root.getNode(testNodeName); - log.info("Node \"/LockIt\" found, this is correct SECOND run."); - } - catch (PathNotFoundException e) - { - node =3D (NodeImpl)root.addNode(testNodeName); - node.addMixin("mix:lockable"); - log.info("Node \"/LockIt\" not found, this is probably FIRST run.= If not, " - + "ensure that \"clean\" is not invoked in \"maven test\"!"); - } - session.save(); - // locking the node with open-scoped deep lock. - // no exception should be thrown - try - { - node.lock(true, false); - // ok! - } - catch (Exception e) - { - fail("Unexpected exception" + e.getStackTrace()); - } +// log.info("/!\\ This test should be executed twice ('mvn clean test= " +// + "-Dtest=3D...' and then without 'clean') and separately from = other tests /!\\"); +// NodeImpl node; +// try +// { +// node =3D (NodeImpl)root.getNode(testNodeName); +// log.info("Node \"/LockIt\" found, this is correct SECOND run."); +// } +// catch (PathNotFoundException e) +// { +// node =3D (NodeImpl)root.addNode(testNodeName); +// node.addMixin("mix:lockable"); +// log.info("Node \"/LockIt\" not found, this is probably FIRST ru= n. If not, " +// + "ensure that \"clean\" is not invoked in \"maven test\"!"); +// } +// session.save(); +// // locking the node with open-scoped deep lock. +// // no exception should be thrown +// try +// { +// node.lock(true, false); +// // ok! +// } +// catch (Exception e) +// { +// fail("Unexpected exception" + e.getStackTrace()); +// } } = - @Override - protected void tearDown() throws Exception - { - // super.tearDown in not invoked to prevent DB cleaning - // shutdown HSSQLDB :) - for (Object uri : DatabaseManager.getDatabaseURIs()) - { - try - { - Connection c =3D DriverManager.getConnection("jdbc:hsqldb:" + = uri.toString(), "sa", ""); - c.createStatement().execute("SHUTDOWN"); - } - catch (Throwable e) - { - } - } - } +// @Override +// protected void tearDown() throws Exception +// { +// // super.tearDown in not invoked to prevent DB cleaning +// // shutdown HSSQLDB :) +// for (Object uri : DatabaseManager.getDatabaseURIs()) +// { +// try +// { +// Connection c =3D DriverManager.getConnection("jdbc:hsqldb:" = + uri.toString(), "sa", ""); +// c.createStatement().execute("SHUTDOWN"); +// } +// catch (Throwable e) +// { +// } +// } +// } } --===============1054404132847796965==-- From do-not-reply at jboss.org Wed Nov 25 10:27:16 2009 Content-Type: multipart/mixed; boundary="===============2696341693153749802==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r867 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 25 Nov 2009 10:27:16 -0500 Message-ID: <200911251527.nAPFRGU6015386@svn01.web.mwc.hst.phx2.redhat.com> --===============2696341693153749802== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-25 10:27:16 -0500 (Wed, 25 Nov 2009) New Revision: 867 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-199: remove perviousData from parent child list updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 15:24:48 UTC (rev 866) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 15:27:16 UTC (rev 867) @@ -657,9 +657,25 @@ } = // remove node form old parent child list - if (!prevParent - .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[pr= evData.getQPath().getEntries().length - 1]))) + // TODO node may me renamed before (using update) so name in list of= parent may link to another node + // may be there is sence left node without linking in list of parent= child nodes. (check it in update) + Node cNode =3D + prevParent + .getChild(makeChildNodeFqn(prevData.getQPath().getEntries()[pr= evData.getQPath().getEntries().length - 1])); + if (cNode !=3D null) { + if (!((String)cNode.get(ITEM_ID)).equals(prevData.getIdentifier()= )) + { + LOG.warn(" Node was updated before " + prevData.getQPath()); + } + else if (!prevParent.removeChild(cNode)) + { + throw new RepositoryException("FATAL Node was not removed from= list of parent node " + + prevData.getQPath().getAsString() + ". Node " + data.getQ= Path().getAsString()); + } + } + else + { throw new RepositoryException("FATAL Node doesn't listed in child= ren nodes of previous parent " + prevData.getQPath().getAsString() + ". Node " + data.getQPat= h().getAsString()); } --===============2696341693153749802==-- From do-not-reply at jboss.org Wed Nov 25 11:18:10 2009 Content-Type: multipart/mixed; boundary="===============8146204962701952201==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r868 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 25 Nov 2009 11:18:10 -0500 Message-ID: <200911251618.nAPGIAAl028442@svn01.web.mwc.hst.phx2.redhat.com> --===============8146204962701952201== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-25 11:18:09 -0500 (Wed, 25 Nov 2009) New Revision: 868 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-203 : Fix method JBossCacheStorageConnection.rename() Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 15:27:16 UTC (rev 867) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 16:18:09 UTC (rev 868) @@ -668,7 +668,7 @@ { LOG.warn(" Node was updated before " + prevData.getQPath()); } - else if (!prevParent.removeChild(cNode)) + else if (!prevParent.removeChild(cNode.getFqn().getLastElement())) { throw new RepositoryException("FATAL Node was not removed from= list of parent node " + prevData.getQPath().getAsString() + ". Node " + data.getQ= Path().getAsString()); --===============8146204962701952201==-- From do-not-reply at jboss.org Wed Nov 25 11:29:28 2009 Content-Type: multipart/mixed; boundary="===============0049324031847393716==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r869 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 25 Nov 2009 11:29:28 -0500 Message-ID: <200911251629.nAPGTSOD030379@svn01.web.mwc.hst.phx2.redhat.com> --===============0049324031847393716== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-25 11:29:28 -0500 (Wed, 25 Nov 2009) New Revision: 869 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-199: remove perviousData from parent child list updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 16:18:09 UTC (rev 868) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 16:29:28 UTC (rev 869) @@ -659,19 +659,29 @@ // remove node form old parent child list // TODO node may me renamed before (using update) so name in list of= parent may link to another node // may be there is sence left node without linking in list of parent= child nodes. (check it in update) - Node cNode =3D - prevParent - .getChild(makeChildNodeFqn(prevData.getQPath().getEntries()[pr= evData.getQPath().getEntries().length - 1])); - if (cNode !=3D null) + Fqn prevPath =3D + makeChildNodeFqn(prevData.getQPath().getEntries()[prevData.getQPa= th().getEntries().length - 1]); + Node prevNameNode =3D prevParent.getChild(prev= Path); + if (prevNameNode !=3D null) { - if (!((String)cNode.get(ITEM_ID)).equals(prevData.getIdentifier()= )) + String prevNameNodeId =3D (String)prevNameNode.get(ITEM_ID); + if (prevNameNodeId !=3D null) { - LOG.warn(" Node was updated before " + prevData.getQPath()); + if (prevNameNodeId.equals(data.getIdentifier())) + { + // it's same-name siblings re-ordering, delete previous chi= ld + if (!prevParent.removeChild(prevPath)) + { + if (!prevParent.removeChild(prevNameNode.getFqn().getLas= tElement())) + throw new RepositoryException("FATAL Node was not rem= oved from list of parent node " + + prevData.getQPath().getAsString() + ". Node " + = data.getQPath().getAsString()); + } + } // else ok } - else if (!prevParent.removeChild(cNode.getFqn().getLastElement())) + else { - throw new RepositoryException("FATAL Node was not removed from= list of parent node " - + prevData.getQPath().getAsString() + ". Node " + data.getQ= Path().getAsString()); + throw new RepositoryException("FATAL Child Node extists but IT= EM_ID is empty " + prevNameNode.getFqn() + + ". Rename of " + data.getQPath().getAsString()); } } else --===============0049324031847393716==-- From do-not-reply at jboss.org Wed Nov 25 11:58:20 2009 Content-Type: multipart/mixed; boundary="===============0295447570461968043==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r870 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Wed, 25 Nov 2009 11:58:20 -0500 Message-ID: <200911251658.nAPGwKk9003332@svn01.web.mwc.hst.phx2.redhat.com> --===============0295447570461968043== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-25 11:58:20 -0500 (Wed, 25 Nov 2009) New Revision: 870 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-203: ordering of child nodes by orderNumb Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 16:29:28 UTC (rev 869) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -25 16:58:20 UTC (rev 870) @@ -39,6 +39,8 @@ import java.io.Serializable; import java.io.UnsupportedEncodingException; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -77,7 +79,18 @@ private boolean batchStarted =3D false; = private boolean isCommited =3D false; + = + class NodesOrderComparator implements Comparator { = + /** + * {@inheritDoc} + */ + public int compare(NodeData n1, NodeData n2) + { + return n1.getOrderNumber() - n2.getOrderNumber(); + } + } + /** * JBossCacheStorageConnection constructor. * @@ -372,6 +385,9 @@ // throw new RepositoryException("FATAL Get child Nodes: parent n= ot found " + parent.getQPath().getAsString()); } = + // TODO We have to order childs by orderNumber, as JBC returns child= s in any order + Collections.sort(childs, new NodesOrderComparator()); + = return childs; } = --===============0295447570461968043==-- From do-not-reply at jboss.org Wed Nov 25 12:03:05 2009 Content-Type: multipart/mixed; boundary="===============7520561365532681777==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r871 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session. Date: Wed, 25 Nov 2009 12:03:05 -0500 Message-ID: <200911251703.nAPH35oD004429@svn01.web.mwc.hst.phx2.redhat.com> --===============7520561365532681777== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-25 12:03:04 -0500 (Wed, 25 Nov 2009) New Revision: 871 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/session/TransactionableDataManager.java Log: EXOJCR-243: Added functionality in transactions Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/session/TransactionableDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java 2009-11-25= 16:58:20 UTC (rev 870) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java 2009-11-25= 17:03:04 UTC (rev 871) @@ -18,10 +18,13 @@ */ package org.exoplatform.services.jcr.impl.dataflow.session; = +import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; import org.exoplatform.services.jcr.dataflow.DataManager; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.LockPlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; +import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; @@ -30,6 +33,7 @@ import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; +import org.exoplatform.services.jcr.observation.ExtendedEvent; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.transaction.TransactionException; @@ -268,7 +272,35 @@ */ public LockData getLockData(String identifier) throws RepositoryExcepti= on { - return storageDataManager.getLockData(identifier); + LockData lockData =3D null; + if (txStarted()) + { + // This is a transaction. Check if the node was locked inside thi= s transaction + ChangesLogIterator changesLogIterator =3D transactionLog.getLogIt= erator(); + while (changesLogIterator.hasNextLog()) + { + PlainChangesLog plainChangesLog =3D changesLogIterator.nextLog= (); + if (plainChangesLog.getEventType() =3D=3D ExtendedEvent.LOCK) + { + if (((LockPlainChangesLogImpl)plainChangesLog).getLockData(= ).getNodeIdentifier().equals(identifier)) + { + lockData =3D ((LockPlainChangesLogImpl)plainChangesLog).= getLockData(); + } + } + else if (plainChangesLog.getEventType() =3D=3D ExtendedEvent.U= NLOCK) + { + if (plainChangesLog.getSize() =3D=3D 2) + { + ItemState itemState =3D plainChangesLog.getAllStates().g= et(0); + if (itemState.getData().getParentIdentifier().equals(ide= ntifier)) + { + lockData =3D null; + } + } + } + } + } + return lockData =3D=3D null ? storageDataManager.getLockData(identif= ier) : lockData; } = /** --===============7520561365532681777==-- From do-not-reply at jboss.org Thu Nov 26 03:32:25 2009 Content-Type: multipart/mixed; boundary="===============5303302111992717121==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r872 - jcr/branches/1.12.0-JBC/component/core. Date: Thu, 26 Nov 2009 03:32:25 -0500 Message-ID: <200911260832.nAQ8WP0R025397@svn01.web.mwc.hst.phx2.redhat.com> --===============5303302111992717121== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-26 03:32:25 -0500 (Thu, 26 Nov 2009) New Revision: 872 Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml Log: EXOJCR-199 : excluded TestLinkedWorkspaceStorageCache Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-25 17:03:04 UTC = (rev 871) +++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-26 08:32:25 UTC = (rev 872) @@ -352,6 +352,7 @@ org/exoplatform/services/jcr/**/TestErrorMultit= hreading.java org/exoplatform/services/jcr/**/api/**/TestSame= NameItems.java org/exoplatform/services/jcr/**/api/**/TestVers= ionRestore.java + org/exoplatform/services/jcr/**/impl/**/TestLin= kedWorkspaceStorageCache.java org/exoplatform/services/jcr/**/impl/**/TestWor= kspaceManagement.java org/exoplatform/services/jcr/**/impl/**/TestRep= ositoryManagement.java org/exoplatform/services/jcr/**/impl/**/TestSav= eConfiguration.java --===============5303302111992717121==-- From do-not-reply at jboss.org Thu Nov 26 05:06:23 2009 Content-Type: multipart/mixed; boundary="===============5165506733177196470==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r873 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/access. Date: Thu, 26 Nov 2009 05:06:23 -0500 Message-ID: <200911261006.nAQA6Nme011294@svn01.web.mwc.hst.phx2.redhat.com> --===============5165506733177196470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-26 05:06:23 -0500 (Thu, 26 Nov 2009) New Revision: 873 Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/impl/access/TestAccess.java Log: EXOJCR-12 : port of test from 1.10.x 1.11.x Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/impl/access/TestAccess.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/access/TestAccess.java 2009-11-26 08:32:25 UTC (rev 872) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/impl/access/TestAccess.java 2009-11-26 10:06:23 UTC (rev 873) @@ -250,6 +250,41 @@ } = /** + * tests child-parent permission inheritance + * = + * @throws Exception + */ + public void testPermissionInheritance1() throws Exception + { + NodeImpl node =3D (NodeImpl)accessTestRoot.addNode("testPermissionIn= heritance"); + node.addMixin("exo:owneable"); + node.addMixin("exo:privilegeable"); + + // change permission + HashMap perm =3D new HashMap(); + perm.put("exo1", new String[]{PermissionType.ADD_NODE, PermissionTyp= e.READ}); + node.setPermissions(perm); + NodeImpl node1 =3D (NodeImpl)node.addNode("node1"); + assertEquals(node.getACL(), node1.getACL()); + // add grandchild node and test if acl is equal to grandparent + NodeImpl node2 =3D (NodeImpl)node1.addNode("node1"); + assertEquals(node.getACL(), node2.getACL()); + NodeImpl node3 =3D (NodeImpl)node1.addNode("node3"); + session.save(); + assertEquals(node3.getACL(), node1.getACL()); + perm.put("exo2", new String[]{PermissionType.ADD_NODE, PermissionTyp= e.READ}); + assertEquals(node3.getACL(), node.getACL()); + node.setPermissions(perm); + session.save(); + node1 =3D (NodeImpl)node.getNode("node1"); + node3 =3D (NodeImpl)node1.getNode("node3"); + + assertEquals(node3.getACL(), node.getACL()); + assertEquals(((ExtendedNode)node.getNode("node1")).getACL(), node.ge= tACL()); + assertEquals(((ExtendedNode)node.getNode("node1/node3")).getACL(), n= ode.getACL()); + } + + /** * tests session.checkPermission() method * = * @throws Exception --===============5165506733177196470==-- From do-not-reply at jboss.org Thu Nov 26 05:38:27 2009 Content-Type: multipart/mixed; boundary="===============2888604465272136962==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r874 - kernel/trunk. Date: Thu, 26 Nov 2009 05:38:26 -0500 Message-ID: <200911261038.nAQAcQwg018525@svn01.web.mwc.hst.phx2.redhat.com> --===============2888604465272136962== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 05:38:26 -0500 (Thu, 26 Nov 2009) New Revision: 874 Added: kernel/trunk/exo.kernel.component.ext.cache/ Log: EXOJCR-268 exo.kernel.component.ext.cache project added --===============2888604465272136962==-- From do-not-reply at jboss.org Thu Nov 26 06:04:07 2009 Content-Type: multipart/mixed; boundary="===============1076506498961099340==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r875 - jcr/branches/1.12.0-JBC. Date: Thu, 26 Nov 2009 06:04:06 -0500 Message-ID: <200911261104.nAQB46ev022908@svn01.web.mwc.hst.phx2.redhat.com> --===============1076506498961099340== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-26 06:04:06 -0500 (Thu, 26 Nov 2009) New Revision: 875 Modified: jcr/branches/1.12.0-JBC/pom.xml Log: EXOJCR-199 : The dependency to core kernal ws was changed in ./branche/1.12= .0-JBC was changed. Modified: jcr/branches/1.12.0-JBC/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/pom.xml 2009-11-26 10:38:26 UTC (rev 874) +++ jcr/branches/1.12.0-JBC/pom.xml 2009-11-26 11:04:06 UTC (rev 875) @@ -25,7 +25,7 @@ org.exoplatform foundation-parent - 3-SNAPSHOT + 3 = org.exoplatform.jcr @@ -38,9 +38,9 @@ exo-jcr 1.12 - 2.2.0-Beta03-SNAPSHOT - 2.3.0-Beta03-SNAPSHOT - 2.1.0-Beta03-SNAPSHOT + 2.2.0-Beta04 + 2.3.0-Beta04 + 2.1.0-Beta04 = --===============1076506498961099340==-- From do-not-reply at jboss.org Thu Nov 26 06:13:27 2009 Content-Type: multipart/mixed; boundary="===============3408120573726011044==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r876 - in jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr: lab and 1 other directories. Date: Thu, 26 Nov 2009 06:13:27 -0500 Message-ID: <200911261113.nAQBDRn0025341@svn01.web.mwc.hst.phx2.redhat.com> --===============3408120573726011044== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-26 06:13:27 -0500 (Thu, 26 Nov 2009) New Revision: 876 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/AbstractRestartTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/TestLockCleanup.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/TestVersionHistory.java Removed: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/api/lock/TestLockCleanupOnRestart.java Log: EXOJCR-199: Added restart test on Versioning and moved Lock properties clea= nup. Deleted: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatfo= rm/services/jcr/api/lock/TestLockCleanupOnRestart.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-26 11:04:06 UTC (= rev 875) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLockCleanupOnRestart.java 2009-11-26 11:13:27 UTC (= rev 876) @@ -1,98 +0,0 @@ -/* - * 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.api.lock; - -import org.exoplatform.services.jcr.JcrAPIBaseTest; -import org.exoplatform.services.jcr.impl.core.NodeImpl; -import org.hsqldb.DatabaseManager; - -import java.sql.Connection; -import java.sql.DriverManager; - -import javax.jcr.PathNotFoundException; - -/** - * @author Nikolay Zamosenchuk - * @version $Id$ - * - */ -public class TestLockCleanupOnRestart extends JcrAPIBaseTest -{ - - /* - * This test should be performed manually because it requires JCR tearD= own and startup without - * cleaning it's content. BEFORE TESTING UNCOMMENT TEST BODY and TEAR D= OWN = - * = - * To check whether lock-properties are deleted as expected, first run: - * >mvn clean test -Dtest=3Dorg.exoplatform.services.jcr.api.lock.Te= stLockCleanupOnRestart - * then (without clean!) : - * >mvn test -Dtest=3Dorg.exoplatform.services.jcr.api.lock.TestLock= CleanupOnRestart - */ - - private static String testNodeName =3D "LockIt"; - - public void testLockCleanUp() throws Exception - { -// log.info("/!\\ This test should be executed twice ('mvn clean test= " -// + "-Dtest=3D...' and then without 'clean') and separately from = other tests /!\\"); -// NodeImpl node; -// try -// { -// node =3D (NodeImpl)root.getNode(testNodeName); -// log.info("Node \"/LockIt\" found, this is correct SECOND run."); -// } -// catch (PathNotFoundException e) -// { -// node =3D (NodeImpl)root.addNode(testNodeName); -// node.addMixin("mix:lockable"); -// log.info("Node \"/LockIt\" not found, this is probably FIRST ru= n. If not, " -// + "ensure that \"clean\" is not invoked in \"maven test\"!"); -// } -// session.save(); -// // locking the node with open-scoped deep lock. -// // no exception should be thrown -// try -// { -// node.lock(true, false); -// // ok! -// } -// catch (Exception e) -// { -// fail("Unexpected exception" + e.getStackTrace()); -// } - } - -// @Override -// protected void tearDown() throws Exception -// { -// // super.tearDown in not invoked to prevent DB cleaning -// // shutdown HSSQLDB :) -// for (Object uri : DatabaseManager.getDatabaseURIs()) -// { -// try -// { -// Connection c =3D DriverManager.getConnection("jdbc:hsqldb:" = + uri.toString(), "sa", ""); -// c.createStatement().execute("SHUTDOWN"); -// } -// catch (Throwable e) -// { -// } -// } -// } -} Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/lab/restart/AbstractRestartTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/AbstractRestartTest.java (re= v 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/AbstractRestartTest.java 2009-11-26 11:13:27 UTC (re= v 876) @@ -0,0 +1,96 @@ +/* + * 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.restart; + +import org.exoplatform.services.jcr.JcrAPIBaseTest; +import org.hsqldb.DatabaseManager; + +import java.sql.Connection; +import java.sql.DriverManager; + +import javax.jcr.PathNotFoundException; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public abstract class AbstractRestartTest extends JcrAPIBaseTest +{ + protected boolean firstRun =3D true; + + private final String runNodeName =3D "SecondRun"; + + @Override + public void setUp() throws Exception + { + super.setUp(); + try + { + root.getNode(runNodeName); + // node exists, it means than this is second run + firstRun =3D false; + } + catch (PathNotFoundException e) + { + root.addNode(runNodeName); + } + session.save(); + if (firstRun) + { + log.info("/!\\ This is FIRST run"); + } + else + { + log.info("/!\\ This is SECOND run"); + } + } + + public boolean isFirstRun() + { + return firstRun; + } + + @Override + protected void tearDown() throws Exception + { + // super.tearDown in not invoked to prevent DB cleaning + // shutdown HSSQLDB :) + if (firstRun) + { + for (Object uri : DatabaseManager.getDatabaseURIs()) + { + try + { + Connection c =3D DriverManager.getConnection("jdbc:hsqldb:"= + uri.toString(), "sa", ""); + c.createStatement().execute("SHUTDOWN"); + } + catch (Throwable e) + { + } + } + } + else + { + super.tearDown(); + } + + } + +} \ No newline at end of file Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/lab/restart/AbstractRestartTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/lab/restart/TestLockCleanup.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestLockCleanup.java (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestLockCleanup.java 2009-11-26 11:13:27 UTC (rev 87= 6) @@ -0,0 +1,73 @@ +/* + * 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.restart; + +import org.exoplatform.services.jcr.impl.core.NodeImpl; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class TestLockCleanup extends AbstractRestartTest +{ + + /* + * This test should be performed manually because it requires JCR tearD= own and startup without + * cleaning it's content. = + * = + * To check whether lock-properties are deleted as expected, first run: + * >mvn clean test -Dtest=3Dorg.exoplatform.services.jcr.lab.restart= .TestLockCleanup + * then (without clean!) : + * >mvn test -Dtest=3Dorg.exoplatform.services.jcr.lab.restart.TestL= ockCleanup + */ + + private static String testNodeName =3D "LockIt"; + + public void testLockCleanUp() throws Exception + { + log.info("/!\\ This test should be executed twice ('mvn clean test " + + "-Dtest=3D...' and then without 'clean') and separately from ot= her tests /!\\"); + NodeImpl node; + if (!isFirstRun()) + { + node =3D (NodeImpl)root.getNode(testNodeName); + log.info("Node \"/LockIt\" found, this is correct SECOND run."); + } + else + { + node =3D (NodeImpl)root.addNode(testNodeName); + node.addMixin("mix:lockable"); + log.info("Node \"/LockIt\" not found, this is probably FIRST run.= If not, " + + "ensure that \"clean\" is not invoked in \"maven test\"!"); + } + session.save(); + // locking the node with open-scoped deep lock. + // no exception should be thrown + try + { + node.lock(true, false); + // ok! + } + catch (Exception e) + { + fail("Unexpected exception" + e.getStackTrace()); + } + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/lab/restart/TestLockCleanup.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/lab/restart/TestVersionHistory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestVersionHistory.java (rev= 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestVersionHistory.java 2009-11-26 11:13:27 UTC (rev= 876) @@ -0,0 +1,268 @@ +/* + * 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.restart; + +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.Node; +import javax.jcr.PathNotFoundException; +import javax.jcr.Property; +import javax.jcr.RepositoryException; +import javax.jcr.Value; +import javax.jcr.version.Version; +import javax.jcr.version.VersionHistory; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class TestVersionHistory extends AbstractRestartTest +{ + + /* + * This test should be performed manually because it requires JCR tearD= own and startup without + * cleaning it's content. = + * = + * For the first run: + * >mvn clean test -Dtest=3Dorg.exoplatform.services.jcr.lab.restart= .TestVersionHistory + * then (without clean!) : + * >mvn test -Dtest=3Dorg.exoplatform.services.jcr.lab.restart.TestV= ersionHistory + */ + + private Node testVersionable =3D null; + + public void testVersionHistory() throws Exception + { + if (isFirstRun()) + { + // prepare phase + Node testRoot =3D root.addNode("testRoot"); + testVersionable =3D testRoot.addNode("testVersionable", "nt:unstr= uctured"); + testVersionable.addMixin("mix:versionable"); + root.save(); + + // testVersionable =3D versionableNode; // it's nt:folder + + VersionHistory vHistory =3D testVersionable.getVersionHistory(); + + // Creating nodes: n1, n2 + Node n1 =3D testVersionable.addNode("n1"); + Node n2 =3D testVersionable.addNode("n2"); + testVersionable.save(); + Version ver1 =3D testVersionable.checkin(); // v1 + vHistory.addVersionLabel(ver1.getName(), "ver.1", false); + testVersionable.checkout(); + + // sameNameSibs nodes + // Creating nodes: n1[2], n1[3], n1[4] + Node snsN1_2 =3D testVersionable.addNode("n1"); + Node snsN1_3 =3D testVersionable.addNode("n1"); + Node snsN1_4 =3D testVersionable.addNode("n1"); + + // Creating node: n3 + Node n3 =3D testVersionable.addNode("n3"); + testVersionable.save(); + Version ver2 =3D testVersionable.checkin(); // v2 + vHistory.addVersionLabel(ver2.getName(), "ver.2", false); + testVersionable.checkout(); + + // Creating node: n4 + Node n4 =3D testVersionable.addNode("n4"); + testVersionable.save(); + Version ver3 =3D testVersionable.checkin(); // v3 + vHistory.addVersionLabel(ver3.getName(), "ver.3", false); + vHistory.addVersionLabel(ver3.getName(), "version 3.0", false); + testVersionable.checkout(); + + // Creating node: n5 + Node n5 =3D testVersionable.addNode("n5"); + testVersionable.save(); + Version ver4 =3D testVersionable.checkin(); // v4 + vHistory.addVersionLabel(ver4.getName(), "ver.4", false); + testVersionable.checkout(); + + if (log.isDebugEnabled()) + log.debug("=3D=3D=3D=3D=3D init =3D=3D=3D=3D=3D"); + checkItemsExisted(new String[]{n1.getPath(), snsN1_2.getPath(), s= nsN1_3.getPath(), snsN1_4.getPath(), + n2.getPath(), n3.getPath(), n4.getPath(), n5.getPath()}, null); + checkVersionHistory(testVersionable, 4); + + } + else + { + // test phase + Node testRoot =3D root.getNode("testRoot"); + testVersionable =3D testRoot.getNode("testVersionable"); + VersionHistory vHistory =3D testVersionable.getVersionHistory(); + Node n1 =3D testVersionable.getNode("n1"); + Node n2 =3D testVersionable.getNode("n2"); + Node n3 =3D testVersionable.getNode("n3"); + Node n4 =3D testVersionable.getNode("n4"); + Node n5 =3D testVersionable.getNode("n5"); + + Node snsN1_2 =3D testVersionable.getNode("n1[2]"); + Node snsN1_3 =3D testVersionable.getNode("n1[3]"); + Node snsN1_4 =3D testVersionable.getNode("n1[4]"); + + Version ver1 =3D vHistory.getVersionByLabel("ver.1"); + + // removing nodes: n2, n4 + n2.remove(); + n4.remove(); + testVersionable.save(); + if (log.isDebugEnabled()) + log.debug("=3D=3D=3D=3D=3D ver.1 before restore =3D=3D=3D=3D= =3D"); + checkItemsExisted(new String[]{n1.getPath(), snsN1_2.getPath(), s= nsN1_3.getPath(), snsN1_4.getPath(), + n3.getPath(), n5.getPath()}, new String[]{n2.getPath(), n4.get= Path()}); + checkVersionHistory(testVersionable, 4); + + // RESTORE ver.1 and n1, n2 will be restored + testVersionable.restore(ver1, true); + if (log.isDebugEnabled()) + log.debug("=3D=3D=3D=3D=3D ver.1 after restore =3D=3D=3D=3D=3D= "); + checkItemsExisted(new String[]{n1.getPath(), n2.getPath()}, new S= tring[]{snsN1_2.getPath(), snsN1_3.getPath(), + snsN1_4.getPath(), n3.getPath(), n4.getPath(), n5.getPath()}); + checkVersionHistory(testVersionable, 4); + + } + } + + protected void checkVersionHistory(Node versionable, int versionCount) = throws RepositoryException + { + + VersionHistory vHistory =3D versionable.getVersionHistory(); + Version rootVersion =3D vHistory.getRootVersion(); + if (log.isDebugEnabled()) + log.debug("rootVersion " + rootVersion.getPath()); + Version baseVersion =3D versionable.getBaseVersion(); + if (log.isDebugEnabled()) + log.debug("baseVersion " + baseVersion.getPath()); + + BaseVersionFinder baseVersionFinder =3D new BaseVersionFinder(baseVe= rsion); + + List refs =3D traverseVersionSubTree(rootVersion, baseVersion= Finder, vHistory, " --"); + if (refs.size() !=3D versionCount) + { + fail("Version history contains not all versions for node " + vers= ionable.getPath() + ", expected:" + + versionCount + " was:" + refs.size()); + } + if (!baseVersionFinder.isBaseVersionFound()) + { + fail("Base version not founded in version history tree for node "= + versionable.getPath() + + ", but exists if call versionable.getBaseVersion() " + baseV= ersion.getPath()); + } + } + + class BaseVersionFinder + { + + private Version baseVersion =3D null; + + private boolean baseVersionFound =3D false; + + BaseVersionFinder(Version baseVersion) + { + this.baseVersion =3D baseVersion; + } + + public Version getBaseVersion() + { + return baseVersion; + } + + public boolean check(Version someVersion) throws RepositoryException + { + + if (baseVersionFound) + return false; + + baseVersionFound =3D baseVersion.isSame(someVersion); + return baseVersionFound; + } + + public boolean isBaseVersionFound() + { + return baseVersionFound; + } + } + + protected List traverseVersionSubTree(Version ver, BaseVersionFi= nder baseVersionFinder, + VersionHistory vHistory, String outPrefix) throws RepositoryException + { + + List successorsRefs =3D new ArrayList(); + String vlInfo =3D ""; + String[] versionLabels =3D vHistory.getVersionLabels(ver); + for (String vl : versionLabels) + { + vlInfo +=3D (vlInfo.length() > 0 ? ", " + vl : vl); + } + if (baseVersionFinder.check(ver)) + { + // this is a base version + vlInfo =3D (vlInfo.length() > 0 ? " [" + vlInfo + "]" : "") + " >= >>Base version<<< "; + } + else + { + vlInfo =3D (vlInfo.length() > 0 ? " [" + vlInfo + "]" : ""); + } + if (log.isDebugEnabled()) + log.debug(outPrefix + " " + ver.getName() + vlInfo); + Value[] versionSuccessors =3D getSucessors(ver); + if (versionSuccessors !=3D null) + { + for (Value sv : versionSuccessors) + { + Version successor =3D (Version)session.getNodeByUUID(sv.getStr= ing()); + if (successor !=3D null) + { + successorsRefs.add(sv); + List successorSuccessors =3D + traverseVersionSubTree(successor, baseVersionFinder, vHi= story, " " + outPrefix); + if (successorSuccessors !=3D null) + { + successorsRefs.addAll(successorSuccessors); + } + } + else + { + fail("No item for successor UUID " + sv.getString()); + } + } + } + return successorsRefs; + } + + protected Value[] getSucessors(Version ver) throws RepositoryException + { + try + { + Property successors =3D ver.getProperty("jcr:successors"); + return successors.getValues(); + } + catch (PathNotFoundException e) + { + // fail("Property jcr:successors must exists for " + vp); + return null; + } + } + +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/lab/restart/TestVersionHistory.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native --===============3408120573726011044==-- From do-not-reply at jboss.org Thu Nov 26 06:33:25 2009 Content-Type: multipart/mixed; boundary="===============4210396627983536971==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r877 - in jcr/branches/1.12.0-OPT/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/load/perf and 1 other directory. Date: Thu, 26 Nov 2009 06:33:25 -0500 Message-ID: <200911261133.nAQBXP7t029202@svn01.web.mwc.hst.phx2.redhat.com> --===============4210396627983536971== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-26 06:33:24 -0500 (Thu, 26 Nov 2009) New Revision: 877 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/ItemImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/NodeImpl.java jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/load/perf/TestGetNodesPerf.java Log: EXOJCR-221: comments added, NodeImpl.hasNodes() improvements Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/ItemImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-26 11:13:27 UTC (rev 876) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/ItemImpl.java 2009-11-26 11:33:24 UTC (rev 877) @@ -765,8 +765,26 @@ return data.getIdentifier().equals(Constants.ROOT_UUID); } = + /** + * Loads data + * + * @param data + * source item data + * @throws RepositoryException = + * if errors occurs + */ abstract void loadData(ItemData data) throws RepositoryException; = + /** + * Loads data. + * + * @param data + * source item data + * @param itemDefinitionData + * source item definition data + * @throws RepositoryException + * if errors occurs + */ abstract void loadData(ItemData data, ItemDefinitionData itemDefinition= Data) throws RepositoryException; = /** Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/= exoplatform/services/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-26 11:13:27 UTC (rev 876) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exopla= tform/services/jcr/impl/core/NodeImpl.java 2009-11-26 11:33:24 UTC (rev 877) @@ -156,7 +156,7 @@ * @param data * Node data * @param parent - * Parent node data + * parent node data is used for simple calculation item defini= tion * @param session = * Session * @throws RepositoryException @@ -1254,7 +1254,7 @@ = checkValid(); = - return dataManager.getChildNodesData(nodeData()).size() > 0; + return dataManager.getChildNodesCount(nodeData()) > 0; } = /** @@ -1384,7 +1384,14 @@ } = /** - * {@inheritDoc} + * Loads data. + * + * @param data + * source item data for load = + * @param parent + * parent node data is used for simple calculation item defini= tion + * @throws RepositoryException = + * if error occurs */ private void loadData(ItemData data, NodeData parent) throws Repository= Exception, InvalidItemStateException, ConstraintViolationException Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/load/perf/TestGetNodesPerf.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-26 11:13:27 UTC = (rev 876) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-26 11:33:24 UTC = (rev 877) @@ -19,7 +19,11 @@ import org.exoplatform.services.jcr.JcrAPIBaseTest; import org.exoplatform.services.jcr.impl.core.SessionImpl; = +import java.util.ArrayList; +import java.util.List; + import javax.jcr.Node; +import javax.jcr.NodeIterator; import javax.jcr.RepositoryException; import javax.jcr.Session; = @@ -35,14 +39,16 @@ { private static final String testName =3D "testRoot"; = - private static final int sessionCount =3D 1; + private static final int sessionCount =3D 20; = - private static final int tryCount =3D 10; + private static final int tryCount =3D 5; = private Session[] sessions =3D new Session[sessionCount]; = private GetNodesThread[] threads =3D new GetNodesThread[sessionCount]; = + private NodeIterator[][] nodes =3D new NodeIterator[sessionCount][tryCo= unt]; + public void testGetNodes() throws Exception { = @@ -73,7 +79,7 @@ log.info("getting nodes..."); for (int i =3D 0; i < sessionCount; i++) { - threads[i] =3D new GetNodesThread(sessions[i]); + threads[i] =3D new GetNodesThread(sessions[i], i); threads[i].start(); } = @@ -90,16 +96,19 @@ = break; } - log.info("Memory used: " + (rt.totalMemory() - rt.freeMemory() - use= dMemory) / 1024 + "Kb"); + log.info("Memory used: " + (rt.totalMemory() - rt.freeMemory() - use= dMemory) / 1024 / 1024 + "Mb"); } = private class GetNodesThread extends Thread { private final Session curSession; = - GetNodesThread(Session session) + private final int sessionNumber; + + GetNodesThread(Session session, int sessionNumber) { this.curSession =3D session; + this.sessionNumber =3D sessionNumber; } = @Override @@ -114,9 +123,11 @@ long startTime =3D System.currentTimeMillis(); testRoot.getNodes(); log.info("Total time: " + (System.currentTimeMillis() - sta= rtTime) / 1000 + "s"); + + Thread.sleep(30000); } } - catch (RepositoryException e) + catch (Exception e) { e.printStackTrace(); } --===============4210396627983536971==-- From do-not-reply at jboss.org Thu Nov 26 06:46:37 2009 Content-Type: multipart/mixed; boundary="===============3599190078665400974==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r878 - jcr/branches/1.12.0-JBC/component/core. Date: Thu, 26 Nov 2009 06:46:37 -0500 Message-ID: <200911261146.nAQBkbWH032073@svn01.web.mwc.hst.phx2.redhat.com> --===============3599190078665400974== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-26 06:46:36 -0500 (Thu, 26 Nov 2009) New Revision: 878 Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml Log: EXOJCR-199: POM with exclusions Modified: jcr/branches/1.12.0-JBC/component/core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-26 11:33:24 UTC = (rev 877) +++ jcr/branches/1.12.0-JBC/component/core/pom.xml 2009-11-26 11:46:36 UTC = (rev 878) @@ -369,15 +369,15 @@ org/exoplatform/services/jcr/**/usecases/BaseUs= ecasesTest.java org/exoplatform/services/jcr/**/api/**/TestSame= NameItems.java org/exoplatform/services/jcr/**/api/**/TestVers= ionRestore.java - = + org/exoplatform/services/jcr/**/impl/**/TestLin= kedWorkspaceStorageCache.java + org/exoplatform/services/jcr/**/impl/**/TestLin= kedWorkspaceStorageCacheMetrics.java org/exoplatform/services/jcr/**/impl/**/TestSes= sionDataManager.java = - org.jibx - maven-jibx-plugin + org.jibx maven-jibx-= plugin src/main/resources @@ -569,10 +569,13 @@
- **/**/JBossCacheServiceTest__.java - **/**/TestItem__.java - **/**/LockCacheLoaderTest.java = - **/**/JBossCacheStorageConnectionTest.jav= a + **/**/JDBCCacheLoaderTest_.java + **/**/JBossCacheStorageConnectionTest_.ja= va + = + **/reading_/Test*.java + **/writing_/Test*.java + = + **/**/TestMoveNode.java --===============3599190078665400974==-- From do-not-reply at jboss.org Thu Nov 26 07:38:17 2009 Content-Type: multipart/mixed; boundary="===============0531378231461294247==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r879 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 26 Nov 2009 07:38:17 -0500 Message-ID: <200911261238.nAQCcHGY009828@svn01.web.mwc.hst.phx2.redhat.com> --===============0531378231461294247== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-26 07:38:16 -0500 (Thu, 26 Nov 2009) New Revision: 879 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-270: updatetreeACL implemented Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 11:46:36 UTC (rev 878) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 12:38:16 UTC (rev 879) @@ -18,12 +18,15 @@ */ package org.exoplatform.services.jcr.impl.storage.jbosscache; = +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; +import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.lock.LockData; import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; @@ -79,9 +82,10 @@ private boolean batchStarted =3D false; = private boolean isCommited =3D false; - = - class NodesOrderComparator implements Comparator { = + class NodesOrderComparator implements Comparator + { + /** * {@inheritDoc} */ @@ -387,7 +391,7 @@ = // TODO We have to order childs by orderNumber, as JBC returns child= s in any order Collections.sort(childs, new NodesOrderComparator()); - = + return childs; } = @@ -756,6 +760,14 @@ { ((TransientNodeData)data).addState(TransientNodeData.TRANSITIVE_M= IXIN_UPDATED); } + + // do update ACL if needed + + if (!prevData.getACL().equals(data.getACL())) + { + updateTreeACL(node, data.getACL()); + } + } = /** @@ -860,6 +872,61 @@ } = /** + * Update Nodes ACL with new ACL. + * + * @param node Node - cache node containing root of JCR subtree. = + * @param newACL - new ACL that must be inserted to node data. + * @throws RepositoryException on error state detected + */ + protected void updateTreeACL(Node node, AccessCon= trolList newACL) throws RepositoryException + { + + NodeData prevData =3D (NodeData)node.get(ITEM_DATA); + + // is exo:Privilegeable + boolean isPrivilegeable =3D false; + for (InternalQName mixin : prevData.getMixinTypeNames()) + { + if (mixin.equals(Constants.EXO_PRIVILEGEABLE)) + { + isPrivilegeable =3D true; + break; + } + } + + if (!isPrivilegeable || prevData.getACL().equals(newACL)) + { + // do update NodeData = + TransientNodeData newData =3D + new TransientNodeData(prevData.getQPath(), prevData.getIdentif= ier(), prevData.getPersistedVersion(), + prevData.getPrimaryTypeName(), prevData.getMixinTypeNames()= , prevData.getOrderNumber(), prevData + .getParentIdentifier(), newACL); + newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED); + node.put(ITEM_DATA, newData); + + // do update child nodes + + for (Node child : node.getChildren()) + { + String childNodeId =3D (String)child.get(ITEM_ID); + if (childNodeId =3D=3D null) + { + throw new RepositoryException("FATAL Child Node Id key is n= ull. Parent " + newData.getQPath()); + } + + Node childNode =3D nodesRoot.getChild(ma= keNodeFqn(childNodeId)); + if (childNode =3D=3D null) + { + throw new RepositoryException("FATAL Node record not found = (" + childNodeId + + "), but listed in childs of " + newData.getQPath()); + } + + updateTreeACL(childNode, newACL); + } + } + } + + /** * {@inheritDoc} */ public void update(NodeData data) throws RepositoryException, Unsupport= edOperationException, --===============0531378231461294247==-- From do-not-reply at jboss.org Thu Nov 26 08:17:10 2009 Content-Type: multipart/mixed; boundary="===============7162828152063498860==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r880 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf. Date: Thu, 26 Nov 2009 08:17:10 -0500 Message-ID: <200911261317.nAQDHA3P018724@svn01.web.mwc.hst.phx2.redhat.com> --===============7162828152063498860== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-26 08:17:10 -0500 (Thu, 26 Nov 2009) New Revision: 880 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/load/perf/TestGetNodesPerf.java Log: EXOJCR-221: test modified Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/load/perf/TestGetNodesPerf.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-26 12:38:16 UTC = (rev 879) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-26 13:17:10 UTC = (rev 880) @@ -47,11 +47,8 @@ = private GetNodesThread[] threads =3D new GetNodesThread[sessionCount]; = - private NodeIterator[][] nodes =3D new NodeIterator[sessionCount][tryCo= unt]; - public void testGetNodes() throws Exception { - for (int i =3D 0; i < sessionCount; i++) { sessions[i] =3D (SessionImpl)repository.login(credentials, "ws"); @@ -77,24 +74,27 @@ long usedMemory =3D rt.totalMemory() - rt.freeMemory(); = log.info("getting nodes..."); - for (int i =3D 0; i < sessionCount; i++) + for (int k =3D 0; k < tryCount; k++) { - threads[i] =3D new GetNodesThread(sessions[i], i); - threads[i].start(); - } - - outer : while (true) - { for (int i =3D 0; i < sessionCount; i++) { - if (threads[i].isAlive()) + threads[i] =3D new GetNodesThread(sessions[i]); + threads[i].start(); + } + + outer : while (true) + { + for (int i =3D 0; i < sessionCount; i++) { - Thread.sleep(1000); - continue outer; + if (threads[i].isAlive()) + { + Thread.sleep(1000); + continue outer; + } } - } = - break; + break; + } } log.info("Memory used: " + (rt.totalMemory() - rt.freeMemory() - use= dMemory) / 1024 / 1024 + "Mb"); } @@ -103,12 +103,11 @@ { private final Session curSession; = - private final int sessionNumber; + private NodeIterator nodes; = - GetNodesThread(Session session, int sessionNumber) + GetNodesThread(Session session) { this.curSession =3D session; - this.sessionNumber =3D sessionNumber; } = @Override @@ -118,14 +117,10 @@ { Node testRoot =3D curSession.getRootNode().getNode(testName); = - for (int k =3D 0; k < tryCount; k++) - { - long startTime =3D System.currentTimeMillis(); - testRoot.getNodes(); - log.info("Total time: " + (System.currentTimeMillis() - sta= rtTime) / 1000 + "s"); + long startTime =3D System.currentTimeMillis(); + nodes =3D testRoot.getNodes(); + log.info("Total time: " + (System.currentTimeMillis() - startT= ime) + "ms"); = - Thread.sleep(30000); - } } catch (Exception e) { --===============7162828152063498860==-- From do-not-reply at jboss.org Thu Nov 26 08:31:31 2009 Content-Type: multipart/mixed; boundary="===============3617692814742342065==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r881 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 26 Nov 2009 08:31:31 -0500 Message-ID: <200911261331.nAQDVV9h021895@svn01.web.mwc.hst.phx2.redhat.com> --===============3617692814742342065== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-26 08:31:31 -0500 (Thu, 26 Nov 2009) New Revision: 881 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-270: updateTreeACL - updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 13:17:10 UTC (rev 880) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 13:31:31 UTC (rev 881) @@ -896,14 +896,20 @@ = if (!isPrivilegeable || prevData.getACL().equals(newACL)) { - // do update NodeData = - TransientNodeData newData =3D - new TransientNodeData(prevData.getQPath(), prevData.getIdentif= ier(), prevData.getPersistedVersion(), - prevData.getPrimaryTypeName(), prevData.getMixinTypeNames()= , prevData.getOrderNumber(), prevData - .getParentIdentifier(), newACL); - newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED); - node.put(ITEM_DATA, newData); + // do update NodeData = + if (!prevData.getACL().equals(newACL)) + { + AccessControlList acl =3D new AccessControlList(prevData.getAC= L().getOwner(), newACL.getPermissionEntries()); + + TransientNodeData newData =3D + new TransientNodeData(prevData.getQPath(), prevData.getIden= tifier(), prevData.getPersistedVersion(), + prevData.getPrimaryTypeName(), prevData.getMixinTypeName= s(), prevData.getOrderNumber(), prevData + .getParentIdentifier(), acl); + newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED= ); + node.put(ITEM_DATA, newData); + } + // do update child nodes = for (Node child : node.getChildren()) @@ -911,14 +917,14 @@ String childNodeId =3D (String)child.get(ITEM_ID); if (childNodeId =3D=3D null) { - throw new RepositoryException("FATAL Child Node Id key is n= ull. Parent " + newData.getQPath()); + throw new RepositoryException("FATAL Child Node Id key is n= ull. Parent " + prevData.getQPath()); } = Node childNode =3D nodesRoot.getChild(ma= keNodeFqn(childNodeId)); if (childNode =3D=3D null) { throw new RepositoryException("FATAL Node record not found = (" + childNodeId - + "), but listed in childs of " + newData.getQPath()); + + "), but listed in childs of " + prevData.getQPath()); } = updateTreeACL(childNode, newACL); --===============3617692814742342065==-- From do-not-reply at jboss.org Thu Nov 26 08:49:08 2009 Content-Type: multipart/mixed; boundary="===============2854894254479953909==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r882 - jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatform/services/jcr/ext/replication. Date: Thu, 26 Nov 2009 08:49:08 -0500 Message-ID: <200911261349.nAQDn8OE025170@svn01.web.mwc.hst.phx2.redhat.com> --===============2854894254479953909== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-26 08:49:07 -0500 (Thu, 26 Nov 2009) New Revision: 882 Modified: jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatform/serv= ices/jcr/ext/replication/ProxyWorkspaceDataReceiver.java jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatform/serv= ices/jcr/ext/replication/WorkspaceDataManagerProxy.java Log: EXOJCR-199 : The calsess ProxyWorkspaceDataReciver and WorkspaceDataManager= Proxy was fixed for build. Modified: jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatfo= rm/services/jcr/ext/replication/ProxyWorkspaceDataReceiver.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/replication/ProxyWorkspaceDataReceiver.java 2009-11-26 13:31:= 31 UTC (rev 881) +++ jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/replication/ProxyWorkspaceDataReceiver.java 2009-11-26 13:49:= 07 UTC (rev 882) @@ -19,7 +19,6 @@ package org.exoplatform.services.jcr.ext.replication; = import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; = @@ -42,12 +41,12 @@ * the LockManagerImpl * @throws RepositoryConfigurationException * will be generated RepositoryConfigurationException - */ + *//* public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataMan= ager, LockManagerImpl lockManager) throws RepositoryConfigurationException { this(dataManager, null, lockManager); - } + }*/ = /** * ProxyWorkspaceDataReceiver constructor. @@ -58,12 +57,12 @@ * the SearchManager * @throws RepositoryConfigurationException * will be generated RepositoryConfigurationException - */ + *//* public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataMan= ager, SearchManager searchManager) throws RepositoryConfigurationException { this(dataManager, searchManager, null); - } + }*/ = /** * ProxyWorkspaceDataReceiver constructor. @@ -75,7 +74,7 @@ */ public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataMan= ager) throws RepositoryConfigurationException { - this(dataManager, null, null); + this(dataManager, null/*, null*/); } = /** @@ -90,9 +89,9 @@ * @throws RepositoryConfigurationException * will be generated the RepositoryConfigurationException */ - public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataMan= ager, SearchManager searchManager, - LockManagerImpl lockManager) throws RepositoryConfigurationException + public ProxyWorkspaceDataReceiver(CacheableWorkspaceDataManager dataMan= ager, SearchManager searchManager/*, + LockManagerImpl lockManager*/) throws RepositoryConfigurationExcepti= on { - dataKeeper =3D new WorkspaceDataManagerProxy(dataManager, searchMana= ger, lockManager); + dataKeeper =3D new WorkspaceDataManagerProxy(dataManager, searchMana= ger/*, lockManager*/); } } Modified: jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatfo= rm/services/jcr/ext/replication/WorkspaceDataManagerProxy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/replication/WorkspaceDataManagerProxy.java 2009-11-26 13:31:3= 1 UTC (rev 881) +++ jcr/branches/1.12.0-JBC/component/ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/replication/WorkspaceDataManagerProxy.java 2009-11-26 13:49:0= 7 UTC (rev 882) @@ -21,7 +21,6 @@ import org.exoplatform.services.jcr.dataflow.ItemDataKeeper; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; -import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; import org.exoplatform.services.log.ExoLogger; @@ -63,18 +62,16 @@ * the CacheableWorkspaceDataManager * @param searchIndex * the SearchManager - * @param lockManager - * the LockManagerImpl */ - public WorkspaceDataManagerProxy(CacheableWorkspaceDataManager dataMana= ger, SearchManager searchIndex, - LockManagerImpl lockManager) + public WorkspaceDataManagerProxy(CacheableWorkspaceDataManager dataMana= ger, SearchManager searchIndex/*, + LockManagerImpl lockManager*/) { this.listeners =3D new ArrayList(); listeners.add(dataManager.getCache()); if (searchIndex !=3D null) listeners.add(searchIndex); - if (lockManager !=3D null) - listeners.add(lockManager); + /*if (lockManager !=3D null) + listeners.add(lockManager);*/ log.info("WorkspaceDataManagerProxy is instantiated"); } = --===============2854894254479953909==-- From do-not-reply at jboss.org Thu Nov 26 08:56:30 2009 Content-Type: multipart/mixed; boundary="===============2893150936914906173==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r883 - in kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache: impl and 1 other directory. Date: Thu, 26 Nov 2009 08:56:29 -0500 Message-ID: <200911261356.nAQDuTee026478@svn01.web.mwc.hst.phx2.redhat.com> --===============2893150936914906173== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 08:56:29 -0500 (Thu, 26 Nov 2009) New Revision: 883 Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/ExoCacheFactory.java kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/ExoCacheInitException.java Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/ExoCacheConfig.java kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/impl/CacheServiceImpl.java Log: EXOJCR-268 Improve the CacheService to allow complex implementation of ExoC= ache Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplat= form/services/cache/ExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheConfig.java 2009-11-26 13:49:07 UTC (rev 882) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheConfig.java 2009-11-26 13:56:29 UTC (rev 883) @@ -23,7 +23,7 @@ * @since Feb 20, 2005 * @version $Id: ExoCacheConfig.java 5799 2006-05-28 17:55:42Z geaz $ */ -public class ExoCacheConfig +public class ExoCacheConfig implements Cloneable { private String name; = @@ -33,14 +33,16 @@ = private long liveTime; = - private boolean distributed =3D false; + private boolean distributed; = - private boolean replicated =3D false; + private boolean replicated; = private String implementation; = - private boolean logEnabled =3D false; + private String type; = + private boolean logEnabled; + public String getName() { return name; @@ -113,6 +115,16 @@ implementation =3D alg; } = + public void setType(String type) + { + this.type =3D type; + } + + public String getType() + { + return type; + } + public boolean isLogEnabled() { return logEnabled; @@ -122,4 +134,20 @@ { this.logEnabled =3D enableLogging; } + + /** + * @see java.lang.Object#clone() + */ + @Override + public ExoCacheConfig clone() throws CloneNotSupportedException + { + try + { + return (ExoCacheConfig)super.clone(); + } + catch (Exception e) + { + throw new AssertionError(); + } + } } Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatfor= m/services/cache/ExoCacheFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheFactory.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheFactory.java 2009-11-26 13:56:29 UTC (rev 883) @@ -0,0 +1,39 @@ +/* + * 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.cache; + +/** + * This class allows you to create a new instance of {@link org.exoplatfor= m.services.cache.ExoCache} + * = + * @author Dmytro Katay= ev + * @version $Id$ + * + */ +public interface ExoCacheFactory +{ + + /** + * Creates a new instance of {@link org.exoplatform.services.cache.ExoC= ache} + * @param config the cache to create + * @return the new instance of {@link org.exoplatform.services.cache.Ex= oCache} + * @exception ExoCacheInitException if an exception happens while initi= alizing the cache + */ + public ExoCache createCache(ExoCacheConfig config) throws ExoCacheInitE= xception; + +} Property changes on: kernel/trunk/exo.kernel.component.cache/src/main/java/= org/exoplatform/services/cache/ExoCacheFactory.java ___________________________________________________________________ Name: svn:mime-type + text/plain Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatfor= m/services/cache/ExoCacheInitException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheInitException.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheInitException.java 2009-11-26 13:56:29 UTC (rev 883) @@ -0,0 +1,61 @@ +/* + * 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.cache; + +/** + * An exception that represents any type of exception that prevent the ini= tialization of + * the {@link org.exoplatform.services.cache.ExoCache} + * = + * @author Dmytro Katay= ev + * @version $Id$ + * + */ +public class ExoCacheInitException extends Exception +{ + + /** + * The serial version UID + */ + private static final long serialVersionUID =3D -5612051266167302943L; + + /** + * {@inheritDoc} + */ + public ExoCacheInitException(String message) + { + super(message); + } + + /** + * {@inheritDoc} + */ + public ExoCacheInitException(Throwable cause) + { + super(cause); + } + + /** + * {@inheritDoc} + */ + public ExoCacheInitException(String message, Throwable cause) + { + super(message, cause); + } + +} Property changes on: kernel/trunk/exo.kernel.component.cache/src/main/java/= org/exoplatform/services/cache/ExoCacheInitException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplat= form/services/cache/impl/CacheServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/CacheServiceImpl.java 2009-11-26 13:49:07 UTC (rev 882) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/CacheServiceImpl.java 2009-11-26 13:56:29 UTC (rev 883) @@ -25,6 +25,8 @@ import org.exoplatform.services.cache.ExoCache; import org.exoplatform.services.cache.ExoCacheConfig; import org.exoplatform.services.cache.ExoCacheConfigPlugin; +import org.exoplatform.services.cache.ExoCacheFactory; +import org.exoplatform.services.cache.ExoCacheInitException; import org.exoplatform.services.cache.SimpleExoCache; = import java.io.Serializable; @@ -40,19 +42,29 @@ @ManagedBy(CacheServiceManaged.class) public class CacheServiceImpl implements CacheService { - private HashMap configs_ =3D new HashMap(); + private final HashMap configs_ =3D new HashMap<= String, ExoCacheConfig>(); = private final ConcurrentHashMap> cacheMap_ =3D new ConcurrentHashMap>(); = - private ExoCacheConfig defaultConfig_; + private final ExoCacheConfig defaultConfig_; = - private LoggingCacheListener loggingListener_; + private final LoggingCacheListener loggingListener_; = + private final ExoCacheFactory factory_; + CacheServiceManaged managed; = + /** + * = + */ public CacheServiceImpl(InitParams params) throws Exception { + this(params, null); + } + + public CacheServiceImpl(InitParams params, ExoCacheFactory factory) thr= ows Exception + { List configs =3D params.getObjectParamValues(ExoCach= eConfig.class); for (ExoCacheConfig config : configs) { @@ -60,6 +72,7 @@ } defaultConfig_ =3D configs_.get("default"); loggingListener_ =3D new LoggingCacheListener(); + factory_ =3D factory =3D=3D null ? new SimpleExoCacheFactory() : fac= tory; } = public void addExoCacheConfig(ComponentPlugin plugin) @@ -111,40 +124,83 @@ ExoCacheConfig config =3D configs_.get(region); if (config =3D=3D null) config =3D defaultConfig_; - ExoCache cache; - if (config.getImplementation() =3D=3D null) - { - cache =3D new SimpleExoCache(); - } - else - { - ClassLoader cl =3D Thread.currentThread().getContextClassLoader(); - Class> clazz =3D - (Class>)cl.loadClass(confi= g.getImplementation()); - cache =3D clazz.newInstance(); - } - cache.setName(region); - cache.setLabel(config.getLabel()); - cache.setMaxSize(config.getMaxSize()); - cache.setLiveTime(config.getLiveTime()); - cache.setLogEnabled(config.isLogEnabled()); - if (cache.isLogEnabled()) - { - cache.addCacheListener(loggingListener_); - } = - // + // Ensure the configuration integrity + final ExoCacheConfig safeConfig =3D config.clone(); + // Set the region as name = + safeConfig.setName(region); + final ExoCache simple =3D factory_.createCache(safeConfig); + if (managed !=3D null) { - managed.registerCache(cache); + managed.registerCache(simple); } - - // - return cache; + return simple; } = public Collection> getAllCacheInsta= nces() { return cacheMap_.values(); } + + /** + * Default implementation of an {@link org.exoplatform.services.cache.E= xoCacheFactory} + */ + private class SimpleExoCacheFactory implements ExoCacheFactory + { + + /** + * {@inheritDoc} + */ + public ExoCache createCache(ExoCacheConfig config) throws ExoCacheIn= itException + { + final ExoCache simple =3D createCacheInstance(config); + simple.setName(config.getName()); + simple.setLabel(config.getLabel()); + simple.setMaxSize(config.getMaxSize()); + simple.setLiveTime(config.getLiveTime()); + // simple.setReplicated(config.isRepicated()); + // simple.setDistributed(config.isDistributed()); + // if (simple.isDistributed()) { + // simple.addCacheListener(distrbutedListener_); + // } + simple.setLogEnabled(config.isLogEnabled()); + if (simple.isLogEnabled()) + { + simple.addCacheListener(loggingListener_); + } + return simple; + } + + /** + * Create a new instance of ExoCache according to the given configur= ation + * @param config the ExoCache configuration + * @return a new instance of ExoCache + * @throws ExoCacheInitException if any exception happens while init= ializing the cache + */ + @SuppressWarnings("unchecked") + private ExoCache createCacheInstance(ExoCacheConfig config) throws E= xoCacheInitException + { + if (config.getImplementation() =3D=3D null) + { + // No implementation has been defined + return new SimpleExoCache(); + } + else + { + // An implementation has been defined + final ClassLoader cl =3D Thread.currentThread().getContextClas= sLoader(); + try + { + final Class clazz =3D cl.loadClass(config.getImplementation= ()); + return (ExoCache)clazz.newInstance(); + } + catch (Exception e) + { + throw new ExoCacheInitException("Cannot create instance of = ExoCache of type " + + config.getImplementation(), e); + } + } + } + } } --===============2893150936914906173==-- From do-not-reply at jboss.org Thu Nov 26 08:57:17 2009 Content-Type: multipart/mixed; boundary="===============8033248615114524555==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r884 - kernel/trunk. Date: Thu, 26 Nov 2009 08:57:17 -0500 Message-ID: <200911261357.nAQDvHE6026560@svn01.web.mwc.hst.phx2.redhat.com> --===============8033248615114524555== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 08:57:16 -0500 (Thu, 26 Nov 2009) New Revision: 884 Modified: kernel/trunk/pom.xml Log: EXOJCR-268 JBoss cache dependency management added Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-26 13:56:29 UTC (rev 883) +++ kernel/trunk/pom.xml 2009-11-26 13:57:16 UTC (rev 884) @@ -53,6 +53,7 @@ exo.kernel.component.common exo.kernel.component.remote exo.kernel.component.cache + exo.kernel.component.ext.cache exo.kernel.component.command packaging/module @@ -78,8 +79,13 @@ org.exoplatform.kernel exo.kernel.component.remote ${project.version} - + + org.exoplatform.kernel + exo.kernel.component.cache + ${project.version} + = + xpp3 xpp3 1.1.3.4.O @@ -163,9 +169,14 @@ jgroups jgroups - 2.6.10.GA + 2.6.12.GA - + + org.jboss.cache + jbosscache-core + 3.2.0.GA = + = + org.jibx jibx-bind ${jibx.plugin.version} --===============8033248615114524555==-- From do-not-reply at jboss.org Thu Nov 26 09:10:48 2009 Content-Type: multipart/mixed; boundary="===============4835502074559007388==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r885 - kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache. Date: Thu, 26 Nov 2009 09:10:48 -0500 Message-ID: <200911261410.nAQEAmpK029890@svn01.web.mwc.hst.phx2.redhat.com> --===============4835502074559007388== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 09:10:48 -0500 (Thu, 26 Nov 2009) New Revision: 885 Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/ExoCacheConfig.java Log: EXOJCR-268 Remove type from ExoCacheConfig since it is useless, Javadoc add= ed to ExoCacheConfig = Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplat= form/services/cache/ExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheConfig.java 2009-11-26 13:57:16 UTC (rev 884) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheConfig.java 2009-11-26 14:10:48 UTC (rev 885) @@ -19,28 +19,53 @@ package org.exoplatform.services.cache; = /** + * This class defines the main configuration properties of an {@link org.e= xoplatform.services.cache.ExoCache} + * = * @author Tuan Nguyen (tuan08(a)users.sourceforge.net) * @since Feb 20, 2005 * @version $Id: ExoCacheConfig.java 5799 2006-05-28 17:55:42Z geaz $ */ public class ExoCacheConfig implements Cloneable { + /** + * The name of the cache. + */ private String name; = + /** + * The label of the cache. + */ private String label; = + /** + * The maximum numbers of elements in cache. + */ private int maxSize; = + /** + * The amount of time (in milliseconds) an element is not written or + * read before it is evicted. + */ private long liveTime; = + /** + * Indicates if the cache is distributed + */ private boolean distributed; = + /** + * Indicates if the cache is replicated + */ private boolean replicated; = + /** + * The full qualified name of the cache implementation to use + */ private String implementation; = - private String type; - + /** + * Indicates if the log is enabled + */ private boolean logEnabled; = public String getName() @@ -93,8 +118,6 @@ distributed =3D b; } = - // public void setDistributed(String b) { distributed_ =3D "true".equal= s(b) ; } - public boolean isRepicated() { return replicated; @@ -115,16 +138,6 @@ implementation =3D alg; } = - public void setType(String type) - { - this.type =3D type; - } - - public String getType() - { - return type; - } - public boolean isLogEnabled() { return logEnabled; --===============4835502074559007388==-- From do-not-reply at jboss.org Thu Nov 26 09:17:46 2009 Content-Type: multipart/mixed; boundary="===============0496798954412537902==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r886 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 26 Nov 2009 09:17:46 -0500 Message-ID: <200911261417.nAQEHkVI031205@svn01.web.mwc.hst.phx2.redhat.com> --===============0496798954412537902== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2009-11-26 09:17:46 -0500 (Thu, 26 Nov 2009) New Revision: 886 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-270: updateTreeACL - updated Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 14:10:48 UTC (rev 885) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 14:17:46 UTC (rev 886) @@ -765,7 +765,7 @@ = if (!prevData.getACL().equals(data.getACL())) { - updateTreeACL(node, data.getACL()); + updateChildsACL(node, data.getACL()); } = } @@ -878,58 +878,53 @@ * @param newACL - new ACL that must be inserted to node data. * @throws RepositoryException on error state detected */ - protected void updateTreeACL(Node node, AccessCon= trolList newACL) throws RepositoryException + protected void updateChildsACL(Node node, AccessC= ontrolList newACL) throws RepositoryException { = - NodeData prevData =3D (NodeData)node.get(ITEM_DATA); - - // is exo:Privilegeable - boolean isPrivilegeable =3D false; - for (InternalQName mixin : prevData.getMixinTypeNames()) + for (Node child : node.getChildren()) { - if (mixin.equals(Constants.EXO_PRIVILEGEABLE)) + String childNodeId =3D (String)child.get(ITEM_ID); + if (childNodeId =3D=3D null) { - isPrivilegeable =3D true; - break; + throw new RepositoryException("FATAL Child Node Id key is null= . Parent " + node.getFqn()); } - } = - if (!isPrivilegeable || prevData.getACL().equals(newACL)) - { - // do update NodeData + Node childNode =3D nodesRoot.getChild(makeN= odeFqn(childNodeId)); + if (childNode =3D=3D null) + { + throw new RepositoryException("FATAL Node record not found (" = + childNodeId + "), but listed in childs of " + + node.getFqn()); + } = - if (!prevData.getACL().equals(newACL)) + NodeData prevData =3D (NodeData)childNode.get(ITEM_DATA); + // is exo:Privilegeable + boolean isPrivilegeable =3D false; + for (InternalQName mixin : prevData.getMixinTypeNames()) { + if (mixin.equals(Constants.EXO_PRIVILEGEABLE)) + { + isPrivilegeable =3D true; + break; + } + } + + if (!isPrivilegeable) + { + // do update NodeData AccessControlList acl =3D new AccessControlList(prevData.getAC= L().getOwner(), newACL.getPermissionEntries()); = TransientNodeData newData =3D new TransientNodeData(prevData.getQPath(), prevData.getIden= tifier(), prevData.getPersistedVersion(), prevData.getPrimaryTypeName(), prevData.getMixinTypeName= s(), prevData.getOrderNumber(), prevData .getParentIdentifier(), acl); - newData.addState(TransientPropertyData.TRANSITIVE_PATH_UPDATED= ); - node.put(ITEM_DATA, newData); - } + newData.addState(TransientPropertyData.TRANSITIVE_ACL_UPDATED); + childNode.put(ITEM_DATA, newData); = - // do update child nodes - - for (Node child : node.getChildren()) - { - String childNodeId =3D (String)child.get(ITEM_ID); - if (childNodeId =3D=3D null) - { - throw new RepositoryException("FATAL Child Node Id key is n= ull. Parent " + prevData.getQPath()); - } - - Node childNode =3D nodesRoot.getChild(ma= keNodeFqn(childNodeId)); - if (childNode =3D=3D null) - { - throw new RepositoryException("FATAL Node record not found = (" + childNodeId - + "), but listed in childs of " + prevData.getQPath()); - } - - updateTreeACL(childNode, newACL); + // do update childs + updateChildsACL(childNode, newACL); } } + } = /** --===============0496798954412537902==-- From do-not-reply at jboss.org Thu Nov 26 09:20:02 2009 Content-Type: multipart/mixed; boundary="===============5092645051496373500==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r887 - kernel/trunk. Date: Thu, 26 Nov 2009 09:20:02 -0500 Message-ID: <200911261420.nAQEK2jl031530@svn01.web.mwc.hst.phx2.redhat.com> --===============5092645051496373500== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 09:20:01 -0500 (Thu, 26 Nov 2009) New Revision: 887 Modified: kernel/trunk/pom.xml Log: EXOJCR-268 exo.kernel.component.ext.cache project excluded from build Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2009-11-26 14:17:46 UTC (rev 886) +++ kernel/trunk/pom.xml 2009-11-26 14:20:01 UTC (rev 887) @@ -53,7 +53,7 @@ exo.kernel.component.common exo.kernel.component.remote exo.kernel.component.cache - exo.kernel.component.ext.cache + exo.kernel.component.command packaging/module --===============5092645051496373500==-- From do-not-reply at jboss.org Thu Nov 26 09:49:09 2009 Content-Type: multipart/mixed; boundary="===============6217846458449239568==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r888 - jcr/branches/1.12.0-JBC/applications. Date: Thu, 26 Nov 2009 09:49:09 -0500 Message-ID: <200911261449.nAQEn98l004559@svn01.web.mwc.hst.phx2.redhat.com> --===============6217846458449239568== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-26 09:49:09 -0500 (Thu, 26 Nov 2009) New Revision: 888 Modified: jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jboss-ear.xml jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jonas-ear.xml jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-tomcat6.xml Log: EXOJCR-199 : The configuration to exo-application was changed. Modified: jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jboss-ear= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jboss-ear.xml 2= 009-11-26 14:20:01 UTC (rev 887) +++ jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jboss-ear.xml 2= 009-11-26 14:49:09 UTC (rev 888) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-JBC-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jonas-ear= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jonas-ear.xml 2= 009-11-26 14:20:01 UTC (rev 887) +++ jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-jonas-ear.xml 2= 009-11-26 14:49:09 UTC (rev 888) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-JBC-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-tomcat6.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-tomcat6.xml 200= 9-11-26 14:20:01 UTC (rev 887) +++ jcr/branches/1.12.0-JBC/applications/product-exo-jcr-as-tomcat6.xml 200= 9-11-26 14:49:09 UTC (rev 888) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.0-Beta03-SNAPSHOT + 1.12.0-JBC-SNAPSHOT = 4.0.0 --===============6217846458449239568==-- From do-not-reply at jboss.org Thu Nov 26 10:30:29 2009 Content-Type: multipart/mixed; boundary="===============6120584001834927613==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r889 - in kernel/trunk/exo.kernel.component.ext.cache: src and 26 other directories. Date: Thu, 26 Nov 2009 10:30:29 -0500 Message-ID: <200911261530.nAQFUTYg012769@svn01.web.mwc.hst.phx2.redhat.com> --===============6120584001834927613== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 10:30:27 -0500 (Thu, 26 Nov 2009) New Revision: 889 Added: kernel/trunk/exo.kernel.component.ext.cache/pom.xml kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ kernel/trunk/exo.kernel.component.ext.cache/src/ kernel/trunk/exo.kernel.component.ext.cache/src/main/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/AbstractExoCache.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/ExoCacheCreator.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/ExoCacheCreatorPlugin.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/ExoCacheFactoryConfigPlugin.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/ExoCacheFactoryImpl.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/fifo/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/fifo/FIFOExoCacheConfig.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/fifo/FIFOExoCacheCreator.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/lfu/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/lfu/LFUExoCacheConfig.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/lfu/LFUExoCacheCreator.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/lru/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/lru/LRUExoCacheConfig.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/lru/LRUExoCacheCreator.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/mru/ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/mru/MRUExoCacheConfig.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/mru/MRUExoCacheCreator.java kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/ kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/ kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/port= al/ kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/port= al/cache-configuration-template.xml kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/port= al/configuration.xml kernel/trunk/exo.kernel.component.ext.cache/src/test/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestAbstractExoCache.java kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestExoCacheConfig.java kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestExoCacheCreator.java kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestExoCacheFactoryImpl.java kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestFIFOCache.java kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestLRUCache.java kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/ kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/ kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/port= al/ kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/port= al/cache-configuration-template.xml kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/port= al/distributed-cache-configuration-template.xml kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/port= al/test-configuration.xml Log: EXOJCR-268 Added an implementation of ExoCache for JBoss Cache 3 Added: kernel/trunk/exo.kernel.component.ext.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/pom.xml = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/pom.xml 2009-11-26 15:30:27= UTC (rev 889) @@ -0,0 +1,28 @@ + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta05-SNAPSHOT + + + exo.kernel.component.ext.cache + + JBoss Cache Implementation for the Cache Service + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + org.jboss.cache + jbosscache-core + + + jgroups + jgroups + = + + Added: kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ 2009-11-26 15:30:2= 7 UTC (rev 889) @@ -0,0 +1,28 @@ + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta05-SNAPSHOT + + + exo.kernel.component.ext.cache + + JBoss Cache Implementation for the Cache Service + + + + org.exoplatform.kernel + exo.kernel.component.cache + + + org.jboss.cache + jbosscache-core + + + jgroups + jgroups + = + + Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/AbstractExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/AbstractExoCache.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/AbstractExoCache.java 2009-11-26 15:30:27 UTC = (rev 889) @@ -0,0 +1,573 @@ +/* + * 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.cache.impl.jboss; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.atomic.AtomicInteger; + +import org.apache.commons.logging.Log; +import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CachedObjectSelector; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ObjectCacheInfo; +import org.exoplatform.services.log.ExoLogger; +import org.jboss.cache.Cache; +import org.jboss.cache.CacheSPI; +import org.jboss.cache.Fqn; +import org.jboss.cache.Node; +import org.jboss.cache.notifications.annotation.NodeCreated; +import org.jboss.cache.notifications.annotation.NodeEvicted; +import org.jboss.cache.notifications.annotation.NodeModified; +import org.jboss.cache.notifications.annotation.NodeRemoved; +import org.jboss.cache.notifications.event.EventImpl; +import org.jboss.cache.notifications.event.NodeEvent; + +/** + * An {@link org.exoplatform.services.cache.ExoCache} implementation based= on {@link org.jboss.cache.Node}. + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 20 juil. 2009 = + */ +public abstract class AbstractExoCache implements ExoCache +{ + + /** + * Logger. + */ + private static final Log LOG =3D ExoLogger.getLogger(AbstractExoCache.c= lass); + + protected final AtomicInteger size =3D new AtomicInteger(); + + private volatile int hits; + + private volatile int misses; + + private String label; + + private String name; + + private boolean distributed; + + private boolean replicated; + + private boolean logEnabled; + + private final CopyOnWriteArrayList listeners; + + protected final Cache cache; + + protected final boolean isCacheSPI; + + @SuppressWarnings("unchecked") + public AbstractExoCache(ExoCacheConfig config, Cache cache) + { + this.cache =3D cache; + this.isCacheSPI =3D cache instanceof CacheSPI; + this.listeners =3D new CopyOnWriteArrayList(); + if (!isCacheSPI) + { + LOG.warn("The cache is not an instance of CacheSPI, the cache siz= e will be evaluated but won't be accurate"); + } + setDistributed(config.isDistributed()); + setLabel(config.getLabel()); + setName(config.getName()); + setLogEnabled(config.isLogEnabled()); + setReplicated(config.isRepicated()); + cache.getConfiguration().setInvocationBatchingEnabled(true); + cache.addCacheListener(new SizeManager()); + } + + /** + * {@inheritDoc} + */ + public void addCacheListener(CacheListener listener) + { + if (listener =3D=3D null) + { + return; + } + listeners.add(listener); + } + + /** + * {@inheritDoc} + */ + public void clearCache() throws Exception + { + final Node rootNode =3D cache.getRoot(); + for (Node node : rootNode.getChildren()) + { + if (node =3D=3D null) + { + continue; + } + remove(getKey(node)); + } + onClearCache(); + } + + /** + * {@inheritDoc} + */ + public Object get(Serializable name) throws Exception + { + final Object result =3D cache.get(Fqn.fromElements(name), name); + if (result =3D=3D null) + { + misses++; + } + else + { + hits++; + } + onGet(name, result); + return result; + } + + /** + * {@inheritDoc} + */ + public int getCacheHit() + { + return hits; + } + + /** + * {@inheritDoc} + */ + public int getCacheMiss() + { + return misses; + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + public int getCacheSize() + { + if (isCacheSPI) + { + return ((CacheSPI)cache).getNumberOfNodes(); + } + return size.intValue(); + } + + /** + * {@inheritDoc} + */ + public List getCachedObjects() + { + final LinkedList list =3D new LinkedList(); + for (Node node : cache.getRoot().getChildren()) + { + if (node =3D=3D null) + { + continue; + } + final Object value =3D node.get(getKey(node)); + if (value !=3D null) + { + list.add(value); + } + } + return list; + } + + /** + * {@inheritDoc} + */ + public String getLabel() + { + return label; + } + + /** + * {@inheritDoc} + */ + public String getName() + { + return name; + } + + /** + * {@inheritDoc} + */ + public boolean isDistributed() + { + return distributed; + } + + /** + * {@inheritDoc} + */ + public boolean isLogEnabled() + { + return logEnabled; + } + + /** + * {@inheritDoc} + */ + public boolean isReplicated() + { + return replicated; + } + + /** + * {@inheritDoc} + */ + public void put(Serializable name, Object obj) throws Exception + { + putOnly(name, obj); + onPut(name, obj); + } + + /** + * Only puts the data into the cache nothing more + */ + private Object putOnly(Serializable name, Object obj) throws Exception + { + return cache.put(Fqn.fromElements(name), name, obj); + } + + /** + * {@inheritDoc} + */ + public void putMap(Map objs) throws Exception + { + cache.startBatch(); + int total =3D 0; + try + { + // Start transaction + for (Entry entry : objs.entrySet()) + { + Object value =3D putOnly(entry.getKey(), entry.getValue()); + if (value =3D=3D null) + { + total++; + } + } + cache.endBatch(true); + // End transaction + for (Entry entry : objs.entrySet()) + { + onPut(entry.getKey(), entry.getValue()); + } + } + catch (Exception e) + { + if (!isCacheSPI) + size.addAndGet(-total); + cache.endBatch(false); + throw e; + } + } + + /** + * {@inheritDoc} + */ + public Object remove(Serializable name) throws Exception + { + final Fqn fqn =3D Fqn.fromElements(name); + final Node node =3D cache.getNode(fqn); + if (node !=3D null) + { + final Object result =3D node.get(name); + if (cache.removeNode(fqn)) + { + onRemove(name, result); + } + return result; + } + return null; + } + + /** + * {@inheritDoc} + */ + public List removeCachedObjects() throws Exception + { + final List list =3D getCachedObjects(); + clearCache(); + return list; + } + + /** + * {@inheritDoc} + */ + public void select(CachedObjectSelector selector) throws Exception + { + for (Node node : cache.getRoot().getChildren()) + { + if (node =3D=3D null) + { + continue; + } + final Serializable key =3D getKey(node); + final Object value =3D node.get(key); + ObjectCacheInfo info =3D new ObjectCacheInfo() + { + public Object get() + { + return value; + } + + public long getExpireTime() + { + // Cannot know: The expire time is managed by JBoss Cache i= tself + return -1; + } + }; + if (selector.select(key, info)) + { + selector.onSelect(this, key, info); + } + } + } + + /** + * {@inheritDoc} + */ + public void setDistributed(boolean distributed) + { + this.distributed =3D distributed; + } + + /** + * {@inheritDoc} + */ + public void setLabel(String label) + { + this.label =3D label; + } + + /** + * {@inheritDoc} + */ + public void setLogEnabled(boolean logEnabled) + { + this.logEnabled =3D logEnabled; + } + + /** + * {@inheritDoc} + */ + public void setName(String name) + { + this.name =3D name; + } + + /** + * {@inheritDoc} + */ + public void setReplicated(boolean replicated) + { + this.replicated =3D replicated; + } + + /** + * Returns the key related to the given node + */ + private Serializable getKey(Node node) + { + return getKey(node.getFqn()); + } + + /** + * Returns the key related to the given Fqn + */ + @SuppressWarnings("unchecked") + private Serializable getKey(Fqn fqn) + { + return (Serializable)fqn.get(0); + } + + void onExpire(Serializable key, Object obj) + { + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onExpire(this, key, obj); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + } + + void onRemove(Serializable key, Object obj) + { + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onRemove(this, key, obj); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + } + + void onPut(Serializable key, Object obj) + { + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + try + { + listener.onPut(this, key, obj); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + + void onGet(Serializable key, Object obj) + { + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + try + { + listener.onGet(this, key, obj); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + + void onClearCache() + { + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + try + { + listener.onClearCache(this); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + + @org.jboss.cache.notifications.annotation.CacheListener + public class SizeManager + { + + @NodeEvicted + public void nodeEvicted(NodeEvent ne) + { + if (ne.isPre()) + { + // Cannot give the value since + // since it disturbs the eviction + // algorithms + onExpire(getKey(ne.getFqn()), null); + } + else if (!isCacheSPI) + { + size.decrementAndGet(); + } + } + + @NodeRemoved + public void nodeRemoved(NodeEvent ne) + { + if (ne.isPre()) + { + if (!ne.isOriginLocal()) + { + final Node node =3D cache.getNode(ne.= getFqn()); + final Serializable key =3D getKey(ne.getFqn()); + onRemove(key, node.get(key)); + } + } + else if (!isCacheSPI) + { + size.decrementAndGet(); + } + } + + @NodeCreated + public void nodeCreated(NodeEvent ne) + { + if (!ne.isPre() && !isCacheSPI) + { + size.incrementAndGet(); + } + } + + @SuppressWarnings("unchecked") + @NodeModified + public void nodeModified(NodeEvent ne) + { + if (!ne.isOriginLocal() && !ne.isPre()) + { + final Serializable key =3D getKey(ne.getFqn()); + if (ne instanceof EventImpl) + { + EventImpl evt =3D (EventImpl)ne; + Map data =3D evt.getData(); + if (data !=3D null) + { + onPut(key, data.get(key)); + return; + } + } + final Node node =3D cache.getNode(ne.get= Fqn()); + onPut(key, node.get(key)); + } + } + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/ExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheCreator.java (= rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheCreator.java 2009-11-26 15:30:27 UTC (= rev 889) @@ -0,0 +1,59 @@ +/* + * 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.cache.impl.jboss; + +import java.io.Serializable; + +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.jboss.cache.Cache; + +/** + * This class is used to create the cache according to the given = + * configuration {@link org.exoplatform.services.cache.ExoCacheConfig} + * = + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 20 juil. 2009 = + */ +public interface ExoCacheCreator +{ + + /** + * Creates an eXo cache according to the given configuration {@link org= .exoplatform.services.cache.ExoCacheConfig} + * @param config the configuration of the cache to apply + * @param cache the cache to initialize + * @exception ExoCacheInitException if an exception happens while initi= alizing the cache + */ + public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException; + + /** + * Returns the type of {@link org.exoplatform.services.cache.ExoCacheCo= nfig} expected by the creator = + * @return the expected type + */ + public Class getExpectedConfigType(); + + /** + * Returns the name of the implementation expected by the creator. This= is mainly used to be backward compatible + * @return the expected by the creator + */ + public String getExpectedImplementation(); +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/ExoCacheCreatorPlugin.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheCreatorPlugin.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheCreatorPlugin.java 2009-11-26 15:30:27= UTC (rev 889) @@ -0,0 +1,60 @@ +/* + * 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.cache.impl.jboss; + +import java.util.ArrayList; +import java.util.List; + +import org.exoplatform.container.component.BaseComponentPlugin; +import org.exoplatform.container.xml.InitParams; + +/** + * This class allows us to define new creators + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 20 juil. 2009 = + */ +public class ExoCacheCreatorPlugin extends BaseComponentPlugin +{ + + /** + * The list of all the creators defined for this ComponentPlugin + */ + private final List creators; + + public ExoCacheCreatorPlugin(InitParams params) + { + creators =3D new ArrayList(); + List configs =3D params.getObjectParamValues(ExoCacheCreator.clas= s); + for (int i =3D 0; i < configs.size(); i++) + { + ExoCacheCreator config =3D (ExoCacheCreator)configs.get(i); + creators.add(config); + } + } + + /** + * Returns all the creators defined for this ComponentPlugin + */ + public List getCreators() + { + return creators; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/ExoCacheFactoryConfigPlugin.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheFactoryConfigPlugin.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheFactoryConfigPlugin.java 2009-11-26 15= :30:27 UTC (rev 889) @@ -0,0 +1,63 @@ +/* + * 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.cache.impl.jboss; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.exoplatform.container.component.BaseComponentPlugin; +import org.exoplatform.container.xml.InitParams; +import org.exoplatform.container.xml.ValueParam; + +/** + * This class is used to define custom configurations + * = + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 23 juil. 2009 = + */ +public class ExoCacheFactoryConfigPlugin extends BaseComponentPlugin +{ + + /** + * The map of all the creators defined for this ComponentPlugin + */ + private final Map configs; + + @SuppressWarnings("unchecked") + public ExoCacheFactoryConfigPlugin(InitParams params) + { + configs =3D new HashMap(); + for (Iterator iterator =3D params.getValueParamIterator(= ); iterator.hasNext();) + { + ValueParam vParam =3D iterator.next(); + configs.put(vParam.getName(), vParam.getValue()); + } + } + + /** + * Returns all the configurations defined for this ComponentPlugin + */ + public Map getConfigs() + { + return configs; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/ExoCacheFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheFactoryImpl.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2009-11-26 15:30:27 U= TC (rev 889) @@ -0,0 +1,242 @@ +/* + * 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.cache.impl.jboss; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.apache.commons.logging.Log; +import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.container.xml.InitParams; +import org.exoplatform.container.xml.ValueParam; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheFactory; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.exoplatform.services.cache.impl.jboss.fifo.FIFOExoCacheCreator; +import org.exoplatform.services.log.ExoLogger; +import org.jboss.cache.Cache; +import org.jboss.cache.CacheFactory; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.EvictionConfig; +import org.jboss.cache.config.EvictionRegionConfig; +import org.jboss.cache.config.Configuration.CacheMode; + +/** + * This class is the JBoss Cache implementation of the {@link org.exoplatf= orm.services.cache.ExoCacheFactory} + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 17 juil. 2009 = + */ +public class ExoCacheFactoryImpl implements ExoCacheFactory +{ + + /** + * The logger + */ + private static final Log LOG =3D ExoLogger.getLogger(ExoCacheFactoryImp= l.class); + + /** + * The initial parameter key that defines the full path of the configur= ation template + */ + private static final String CACHE_CONFIG_TEMPLATE_KEY =3D "cache.config= .template"; + + /** + * The configuration manager that allows us to retrieve a configuration= file in several different + * manners + */ + private final ConfigurationManager configManager; + + /** + * The full path of the configuration template + */ + private final String cacheConfigTemplate; + + /** + * The mapping between the configuration types and the creators + */ + private final Map, ExoCacheCreator> map= pingConfigTypeCreators =3D + new HashMap, ExoCacheCreator>(); + + /** + * The mapping between the implementations and the creators. This is ma= inly used for backward compatibility + */ + private final Map mappingImplCreators =3D new = HashMap(); + + /** + * The mapping between the cache names and the configuration paths + */ + private final Map mappingCacheNameConfig =3D new HashMa= p(); + + /** + * The default creator + */ + private final ExoCacheCreator defaultCreator =3D new FIFOExoCacheCreato= r(); + + public ExoCacheFactoryImpl(InitParams params, ConfigurationManager conf= igManager) + { + this.configManager =3D configManager; + this.cacheConfigTemplate =3D getValueParam(params, CACHE_CONFIG_TEMP= LATE_KEY); + if (cacheConfigTemplate =3D=3D null) + { + throw new RuntimeException("The parameter '" + CACHE_CONFIG_TEMPL= ATE_KEY + "' must be set"); + } + } + + /** + * To create a new cache instance according to the given configuration,= we follow the steps below: + * = + * 1. We first try to find if a specific location of the cache configur= ation has been defined thanks + * to an external component plugin of type ExoCacheFactoryConfigPlugin + * 2. If no specific location has been defined, we use the default conf= iguration which is + * "${CACHE_CONFIG_TEMPLATE_KEY}" + */ + public ExoCache createCache(ExoCacheConfig config) throws ExoCacheInitE= xception + { + final String region =3D config.getName(); + final String customConfig =3D mappingCacheNameConfig.get(region); + final Cache cache; + final CacheFactory factory =3D new DefaultCach= eFactory(); + final ExoCache eXoCache; + try + { + if (customConfig !=3D null) + { + // A custom configuration has been set + if (LOG.isInfoEnabled()) + LOG.info("A custom configuration has been set for the cache= '" + region + "'."); + cache =3D factory.createCache(configManager.getInputStream(cus= tomConfig), false); + } + else + { + // No custom configuration has been found, a configuration tem= plate will be used = + if (LOG.isInfoEnabled()) + LOG.info("The configuration template will be used for the t= he cache '" + region + "'."); + cache =3D factory.createCache(configManager.getInputStream(cac= heConfigTemplate), false); + if (!config.isDistributed()) + { + // The cache is local + cache.getConfiguration().setCacheMode(CacheMode.LOCAL); + } + // Re initialize the template to avoid conflicts + cleanConfigurationTemplate(cache, region); + } + final ExoCacheCreator creator =3D getExoCacheCreator(config); + // Create the cache + eXoCache =3D creator.create(config, cache); + // Create the cache + cache.create(); + // Start the cache + cache.start(); + } + catch (Exception e) + { + throw new ExoCacheInitException("The cache '" + region + "' could= not be initialized", e); + } + return eXoCache; + } + + /** + * Add a list of creators to register + * @param plugin the plugin that contains the creators + */ + public void addCreator(ExoCacheCreatorPlugin plugin) + { + final List creators =3D plugin.getCreators(); + for (ExoCacheCreator creator : creators) + { + mappingConfigTypeCreators.put(creator.getExpectedConfigType(), cr= eator); + mappingImplCreators.put(creator.getExpectedImplementation(), crea= tor); + } + } + + /** + * Add a list of custom configuration to register + * @param plugin the plugin that contains the configs + */ + public void addConfig(ExoCacheFactoryConfigPlugin plugin) + { + final Map configs =3D plugin.getConfigs(); + mappingCacheNameConfig.putAll(configs); + } + + /** + * Returns the value of the ValueParam if and only if the value is not = empty + */ + private static String getValueParam(InitParams params, String key) + { + if (params =3D=3D null) + { + return null; + } + final ValueParam vp =3D params.getValueParam(key); + String result; + if (vp =3D=3D null || (result =3D vp.getValue()) =3D=3D null || (res= ult =3D result.trim()).length() =3D=3D 0) + { + return null; + } + return result; + } + + /** + * Returns the most relevant ExoCacheCreator according to the give conf= iguration + */ + protected ExoCacheCreator getExoCacheCreator(ExoCacheConfig config) + { + ExoCacheCreator creator =3D mappingConfigTypeCreators.get(config.get= Class()); + if (creator =3D=3D null) + { + // No creator for this type has been found, let's try the impleme= ntation field + creator =3D mappingImplCreators.get(config.getImplementation()); + if (creator =3D=3D null) + { + // No creator can be found, we will use the default creator + if (LOG.isInfoEnabled()) + LOG.info("No cache creator has been found for the the cache= '" + config.getName() + + "', the default one will be used."); + return defaultCreator; + } + } + if (LOG.isInfoEnabled()) + LOG.info("The cache '" + config.getName() + "' will be created wi= th '" + creator.getClass() + "'."); + return creator; + } + + /** + * Clean the configuration template to prevent conflicts + */ + protected void cleanConfigurationTemplate(Cache c= ache, String region) + { + final Configuration config =3D cache.getConfiguration(); + // Reset the eviction policies = + final EvictionConfig evictionConfig =3D config.getEvictionConfig(); + evictionConfig.setEvictionRegionConfigs(new LinkedList()); + // Rename the cluster name + String clusterName =3D config.getClusterName(); + if (clusterName !=3D null && (clusterName =3D clusterName.trim()).le= ngth() > 0) + { + config.setClusterName(clusterName + " " + region); + } + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/fifo/FIFOExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/fifo/FIFOExoCacheConfig.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/fifo/FIFOExoCacheConfig.java 2009-11-26 15:30:= 27 UTC (rev 889) @@ -0,0 +1,57 @@ +/* + * 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.cache.impl.jboss.fifo; + +import org.exoplatform.services.cache.ExoCacheConfig; + +/** + * The {@link org.exoplatform.services.cache.ExoCacheConfig} for the FIFO = implementation + * = + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class FIFOExoCacheConfig extends ExoCacheConfig +{ + + private int maxNodes; + + private long minTimeToLive; + + public int getMaxNodes() + { + return maxNodes; + } + + public void setMaxNodes(int maxNodes) + { + this.maxNodes =3D maxNodes; + } + + public long getMinTimeToLive() + { + return minTimeToLive; + } + + public void setMinTimeToLive(long minTimeToLive) + { + this.minTimeToLive =3D minTimeToLive; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/fifo/FIFOExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/fifo/FIFOExoCacheCreator.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/fifo/FIFOExoCacheCreator.java 2009-11-26 15:30= :27 UTC (rev 889) @@ -0,0 +1,128 @@ +/* + * 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.cache.impl.jboss.fifo; + +import java.io.Serializable; + +import org.exoplatform.management.annotations.ManagedDescription; +import org.exoplatform.management.annotations.ManagedName; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.exoplatform.services.cache.impl.jboss.AbstractExoCache; +import org.exoplatform.services.cache.impl.jboss.ExoCacheCreator; +import org.jboss.cache.Cache; +import org.jboss.cache.Fqn; +import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.EvictionConfig; +import org.jboss.cache.config.EvictionRegionConfig; +import org.jboss.cache.eviction.FIFOAlgorithmConfig; + +/** + * The FIFO Implementation of an {@link org.exoplatform.services.cache.imp= l.jboss.ExoCacheCreator} + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 20 juil. 2009 = + */ +public class FIFOExoCacheCreator implements ExoCacheCreator +{ + + /** + * The expected implementation name + */ + public static final String EXPECTED_IMPL =3D "FIFO"; + + /** + * {@inheritDoc} + */ + public String getExpectedImplementation() + { + return EXPECTED_IMPL; + } + + /** + * {@inheritDoc} + */ + public Class getExpectedConfigType() + { + return FIFOExoCacheConfig.class; + } + + /** + * {@inheritDoc} + */ + public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException + { + if (config instanceof FIFOExoCacheConfig) + { + final FIFOExoCacheConfig fifoConfig =3D (FIFOExoCacheConfig)confi= g; + return create(config, cache, fifoConfig.getMaxNodes(), fifoConfig= .getMinTimeToLive()); + } + else + { + final long period =3D config.getLiveTime(); + return create(config, cache, config.getMaxSize(), period > 0 ? pe= riod * 1000 : 0); + } + } + + /** + * Creates a new ExoCache instance with the relevant parameters + */ + private ExoCache create(ExoCacheConfig config, Cache cache, int maxNodes, long minTimeToLive) + throws ExoCacheInitException + { + final Configuration configuration =3D cache.getConfiguration(); + final FIFOAlgorithmConfig fifo =3D new FIFOAlgorithmConfig(maxNodes); + fifo.setMinTimeToLive(minTimeToLive); + // Create an eviction region config + final EvictionRegionConfig erc =3D new EvictionRegionConfig(Fqn.ROOT= , fifo); + + final EvictionConfig evictionConfig =3D configuration.getEvictionCon= fig(); + evictionConfig.setDefaultEvictionRegionConfig(erc); + + return new AbstractExoCache(config, cache) + { + + public void setMaxSize(int max) + { + fifo.setMaxNodes(max); + } + + public void setLiveTime(long period) + { + fifo.setMinTimeToLive(period); + } + + @ManagedName("MaxNodes") + @ManagedDescription("This is the maximum number of nodes allowed = in this region. 0 denotes immediate expiry, -1 denotes no limit.") + public int getMaxSize() + { + return fifo.getMaxNodes(); + } + + @ManagedName("MinTimeToLive") + @ManagedDescription("the minimum amount of time a node must be al= lowed to live after being accessed before it is allowed to be considered fo= r eviction. 0 denotes that this feature is disabled, which is the default v= alue.") + public long getLiveTime() + { + return fifo.getMinTimeToLive(); + } + }; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/lfu/LFUExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lfu/LFUExoCacheConfig.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lfu/LFUExoCacheConfig.java 2009-11-26 15:30:27= UTC (rev 889) @@ -0,0 +1,69 @@ +/* + * 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.cache.impl.jboss.lfu; + +import org.exoplatform.services.cache.ExoCacheConfig; + +/** + * The {@link org.exoplatform.services.cache.ExoCacheConfig} for the LFU i= mplementation + * = + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class LFUExoCacheConfig extends ExoCacheConfig +{ + + private int maxNodes; + + private int minNodes; + + private long minTimeToLive; + + public int getMaxNodes() + { + return maxNodes; + } + + public void setMaxNodes(int maxNodes) + { + this.maxNodes =3D maxNodes; + } + + public int getMinNodes() + { + return minNodes; + } + + public void setMinNodes(int minNodes) + { + this.minNodes =3D minNodes; + } + + public long getMinTimeToLive() + { + return minTimeToLive; + } + + public void setMinTimeToLive(long minTimeToLive) + { + this.minTimeToLive =3D minTimeToLive; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/lfu/LFUExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lfu/LFUExoCacheCreator.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lfu/LFUExoCacheCreator.java 2009-11-26 15:30:2= 7 UTC (rev 889) @@ -0,0 +1,160 @@ +/* + * 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.cache.impl.jboss.lfu; + +import java.io.Serializable; + +import org.exoplatform.management.annotations.Managed; +import org.exoplatform.management.annotations.ManagedDescription; +import org.exoplatform.management.annotations.ManagedName; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.exoplatform.services.cache.impl.jboss.AbstractExoCache; +import org.exoplatform.services.cache.impl.jboss.ExoCacheCreator; +import org.jboss.cache.Cache; +import org.jboss.cache.Fqn; +import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.EvictionConfig; +import org.jboss.cache.config.EvictionRegionConfig; +import org.jboss.cache.eviction.LFUAlgorithmConfig; + +/** + * The LFU Implementation of an {@link org.exoplatform.services.cache.impl= .jboss.ExoCacheCreator} + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class LFUExoCacheCreator implements ExoCacheCreator +{ + + /** + * The expected implementation name + */ + public static final String EXPECTED_IMPL =3D "LFU"; + + /** + * The default value for the parameter maxAge + */ + protected int defaultMinNodes; + + /** + * {@inheritDoc} + */ + public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException + { + if (config instanceof LFUExoCacheConfig) + { + final LFUExoCacheConfig lfuConfig =3D (LFUExoCacheConfig)config; + return create(config, cache, lfuConfig.getMaxNodes(), lfuConfig.g= etMinNodes(), lfuConfig.getMinTimeToLive()); + } + else + { + final long period =3D config.getLiveTime(); + return create(config, cache, config.getMaxSize(), defaultMinNodes= , period > 0 ? period * 1000 : 0); + } + } + + /** + * Creates a new ExoCache instance with the relevant parameters + */ + private ExoCache create(ExoCacheConfig config, Cache cache, int maxNodes, int minNodes, + long minTimeToLive) throws ExoCacheInitException + { + final Configuration configuration =3D cache.getConfiguration(); + final LFUAlgorithmConfig lfu =3D new LFUAlgorithmConfig(maxNodes, mi= nNodes); + lfu.setMinTimeToLive(minTimeToLive); + // Create an eviction region config + final EvictionRegionConfig erc =3D new EvictionRegionConfig(Fqn.ROOT= , lfu); + + final EvictionConfig evictionConfig =3D configuration.getEvictionCon= fig(); + evictionConfig.setDefaultEvictionRegionConfig(erc); + return new LFUExoCache(config, cache, lfu); + } + + /** + * {@inheritDoc} + */ + public Class getExpectedConfigType() + { + return LFUExoCacheConfig.class; + } + + /** + * {@inheritDoc} + */ + public String getExpectedImplementation() + { + return EXPECTED_IMPL; + } + + /** + * The LRU implementation of an ExoCache + */ + public static class LFUExoCache extends AbstractExoCache + { + + private final LFUAlgorithmConfig lfu; + + public LFUExoCache(ExoCacheConfig config, Cache cache, LFUAlgorithmConfig lfu) + { + super(config, cache); + this.lfu =3D lfu; + } + + @ManagedName("MinTimeToLive") + @ManagedDescription("the minimum amount of time a node must be allow= ed to live after being accessed before it is allowed to be considered for e= viction. 0 denotes that this feature is disabled, which is the default valu= e.") + public long getLiveTime() + { + return lfu.getMinTimeToLive(); + } + + @ManagedName("MaxNodes") + @ManagedDescription("This is the maximum number of nodes allowed in = this region. 0 denotes immediate expiry, -1 denotes no limit.") + public int getMaxSize() + { + return lfu.getMaxNodes(); + } + + @Managed + @ManagedName("MinNodes") + @ManagedDescription("This is the minimum number of nodes allowed in = this region. This value determines what the eviction queue should prune dow= n to per pass. e.g. If minNodes is 10 and the cache grows to 100 nodes, the= cache is pruned down to the 10 most frequently used nodes when the evictio= n timer makes a pass through the eviction algorithm.") + public long getMinNodes() + { + return lfu.getMinNodes(); + } + + public void setLiveTime(long period) + { + lfu.setMinTimeToLive(period); + } + + public void setMaxSize(int max) + { + lfu.setMaxNodes(max); + } + + @Managed + public void setMinNodes(int minNodes) + { + lfu.setMinNodes(minNodes); + } + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/lru/LRUExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lru/LRUExoCacheConfig.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lru/LRUExoCacheConfig.java 2009-11-26 15:30:27= UTC (rev 889) @@ -0,0 +1,81 @@ +/* + * 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.cache.impl.jboss.lru; + +import org.exoplatform.services.cache.ExoCacheConfig; + +/** + * The {@link org.exoplatform.services.cache.ExoCacheConfig} for the LRU i= mplementation + * = + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class LRUExoCacheConfig extends ExoCacheConfig +{ + + private int maxNodes; + + private long timeToLive; + + private long maxAge; + + private long minTimeToLive; + + public int getMaxNodes() + { + return maxNodes; + } + + public void setMaxNodes(int maxNodes) + { + this.maxNodes =3D maxNodes; + } + + public long getTimeToLive() + { + return timeToLive; + } + + public void setTimeToLive(long timeToLive) + { + this.timeToLive =3D timeToLive; + } + + public long getMaxAge() + { + return maxAge; + } + + public void setMaxAge(long maxAge) + { + this.maxAge =3D maxAge; + } + + public long getMinTimeToLive() + { + return minTimeToLive; + } + + public void setMinTimeToLive(long minTimeToLive) + { + this.minTimeToLive =3D minTimeToLive; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/lru/LRUExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lru/LRUExoCacheCreator.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/lru/LRUExoCacheCreator.java 2009-11-26 15:30:2= 7 UTC (rev 889) @@ -0,0 +1,181 @@ +/* + * 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.cache.impl.jboss.lru; + +import java.io.Serializable; + +import org.exoplatform.management.annotations.Managed; +import org.exoplatform.management.annotations.ManagedDescription; +import org.exoplatform.management.annotations.ManagedName; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.exoplatform.services.cache.impl.jboss.AbstractExoCache; +import org.exoplatform.services.cache.impl.jboss.ExoCacheCreator; +import org.jboss.cache.Cache; +import org.jboss.cache.Fqn; +import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.EvictionConfig; +import org.jboss.cache.config.EvictionRegionConfig; +import org.jboss.cache.eviction.LRUAlgorithmConfig; + +/** + * The LRU Implementation of an {@link org.exoplatform.services.cache.impl= .jboss.ExoCacheCreator} + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class LRUExoCacheCreator implements ExoCacheCreator +{ + + /** + * The expected implementation name + */ + public static final String EXPECTED_IMPL =3D "LRU"; + + /** + * The default value for the parameter timeToLive + */ + protected long defaultTimeToLive; + + /** + * The default value for the parameter maxAge + */ + protected long defaultMaxAge; + + /** + * {@inheritDoc} + */ + public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException + { + if (config instanceof LRUExoCacheConfig) + { + final LRUExoCacheConfig lruConfig =3D (LRUExoCacheConfig)config; + return create(config, cache, lruConfig.getMaxNodes(), lruConfig.g= etTimeToLive(), lruConfig.getMaxAge(), + lruConfig.getMinTimeToLive()); + } + else + { + final long period =3D config.getLiveTime(); + return create(config, cache, config.getMaxSize(), defaultTimeToLi= ve, defaultMaxAge, period > 0 ? period * 1000 + : 0); + } + } + + /** + * Creates a new ExoCache instance with the relevant parameters + */ + private ExoCache create(ExoCacheConfig config, Cache cache, int maxNodes, long timeToLive, + long maxAge, long minTimeToLive) throws ExoCacheInitException + { + final Configuration configuration =3D cache.getConfiguration(); + final LRUAlgorithmConfig lru =3D new LRUAlgorithmConfig(timeToLive, = maxAge, maxNodes); + lru.setMinTimeToLive(minTimeToLive); + // Create an eviction region config + final EvictionRegionConfig erc =3D new EvictionRegionConfig(Fqn.ROOT= , lru); + + final EvictionConfig evictionConfig =3D configuration.getEvictionCon= fig(); + evictionConfig.setDefaultEvictionRegionConfig(erc); + return new LRUExoCache(config, cache, lru); + } + + /** + * {@inheritDoc} + */ + public Class getExpectedConfigType() + { + return LRUExoCacheConfig.class; + } + + /** + * {@inheritDoc} + */ + public String getExpectedImplementation() + { + return EXPECTED_IMPL; + } + + /** + * The LRU implementation of an ExoCache + */ + public static class LRUExoCache extends AbstractExoCache + { + + private final LRUAlgorithmConfig lru; + + public LRUExoCache(ExoCacheConfig config, Cache cache, LRUAlgorithmConfig lru) + { + super(config, cache); + this.lru =3D lru; + } + + @ManagedName("MinTimeToLive") + @ManagedDescription("the minimum amount of time a node must be allow= ed to live after being accessed before it is allowed to be considered for e= viction. 0 denotes that this feature is disabled, which is the default valu= e.") + public long getLiveTime() + { + return lru.getMinTimeToLive(); + } + + @ManagedName("MaxNodes") + @ManagedDescription("This is the maximum number of nodes allowed in = this region. 0 denotes immediate expiry, -1 denotes no limit.") + public int getMaxSize() + { + return lru.getMaxNodes(); + } + + @Managed + @ManagedName("TimeToLive") + @ManagedDescription("The amount of time a node is not written to or = read (in milliseconds) before the node is swept away. 0 denotes immediate e= xpiry, -1 denotes no limit.") + public long getTimeToLive() + { + return lru.getTimeToLive(); + } + + @Managed + @ManagedName("MaxAges") + @ManagedDescription("Lifespan of a node (in milliseconds) regardless= of idle time before the node is swept away. 0 denotes immediate expiry, -1= denotes no limit.") + public long getMaxAge() + { + return lru.getMaxAge(); + } + + public void setLiveTime(long period) + { + lru.setMinTimeToLive(period); + } + + public void setMaxSize(int max) + { + lru.setMaxNodes(max); + } + + @Managed + public void setTimeToLive(long timeToLive) + { + lru.setTimeToLive(timeToLive); + } + + @Managed + public void setMaxAge(long maxAge) + { + lru.setMaxAge(maxAge); + } + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/mru/MRUExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/mru/MRUExoCacheConfig.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/mru/MRUExoCacheConfig.java 2009-11-26 15:30:27= UTC (rev 889) @@ -0,0 +1,57 @@ +/* + * 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.cache.impl.jboss.mru; + +import org.exoplatform.services.cache.ExoCacheConfig; + +/** + * The {@link org.exoplatform.services.cache.ExoCacheConfig} for the MRU i= mplementation + * = + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class MRUExoCacheConfig extends ExoCacheConfig +{ + + private int maxNodes; + + private long minTimeToLive; + + public int getMaxNodes() + { + return maxNodes; + } + + public void setMaxNodes(int maxNodes) + { + this.maxNodes =3D maxNodes; + } + + public long getMinTimeToLive() + { + return minTimeToLive; + } + + public void setMinTimeToLive(long minTimeToLive) + { + this.minTimeToLive =3D minTimeToLive; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exopla= tform/services/cache/impl/jboss/mru/MRUExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/mru/MRUExoCacheCreator.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/mru/MRUExoCacheCreator.java 2009-11-26 15:30:2= 7 UTC (rev 889) @@ -0,0 +1,128 @@ +/* + * 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.cache.impl.jboss.mru; + +import java.io.Serializable; + +import org.exoplatform.management.annotations.ManagedDescription; +import org.exoplatform.management.annotations.ManagedName; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.exoplatform.services.cache.impl.jboss.AbstractExoCache; +import org.exoplatform.services.cache.impl.jboss.ExoCacheCreator; +import org.jboss.cache.Cache; +import org.jboss.cache.Fqn; +import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.EvictionConfig; +import org.jboss.cache.config.EvictionRegionConfig; +import org.jboss.cache.eviction.MRUAlgorithmConfig; + +/** + * The MRU Implementation of an {@link org.exoplatform.services.cache.impl= .jboss.ExoCacheCreator} + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class MRUExoCacheCreator implements ExoCacheCreator +{ + + /** + * The expected implementation name + */ + public static final String EXPECTED_IMPL =3D "MRU"; + + /** + * {@inheritDoc} + */ + public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException + { + if (config instanceof MRUExoCacheConfig) + { + final MRUExoCacheConfig mruConfig =3D (MRUExoCacheConfig)config; + return create(config, cache, mruConfig.getMaxNodes(), mruConfig.g= etMinTimeToLive()); + } + else + { + final long period =3D config.getLiveTime(); + return create(config, cache, config.getMaxSize(), period > 0 ? pe= riod * 1000 : 0); + } + } + + /** + * Creates a new ExoCache instance with the relevant parameters + */ + private ExoCache create(ExoCacheConfig config, Cache cache, int maxNodes, long minTimeToLive) + throws ExoCacheInitException + { + final Configuration configuration =3D cache.getConfiguration(); + final MRUAlgorithmConfig mru =3D new MRUAlgorithmConfig(maxNodes); + mru.setMinTimeToLive(minTimeToLive); + // Create an eviction region config + final EvictionRegionConfig erc =3D new EvictionRegionConfig(Fqn.ROOT= , mru); + + final EvictionConfig evictionConfig =3D configuration.getEvictionCon= fig(); + evictionConfig.setDefaultEvictionRegionConfig(erc); + + return new AbstractExoCache(config, cache) + { + + public void setMaxSize(int max) + { + mru.setMaxNodes(max); + } + + public void setLiveTime(long period) + { + mru.setMinTimeToLive(period); + } + + @ManagedName("MaxNodes") + @ManagedDescription("This is the maximum number of nodes allowed = in this region. 0 denotes immediate expiry, -1 denotes no limit.") + public int getMaxSize() + { + return mru.getMaxNodes(); + } + + @ManagedName("MinTimeToLive") + @ManagedDescription("the minimum amount of time a node must be al= lowed to live after being accessed before it is allowed to be considered fo= r eviction. 0 denotes that this feature is disabled, which is the default v= alue.") + public long getLiveTime() + { + return mru.getMinTimeToLive(); + } + }; + } + + /** + * {@inheritDoc} + */ + public Class getExpectedConfigType() + { + return MRUExoCacheConfig.class; + } + + /** + * {@inheritDoc} + */ + public String getExpectedImplementation() + { + return EXPECTED_IMPL; + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/= portal/cache-configuration-template.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/por= tal/cache-configuration-template.xml (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/por= tal/cache-configuration-template.xml 2009-11-26 15:30:27 UTC (rev 889) @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/= portal/configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/por= tal/configuration.xml (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/por= tal/configuration.xml 2009-11-26 15:30:27 UTC (rev 889) @@ -0,0 +1,33 @@ + + + + + org.exoplatform.services.cache.ExoCacheFactory + org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl<= /type> + + + cache.config.template + jar:/conf/portal/cache-configuration-template.xml + + + + Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exopla= tform/services/cache/impl/jboss/TestAbstractExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestAbstractExoCache.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestAbstractExoCache.java 2009-11-26 15:30:27 = UTC (rev 889) @@ -0,0 +1,643 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.CachedObjectSelector; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheFactory; +import org.exoplatform.services.cache.ObjectCacheInfo; +import org.exoplatform.test.BasicTestCase; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestAbstractExoCache extends BasicTestCase +{ + + CacheService service; + + AbstractExoCache cache; + + ExoCacheFactory factory; + + public TestAbstractExoCache(String name) + { + super(name); + } + + public void setUp() throws Exception + { + this.service =3D (CacheService)PortalContainer.getInstance().getComp= onentInstanceOfType(CacheService.class); + this.cache =3D (AbstractExoCache)service.getCacheInstance("myCache"); + this.factory =3D (ExoCacheFactory)PortalContainer.getInstance().getC= omponentInstanceOfType(ExoCacheFactory.class); + } + + protected void tearDown() throws Exception + { + cache.clearCache(); + } + + public void testPut() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + assertEquals(3, cache.getCacheSize()); + cache.put(new MyKey("a"), "c"); + assertEquals(3, cache.getCacheSize()); + cache.put(new MyKey("d"), "c"); + assertEquals(4, cache.getCacheSize()); + } + + public void testClearCache() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + assertTrue(cache.getCacheSize() > 0); + cache.clearCache(); + assertTrue(cache.getCacheSize() =3D=3D 0); + } + + public void testGet() throws Exception + { + cache.put(new MyKey("a"), "a"); + assertEquals("a", cache.get(new MyKey("a"))); + cache.put(new MyKey("a"), "c"); + assertEquals("c", cache.get(new MyKey("a"))); + cache.remove(new MyKey("a")); + assertEquals(null, cache.get(new MyKey("a"))); + assertEquals(null, cache.get(new MyKey("x"))); + } + + public void testRemove() throws Exception + { + cache.put(new MyKey("a"), 1); + cache.put(new MyKey("b"), 2); + cache.put(new MyKey("c"), 3); + assertEquals(3, cache.getCacheSize()); + assertEquals(1, cache.remove(new MyKey("a"))); + assertEquals(2, cache.getCacheSize()); + assertEquals(2, cache.remove(new MyKey("b"))); + assertEquals(1, cache.getCacheSize()); + assertEquals(null, cache.remove(new MyKey("x"))); + assertEquals(1, cache.getCacheSize()); + } + + public void testPutMap() throws Exception + { + Map values =3D new HashMap(); + values.put(new MyKey("a"), "a"); + values.put(new MyKey("b"), "b"); + assertEquals(0, cache.getCacheSize()); + cache.putMap(values); + assertEquals(2, cache.getCacheSize()); + values =3D new HashMap() + { + public Set> entrySet() + { + Set> set =3D new LinkedHashSet>(super.entrySet()); + set.add(new Entry() + { + + public Object setValue(Object paramV) + { + return null; + } + + public Object getValue() + { + throw new RuntimeException("An exception"); + } + + public Serializable getKey() + { + return "c"; + } + }); + return set; + } + }; + values.put(new MyKey("e"), "e"); + values.put(new MyKey("d"), "d"); + try + { + cache.putMap(values); + assertTrue("An error was expected", false); + } + catch (Exception e) + { + } + assertEquals(2, cache.getCacheSize()); + } + + public void testGetCachedObjects() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + cache.put(new MyKey("d"), null); + assertEquals(4, cache.getCacheSize()); + List values =3D cache.getCachedObjects(); + assertEquals(3, values.size()); + assertTrue(values.contains("a")); + assertTrue(values.contains("b")); + assertTrue(values.contains("c")); + } + + public void testRemoveCachedObjects() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + cache.put(new MyKey("d"), null); + assertEquals(4, cache.getCacheSize()); + List values =3D cache.removeCachedObjects(); + assertEquals(3, values.size()); + assertTrue(values.contains("a")); + assertTrue(values.contains("b")); + assertTrue(values.contains("c")); + assertEquals(0, cache.getCacheSize()); + } + + public void testSelect() throws Exception + { + cache.put(new MyKey("a"), 1); + cache.put(new MyKey("b"), 2); + cache.put(new MyKey("c"), 3); + final AtomicInteger count =3D new AtomicInteger(); + CachedObjectSelector selector =3D new CachedObjectSelector() + { + + public void onSelect(ExoCache cache, Serializable key, ObjectCach= eInfo ocinfo) throws Exception + { + assertTrue(key.equals(new MyKey("a")) || key.equals(new MyKey(= "b")) || key.equals(new MyKey("c"))); + assertTrue(ocinfo.get().equals(1) || ocinfo.get().equals(2) ||= ocinfo.get().equals(3)); + count.incrementAndGet(); + } + + public boolean select(Serializable key, ObjectCacheInfo ocinfo) + { + return true; + } + }; + cache.select(selector); + assertEquals(3, count.intValue()); + } + + public void testGetHitsNMisses() throws Exception + { + int hits =3D cache.getCacheHit(); + int misses =3D cache.getCacheMiss(); + cache.put(new MyKey("a"), "a"); + cache.get(new MyKey("a")); + cache.remove(new MyKey("a")); + cache.get(new MyKey("a")); + cache.get(new MyKey("z")); + assertEquals(1, cache.getCacheHit() - hits); + assertEquals(2, cache.getCacheMiss() - misses); + } + + public void testDistributedCache() throws Exception + { + ExoCacheConfig config =3D new ExoCacheConfig(); + config.setName("MyCacheDistributed"); + config.setMaxSize(5); + config.setLiveTime(1000); + config.setDistributed(true); + ExoCacheConfig config2 =3D new ExoCacheConfig(); + config2.setName("MyCacheDistributed2"); + config2.setMaxSize(5); + config2.setLiveTime(1000); + config2.setDistributed(true); + AbstractExoCache cache1 =3D (AbstractExoCache)factory.createCache(co= nfig); + MyCacheListener listener1 =3D new MyCacheListener(); + cache1.addCacheListener(listener1); + AbstractExoCache cache2 =3D (AbstractExoCache)factory.createCache(co= nfig); + MyCacheListener listener2 =3D new MyCacheListener(); + cache2.addCacheListener(listener2); + AbstractExoCache cache3 =3D (AbstractExoCache)factory.createCache(co= nfig2); + MyCacheListener listener3 =3D new MyCacheListener(); + cache3.addCacheListener(listener3); + try + { + cache1.put(new MyKey("a"), "b"); + assertEquals(1, cache1.getCacheSize()); + assertEquals("b", cache2.get(new MyKey("a"))); + assertEquals(1, cache2.getCacheSize()); + assertEquals(0, cache3.getCacheSize()); + assertEquals(1, listener1.put); + assertEquals(1, listener2.put); + assertEquals(0, listener3.put); + assertEquals(0, listener1.get); + assertEquals(1, listener2.get); + assertEquals(0, listener3.get); + cache2.put(new MyKey("b"), "c"); + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals("c", cache1.get(new MyKey("b"))); + assertEquals(0, cache3.getCacheSize()); + assertEquals(2, listener1.put); + assertEquals(2, listener2.put); + assertEquals(0, listener3.put); + assertEquals(1, listener1.get); + assertEquals(1, listener2.get); + assertEquals(0, listener3.get); + cache3.put(new MyKey("c"), "d"); + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals(1, cache3.getCacheSize()); + assertEquals("d", cache3.get(new MyKey("c"))); + assertEquals(2, listener1.put); + assertEquals(2, listener2.put); + assertEquals(1, listener3.put); + assertEquals(1, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + cache2.put(new MyKey("a"), "a"); + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals("a", cache1.get(new MyKey("a"))); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + cache2.remove(new MyKey("a")); + assertEquals(1, cache1.getCacheSize()); + assertEquals(1, cache2.getCacheSize()); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + cache1.clearCache(); + assertEquals(0, cache1.getCacheSize()); + assertEquals(null, cache2.get(new MyKey("b"))); + assertEquals(0, cache2.getCacheSize()); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(2, listener2.get); + assertEquals(1, listener3.get); + assertEquals(2, listener1.remove); + assertEquals(2, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + Map values =3D new HashMap(); + values.put(new MyKey("a"), "a"); + values.put(new MyKey("b"), "b"); + cache1.putMap(values); + assertEquals(2, cache1.getCacheSize()); + Thread.sleep(40); + assertEquals("a", cache2.get(new MyKey("a"))); + assertEquals("b", cache2.get(new MyKey("b"))); + assertEquals(2, cache2.getCacheSize()); + assertEquals(5, listener1.put); + assertEquals(5, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(4, listener2.get); + assertEquals(1, listener3.get); + assertEquals(2, listener1.remove); + assertEquals(2, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + values =3D new HashMap() + { + public Set> entrySet() + { + Set> set =3D new LinkedHashSet<= Entry>(super.entrySet()); + set.add(new Entry() + { + + public Object setValue(Object paramV) + { + return null; + } + + public Object getValue() + { + throw new RuntimeException("An exception"); + } + + public Serializable getKey() + { + return "c"; + } + }); + return set; + } + }; + values.put(new MyKey("e"), "e"); + values.put(new MyKey("d"), "d"); + try + { + cache1.putMap(values); + assertTrue("An error was expected", false); + } + catch (Exception e) + { + } + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals(5, listener1.put); + assertEquals(5, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(4, listener2.get); + assertEquals(1, listener3.get); + assertEquals(2, listener1.remove); + assertEquals(2, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + } + finally + { + cache1.cache.stop(); + cache2.cache.stop(); + cache3.cache.stop(); + } + } + + public void testMultiThreading() throws Exception + { + final ExoCache cache =3D service.getCacheInstance("test-multi-thread= ing"); + final int totalElement =3D 100; + final int totalTimes =3D 100; + int reader =3D 20; + int writer =3D 10; + int remover =3D 5; + int cleaner =3D 1; + final CountDownLatch startSignalWriter =3D new CountDownLatch(1); + final CountDownLatch startSignalOthers =3D new CountDownLatch(1); + final CountDownLatch doneSignal =3D new CountDownLatch(reader + writ= er + remover); + final List errors =3D Collections.synchronizedList(new Ar= rayList()); + for (int i =3D 0; i < writer; i++) + { + final int index =3D i; + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignalWriter.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.put(new MyKey("key" + i), "value" + i); + } + if (index =3D=3D 0 && j =3D=3D 0) + { + // The cache is full, we can launch the others + startSignalOthers.countDown(); + } + sleep(50); + } + doneSignal.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + startSignalWriter.countDown(); + for (int i =3D 0; i < reader; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignalOthers.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.get(new MyKey("key" + i)); + } + sleep(50); + } + doneSignal.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + for (int i =3D 0; i < remover; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignalOthers.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.remove(new MyKey("key" + i)); + } + sleep(50); + } + doneSignal.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + doneSignal.await(); + for (int i =3D 0; i < totalElement; i++) + { + cache.put(new MyKey("key" + i), "value" + i); + } + assertEquals(totalElement, cache.getCacheSize()); + final CountDownLatch startSignal =3D new CountDownLatch(1); + final CountDownLatch doneSignal2 =3D new CountDownLatch(writer + cle= aner); + for (int i =3D 0; i < writer; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignal.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.put(new MyKey("key" + i), "value" + i); + } + sleep(50); + } + doneSignal2.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + for (int i =3D 0; i < cleaner; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignal.await(); + for (int j =3D 0; j < totalTimes; j++) + { + sleep(150); + cache.clearCache(); + } + doneSignal2.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + cache.clearCache(); + assertEquals(0, cache.getCacheSize()); + if (!errors.isEmpty()) + { + for (Exception e : errors) + { + e.printStackTrace(); + } + throw errors.get(0); + } + + } + + public static class MyCacheListener implements CacheListener + { + + public int clearCache; + + public int expire; + + public int get; + + public int put; + + public int remove; + + public void onClearCache(ExoCache cache) throws Exception + { + clearCache++; + } + + public void onExpire(ExoCache cache, Serializable key, Object obj) t= hrows Exception + { + expire++; + } + + public void onGet(ExoCache cache, Serializable key, Object obj) thro= ws Exception + { + get++; + } + + public void onPut(ExoCache cache, Serializable key, Object obj) thro= ws Exception + { + put++; + } + + public void onRemove(ExoCache cache, Serializable key, Object obj) t= hrows Exception + { + remove++; + } + } + + public static class MyKey implements Serializable + { + public String value; + + public MyKey(String value) + { + this.value =3D value; + } + + @Override + public boolean equals(Object paramObject) + { + return paramObject instanceof MyKey && ((MyKey)paramObject).value= .endsWith(value); + } + + @Override + public int hashCode() + { + return value.hashCode(); + } + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exopla= tform/services/cache/impl/jboss/TestExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheConfig.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheConfig.java 2009-11-26 15:30:27 UT= C (rev 889) @@ -0,0 +1,32 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.services.cache.ExoCacheConfig; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestExoCacheConfig extends ExoCacheConfig +{ + +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exopla= tform/services/cache/impl/jboss/TestExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheCreator.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheCreator.java 2009-11-26 15:30:27 U= TC (rev 889) @@ -0,0 +1,215 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CachedObjectSelector; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.jboss.cache.Cache; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestExoCacheCreator implements ExoCacheCreator +{ + + public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException + { + return new TestExoCache(); + } + + public Class getExpectedConfigType() + { + return TestExoCacheConfig.class; + } + + public String getExpectedImplementation() + { + return "TEST"; + } + + public static class TestExoCache implements ExoCache + { + + public void addCacheListener(CacheListener listener) + { + // TODO Auto-generated method stub + + } + + public void clearCache() throws Exception + { + // TODO Auto-generated method stub + + } + + public Object get(Serializable name) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + public int getCacheHit() + { + // TODO Auto-generated method stub + return 0; + } + + public int getCacheMiss() + { + // TODO Auto-generated method stub + return 0; + } + + public int getCacheSize() + { + // TODO Auto-generated method stub + return 0; + } + + public List getCachedObjects() + { + // TODO Auto-generated method stub + return null; + } + + public String getLabel() + { + // TODO Auto-generated method stub + return null; + } + + public long getLiveTime() + { + // TODO Auto-generated method stub + return 0; + } + + public int getMaxSize() + { + // TODO Auto-generated method stub + return 0; + } + + public String getName() + { + return "name"; + } + + public boolean isDistributed() + { + // TODO Auto-generated method stub + return false; + } + + public boolean isLogEnabled() + { + // TODO Auto-generated method stub + return false; + } + + public boolean isReplicated() + { + // TODO Auto-generated method stub + return false; + } + + public void put(Serializable name, Object obj) throws Exception + { + // TODO Auto-generated method stub + + } + + public void putMap(Map objs) throws Exception + { + // TODO Auto-generated method stub + + } + + public Object remove(Serializable name) throws Exception + { + // TODO Auto-generated method stub + return null; + } + + public List removeCachedObjects() throws Exception + { + // TODO Auto-generated method stub + return null; + } + + public void select(CachedObjectSelector selector) throws Exception + { + // TODO Auto-generated method stub + + } + + public void setDistributed(boolean b) + { + // TODO Auto-generated method stub + + } + + public void setLabel(String s) + { + // TODO Auto-generated method stub + + } + + public void setLiveTime(long period) + { + // TODO Auto-generated method stub + + } + + public void setLogEnabled(boolean b) + { + // TODO Auto-generated method stub + + } + + public void setMaxSize(int max) + { + // TODO Auto-generated method stub + + } + + public void setName(String name) + { + // TODO Auto-generated method stub + + } + + public void setReplicated(boolean b) + { + // TODO Auto-generated method stub + + } + + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exopla= tform/services/cache/impl/jboss/TestExoCacheFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheFactoryImpl.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheFactoryImpl.java 2009-11-26 15:30:= 27 UTC (rev 889) @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.impl.jboss.TestExoCacheCreator.TestE= xoCache; +import org.exoplatform.test.BasicTestCase; +import org.jboss.cache.config.Configuration.CacheMode; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 20 juil. 2009 = + */ +public class TestExoCacheFactoryImpl extends BasicTestCase +{ + + CacheService service_; + + public TestExoCacheFactoryImpl(String name) + { + super(name); + } + + public void setUp() throws Exception + { + service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); + } + + public void testCacheFactory() + { + ExoCache cache =3D service_.getCacheInstance("myCache"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + AbstractExoCache aCache =3D (AbstractExoCache)cache; + assertTrue("expect a local cache", aCache.cache.getConfiguration().g= etCacheMode() =3D=3D CacheMode.LOCAL); + aCache.cache.stop(); + cache =3D service_.getCacheInstance("cacheDistributed"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + aCache =3D (AbstractExoCache)cache; + assertTrue("expect a distributed cache", aCache.cache.getConfigurati= on().getCacheMode() =3D=3D CacheMode.REPL_SYNC); + aCache.cache.stop(); + cache =3D service_.getCacheInstance("myCustomCache"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + aCache =3D (AbstractExoCache)cache; + assertTrue("expect a distributed cache", aCache.cache.getConfigurati= on().getCacheMode() =3D=3D CacheMode.REPL_SYNC); + aCache.cache.stop(); + } + + public void testExoCacheCreator() + { + ExoCache cache =3D service_.getCacheInstance("test-default-impl"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + AbstractExoCache aCache =3D (AbstractExoCache)cache; + aCache.cache.stop(); + cache =3D service_.getCacheInstance("test-custom-impl-with-old-confi= g"); + assertTrue("expect an instance of TestExoCache", cache instanceof Te= stExoCache); + cache =3D service_.getCacheInstance("test-custom-impl-with-new-confi= g"); + assertTrue("expect an instance of TestExoCache", cache instanceof Te= stExoCache); + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exopla= tform/services/cache/impl/jboss/TestFIFOCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestFIFOCache.java (re= v 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestFIFOCache.java 2009-11-26 15:30:27 UTC (re= v 889) @@ -0,0 +1,85 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.test.BasicTestCase; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestFIFOCache extends BasicTestCase +{ + + CacheService service_; + + public TestFIFOCache(String name) + { + super(name); + } + + public void setUp() throws Exception + { + service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); + } + + public void testPolicy() throws Exception + { + testPolicy("test-fifo"); + testPolicy("test-fifo-with-old-config"); + } + + private void testPolicy(String cacheName) throws Exception + { + ExoCache cache =3D service_.getCacheInstance(cacheName); + cache.put("a", "a"); + cache.put("b", "a"); + cache.put("c", "a"); + cache.put("d", "a"); + assertEquals(4, cache.getCacheSize()); + cache.put("e", "a"); + assertEquals(5, cache.getCacheSize()); + cache.put("f", "a"); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(500); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(600); + assertEquals(5, cache.getCacheSize()); + cache.setMaxSize(3); + cache.setLiveTime(1500); + cache.put("g", "a"); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(1100); + assertEquals(3, cache.getCacheSize()); + cache.put("h", "a"); + cache.put("i", "a"); + cache.put("j", "a"); + cache.put("k", "a"); + assertEquals(7, cache.getCacheSize()); + Thread.sleep(500); + assertEquals(4, cache.getCacheSize()); + Thread.sleep(1100); + assertEquals(3, cache.getCacheSize()); + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exopla= tform/services/cache/impl/jboss/TestLRUCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestLRUCache.java (rev= 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestLRUCache.java 2009-11-26 15:30:27 UTC (rev= 889) @@ -0,0 +1,91 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator.LR= UExoCache; +import org.exoplatform.test.BasicTestCase; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestLRUCache extends BasicTestCase +{ + + CacheService service_; + + public TestLRUCache(String name) + { + super(name); + } + + public void setUp() throws Exception + { + service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); + } + + public void testPolicy() throws Exception + { + testPolicy("test-lru"); + testPolicy("test-lru-with-old-config"); + } + + private void testPolicy(String cacheName) throws Exception + { + LRUExoCache cache =3D (LRUExoCache)service_.getCacheInstance(cacheNa= me); + cache.put("a", "a"); + cache.put("b", "a"); + cache.put("c", "a"); + cache.put("d", "a"); + assertEquals(4, cache.getCacheSize()); + cache.put("e", "a"); + assertEquals(5, cache.getCacheSize()); + cache.put("f", "a"); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(1000); + assertFalse(cache.get("b") =3D=3D null); + assertFalse(cache.get("c") =3D=3D null); + assertFalse(cache.get("d") =3D=3D null); + Thread.sleep(600); + assertEquals(3, cache.getCacheSize()); + Thread.sleep(500); + assertEquals(0, cache.getCacheSize()); + cache.setMaxSize(3); + cache.setTimeToLive(500); + cache.setMaxAge(1000); + cache.put("a", "a"); + cache.put("b", "a"); + cache.put("c", "a"); + cache.put("d", "a"); + assertEquals(4, cache.getCacheSize()); + cache.put("e", "a"); + assertEquals(5, cache.getCacheSize()); + cache.put("f", "a"); + Thread.sleep(500); + cache.get("a"); + cache.get("b"); + assertEquals(3, cache.getCacheSize()); + Thread.sleep(600); + assertEquals(0, cache.getCacheSize()); + } +} Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/= portal/cache-configuration-template.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/cache-configuration-template.xml (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/cache-configuration-template.xml 2009-11-26 15:30:27 UTC (rev 889) @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/= portal/distributed-cache-configuration-template.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/distributed-cache-configuration-template.xml (r= ev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/distributed-cache-configuration-template.xml 2009-11-26 15:30:27 UTC (r= ev 889) @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + Added: kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/= portal/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/test-configuration.xml (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/test-configuration.xml 2009-11-26 15:30:27 UTC (rev 889) @@ -0,0 +1,180 @@ + + + + = + + org.exoplatform.services.cache.CacheService + org.exoplatform.services.cache.impl.CacheServiceImpl + + + + cache.config.default + The default cache configuration + + default + 5 + 2 + + + + test-multi-threading + The default cache configuration + + test-multi-threading + -1 + 0 + = + = + + cacheDistributed + The default cache configuration + + cacheDistributed + 5 + 2 + true + + = + + test-default-impl + The default cache configuration + + test-default-impl + 5 + 2 + + = + + test-custom-impl-with-old-config + The default cache configuration + + test-custom-impl-with-old-config + 5 + 2 + TEST + + = + + test-custom-impl-with-new-config + The default cache configuration + + test-custom-impl-with-new-config + 5 + 2 + + + + test-fifo-with-old-config + The default cache configuration + + test-fifo-with-old-config<= /field> + 5 + 1 + FIFO + + = + + test-fifo + The default cache configuration + + test-fifo + 5 + 1000 + + = + + test-lru-with-old-config + The default cache configuration + + test-lru-with-old-config + 5 + 1 + LRU + + = + + test-lru + The default cache configuration + + test-lru + 5 + 1000 + 2000 + 1500 + + = + = + = + = + + org.exoplatform.services.cache.ExoCacheFactory + org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl + + + cache.config.template + jar:/conf/portal/cache-configuration-template.xml + + + = + = + + org.exoplatform.services.cache.ExoCacheFactory + + addConfig + addConfig + org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryConfi= gPlugin + add Custom Configurations + = + + myCustomCache + jar:/conf/portal/distributed-cache-configuration-template.= xml + = + = + = + + addCreator + addCreator + org.exoplatform.services.cache.impl.jboss.ExoCacheCreatorPlugi= n + add Exo Cache Creator + = + + Test + The cache creator for testing purpose + + = + + FIFO + The fifo cache creator + + + + LRU + The lru cache creator + + 1500 + 2000 = + + = + = + + = + --===============6120584001834927613==-- From do-not-reply at jboss.org Thu Nov 26 10:32:33 2009 Content-Type: multipart/mixed; boundary="===============5924491819706367502==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r890 - kernel/trunk/exo.kernel.component.ext.cache. Date: Thu, 26 Nov 2009 10:32:33 -0500 Message-ID: <200911261532.nAQFWX56013012@svn01.web.mwc.hst.phx2.redhat.com> --===============5924491819706367502== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 10:32:33 -0500 (Thu, 26 Nov 2009) New Revision: 890 Removed: kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ Log: EXOJCR-268 Added an implementation of ExoCache for JBoss Cache 3 Deleted: kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ 2009-11-26 15:30:2= 7 UTC (rev 889) +++ kernel/trunk/exo.kernel.component.ext.cache/pom.xml~ 2009-11-26 15:32:3= 3 UTC (rev 890) @@ -1,28 +0,0 @@ - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta05-SNAPSHOT - - - exo.kernel.component.ext.cache - - JBoss Cache Implementation for the Cache Service - - - - org.exoplatform.kernel - exo.kernel.component.cache - - - org.jboss.cache - jbosscache-core - - - jgroups - jgroups - = - - --===============5924491819706367502==-- From do-not-reply at jboss.org Thu Nov 26 10:38:45 2009 Content-Type: multipart/mixed; boundary="===============3045205858659760233==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r891 - kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatform/services/cache/impl/jboss. Date: Thu, 26 Nov 2009 10:38:39 -0500 Message-ID: <200911261538.nAQFcdiq013884@svn01.web.mwc.hst.phx2.redhat.com> --===============3045205858659760233== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 10:38:39 -0500 (Thu, 26 Nov 2009) New Revision: 891 Modified: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/AbstractExoCache.java kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfor= m/services/cache/impl/jboss/ExoCacheFactoryImpl.java Log: EXOJCR-268 org.apache.commons.logging replaced with exo logger Modified: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exo= platform/services/cache/impl/jboss/AbstractExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/AbstractExoCache.java 2009-11-26 15:32:33 UTC = (rev 890) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/AbstractExoCache.java 2009-11-26 15:38:39 UTC = (rev 891) @@ -26,13 +26,13 @@ import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicInteger; = -import org.apache.commons.logging.Log; import org.exoplatform.services.cache.CacheListener; import org.exoplatform.services.cache.CachedObjectSelector; import org.exoplatform.services.cache.ExoCache; import org.exoplatform.services.cache.ExoCacheConfig; import org.exoplatform.services.cache.ObjectCacheInfo; import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; import org.jboss.cache.CacheSPI; import org.jboss.cache.Fqn; Modified: kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exo= platform/services/cache/impl/jboss/ExoCacheFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2009-11-26 15:32:33 U= TC (rev 890) +++ kernel/trunk/exo.kernel.component.ext.cache/src/main/java/org/exoplatfo= rm/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2009-11-26 15:38:39 U= TC (rev 891) @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; = -import org.apache.commons.logging.Log; import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.ValueParam; @@ -34,6 +33,7 @@ import org.exoplatform.services.cache.ExoCacheInitException; import org.exoplatform.services.cache.impl.jboss.fifo.FIFOExoCacheCreator; import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; import org.jboss.cache.CacheFactory; import org.jboss.cache.DefaultCacheFactory; --===============3045205858659760233==-- From do-not-reply at jboss.org Thu Nov 26 10:41:36 2009 Content-Type: multipart/mixed; boundary="===============5821074400156889701==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r892 - kernel/trunk/exo.kernel.component.ext.cache. Date: Thu, 26 Nov 2009 10:41:36 -0500 Message-ID: <200911261541.nAQFfapl014473@svn01.web.mwc.hst.phx2.redhat.com> --===============5821074400156889701== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 10:41:36 -0500 (Thu, 26 Nov 2009) New Revision: 892 Modified: kernel/trunk/exo.kernel.component.ext.cache/pom.xml Log: EXOJCR-162 transitibe dependencies fixed Modified: kernel/trunk/exo.kernel.component.ext.cache/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/pom.xml 2009-11-26 15:38:39= UTC (rev 891) +++ kernel/trunk/exo.kernel.component.ext.cache/pom.xml 2009-11-26 15:41:36= UTC (rev 892) @@ -10,19 +10,27 @@ exo.kernel.component.ext.cache = JBoss Cache Implementation for the Cache Service - - + + + org.exoplatform.tool + exo.tool.framework.junit + = + org.exoplatform.kernel + exo.kernel.commons + = + + org.exoplatform.kernel + exo.kernel.container + = + + org.exoplatform.kernel exo.kernel.component.cache org.jboss.cache jbosscache-core - - jgroups - jgroups - = --===============5821074400156889701==-- From do-not-reply at jboss.org Thu Nov 26 11:21:22 2009 Content-Type: multipart/mixed; boundary="===============3634029592542783771==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r893 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 26 Nov 2009 11:21:22 -0500 Message-ID: <200911261621.nAQGLMh2022559@svn01.web.mwc.hst.phx2.redhat.com> --===============3634029592542783771== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-26 11:21:21 -0500 (Thu, 26 Nov 2009) New Revision: 893 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-201: rework of transitive changes apply (mixins and paths) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 15:41:36 UTC (rev 892) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -26 16:21:21 UTC (rev 893) @@ -727,8 +727,7 @@ childNode.put(ITEM_ID, data.getIdentifier()); = // 4. update all child nodes - updateTreePath(node, data.getQPath()); //treePrint(node) - + updateTreePath(node, data.getQPath()); } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-26 15:41:36= UTC (rev 892) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-26 16:21:21= UTC (rev 893) @@ -118,7 +118,13 @@ } break; case PUT_KEY_VALUE : + if (LOG.isDebugEnabled()) + { + LOG.debug("PUT_KEY_VALUE modification"); + } + doUpdate(m, conn); + break; case REMOVE_DATA : if (LOG.isDebugEnabled()) @@ -133,7 +139,13 @@ } break; case REMOVE_NODE : + if (LOG.isDebugEnabled()) + { + LOG.debug("REMOVE_NODE modification"); + } + doRemove(m, conn); + break; case MOVE : if (LOG.isDebugEnabled()) @@ -227,16 +239,12 @@ if (modification.getValue() instanceof NodeData) { //add node data - NodeData nodeData =3D (NodeData)modification.getValue(); - - conn.add(nodeData); + conn.add((NodeData)modification.getValue()); } else if (modification.getValue() instanceof PropertyData) { //add property data - PropertyData propertyData =3D (PropertyData)modification.getValue= (); - - conn.add(propertyData); + conn.add((PropertyData)modification.getValue()); } } = @@ -255,24 +263,26 @@ //Check flag it's mixin update for node, if this flag set we have= node need to = TransientItemData item =3D (TransientItemData)m.getValue(); = - // TODO try - // if ((item.getState() =3D=3D TransientItemData.TRANSITIVE_NONE) - - if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED)= =3D=3D 0 - || (item.getState() & TransientItemData.TRANSITIVE_MIXIN_UPDAT= ED) =3D=3D 0) + if ((item.getState() & TransientItemData.TRANSITIVE_PATH_UPDATED)= =3D=3D 0) { + // if not a transitive update of path, update it in the databa= se if (conn.itemExists((String)m.getFqn().get(1), item.isNode())) { // update if it's non transitive update if (item.isNode()) { - // TODO conn.rename() is used to update all the fields i= n DB. - // Original conn.update() will be matched as deprecated, = - // and conn.rename() should be renamed to update. This - // is done to solve the issue, when we need to guess each - // time whether node is moved or just updated. This - // solution is used as the fastest among other. = - conn.rename((NodeData)item); + if ((item.getState() & TransientItemData.TRANSITIVE_MIXI= N_UPDATED) =3D=3D 0) + { + // TODO do not handle mixin updates in db; it's a wor= karound - review logic in the connection + + // TODO conn.rename() is used to update all the field= s in DB. + // Original conn.update() will be matched as deprecat= ed, = + // and conn.rename() should be renamed to update. This + // is done to solve the issue, when we need to guess = each + // time whether node is moved or just updated. This + // solution is used as the fastest among other. = + conn.rename((NodeData)item); + } } else { @@ -731,7 +741,7 @@ } catch (Throwable e) { - // TODO why we cannot throw an exception??? + // TODO why we cannot throw an exception??? (throws Exception = expected) LOG.error("Error of transaction " + tx + " rollback.", e); } } --===============3634029592542783771==-- From do-not-reply at jboss.org Thu Nov 26 11:23:35 2009 Content-Type: multipart/mixed; boundary="===============8842855891814197505==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r894 - kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatform/services/cache/impl/jboss. Date: Thu, 26 Nov 2009 11:23:34 -0500 Message-ID: <200911261623.nAQGNYCk022753@svn01.web.mwc.hst.phx2.redhat.com> --===============8842855891814197505== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 11:23:34 -0500 (Thu, 26 Nov 2009) New Revision: 894 Modified: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestAbstractExoCache.java Log: EXOJCR-268 Unimplemented methods added Modified: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exo= platform/services/cache/impl/jboss/TestAbstractExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestAbstractExoCache.java 2009-11-26 16:21:21 = UTC (rev 893) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestAbstractExoCache.java 2009-11-26 16:23:34 = UTC (rev 894) @@ -20,6 +20,7 @@ = import org.exoplatform.container.PortalContainer; import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CacheListenerContext; import org.exoplatform.services.cache.CacheService; import org.exoplatform.services.cache.CachedObjectSelector; import org.exoplatform.services.cache.ExoCache; @@ -617,6 +618,31 @@ { remove++; } + + public void onClearCache(CacheListenerContext context) throws Except= ion + { + clearCache++; + } + + public void onExpire(CacheListenerContext context, Serializable key,= Object obj) throws Exception + { + expire++; + } + + public void onGet(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception + { + get++; + } + + public void onPut(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception + { + put++; + } + + public void onRemove(CacheListenerContext context, Serializable key,= Object obj) throws Exception + { + remove++; + } } = public static class MyKey implements Serializable --===============8842855891814197505==-- From do-not-reply at jboss.org Thu Nov 26 11:26:29 2009 Content-Type: multipart/mixed; boundary="===============1072362948286238589==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r895 - kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatform/services/cache/impl/jboss. Date: Thu, 26 Nov 2009 11:26:29 -0500 Message-ID: <200911261626.nAQGQTqx023261@svn01.web.mwc.hst.phx2.redhat.com> --===============1072362948286238589== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkatayev Date: 2009-11-26 11:26:29 -0500 (Thu, 26 Nov 2009) New Revision: 895 Modified: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfor= m/services/cache/impl/jboss/TestExoCacheCreator.java Log: EXOJCR-268 Unimplemented methods added Modified: kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exo= platform/services/cache/impl/jboss/TestExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheCreator.java 2009-11-26 16:23:34 U= TC (rev 894) +++ kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheCreator.java 2009-11-26 16:26:29 U= TC (rev 895) @@ -62,18 +62,7 @@ = } = - public void clearCache() throws Exception - { - // TODO Auto-generated method stub = - } - - public Object get(Serializable name) throws Exception - { - // TODO Auto-generated method stub - return null; - } - public int getCacheHit() { // TODO Auto-generated method stub @@ -139,76 +128,89 @@ return false; } = - public void put(Serializable name, Object obj) throws Exception + + public void select(CachedObjectSelector selector) throws Exception { // TODO Auto-generated method stub = } = - public void putMap(Map objs) throws Exception + public void setDistributed(boolean b) { // TODO Auto-generated method stub = } = - public Object remove(Serializable name) throws Exception + public void setLabel(String s) { // TODO Auto-generated method stub - return null; + } = - public List removeCachedObjects() throws Exception + public void setLiveTime(long period) { // TODO Auto-generated method stub - return null; + } = - public void select(CachedObjectSelector selector) throws Exception + public void setLogEnabled(boolean b) { // TODO Auto-generated method stub = } = - public void setDistributed(boolean b) + public void setMaxSize(int max) { // TODO Auto-generated method stub = } = - public void setLabel(String s) + public void setName(String name) { // TODO Auto-generated method stub = } = - public void setLiveTime(long period) + public void setReplicated(boolean b) { // TODO Auto-generated method stub = } = - public void setLogEnabled(boolean b) + public void clearCache() { // TODO Auto-generated method stub + = + } = + public Object get(Serializable key) + { + // TODO Auto-generated method stub + return null; } = - public void setMaxSize(int max) + public void put(Serializable key, Object value) throws NullPointerEx= ception { // TODO Auto-generated method stub + = + } = + public void putMap(Map objs) throws NullPointerException, IllegalArg= umentException + { + // TODO Auto-generated method stub + = } = - public void setName(String name) + public Object remove(Serializable key) throws NullPointerException { // TODO Auto-generated method stub - + return null; } = - public void setReplicated(boolean b) + public List removeCachedObjects() { // TODO Auto-generated method stub - + return null; } = } --===============1072362948286238589==-- From do-not-reply at jboss.org Thu Nov 26 11:41:13 2009 Content-Type: multipart/mixed; boundary="===============8158347988130046434==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r896 - jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal. Date: Thu, 26 Nov 2009 11:41:13 -0500 Message-ID: <200911261641.nAQGfDHJ024946@svn01.web.mwc.hst.phx2.redhat.com> --===============8158347988130046434== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-26 11:41:13 -0500 (Thu, 26 Nov 2009) New Revision: 896 Added: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jb= osscache-configuration_repository_backup.xml jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jb= osscache-configuration_repository_digital-assets.xml jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jb= osscache-configuration_repository_production.xml Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/ex= o-jcr-config.xml Log: EXOJCR-199 : The configuration in main/conf/portal was changed to use JBo= ssCacheWorkspaceDataContainer. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/po= rtal/exo-jcr-config.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/e= xo-jcr-config.xml 2009-11-26 16:26:29 UTC (rev 895) +++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/e= xo-jcr-config.xml 2009-11-26 16:41:13 UTC (rev 896) @@ -28,8 +28,9 @@ - + + @@ -75,8 +76,9 @@ = - + + @@ -114,8 +116,9 @@ = - + + Added: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/porta= l/jbosscache-configuration_repository_backup.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_backup.xml (rev = 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_backup.xml 2009-11-26 16:41:13 UTC (rev = 896) @@ -0,0 +1,67 @@ + + + + + + + + = + + + = + + + + = + + + + + + + + + + + + + + + + + + + = + + + + + + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/resour= ces/conf/portal/jbosscache-configuration_repository_backup.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/porta= l/jbosscache-configuration_repository_digital-assets.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_digital-assets.xml = (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_digital-assets.xml 2009-11-26 16:41:13 U= TC (rev 896) @@ -0,0 +1,67 @@ + + + + + + + + = + + + = + + + + = + + + + + + + + + + + + + + + + + + + = + + = + + + + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/resour= ces/conf/portal/jbosscache-configuration_repository_digital-assets.xml ___________________________________________________________________ Name: svn:eol-style + native Added: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/porta= l/jbosscache-configuration_repository_production.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_production.xml (= rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_production.xml 2009-11-26 16:41:13 UTC (= rev 896) @@ -0,0 +1,67 @@ + + + + + + + + = + + + = + + + + = + + + + + + + + + + + + + + + + + + + = + + = + + + + = + = + + = + + + Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/resour= ces/conf/portal/jbosscache-configuration_repository_production.xml ___________________________________________________________________ Name: svn:eol-style + native --===============8158347988130046434==-- From do-not-reply at jboss.org Thu Nov 26 11:53:50 2009 Content-Type: multipart/mixed; boundary="===============1541689511049631247==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r897 - jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal. Date: Thu, 26 Nov 2009 11:53:49 -0500 Message-ID: <200911261653.nAQGrntW026855@svn01.web.mwc.hst.phx2.redhat.com> --===============1541689511049631247== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2009-11-26 11:53:49 -0500 (Thu, 26 Nov 2009) New Revision: 897 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jb= osscache-configuration_repository_backup.xml jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jb= osscache-configuration_repository_digital-assets.xml jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/jb= osscache-configuration_repository_production.xml Log: EXOJCR-199 : The configuration in main/conf/portal was changed. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/po= rtal/jbosscache-configuration_repository_backup.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_backup.xml 2009-11-26 16:41:13 UTC (rev = 896) +++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_backup.xml 2009-11-26 16:53:49 UTC (rev = 897) @@ -21,14 +21,14 @@ use_incoming_packet_handler=3D"true" /> = - - + = = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/po= rtal/jbosscache-configuration_repository_digital-assets.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_digital-assets.xml 2009-11-26 16:41:13 U= TC (rev 896) +++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_digital-assets.xml 2009-11-26 16:53:49 U= TC (rev 897) @@ -21,14 +21,14 @@ use_incoming_packet_handler=3D"true" /> = - - + = = Modified: jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/po= rtal/jbosscache-configuration_repository_production.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_production.xml 2009-11-26 16:41:13 UTC (= rev 896) +++ jcr/branches/1.12.0-JBC/component/core/src/main/resources/conf/portal/j= bosscache-configuration_repository_production.xml 2009-11-26 16:53:49 UTC (= rev 897) @@ -21,14 +21,14 @@ use_incoming_packet_handler=3D"true" /> = - - + = = --===============1541689511049631247==-- From do-not-reply at jboss.org Thu Nov 26 21:12:59 2009 Content-Type: multipart/mixed; boundary="===============6858682910957077762==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r898 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl: dataflow and 1 other directory. Date: Thu, 26 Nov 2009 21:12:58 -0500 Message-ID: <200911270212.nAR2CwXU004421@svn01.web.mwc.hst.phx2.redhat.com> --===============6858682910957077762== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-26 21:12:58 -0500 (Thu, 26 Nov 2009) New Revision: 898 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/version/FrozenNodeInitializer.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/TransientValueData.java Log: EXOJCR-275: Version.restore workaround for Value storage right work (it's n= ormal logic actually, but not so good tested yet) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/version/FrozenNodeInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/version/FrozenNodeInitializer.java 2009-11-26 16:53:49= UTC (rev 897) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/version/FrozenNodeInitializer.java 2009-11-27 02:12:58= UTC (rev 898) @@ -104,7 +104,11 @@ List values =3D new ArrayList(); for (ValueData valueData : property.getValues()) { - values.add(((TransientValueData)valueData).createTransientCopy()); + //values.add(((TransientValueData)valueData).createTransientCopy(= )); + + // TODO workaround for JBC branch, issued by the FileRestoreTest + TransientValueData tvd =3D (TransientValueData)valueData; + values.add(tvd.createTransientCopy1()); } = boolean mv =3D property.isMultiValued(); Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/dataflow/TransientValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TransientValueData.java 2009-11-26 16:53:49 UTC (r= ev 897) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/TransientValueData.java 2009-11-27 02:12:58 UTC (r= ev 898) @@ -125,7 +125,7 @@ * @param orderNumber * int */ - protected TransientValueData(InputStream stream, int orderNumber) + public TransientValueData(InputStream stream, int orderNumber) { super(orderNumber); this.tmpStream =3D stream; @@ -428,6 +428,37 @@ } = /** + * Create TransientCopy of data. + * = + * TODO workaround for JBC branch, issued by the FileRestoreTest. + * + * @return TransientValueData + * @throws RepositoryException + */ + public TransientValueData createTransientCopy1() throws RepositoryExcep= tion + { + try + { + if (isByteArray()) + { + // bytes based + return new TransientValueData(orderNumber, data, null, null, f= ileCleaner, maxBufferSize, tempDirectory, + deleteSpoolFile); + } + else + { + // stream (or file) based , i.e. shared across sessions + return new TransientValueData(orderNumber, null, getAsStream()= , null, fileCleaner, maxBufferSize, + tempDirectory, true); + } + } + catch (IOException e) + { + throw new RepositoryException(e); + } + } + + /** * Create editable ValueData copy. * = * @return EditableValueData @@ -931,23 +962,23 @@ // write streams out.writeInt(2); //TODO Need optimization in backup service. - byte[] buf =3D new byte[4*1024]; - = - if (!spooled) = + byte[] buf =3D new byte[4 * 1024]; + + if (!spooled) spoolInputStream(); InputStream in =3D (spoolFile =3D=3D null ? new ByteArrayInputStr= eam(data) : new FileInputStream(spoolFile)); long dataLength =3D (spoolFile =3D=3D null ? data.length : spoolF= ile.length()); int len; - = + //write length of spoolFile out.writeLong(dataLength); - = + while ((len =3D in.read(buf)) > 0) - out.write(buf, 0, len); - = + out.write(buf, 0, len); + in.close(); } - = + out.writeInt(orderNumber); out.writeInt(maxBufferSize); } @@ -967,16 +998,17 @@ else { //read file form stream - long lengthSpoolFile =3D in.readLong(); = - = + long lengthSpoolFile =3D in.readLong(); + //TODO May be optimization. SpoolFile sf =3D SpoolFile.createTempFile("jcrvd", null, tempDire= ctory); sf.acquire(this); - OutputStream outStream =3D new FileOutputStream(sf); = - = - byte[] buf =3D new byte[4*1024]; - = - while (lengthSpoolFile > 0) { + OutputStream outStream =3D new FileOutputStream(sf); + + byte[] buf =3D new byte[4 * 1024]; + + while (lengthSpoolFile > 0) + { if (lengthSpoolFile - buf.length > 0) { in.readFully(buf); @@ -984,17 +1016,17 @@ } else { - in.readFully(buf, 0, (int) lengthSpoolFile); - outStream.write(buf, 0, (int) lengthSpoolFile); + in.readFully(buf, 0, (int)lengthSpoolFile); + outStream.write(buf, 0, (int)lengthSpoolFile); } - lengthSpoolFile-=3Dbuf.length; + lengthSpoolFile -=3D buf.length; } outStream.flush(); outStream.close(); spoolFile =3D sf; spooled =3D true; } - = + orderNumber =3D in.readInt(); maxBufferSize =3D in.readInt(); } --===============6858682910957077762==-- From do-not-reply at jboss.org Thu Nov 26 21:14:37 2009 Content-Type: multipart/mixed; boundary="===============4509387266520906638==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r899 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Thu, 26 Nov 2009 21:14:37 -0500 Message-ID: <200911270214.nAR2EbQ3004568@svn01.web.mwc.hst.phx2.redhat.com> --===============4509387266520906638== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-26 21:14:36 -0500 (Thu, 26 Nov 2009) New Revision: 899 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java Log: EXOJCR-270: skip transitive ACL updates on DB level; cleanups Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -27 02:12:58 UTC (rev 898) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -27 02:14:36 UTC (rev 899) @@ -294,7 +294,7 @@ InvalidItemStateException, IllegalStateException { startBatch(); - // propsRoot.getChild(makePropFqn(data.getIdentifier())) + = // check if parent is cached Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-27 02:12:58= UTC (rev 898) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-27 02:14:36= UTC (rev 899) @@ -89,18 +89,14 @@ } = /** - * Apply all Modifications to JDBC database, but don't commite them. + * Apply all Modifications on JDBC database, but don't commit them. * * @param modifications List if Modification * @param conn JDBCStorageConnection - * @throws RepositoryException if error = + * @throws RepositoryException if error occurs */ protected void apply(List modifications, JDBCStorageConne= ction conn) throws RepositoryException { - // TODO Prepare modifications list. - // Will be added oldValueData to modification for UPDATE. = - //prepareModifications(modifications); - for (Modification m : modifications) { switch (m.getType()) @@ -271,9 +267,10 @@ // update if it's non transitive update if (item.isNode()) { - if ((item.getState() & TransientItemData.TRANSITIVE_MIXI= N_UPDATED) =3D=3D 0) + if ((item.getState() & TransientItemData.TRANSITIVE_MIXI= N_UPDATED) =3D=3D 0 + && (item.getState() & TransientItemData.TRANSITIVE_AC= L_UPDATED) =3D=3D 0) { - // TODO do not handle mixin updates in db; it's a wor= karound - review logic in the connection + // TODO do not handle mixin or ACL updates in db; it'= s a workaround - review logic in the connection = // TODO conn.rename() is used to update all the field= s in DB. // Original conn.update() will be matched as deprecat= ed, = @@ -801,56 +798,4 @@ throw new JDBCCacheLoaderException("The method 'removeData(Fqn fqn)'= should not be called."); } = - // etc. - - /** - * Prepare list of modifications. - * = - * Will be checked the UPDATE or ADD. - * = - * @param modifications - * @throws RepositoryException - */ - @Deprecated - private void prepareModifications(List modifications) thr= ows RepositoryException - { - WorkspaceStorageConnection conn =3D dataContainer.openConnection(); - - try - { - for (int i =3D 0; i < modifications.size(); i++) - { - Modification m =3D modifications.get(i); - if (m.getType() =3D=3D ModificationType.PUT_KEY_VALUE) - { - ItemData itemData =3D null; - - //Check add or update node data. - if (m.getValue() instanceof NodeData) - { - NodeData nodeData =3D (NodeData)m.getValue(); - itemData =3D conn.getItemData(nodeData.getIdentifier()); - - // Set oldValueData for update node. - if (itemData !=3D null) - modifications.get(i).setOldValue(itemData); - } - else if (m.getValue() instanceof PropertyData) - { - PropertyData propertyData =3D (PropertyData)m.getValue(); - itemData =3D conn.getItemData(propertyData.getIdentifier= ()); - - // Set oldValueData for update property. - if (itemData !=3D null) - modifications.get(i).setOldValue(itemData); - } - } - } - } - finally - { - conn.close(); - } - } - } \ No newline at end of file --===============4509387266520906638==-- From do-not-reply at jboss.org Fri Nov 27 03:21:20 2009 Content-Type: multipart/mixed; boundary="===============8713038465231498634==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r900 - jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf. Date: Fri, 27 Nov 2009 03:21:20 -0500 Message-ID: <200911270821.nAR8LKMw006467@svn01.web.mwc.hst.phx2.redhat.com> --===============8713038465231498634== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-27 03:21:19 -0500 (Fri, 27 Nov 2009) New Revision: 900 Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exoplat= form/services/jcr/load/perf/TestGetNodesPerf.java Log: EXOJCR-271: test scalability Modified: jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/= exoplatform/services/jcr/load/perf/TestGetNodesPerf.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-27 02:14:36 UTC = (rev 899) +++ jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/test/java/org/exopla= tform/services/jcr/load/perf/TestGetNodesPerf.java 2009-11-27 08:21:19 UTC = (rev 900) @@ -19,12 +19,8 @@ import org.exoplatform.services.jcr.JcrAPIBaseTest; import org.exoplatform.services.jcr.impl.core.SessionImpl; = -import java.util.ArrayList; -import java.util.List; - import javax.jcr.Node; import javax.jcr.NodeIterator; -import javax.jcr.RepositoryException; import javax.jcr.Session; = /** @@ -39,7 +35,7 @@ { private static final String testName =3D "testRoot"; = - private static final int sessionCount =3D 20; + private static final int sessionCount =3D 10; = private static final int tryCount =3D 5; = @@ -95,6 +91,9 @@ = break; } + + log.info("waiting for 10 seconds..."); + Thread.sleep(10000); } log.info("Memory used: " + (rt.totalMemory() - rt.freeMemory() - use= dMemory) / 1024 / 1024 + "Mb"); } --===============8713038465231498634==-- From do-not-reply at jboss.org Fri Nov 27 06:53:45 2009 Content-Type: multipart/mixed; boundary="===============8025383186103277514==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r901 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/lab/restart. Date: Fri, 27 Nov 2009 06:53:45 -0500 Message-ID: <200911271153.nARBrjJ7015620@svn01.web.mwc.hst.phx2.redhat.com> --===============8025383186103277514== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-27 06:53:44 -0500 (Fri, 27 Nov 2009) New Revision: 901 Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/TestSearch.java Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/AbstractRestartTest.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/TestLockCleanup.java jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/ser= vices/jcr/lab/restart/TestVersionHistory.java Log: EXOJCR-199: restart tests added and refactored. Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/lab/restart/AbstractRestartTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/AbstractRestartTest.java 2009-11-27 08:21:19 UTC (re= v 900) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/AbstractRestartTest.java 2009-11-27 11:53:44 UTC (re= v 901) @@ -33,26 +33,41 @@ */ public abstract class AbstractRestartTest extends JcrAPIBaseTest { - protected boolean firstRun =3D true; + protected static int run =3D 0; = + protected static int testCasesCount =3D 0; + private final String runNodeName =3D "SecondRun"; = + /** + * Count of test cases in one test suite. After last test HSSQLDB "SHUT= DOWN is called" + */ + public AbstractRestartTest(int testCasesCount) + { + super(); + this.testCasesCount =3D testCasesCount; + } + @Override public void setUp() throws Exception { super.setUp(); - try + if (run =3D=3D 0) { - root.getNode(runNodeName); - // node exists, it means than this is second run - firstRun =3D false; + try + { + root.getNode(runNodeName); + // node exists, it means than this is second run + run =3D 2; + } + catch (PathNotFoundException e) + { + root.addNode(runNodeName); + run =3D 1; + } } - catch (PathNotFoundException e) - { - root.addNode(runNodeName); - } session.save(); - if (firstRun) + if (run < 2) { log.info("/!\\ This is FIRST run"); } @@ -64,7 +79,7 @@ = public boolean isFirstRun() { - return firstRun; + return run < 2; } = @Override @@ -72,24 +87,28 @@ { // super.tearDown in not invoked to prevent DB cleaning // shutdown HSSQLDB :) - if (firstRun) + testCasesCount--; + if (testCasesCount <=3D 0) { - for (Object uri : DatabaseManager.getDatabaseURIs()) + if (isFirstRun()) { - try + for (Object uri : DatabaseManager.getDatabaseURIs()) { - Connection c =3D DriverManager.getConnection("jdbc:hsqldb:"= + uri.toString(), "sa", ""); - c.createStatement().execute("SHUTDOWN"); + try + { + Connection c =3D DriverManager.getConnection("jdbc:hsqld= b:" + uri.toString(), "sa", ""); + c.createStatement().execute("SHUTDOWN"); + } + catch (Throwable e) + { + } } - catch (Throwable e) - { - } } + else + { + super.tearDown(); + } } - else - { - super.tearDown(); - } = } = Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/lab/restart/TestLockCleanup.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestLockCleanup.java 2009-11-27 08:21:19 UTC (rev 90= 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestLockCleanup.java 2009-11-27 11:53:44 UTC (rev 90= 1) @@ -28,6 +28,14 @@ public class TestLockCleanup extends AbstractRestartTest { = + /** + * = + */ + public TestLockCleanup() + { + super(1); + } + = /* * This test should be performed manually because it requires JCR tearD= own and startup without * cleaning it's content. = Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform= /services/jcr/lab/restart/TestSearch.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestSearch.java (rev 0) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestSearch.java 2009-11-27 11:53:44 UTC (rev 901) @@ -0,0 +1,169 @@ +/* + * 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.restart; + +import org.exoplatform.services.jcr.impl.core.SessionImpl; + +import java.io.ByteArrayInputStream; +import java.util.Calendar; + +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.RepositoryException; +import javax.jcr.query.Query; +import javax.jcr.query.QueryManager; +import javax.jcr.query.QueryResult; + +/** + * @author Nikolay Zamosenchuk + * @version $Id$ + * + */ +public class TestSearch extends AbstractRestartTest +{ + public TestSearch() + { + super(2); + } + = + public void testSearch() throws Exception + { + if (isFirstRun()) + { + Node rootNode =3D session.getRootNode(); + Node queryNode =3D rootNode.addNode("queryNode", "nt:unstructured= "); + if (!queryNode.canAddMixin("rma:record")) + throw new RepositoryException("Cannot add mixin node"); + else + { + queryNode.addMixin("rma:record"); + queryNode.setProperty("rma:recordIdentifier", "testIdentificat= or"); + queryNode.setProperty("rma:originatingOrganization", "testProp= erty2"); + } + + Node node1 =3D queryNode.addNode("Test1", "nt:file"); + Node content1 =3D node1.addNode("jcr:content", "nt:resource"); + content1.setProperty("jcr:lastModified", Calendar.getInstance()); + content1.setProperty("jcr:mimeType", "text/plain"); + content1.setProperty("jcr:data", new ByteArrayInputStream("ABBA A= AAA".getBytes())); + node1.addMixin("rma:record"); + node1.setProperty("rma:recordIdentifier", "testIdentificator"); + node1.setProperty("rma:originatingOrganization", "testProperty2"); + + Node node2 =3D queryNode.addNode("Test2", "nt:file"); + Node content2 =3D node2.addNode("jcr:content", "nt:resource"); + content2.setProperty("jcr:lastModified", Calendar.getInstance()); + content2.setProperty("jcr:mimeType", "text/plain"); + content2.setProperty("jcr:data", new ByteArrayInputStream("ACDC E= EEE".getBytes())); + node2.addMixin("rma:record"); + node2.setProperty("rma:recordIdentifier", "testIdentificator"); + node2.setProperty("rma:originatingOrganization", "testProperty2"); + + session.save(); + } + else + { + SessionImpl querySession =3D (SessionImpl)repository.login(creden= tials, "ws"); + String sqlQuery =3D "SELECT * FROM rma:record WHERE jcr:path LIKE= '/queryNode/%' "; + QueryManager manager =3D querySession.getWorkspace().getQueryMana= ger(); + Query query =3D manager.createQuery(sqlQuery, Query.SQL); + + QueryResult queryResult =3D query.execute(); + NodeIterator iter =3D queryResult.getNodes(); + + assertTrue(iter.getSize() =3D=3D 2); // check target nodes for ex= istanse + while (iter.hasNext()) + { + assertNotNull(iter.nextNode()); + } + + sqlQuery =3D "//*[jcr:contains(., 'ABBA')]"; + query =3D manager.createQuery(sqlQuery, Query.XPATH); + + queryResult =3D query.execute(); + iter =3D queryResult.getNodes(); + + while (iter.hasNext()) + { + System.out.print(iter.nextNode().getPath()); + } + + assertEquals("Result nodes count is wrong", 1, iter.getSize()); + while (iter.hasNext()) + { + assertEquals("Content must be equals", "ABBA AAAA", iter.nextN= ode().getProperty("jcr:data").getString()); + } + } + } + + public void testSQLQuery() throws Exception + { + if (isFirstRun()) + { + Node testRoot =3D root.addNode("testSqlQuery"); + root.save(); + + String prefixPath =3D testRoot.getPath(); + + // files + Node subnode =3D testRoot.addNode("files"); + + Node sdata =3D subnode.addNode("draft"); + sdata.addNode("content1"); + + Node file =3D subnode.addNode("myFile1", "nt:file"); + Node cfile =3D file.addNode("jcr:content", "nt:unstructured").add= Node("myFile1", "nt:file"); + cfile.addNode("jcr:content", "nt:base"); + + file =3D subnode.addNode("myFile2", "nt:file"); + cfile =3D file.addNode("jcr:content", "nt:unstructured").addNode(= "myFile1", "nt:file"); + cfile.addNode("jcr:content", "nt:base"); + + // data + subnode =3D testRoot.addNode("data"); + + sdata =3D subnode.addNode("draft"); + sdata.addNode("content1"); + sdata.addNode("content2"); + + Node data =3D subnode.addNode("myData1", "nt:file"); + data.addNode("jcr:content", "nt:unstructured"); + + data =3D subnode.addNode("myData2", "nt:file"); + data.addNode("jcr:content", "nt:unstructured"); + + testRoot.save(); + } + else + { + + Query q =3D + session.getWorkspace().getQueryManager().createQuery( + "select * from nt:unstructured where jcr:path like '/testSq= lQuery/%/draft/%'", Query.SQL); + + QueryResult res =3D q.execute(); + assertEquals("Wrong nodes count in result set", 3, res.getNodes()= .getSize()); + + for (NodeIterator nodes =3D res.getNodes(); nodes.hasNext();) + { + log.info(nodes.nextNode().getPath()); + } + } + } +} Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/o= rg/exoplatform/services/jcr/lab/restart/TestSearch.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatf= orm/services/jcr/lab/restart/TestVersionHistory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestVersionHistory.java 2009-11-27 08:21:19 UTC (rev= 900) +++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/se= rvices/jcr/lab/restart/TestVersionHistory.java 2009-11-27 11:53:44 UTC (rev= 901) @@ -46,6 +46,14 @@ * then (without clean!) : * >mvn test -Dtest=3Dorg.exoplatform.services.jcr.lab.restart.TestV= ersionHistory */ + = + /** + * = + */ + public TestVersionHistory() + { + super(1); + } = private Node testVersionable =3D null; = --===============8025383186103277514==-- From do-not-reply at jboss.org Fri Nov 27 18:21:54 2009 Content-Type: multipart/mixed; boundary="===============0576351881766855621==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r902 - in kernel/branches/mc-int-branch: exo.kernel.container and 35 other directories. Date: Fri, 27 Nov 2009 18:21:54 -0500 Message-ID: <200911272321.nARNLsiq026957@svn01.web.mwc.hst.phx2.redhat.com> --===============0576351881766855621== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2009-11-27 18:21:52 -0500 (Fri, 27 Nov 2009) New Revision: 902 Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCIntegrationInvoker.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/AOPInterceptor.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/MissingNoArgsConstructorBean.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/PrivateNoArgsConstructorBean.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/ProtectedNoArgsConstructorBean.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/conf/mc-beans.xml kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/conf/mc-int-beans.xml kernel/branches/mc-int-branch/exo.kernel.mc-int/ kernel/branches/mc-int-branch/exo.kernel.mc-int/pom.xml kernel/branches/mc-int-branch/exo.kernel.mc-int/src/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/GenericWrapperUtil.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/InterceptMC.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/JavassistAOPClassLoader.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/MCComponentAdapter.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/MCComponentInfo.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/MCInjectionMode.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/MCIntConfig.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/MCIntegrationImpl.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/MCInterceptProxy.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/RootContainerVDFDecoratorInjector.java kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopla= tform/container/mc/impl/WrapperMethodComposer.java kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/ kernel/branches/mc-int-branch/exo.kernel.tests/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/pom.xml kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/kernel/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/kernel/it/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/kernel/it/MCInjectionTest.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/kernel/it/MCInjectionTest2.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/kernel/it/MCInjectionTest3.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/kernel/it/MCInjectionTest4.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/kernel/it/MCInjectionTest5.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/tests/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/tests/JUnitInvokerServlet.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/tests/LogOutputStream.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/java/org/exoplatform/tests/TeeOutputStream.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/webapp/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/webapp/WEB-INF/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/mai= n/webapp/WEB-INF/web.xml kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/CopiedException.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/FailuresParser.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/LineReader.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/TestMCInjectionIntegration.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/TestMCInjectionIntegration2.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/TestMCInjectionIntegration3.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/TestMCInjectionIntegration4.java kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/src/tes= t/java/org/exoplatform/kernel/it/TestMCInjectionIntegration5.java kernel/branches/mc-int-branch/exo.kernel.tests/pom.xml Removed: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/GenericWrapperUtil.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/InterceptMC.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/JavassistAOPClassLoader.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCComponentAdapter.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCComponentInfo.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCInjectionMode.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCInterceptProxy.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/WrapperMethodComposer.java kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/pom.xml kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/src/ kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/ Modified: kernel/branches/mc-int-branch/exo.kernel.container/pom.xml kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCIntegration.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCIntegrationContainer.java kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/util/JBossEnv.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/InjectedBean.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/jav= a/org/exoplatform/kernel/demos/mc/InjectingBean.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/META-INF/jboss-beans.xml kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/conf/configuration.xml kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml kernel/branches/mc-int-branch/pom.xml Log: Removed mc-kernel artifact dependencies from exo.kernel.container - moved i= ntegration impl code to exo.kernel.mc-int module, AOP demo, integration tes= ts Modified: kernel/branches/mc-int-branch/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-27 1= 1:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-27 2= 3:21:52 UTC (rev 902) @@ -86,32 +86,7 @@ org.jibx jibx-extras - - - org.jboss.microcontainer - jboss-aop-mc-int - - - - org.jboss.mc-int - jboss-mc-int-common - - - - org.jboss.mc-int - jboss-mc-int-servlet - - - - org.jboss.cl - jboss-classloader - - - - org.exoplatform.kernel - mc-kernel-extras - - + = = Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/GenericWrapperUtil.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/GenericWrapperUtil.java 2009-11-27 11:53:44 UTC (rev= 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/GenericWrapperUtil.java 2009-11-27 23:21:52 UTC (rev= 902) @@ -1,165 +0,0 @@ -package org.exoplatform.container.mc; - -import javassist.ClassPool; -import javassist.CtClass; -import javassist.CtConstructor; -import javassist.CtMethod; -import javassist.CtNewMethod; -import javassist.LoaderClassPath; -import javassist.Modifier; -import javassist.NotFoundException; -import javassist.bytecode.AnnotationsAttribute; -import javassist.bytecode.ClassFile; -import javassist.bytecode.ConstPool; -import javassist.bytecode.MethodInfo; -import org.jboss.deployers.structure.spi.DeploymentUnit; -import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentUnit; -import org.jboss.mc.common.ThreadLocalUtils; -import org.jboss.virtual.MemoryFileFactory; -import org.jboss.virtual.VirtualFile; - -import java.net.URL; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author Ales Justin - * @author Marko Strukelj - */ -final class GenericWrapperUtil -{ - private static AtomicInteger counter =3D new AtomicInteger(0); - - static MCComponentInfo generateAndInstallWrapper(Object instance) throw= s Exception - { - ClassPool pool =3D ClassPool.getDefault(); - pool.insertClassPath(new LoaderClassPath(Thread.currentThread().getC= ontextClassLoader())); - - CtClass cc =3D pool.get(MCInterceptProxy.class.getName()); - CtClass pc =3D pool.get(instance.getClass().getName()); - - zeroArgConstructorCheck(pc, instance); - - cc.setSuperclass(pc); - cc.setName(getPackage(cc.getName()) + ".MCInterceptProxy$" + counter= .getAndIncrement()); - WrapperMethodComposer composer =3D new WrapperMethodComposer(MCInter= ceptProxy.DELEGATE, pc.getName()); - - ClassFile cf =3D cc.getClassFile(); - AnnotationsAttribute attr =3D setAnnotations(pc.getClassFile().getAt= tributes(), cf.getConstPool()); - if (attr !=3D null) - cf.addAttribute(attr); - cf.setVersionToJava5(); - - for (CtMethod m : pc.getMethods()) - { - if (isMethodOverridable(m)) - { - CtMethod method =3D CtNewMethod.make(composer.composeMethod(m)= , cc); - MethodInfo minf =3D method.getMethodInfo(); - attr =3D setAnnotations(m.getMethodInfo().getAttributes(), min= f.getConstPool()); - if (attr !=3D null) - minf.addAttribute(attr); - cc.addMethod(method); - } - } - - installWrapper(cc); - - MCComponentInfo mcinf =3D new MCComponentInfo(cc.getName(), - new JavassistAOPClassLoader(Thread.currentThread().getContextC= lassLoader(), cc.getClassPool())); - Thread.currentThread().setContextClassLoader(mcinf.getClassLoader())= ; // TODO: ensure symetry - reset old CL when done - return mcinf; - } - - private static AnnotationsAttribute setAnnotations(List attrs, ConstPoo= l cpool) - { - AnnotationsAttribute attr =3D new AnnotationsAttribute(cpool, Annota= tionsAttribute.visibleTag); - for (Object a : attrs) - { - if (a instanceof AnnotationsAttribute) - { - AnnotationsAttribute aa =3D (AnnotationsAttribute) a; - if (AnnotationsAttribute.visibleTag.equals(aa.getName()) =3D= =3D false) - continue; - attr.setAnnotations(aa.getAnnotations()); - return attr; - } - } - return null; - } - - private static String getPackage(String name) - { - return name.substring(0, name.lastIndexOf(".")); - } - - private static void installWrapper(CtClass cc) throws Exception - { - // This is to make classloading work with jboss-aop and mc-classload= ing - // - third-party (Tomcat) can be enabled through context classloader - DeploymentUnit unit =3D ThreadLocalUtils.getUnit(); - String host =3D getVFSMemoryHost(unit); - if (host !=3D null) - { - URL vfsUrl =3D new URL("vfsmemory://" + host + "/" + getResourceP= ath(cc.getName())); - MemoryFileFactory.putFile(vfsUrl, cc.toBytecode()); - return; - } - } - - static void postInstallCleanup() - { - // TODO: symmetry not 100% assured here - ClassLoader cl =3D Thread.currentThread().getContextClassLoader(); - if (cl instanceof JavassistAOPClassLoader) - Thread.currentThread().setContextClassLoader(cl.getParent()); - } - - private static String getResourcePath(String name) - { - return name.replace(".", "/") + ".class"; - } - - private static String getVFSMemoryHost(DeploymentUnit unit) throws Exce= ption - { - if (unit instanceof AbstractVFSDeploymentUnit) - { - List classPath =3D ((AbstractVFSDeploymentUnit) unit= ).getClassPath(); - for (VirtualFile vf : classPath) - { - URL url =3D vf.toURL(); - if ("vfsmemory".equals(url.getProtocol())) - { - return url.getHost(); - } - } - return getVFSMemoryHost(unit.getParent()); - } - - return null; - } - - private static boolean isMethodOverridable(CtMethod m) - { - return (m.getModifiers() & Modifier.FINAL) =3D=3D 0 - && !"clone".equals(m.getName()) - && !"finalize".equals(m.getName()); - } - - private static void zeroArgConstructorCheck(CtClass pc, Object c) - throws NotFoundException - { - CtConstructor[] ctors =3D pc.getConstructors(); - boolean found =3D false; - for (CtConstructor cons : ctors) - { - if (cons.getParameterTypes().length =3D=3D 0) - { - found =3D true; - break; - } - } - if (!found) - throw new RuntimeException("Class can not be AOP instrumented - i= t has no zero-arguments public constructor: " + c.getClass()); - } -} \ No newline at end of file Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/InterceptMC.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/InterceptMC.java 2009-11-27 11:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/InterceptMC.java 2009-11-27 23:21:52 UTC (rev 902) @@ -1,31 +0,0 @@ -package org.exoplatform.container.mc; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Marks Gatein MC enabled component. - * - * @author Marko Strukelj - * @author Ales Justin - */ -(a)Retention(RetentionPolicy.RUNTIME) -(a)Target({ElementType.TYPE}) -public @interface InterceptMC -{ - /** - * Do we enable AOP for this component. - * - * @return true if we should enable AOP, false otherwise - */ - boolean enableAOP() default false; - - /** - * Injection mode - * - * @return MCInjectionMode enumeration constant representing injection = mode - */ - MCInjectionMode injectionMode() default MCInjectionMode.STANDARD; -} Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/JavassistAOPClassLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/JavassistAOPClassLoader.java 2009-11-27 11:53:44 UTC= (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/JavassistAOPClassLoader.java 2009-11-27 23:21:52 UTC= (rev 902) @@ -1,61 +0,0 @@ -package org.exoplatform.container.mc; - -import javassist.Loader; -import javassist.ClassPool; - -/** - * @author Marko Strukelj - */ -public class JavassistAOPClassLoader extends Loader -{ - public JavassistAOPClassLoader() - { - } - - public JavassistAOPClassLoader(ClassPool cp) - { - super(cp); - } - - public JavassistAOPClassLoader(ClassLoader parent, ClassPool cp) - { - super(parent, cp); - } - - @Override - protected Class loadClassByDelegation(String name) throws ClassNotFound= Exception - { - if (name.startsWith("org.jboss.aop.")) - return delegateToParent(name); - - return super.loadClassByDelegation(name); - } - - protected Class loadClass(String name, boolean resolve) - throws ClassFormatError, ClassNotFoundException - { - name =3D name.intern(); - synchronized (name) - { - Class c =3D findLoadedClass(name); - if (c =3D=3D null) - { - try - { - c =3D delegateToParent(name); - } - catch (ClassNotFoundException ignored) - { - } - } - - if (c =3D=3D null) - c =3D findClass(name); - - if (resolve) - resolveClass(c); - - return c; - } - } -} Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/MCComponentAdapter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentAdapter.java 2009-11-27 11:53:44 UTC (rev= 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentAdapter.java 2009-11-27 23:21:52 UTC (rev= 902) @@ -1,142 +0,0 @@ -package org.exoplatform.container.mc; - -import java.lang.ref.WeakReference; - -import org.jboss.beans.info.spi.BeanAccessMode; -import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; -import org.jboss.dependency.plugins.helpers.StatelessController; -import org.jboss.dependency.spi.ControllerState; -import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext; -import org.jboss.kernel.spi.dependency.KernelController; -import org.jboss.kernel.spi.dependency.KernelControllerContext; -import org.picocontainer.ComponentAdapter; -import org.picocontainer.PicoContainer; -import org.picocontainer.PicoInitializationException; -import org.picocontainer.PicoIntrospectionException; -import org.picocontainer.PicoVisitor; - -/** - * @author Ales Justin - * @author Marko Strukelj - */ -public class MCComponentAdapter implements ComponentAdapter -{ - private KernelController controller; - private ComponentAdapter delegate; - private InterceptMC interceptMC; - private WeakReference lastComponentInstance; - - public MCComponentAdapter(KernelController controller, ComponentAdapter= delegate, InterceptMC interceptMC) - { - if (controller =3D=3D null) - throw new IllegalArgumentException("Null controller"); - if (delegate =3D=3D null) - throw new IllegalArgumentException("Null delegate"); - - if (controller instanceof StatelessController) - throw new IllegalArgumentException("controller is instanceof Stat= elessController"); - - this.controller =3D controller; - this.delegate =3D delegate; - this.interceptMC =3D interceptMC; - } - - public Object getComponentKey() - { - return delegate.getComponentKey(); - } - - public Class getComponentImplementation() - { - return delegate.getComponentImplementation(); - } - - public Object getComponentInstance(PicoContainer container) throws Pico= InitializationException, PicoIntrospectionException - { - Object target =3D getTargetFromRef(); - if (target !=3D null) - return target; - - try - { - String key =3D delegate.getComponentKey().toString(); - Object instance =3D delegate.getComponentInstance(container); - BeanMetaDataBuilder builder; - if (interceptMC !=3D null && interceptMC.enableAOP()) - { - MCComponentInfo mcinfo =3D GenericWrapperUtil.generateAndInsta= llWrapper(instance); - builder =3D BeanMetaDataBuilder.createBuilder(key, mcinfo.getW= rapperClassName()); - builder.addConstructorParameter(Object.class.getName(), instan= ce); - } - else - { - builder =3D BeanMetaDataBuilder.createBuilder(key, instance.ge= tClass().getName()); - builder.setConstructorValue(instance); - } - builder.ignoreCreate(); - builder.ignoreStart(); - builder.ignoreStop(); - builder.ignoreDestroy(); - builder.setAccessMode(getInjectionMode(interceptMC)); - - KernelControllerContext ctx =3D new AbstractKernelControllerConte= xt(null, builder.getBeanMetaData(), null); - try - { - StatelessController ctrl =3D new StatelessController(controlle= r); - ctrl.install(ctx); - if (ctx.getError() !=3D null) - throw ctx.getError(); - if (ctrl.getStates().isBeforeState(ctx.getState(), ControllerS= tate.INSTALLED)) - throw new IllegalArgumentException("Missing some dependency= : " + ctx.getDependencyInfo().getUnresolvedDependencies(null)); - - target =3D ctx.getTarget(); - lastComponentInstance =3D new WeakReference(target); - return target; - } - finally - { - GenericWrapperUtil.postInstallCleanup(); - } - } - catch (Throwable ex) - { - throw new RuntimeException("Failed to perform MC interception on = component: " + delegate.getComponentImplementation(), ex); - } - } - - private BeanAccessMode getInjectionMode(InterceptMC interceptMC) - { - MCInjectionMode mode =3D interceptMC.injectionMode(); - - switch(mode) - { - case ALL: - return BeanAccessMode.ALL; - case FIELDS: - return BeanAccessMode.FIELDS; - default: - return BeanAccessMode.STANDARD; - } - } - - public void verify(PicoContainer container) throws PicoIntrospectionExc= eption - { - delegate.verify(container); - } - - public void accept(PicoVisitor visitor) - { - delegate.accept(visitor); - } - - private Object getTargetFromRef() - { - if (lastComponentInstance =3D=3D null) - return null; - - Object target =3D lastComponentInstance.get(); - if (target =3D=3D null) - return null; - return target; - } -} \ No newline at end of file Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/MCComponentInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentInfo.java 2009-11-27 11:53:44 UTC (rev 90= 1) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCComponentInfo.java 2009-11-27 23:21:52 UTC (rev 90= 2) @@ -1,26 +0,0 @@ -package org.exoplatform.container.mc; - -/** - * @author Marko Strukelj - */ -public class MCComponentInfo -{ - private String name; - private ClassLoader classLoader; - - public MCComponentInfo(String wrapperClassName, ClassLoader classLoader) - { - this.name =3D wrapperClassName; - this.classLoader =3D classLoader; - } - - public String getWrapperClassName() - { - return name; - } - - public ClassLoader getClassLoader() - { - return classLoader; - } -} Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/MCInjectionMode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInjectionMode.java 2009-11-27 11:53:44 UTC (rev 90= 1) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInjectionMode.java 2009-11-27 23:21:52 UTC (rev 90= 2) @@ -1,16 +0,0 @@ -package org.exoplatform.container.mc; - -/** - * @author Marko Strukelj - */ -public enum MCInjectionMode -{ - /** Field and method injections */ - ALL, - - /** Disable field injections (default) */ - FIELDS, - - /** Try setter injection first, if no setter found, fallback to field */ - STANDARD -} Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/mc/MCIntegration.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegration.java 2009-11-27 11:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegration.java 2009-11-27 23:21:52 UTC (rev 902) @@ -1,95 +1,16 @@ package org.exoplatform.container.mc; = -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.jboss.kernel.Kernel; -import org.jboss.kernel.plugins.dependency.AbstractKernelController; -import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; -import org.jboss.kernel.spi.deployment.KernelDeployment; -import org.jboss.mc.common.ThreadLocalUtils; import org.picocontainer.ComponentAdapter; = -import java.io.IOException; -import java.net.URL; -import java.util.Enumeration; -import java.util.LinkedList; -import java.util.List; +import javax.servlet.ServletContext; = /** * @author Marko Strukelj */ -public class MCIntegration +public interface MCIntegration { - private static Log log =3D ExoLogger.getLogger(MCIntegration.class); - private static MCIntegration mcint; - - private AbstractKernelController rootController; - private List deployments =3D new LinkedList(); - - public synchronized static MCIntegration getInstance() - { - if (mcint =3D=3D null) - mcint =3D new MCIntegration(); - return mcint; - } - - public synchronized AbstractKernelController getRootController() - { - if (rootController =3D=3D null) - { - Kernel kernel =3D ThreadLocalUtils.getKernel(); - if (kernel !=3D null) - { - rootController =3D (AbstractKernelController) kernel.getContro= ller(); - } - else - { - log.warn("GateIn - MC integration not available"); - return null; - } - processDeployments(); - } - return rootController; - } - - private void processDeployments() - { - // Now deploy any AOP configuration - instantiates lifecycle callbac= ks - BasicXMLDeployer deployer =3D new BasicXMLDeployer(rootController.ge= tKernel()); - Enumeration urls =3D null; - try - { - urls =3D Thread.currentThread().getContextClassLoader().getResour= ces("conf/mc-beans.xml"); - } - catch (IOException e) - { - throw new RuntimeException("Failed to load resources: conf/mc-bea= ns.xml", e); - } - - while (urls.hasMoreElements()) - { - URL confUrl =3D urls.nextElement(); - try - { - deployments.add(deployer.deploy(confUrl)); - } - catch (Throwable ex) - { - throw new RuntimeException("Failed to deploy: " + confUrl, ex); - } - } - - if (deployments.size() =3D=3D 0) - { - log.debug("No conf/mc-beans.xml found. MC integration disabled."); - } - } - - public ComponentAdapter getMCAdapter(ComponentAdapter adapter, Intercep= tMC interceptAnnotation) - { - AbstractKernelController controller =3D getRootController(); - if (controller !=3D null) - adapter =3D new MCComponentAdapter(controller, adapter, intercept= Annotation); - return adapter; - } + ComponentAdapter getMCAdapter(ComponentAdapter componentAdapter); + boolean hasMCKernel(ComponentAdapter adapter); + void initThreadCtx(ServletContext ctx); + void resetThreadCtx(ServletContext ctx); } Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/mc/MCIntegrationContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationContainer.java 2009-11-27 11:53:44 UTC = (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationContainer.java 2009-11-27 23:21:52 UTC = (rev 902) @@ -7,9 +7,6 @@ import org.picocontainer.defaults.ComponentAdapterFactory; import org.picocontainer.defaults.DefaultPicoContainer; = -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - /** * @author Marko Strukelj */ @@ -38,17 +35,20 @@ = public ComponentAdapter registerComponent(ComponentAdapter componentAda= pter) { - Class clazz =3D componentAdapter.getComponentImplementation(); - InterceptMC interceptAnnotation =3D clazz.getAnnotation(InterceptMC.= class); - ComponentAdapter adapter =3D componentAdapter; - if (interceptAnnotation !=3D null) + if (hasMCKernel(componentAdapter)) { - if (hasMCKernel(componentAdapter)) + try { - adapter =3D MCIntegration.getInstance().getMCAdapter(component= Adapter, interceptAnnotation); + adapter =3D MCIntegrationInvoker.getMCAdapter(componentAdapter= ); } + catch(Exception ignored) + { + log.warn("MC integration failed - maybe not supported in this = environment (component: " + + componentAdapter.getComponentKey() + ")", ignored); + } } + super.registerComponent(adapter); return adapter; } @@ -57,39 +57,13 @@ { try { - Class tlu =3D null; - String name =3D "org.jboss.mc.common.ThreadLocalUtils"; - try - { - ClassLoader cl =3D Thread.currentThread().getContextClassLoade= r(); - if (cl !=3D null) - tlu =3D cl.loadClass(name); - } - catch (ClassNotFoundException ignored) - { - tlu =3D Class.forName(name); - } - - Method m =3D tlu.getMethod("getKernel"); - Object ret =3D m.invoke(null); - return ret !=3D null; + return MCIntegrationInvoker.hasMCKernel(componentAdapter); } - catch (ClassNotFoundException ignored) + catch (Exception ignored) { - log.warn("@InterceptMC not supported in this environment (compone= nt: " + componentAdapter.getComponentKey() + ") - necessary classes are mis= sing: " + ignored); - return false; + log.warn("MC integration failed - maybe not supported in this env= ironment (component: " + + componentAdapter.getComponentKey() + ")", ignored); } - catch (NoSuchMethodException e) - { - throw new RuntimeException(e); - } - catch (InvocationTargetException e) - { - throw new RuntimeException(e); - } - catch (IllegalAccessException e) - { - throw new RuntimeException(e); - } + return false; } } Added: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org= /exoplatform/container/mc/MCIntegrationInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationInvoker.java (r= ev 0) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationInvoker.java 2009-11-27 23:21:52 UTC (r= ev 902) @@ -0,0 +1,106 @@ +package org.exoplatform.container.mc; + +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.picocontainer.ComponentAdapter; + +import javax.servlet.ServletContext; +import java.lang.reflect.Method; + +/** + * @author Marko Strukelj + */ +public class MCIntegrationInvoker +{ + private static Log log =3D ExoLogger.getLogger(MCIntegrationInvoker.cla= ss); + + private static MCIntegration mcInt; + private static boolean permFailure; + + public static synchronized ComponentAdapter getMCAdapter(ComponentAdapt= er componentAdapter) + { + MCIntegration mcInt =3D getMCIntegration(); + if (mcInt =3D=3D null) + { + return componentAdapter; + } + + return mcInt.getMCAdapter(componentAdapter); + } + + public static synchronized boolean hasMCKernel(ComponentAdapter adapter) + { + MCIntegration mcInt =3D getMCIntegration(); + if (mcInt =3D=3D null) + { + return false; + } + return mcInt.hasMCKernel(adapter); + } + + public static synchronized void initThreadCtx(ServletContext ctx) + { + MCIntegration mcInt =3D getMCIntegration(); + if (mcInt =3D=3D null) + { + return; + } + mcInt.initThreadCtx(ctx); + } + + public static synchronized void resetThreadCtx(ServletContext ctx) + { + MCIntegration mcInt =3D getMCIntegration(); + if (mcInt =3D=3D null) + { + return; + } + mcInt.resetThreadCtx(ctx); + } + + private static MCIntegration getMCIntegration() + { + if (mcInt =3D=3D null && permFailure =3D=3D false) + { + Class clazz =3D null; + try + { + clazz =3D loadClass("org.exoplatform.container.mc.impl.MCInteg= rationImpl"); + Method m =3D clazz.getMethod("getInstance"); + mcInt =3D (MCIntegration) m.invoke(null); + } + catch (ClassNotFoundException ignored) + { + permFailure =3D true; + log.info("MC integration not available in this environment (mi= ssing class: " + + ignored.getMessage() + ")"); + + return null; + } + catch (Exception e) + { + permFailure =3D true; + throw new RuntimeException("MC Integration initialization erro= r", e); + } + } + return mcInt; + } + + static Class loadClass(String name) throws ClassNotFoundException + { + Class clazz =3D null; + try + { + ClassLoader cl =3D Thread.currentThread().getContextClassLoader(); + if (cl !=3D null) + { + clazz =3D cl.loadClass(name); + } + } + catch (ClassNotFoundException ignored) + { + clazz =3D Class.forName(name); + } + return clazz; + } +} Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/MCInterceptProxy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInterceptProxy.java 2009-11-27 11:53:44 UTC (rev 9= 01) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCInterceptProxy.java 2009-11-27 23:21:52 UTC (rev 9= 02) @@ -1,16 +0,0 @@ -package org.exoplatform.container.mc; - -/** - * @author Marko Strukelj - */ -public class MCInterceptProxy -{ - public static final String DELEGATE =3D "__delegate"; - private Object __delegate; - - public MCInterceptProxy(Object delegate) - { - this.__delegate =3D delegate; - System.out.println("MCInterceptProxy - CL: " + delegate.getC= lass().getClassLoader()); - } -} Deleted: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/o= rg/exoplatform/container/mc/WrapperMethodComposer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/WrapperMethodComposer.java 2009-11-27 11:53:44 UTC (= rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/WrapperMethodComposer.java 2009-11-27 23:21:52 UTC (= rev 902) @@ -1,126 +0,0 @@ -package org.exoplatform.container.mc; - -import javassist.CtClass; -import javassist.CtMethod; -import javassist.NotFoundException; -import javassist.bytecode.AccessFlag; - -/** - * @author Marko Strukelj - */ -public class WrapperMethodComposer -{ - private String delegate; - private String type; - - public WrapperMethodComposer(String delegateFldName, String type) - { - delegate =3D delegateFldName; - this.type =3D type; - } - - public String composeMethod(CtMethod method) throws NotFoundException - { - StringBuilder sb =3D new StringBuilder(); - - String next =3D addModifiers(method.getModifiers()); - sb.append(next); - if (next.length() > 0) - sb.append(" "); - - CtClass ret =3D method.getReturnType(); - next =3D addReturnType(ret); - sb.append(next).append(" "); - - sb.append(method.getName()).append("("); - next =3D addParams(method.getParameterTypes()); - sb.append(next); - sb.append(") "); - - next =3D addExceptions(method.getExceptionTypes()); - sb.append(next); - if (next.length() > 0) - sb.append(" "); - - sb.append("{ "); - sb.append(delegateCall(method.getName(), method.getParameterTypes(),= method.getReturnType())); - sb.append("}"); - - return sb.toString(); - } - - private String delegateCall(String name, CtClass[] parameterTypes, CtCl= ass returnType) - { - StringBuilder sb =3D new StringBuilder(); - if (returnType !=3D null) - sb.append("return "); - sb.append("((").append(type).append(")"); - sb.append(delegate).append(")").append(".").append(name).append("("); - for (int i =3D 0; i < parameterTypes.length; i++) - { - if (i > 0) - sb.append(","); - sb.append("a").append(i); - } - sb.append(");"); - - if (returnType =3D=3D null) - sb.append("return;"); - - return sb.toString(); - } - - - private String addParams(CtClass[] parameterTypes) - { - if (parameterTypes =3D=3D null || parameterTypes.length =3D=3D 0) - return ""; - - StringBuilder sb =3D new StringBuilder(); - for (int i =3D 0; i < parameterTypes.length; i++) - { - if (i > 0) - sb.append(","); - sb.append(parameterTypes[i].getName()).append(" a").append(i); - } - return sb.toString(); - } - - private String addExceptions(CtClass[] exceptionTypes) - { - StringBuilder ret =3D new StringBuilder(); - if (exceptionTypes =3D=3D null || exceptionTypes.length =3D=3D 0) - return ""; - - ret.append("throws "); - for (int i =3D 0; i < exceptionTypes.length; i++) - { - if (i > 0) - ret.append(","); - ret.append(exceptionTypes[i].getName()); - } - return ret.toString(); - } - - private String addReturnType(CtClass ret) - { - if (ret =3D=3D null) - return "void"; - else - return ret.getName(); - } - - private String addModifiers(int modifiers) - { - if (AccessFlag.isPackage(modifiers)) - return ""; - else if (AccessFlag.isPrivate(modifiers)) - return "private"; - else if (AccessFlag.isPublic(modifiers)) - return "public"; - else if (AccessFlag.isProtected(modifiers)) - return "protected"; - else - throw new RuntimeException("Invalid modifiers: " + modifiers); - } -} Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/util/JBossEnv.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/util/JBossEnv.java 2009-11-27 11:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/util/JBossEnv.java 2009-11-27 23:21:52 UTC (rev 902) @@ -1,10 +1,8 @@ package org.exoplatform.container.util; = import javax.servlet.ServletContext; +import org.exoplatform.container.mc.MCIntegrationInvoker; = -import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; -import org.jboss.mc.servlet.vdf.api.VDFThreadLocalUtils; - /** * This class makes env specific thread context inits when GateIn runs ins= ide JBossAS or MC * @@ -12,6 +10,9 @@ */ public class JBossEnv { + /** This value is equal to org.jboss.kernel.plugins.bootstrap.basic.Ker= nelConstants.KERNEL_NAME */ + private static final String MC_KERNEL_NAME =3D "jboss.kernel:service=3D= Kernel"; + /** * Check if MC Kernel is available * @@ -20,7 +21,7 @@ */ public static boolean isAvailable(ServletContext ctx) { - return ctx.getAttribute(KernelConstants.KERNEL_NAME) !=3D null; + return ctx.getAttribute(MC_KERNEL_NAME) !=3D null; } = /** @@ -30,7 +31,7 @@ */ public static void initThreadEnv(ServletContext ctx) { - org.jboss.mc.servlet.vdf.api.VDFThreadLocalUtils.init(ctx); + MCIntegrationInvoker.initThreadCtx(ctx); } = /** @@ -40,6 +41,6 @@ */ public static void cleanupThreadEnv(ServletContext ctx) { - org.jboss.mc.servlet.vdf.api.VDFThreadLocalUtils.reset(); + MCIntegrationInvoker.resetThreadCtx(ctx); } } \ No newline at end of file Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml 200= 9-11-27 11:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml 200= 9-11-27 23:21:52 UTC (rev 902) @@ -4,19 +4,23 @@ = org.exoplatform.kernel.demos - exo.kernel.demos + demos-parent 2.2.0-Beta04-SNAPSHOT = - exo.mc-int.mc-injection + exo.kernel.demos.mc-injection = - eXo Kernel Demo - MC Injection + eXo Kernel :: Demos :: MC Injection MC Integration Demo - MC Injection = + picocontainer + picocontainer + + org.exoplatform.kernel - exo.kernel.container = + exo.kernel.mc-int org.jboss.microcontainer Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /java/org/exoplatform/kernel/demos/mc/AOPInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/AOPInterceptor.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/AOPInterceptor.java 2009-11-27 23:21:52 = UTC (rev 902) @@ -0,0 +1,52 @@ +package org.exoplatform.kernel.demos.mc; + +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.aop.advice.Interceptor; +import org.jboss.aop.joinpoint.Invocation; +import org.jboss.aop.proxy.container.ContainerProxyMethodInvocation; + +import java.util.LinkedList; +import java.util.List; + +/** + * @author Marko Strukelj + */ +public class AOPInterceptor implements Interceptor +{ + private static Log log =3D ExoLogger.getLogger(AOPInterceptor.class); + private static LinkedList invocations =3D new LinkedList(); + + public String getName() + { + return getClass().getName(); + } + + public Object invoke(Invocation invocation) throws Throwable + { + StringBuilder sb =3D new StringBuilder(); + if (invocation instanceof ContainerProxyMethodInvocation) + { + ContainerProxyMethodInvocation methodInvocation =3D (ContainerPro= xyMethodInvocation) invocation; + sb.append("Method: " + methodInvocation.getActualMethod().getName= ()); + sb.append(", Args:\n"); + Object[] args =3D methodInvocation.getArguments(); + for (int i =3D 0; i < args.length; i++) + { + sb.append(" " + i + ") " + args[i] + "\n"); + } + } + else + { + sb.append(invocation); + } + log.info("Interceptor: " + this + ", Target object: " + invocation.g= etTargetObject() + ", " + sb); + invocations.add(invocation); + return invocation.invokeNext(); + } + + public static List getInvocations() + { + return invocations; + } +} Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/m= ain/java/org/exoplatform/kernel/demos/mc/InjectedBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectedBean.java 2009-11-27 11:53:44 UT= C (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectedBean.java 2009-11-27 23:21:52 UT= C (rev 902) @@ -1,14 +1,17 @@ package org.exoplatform.kernel.demos.mc; = -import org.jboss.logging.Logger; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; = /** * @author Marko Strukelj */ public class InjectedBean { - private static final Logger log =3D Logger.getLogger(InjectedBean.class= ); + private static final Log log =3D ExoLogger.getLogger(InjectedBean.class= ); = + public static final String SOME_PROPERTY_VALUE =3D "[This is some prope= rty value]"; + //static //{ // System.out.println("InjectedBean class loaded !!!"); @@ -21,7 +24,7 @@ = public String getSomeString() { - return "[This is some property value]"; + return SOME_PROPERTY_VALUE; } = public void start() Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/m= ain/java/org/exoplatform/kernel/demos/mc/InjectingBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectingBean.java 2009-11-27 11:53:44 U= TC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/InjectingBean.java 2009-11-27 23:21:52 U= TC (rev 902) @@ -1,7 +1,9 @@ package org.exoplatform.kernel.demos.mc; = -import org.exoplatform.container.mc.InterceptMC; -import org.exoplatform.container.mc.MCInjectionMode; +import org.exoplatform.container.mc.impl.InterceptMC; +import org.exoplatform.container.mc.impl.MCInjectionMode; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.MapValue; @@ -9,7 +11,6 @@ import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; import org.jboss.kernel.spi.config.KernelConfigurator; -import org.jboss.logging.Logger; = import java.util.Map; = @@ -22,31 +23,44 @@ * @author Marko Strukelj */ // Enable field injection by setting injectionMode -(a)InterceptMC(injectionMode=3D MCInjectionMode.ALL) +(a)InterceptMC(injectionMode =3D MCInjectionMode.ALL) public class InjectingBean implements org.picocontainer.Startable { - private static final Logger log =3D Logger.getLogger(InjectingBean.clas= s); + private static final Log log =3D ExoLogger.getLogger(InjectingBean.clas= s); = - private InjectedBean bean1; + private InjectedBean bean; private KernelConfigurator configurator; = // Avoid using field injection, it's an anti-pattern @Inject(bean =3D "InjectedBean") private InjectedBean injectedBean; = + private Map bindingsMap; + private String stringValue; + private boolean started; = public InjectingBean() { log.info("Injecting bean instantiated"); } = + public InjectedBean getBean() + { + return bean; + } + @Inject public void setBean(InjectedBean bean) { - this.bean1 =3D bean; + this.bean =3D bean; log.info("Received InjectedBean: " + bean); } = + public KernelConfigurator getConfigurator() + { + return configurator; + } + @Inject(bean =3D KernelConstants.KERNEL_CONFIGURATOR_NAME) public void setConfigurator(KernelConfigurator configurator) { @@ -54,6 +68,11 @@ log.info("InjectingBean Received KernelConfigurator: " + configurato= r); } = + public Map getBindings() + { + return bindingsMap; + } + @MapValue( value =3D { @EntryValue( @@ -85,21 +104,39 @@ public void setBindings(Map, Object> bindings) { log.info("Received a map with bindings: " + bindings); + this.bindingsMap =3D bindings; } = + public String getSomeStringProperty() + { + return stringValue; + } + @Inject(bean =3D "InjectedBean", property =3D "someString") public void setSomeStringProperty(String value) { log.info("Received SomeStringProperty value: " + value); + this.stringValue =3D value; } = public void start() { log.warn("start() called (injectedBean is set to: " + injectedBean += ")"); + this.started =3D true; } = public void stop() { log.info("stop() called"); } + + public InjectedBean getInjectedBean() + { + return injectedBean; + } + + public boolean isStarted() + { + return started; + } } Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /java/org/exoplatform/kernel/demos/mc/MissingNoArgsConstructorBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/MissingNoArgsConstructorBean.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/MissingNoArgsConstructorBean.java 2009-1= 1-27 23:21:52 UTC (rev 902) @@ -0,0 +1,42 @@ +package org.exoplatform.kernel.demos.mc; + +import org.exoplatform.container.xml.InitParams; +import org.exoplatform.container.xml.ValueParam; +import org.picocontainer.Startable; + +/** + * @author Marko Strukelj + */ +public class MissingNoArgsConstructorBean implements Startable +{ + private String name; + private boolean started; + + public MissingNoArgsConstructorBean(InitParams params) + { + if (params =3D=3D null) + { + return; + } + ValueParam val =3D params.getValueParam("name"); + if (val !=3D null) + { + name =3D val.getValue(); + } + } + + public String method01() + { + return "method01"; + } + + public void start() + { + started =3D true; + } + + public void stop() + { + started =3D false; + } +} Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /java/org/exoplatform/kernel/demos/mc/PrivateNoArgsConstructorBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/PrivateNoArgsConstructorBean.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/PrivateNoArgsConstructorBean.java 2009-1= 1-27 23:21:52 UTC (rev 902) @@ -0,0 +1,38 @@ +package org.exoplatform.kernel.demos.mc; + +import org.exoplatform.container.xml.InitParams; +import org.jboss.beans.metadata.api.annotations.Inject; + +/** + * @author Marko Strukelj + */ +public class PrivateNoArgsConstructorBean extends MissingNoArgsConstructor= Bean +{ + private InjectedBean injectedBean; + + private PrivateNoArgsConstructorBean() + { + super(null); + } + + public PrivateNoArgsConstructorBean(InitParams params) + { + super(params); + } + + public String method12() + { + return "method12"; + } + + @Inject + public void setInjectedBean(InjectedBean bean) + { + this.injectedBean =3D bean; + } + + public InjectedBean getInjectedBean() + { + return injectedBean; + } +} Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /java/org/exoplatform/kernel/demos/mc/ProtectedNoArgsConstructorBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/ProtectedNoArgsConstructorBean.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/ja= va/org/exoplatform/kernel/demos/mc/ProtectedNoArgsConstructorBean.java 2009= -11-27 23:21:52 UTC (rev 902) @@ -0,0 +1,38 @@ +package org.exoplatform.kernel.demos.mc; + +import org.exoplatform.container.xml.InitParams; +import org.jboss.beans.metadata.api.annotations.Inject; + +/** + * @author Marko Strukelj + */ +public class ProtectedNoArgsConstructorBean extends MissingNoArgsConstruct= orBean +{ + private InjectedBean injectedBean; + + protected ProtectedNoArgsConstructorBean() + { + super(null); + } + + public ProtectedNoArgsConstructorBean(InitParams params) + { + super(params); + } + + public String method11() + { + return "method11"; + } + + @Inject + public void setInjectedBean(InjectedBean bean) + { + this.injectedBean =3D bean; + } + + public InjectedBean getInjectedBean() + { + return injectedBean; + } +} Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/m= ain/resources/META-INF/jboss-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/META-INF/jboss-beans.xml 2009-11-27 11:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/META-INF/jboss-beans.xml 2009-11-27 23:21:52 UTC (rev 902) @@ -1,3 +1,3 @@ - + \ No newline at end of file Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/m= ain/resources/conf/configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/configuration.xml 2009-11-27 11:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/configuration.xml 2009-11-27 23:21:52 UTC (rev 902) @@ -1,12 +1,37 @@ + xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=3D"http://www.exoplaform.org/xml/ns/kernel_1_0.xs= d http://www.exoplaform.org/xml/ns/kernel_1_0.xsd" + xmlns=3D"http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"> = - - InjectingBean - org.exoplatform.kernel.demos.mc.InjectingBean - = - + + InjectingBean + org.exoplatform.kernel.demos.mc.InjectingBean + + + InjectingBean2 + org.exoplatform.kernel.demos.mc.InjectingBean + + + InjectingBean3 + org.exoplatform.kernel.demos.mc.InjectingBean + + + InjectingBean4 + org.exoplatform.kernel.demos.mc.InjectingBean + + + InjectingBean5 + org.exoplatform.kernel.demos.mc.InjectingBean + + + ProtectedNoArgsConstructorBean + org.exoplatform.kernel.demos.mc.ProtectedNoArgsConstructorBean= + + + name + Some value + + + Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /resources/conf/mc-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/mc-beans.xml (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/mc-beans.xml 2009-11-27 23:21:52 UTC (rev 902) @@ -0,0 +1,22 @@ + + + + + + + + + *(..))"> + + + + *(..))"> + + + + \ No newline at end of file Added: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main= /resources/conf/mc-int-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/mc-int-beans.xml (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/mc-int-beans.xml 2009-11-27 23:21:52 UTC (rev 902) @@ -0,0 +1,27 @@ + + + + + @org.exoplatform.container.mc.impl.InterceptMC(enableAOP= =3Dtrue) + + + + @org.exoplatform.container.mc.impl.InterceptMC(injectionMode=3Dor= g.exoplatform.container.mc.impl.MCInjectionMode.STANDARD) + + + + + @org.exoplatform.container.mc.impl.InterceptMC(enableAOP=3Dtrue,i= njectionMode=3Dorg.exoplatform.container.mc.impl.MCInjectionMode.ALL) + + + + @org.exoplatform.container.mc.impl.InterceptMC(enableAOP= =3Dtrue) + + + + + + @org.exoplatform.container.mc.impl.InterceptMC(enableAOP= =3Dtrue) + + + \ No newline at end of file Modified: kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml 2009-11-27 11:53= :44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml 2009-11-27 23:21= :52 UTC (rev 902) @@ -9,10 +9,10 @@ = org.exoplatform.kernel.demos - exo.kernel.demos + demos-parent pom = - eXo Kernel Demos + eXo Kernel :: Demos = mc-injection Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/pom.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/pom.xml 2009-11-27 23:2= 1:52 UTC (rev 902) @@ -0,0 +1,69 @@ + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.mc-int + + eXo Kernel :: MC Kernel Integration + MC Kernel Integration + + + + org.exoplatform.kernel + exo.kernel.commons + + + + org.exoplatform.kernel + exo.kernel.container + + + + javax.servlet + servlet-api + + = + + picocontainer + picocontainer + + + + org.jboss.microcontainer + jboss-kernel + + + + org.jboss.microcontainer + jboss-aop-mc-int + + + + org.jboss.mc-int + jboss-mc-int-common + + + + org.jboss.mc-int + jboss-mc-int-servlet + + + + org.jboss.cl + jboss-classloader + + + + org.exoplatform.kernel + exo.kernel.mc-kernel-extras + + = + + Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/GenericWrapperUtil.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/GenericWrapperUtil.java (r= ev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/GenericWrapperUtil.java 2009-11-27 23:21:52 UTC (r= ev 902) @@ -0,0 +1,177 @@ +package org.exoplatform.container.mc.impl; + +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtConstructor; +import javassist.CtMethod; +import javassist.CtNewMethod; +import javassist.LoaderClassPath; +import javassist.Modifier; +import javassist.NotFoundException; +import javassist.bytecode.AnnotationsAttribute; +import javassist.bytecode.ClassFile; +import javassist.bytecode.ConstPool; +import javassist.bytecode.MethodInfo; +import org.jboss.deployers.structure.spi.DeploymentUnit; +import org.jboss.deployers.vfs.plugins.structure.AbstractVFSDeploymentUnit; +import org.jboss.mc.common.ThreadLocalUtils; +import org.jboss.virtual.MemoryFileFactory; +import org.jboss.virtual.VirtualFile; + +import java.net.URL; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * @author Ales Justin + * @author Marko Strukelj + */ +final class GenericWrapperUtil +{ + private static AtomicInteger counter =3D new AtomicInteger(0); + + static MCComponentInfo generateAndInstallWrapper(Object instance) throw= s Exception + { + ClassPool pool =3D ClassPool.getDefault(); + pool.insertClassPath(new LoaderClassPath(Thread.currentThread().getC= ontextClassLoader())); + + CtClass cc =3D pool.get(MCInterceptProxy.class.getName()); + CtClass pc =3D pool.get(instance.getClass().getName()); + + zeroArgConstructorCheck(pc, instance); + + cc.setSuperclass(pc); + cc.setName(getPackage(cc.getName()) + ".MCInterceptProxy$" + counter= .getAndIncrement()); + WrapperMethodComposer composer =3D new WrapperMethodComposer(MCInter= ceptProxy.DELEGATE, pc.getName()); + + ClassFile cf =3D cc.getClassFile(); + AnnotationsAttribute attr =3D setAnnotations(pc.getClassFile().getAt= tributes(), cf.getConstPool()); + if (attr !=3D null) + { + cf.addAttribute(attr); + } + cf.setVersionToJava5(); + + for (CtMethod m : pc.getMethods()) + { + if (isMethodOverridable(m)) + { + CtMethod method =3D CtNewMethod.make(composer.composeMethod(m)= , cc); + MethodInfo minf =3D method.getMethodInfo(); + attr =3D setAnnotations(m.getMethodInfo().getAttributes(), min= f.getConstPool()); + if (attr !=3D null) + { + minf.addAttribute(attr); + } + cc.addMethod(method); + } + } + + installWrapper(cc); + + MCComponentInfo mcinf =3D new MCComponentInfo(cc.getName(), + new JavassistAOPClassLoader(Thread.currentThread().getContextC= lassLoader(), cc.getClassPool())); + Thread.currentThread().setContextClassLoader(mcinf.getClassLoader())= ; // TODO: ensure symetry - reset old CL when done + return mcinf; + } + + private static AnnotationsAttribute setAnnotations(List attrs, ConstPoo= l cpool) + { + //AnnotationsAttribute attr =3D new AnnotationsAttribute(cpool, Anno= tationsAttribute.visibleTag); + for (Object a : attrs) + { + if (a instanceof AnnotationsAttribute) + { + AnnotationsAttribute aa =3D (AnnotationsAttribute) a; + if (AnnotationsAttribute.visibleTag.equals(aa.getName()) =3D= =3D false) + { + continue; + } + //attr.setAnnotations(aa.getAnnotations()); + //return attr; + return (AnnotationsAttribute) aa.copy(cpool, null); + } + } + return null; + } + + private static String getPackage(String name) + { + return name.substring(0, name.lastIndexOf(".")); + } + + private static void installWrapper(CtClass cc) throws Exception + { + // This is to make classloading work with jboss-aop and mc-classload= ing + // - third-party (Tomcat) can be enabled through context classloader + DeploymentUnit unit =3D ThreadLocalUtils.getUnit(); + String host =3D getVFSMemoryHost(unit); + if (host !=3D null) + { + URL vfsUrl =3D new URL("vfsmemory://" + host + "/" + getResourceP= ath(cc.getName())); + MemoryFileFactory.putFile(vfsUrl, cc.toBytecode()); + return; + } + } + + static void postInstallCleanup() + { + // TODO: symmetry not 100% assured here + ClassLoader cl =3D Thread.currentThread().getContextClassLoader(); + if (cl instanceof JavassistAOPClassLoader) + { + Thread.currentThread().setContextClassLoader(cl.getParent()); + } + } + + private static String getResourcePath(String name) + { + return name.replace(".", "/") + ".class"; + } + + private static String getVFSMemoryHost(DeploymentUnit unit) throws Exce= ption + { + if (unit instanceof AbstractVFSDeploymentUnit) + { + List classPath =3D ((AbstractVFSDeploymentUnit) unit= ).getClassPath(); + for (VirtualFile vf : classPath) + { + URL url =3D vf.toURL(); + if ("vfsmemory".equals(url.getProtocol())) + { + return url.getHost(); + } + } + return getVFSMemoryHost(unit.getParent()); + } + + return null; + } + + private static boolean isMethodOverridable(CtMethod m) + { + return (m.getModifiers() & Modifier.FINAL) =3D=3D 0 + && !"clone".equals(m.getName()) + && !"finalize".equals(m.getName()); + } + + private static void zeroArgConstructorCheck(CtClass pc, Object c) + throws NotFoundException + { + CtConstructor[] ctors =3D pc.getDeclaredConstructors(); + boolean found =3D false; + for (CtConstructor cons : ctors) + { + if (cons.getParameterTypes().length =3D=3D 0 + && (cons.getModifiers() & (Modifier.PUBLIC | Modifier.PROTE= CTED)) > 0) + { + found =3D true; + break; + } + } + if (!found) + { + throw new RuntimeException("Class can not be AOP instrumented - i= t has no zero-arguments public/protected constructor: " + c.getClass()); + } + } +} \ No newline at end of file Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/InterceptMC.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/InterceptMC.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/InterceptMC.java 2009-11-27 23:21:52 UTC (rev 902) @@ -0,0 +1,31 @@ +package org.exoplatform.container.mc.impl; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks Gatein MC enabled component. + * + * @author Marko Strukelj + * @author Ales Justin + */ +(a)Retention(RetentionPolicy.RUNTIME) +(a)Target({ElementType.TYPE}) +public @interface InterceptMC +{ + /** + * Do we enable AOP for this component. + * + * @return true if we should enable AOP, false otherwise + */ + boolean enableAOP() default false; + + /** + * Injection mode + * + * @return MCInjectionMode enumeration constant representing injection = mode + */ + MCInjectionMode injectionMode() default MCInjectionMode.STANDARD; +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/JavassistAOPClassLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/JavassistAOPClassLoader.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/JavassistAOPClassLoader.java 2009-11-27 23:21:52 U= TC (rev 902) @@ -0,0 +1,67 @@ +package org.exoplatform.container.mc.impl; + +import javassist.ClassPool; +import javassist.Loader; + +/** + * @author Marko Strukelj + */ +public class JavassistAOPClassLoader extends Loader +{ + public JavassistAOPClassLoader() + { + } + + public JavassistAOPClassLoader(ClassPool cp) + { + super(cp); + } + + public JavassistAOPClassLoader(ClassLoader parent, ClassPool cp) + { + super(parent, cp); + } + + @Override + protected Class loadClassByDelegation(String name) throws ClassNotFound= Exception + { + if (name.startsWith("org.jboss.aop.")) + { + return delegateToParent(name); + } + + return super.loadClassByDelegation(name); + } + + protected Class loadClass(String name, boolean resolve) + throws ClassFormatError, ClassNotFoundException + { + name =3D name.intern(); + synchronized (name) + { + Class c =3D findLoadedClass(name); + if (c =3D=3D null) + { + try + { + c =3D delegateToParent(name); + } + catch (ClassNotFoundException ignored) + { + } + } + + if (c =3D=3D null) + { + c =3D findClass(name); + } + + if (resolve) + { + resolveClass(c); + } + + return c; + } + } +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/MCComponentAdapter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCComponentAdapter.java (r= ev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCComponentAdapter.java 2009-11-27 23:21:52 UTC (r= ev 902) @@ -0,0 +1,141 @@ +package org.exoplatform.container.mc.impl; + +import org.jboss.beans.info.spi.BeanAccessMode; +import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; +import org.jboss.dependency.plugins.helpers.StatelessController; +import org.jboss.dependency.spi.ControllerState; +import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext; +import org.jboss.kernel.spi.dependency.KernelController; +import org.jboss.kernel.spi.dependency.KernelControllerContext; +import org.picocontainer.ComponentAdapter; +import org.picocontainer.PicoContainer; +import org.picocontainer.PicoInitializationException; +import org.picocontainer.PicoIntrospectionException; +import org.picocontainer.PicoVisitor; + +/** + * @author Ales Justin + * @author Marko Strukelj + */ +public class MCComponentAdapter implements ComponentAdapter +{ + private KernelController controller; + private ComponentAdapter delegate; + private InterceptMC interceptMC; + private Object lastComponentInstance; + + public MCComponentAdapter(KernelController controller, ComponentAdapter= delegate, InterceptMC interceptMC) + { + if (controller =3D=3D null) + { + throw new IllegalArgumentException("Null controller"); + } + if (delegate =3D=3D null) + { + throw new IllegalArgumentException("Null delegate"); + } + + if (controller instanceof StatelessController) + { + throw new IllegalArgumentException("controller is instanceof Stat= elessController"); + } + + this.controller =3D controller; + this.delegate =3D delegate; + this.interceptMC =3D interceptMC; + } + + public Object getComponentKey() + { + return delegate.getComponentKey(); + } + + public Class getComponentImplementation() + { + return delegate.getComponentImplementation(); + } + + public Object getComponentInstance(PicoContainer container) throws Pico= InitializationException, PicoIntrospectionException + { + Object target =3D lastComponentInstance; + if (target !=3D null) + { + return target; + } + + String key =3D delegate.getComponentKey().toString(); + Object instance =3D delegate.getComponentInstance(container); + try + { + BeanMetaDataBuilder builder; + if (interceptMC !=3D null && interceptMC.enableAOP()) + { + MCComponentInfo mcinfo =3D GenericWrapperUtil.generateAndInsta= llWrapper(instance); + builder =3D BeanMetaDataBuilder.createBuilder(key, mcinfo.getW= rapperClassName()); + builder.addConstructorParameter(Object.class.getName(), instan= ce); + } + else + { + builder =3D BeanMetaDataBuilder.createBuilder(key, instance.ge= tClass().getName()); + builder.setConstructorValue(instance); + } + builder.ignoreCreate(); + builder.ignoreStart(); + builder.ignoreStop(); + builder.ignoreDestroy(); + builder.setAccessMode(getInjectionMode(interceptMC)); + + KernelControllerContext ctx =3D new AbstractKernelControllerConte= xt(null, builder.getBeanMetaData(), null); + try + { + StatelessController ctrl =3D new StatelessController(controlle= r); + ctrl.install(ctx); + if (ctx.getError() !=3D null) + { + throw ctx.getError(); + } + if (ctrl.getStates().isBeforeState(ctx.getState(), ControllerS= tate.INSTALLED)) + { + throw new IllegalArgumentException("Missing some dependency= : " + ctx.getDependencyInfo().getUnresolvedDependencies(null)); + } + + target =3D ctx.getTarget(); + lastComponentInstance =3D target; + return target; + } + finally + { + GenericWrapperUtil.postInstallCleanup(); + } + } + catch (Throwable ex) + { + throw new RuntimeException("Failed to perform MC interception on = component: " + delegate.getComponentImplementation(), ex); + } + } + + private BeanAccessMode getInjectionMode(InterceptMC interceptMC) + { + MCInjectionMode mode =3D interceptMC.injectionMode(); + + switch (mode) + { + case ALL: + return BeanAccessMode.ALL; + case FIELDS: + return BeanAccessMode.FIELDS; + default: + return BeanAccessMode.STANDARD; + } + } + + public void verify(PicoContainer container) throws PicoIntrospectionExc= eption + { + delegate.verify(container); + } + + public void accept(PicoVisitor visitor) + { + delegate.accept(visitor); + } +} \ No newline at end of file Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/MCComponentInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCComponentInfo.java (rev = 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCComponentInfo.java 2009-11-27 23:21:52 UTC (rev = 902) @@ -0,0 +1,26 @@ +package org.exoplatform.container.mc.impl; + +/** + * @author Marko Strukelj + */ +public class MCComponentInfo +{ + private String name; + private ClassLoader classLoader; + + public MCComponentInfo(String wrapperClassName, ClassLoader classLoader) + { + this.name =3D wrapperClassName; + this.classLoader =3D classLoader; + } + + public String getWrapperClassName() + { + return name; + } + + public ClassLoader getClassLoader() + { + return classLoader; + } +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/MCInjectionMode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCInjectionMode.java (rev = 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCInjectionMode.java 2009-11-27 23:21:52 UTC (rev = 902) @@ -0,0 +1,22 @@ +package org.exoplatform.container.mc.impl; + +/** + * @author Marko Strukelj + */ +public enum MCInjectionMode +{ + /** + * Field and method injections + */ + ALL, + + /** + * Disable field injections (default) + */ + FIELDS, + + /** + * Try setter injection first, if no setter found, fallback to field + */ + STANDARD +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/MCIntConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCIntConfig.java (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCIntConfig.java 2009-11-27 23:21:52 UTC (rev 902) @@ -0,0 +1,171 @@ +package org.exoplatform.container.mc.impl; + +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.beans.metadata.spi.BeanMetaData; +import org.jboss.kernel.spi.deployment.KernelDeployment; +import org.jboss.xb.binding.Unmarshaller; +import org.jboss.xb.binding.UnmarshallerFactory; +import org.jboss.xb.binding.resolver.MutableSchemaResolver; +import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFa= ctory; +import org.picocontainer.ComponentAdapter; + +import java.io.IOException; +import java.net.URL; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author Marko Strukelj + */ +public class MCIntConfig +{ + private static final Log log =3D ExoLogger.getLogger(MCIntConfig.class); + + private Map confByKey =3D new HashMap(); + + private Map confByBean =3D new HashMap(); + + MCIntConfig() + { + Enumeration urls =3D null; + try + { + urls =3D Thread.currentThread().getContextClassLoader().getResour= ces("conf/mc-int-beans.xml"); + } + catch (IOException e) + { + throw new RuntimeException("Failed to get resources: conf/mc-int-= beans.xml", e); + } + + UnmarshallerFactory factory =3D UnmarshallerFactory.newInstance(); + MutableSchemaResolver resolver =3D SingletonSchemaResolverFactory.ge= tInstance().getSchemaBindingResolver(); + + while (urls.hasMoreElements()) + { + URL url =3D urls.nextElement(); + + KernelDeployment deployment =3D parseConfigURL(factory, resolver,= url); + + List beans =3D deployment.getBeans(); + for (BeanMetaData mdata : beans) + { + String name =3D mdata.getName(); + DeploymentData data =3D confByKey.get(name); + if (data =3D=3D null) + { + String bean =3D mdata.getBean(); + data =3D confByBean.get(bean); + } + if (data !=3D null) + { + log.warn("Overriding existing mc-int-beans configuration fo= r bean: " + data.data + + " from " + data.deployment.getName() + " with one f= rom " + deployment.getName()); + } + addConf(new DeploymentData(deployment, mdata)); + } + } + } + + public BeanMetaData getByKey(String key) + { + DeploymentData dd =3D confByKey.get(key); + if (dd =3D=3D null) + { + return null; + } + return dd.data; + } + + public BeanMetaData getByBean(String bean) + { + DeploymentData dd =3D confByBean.get(bean); + if (dd =3D=3D null) + { + return null; + } + return dd.data; + } + + public BeanMetaData getByAdapter(ComponentAdapter adapter) + { + Object key =3D adapter.getComponentKey(); + String strKey =3D key instanceof Class ? ((Class) key).getName() : S= tring.valueOf(key); + BeanMetaData ret =3D getByKey(strKey); + if (ret !=3D null) + { + return ret; + } + + ret =3D getByBean(strKey); + return ret; + } + + private void addConf(DeploymentData deploymentData) + { + String name =3D deploymentData.data.getName(); + if (name !=3D null) + { + confByKey.put(name, deploymentData); + } + String bean =3D deploymentData.data.getBean(); + if (bean !=3D null) + { + confByBean.put(bean, deploymentData); + } + if (name =3D=3D null && bean =3D=3D null) + { + throw new RuntimeException("Configuration error: bean found with = no name and no class in " + + deploymentData.deployment.getName()); + } + } + + private KernelDeployment parseConfigURL(UnmarshallerFactory factory, Mu= tableSchemaResolver resolver, URL url) + { + final boolean trace =3D log.isTraceEnabled(); + if (trace) + { + log.trace("Parsing " + url); + } + long start =3D System.currentTimeMillis(); + + Unmarshaller unmarshaller =3D factory.newUnmarshaller(); + KernelDeployment deployment =3D null; + try + { + deployment =3D (KernelDeployment) unmarshaller.unmarshal(url.toSt= ring(), resolver); + } + catch (Exception e) + { + throw new RuntimeException("Failed to parse xml " + url, e); + } + + if (deployment =3D=3D null) + { + throw new RuntimeException("The xml " + url + " is not well forme= d!"); + } + deployment.setName(url.toString()); + + if (trace) + { + long now =3D System.currentTimeMillis(); + log.trace("Parsing " + url + " took " + (now - start) + " millise= conds"); + } + + return deployment; + } + + static class DeploymentData + { + KernelDeployment deployment; + BeanMetaData data; + + public DeploymentData(KernelDeployment deployment, BeanMetaData data) + { + this.deployment =3D deployment; + this.data =3D data; + } + } +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/MCIntegrationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCIntegrationImpl.java (re= v 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCIntegrationImpl.java 2009-11-27 23:21:52 UTC (re= v 902) @@ -0,0 +1,153 @@ +package org.exoplatform.container.mc.impl; + +import org.exoplatform.container.mc.MCIntegration; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.jboss.beans.metadata.spi.AnnotationMetaData; +import org.jboss.beans.metadata.spi.BeanMetaData; +import org.jboss.kernel.Kernel; +import org.jboss.kernel.plugins.dependency.AbstractKernelController; +import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; +import org.jboss.kernel.spi.deployment.KernelDeployment; +import org.jboss.mc.common.ThreadLocalUtils; +import org.jboss.mc.servlet.vdf.api.VDFThreadLocalUtils; +import org.picocontainer.ComponentAdapter; + +import javax.servlet.ServletContext; +import java.io.IOException; +import java.lang.annotation.Annotation; +import java.net.URL; +import java.util.Enumeration; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +/** + * @author Marko Strukelj + */ +public class MCIntegrationImpl implements MCIntegration +{ + private static Log log =3D ExoLogger.getLogger(MCIntegrationImpl.class); + private static MCIntegration mcint; + + private AbstractKernelController rootController; + private List deployments =3D new LinkedList(); + private MCIntConfig conf; + + public synchronized static MCIntegration getInstance() + { + if (mcint =3D=3D null) + { + mcint =3D new MCIntegrationImpl(); + } + return mcint; + } + + private MCIntegrationImpl() + { + // load mc-int-beans.xml + conf =3D new MCIntConfig(); + } + + public synchronized AbstractKernelController getRootController() + { + if (rootController =3D=3D null) + { + Kernel kernel =3D ThreadLocalUtils.getKernel(); + if (kernel !=3D null) + { + rootController =3D (AbstractKernelController) kernel.getContro= ller(); + } + else + { + log.warn("GateIn - MC integration not available"); + return null; + } + processDeployments(); + } + return rootController; + } + + private void processDeployments() + { + // Now deploy any AOP configuration - instantiates lifecycle callbac= ks + BasicXMLDeployer deployer =3D new BasicXMLDeployer(rootController.ge= tKernel()); + Enumeration urls =3D null; + try + { + urls =3D Thread.currentThread().getContextClassLoader().getResour= ces("conf/mc-beans.xml"); + } + catch (IOException e) + { + throw new RuntimeException("Failed to load resources: conf/mc-bea= ns.xml", e); + } + + while (urls.hasMoreElements()) + { + URL confUrl =3D urls.nextElement(); + try + { + deployments.add(deployer.deploy(confUrl)); + log.debug("Deployed mc-kernel configuration: " + confUrl); + } + catch (Throwable ex) + { + throw new RuntimeException("Failed to deploy: " + confUrl, ex); + } + } + } + + public ComponentAdapter getMCAdapter(ComponentAdapter adapter) + { + InterceptMC interceptAnnotation =3D null; + + BeanMetaData data =3D conf.getByAdapter(adapter); + if (data !=3D null) + { + Set annotationMetaData =3D data.getAnnotation= s(); + if (annotationMetaData !=3D null) + { + for (AnnotationMetaData annMeta : annotationMetaData) + { + Annotation ann =3D annMeta.getAnnotationInstance(); + if (ann.annotationType() =3D=3D InterceptMC.class) + { + interceptAnnotation =3D (InterceptMC) ann; + } + } + } + } + else + { + Class clazz =3D adapter.getComponentImplementation(); + interceptAnnotation =3D clazz.getAnnotation(InterceptMC.class); + } + + if (interceptAnnotation =3D=3D null) + { + return adapter; + } + + AbstractKernelController controller =3D getRootController(); + if (controller !=3D null) + { + adapter =3D new MCComponentAdapter(controller, adapter, intercept= Annotation); + } + return adapter; + } + + public boolean hasMCKernel(ComponentAdapter adapter) + { + return ThreadLocalUtils.getKernel() !=3D null; + } + + public void initThreadCtx(ServletContext ctx) + { + VDFThreadLocalUtils.init(ctx); + } + + public void resetThreadCtx(ServletContext ctx) + { + VDFThreadLocalUtils.reset(); + } +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/MCInterceptProxy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCInterceptProxy.java (rev= 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/MCInterceptProxy.java 2009-11-27 23:21:52 UTC (rev= 902) @@ -0,0 +1,23 @@ +package org.exoplatform.container.mc.impl; + +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; + +/** + * @author Marko Strukelj + */ +public class MCInterceptProxy +{ + private static final Log __log =3D ExoLogger.getLogger(MCInterceptProxy= .class); + public static final String DELEGATE =3D "__delegate"; + private Object __delegate; + + public MCInterceptProxy(Object delegate) + { + this.__delegate =3D delegate; + if (__log.isDebugEnabled()) + { + __log.debug("MCInterceptProxy - CL: " + delegate.getClass= ().getClassLoader()); + } + } +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/RootContainerVDFDecoratorInjector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/RootContainerVDFDecoratorInjector.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/RootContainerVDFDecoratorInjector.java 2009-11-27 = 23:21:52 UTC (rev 902) @@ -0,0 +1,71 @@ +package org.exoplatform.container.mc.impl; + +import javassist.ClassPool; +import javassist.CtClass; +import javassist.CtMethod; +import javassist.LoaderClassPath; +import org.jboss.beans.metadata.api.annotations.Inject; +import org.jboss.classloader.spi.ClassLoaderSystem; +import org.jboss.kernel.Kernel; +import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; +import org.jboss.mc.common.ThreadLocalUtils; +import org.jboss.util.loading.Translator; + +import java.security.ProtectionDomain; + +public class RootContainerVDFDecoratorInjector implements Translator +{ + @SuppressWarnings({"UnusedDeclaration"}) + private Kernel kernel; + private ClassLoaderSystem system; + + private static final String RC_CLASSNAME =3D "org.exoplatform.container= .RootContainer"; + private boolean found; + + public void start() + { + system.addTranslator(this); + } + + public void stop() + { + system.removeTranslator(this); + } + + protected byte[] decorate(ClassLoader cl) throws Exception + { + ClassPool pool =3D ClassPool.getDefault(); + pool.insertClassPath(new LoaderClassPath(cl)); + CtClass cc =3D pool.get(RC_CLASSNAME); + CtMethod m =3D cc.getDeclaredMethod("getInstance"); + m.insertBefore(ThreadLocalUtils.class.getName() + ".putKernel(kernel= );\ntry {\n"); + m.insertAfter("\n } finally { \n" + ThreadLocalUtils.class.getName()= + ".removeKernel();\n }"); + return cc.toBytecode(); + } + + public byte[] transform(ClassLoader classLoader, String s, Class aCl= ass, ProtectionDomain protectionDomain, byte[] bytes) throws Exception + { + if (found =3D=3D false && RC_CLASSNAME.equals(s)) + { + found =3D true; + return decorate(classLoader); + } + return bytes; + } + + public void unregisterClassLoader(ClassLoader classLoader) + { + } + + @Inject(bean =3D KernelConstants.KERNEL_NAME) + public void setKernel(Kernel kernel) + { + this.kernel =3D kernel; + } + + @Inject + public void setSystem(ClassLoaderSystem system) + { + this.system =3D system; + } +} Added: kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/ex= oplatform/container/mc/impl/WrapperMethodComposer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/WrapperMethodComposer.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/src/main/java/org/exopl= atform/container/mc/impl/WrapperMethodComposer.java 2009-11-27 23:21:52 UTC= (rev 902) @@ -0,0 +1,158 @@ +package org.exoplatform.container.mc.impl; + +import javassist.CtClass; +import javassist.CtMethod; +import javassist.NotFoundException; +import javassist.bytecode.AccessFlag; + +/** + * @author Marko Strukelj + */ +public class WrapperMethodComposer +{ + private String delegate; + private String type; + + public WrapperMethodComposer(String delegateFldName, String type) + { + delegate =3D delegateFldName; + this.type =3D type; + } + + public String composeMethod(CtMethod method) throws NotFoundException + { + StringBuilder sb =3D new StringBuilder(); + + String next =3D addModifiers(method.getModifiers()); + sb.append(next); + if (next.length() > 0) + { + sb.append(" "); + } + + CtClass ret =3D method.getReturnType(); + next =3D addReturnType(ret); + sb.append(next).append(" "); + + sb.append(method.getName()).append("("); + next =3D addParams(method.getParameterTypes()); + sb.append(next); + sb.append(") "); + + next =3D addExceptions(method.getExceptionTypes()); + sb.append(next); + if (next.length() > 0) + { + sb.append(" "); + } + + sb.append("{ "); + sb.append(delegateCall(method.getName(), method.getParameterTypes(),= method.getReturnType())); + sb.append("}"); + + return sb.toString(); + } + + private String delegateCall(String name, CtClass[] parameterTypes, CtCl= ass returnType) + { + StringBuilder sb =3D new StringBuilder(); + if (returnType !=3D null) + { + sb.append("return "); + } + sb.append("((").append(type).append(")"); + sb.append(delegate).append(")").append(".").append(name).append("("); + for (int i =3D 0; i < parameterTypes.length; i++) + { + if (i > 0) + { + sb.append(","); + } + sb.append("a").append(i); + } + sb.append(");"); + + if (returnType =3D=3D null) + { + sb.append("return;"); + } + + return sb.toString(); + } + + + private String addParams(CtClass[] parameterTypes) + { + if (parameterTypes =3D=3D null || parameterTypes.length =3D=3D 0) + { + return ""; + } + + StringBuilder sb =3D new StringBuilder(); + for (int i =3D 0; i < parameterTypes.length; i++) + { + if (i > 0) + { + sb.append(","); + } + sb.append(parameterTypes[i].getName()).append(" a").append(i); + } + return sb.toString(); + } + + private String addExceptions(CtClass[] exceptionTypes) + { + StringBuilder ret =3D new StringBuilder(); + if (exceptionTypes =3D=3D null || exceptionTypes.length =3D=3D 0) + { + return ""; + } + + ret.append("throws "); + for (int i =3D 0; i < exceptionTypes.length; i++) + { + if (i > 0) + { + ret.append(","); + } + ret.append(exceptionTypes[i].getName()); + } + return ret.toString(); + } + + private String addReturnType(CtClass ret) + { + if (ret =3D=3D null) + { + return "void"; + } + else + { + return ret.getName(); + } + } + + private String addModifiers(int modifiers) + { + if (AccessFlag.isPackage(modifiers)) + { + return ""; + } + else if (AccessFlag.isPrivate(modifiers)) + { + return "private"; + } + else if (AccessFlag.isPublic(modifiers)) + { + return "public"; + } + else if (AccessFlag.isProtected(modifiers)) + { + return "protected"; + } + else + { + throw new RuntimeException("Invalid modifiers: " + modifiers); + } + } +} Copied: kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras (from rev= 901, kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras) Deleted: kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/org.jboss.mc-kernel-extras/pom.xml 2009-1= 1-27 11:53:44 UTC (rev 901) +++ kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/pom.xml 2009-= 11-27 23:21:52 UTC (rev 902) @@ -1,57 +0,0 @@ - - - - 4.0.0 - - - org.exoplatform.kernel - kernel-parent - 2.2.0-Beta04-SNAPSHOT - - - mc-kernel-extras - - MC Kernel 2.2.0 Selected Classes - MC integration classes that aren't available in mc-kernel = 2.0.6.GA - = - - - - - org.jboss.microcontainer - jboss-kernel - - - Added: kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/pom= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/pom.xm= l (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/pom.xm= l 2009-11-27 23:21:52 UTC (rev 902) @@ -0,0 +1,98 @@ + + + 4.0.0 + + + org.exoplatform.kernel.tests + tests-parent + 2.2.0-Beta04-SNAPSHOT + + + exo.kernel.integration-tests + war + + eXo Kernel :: Tests :: Integration Tests + MC Integration Tests + + + + junit + junit + 4.7 + + + org.exoplatform.kernel + exo.kernel.container = + + + org.exoplatform.kernel.demos + exo.kernel.demos.mc-injection + + + + + + + maven-war-plugin + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/ma= in/resources/conf/portal/cache-configuration-template.xml (from rev 902, ke= rnel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/portal/ca= che-configuration-template.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/main/r= esources/conf/portal/cache-configuration-template.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/main/r= esources/conf/portal/cache-configuration-template.xml 2009-11-28 00:05:57 U= TC (rev 903) @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/m= ain/resources/conf/portal/configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/main/resources/conf/por= tal/configuration.xml 2009-11-27 23:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/main/r= esources/conf/portal/configuration.xml 2009-11-28 00:05:57 UTC (rev 903) @@ -1,33 +0,0 @@ - - - - - org.exoplatform.services.cache.ExoCacheFactory - org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl<= /type> - - - cache.config.template - jar:/conf/portal/cache-configuration-template.xml - - - - Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/ma= in/resources/conf/portal/configuration.xml (from rev 902, kernel/trunk/exo.= kernel.component.ext.cache/src/main/resources/conf/portal/configuration.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/main/r= esources/conf/portal/configuration.xml (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/main/r= esources/conf/portal/configuration.xml 2009-11-28 00:05:57 UTC (rev 903) @@ -0,0 +1,33 @@ + + + + + org.exoplatform.services.cache.ExoCacheFactory + org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl<= /type> + + + cache.config.template + jar:/conf/portal/cache-configuration-template.xml + + + + Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st (from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java (from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test= /java) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org (from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/= test/java/org) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform (from rev 902, kernel/trunk/exo.kernel.component.ex= t.cache/src/test/java/org/exoplatform) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services (from rev 902, kernel/trunk/exo.kernel.com= ponent.ext.cache/src/test/java/org/exoplatform/services) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache (from rev 902, kernel/trunk/exo.kern= el.component.ext.cache/src/test/java/org/exoplatform/services/cache) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl (from rev 902, kernel/trunk/exo= .kernel.component.ext.cache/src/test/java/org/exoplatform/services/cache/im= pl) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl/jboss (from rev 902, kernel/tru= nk/exo.kernel.component.ext.cache/src/test/java/org/exoplatform/services/ca= che/impl/jboss) Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestAbstractExoCache.java 2009-11-27 23:21:52 = UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 200= 9-11-28 00:05:57 UTC (rev 903) @@ -1,669 +0,0 @@ -/* - * 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.cache.impl.jboss; - -import org.exoplatform.container.PortalContainer; -import org.exoplatform.services.cache.CacheListener; -import org.exoplatform.services.cache.CacheListenerContext; -import org.exoplatform.services.cache.CacheService; -import org.exoplatform.services.cache.CachedObjectSelector; -import org.exoplatform.services.cache.ExoCache; -import org.exoplatform.services.cache.ExoCacheConfig; -import org.exoplatform.services.cache.ExoCacheFactory; -import org.exoplatform.services.cache.ObjectCacheInfo; -import org.exoplatform.test.BasicTestCase; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Created by The eXo Platform SAS - * Author : eXoPlatform - * exo(a)exoplatform.com - * 21 juil. 2009 = - */ -public class TestAbstractExoCache extends BasicTestCase -{ - - CacheService service; - - AbstractExoCache cache; - - ExoCacheFactory factory; - - public TestAbstractExoCache(String name) - { - super(name); - } - - public void setUp() throws Exception - { - this.service =3D (CacheService)PortalContainer.getInstance().getComp= onentInstanceOfType(CacheService.class); - this.cache =3D (AbstractExoCache)service.getCacheInstance("myCache"); - this.factory =3D (ExoCacheFactory)PortalContainer.getInstance().getC= omponentInstanceOfType(ExoCacheFactory.class); - } - - protected void tearDown() throws Exception - { - cache.clearCache(); - } - - public void testPut() throws Exception - { - cache.put(new MyKey("a"), "a"); - cache.put(new MyKey("b"), "b"); - cache.put(new MyKey("c"), "c"); - assertEquals(3, cache.getCacheSize()); - cache.put(new MyKey("a"), "c"); - assertEquals(3, cache.getCacheSize()); - cache.put(new MyKey("d"), "c"); - assertEquals(4, cache.getCacheSize()); - } - - public void testClearCache() throws Exception - { - cache.put(new MyKey("a"), "a"); - cache.put(new MyKey("b"), "b"); - cache.put(new MyKey("c"), "c"); - assertTrue(cache.getCacheSize() > 0); - cache.clearCache(); - assertTrue(cache.getCacheSize() =3D=3D 0); - } - - public void testGet() throws Exception - { - cache.put(new MyKey("a"), "a"); - assertEquals("a", cache.get(new MyKey("a"))); - cache.put(new MyKey("a"), "c"); - assertEquals("c", cache.get(new MyKey("a"))); - cache.remove(new MyKey("a")); - assertEquals(null, cache.get(new MyKey("a"))); - assertEquals(null, cache.get(new MyKey("x"))); - } - - public void testRemove() throws Exception - { - cache.put(new MyKey("a"), 1); - cache.put(new MyKey("b"), 2); - cache.put(new MyKey("c"), 3); - assertEquals(3, cache.getCacheSize()); - assertEquals(1, cache.remove(new MyKey("a"))); - assertEquals(2, cache.getCacheSize()); - assertEquals(2, cache.remove(new MyKey("b"))); - assertEquals(1, cache.getCacheSize()); - assertEquals(null, cache.remove(new MyKey("x"))); - assertEquals(1, cache.getCacheSize()); - } - - public void testPutMap() throws Exception - { - Map values =3D new HashMap(); - values.put(new MyKey("a"), "a"); - values.put(new MyKey("b"), "b"); - assertEquals(0, cache.getCacheSize()); - cache.putMap(values); - assertEquals(2, cache.getCacheSize()); - values =3D new HashMap() - { - public Set> entrySet() - { - Set> set =3D new LinkedHashSet>(super.entrySet()); - set.add(new Entry() - { - - public Object setValue(Object paramV) - { - return null; - } - - public Object getValue() - { - throw new RuntimeException("An exception"); - } - - public Serializable getKey() - { - return "c"; - } - }); - return set; - } - }; - values.put(new MyKey("e"), "e"); - values.put(new MyKey("d"), "d"); - try - { - cache.putMap(values); - assertTrue("An error was expected", false); - } - catch (Exception e) - { - } - assertEquals(2, cache.getCacheSize()); - } - - public void testGetCachedObjects() throws Exception - { - cache.put(new MyKey("a"), "a"); - cache.put(new MyKey("b"), "b"); - cache.put(new MyKey("c"), "c"); - cache.put(new MyKey("d"), null); - assertEquals(4, cache.getCacheSize()); - List values =3D cache.getCachedObjects(); - assertEquals(3, values.size()); - assertTrue(values.contains("a")); - assertTrue(values.contains("b")); - assertTrue(values.contains("c")); - } - - public void testRemoveCachedObjects() throws Exception - { - cache.put(new MyKey("a"), "a"); - cache.put(new MyKey("b"), "b"); - cache.put(new MyKey("c"), "c"); - cache.put(new MyKey("d"), null); - assertEquals(4, cache.getCacheSize()); - List values =3D cache.removeCachedObjects(); - assertEquals(3, values.size()); - assertTrue(values.contains("a")); - assertTrue(values.contains("b")); - assertTrue(values.contains("c")); - assertEquals(0, cache.getCacheSize()); - } - - public void testSelect() throws Exception - { - cache.put(new MyKey("a"), 1); - cache.put(new MyKey("b"), 2); - cache.put(new MyKey("c"), 3); - final AtomicInteger count =3D new AtomicInteger(); - CachedObjectSelector selector =3D new CachedObjectSelector() - { - - public void onSelect(ExoCache cache, Serializable key, ObjectCach= eInfo ocinfo) throws Exception - { - assertTrue(key.equals(new MyKey("a")) || key.equals(new MyKey(= "b")) || key.equals(new MyKey("c"))); - assertTrue(ocinfo.get().equals(1) || ocinfo.get().equals(2) ||= ocinfo.get().equals(3)); - count.incrementAndGet(); - } - - public boolean select(Serializable key, ObjectCacheInfo ocinfo) - { - return true; - } - }; - cache.select(selector); - assertEquals(3, count.intValue()); - } - - public void testGetHitsNMisses() throws Exception - { - int hits =3D cache.getCacheHit(); - int misses =3D cache.getCacheMiss(); - cache.put(new MyKey("a"), "a"); - cache.get(new MyKey("a")); - cache.remove(new MyKey("a")); - cache.get(new MyKey("a")); - cache.get(new MyKey("z")); - assertEquals(1, cache.getCacheHit() - hits); - assertEquals(2, cache.getCacheMiss() - misses); - } - - public void testDistributedCache() throws Exception - { - ExoCacheConfig config =3D new ExoCacheConfig(); - config.setName("MyCacheDistributed"); - config.setMaxSize(5); - config.setLiveTime(1000); - config.setDistributed(true); - ExoCacheConfig config2 =3D new ExoCacheConfig(); - config2.setName("MyCacheDistributed2"); - config2.setMaxSize(5); - config2.setLiveTime(1000); - config2.setDistributed(true); - AbstractExoCache cache1 =3D (AbstractExoCache)factory.createCache(co= nfig); - MyCacheListener listener1 =3D new MyCacheListener(); - cache1.addCacheListener(listener1); - AbstractExoCache cache2 =3D (AbstractExoCache)factory.createCache(co= nfig); - MyCacheListener listener2 =3D new MyCacheListener(); - cache2.addCacheListener(listener2); - AbstractExoCache cache3 =3D (AbstractExoCache)factory.createCache(co= nfig2); - MyCacheListener listener3 =3D new MyCacheListener(); - cache3.addCacheListener(listener3); - try - { - cache1.put(new MyKey("a"), "b"); - assertEquals(1, cache1.getCacheSize()); - assertEquals("b", cache2.get(new MyKey("a"))); - assertEquals(1, cache2.getCacheSize()); - assertEquals(0, cache3.getCacheSize()); - assertEquals(1, listener1.put); - assertEquals(1, listener2.put); - assertEquals(0, listener3.put); - assertEquals(0, listener1.get); - assertEquals(1, listener2.get); - assertEquals(0, listener3.get); - cache2.put(new MyKey("b"), "c"); - assertEquals(2, cache1.getCacheSize()); - assertEquals(2, cache2.getCacheSize()); - assertEquals("c", cache1.get(new MyKey("b"))); - assertEquals(0, cache3.getCacheSize()); - assertEquals(2, listener1.put); - assertEquals(2, listener2.put); - assertEquals(0, listener3.put); - assertEquals(1, listener1.get); - assertEquals(1, listener2.get); - assertEquals(0, listener3.get); - cache3.put(new MyKey("c"), "d"); - assertEquals(2, cache1.getCacheSize()); - assertEquals(2, cache2.getCacheSize()); - assertEquals(1, cache3.getCacheSize()); - assertEquals("d", cache3.get(new MyKey("c"))); - assertEquals(2, listener1.put); - assertEquals(2, listener2.put); - assertEquals(1, listener3.put); - assertEquals(1, listener1.get); - assertEquals(1, listener2.get); - assertEquals(1, listener3.get); - cache2.put(new MyKey("a"), "a"); - assertEquals(2, cache1.getCacheSize()); - assertEquals(2, cache2.getCacheSize()); - assertEquals("a", cache1.get(new MyKey("a"))); - assertEquals(3, listener1.put); - assertEquals(3, listener2.put); - assertEquals(1, listener3.put); - assertEquals(2, listener1.get); - assertEquals(1, listener2.get); - assertEquals(1, listener3.get); - cache2.remove(new MyKey("a")); - assertEquals(1, cache1.getCacheSize()); - assertEquals(1, cache2.getCacheSize()); - assertEquals(3, listener1.put); - assertEquals(3, listener2.put); - assertEquals(1, listener3.put); - assertEquals(2, listener1.get); - assertEquals(1, listener2.get); - assertEquals(1, listener3.get); - assertEquals(1, listener1.remove); - assertEquals(1, listener2.remove); - assertEquals(0, listener3.remove); - cache1.clearCache(); - assertEquals(0, cache1.getCacheSize()); - assertEquals(null, cache2.get(new MyKey("b"))); - assertEquals(0, cache2.getCacheSize()); - assertEquals(3, listener1.put); - assertEquals(3, listener2.put); - assertEquals(1, listener3.put); - assertEquals(2, listener1.get); - assertEquals(2, listener2.get); - assertEquals(1, listener3.get); - assertEquals(2, listener1.remove); - assertEquals(2, listener2.remove); - assertEquals(0, listener3.remove); - assertEquals(1, listener1.clearCache); - assertEquals(0, listener2.clearCache); - assertEquals(0, listener3.clearCache); - Map values =3D new HashMap(); - values.put(new MyKey("a"), "a"); - values.put(new MyKey("b"), "b"); - cache1.putMap(values); - assertEquals(2, cache1.getCacheSize()); - Thread.sleep(40); - assertEquals("a", cache2.get(new MyKey("a"))); - assertEquals("b", cache2.get(new MyKey("b"))); - assertEquals(2, cache2.getCacheSize()); - assertEquals(5, listener1.put); - assertEquals(5, listener2.put); - assertEquals(1, listener3.put); - assertEquals(2, listener1.get); - assertEquals(4, listener2.get); - assertEquals(1, listener3.get); - assertEquals(2, listener1.remove); - assertEquals(2, listener2.remove); - assertEquals(0, listener3.remove); - assertEquals(1, listener1.clearCache); - assertEquals(0, listener2.clearCache); - assertEquals(0, listener3.clearCache); - values =3D new HashMap() - { - public Set> entrySet() - { - Set> set =3D new LinkedHashSet<= Entry>(super.entrySet()); - set.add(new Entry() - { - - public Object setValue(Object paramV) - { - return null; - } - - public Object getValue() - { - throw new RuntimeException("An exception"); - } - - public Serializable getKey() - { - return "c"; - } - }); - return set; - } - }; - values.put(new MyKey("e"), "e"); - values.put(new MyKey("d"), "d"); - try - { - cache1.putMap(values); - assertTrue("An error was expected", false); - } - catch (Exception e) - { - } - assertEquals(2, cache1.getCacheSize()); - assertEquals(2, cache2.getCacheSize()); - assertEquals(5, listener1.put); - assertEquals(5, listener2.put); - assertEquals(1, listener3.put); - assertEquals(2, listener1.get); - assertEquals(4, listener2.get); - assertEquals(1, listener3.get); - assertEquals(2, listener1.remove); - assertEquals(2, listener2.remove); - assertEquals(0, listener3.remove); - assertEquals(1, listener1.clearCache); - assertEquals(0, listener2.clearCache); - assertEquals(0, listener3.clearCache); - } - finally - { - cache1.cache.stop(); - cache2.cache.stop(); - cache3.cache.stop(); - } - } - - public void testMultiThreading() throws Exception - { - final ExoCache cache =3D service.getCacheInstance("test-multi-thread= ing"); - final int totalElement =3D 100; - final int totalTimes =3D 100; - int reader =3D 20; - int writer =3D 10; - int remover =3D 5; - int cleaner =3D 1; - final CountDownLatch startSignalWriter =3D new CountDownLatch(1); - final CountDownLatch startSignalOthers =3D new CountDownLatch(1); - final CountDownLatch doneSignal =3D new CountDownLatch(reader + writ= er + remover); - final List errors =3D Collections.synchronizedList(new Ar= rayList()); - for (int i =3D 0; i < writer; i++) - { - final int index =3D i; - Thread thread =3D new Thread() - { - public void run() - { - try - { - startSignalWriter.await(); - for (int j =3D 0; j < totalTimes; j++) - { - for (int i =3D 0; i < totalElement; i++) - { - cache.put(new MyKey("key" + i), "value" + i); - } - if (index =3D=3D 0 && j =3D=3D 0) - { - // The cache is full, we can launch the others - startSignalOthers.countDown(); - } - sleep(50); - } - doneSignal.countDown(); - } - catch (Exception e) - { - errors.add(e); - } - } - }; - thread.start(); - } - startSignalWriter.countDown(); - for (int i =3D 0; i < reader; i++) - { - Thread thread =3D new Thread() - { - public void run() - { - try - { - startSignalOthers.await(); - for (int j =3D 0; j < totalTimes; j++) - { - for (int i =3D 0; i < totalElement; i++) - { - cache.get(new MyKey("key" + i)); - } - sleep(50); - } - doneSignal.countDown(); - } - catch (Exception e) - { - errors.add(e); - } - } - }; - thread.start(); - } - for (int i =3D 0; i < remover; i++) - { - Thread thread =3D new Thread() - { - public void run() - { - try - { - startSignalOthers.await(); - for (int j =3D 0; j < totalTimes; j++) - { - for (int i =3D 0; i < totalElement; i++) - { - cache.remove(new MyKey("key" + i)); - } - sleep(50); - } - doneSignal.countDown(); - } - catch (Exception e) - { - errors.add(e); - } - } - }; - thread.start(); - } - doneSignal.await(); - for (int i =3D 0; i < totalElement; i++) - { - cache.put(new MyKey("key" + i), "value" + i); - } - assertEquals(totalElement, cache.getCacheSize()); - final CountDownLatch startSignal =3D new CountDownLatch(1); - final CountDownLatch doneSignal2 =3D new CountDownLatch(writer + cle= aner); - for (int i =3D 0; i < writer; i++) - { - Thread thread =3D new Thread() - { - public void run() - { - try - { - startSignal.await(); - for (int j =3D 0; j < totalTimes; j++) - { - for (int i =3D 0; i < totalElement; i++) - { - cache.put(new MyKey("key" + i), "value" + i); - } - sleep(50); - } - doneSignal2.countDown(); - } - catch (Exception e) - { - errors.add(e); - } - } - }; - thread.start(); - } - for (int i =3D 0; i < cleaner; i++) - { - Thread thread =3D new Thread() - { - public void run() - { - try - { - startSignal.await(); - for (int j =3D 0; j < totalTimes; j++) - { - sleep(150); - cache.clearCache(); - } - doneSignal2.countDown(); - } - catch (Exception e) - { - errors.add(e); - } - } - }; - thread.start(); - } - cache.clearCache(); - assertEquals(0, cache.getCacheSize()); - if (!errors.isEmpty()) - { - for (Exception e : errors) - { - e.printStackTrace(); - } - throw errors.get(0); - } - - } - - public static class MyCacheListener implements CacheListener - { - - public int clearCache; - - public int expire; - - public int get; - - public int put; - - public int remove; - - public void onClearCache(ExoCache cache) throws Exception - { - clearCache++; - } - - public void onExpire(ExoCache cache, Serializable key, Object obj) t= hrows Exception - { - expire++; - } - - public void onGet(ExoCache cache, Serializable key, Object obj) thro= ws Exception - { - get++; - } - - public void onPut(ExoCache cache, Serializable key, Object obj) thro= ws Exception - { - put++; - } - - public void onRemove(ExoCache cache, Serializable key, Object obj) t= hrows Exception - { - remove++; - } - - public void onClearCache(CacheListenerContext context) throws Except= ion - { - clearCache++; - } - - public void onExpire(CacheListenerContext context, Serializable key,= Object obj) throws Exception - { - expire++; - } - - public void onGet(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception - { - get++; - } - - public void onPut(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception - { - put++; - } - - public void onRemove(CacheListenerContext context, Serializable key,= Object obj) throws Exception - { - remove++; - } - } - - public static class MyKey implements Serializable - { - public String value; - - public MyKey(String value) - { - this.value =3D value; - } - - @Override - public boolean equals(Object paramObject) - { - return paramObject instanceof MyKey && ((MyKey)paramObject).value= .endsWith(value); - } - - @Override - public int hashCode() - { - return value.hashCode(); - } - } -} Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java= (from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test/java/o= rg/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 200= 9-11-28 00:05:57 UTC (rev 903) @@ -0,0 +1,669 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CacheListenerContext; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.CachedObjectSelector; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheFactory; +import org.exoplatform.services.cache.ObjectCacheInfo; +import org.exoplatform.test.BasicTestCase; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestAbstractExoCache extends BasicTestCase +{ + + CacheService service; + + AbstractExoCache cache; + + ExoCacheFactory factory; + + public TestAbstractExoCache(String name) + { + super(name); + } + + public void setUp() throws Exception + { + this.service =3D (CacheService)PortalContainer.getInstance().getComp= onentInstanceOfType(CacheService.class); + this.cache =3D (AbstractExoCache)service.getCacheInstance("myCache"); + this.factory =3D (ExoCacheFactory)PortalContainer.getInstance().getC= omponentInstanceOfType(ExoCacheFactory.class); + } + + protected void tearDown() throws Exception + { + cache.clearCache(); + } + + public void testPut() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + assertEquals(3, cache.getCacheSize()); + cache.put(new MyKey("a"), "c"); + assertEquals(3, cache.getCacheSize()); + cache.put(new MyKey("d"), "c"); + assertEquals(4, cache.getCacheSize()); + } + + public void testClearCache() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + assertTrue(cache.getCacheSize() > 0); + cache.clearCache(); + assertTrue(cache.getCacheSize() =3D=3D 0); + } + + public void testGet() throws Exception + { + cache.put(new MyKey("a"), "a"); + assertEquals("a", cache.get(new MyKey("a"))); + cache.put(new MyKey("a"), "c"); + assertEquals("c", cache.get(new MyKey("a"))); + cache.remove(new MyKey("a")); + assertEquals(null, cache.get(new MyKey("a"))); + assertEquals(null, cache.get(new MyKey("x"))); + } + + public void testRemove() throws Exception + { + cache.put(new MyKey("a"), 1); + cache.put(new MyKey("b"), 2); + cache.put(new MyKey("c"), 3); + assertEquals(3, cache.getCacheSize()); + assertEquals(1, cache.remove(new MyKey("a"))); + assertEquals(2, cache.getCacheSize()); + assertEquals(2, cache.remove(new MyKey("b"))); + assertEquals(1, cache.getCacheSize()); + assertEquals(null, cache.remove(new MyKey("x"))); + assertEquals(1, cache.getCacheSize()); + } + + public void testPutMap() throws Exception + { + Map values =3D new HashMap(); + values.put(new MyKey("a"), "a"); + values.put(new MyKey("b"), "b"); + assertEquals(0, cache.getCacheSize()); + cache.putMap(values); + assertEquals(2, cache.getCacheSize()); + values =3D new HashMap() + { + public Set> entrySet() + { + Set> set =3D new LinkedHashSet>(super.entrySet()); + set.add(new Entry() + { + + public Object setValue(Object paramV) + { + return null; + } + + public Object getValue() + { + throw new RuntimeException("An exception"); + } + + public Serializable getKey() + { + return "c"; + } + }); + return set; + } + }; + values.put(new MyKey("e"), "e"); + values.put(new MyKey("d"), "d"); + try + { + cache.putMap(values); + assertTrue("An error was expected", false); + } + catch (Exception e) + { + } + assertEquals(2, cache.getCacheSize()); + } + + public void testGetCachedObjects() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + cache.put(new MyKey("d"), null); + assertEquals(4, cache.getCacheSize()); + List values =3D cache.getCachedObjects(); + assertEquals(3, values.size()); + assertTrue(values.contains("a")); + assertTrue(values.contains("b")); + assertTrue(values.contains("c")); + } + + public void testRemoveCachedObjects() throws Exception + { + cache.put(new MyKey("a"), "a"); + cache.put(new MyKey("b"), "b"); + cache.put(new MyKey("c"), "c"); + cache.put(new MyKey("d"), null); + assertEquals(4, cache.getCacheSize()); + List values =3D cache.removeCachedObjects(); + assertEquals(3, values.size()); + assertTrue(values.contains("a")); + assertTrue(values.contains("b")); + assertTrue(values.contains("c")); + assertEquals(0, cache.getCacheSize()); + } + + public void testSelect() throws Exception + { + cache.put(new MyKey("a"), 1); + cache.put(new MyKey("b"), 2); + cache.put(new MyKey("c"), 3); + final AtomicInteger count =3D new AtomicInteger(); + CachedObjectSelector selector =3D new CachedObjectSelector() + { + + public void onSelect(ExoCache cache, Serializable key, ObjectCach= eInfo ocinfo) throws Exception + { + assertTrue(key.equals(new MyKey("a")) || key.equals(new MyKey(= "b")) || key.equals(new MyKey("c"))); + assertTrue(ocinfo.get().equals(1) || ocinfo.get().equals(2) ||= ocinfo.get().equals(3)); + count.incrementAndGet(); + } + + public boolean select(Serializable key, ObjectCacheInfo ocinfo) + { + return true; + } + }; + cache.select(selector); + assertEquals(3, count.intValue()); + } + + public void testGetHitsNMisses() throws Exception + { + int hits =3D cache.getCacheHit(); + int misses =3D cache.getCacheMiss(); + cache.put(new MyKey("a"), "a"); + cache.get(new MyKey("a")); + cache.remove(new MyKey("a")); + cache.get(new MyKey("a")); + cache.get(new MyKey("z")); + assertEquals(1, cache.getCacheHit() - hits); + assertEquals(2, cache.getCacheMiss() - misses); + } + + public void testDistributedCache() throws Exception + { + ExoCacheConfig config =3D new ExoCacheConfig(); + config.setName("MyCacheDistributed"); + config.setMaxSize(5); + config.setLiveTime(1000); + config.setDistributed(true); + ExoCacheConfig config2 =3D new ExoCacheConfig(); + config2.setName("MyCacheDistributed2"); + config2.setMaxSize(5); + config2.setLiveTime(1000); + config2.setDistributed(true); + AbstractExoCache cache1 =3D (AbstractExoCache)factory.createCache(co= nfig); + MyCacheListener listener1 =3D new MyCacheListener(); + cache1.addCacheListener(listener1); + AbstractExoCache cache2 =3D (AbstractExoCache)factory.createCache(co= nfig); + MyCacheListener listener2 =3D new MyCacheListener(); + cache2.addCacheListener(listener2); + AbstractExoCache cache3 =3D (AbstractExoCache)factory.createCache(co= nfig2); + MyCacheListener listener3 =3D new MyCacheListener(); + cache3.addCacheListener(listener3); + try + { + cache1.put(new MyKey("a"), "b"); + assertEquals(1, cache1.getCacheSize()); + assertEquals("b", cache2.get(new MyKey("a"))); + assertEquals(1, cache2.getCacheSize()); + assertEquals(0, cache3.getCacheSize()); + assertEquals(1, listener1.put); + assertEquals(1, listener2.put); + assertEquals(0, listener3.put); + assertEquals(0, listener1.get); + assertEquals(1, listener2.get); + assertEquals(0, listener3.get); + cache2.put(new MyKey("b"), "c"); + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals("c", cache1.get(new MyKey("b"))); + assertEquals(0, cache3.getCacheSize()); + assertEquals(2, listener1.put); + assertEquals(2, listener2.put); + assertEquals(0, listener3.put); + assertEquals(1, listener1.get); + assertEquals(1, listener2.get); + assertEquals(0, listener3.get); + cache3.put(new MyKey("c"), "d"); + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals(1, cache3.getCacheSize()); + assertEquals("d", cache3.get(new MyKey("c"))); + assertEquals(2, listener1.put); + assertEquals(2, listener2.put); + assertEquals(1, listener3.put); + assertEquals(1, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + cache2.put(new MyKey("a"), "a"); + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals("a", cache1.get(new MyKey("a"))); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + cache2.remove(new MyKey("a")); + assertEquals(1, cache1.getCacheSize()); + assertEquals(1, cache2.getCacheSize()); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + cache1.clearCache(); + assertEquals(0, cache1.getCacheSize()); + assertEquals(null, cache2.get(new MyKey("b"))); + assertEquals(0, cache2.getCacheSize()); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(2, listener2.get); + assertEquals(1, listener3.get); + assertEquals(2, listener1.remove); + assertEquals(2, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + Map values =3D new HashMap(); + values.put(new MyKey("a"), "a"); + values.put(new MyKey("b"), "b"); + cache1.putMap(values); + assertEquals(2, cache1.getCacheSize()); + Thread.sleep(40); + assertEquals("a", cache2.get(new MyKey("a"))); + assertEquals("b", cache2.get(new MyKey("b"))); + assertEquals(2, cache2.getCacheSize()); + assertEquals(5, listener1.put); + assertEquals(5, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(4, listener2.get); + assertEquals(1, listener3.get); + assertEquals(2, listener1.remove); + assertEquals(2, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + values =3D new HashMap() + { + public Set> entrySet() + { + Set> set =3D new LinkedHashSet<= Entry>(super.entrySet()); + set.add(new Entry() + { + + public Object setValue(Object paramV) + { + return null; + } + + public Object getValue() + { + throw new RuntimeException("An exception"); + } + + public Serializable getKey() + { + return "c"; + } + }); + return set; + } + }; + values.put(new MyKey("e"), "e"); + values.put(new MyKey("d"), "d"); + try + { + cache1.putMap(values); + assertTrue("An error was expected", false); + } + catch (Exception e) + { + } + assertEquals(2, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertEquals(5, listener1.put); + assertEquals(5, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(4, listener2.get); + assertEquals(1, listener3.get); + assertEquals(2, listener1.remove); + assertEquals(2, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + } + finally + { + cache1.cache.stop(); + cache2.cache.stop(); + cache3.cache.stop(); + } + } + + public void testMultiThreading() throws Exception + { + final ExoCache cache =3D service.getCacheInstance("test-multi-thread= ing"); + final int totalElement =3D 100; + final int totalTimes =3D 100; + int reader =3D 20; + int writer =3D 10; + int remover =3D 5; + int cleaner =3D 1; + final CountDownLatch startSignalWriter =3D new CountDownLatch(1); + final CountDownLatch startSignalOthers =3D new CountDownLatch(1); + final CountDownLatch doneSignal =3D new CountDownLatch(reader + writ= er + remover); + final List errors =3D Collections.synchronizedList(new Ar= rayList()); + for (int i =3D 0; i < writer; i++) + { + final int index =3D i; + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignalWriter.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.put(new MyKey("key" + i), "value" + i); + } + if (index =3D=3D 0 && j =3D=3D 0) + { + // The cache is full, we can launch the others + startSignalOthers.countDown(); + } + sleep(50); + } + doneSignal.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + startSignalWriter.countDown(); + for (int i =3D 0; i < reader; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignalOthers.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.get(new MyKey("key" + i)); + } + sleep(50); + } + doneSignal.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + for (int i =3D 0; i < remover; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignalOthers.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.remove(new MyKey("key" + i)); + } + sleep(50); + } + doneSignal.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + doneSignal.await(); + for (int i =3D 0; i < totalElement; i++) + { + cache.put(new MyKey("key" + i), "value" + i); + } + assertEquals(totalElement, cache.getCacheSize()); + final CountDownLatch startSignal =3D new CountDownLatch(1); + final CountDownLatch doneSignal2 =3D new CountDownLatch(writer + cle= aner); + for (int i =3D 0; i < writer; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignal.await(); + for (int j =3D 0; j < totalTimes; j++) + { + for (int i =3D 0; i < totalElement; i++) + { + cache.put(new MyKey("key" + i), "value" + i); + } + sleep(50); + } + doneSignal2.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + for (int i =3D 0; i < cleaner; i++) + { + Thread thread =3D new Thread() + { + public void run() + { + try + { + startSignal.await(); + for (int j =3D 0; j < totalTimes; j++) + { + sleep(150); + cache.clearCache(); + } + doneSignal2.countDown(); + } + catch (Exception e) + { + errors.add(e); + } + } + }; + thread.start(); + } + cache.clearCache(); + assertEquals(0, cache.getCacheSize()); + if (!errors.isEmpty()) + { + for (Exception e : errors) + { + e.printStackTrace(); + } + throw errors.get(0); + } + + } + + public static class MyCacheListener implements CacheListener + { + + public int clearCache; + + public int expire; + + public int get; + + public int put; + + public int remove; + + public void onClearCache(ExoCache cache) throws Exception + { + clearCache++; + } + + public void onExpire(ExoCache cache, Serializable key, Object obj) t= hrows Exception + { + expire++; + } + + public void onGet(ExoCache cache, Serializable key, Object obj) thro= ws Exception + { + get++; + } + + public void onPut(ExoCache cache, Serializable key, Object obj) thro= ws Exception + { + put++; + } + + public void onRemove(ExoCache cache, Serializable key, Object obj) t= hrows Exception + { + remove++; + } + + public void onClearCache(CacheListenerContext context) throws Except= ion + { + clearCache++; + } + + public void onExpire(CacheListenerContext context, Serializable key,= Object obj) throws Exception + { + expire++; + } + + public void onGet(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception + { + get++; + } + + public void onPut(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception + { + put++; + } + + public void onRemove(CacheListenerContext context, Serializable key,= Object obj) throws Exception + { + remove++; + } + } + + public static class MyKey implements Serializable + { + public String value; + + public MyKey(String value) + { + this.value =3D value; + } + + @Override + public boolean equals(Object paramObject) + { + return paramObject instanceof MyKey && ((MyKey)paramObject).value= .endsWith(value); + } + + @Override + public int hashCode() + { + return value.hashCode(); + } + } +} Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/java/org/exoplatform/services/cache/impl/jboss/TestExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheConfig.java 2009-11-27 23:21:52 UT= C (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheConfig.java 2009-= 11-28 00:05:57 UTC (rev 903) @@ -1,32 +0,0 @@ -/* - * 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.cache.impl.jboss; - -import org.exoplatform.services.cache.ExoCacheConfig; - -/** - * Created by The eXo Platform SAS - * Author : eXoPlatform - * exo(a)exoplatform.com - * 21 juil. 2009 = - */ -public class TestExoCacheConfig extends ExoCacheConfig -{ - -} Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl/jboss/TestExoCacheConfig.java (= from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org= /exoplatform/services/cache/impl/jboss/TestExoCacheConfig.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheConfig.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheConfig.java 2009-= 11-28 00:05:57 UTC (rev 903) @@ -0,0 +1,32 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.services.cache.ExoCacheConfig; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestExoCacheConfig extends ExoCacheConfig +{ + +} Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/java/org/exoplatform/services/cache/impl/jboss/TestExoCacheCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheCreator.java 2009-11-27 23:21:52 U= TC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheCreator.java 2009= -11-28 00:05:57 UTC (rev 903) @@ -1,217 +0,0 @@ -/* - * 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.cache.impl.jboss; - -import org.exoplatform.services.cache.CacheListener; -import org.exoplatform.services.cache.CachedObjectSelector; -import org.exoplatform.services.cache.ExoCache; -import org.exoplatform.services.cache.ExoCacheConfig; -import org.exoplatform.services.cache.ExoCacheInitException; -import org.jboss.cache.Cache; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -/** - * Created by The eXo Platform SAS - * Author : eXoPlatform - * exo(a)exoplatform.com - * 21 juil. 2009 = - */ -public class TestExoCacheCreator implements ExoCacheCreator -{ - - public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException - { - return new TestExoCache(); - } - - public Class getExpectedConfigType() - { - return TestExoCacheConfig.class; - } - - public String getExpectedImplementation() - { - return "TEST"; - } - - public static class TestExoCache implements ExoCache - { - - public void addCacheListener(CacheListener listener) - { - // TODO Auto-generated method stub - - } - - - public int getCacheHit() - { - // TODO Auto-generated method stub - return 0; - } - - public int getCacheMiss() - { - // TODO Auto-generated method stub - return 0; - } - - public int getCacheSize() - { - // TODO Auto-generated method stub - return 0; - } - - public List getCachedObjects() - { - // TODO Auto-generated method stub - return null; - } - - public String getLabel() - { - // TODO Auto-generated method stub - return null; - } - - public long getLiveTime() - { - // TODO Auto-generated method stub - return 0; - } - - public int getMaxSize() - { - // TODO Auto-generated method stub - return 0; - } - - public String getName() - { - return "name"; - } - - public boolean isDistributed() - { - // TODO Auto-generated method stub - return false; - } - - public boolean isLogEnabled() - { - // TODO Auto-generated method stub - return false; - } - - public boolean isReplicated() - { - // TODO Auto-generated method stub - return false; - } - - - public void select(CachedObjectSelector selector) throws Exception - { - // TODO Auto-generated method stub - - } - - public void setDistributed(boolean b) - { - // TODO Auto-generated method stub - - } - - public void setLabel(String s) - { - // TODO Auto-generated method stub - - } - - public void setLiveTime(long period) - { - // TODO Auto-generated method stub - - } - - public void setLogEnabled(boolean b) - { - // TODO Auto-generated method stub - - } - - public void setMaxSize(int max) - { - // TODO Auto-generated method stub - - } - - public void setName(String name) - { - // TODO Auto-generated method stub - - } - - public void setReplicated(boolean b) - { - // TODO Auto-generated method stub - - } - - public void clearCache() - { - // TODO Auto-generated method stub - = - } - - public Object get(Serializable key) - { - // TODO Auto-generated method stub - return null; - } - - public void put(Serializable key, Object value) throws NullPointerEx= ception - { - // TODO Auto-generated method stub - = - } - - public void putMap(Map objs) throws NullPointerException, IllegalArg= umentException - { - // TODO Auto-generated method stub - = - } - - public Object remove(Serializable key) throws NullPointerException - { - // TODO Auto-generated method stub - return null; - } - - public List removeCachedObjects() - { - // TODO Auto-generated method stub - return null; - } - - } -} Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl/jboss/TestExoCacheCreator.java = (from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test/java/or= g/exoplatform/services/cache/impl/jboss/TestExoCacheCreator.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheCreator.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheCreator.java 2009= -11-28 00:05:57 UTC (rev 903) @@ -0,0 +1,217 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CachedObjectSelector; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ExoCacheConfig; +import org.exoplatform.services.cache.ExoCacheInitException; +import org.jboss.cache.Cache; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestExoCacheCreator implements ExoCacheCreator +{ + + public ExoCache create(ExoCacheConfig config, Cache cache) throws ExoCacheInitException + { + return new TestExoCache(); + } + + public Class getExpectedConfigType() + { + return TestExoCacheConfig.class; + } + + public String getExpectedImplementation() + { + return "TEST"; + } + + public static class TestExoCache implements ExoCache + { + + public void addCacheListener(CacheListener listener) + { + // TODO Auto-generated method stub + + } + + + public int getCacheHit() + { + // TODO Auto-generated method stub + return 0; + } + + public int getCacheMiss() + { + // TODO Auto-generated method stub + return 0; + } + + public int getCacheSize() + { + // TODO Auto-generated method stub + return 0; + } + + public List getCachedObjects() + { + // TODO Auto-generated method stub + return null; + } + + public String getLabel() + { + // TODO Auto-generated method stub + return null; + } + + public long getLiveTime() + { + // TODO Auto-generated method stub + return 0; + } + + public int getMaxSize() + { + // TODO Auto-generated method stub + return 0; + } + + public String getName() + { + return "name"; + } + + public boolean isDistributed() + { + // TODO Auto-generated method stub + return false; + } + + public boolean isLogEnabled() + { + // TODO Auto-generated method stub + return false; + } + + public boolean isReplicated() + { + // TODO Auto-generated method stub + return false; + } + + + public void select(CachedObjectSelector selector) throws Exception + { + // TODO Auto-generated method stub + + } + + public void setDistributed(boolean b) + { + // TODO Auto-generated method stub + + } + + public void setLabel(String s) + { + // TODO Auto-generated method stub + + } + + public void setLiveTime(long period) + { + // TODO Auto-generated method stub + + } + + public void setLogEnabled(boolean b) + { + // TODO Auto-generated method stub + + } + + public void setMaxSize(int max) + { + // TODO Auto-generated method stub + + } + + public void setName(String name) + { + // TODO Auto-generated method stub + + } + + public void setReplicated(boolean b) + { + // TODO Auto-generated method stub + + } + + public void clearCache() + { + // TODO Auto-generated method stub + = + } + + public Object get(Serializable key) + { + // TODO Auto-generated method stub + return null; + } + + public void put(Serializable key, Object value) throws NullPointerEx= ception + { + // TODO Auto-generated method stub + = + } + + public void putMap(Map objs) throws NullPointerException, IllegalArg= umentException + { + // TODO Auto-generated method stub + = + } + + public Object remove(Serializable key) throws NullPointerException + { + // TODO Auto-generated method stub + return null; + } + + public List removeCachedObjects() + { + // TODO Auto-generated method stub + return null; + } + + } +} Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/java/org/exoplatform/services/cache/impl/jboss/TestExoCacheFactoryImpl.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestExoCacheFactoryImpl.java 2009-11-27 23:21:= 52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheFactoryImpl.java = 2009-11-28 00:05:57 UTC (rev 903) @@ -1,79 +0,0 @@ -/* - * 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.cache.impl.jboss; - -import org.exoplatform.container.PortalContainer; -import org.exoplatform.services.cache.CacheService; -import org.exoplatform.services.cache.ExoCache; -import org.exoplatform.services.cache.impl.jboss.TestExoCacheCreator.TestE= xoCache; -import org.exoplatform.test.BasicTestCase; -import org.jboss.cache.config.Configuration.CacheMode; - -/** - * Created by The eXo Platform SAS - * Author : eXoPlatform - * exo(a)exoplatform.com - * 20 juil. 2009 = - */ -public class TestExoCacheFactoryImpl extends BasicTestCase -{ - - CacheService service_; - - public TestExoCacheFactoryImpl(String name) - { - super(name); - } - - public void setUp() throws Exception - { - service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); - } - - public void testCacheFactory() - { - ExoCache cache =3D service_.getCacheInstance("myCache"); - assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); - AbstractExoCache aCache =3D (AbstractExoCache)cache; - assertTrue("expect a local cache", aCache.cache.getConfiguration().g= etCacheMode() =3D=3D CacheMode.LOCAL); - aCache.cache.stop(); - cache =3D service_.getCacheInstance("cacheDistributed"); - assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); - aCache =3D (AbstractExoCache)cache; - assertTrue("expect a distributed cache", aCache.cache.getConfigurati= on().getCacheMode() =3D=3D CacheMode.REPL_SYNC); - aCache.cache.stop(); - cache =3D service_.getCacheInstance("myCustomCache"); - assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); - aCache =3D (AbstractExoCache)cache; - assertTrue("expect a distributed cache", aCache.cache.getConfigurati= on().getCacheMode() =3D=3D CacheMode.REPL_SYNC); - aCache.cache.stop(); - } - - public void testExoCacheCreator() - { - ExoCache cache =3D service_.getCacheInstance("test-default-impl"); - assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); - AbstractExoCache aCache =3D (AbstractExoCache)cache; - aCache.cache.stop(); - cache =3D service_.getCacheInstance("test-custom-impl-with-old-confi= g"); - assertTrue("expect an instance of TestExoCache", cache instanceof Te= stExoCache); - cache =3D service_.getCacheInstance("test-custom-impl-with-new-confi= g"); - assertTrue("expect an instance of TestExoCache", cache instanceof Te= stExoCache); - } -} Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl/jboss/TestExoCacheFactoryImpl.j= ava (from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test/jav= a/org/exoplatform/services/cache/impl/jboss/TestExoCacheFactoryImpl.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheFactoryImpl.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestExoCacheFactoryImpl.java = 2009-11-28 00:05:57 UTC (rev 903) @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.impl.jboss.TestExoCacheCreator.TestE= xoCache; +import org.exoplatform.test.BasicTestCase; +import org.jboss.cache.config.Configuration.CacheMode; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 20 juil. 2009 = + */ +public class TestExoCacheFactoryImpl extends BasicTestCase +{ + + CacheService service_; + + public TestExoCacheFactoryImpl(String name) + { + super(name); + } + + public void setUp() throws Exception + { + service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); + } + + public void testCacheFactory() + { + ExoCache cache =3D service_.getCacheInstance("myCache"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + AbstractExoCache aCache =3D (AbstractExoCache)cache; + assertTrue("expect a local cache", aCache.cache.getConfiguration().g= etCacheMode() =3D=3D CacheMode.LOCAL); + aCache.cache.stop(); + cache =3D service_.getCacheInstance("cacheDistributed"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + aCache =3D (AbstractExoCache)cache; + assertTrue("expect a distributed cache", aCache.cache.getConfigurati= on().getCacheMode() =3D=3D CacheMode.REPL_SYNC); + aCache.cache.stop(); + cache =3D service_.getCacheInstance("myCustomCache"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + aCache =3D (AbstractExoCache)cache; + assertTrue("expect a distributed cache", aCache.cache.getConfigurati= on().getCacheMode() =3D=3D CacheMode.REPL_SYNC); + aCache.cache.stop(); + } + + public void testExoCacheCreator() + { + ExoCache cache =3D service_.getCacheInstance("test-default-impl"); + assertTrue("expect an instance of AbstractExoCache", cache instanceo= f AbstractExoCache); + AbstractExoCache aCache =3D (AbstractExoCache)cache; + aCache.cache.stop(); + cache =3D service_.getCacheInstance("test-custom-impl-with-old-confi= g"); + assertTrue("expect an instance of TestExoCache", cache instanceof Te= stExoCache); + cache =3D service_.getCacheInstance("test-custom-impl-with-new-confi= g"); + assertTrue("expect an instance of TestExoCache", cache instanceof Te= stExoCache); + } +} Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/java/org/exoplatform/services/cache/impl/jboss/TestFIFOCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestFIFOCache.java 2009-11-27 23:21:52 UTC (re= v 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestFIFOCache.java 2009-11-28= 00:05:57 UTC (rev 903) @@ -1,85 +0,0 @@ -/* - * 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.cache.impl.jboss; - -import org.exoplatform.container.PortalContainer; -import org.exoplatform.services.cache.CacheService; -import org.exoplatform.services.cache.ExoCache; -import org.exoplatform.test.BasicTestCase; - -/** - * Created by The eXo Platform SAS - * Author : eXoPlatform - * exo(a)exoplatform.com - * 21 juil. 2009 = - */ -public class TestFIFOCache extends BasicTestCase -{ - - CacheService service_; - - public TestFIFOCache(String name) - { - super(name); - } - - public void setUp() throws Exception - { - service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); - } - - public void testPolicy() throws Exception - { - testPolicy("test-fifo"); - testPolicy("test-fifo-with-old-config"); - } - - private void testPolicy(String cacheName) throws Exception - { - ExoCache cache =3D service_.getCacheInstance(cacheName); - cache.put("a", "a"); - cache.put("b", "a"); - cache.put("c", "a"); - cache.put("d", "a"); - assertEquals(4, cache.getCacheSize()); - cache.put("e", "a"); - assertEquals(5, cache.getCacheSize()); - cache.put("f", "a"); - assertEquals(6, cache.getCacheSize()); - Thread.sleep(500); - assertEquals(6, cache.getCacheSize()); - Thread.sleep(600); - assertEquals(5, cache.getCacheSize()); - cache.setMaxSize(3); - cache.setLiveTime(1500); - cache.put("g", "a"); - assertEquals(6, cache.getCacheSize()); - Thread.sleep(1100); - assertEquals(3, cache.getCacheSize()); - cache.put("h", "a"); - cache.put("i", "a"); - cache.put("j", "a"); - cache.put("k", "a"); - assertEquals(7, cache.getCacheSize()); - Thread.sleep(500); - assertEquals(4, cache.getCacheSize()); - Thread.sleep(1100); - assertEquals(3, cache.getCacheSize()); - } -} Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl/jboss/TestFIFOCache.java (from = rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exop= latform/services/cache/impl/jboss/TestFIFOCache.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestFIFOCache.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestFIFOCache.java 2009-11-28= 00:05:57 UTC (rev 903) @@ -0,0 +1,85 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.test.BasicTestCase; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestFIFOCache extends BasicTestCase +{ + + CacheService service_; + + public TestFIFOCache(String name) + { + super(name); + } + + public void setUp() throws Exception + { + service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); + } + + public void testPolicy() throws Exception + { + testPolicy("test-fifo"); + testPolicy("test-fifo-with-old-config"); + } + + private void testPolicy(String cacheName) throws Exception + { + ExoCache cache =3D service_.getCacheInstance(cacheName); + cache.put("a", "a"); + cache.put("b", "a"); + cache.put("c", "a"); + cache.put("d", "a"); + assertEquals(4, cache.getCacheSize()); + cache.put("e", "a"); + assertEquals(5, cache.getCacheSize()); + cache.put("f", "a"); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(500); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(600); + assertEquals(5, cache.getCacheSize()); + cache.setMaxSize(3); + cache.setLiveTime(1500); + cache.put("g", "a"); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(1100); + assertEquals(3, cache.getCacheSize()); + cache.put("h", "a"); + cache.put("i", "a"); + cache.put("j", "a"); + cache.put("k", "a"); + assertEquals(7, cache.getCacheSize()); + Thread.sleep(500); + assertEquals(4, cache.getCacheSize()); + Thread.sleep(1100); + assertEquals(3, cache.getCacheSize()); + } +} Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/java/org/exoplatform/services/cache/impl/jboss/TestLRUCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exoplatfo= rm/services/cache/impl/jboss/TestLRUCache.java 2009-11-27 23:21:52 UTC (rev= 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestLRUCache.java 2009-11-28 = 00:05:57 UTC (rev 903) @@ -1,91 +0,0 @@ -/* - * 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.cache.impl.jboss; - -import org.exoplatform.container.PortalContainer; -import org.exoplatform.services.cache.CacheService; -import org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator.LR= UExoCache; -import org.exoplatform.test.BasicTestCase; - -/** - * Created by The eXo Platform SAS - * Author : eXoPlatform - * exo(a)exoplatform.com - * 21 juil. 2009 = - */ -public class TestLRUCache extends BasicTestCase -{ - - CacheService service_; - - public TestLRUCache(String name) - { - super(name); - } - - public void setUp() throws Exception - { - service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); - } - - public void testPolicy() throws Exception - { - testPolicy("test-lru"); - testPolicy("test-lru-with-old-config"); - } - - private void testPolicy(String cacheName) throws Exception - { - LRUExoCache cache =3D (LRUExoCache)service_.getCacheInstance(cacheNa= me); - cache.put("a", "a"); - cache.put("b", "a"); - cache.put("c", "a"); - cache.put("d", "a"); - assertEquals(4, cache.getCacheSize()); - cache.put("e", "a"); - assertEquals(5, cache.getCacheSize()); - cache.put("f", "a"); - assertEquals(6, cache.getCacheSize()); - Thread.sleep(1000); - assertFalse(cache.get("b") =3D=3D null); - assertFalse(cache.get("c") =3D=3D null); - assertFalse(cache.get("d") =3D=3D null); - Thread.sleep(600); - assertEquals(3, cache.getCacheSize()); - Thread.sleep(500); - assertEquals(0, cache.getCacheSize()); - cache.setMaxSize(3); - cache.setTimeToLive(500); - cache.setMaxAge(1000); - cache.put("a", "a"); - cache.put("b", "a"); - cache.put("c", "a"); - cache.put("d", "a"); - assertEquals(4, cache.getCacheSize()); - cache.put("e", "a"); - assertEquals(5, cache.getCacheSize()); - cache.put("f", "a"); - Thread.sleep(500); - cache.get("a"); - cache.get("b"); - assertEquals(3, cache.getCacheSize()); - Thread.sleep(600); - assertEquals(0, cache.getCacheSize()); - } -} Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/java/org/exoplatform/services/cache/impl/jboss/TestLRUCache.java (from r= ev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test/java/org/exopl= atform/services/cache/impl/jboss/TestLRUCache.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestLRUCache.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/j= ava/org/exoplatform/services/cache/impl/jboss/TestLRUCache.java 2009-11-28 = 00:05:57 UTC (rev 903) @@ -0,0 +1,91 @@ +/* + * 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.cache.impl.jboss; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.services.cache.CacheService; +import org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator.LR= UExoCache; +import org.exoplatform.test.BasicTestCase; + +/** + * Created by The eXo Platform SAS + * Author : eXoPlatform + * exo(a)exoplatform.com + * 21 juil. 2009 = + */ +public class TestLRUCache extends BasicTestCase +{ + + CacheService service_; + + public TestLRUCache(String name) + { + super(name); + } + + public void setUp() throws Exception + { + service_ =3D (CacheService)PortalContainer.getInstance().getComponen= tInstanceOfType(CacheService.class); + } + + public void testPolicy() throws Exception + { + testPolicy("test-lru"); + testPolicy("test-lru-with-old-config"); + } + + private void testPolicy(String cacheName) throws Exception + { + LRUExoCache cache =3D (LRUExoCache)service_.getCacheInstance(cacheNa= me); + cache.put("a", "a"); + cache.put("b", "a"); + cache.put("c", "a"); + cache.put("d", "a"); + assertEquals(4, cache.getCacheSize()); + cache.put("e", "a"); + assertEquals(5, cache.getCacheSize()); + cache.put("f", "a"); + assertEquals(6, cache.getCacheSize()); + Thread.sleep(1000); + assertFalse(cache.get("b") =3D=3D null); + assertFalse(cache.get("c") =3D=3D null); + assertFalse(cache.get("d") =3D=3D null); + Thread.sleep(600); + assertEquals(3, cache.getCacheSize()); + Thread.sleep(500); + assertEquals(0, cache.getCacheSize()); + cache.setMaxSize(3); + cache.setTimeToLive(500); + cache.setMaxAge(1000); + cache.put("a", "a"); + cache.put("b", "a"); + cache.put("c", "a"); + cache.put("d", "a"); + assertEquals(4, cache.getCacheSize()); + cache.put("e", "a"); + assertEquals(5, cache.getCacheSize()); + cache.put("f", "a"); + Thread.sleep(500); + cache.get("a"); + cache.get("b"); + assertEquals(3, cache.getCacheSize()); + Thread.sleep(600); + assertEquals(0, cache.getCacheSize()); + } +} Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/resources (from rev 902, kernel/trunk/exo.kernel.component.ext.cache/src= /test/resources) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/resources/conf (from rev 902, kernel/trunk/exo.kernel.component.ext.cach= e/src/test/resources/conf) Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/resources/conf/portal (from rev 902, kernel/trunk/exo.kernel.component.e= xt.cache/src/test/resources/conf/portal) Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/resources/conf/portal/cache-configuration-template.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/cache-configuration-template.xml 2009-11-27 23:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/cache-configuration-template.xml 2009-11-28 00:05:57 U= TC (rev 903) @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/resources/conf/portal/cache-configuration-template.xml (from rev 902, ke= rnel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/portal/ca= che-configuration-template.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/cache-configuration-template.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/cache-configuration-template.xml 2009-11-28 00:05:57 U= TC (rev 903) @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/resources/conf/portal/distributed-cache-configuration-template.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/distributed-cache-configuration-template.xml 2009-11-27 23:21:52 UTC (r= ev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/distributed-cache-configuration-template.xml 2009-11-2= 8 00:05:57 UTC (rev 903) @@ -1,193 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - - - Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/resources/conf/portal/distributed-cache-configuration-template.xml (from= rev 902, kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/co= nf/portal/distributed-cache-configuration-template.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/distributed-cache-configuration-template.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/distributed-cache-configuration-template.xml 2009-11-2= 8 00:05:57 UTC (rev 903) @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + Deleted: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/t= est/resources/conf/portal/test-configuration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache/src/test/resources/conf/por= tal/test-configuration.xml 2009-11-27 23:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/test-configuration.xml 2009-11-28 00:05:57 UTC (rev 90= 3) @@ -1,180 +0,0 @@ - - - - = - - org.exoplatform.services.cache.CacheService - org.exoplatform.services.cache.impl.CacheServiceImpl - - - - cache.config.default - The default cache configuration - - default - 5 - 2 - - - - test-multi-threading - The default cache configuration - - test-multi-threading - -1 - 0 - = - = - - cacheDistributed - The default cache configuration - - cacheDistributed - 5 - 2 - true - - = - - test-default-impl - The default cache configuration - - test-default-impl - 5 - 2 - - = - - test-custom-impl-with-old-config - The default cache configuration - - test-custom-impl-with-old-config - 5 - 2 - TEST - - = - - test-custom-impl-with-new-config - The default cache configuration - - test-custom-impl-with-new-config - 5 - 2 - - - - test-fifo-with-old-config - The default cache configuration - - test-fifo-with-old-config<= /field> - 5 - 1 - FIFO - - = - - test-fifo - The default cache configuration - - test-fifo - 5 - 1000 - - = - - test-lru-with-old-config - The default cache configuration - - test-lru-with-old-config - 5 - 1 - LRU - - = - - test-lru - The default cache configuration - - test-lru - 5 - 1000 - 2000 - 1500 - - = - = - = - = - - org.exoplatform.services.cache.ExoCacheFactory - org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl - - - cache.config.template - jar:/conf/portal/cache-configuration-template.xml - - - = - = - - org.exoplatform.services.cache.ExoCacheFactory - - addConfig - addConfig - org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryConfi= gPlugin - add Custom Configurations - = - - myCustomCache - jar:/conf/portal/distributed-cache-configuration-template.= xml - = - = - = - - addCreator - addCreator - org.exoplatform.services.cache.impl.jboss.ExoCacheCreatorPlugi= n - add Exo Cache Creator - = - - Test - The cache creator for testing purpose - - = - - FIFO - The fifo cache creator - - - - LRU - The lru cache creator - - 1500 - 2000 = - - = - = - - = - Copied: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/te= st/resources/conf/portal/test-configuration.xml (from rev 902, kernel/trunk= /exo.kernel.component.ext.cache/src/test/resources/conf/portal/test-configu= ration.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/test-configuration.xml (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache/src/test/r= esources/conf/portal/test-configuration.xml 2009-11-28 00:05:57 UTC (rev 90= 3) @@ -0,0 +1,180 @@ + + + + = + + org.exoplatform.services.cache.CacheService + org.exoplatform.services.cache.impl.CacheServiceImpl + + + + cache.config.default + The default cache configuration + + default + 5 + 2 + + + + test-multi-threading + The default cache configuration + + test-multi-threading + -1 + 0 + = + = + + cacheDistributed + The default cache configuration + + cacheDistributed + 5 + 2 + true + + = + + test-default-impl + The default cache configuration + + test-default-impl + 5 + 2 + + = + + test-custom-impl-with-old-config + The default cache configuration + + test-custom-impl-with-old-config + 5 + 2 + TEST + + = + + test-custom-impl-with-new-config + The default cache configuration + + test-custom-impl-with-new-config + 5 + 2 + + + + test-fifo-with-old-config + The default cache configuration + + test-fifo-with-old-config<= /field> + 5 + 1 + FIFO + + = + + test-fifo + The default cache configuration + + test-fifo + 5 + 1000 + + = + + test-lru-with-old-config + The default cache configuration + + test-lru-with-old-config + 5 + 1 + LRU + + = + + test-lru + The default cache configuration + + test-lru + 5 + 1000 + 2000 + 1500 + + = + = + = + = + + org.exoplatform.services.cache.ExoCacheFactory + org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryImpl + + + cache.config.template + jar:/conf/portal/cache-configuration-template.xml + + + = + = + + org.exoplatform.services.cache.ExoCacheFactory + + addConfig + addConfig + org.exoplatform.services.cache.impl.jboss.ExoCacheFactoryConfi= gPlugin + add Custom Configurations + = + + myCustomCache + jar:/conf/portal/distributed-cache-configuration-template.= xml + = + = + = + + addCreator + addCreator + org.exoplatform.services.cache.impl.jboss.ExoCacheCreatorPlugi= n + add Exo Cache Creator + = + + Test + The cache creator for testing purpose + + = + + FIFO + The fifo cache creator + + + + LRU + The lru cache creator + + 1500 + 2000 = + + = + = + + = + Modified: kernel/branches/mc-int-branch/exo.kernel.component.remote/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.component.remote/pom.xml 2009-= 11-27 23:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.component.remote/pom.xml 2009-= 11-28 00:05:57 UTC (rev 903) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = exo.kernel.component.remote @@ -35,13 +35,20 @@ = + org.exoplatform.tool + exo.tool.framework.junit + + org.exoplatform.kernel - exo.kernel.component.common + exo.kernel.commons - - jgroups - jgroups - + org.exoplatform.kernel + exo.kernel.container + = + + jgroups + jgroups + Modified: kernel/branches/mc-int-branch/exo.kernel.container/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-27 2= 3:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.container/pom.xml 2009-11-28 0= 0:05:57 UTC (rev 903) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = exo.kernel.container @@ -38,28 +38,23 @@ org.exoplatform.kernel exo.kernel.commons - org.exoplatform.tool exo.tool.framework.junit compile - javax.servlet servlet-api - picocontainer picocontainer - commons-beanutils commons-beanutils - org.jibx jibx-run @@ -70,7 +65,6 @@ - org.jibx jibx-bind @@ -81,12 +75,15 @@ - org.jibx jibx-extras - = + + xpp3 + xpp3 + 1.1.3.4.O + = @@ -120,4 +117,4 @@ --> - + \ No newline at end of file Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml 200= 9-11-27 23:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/pom.xml 200= 9-11-28 00:05:57 UTC (rev 903) @@ -5,7 +5,7 @@ org.exoplatform.kernel.demos demos-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = exo.kernel.demos.mc-injection Modified: kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml 2009-11-27 23:21= :52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.demos/pom.xml 2009-11-28 00:05= :57 UTC (rev 903) @@ -5,7 +5,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = org.exoplatform.kernel.demos Modified: kernel/branches/mc-int-branch/exo.kernel.mc-int/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-int/pom.xml 2009-11-27 23:2= 1:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.mc-int/pom.xml 2009-11-28 00:0= 5:57 UTC (rev 903) @@ -6,7 +6,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = exo.kernel.mc-int @@ -19,51 +19,41 @@ org.exoplatform.kernel exo.kernel.commons - org.exoplatform.kernel exo.kernel.container - javax.servlet servlet-api - = picocontainer picocontainer - org.jboss.microcontainer jboss-kernel - org.jboss.microcontainer jboss-aop-mc-int - org.jboss.mc-int jboss-mc-int-common - org.jboss.mc-int jboss-mc-int-servlet - org.jboss.cl jboss-classloader - org.exoplatform.kernel exo.kernel.mc-kernel-extras - = Added: kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/pom.xml = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/pom.xml 2009-= 11-28 00:05:57 UTC (rev 903) @@ -0,0 +1,23 @@ + + + + 4.0.0 + + + org.exoplatform.kernel + kernel-parent + 2.2.0-Beta05-SNAPSHOT + + + exo.kernel.mc-kernel-extras + + eXo Kernel :: MC Kernel Extras + MC Kernel 2.2.0 classes that aren't available in mc-kernel= 2.0.6.GA + + + + org.jboss.microcontainer + jboss-kernel + + + Added: kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/src/main/j= ava/org/jboss/dependency/plugins/helpers/StatelessController.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/src/main/java= /org/jboss/dependency/plugins/helpers/StatelessController.java = (rev 0) +++ kernel/branches/mc-int-branch/exo.kernel.mc-kernel-extras/src/main/java= /org/jboss/dependency/plugins/helpers/StatelessController.java 2009-11-28 0= 0:05:57 UTC (rev 903) @@ -0,0 +1,167 @@ +/* +* JBoss, Home of Professional Open Source +* Copyright 2005, JBoss Inc., and individual contributors as indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* 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.jboss.dependency.plugins.helpers; + +import org.jboss.beans.metadata.spi.BeanMetaData; +import org.jboss.dependency.spi.Controller; +import org.jboss.dependency.spi.ControllerContext; +import org.jboss.dependency.spi.ControllerState; +import org.jboss.dependency.plugins.AbstractController; +import org.jboss.kernel.Kernel; +import org.jboss.kernel.spi.dependency.KernelController; +import org.jboss.kernel.spi.dependency.KernelControllerContext; +import org.jboss.kernel.spi.event.KernelEvent; +import org.jboss.kernel.spi.event.KernelEventFilter; +import org.jboss.kernel.spi.event.KernelEventListener; + +import java.util.Set; + +/** + * Stateless controller. + * + * @author Ales Justin + */ +public class StatelessController extends AbstractController implements Ker= nelController +{ + private KernelController controller; + + public StatelessController(KernelController controller) + { + if (controller =3D=3D null) + throw new IllegalArgumentException("Null controller"); + + this.controller =3D controller; + for (ControllerState state : controller.getStates()) + addState(state, null); + } + + public void enableOnDemand(ControllerContext context) throws Throwable + { + // ignore + } + + @Override + protected void registerControllerContext(ControllerContext context) + { + // do nothing + } + + @Override + public void install(ControllerContext context) throws Throwable + { + super.install(context); + } + + public ControllerContext uninstall(Object name) + { + return null; + } + + public ControllerContext getContext(Object name, ControllerState state) + { + return controller.getContext(name, state); + } + + public ControllerContext getInstalledContext(Object name) + { + return controller.getInstalledContext(name); + } + + public boolean isShutdown() + { + return controller.isShutdown(); + } + + public void shutdown() + { + } + + public Kernel getKernel() + { + return controller.getKernel(); + } + + public void setKernel(Kernel kernel) throws Throwable + { + controller.setKernel(kernel); + } + + public KernelControllerContext install(BeanMetaData metaData) throws Th= rowable + { + return controller.install(metaData); + } + + public KernelControllerContext install(BeanMetaData metaData, Object ta= rget) throws Throwable + { + return controller.install(metaData, target); + } + + public void addSupplies(KernelControllerContext context) + { + controller.addSupplies(context); + } + + public void removeSupplies(KernelControllerContext context) + { + controller.removeSupplies(context); + } + + public Set getInstantiatedContexts(Class cl= azz) + { + return controller.getInstantiatedContexts(clazz); + } + + public Set getContexts(Class clazz, Control= lerState state) + { + return controller.getContexts(clazz, state); + } + + public KernelControllerContext getContextByClass(Class clazz) + { + return controller.getContextByClass(clazz); + } + + public void addInstantiatedContext(KernelControllerContext context) + { + controller.addInstantiatedContext(context); + } + + public void removeInstantiatedContext(KernelControllerContext context) + { + controller.removeInstantiatedContext(context); + } + + public void registerListener(KernelEventListener listener, KernelEventF= ilter filter, Object handback) throws Throwable + { + controller.registerListener(listener, filter, handback); + } + + public void unregisterListener(KernelEventListener listener, KernelEven= tFilter filter, Object handback) throws Throwable + { + controller.unregisterListener(listener, filter, handback); + } + + public void fireKernelEvent(KernelEvent event) + { + controller.fireKernelEvent(event); + } +} \ No newline at end of file Modified: kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/= pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/pom.xm= l 2009-11-27 23:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.tests/integration-tests/pom.xm= l 2009-11-28 00:05:57 UTC (rev 903) @@ -5,7 +5,7 @@ org.exoplatform.kernel.tests tests-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = exo.kernel.integration-tests Modified: kernel/branches/mc-int-branch/exo.kernel.tests/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.tests/pom.xml 2009-11-27 23:21= :52 UTC (rev 902) +++ kernel/branches/mc-int-branch/exo.kernel.tests/pom.xml 2009-11-28 00:05= :57 UTC (rev 903) @@ -5,7 +5,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = org.exoplatform.kernel.tests Modified: kernel/branches/mc-int-branch/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/packaging/module/pom.xml 2009-11-27 23:21= :52 UTC (rev 902) +++ kernel/branches/mc-int-branch/packaging/module/pom.xml 2009-11-28 00:05= :57 UTC (rev 903) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT = 4.0.0 Modified: kernel/branches/mc-int-branch/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/pom.xml 2009-11-27 23:21:52 UTC (rev 902) +++ kernel/branches/mc-int-branch/pom.xml 2009-11-28 00:05:57 UTC (rev 903) @@ -18,7 +18,8 @@ 02110-1301 USA, or see the FSF site: http://www.fsf.org. = --> - + = 4.0.0 = @@ -30,7 +31,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.0-Beta04-SNAPSHOT + 2.2.0-Beta05-SNAPSHOT pom = eXo Kernel @@ -56,222 +57,213 @@ exo.kernel.component.common exo.kernel.component.remote exo.kernel.component.cache + exo.kernel.component.command exo.kernel.mc-int exo.kernel.mc-kernel-extras exo.kernel.demos - exo.kernel.tests = + exo.kernel.tests packaging/module = - + org.exoplatform.tool + exo.tool.framework.junit + 1.2.0 + + org.exoplatform.kernel exo.kernel.container ${project.version} - org.exoplatform.kernel exo.kernel.commons ${project.version} - org.exoplatform.kernel - exo.kernel.component.common + exo.kernel.component.remote ${project.version} - org.exoplatform.kernel - exo.kernel.component.remote + exo.kernel.component.cache ${project.version} - org.exoplatform.kernel exo.kernel.mc-int ${project.version} - = org.exoplatform.kernel exo.kernel.mc-kernel-extras ${project.version} - org.exoplatform.kernel.demos exo.kernel.demos.mc-injection ${project.version} - org.exoplatform.tool exo.tool.framework.junit 1.2.0 - commons-lang commons-lang 2.3 - commons-chain commons-chain 1.0 - xpp3 xpp3 1.1.3.4.O - commons-logging commons-logging 1.0.4 - - jgroups - jgroups - 2.6.10.GA + commons-beanutils + commons-beanutils + 1.6 - + commons-chain + commons-chain + 1.0 + + + commons-digester + commons-digester + 1.6 + + org.slf4j slf4j-api 1.5.6 - org.slf4j slf4j-log4j12 1.5.6 - log4j log4j 1.2.14 - - picocontainer - picocontainer - 1.1 + xml-apis + xml-apis + 1.0.b2 - - commons-beanutils - commons-beanutils - 1.6 + quartz + quartz + 1.5.0-RC2 - - org.jibx - jibx-run - ${jibx.plugin.version} + javax.mail + mail + 1.4 - - org.jibx - jibx-bind - ${jibx.plugin.version} - - - - org.jibx - jibx-extras - ${jibx.plugin.version} - - - javax.activation activation 1.1 - javax.resource connector-api 1.5 - - jotm - jotm - 2.0.10 + javax.transaction + jta + 1.0.1B - - quartz - quartz - 1.5.0-RC2 + picocontainer + picocontainer + 1.1 - - javax.mail - mail - 1.4 - - - javax.servlet servlet-api 2.5 provided - - javax.transaction - jta - 1.0.1B + jgroups + jgroups + 2.6.12.GA - org.jboss.microcontainer jboss-dependency ${org.jboss.mc} - org.jboss.microcontainer jboss-kernel ${org.jboss.mc} - org.jboss.microcontainer jboss-aop-mc-int ${org.jboss.mc} - org.jboss.mc-int jboss-mc-int-common ${org.jboss.mc-int} - org.jboss.mc-int jboss-mc-int-servlet ${org.jboss.mc-int} - - - org.jboss.cl - jboss-classloader - ${version.jboss.classloader} - - + + org.jboss.cl + jboss-classloader + ${version.jboss.classloader} + + + org.jboss.cache + jbosscache-core + 3.2.0.GA + + + org.jibx + jibx-bind + ${jibx.plugin.version} + + + org.jibx + jibx-extras + ${jibx.plugin.version} + + + org.jibx + jibx-run + ${jibx.plugin.version} + + + jotm + jotm + 2.0.10 + = --===============2099929353970000295==-- From do-not-reply at jboss.org Sat Nov 28 16:33:31 2009 Content-Type: multipart/mixed; boundary="===============8069619431308935393==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r904 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query. Date: Sat, 28 Nov 2009 16:33:31 -0500 Message-ID: <200911282133.nASLXVlZ027864@svn01.web.mwc.hst.phx2.redhat.com> --===============8069619431308935393== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: skabashnyuk Date: 2009-11-28 16:33:31 -0500 (Sat, 28 Nov 2009) New Revision: 904 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/core/query/SystemSearchManager.java Log: EXOJCR-241: fixed indexing of the jcr:system. Now all test pass Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/SystemSearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-28 00:05:57 UTC= (rev 903) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SystemSearchManager.java 2009-11-28 21:33:31 UTC= (rev 904) @@ -30,6 +30,7 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; +import org.jboss.cache.commands.WriteCommand; = import java.util.ArrayList; import java.util.List; @@ -61,12 +62,17 @@ */ private List changesLogBuffer =3D new ArrayList(); = + /** + * ChangesLog Buffer (used for saves before start). + */ + private List> writeCommandBuffer =3D new ArrayList>(); + public static final String INDEX_DIR_SUFFIX =3D "system"; = public SystemSearchManager(QueryHandlerEntry config, NamespaceRegistryI= mpl nsReg, NodeTypeDataManager ntReg, WorkspacePersistentDataManager itemMgr, DocumentReaderService servic= e, ConfigurationManager cfm, - RepositoryIndexSearcherHolder indexSearcherHolder, IndexerIntercepto= r indexInterceptor) throws RepositoryException, - RepositoryConfigurationException + RepositoryIndexSearcherHolder indexSearcherHolder, IndexerIntercepto= r indexInterceptor) + throws RepositoryException, RepositoryConfigurationException { super(config, nsReg, ntReg, itemMgr, null, service, cfm, indexSearch= erHolder, indexInterceptor); } @@ -107,24 +113,50 @@ { log.error(e.getLocalizedMessage()); handler =3D null; - changesLogBuffer.clear(); - changesLogBuffer =3D null; + freeBuffers(); throw new RuntimeException(e); } catch (RepositoryConfigurationException e) { log.error(e.getLocalizedMessage()); handler =3D null; - changesLogBuffer.clear(); - changesLogBuffer =3D null; + freeBuffers(); throw new RuntimeException(e); } - for (ItemStateChangesLog bufferedChangesLog : changesLogBuffer) + if (changesLogBuffer.size() > 0) { - super.onSaveItems(bufferedChangesLog); + for (ItemStateChangesLog bufferedChangesLog : changesLogBuffer) + { + super.onSaveItems(bufferedChangesLog); + } + } + + if (writeCommandBuffer.size() > 0) + { + try + { + for (List bufferedWriteLog : writeCommandBuffer) + { + super.onSaveItems(bufferedWriteLog); + } + } + catch (RepositoryException e) + { + freeBuffers(); + throw new RuntimeException(e); + + } + } + freeBuffers(); + } + + private void freeBuffers() + { changesLogBuffer.clear(); changesLogBuffer =3D null; + writeCommandBuffer.clear(); + writeCommandBuffer =3D null; } = @Override @@ -133,7 +165,25 @@ { QueryHandlerContext context =3D new QueryHandlerContext(itemMgr, indexingTree, nodeTypeDataManage= r, nsReg, parentHandler, getIndexDir() + "_" - + INDEX_DIR_SUFFIX, extractor, changesLogBuffer.size() > 0 && = !isStarted, virtualTableResolver); + + INDEX_DIR_SUFFIX, extractor, + (changesLogBuffer.size() > 0 || writeCommandBuffer.size() > 0)= && !isStarted, virtualTableResolver); return context; } + + /* (non-Javadoc) + * @see org.exoplatform.services.jcr.impl.core.query.SearchManager#onSa= veItems(java.util.List) + */ + @Override + public void onSaveItems(List modifications) throws Reposi= toryException + { + if (!isStarted) + { + writeCommandBuffer.add(modifications); + } + else + { + super.onSaveItems(modifications); + } + + } } --===============8069619431308935393==-- From do-not-reply at jboss.org Sun Nov 29 15:16:22 2009 Content-Type: multipart/mixed; boundary="===============0280697288143846568==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r905 - in kernel/branches/mc-int-branch: exo.kernel.demos/mc-injection/src/main/resources/conf and 1 other directory. Date: Sun, 29 Nov 2009 15:16:22 -0500 Message-ID: <200911292016.nATKGMdT027474@svn01.web.mwc.hst.phx2.redhat.com> --===============0280697288143846568== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: mstruk Date: 2009-11-29 15:16:22 -0500 (Sun, 29 Nov 2009) New Revision: 905 Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/exo= platform/container/mc/MCIntegrationInvoker.java kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/res= ources/conf/mc-int-beans.xml Log: Log warn if mc-int not available + aop conf can't have leading and trailing= whitespaces spaces in mc-int-beans.xml Modified: kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/= org/exoplatform/container/mc/MCIntegrationInvoker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationInvoker.java 2009-11-28 21:33:31 UTC (r= ev 904) +++ kernel/branches/mc-int-branch/exo.kernel.container/src/main/java/org/ex= oplatform/container/mc/MCIntegrationInvoker.java 2009-11-29 20:16:22 UTC (r= ev 905) @@ -72,7 +72,7 @@ catch (ClassNotFoundException ignored) { permFailure =3D true; - log.info("MC integration not available in this environment (mi= ssing class: " + log.warn("MC integration not available in this environment (mi= ssing class: " + ignored.getMessage() + ")"); = return null; Modified: kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/m= ain/resources/conf/mc-int-beans.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/mc-int-beans.xml 2009-11-28 21:33:31 UTC (rev 904) +++ kernel/branches/mc-int-branch/exo.kernel.demos/mc-injection/src/main/re= sources/conf/mc-int-beans.xml 2009-11-29 20:16:22 UTC (rev 905) @@ -5,14 +5,10 @@ @org.exoplatform.container.mc.impl.InterceptMC(enableAOP= =3Dtrue) - - @org.exoplatform.container.mc.impl.InterceptMC(injectionMode=3Dor= g.exoplatform.container.mc.impl.MCInjectionMode.STANDARD) - + @org.exoplatform.container.mc.impl.InterceptMC(injection= Mode=3Dorg.exoplatform.container.mc.impl.MCInjectionMode.STANDARD) - - @org.exoplatform.container.mc.impl.InterceptMC(enableAOP=3Dtrue,i= njectionMode=3Dorg.exoplatform.container.mc.impl.MCInjectionMode.ALL) - + @org.exoplatform.container.mc.impl.InterceptMC(enableAOP= =3Dtrue,injectionMode=3Dorg.exoplatform.container.mc.impl.MCInjectionMode.A= LL) @org.exoplatform.container.mc.impl.InterceptMC(enableAOP= =3Dtrue) --===============0280697288143846568==-- From do-not-reply at jboss.org Mon Nov 30 05:36:39 2009 Content-Type: multipart/mixed; boundary="===============8596519177521570231==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r906 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core and 14 other directories. Date: Mon, 30 Nov 2009 05:36:39 -0500 Message-ID: <200911301036.nAUAadUl025378@svn01.web.mwc.hst.phx2.redhat.com> --===============8596519177521570231== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2009-11-30 05:36:38 -0500 (Mon, 30 Nov 2009) New Revision: 906 Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/core/TestNodeOrder.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/load/perf/TestGetNodesPerf.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/dataflow/ItemDataConsumer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/dataflow/PlainChangesLogImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/ItemImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/NodeImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/PropertyImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/nodetype/ItemAutocreator.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/QueryImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/version/VersionHistoryImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.ja= va jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/session/SessionChangesLog.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/session/TransactionableDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/DBConstants.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/storage/WorkspaceStorageConnection.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/BaseStandaloneTest.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/api/core/query/UpperLowerCaseQueryTest.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/BaseStandaloneTest.java jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/f= tp/BaseStandaloneTest.java Log: EXOJCR-280: Merge OPT branch Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/ItemDataConsumer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/ItemDataConsumer.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/ItemDataConsumer.java 2009-11-30 10:36:38 UTC (rev 906) @@ -28,48 +28,72 @@ import javax.jcr.RepositoryException; = /** - * Created by The eXo Platform SAS. + * Created by The eXo Platform SAS.
* = - * @author Gennady Azarenk= ov - * @version $Id: ItemDataConsumer.java 11907 2008-03-13 15:36:21Z ksm $ + * Basic (Level 1) data flow inmemory operations
* = - * Basic (Level 1) data flow inmemory operations - * = * Common Rule for Read : If there is some storage in this manage= r =EF=BF=BD try to get the data * from here first, if not found =EF=BF=BD call super.someMethod + * = + * @author Gennady Azarenk= ov + * @version $Id$ */ public interface ItemDataConsumer { = /** - * @param parent - * @param name - * @return data by parent and name + * Find Item by parent (id) and name (with path index). + * = + * @param parent NodeData + * @param name QPathEntry + * @return ItemData, data by parent and name * @throws RepositoryException */ ItemData getItemData(NodeData parent, QPathEntry name) throws Repositor= yException; = /** - * @param identifier - * @return data by identifier + * Find Item by identifier. + * = + * @param String identifier + * @return ItemData, data by identifier */ ItemData getItemData(String identifier) throws RepositoryException; = /** - * @param parentIdentifier - * @return children data + * Get child Nodes of the parent node. + * = + * @param parent NodeData + * @return List of children Nodes */ List getChildNodesData(NodeData parent) throws RepositoryExce= ption; = /** - * @param parentIdentifier - * @return children data + * Get children nodes count of the parent node. = + * @param parent NodeData + * @return int, child nodes count */ + int getChildNodesCount(NodeData parent) throws RepositoryException; + = + /** + * Get child Properties of the parent node. + * = + * @param parent NodeData + * @return List of children Properties + */ List getChildPropertiesData(NodeData parent) throws Repos= itoryException; = - List listChildPropertiesData(final NodeData nodeData) thr= ows RepositoryException; + /** + * List child Properties, returned list will contains Properties withou= t actual Values. + * + * @param parent NodeData = + * @return List of PropertyData = + * @throws RepositoryException + */ + List listChildPropertiesData(final NodeData parent) throw= s RepositoryException; = /** + * Get Referenced properties. + * = * @param identifier * - referenceable id * @param skipVersionStorage Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/PlainChangesLogImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/PlainChangesLogImpl.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/PlainChangesLogImpl.java 2009-11-30 10:36:38 UTC (rev 906) @@ -199,7 +199,6 @@ in.readFully(buf); sessionId =3D new String(buf, DEFAULT_ENCODING); = - items =3D new ArrayList(); int listSize =3D in.readInt(); for (int i =3D 0; i < listSize; i++) add((ItemState)in.readObject()); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/ItemImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/ItemImpl.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/ItemImpl.java 2009-11-30 10:36:38 UTC (rev 906) @@ -23,6 +23,7 @@ import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.access.PermissionType; import org.exoplatform.services.jcr.core.ExtendedPropertyType; +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; @@ -97,6 +98,11 @@ */ protected JCRPath location; = + /** + * Item QPath. + */ + protected QPath qpath; + protected SessionDataManager dataManager; = protected LocationFactory locationFactory; @@ -104,32 +110,24 @@ protected ValueFactoryImpl valueFactory; = /** - * Hashcode. - */ - protected final int itemHashCode; - - /** - * ItemImpl constructor. - * = - * @param data - * ItemData object - * @param session - * Session object - * @throws RepositoryException - * if any Exception is occurred - */ + * ItemImpl constructor. + * = + * @param data + * ItemData object + * @param session + * Session object + * @throws RepositoryException + * if any Exception is occurred + */ ItemImpl(ItemData data, SessionImpl session) throws RepositoryException { = this.session =3D session; this.data =3D data; - this.location =3D session.getLocationFactory().createJCRPath(data.ge= tQPath()); = this.dataManager =3D session.getTransientNodesManager(); this.locationFactory =3D session.getLocationFactory(); this.valueFactory =3D session.getValueFactory(); - - itemHashCode =3D (session.getWorkspace().getName() + data.getIdentif= ier()).hashCode(); } = protected void invalidate() @@ -165,7 +163,7 @@ /** * {@inheritDoc} */ - public String getPath() + public String getPath() throws RepositoryException { return getLocation().getAsString(false); } @@ -173,7 +171,7 @@ /** * {@inheritDoc} */ - public String getName() + public String getName() throws RepositoryException { return getLocation().getName().getAsString(); } @@ -239,7 +237,7 @@ */ public int getDepth() { - return getLocation().getDepth(); + return qpath.getDepth(); } = /** @@ -749,8 +747,11 @@ * = * @return item JCRPath */ - public JCRPath getLocation() + public JCRPath getLocation() throws RepositoryException { + if (this.location =3D=3D null) + this.location =3D session.getLocationFactory().createJCRPath(qpat= h); + return this.location; } = @@ -764,8 +765,35 @@ return data.getIdentifier().equals(Constants.ROOT_UUID); } = + /** + * Loads data + * + * @param data + * source item data + * @throws RepositoryException = + * if errors occurs + */ abstract void loadData(ItemData data) throws RepositoryException; = + /** + * Loads data. + * + * @param data + * source item data + * @param itemDefinitionData + * source item definition data + * @throws RepositoryException + * if errors occurs + */ + abstract void loadData(ItemData data, ItemDefinitionData itemDefinition= Data) throws RepositoryException; + + /** + * Returns Item definition data. + * + * @return + */ + abstract ItemDefinitionData getItemDefinitionData(); + public boolean hasPermission(String action) throws RepositoryException { NodeData ndata; @@ -804,15 +832,6 @@ return false; } = - /** - * {@inheritDoc} - */ - @Override - public int hashCode() - { - return itemHashCode; - } - private ValueData valueData(Value value, int type) throws RepositoryExc= eption, ValueFormatException { = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2009-11-30 10:36:38 UTC (rev 906) @@ -24,6 +24,7 @@ import org.exoplatform.services.jcr.access.SystemIdentity; import org.exoplatform.services.jcr.core.ExtendedNode; import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; @@ -137,7 +138,7 @@ * = * @param data * Node data - * @param session + * @param session = * Session * @throws RepositoryException * if error occurs during the Node data loading @@ -150,6 +151,25 @@ } = /** + * NodeImpl constructor. + * = + * @param data + * Node data + * @param parent + * parent node data is used for simple calculation item defini= tion + * @param session = + * Session + * @throws RepositoryException + * if error occurs during the Node data loading + */ + public NodeImpl(NodeData data, NodeData parent, SessionImpl session) th= rows RepositoryException + { + super(data, session); + this.sysLocFactory =3D session.getSystemLocationFactory(); + loadData(data, parent); + } + + /** * {@inheritDoc} */ public void accept(ItemVisitor visitor) throws RepositoryException @@ -585,7 +605,7 @@ dataManager.update(state, false); = NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeType= sHolder(); - ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager); + ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager, false); = PlainChangesLog changes =3D itemAutocreator.makeAutoCreatedItems(nodeData(), type.getName(), = dataManager, session.getUserID()); @@ -956,7 +976,7 @@ + itemPath.getAsString(false)); return (NodeImpl)node; } - = + /** * {@inheritDoc} */ @@ -1234,7 +1254,7 @@ = checkValid(); = - return dataManager.getChildNodesData(nodeData()).size() > 0; + return dataManager.getChildNodesCount(nodeData()) > 0; } = /** @@ -1357,14 +1377,100 @@ throw new RepositoryException("ACL is NULL " + nodeData.getQPath(= ).getAsString()); = this.data =3D nodeData; - this.location =3D session.getLocationFactory().createJCRPath(getData= ().getQPath()); + this.qpath =3D nodeData.getQPath(); + this.location =3D null; = initDefinition(); } = /** + * Loads data. + * + * @param data + * source item data for load = + * @param parent + * parent node data is used for simple calculation item defini= tion + * @throws RepositoryException = + * if error occurs + */ + private void loadData(ItemData data, NodeData parent) throws Repository= Exception, InvalidItemStateException, + ConstraintViolationException + { + + if (data =3D=3D null) + throw new InvalidItemStateException("Data is null for " + this.ge= tPath() + + " Probably was deleted by another session and can not be loa= ded from container "); + + if (!data.isNode()) + throw new RepositoryException("Load data failed: Node expected"); + + NodeData nodeData =3D (NodeData)data; + + // TODO do we need this three checks here? + if (nodeData.getPrimaryTypeName() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no primary= TypeName. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]") + " " + nodeData); + + if (nodeData.getMixinTypeNames() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no mixinTy= peNames. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]")); + + if (nodeData.getACL() =3D=3D null) + throw new RepositoryException("ACL is NULL " + nodeData.getQPath(= ).getAsString()); + + this.data =3D nodeData; + this.qpath =3D nodeData.getQPath(); + this.location =3D null; + + initDefinition(parent); + } + + /** * {@inheritDoc} */ + @Override + public void loadData(ItemData data, ItemDefinitionData itemDefinitionDa= ta) throws RepositoryException, + InvalidItemStateException, ConstraintViolationException + { + + if (data =3D=3D null) + throw new InvalidItemStateException("Data is null for " + this.ge= tPath() + + " Probably was deleted by another session and can not be loa= ded from container "); + + if (!data.isNode()) + throw new RepositoryException("Load data failed: Node expected"); + + NodeData nodeData =3D (NodeData)data; + + // TODO do we need this three checks here? + if (nodeData.getPrimaryTypeName() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no primary= TypeName. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]") + " " + nodeData); + + if (nodeData.getMixinTypeNames() =3D=3D null) + throw new RepositoryException("Load data: NodeData has no mixinTy= peNames. Null value found. " + + (nodeData.getQPath() !=3D null ? nodeData.getQPath().getAsSt= ring() : "[null path node]")); + + if (nodeData.getACL() =3D=3D null) + throw new RepositoryException("ACL is NULL " + nodeData.getQPath(= ).getAsString()); + + this.data =3D nodeData; + this.location =3D null; + this.qpath =3D nodeData.getQPath(); + this.definition =3D (NodeDefinitionData)itemDefinitionData; + } + + /** + * {@inheritDoc} + */ + public ItemDefinitionData getItemDefinitionData() + { + return definition; + } + + /** + * {@inheritDoc} + */ public Lock lock(boolean isDeep, boolean isSessionScoped) throws Unsupp= ortedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException { @@ -2488,16 +2594,92 @@ = // ----------------------------- ExtendedNode -------------------------= ---- = - private int getNextChildOrderNum(List siblings) + private int getNextChildOrderNum() throws RepositoryException { - int max =3D -1; + // int max =3D -1; + // for (NodeData sibling : siblings) + // { + // int cur =3D sibling.getOrderNumber(); + // if (cur > max) + // max =3D cur; + // } + // return ++max; + + //return siblings.size(); + + return dataManager.getChildNodesCount(nodeData()); + } + + private int getNextChildIndex(InternalQName nameToAdd, NodeData parentN= ode) throws RepositoryException, + ItemExistsException + { + + NodeDefinitionData def =3D + session.getWorkspace().getNodeTypesHolder().getChildNodeDefinitio= n(nameToAdd, parentNode.getPrimaryTypeName(), + parentNode.getMixinTypeNames()); + + boolean allowSns =3D def.isAllowsSameNameSiblings(); + + int ind =3D 1; + + NodeData sibling =3D (NodeData)dataManager.getItemData(parentNode, n= ew QPathEntry(nameToAdd, ind)); + while (sibling !=3D null) + { + if (allowSns) + { + ind++; + sibling =3D (NodeData)dataManager.getItemData(parentNode, new = QPathEntry(nameToAdd, ind)); + } + else + { + throw new ItemExistsException("The node " + nameToAdd + " alre= ady exists in " + getPath() + + " and same name sibling is not allowed "); + } + }; + + return ind; + + // int ind =3D 0; + // for (NodeData sibling : siblings) + // { + // if (sibling.getQPath().getName().equals(nameToAdd)) + // { + // if (allowSns) + // ind++; + // else + // throw new ItemExistsException("The node " + nameToA= dd + " already exists in " + getPath() + // + " and same name sibling is not allowed "); + // } + // } + // return ind + 1; + + } + + // old impl + @Deprecated + private int getNextChildIndex(InternalQName nameToAdd, List s= iblings, NodeData parentNode) + throws RepositoryException, ItemExistsException + { + + int ind =3D 0; for (NodeData sibling : siblings) { - int cur =3D sibling.getOrderNumber(); - if (cur > max) - max =3D cur; + if (sibling.getQPath().getName().equals(nameToAdd)) + { + NodeDefinitionData def =3D + session.getWorkspace().getNodeTypesHolder().getChildNodeDef= inition(nameToAdd, + parentNode.getPrimaryTypeName(), parentNode.getMixinType= Names()); + if (LOG.isDebugEnabled()) + LOG.debug("Calculate index for " + nameToAdd + " " + siblin= g.getQPath().getAsString()); + + if (def.isAllowsSameNameSiblings()) + ind++; + else + throw new ItemExistsException("The node " + nameToAdd + " a= lready exists in " + getPath() + + " and same name sibling is not allowed "); + } } - return ++max; + return ind + 1; } = private NodeImpl doAddNode(NodeImpl parentNode, InternalQName name, Int= ernalQName primaryTypeName) @@ -2510,9 +2692,9 @@ InternalQName[] mixinTypeNames =3D new InternalQName[0]; String identifier =3D IdGenerator.generate(); = - List siblings =3D dataManager.getChildNodesData(parentNode= .nodeData()); - int orderNum =3D parentNode.getNextChildOrderNum(siblings); - int index =3D parentNode.getNextChildIndex(name, siblings, parentNod= e.nodeData()); + //List siblings =3D dataManager.getChildNodesData(parentNo= de.nodeData()); + int orderNum =3D parentNode.getNextChildOrderNum(); + int index =3D parentNode.getNextChildIndex(name, parentNode.nodeData= ()); = QPath path =3D QPath.makeChildPath(parentNode.getInternalPath(), nam= e, index); = @@ -2528,7 +2710,7 @@ NodeImpl node =3D (NodeImpl)dataManager.update(state, true); = NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeType= sHolder(); - ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager); + ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, v= alueFactory, dataManager, true); = PlainChangesLog changes =3D itemAutocreator.makeAutoCreatedItems(node.nodeData(), primaryType= Name, dataManager, session.getUserID()); @@ -2546,35 +2728,8 @@ session.getActionHandler().postAddNode(node); = return node; - } = - private int getNextChildIndex(InternalQName nameToAdd, List s= iblings, NodeData parentNode) - throws RepositoryException, ItemExistsException - { - - int ind =3D 0; - for (NodeData sibling : siblings) - { - if (sibling.getQPath().getName().equals(nameToAdd)) - { - NodeDefinitionData def =3D - session.getWorkspace().getNodeTypesHolder().getChildNodeDef= inition(nameToAdd, - parentNode.getPrimaryTypeName(), parentNode.getMixinType= Names()); - if (LOG.isDebugEnabled()) - LOG.debug("Calculate index for " + nameToAdd + " " + siblin= g.getQPath().getAsString()); - - if (def.isAllowsSameNameSiblings()) - ind++; - else - throw new ItemExistsException("The node " + nameToAdd + " a= lready exists in " + getPath() - + " and same name sibling is not allowed "); - } - } - return ind + 1; - - } - private int getOrderNumber() { return nodeData().getOrderNumber(); @@ -2636,6 +2791,33 @@ throw new ConstraintViolationException("Node definition not found= for " + getPath()); } = + /** + * Init NodeDefinition. + * = + * @throws RepositoryException + * if error occurs + * @throws ConstraintViolationException + * if definition not found + */ + private void initDefinition(NodeData parent) throws RepositoryException= , ConstraintViolationException + { + + if (this.isRoot()) + { // root - no parent + this.definition =3D + new NodeDefinitionData(null, null, true, true, OnParentVersion= Action.ABORT, true, + new InternalQName[]{Constants.NT_BASE}, null, false); + return; + } + + this.definition =3D + session.getWorkspace().getNodeTypesHolder().getChildNodeDefinitio= n(getInternalName(), + parent.getPrimaryTypeName(), parent.getMixinTypeNames()); + + if (definition =3D=3D null) + throw new ConstraintViolationException("Node definition not found= for " + getPath()); + } + private void removeMergeFailed(Version version, PlainChangesLog changes= Log) throws RepositoryException { = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/PropertyImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/PropertyImpl.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/PropertyImpl.java 2009-11-30 10:36:38 UTC (rev 906) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.core; = import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionData; import org.exoplatform.services.jcr.core.nodetype.PropertyDefinitionDatas; import org.exoplatform.services.jcr.datamodel.InternalQName; @@ -93,14 +94,42 @@ this.propertyData =3D (TransientPropertyData)data; this.type =3D propertyData.getType(); = - this.location =3D session.getLocationFactory().createJCRPath(getData= ().getQPath()); - this.propertyDef =3D null; + this.qpath =3D data.getQPath(); + this.location =3D null; + initDefinitions(this.propertyData.isMultiValued()); } = /** * {@inheritDoc} */ + void loadData(ItemData data, ItemDefinitionData itemDefinitionData) thr= ows RepositoryException, + ConstraintViolationException + { + + if (!(data instanceof TransientPropertyData)) + throw new RepositoryException("Load data: TransientPropertyData i= s expected, but have " + data); + + this.data =3D data; + this.propertyData =3D (TransientPropertyData)data; + this.type =3D propertyData.getType(); + + this.location =3D null; + this.qpath =3D data.getQPath(); + this.propertyDef =3D (PropertyDefinitionData)itemDefinitionData; + } + + /** + * {@inheritDoc} + */ + public ItemDefinitionData getItemDefinitionData() + { + return propertyDef; + } + + /** + * {@inheritDoc} + */ public Value getValue() throws ValueFormatException, RepositoryException { = @@ -526,9 +555,10 @@ */ public String dump() { - String vals =3D "Property " + getPath() + " values: "; + String vals =3D "Property "; try { + vals =3D getPath() + " values: "; for (int i =3D 0; i < getValueArray().length; i++) { vals +=3D new String(((BaseValue)getValueArray()[i]).getIntern= alData().getAsByteArray()) + ";"; @@ -564,19 +594,4 @@ return false; } = - /** - * {@inheritDoc} - */ - @Override - public int hashCode() - { - try - { - return getLocation().getAsString(false).hashCode(); - } - catch (Exception e) - { - return super.hashCode(); - } - } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2009-11-30 10:36:38 UTC (rev 906) @@ -466,18 +466,12 @@ public boolean isNew(String identifier) { = - List states =3D changesLog.getItemStates(identifier); - ItemState lastState =3D states.size() > 0 ? states.get(states.size()= - 1) : null; + ItemState lastState =3D changesLog.getItemState(identifier); = if (lastState =3D=3D null || lastState.isDeleted()) return false; = - for (ItemState state : states) - { - if (state.isAdded()) - return true; - } - return false; + return changesLog.getItemState(identifier, ItemState.ADDED) !=3D nul= l; } = /** @@ -534,7 +528,8 @@ // [PN] 21.12.07 use item data NodeData parent =3D (NodeData)getItemData(data.getParentIdentifie= r()); // skip not permitted - if (accessManager.hasPermission(parent.getACL(), PermissionType.R= EAD, session.getUserState().getIdentity())) + if (accessManager.hasPermission(parent.getACL(), new String[]{Per= missionType.READ}, session.getUserState() + .getIdentity())) { PropertyImpl item =3D null; ItemState state =3D changesLog.getItemState(identifier); @@ -583,11 +578,12 @@ = for (NodeData data : nodeDatas) { - NodeImpl item =3D itemFactory.createNode(data); + NodeImpl item =3D itemFactory.createNode(data, parent); = session.getActionHandler().postRead(item); = - if (accessManager.hasPermission(data.getACL(), PermissionType.= READ, session.getUserState().getIdentity())) + if (accessManager.hasPermission(data.getACL(), new String[]{Pe= rmissionType.READ}, session.getUserState() + .getIdentity())) { if (pool) item =3D (NodeImpl)itemsPool.get(item); @@ -633,7 +629,8 @@ { ItemImpl item =3D itemFactory.createItem(data); session.getActionHandler().postRead(item); - if (accessManager.hasPermission(parent.getACL(), PermissionTyp= e.READ, session.getUserState().getIdentity())) + if (accessManager.hasPermission(parent.getACL(), new String[]{= PermissionType.READ}, session.getUserState() + .getIdentity())) { if (pool) item =3D itemsPool.get(item); @@ -674,6 +671,22 @@ /** * {@inheritDoc} */ + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on + { + int childsCount =3D + changesLog.getChildNodesCount(parent.getIdentifier()) + transacti= onableManager.getChildNodesCount(parent); + if (childsCount < 0) + { + throw new InvalidItemStateException("Node's child nodes were chan= ged in another Session " + + parent.getQPath().getAsString()); + } + + return childsCount; + } + + /** + * {@inheritDoc} + */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException { long start =3D 0; @@ -1264,8 +1277,8 @@ // Remove propery or node if (changedItem.isDeleted()) { - if (!accessManager.hasPermission(parent.getACL(), PermissionTy= pe.REMOVE, session.getUserState() - .getIdentity())) + if (!accessManager.hasPermission(parent.getACL(), new String[]= {PermissionType.REMOVE}, session + .getUserState().getIdentity())) throw new AccessDeniedException("Access denied: REMOVE " + changedItem.getData().getQPath().getAsString() + " for= : " + session.getUserID() + " item owner " + parent.getACL().getOwner()); @@ -1275,8 +1288,8 @@ // add node if (changedItem.isAdded()) { - if (!accessManager.hasPermission(parent.getACL(), Permissio= nType.ADD_NODE, session.getUserState() - .getIdentity())) + if (!accessManager.hasPermission(parent.getACL(), new Strin= g[]{PermissionType.ADD_NODE}, session + .getUserState().getIdentity())) { throw new AccessDeniedException("Access denied: ADD_NODE= " + changedItem.getData().getQPath().getAsString() + " = for: " + session.getUserID() + " item owner " @@ -1287,8 +1300,8 @@ else if (changedItem.isAdded() || changedItem.isUpdated()) { // add or update property - if (!accessManager.hasPermission(parent.getACL(), PermissionTy= pe.SET_PROPERTY, session.getUserState() - .getIdentity())) + if (!accessManager.hasPermission(parent.getACL(), new String[]= {PermissionType.SET_PROPERTY}, session + .getUserState().getIdentity())) throw new AccessDeniedException("Access denied: SET_PROPERT= Y " + changedItem.getData().getQPath().getAsString() + " for= : " + session.getUserID() + " item owner " + parent.getACL().getOwner()); @@ -1647,10 +1660,6 @@ { ret.add(childNode); = - if (log.isDebugEnabled()) - log.debug("Traverse transient (N) " + childNode.getData(= ).getQPath().getAsString() + " " - + ItemState.nameFromValue(childNode.getState())); - if (deep) traverseTransientDescendants(childNode.getData(), deep, = action, ret); } @@ -1661,17 +1670,14 @@ for (ItemState childProp : childProps) { ret.add(childProp); - - if (log.isDebugEnabled()) - log.debug("Traverse transient (P) " + childProp.getData= ().getQPath().getAsString()); } } } } = /** - * Pool for touched items. - */ + * Pool for touched items. + */ protected final class ItemReferencePool { = @@ -1723,7 +1729,7 @@ } else { - item.loadData(newItem.getData()); + item.loadData(newItem.getData(), newItem.getItemDefinitionData= ()); return item; } } @@ -1833,12 +1839,19 @@ String dump() { String str =3D "Items Pool: \n"; - for (ItemImpl item : items.values()) + try { - str +=3D - (item.isNode() ? "Node\t\t" : "Property\t") + "\t" + item.i= sValid() + "\t" + item.isNew() + "\t" - + item.getInternalIdentifier() + "\t" + item.getPath() += "\n"; + for (ItemImpl item : items.values()) + { + str +=3D + (item.isNode() ? "Node\t\t" : "Property\t") + "\t" + ite= m.isValid() + "\t" + item.isNew() + "\t" + + item.getInternalIdentifier() + "\t" + item.getPath(= ) + "\n"; + } } + catch (Exception e) + { + e.printStackTrace(); + } = return str; } @@ -1874,10 +1887,26 @@ return node; } = + private NodeImpl createNode(NodeData data, NodeData parent) throws R= epositoryException + { + NodeImpl node =3D new NodeImpl(data, parent, session); + if (data.getPrimaryTypeName().equals(Constants.NT_VERSION)) + { + return new VersionImpl(data, session); + } + else if (data.getPrimaryTypeName().equals(Constants.NT_VERSIONHIS= TORY)) + { + return new VersionHistoryImpl(data, session); + } + else + return node; + } + private PropertyImpl createProperty(ItemData data) throws Repository= Exception { return new PropertyImpl(data, session); } + } = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/nodetype/ItemAutocreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/ItemAutocreator.java 2009-11-29 20:16:22 UTC (rev 9= 05) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/ItemAutocreator.java 2009-11-30 10:36:38 UTC (rev 9= 06) @@ -69,16 +69,19 @@ = private final ValueFactory valueFactory; = + private final boolean avoidCheckExistedChildItems; + /** * @param nodeTypeDataManager */ public ItemAutocreator(NodeTypeDataManager nodeTypeDataManager, ValueFa= ctory valueFactory, - ItemDataConsumer dataConsumer) + ItemDataConsumer dataConsumer, boolean avoidCheckExistedChildItems) { super(); this.nodeTypeDataManager =3D nodeTypeDataManager; this.valueFactory =3D valueFactory; this.dataConsumer =3D dataConsumer; + this.avoidCheckExistedChildItems =3D avoidCheckExistedChildItems; } = public PlainChangesLog makeAutoCreatedItems(final NodeData parent, fina= l InternalQName nodeTypeName, @@ -113,7 +116,9 @@ { if (ndef.isAutoCreated()) { - final ItemData pdata =3D targetDataManager.getItemData(parent,= new QPathEntry(ndef.getName(), 0)); + final ItemData pdata =3D + avoidCheckExistedChildItems ? null : targetDataManager.getI= temData(parent, new QPathEntry( + ndef.getName(), 0)); if (pdata =3D=3D null && !addedNodes.contains(ndef.getName()) = || pdata !=3D null && !pdata.isNode()) { = @@ -156,7 +161,9 @@ if (pdef.isAutoCreated()) { = - final ItemData pdata =3D targetDataManager.getItemData(parent,= new QPathEntry(pdef.getName(), 0)); + final ItemData pdata =3D + avoidCheckExistedChildItems ? null : targetDataManager.getI= temData(parent, new QPathEntry( + pdef.getName(), 0)); if (pdata =3D=3D null && !addedProperties.contains(pdef.getNam= e()) || pdata !=3D null && pdata.isNode()) { = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-11-29 20:16:22 UT= C (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2009-11-30 10:36:38 UT= C (rev 906) @@ -638,7 +638,7 @@ final boolean recipientsMixVersionable =3D isNodeType(Constants.MIX_= VERSIONABLE, recipienAllNodeTypeNames); final boolean ancestorIsMixVersionable =3D isNodeType(Constants.MIX_= VERSIONABLE, ancestorAllNodeTypeNames); = - ItemAutocreator itemAutocreator =3D new ItemAutocreator(this, valueF= actory, dataManager); + ItemAutocreator itemAutocreator =3D new ItemAutocreator(this, valueF= actory, dataManager, false); if (recipientsMixVersionable && !ancestorIsMixVersionable) { = @@ -838,7 +838,8 @@ = volatileNodeTypeDataManager.registerVolatileNodeTypes(volatileNodeTy= pes); = - ItemAutocreator itemAutocreator =3D new ItemAutocreator(volatileNode= TypeDataManager, valueFactory, dataManager); + ItemAutocreator itemAutocreator =3D + new ItemAutocreator(volatileNodeTypeDataManager, valueFactory, da= taManager, false); = final Set nodes =3D this.indexSearcherHolder.getNodesByNodeT= ype(recipientDefinition.getName()); // check add mix:versionable super Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/QueryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/QueryImpl.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/QueryImpl.java 2009-11-30 10:36:38 UTC (rev 906) @@ -16,7 +16,6 @@ */ package org.exoplatform.services.jcr.impl.core.query; = - import java.text.NumberFormat; = import javax.jcr.ItemExistsException; @@ -56,298 +55,302 @@ /** * Provides the default implementation for a JCR query. */ -public class QueryImpl extends AbstractQueryImpl { +public class QueryImpl extends AbstractQueryImpl +{ = - /** - * The logger instance for this class - */ - private static final Logger log =3D LoggerFactory.getLogger(QueryImpl.= class); + /** + * The logger instance for this class + */ + private static final Logger log =3D LoggerFactory.getLogger(QueryImpl.c= lass); = - /** - * A string constant representing the JCR-SQL2 query language. - * - * @since JCR 2.0 - * TODO: REMOVE WHEN JSR 283 IS FINAL!! - */ - public static final String JCR_SQL2 =3D "JCR-SQL2"; + /** + * A string constant representing the JCR-SQL2 query language. + * + * @since JCR 2.0 + * TODO: REMOVE WHEN JSR 283 IS FINAL!! + */ + public static final String JCR_SQL2 =3D "JCR-SQL2"; = - /** - * A string constant representing the JCR-JQOM query language. - * - * @since JCR 2.0 - * TODO: REMOVE WHEN JSR 283 IS FINAL!! - */ - public static final String JCR_JQOM =3D "JCR-JQOM"; + /** + * A string constant representing the JCR-JQOM query language. + * + * @since JCR 2.0 + * TODO: REMOVE WHEN JSR 283 IS FINAL!! + */ + public static final String JCR_JQOM =3D "JCR-JQOM"; = - /** - * The session of the user executing this query - */ - protected SessionImpl session; + /** + * The session of the user executing this query + */ + protected SessionImpl session; = - /** - * The query statement - */ - protected String statement; + /** + * The query statement + */ + protected String statement; = - /** - * The syntax of the query statement - */ - protected String language; + /** + * The syntax of the query statement + */ + protected String language; = - /** - * The actual query implementation that can be executed - */ - protected ExecutableQuery query; + /** + * The actual query implementation that can be executed + */ + protected ExecutableQuery query; = - /** - * The node where this query is persisted. Only set when this is a per= sisted - * query. - */ - protected Node node; + /** + * The node where this query is persisted. Only set when this is a pers= isted + * query. + */ + protected Node node; = - /** - * The query handler for this query. - */ - protected QueryHandler handler; + /** + * The query handler for this query. + */ + protected QueryHandler handler; = - /** - * Flag indicating whether this query is initialized. - */ - private boolean initialized =3D false; + /** + * Flag indicating whether this query is initialized. + */ + private boolean initialized =3D false; = - /** - * The maximum result size - */ - private long limit; + /** + * The maximum result size + */ + private long limit; = - /** - * The offset in the total result set - */ - private long offset; + /** + * The offset in the total result set + */ + private long offset; = - /** - * @inheritDoc - */ - public void init(SessionImpl session, - SessionDataManager itemMgr, - QueryHandler handler, - String statement, - String language) throws InvalidQueryException { - checkNotInitialized(); - this.session =3D session; - this.statement =3D statement; - this.language =3D language; - this.handler =3D handler; - this.query =3D handler.createExecutableQuery(session, itemMgr, sta= tement, language); - setInitialized(); - } + /** + * @inheritDoc + */ + public void init(SessionImpl session, SessionDataManager itemMgr, Query= Handler handler, String statement, + String language) throws InvalidQueryException + { + checkNotInitialized(); + this.session =3D session; + this.statement =3D statement; + this.language =3D language; + this.handler =3D handler; + this.query =3D handler.createExecutableQuery(session, itemMgr, state= ment, language); + setInitialized(); + } = - /** - * @inheritDoc - */ - public void init(SessionImpl session, - SessionDataManager itemMgr, - QueryHandler handler, - Node node) - throws InvalidQueryException, RepositoryException { - checkNotInitialized(); - this.session =3D session; - this.node =3D node; - this.handler =3D handler; + /** + * @inheritDoc + */ + public void init(SessionImpl session, SessionDataManager itemMgr, Query= Handler handler, Node node) + throws InvalidQueryException, RepositoryException + { + checkNotInitialized(); + this.session =3D session; + this.node =3D node; + this.handler =3D handler; = - if (!((ExtendedNode)node).isNodeType(Constants.NT_QUERY)){ - throw new InvalidQueryException("node is not of type nt:query"= ); - } - statement =3D node.getProperty("jcr:statement").getString(); - language =3D node.getProperty("jcr:language").getString(); - query =3D handler.createExecutableQuery(session, itemMgr, statemen= t, language); - setInitialized(); - } + if (!((ExtendedNode)node).isNodeType(Constants.NT_QUERY)) + { + throw new InvalidQueryException("node is not of type nt:query"); + } + statement =3D node.getProperty("jcr:statement").getString(); + language =3D node.getProperty("jcr:language").getString(); + query =3D handler.createExecutableQuery(session, itemMgr, statement,= language); + setInitialized(); + } = -// /** -// * @inheritDoc -// *

-// * Throws an {@link UnsupportedOperationException}. -// */ -// public void init(SessionImpl session, -// Sess itemMgr, -// QueryHandler handler, -// QueryObjectModelTree qomTree, -// String language) -// throws InvalidQueryException, RepositoryException { -// throw new UnsupportedOperationException("not a prepared query"); -// } + // /** + // * @inheritDoc + // *

+ // * Throws an {@link UnsupportedOperationException}. + // */ + // public void init(SessionImpl session, + // Sess itemMgr, + // QueryHandler handler, + // QueryObjectModelTree qomTree, + // String language) + // throws InvalidQueryException, RepositoryException { + // throw new UnsupportedOperationException("not a prepared query= "); + // } = - /** - * This method simply forwards the execute call to the - * {@link ExecutableQuery} object returned by - * {@link QueryHandler#createExecutableQuery}. - * {@inheritDoc} - */ - public QueryResult execute() throws RepositoryException { - checkInitialized(); - long time =3D System.currentTimeMillis(); - QueryResult result =3D query.execute(offset, limit); - if (log.isDebugEnabled()) { - time =3D System.currentTimeMillis() - time; - NumberFormat format =3D NumberFormat.getNumberInstance(); - format.setMinimumFractionDigits(2); - format.setMaximumFractionDigits(2); - String seconds =3D format.format((double) time / 1000); - log.debug("executed in " + seconds + " s. (" + statement + ")"= ); - } - return result; - } + /** + * This method simply forwards the execute call to the + * {@link ExecutableQuery} object returned by + * {@link QueryHandler#createExecutableQuery}. + * {@inheritDoc} + */ + public QueryResult execute() throws RepositoryException + { + checkInitialized(); + long time =3D System.currentTimeMillis(); + QueryResult result =3D query.execute(offset, limit); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + NumberFormat format =3D NumberFormat.getNumberInstance(); + format.setMinimumFractionDigits(2); + format.setMaximumFractionDigits(2); + String seconds =3D format.format((double)time / 1000); + log.debug("executed in " + seconds + " s. (" + statement + ")"); + } + return result; + } = - /** - * {@inheritDoc} - */ - public String getStatement() { - checkInitialized(); - return statement; - } + /** + * {@inheritDoc} + */ + public String getStatement() + { + checkInitialized(); + return statement; + } = - /** - * {@inheritDoc} - */ - public String getLanguage() { - checkInitialized(); - return language; - } + /** + * {@inheritDoc} + */ + public String getLanguage() + { + checkInitialized(); + return language; + } = - /** - * {@inheritDoc} - */ - public String getStoredQueryPath() - throws ItemNotFoundException, RepositoryException { - checkInitialized(); - if (node =3D=3D null) { - throw new ItemNotFoundException("not a persistent query"); - } - return node.getPath(); - } + /** + * {@inheritDoc} + */ + public String getStoredQueryPath() throws ItemNotFoundException, Reposi= toryException + { + checkInitialized(); + if (node =3D=3D null) + { + throw new ItemNotFoundException("not a persistent query"); + } + return node.getPath(); + } = - /** - * {@inheritDoc} - */ - public Node storeAsNode(String absPath) - throws ItemExistsException, - PathNotFoundException, - VersionException, - ConstraintViolationException, - LockException, - UnsupportedRepositoryOperationException, - RepositoryException { + /** + * {@inheritDoc} + */ + public Node storeAsNode(String absPath) throws ItemExistsException, Pat= hNotFoundException, VersionException, + ConstraintViolationException, LockException, UnsupportedRepositoryOp= erationException, RepositoryException + { = - checkInitialized(); - JCRPath path =3D session.getLocationFactory().parseAbsPath(absPath); - QPath qpath =3D path.getInternalPath(); - NodeImpl parent =3D (NodeImpl)session.getTransientNodesManager().ge= tItem(qpath.makeParentPath(), false); - if (parent =3D=3D null) - throw new PathNotFoundException("Parent not found for " + path.g= etAsString(false)); + checkInitialized(); + JCRPath path =3D session.getLocationFactory().parseAbsPath(absPath); + QPath qpath =3D path.getInternalPath(); + NodeImpl parent =3D (NodeImpl)session.getTransientNodesManager().get= Item(qpath.makeParentPath(), false); + if (parent =3D=3D null) + throw new PathNotFoundException("Parent not found for " + path.ge= tAsString(false)); = - // validate as on parent child node - parent.validateChildNode(qpath.getName(), Constants.NT_QUERY); + // validate as on parent child node + parent.validateChildNode(qpath.getName(), Constants.NT_QUERY); = - NodeData queryData =3D - TransientNodeData.createNodeData((NodeData)parent.getData(), qpa= th.getName(), Constants.NT_QUERY); - NodeImpl queryNode =3D - (NodeImpl)session.getTransientNodesManager().update(ItemState.cr= eateAddedState(queryData), false); + NodeData queryData =3D + TransientNodeData.createNodeData((NodeData)parent.getData(), qpat= h.getName(), Constants.NT_QUERY); + NodeImpl queryNode =3D + (NodeImpl)session.getTransientNodesManager().update(ItemState.cre= ateAddedState(queryData), false); = - NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeTyp= esHolder(); + NodeTypeDataManager ntmanager =3D session.getWorkspace().getNodeType= sHolder(); = - ItemAutocreator itemAutocreator =3D new ItemAutocreator(ntmanager, = session.getValueFactory(),session.getTransientNodesManager()); + ItemAutocreator itemAutocreator =3D + new ItemAutocreator(ntmanager, session.getValueFactory(), session= .getTransientNodesManager(), false); = - PlainChangesLog changes =3D - itemAutocreator.makeAutoCreatedItems((NodeData)queryNode.getData= (), Constants.NT_QUERY, session - .getTransientNodesManager(), session.getUserID()); + PlainChangesLog changes =3D + itemAutocreator.makeAutoCreatedItems((NodeData)queryNode.getData(= ), Constants.NT_QUERY, session + .getTransientNodesManager(), session.getUserID()); = - for (ItemState autoCreatedState : changes.getAllStates()) - { - session.getTransientNodesManager().update(autoCreatedState, fals= e); - } - // queryNode.addAutoCreatedItems(Constants.NT_QUERY); - // set properties - TransientValueData value =3D new TransientValueData(language); - TransientPropertyData jcrLanguage =3D - TransientPropertyData.createPropertyData(queryData, Constants.JC= R_LANGUAGE, PropertyType.STRING, false, value); - session.getTransientNodesManager().update(ItemState.createAddedStat= e(jcrLanguage), false); + for (ItemState autoCreatedState : changes.getAllStates()) + { + session.getTransientNodesManager().update(autoCreatedState, false= ); + } + // queryNode.addAutoCreatedItems(Constants.NT_QUERY); + // set properties + TransientValueData value =3D new TransientValueData(language); + TransientPropertyData jcrLanguage =3D + TransientPropertyData.createPropertyData(queryData, Constants.JCR= _LANGUAGE, PropertyType.STRING, false, value); + session.getTransientNodesManager().update(ItemState.createAddedState= (jcrLanguage), false); = - value =3D new TransientValueData(statement); - TransientPropertyData jcrStatement =3D - TransientPropertyData - .createPropertyData(queryData, Constants.JCR_STATEMENT, Prope= rtyType.STRING, false, value); - session.getTransientNodesManager().update(ItemState.createAddedStat= e(jcrStatement), false); + value =3D new TransientValueData(statement); + TransientPropertyData jcrStatement =3D + TransientPropertyData + .createPropertyData(queryData, Constants.JCR_STATEMENT, Proper= tyType.STRING, false, value); + session.getTransientNodesManager().update(ItemState.createAddedState= (jcrStatement), false); = - // NOTE: for save stored node need save() on parent or on session (= 6.6.10 - // The Query Object) - node =3D queryNode; - return node; - } + // NOTE: for save stored node need save() on parent or on session (6= .6.10 + // The Query Object) + node =3D queryNode; + return node; + } = - /** - * Binds the given value to the variable named - * varName. - * - * @param varName name of variable in query - * @param value value to bind - * @throws IllegalArgumentException if varName is no= t a - * valid variable in this query. - * @throws javax.jcr.RepositoryException if an error occurs. - */ - public void bindValue(String varName, Value value) - throws IllegalArgumentException, RepositoryException { - checkInitialized(); - query.bindValue(session.getLocationFactory().parseJCRName(varName)= .getInternalName(), value); - } + /** + * Binds the given value to the variable named + * varName. + * + * @param varName name of variable in query + * @param value value to bind + * @throws IllegalArgumentException if varName is not= a + * valid variable in this query. + * @throws javax.jcr.RepositoryException if an error occurs. + */ + public void bindValue(String varName, Value value) throws IllegalArgume= ntException, RepositoryException + { + checkInitialized(); + query.bindValue(session.getLocationFactory().parseJCRName(varName).g= etInternalName(), value); + } = - /** - * Sets the maximum size of the result set. - * - * @param limit new maximum size of the result set - */ - public void setLimit(long limit) { - this.limit =3D limit; - } + /** + * Sets the maximum size of the result set. + * + * @param limit new maximum size of the result set + */ + public void setLimit(long limit) + { + this.limit =3D limit; + } = - /** - * Sets the start offset of the result set. - * - * @param offset new start offset of the result set - */ - public void setOffset(long offset) { - this.offset =3D offset; - } + /** + * Sets the start offset of the result set. + * + * @param offset new start offset of the result set + */ + public void setOffset(long offset) + { + this.offset =3D offset; + } = - //-----------------------------< internal >---------------------------= ------ + //-----------------------------< internal >----------------------------= ----- = - /** - * Sets the initialized flag. - */ - protected void setInitialized() { - initialized =3D true; - } + /** + * Sets the initialized flag. + */ + protected void setInitialized() + { + initialized =3D true; + } = - /** - * Checks if this query is not yet initialized and throws an - * IllegalStateException if it is already initialized. - */ - protected void checkNotInitialized() { - if (initialized) { - throw new IllegalStateException("already initialized"); - } - } + /** + * Checks if this query is not yet initialized and throws an + * IllegalStateException if it is already initialized. + */ + protected void checkNotInitialized() + { + if (initialized) + { + throw new IllegalStateException("already initialized"); + } + } = - /** - * Checks if this query is initialized and throws an - * IllegalStateException if it is not yet initialized. - */ - protected void checkInitialized() { - if (!initialized) { - throw new IllegalStateException("not initialized"); - } - } + /** + * Checks if this query is initialized and throws an + * IllegalStateException if it is not yet initialized. + */ + protected void checkInitialized() + { + if (!initialized) + { + throw new IllegalStateException("not initialized"); + } + } = - = } - Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/version/VersionHistoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/version/VersionHistoryImpl.java 2009-11-29 20:16:22 UTC (rev= 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/version/VersionHistoryImpl.java 2009-11-30 10:36:38 UTC (rev= 906) @@ -629,7 +629,7 @@ = } = - public boolean isVersionBelongToThis(Version version) + public boolean isVersionBelongToThis(Version version) throws Repository= Exception { return ((VersionImpl)version).getLocation().isDescendantOf(getLocati= on(), false); } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataMan= ager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.j= ava 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.j= ava 2009-11-30 10:36:38 UTC (rev 906) @@ -18,6 +18,12 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import java.util.Calendar; +import java.util.List; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; import org.exoplatform.services.jcr.dataflow.SharedDataManager; @@ -28,12 +34,6 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = -import java.util.Calendar; -import java.util.List; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. Data Manager supported ACL Inheritance * = @@ -124,6 +124,9 @@ return node; } = + /** + * {@inheritDoc} + */ // ------------ ItemDataConsumer impl ------------ = public List getChildNodesData(NodeData parent) throws Reposit= oryException @@ -133,29 +136,52 @@ initACL(parent, node); return nodes; } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception = + { + return persistentManager.getChildNodesCount(parent); + } = + /** + * {@inheritDoc} + */ public ItemData getItemData(NodeData parent, QPathEntry name) throws Re= positoryException { final ItemData item =3D persistentManager.getItemData(parent, name); return item !=3D null && item.isNode() ? initACL(parent, (NodeData)i= tem) : item; } = + /** + * {@inheritDoc} + */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on { final ItemData item =3D persistentManager.getItemData(identifier); return item !=3D null && item.isNode() ? initACL(null, (NodeData)ite= m) : item; } = + /** + * {@inheritDoc} + */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException { return persistentManager.getChildPropertiesData(parent); } = + /** + * {@inheritDoc} + */ public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException { return persistentManager.listChildPropertiesData(parent); } = + /** + * {@inheritDoc} + */ public List getReferencesData(String identifier, boolean = skipVersionStorage) throws RepositoryException { @@ -164,12 +190,18 @@ = // ------------ SharedDataManager ---------------------- = + /** + * {@inheritDoc} + */ public void save(ItemStateChangesLog changes) throws InvalidItemStateEx= ception, UnsupportedOperationException, RepositoryException { persistentManager.save(changes); } = + /** + * {@inheritDoc} + */ public Calendar getCurrentTime() { return persistentManager.getCurrentTime(); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2009-11-29= 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2009-11-30= 10:36:38 UTC (rev 906) @@ -369,6 +369,18 @@ } } = + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on + { + if (cache.isEnabled()) + { + List childNodes =3D cache.getChildNodes(parent); + if (childNodes !=3D null) + return childNodes.size(); + } + + return super.getChildNodesCount(parent); + } + /** * Get child PropertyData. * = @@ -453,7 +465,7 @@ } return propertiesList; } - + = /** * {@inheritDoc} */ Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2009-11-= 29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2009-11-= 30 10:36:38 UTC (rev 906) @@ -18,6 +18,12 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.InvalidItemStateException; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; import org.exoplatform.services.jcr.dataflow.CompositeChangesLog; import org.exoplatform.services.jcr.dataflow.DataManager; @@ -36,12 +42,6 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.InvalidItemStateException; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. Responsible for: *redirecting reposito= ry operations if item is * descendant of /jcr:system/jcr:versionStorage *adding version history fo= r newly added/assigned @@ -72,11 +72,8 @@ this.versionDataManager =3D (ACLInheritanceSupportedWorkspaceDataMan= ager)systemDataManager; } = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.impl.core.WorkspaceDataManager#get= ChildNodes(org.exoplatform.services - * .jcr.datamodel.NodeData) + /** + * {@inheritDoc} */ @Override public List getChildNodesData(final NodeData nodeData) throws= RepositoryException @@ -87,12 +84,22 @@ } return super.getChildNodesData(nodeData); } + = + /** + * {@inheritDoc} + */ + @Override + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception = + { + if (isSystemDescendant(parent.getQPath()) && !this.equals(versionDat= aManager)) + { + return versionDataManager.getChildNodesCount(parent); + } + return super.getChildNodesCount(parent); + } = = - /* - * (non-Javadoc) - * = - * @see org.exoplatform.services.jcr.impl.core.WorkspaceDataManager#get= ChildProperties(org.exoplatform - * .services.jcr.datamodel.NodeData) + /** + * {@inheritDoc} */ @Override public List getChildPropertiesData(final NodeData nodeDat= a) throws RepositoryException @@ -104,6 +111,10 @@ return super.getChildPropertiesData(nodeData); } = + /** + * {@inheritDoc} + */ + @Override public List listChildPropertiesData(final NodeData nodeDa= ta) throws RepositoryException { if (isSystemDescendant(nodeData.getQPath()) && !this.equals(versionD= ataManager)) @@ -113,6 +124,10 @@ return super.listChildPropertiesData(nodeData); } = + /** + * {@inheritDoc} + */ + @Override public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException { if (parentData !=3D null) @@ -127,8 +142,9 @@ } = /** - * @see org.exoplatform.services.jcr.impl.dataflow.persistent.Workspace= PersistentDataManager#getItemData(java.lang.String) + * {@inheritDoc} */ + @Override public ItemData getItemData(String identifier) throws RepositoryExcepti= on { // from cache at first Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-2= 9 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-3= 0 10:36:38 UTC (rev 906) @@ -290,6 +290,22 @@ con.close(); } } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on + { + final WorkspaceStorageConnection con =3D dataContainer.openConnectio= n(); + try + { + return con.getChildNodesCount(parent); + } + finally + { + con.close(); + } + } = = /** * {@inheritDoc} Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2009-= 11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2009-= 11-30 10:36:38 UTC (rev 906) @@ -97,6 +97,9 @@ storageDataManager.save(newLog); } = + /** + * {@inheritDoc} + */ public ItemData getItemData(NodeData parentData, QPathEntry name) throw= s RepositoryException { return copyItemData(storageDataManager.getItemData(parentData, name)= ); @@ -117,6 +120,14 @@ { return copyNodes(storageDataManager.getChildNodesData(parent)); } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception = + { + return storageDataManager.getChildNodesCount(parent); + } = = /** * {@inheritDoc} @@ -126,6 +137,9 @@ return copyProperties(storageDataManager.getChildPropertiesData(pare= nt)); } = + /** + * {@inheritDoc} + */ public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException { return copyPropertiesWithoutValues(storageDataManager.listChildPrope= rtiesData(parent)); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/SessionChangesLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-29 20:16:22 UTC (= rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/SessionChangesLog.java 2009-11-30 10:36:38 UTC (= rev 906) @@ -26,6 +26,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; = import java.util.ArrayList; @@ -50,6 +51,22 @@ protected Map index =3D new HashMap(); = /** + * ItemState index storage. Used to store last nodes states. = + */ + protected Map> lastChildNodeStates =3D n= ew HashMap>(); + + /** + * ItemState index storage. Used to store last properties states. = + */ + protected Map> lastChildPropertyStates = =3D + new HashMap>(); + + /** + * Stores persisted child nodes count. = + */ + protected Map childNodesCount =3D new HashMap(); + + /** * Create empty ChangesLog. * = * @param sessionId @@ -70,52 +87,45 @@ super(items, sessionId); = for (ItemState change : items) - { - index.put(change.getData().getIdentifier(), change); - index.put(change.getData().getQPath(), change); - } + addItem(change); } = - /* - * (non-Javadoc) - * @see - * org.exoplatform.services.jcr.dataflow.PlainChangesLog#add(org.exopla= tform.services.jcr.dataflow - * .ItemState) + /** + * {@inheritDoc} */ @Override public PlainChangesLog add(ItemState change) { super.add(change); - index.put(change.getData().getIdentifier(), change); - index.put(change.getData().getQPath(), change); + addItem(change); + return this; } = - /* - * (non-Javadoc) - * @see org.exoplatform.services.jcr.dataflow.PlainChangesLog#addAll(ja= va.util.List) + /** + * {@inheritDoc} */ @Override public PlainChangesLog addAll(List changes) { super.addAll(changes); for (ItemState change : changes) - { - index.put(change.getData().getIdentifier(), change); - index.put(change.getData().getQPath(), change); - } + addItem(change); + return this; } = - /* - * (non-Javadoc) - * @see org.exoplatform.services.jcr.dataflow.PlainChangesLog#clear() + /** + * {@inheritDoc} */ @Override public void clear() { super.clear(); index.clear(); + lastChildNodeStates.clear(); + lastChildPropertyStates.clear(); + childNodesCount.clear(); } = /** @@ -126,24 +136,51 @@ */ public void remove(QPath rootPath) { - List removedList =3D new ArrayList(); + for (int i =3D items.size() - 1; i >=3D 0; i--) + { + ItemState item =3D items.get(i); = - for (ItemState item : items) - { QPath qPath =3D item.getData().getQPath(); if (qPath.isDescendantOf(rootPath) || item.getAncestorToSave().is= DescendantOf(rootPath) || item.getAncestorToSave().equals(rootPath) || qPath.equals(r= ootPath)) { - removedList.add(item); + items.remove(i); + index.remove(item.getData().getIdentifier()); + index.remove(item.getData().getQPath()); + index.remove(new ParentIDQPathBasedKey(item)); + index.remove(new IDStateBasedKey(item.getData().getIdentifier(= ), item.getState())); + childNodesCount.remove(item.getData().getIdentifier()); + lastChildNodeStates.remove(item.getData().getIdentifier()); + lastChildPropertyStates.remove(item.getData().getIdentifier()); + + if (item.isNode() && item.isPersisted()) + { + int childCount[] =3D childNodesCount.get(item.getData().get= ParentIdentifier()); + if (childCount !=3D null) + { + if (item.isDeleted()) + ++childCount[0]; + else if (item.isAdded()) + --childCount[0]; + + childNodesCount.put(item.getData().getParentIdentifier()= , childCount); + } + } + + if (item.getData().isNode()) + { + Map children =3D lastChildNodeStates.get= (item.getData().getParentIdentifier()); + if (children !=3D null) + children.remove(item.getData().getIdentifier()); + } + else + { + Map children =3D lastChildPropertyStates= .get(item.getData().getParentIdentifier()); + if (children !=3D null) + children.remove(item.getData().getIdentifier()); + } } } - - for (ItemState item : removedList) - { - items.remove(item); - index.remove(item.getData().getIdentifier()); - index.remove(item.getData().getQPath()); - } } = /** @@ -215,9 +252,11 @@ return list; } = - /* - * (non-Javadoc) - * @see org.exoplatform.services.jcr.dataflow.ItemDataChangesLog#getIte= mStates(java.lang.String) + /** + * Gets items by identifier. + * + * @param itemIdentifier + * @return */ public List getItemStates(String itemIdentifier) { @@ -242,8 +281,18 @@ public PlainChangesLog pushLog(QPath rootPath) { PlainChangesLog cLog =3D new PlainChangesLogImpl(sessionId); - cLog.addAll(getDescendantsChanges(rootPath)); - remove(rootPath); + + if (rootPath.equals(Constants.ROOT_PATH)) + { + cLog.addAll(items); + clear(); + } + else + { + cLog.addAll(getDescendantsChanges(rootPath)); + remove(rootPath); + } + return cLog; } = @@ -257,15 +306,7 @@ */ public ItemState getItemState(NodeData parentData, QPathEntry name) thr= ows IllegalPathException { - List allStates =3D getAllStates(); - for (int i =3D allStates.size() - 1; i >=3D 0; i--) - { - ItemState state =3D allStates.get(i); - if (state.getData().getParentIdentifier().equals(parentData.getId= entifier()) - && state.getData().getQPath().getEntries()[state.getData().get= QPath().getEntries().length - 1].isSame(name)) - return state; - } - return null; + return index.get(new ParentIDQPathBasedKey(parentData.getIdentifier(= ), name)); } = /** @@ -295,6 +336,20 @@ } = /** + * Get ItemState by identifier and state. + * = + * NOTE: Uses index HashMap. + * = + * @param itemIdentifier + * @param sate + * @return + */ + public ItemState getItemState(String itemIdentifier, int state) + { + return index.get(new IDStateBasedKey(itemIdentifier, state)); + } + + /** * Collect changes of all item direct childs (only). Including the item= itself. * = * @param rootIdentifier @@ -312,6 +367,12 @@ return list; } = + public int getChildNodesCount(String rootIdentifier) + { + int[] childCount =3D childNodesCount.get(rootIdentifier); + return childCount =3D=3D null ? 0 : childCount[0]; + } + /** * Collect last in ChangesLog order item child changes. * = @@ -323,17 +384,11 @@ */ public Collection getLastChildrenStates(ItemData rootData, b= oolean forNodes) { - HashMap children =3D new HashMap(); - List changes =3D getChildrenChanges(rootData.getIdentifie= r()); - for (ItemState child : changes) - { - ItemData data =3D child.getData(); - // add state to result - if (data.isNode() =3D=3D forNodes && !data.equals(rootData)) - children.put(data.getIdentifier(), child); + Map children =3D + forNodes ? lastChildNodeStates.get(rootData.getIdentifier()) : la= stChildPropertyStates.get(rootData + .getIdentifier()); = - } - return children.values(); + return children =3D=3D null ? new ArrayList() : children.= values(); } = /** @@ -528,4 +583,214 @@ } return null; } + + /** + * Adds item to the changes log. + * = + * @param item + * the item + */ + private void addItem(ItemState item) + { + index.put(item.getData().getIdentifier(), item); + index.put(item.getData().getQPath(), item); + index.put(new ParentIDQPathBasedKey(item), item); + index.put(new IDStateBasedKey(item.getData().getIdentifier(), item.g= etState()), item); + + if (item.getData().isNode()) + { + Map children =3D lastChildNodeStates.get(item.= getData().getParentIdentifier()); + if (children =3D=3D null) + { + children =3D new HashMap(); + lastChildNodeStates.put(item.getData().getParentIdentifier(), = children); + } + children.put(item.getData().getIdentifier(), item); + } + else + { + Map children =3D lastChildPropertyStates.get(i= tem.getData().getParentIdentifier()); + if (children =3D=3D null) + { + children =3D new HashMap(); + lastChildPropertyStates.put(item.getData().getParentIdentifier= (), children); + } + children.put(item.getData().getIdentifier(), item); + } + + if (item.isNode() && item.isPersisted()) + { + int[] childCount =3D childNodesCount.get(item.getData().getParent= Identifier()); + if (childCount =3D=3D null) + childCount =3D new int[1]; + + if (item.isDeleted()) + --childCount[0]; + else if (item.isAdded()) + ++childCount[0]; + + childNodesCount.put(item.getData().getParentIdentifier(), childCo= unt); + } + } + + /** + * This class is used as a key for index map. + */ + private class IDStateBasedKey + { + + /** + * Item identifier. + */ + private final String identifier; + + /** + * Item state. + */ + private final int state; + + /** + * KeyUUIDState constructor. + * + * @param identifier + * item identifier + * @param state + * item state + */ + IDStateBasedKey(String identifier, int state) + { + this.identifier =3D identifier; + this.state =3D state; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() + { + final int prime =3D 31; + int result =3D 1; + result =3D prime * result + identifier.hashCode(); + result =3D prime * result + state; + + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) + { + if (this =3D=3D obj) + return true; + if (obj =3D=3D null) + return false; + if (getClass() !=3D obj.getClass()) + return false; + IDStateBasedKey other =3D (IDStateBasedKey)obj; + + if (identifier =3D=3D null) + { + if (other.identifier !=3D null) + return false; + } + else if (!identifier.equals(other.identifier)) + return false; + if (state !=3D other.state) + return false; + return true; + } + } + + /** + * This class is used as a key for index map. + */ + private class ParentIDQPathBasedKey + { + /** + * Item name. + */ + private final QPathEntry name; + + /** + * Parent identifier. + */ + private final String parentIdentifier; + + /** + * KeyParentUUIDQPath constructor. + * + * @param item + * the item + */ + ParentIDQPathBasedKey(ItemState item) + { + this.name =3D item.getData().getQPath().getEntries()[item.getData= ().getQPath().getEntries().length - 1]; + this.parentIdentifier =3D item.getData().getParentIdentifier(); + } + + /** + * KeyParentUUIDQPath constructor. + * + * @param parentIdentifier + * the parent identifier + * @param name + * item name + */ + ParentIDQPathBasedKey(String parentIdentifier, QPathEntry name) + { + this.name =3D name; + this.parentIdentifier =3D parentIdentifier; + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() + { + final int prime =3D 31; + int result =3D 1; + result =3D prime * result + name.getName().hashCode(); + result =3D prime * result + name.getNamespace().hashCode(); + result =3D prime * result + name.getIndex(); + result =3D prime * result + parentIdentifier.hashCode(); + + return result; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object obj) + { + if (this =3D=3D obj) + return true; + if (obj =3D=3D null) + return false; + if (getClass() !=3D obj.getClass()) + return false; + ParentIDQPathBasedKey other =3D (ParentIDQPathBasedKey)obj; + + if (name =3D=3D null) + { + if (other.name !=3D null) + return false; + } + else if (!name.getName().equals(other.name.getName()) + || !name.getNamespace().equals(other.name.getNamespace()) || n= ame.getIndex() !=3D other.name.getIndex()) + return false; + if (parentIdentifier =3D=3D null) + { + if (other.parentIdentifier !=3D null) + return false; + } + else if (!parentIdentifier.equals(other.parentIdentifier)) + return false; + return true; + } + } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2009-11-29 20:16= :22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2009-11-30 10:36= :38 UTC (rev 906) @@ -94,6 +94,45 @@ /** * {@inheritDoc} */ + public int getChildNodesCount(final NodeData parent) throws RepositoryE= xception + { + if (txStarted()) + { + int txChildsCount =3D 0; + for (ItemState change : transactionLog.getAllStates()) + { + if (change.isNode() && change.isPersisted() + && change.getData().getParentIdentifier().equals(parent.get= Identifier())) + { + if (change.isDeleted()) + { + txChildsCount--; + } + else if (change.isAdded()) + { + txChildsCount++; + } + } + } + + final int childsCount =3D storageDataManager.getChildNodesCount(p= arent) + txChildsCount; + if (childsCount < 0) + { + throw new InvalidItemStateException("Node's child nodes were c= hanged in another Transaction " + + parent.getQPath().getAsString()); + } + = + return childsCount; + } + else + { + return storageDataManager.getChildNodesCount(parent); + } + } + + /** + * {@inheritDoc} + */ public List getChildPropertiesData(NodeData parent) throw= s RepositoryException { List props =3D storageDataManager.getChildPropertiesDa= ta(parent); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/DBConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/DBConstants.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/DBConstants.java 2009-11-30 10:36:38 UTC (rev 906) @@ -126,6 +126,11 @@ * FIND_NODES_BY_PARENTID. */ protected String FIND_NODES_BY_PARENTID; + = + /** + * FIND_NODES_COUNT_BY_PARENTID. + */ + protected String FIND_NODES_COUNT_BY_PARENTID; = /** * FIND_PROPERTIES_BY_PARENTID. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-29 20:16:22 UTC (= rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-30 10:36:38 UTC (= rev 906) @@ -600,6 +600,29 @@ throw new RepositoryException(e); } } + = + /** + * {@inheritDoc} + */ + public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on { + checkIfOpened(); + try + { + ResultSet count =3D findChildNodesCountByParentIdentifier(getInte= rnalId(parent.getIdentifier())); + if (count.next()) = + { + return count.getInt(1); + } + else + { + throw new RepositoryException("FATAL No resulton childNodes co= unt for " + parent.getQPath().getAsString()); + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + } = = /** * {@inheritDoc} @@ -1871,6 +1894,8 @@ protected abstract ResultSet findItemByName(String parentId, String nam= e, int index) throws SQLException; = protected abstract ResultSet findChildNodesByParentIdentifier(String pa= rentIdentifier) throws SQLException; + = + protected abstract ResultSet findChildNodesCountByParentIdentifier(Stri= ng parentIdentifier) throws SQLException; = protected abstract ResultSet findChildPropertiesByParentIdentifier(Stri= ng parentIdentifier) throws SQLException; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-29 20:16= :22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2009-11-30 10:36= :38 UTC (rev 906) @@ -74,6 +74,7 @@ "select V.DATA" + " from JCR_MITEM I, JCR_MVALUE V" + " where I.PARENT_ID=3D? and I.I_CLASS=3D2 and I.NAME=3D? and= I.ID=3DV.PROPERTY_ID order by V.ORDER_NUM"; FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where PAREN= T_ID=3D? and I_CLASS=3D1" + " order by N_ORDER_NUM"; + FIND_NODES_COUNT_BY_PARENTID =3D "select count(ID) from JCR_MITEM" += " where PARENT_ID=3D? and I_CLASS=3D1"; FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = PARENT_ID=3D? and I_CLASS=3D2" + " order by ID"; } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-29 20:1= 6:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2009-11-30 10:3= 6:38 UTC (rev 906) @@ -81,6 +81,8 @@ + " where I.PARENT_ID=3D? and I.I_CLASS=3D2 and I.CONTAINER_NA= ME=3D? and I.NAME=3D? and I.ID=3DV.PROPERTY_ID order by V.ORDER_NUM"; FIND_NODES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D1= and CONTAINER_NAME=3D?" + " order by N_ORDER_NUM"; + FIND_NODES_COUNT_BY_PARENTID =3D + "select count(ID) from JCR_SITEM" + " where PARENT_ID=3D? and I_C= LASS=3D1 and CONTAINER_NAME=3D?"; FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where PARENT_ID=3D? and I_CLASS=3D2= and CONTAINER_NAME=3D?" + " order by ID"; } @@ -135,7 +137,23 @@ findNodesByParentId.setString(2, containerName); return findNodesByParentId.executeQuery(); } + = + /** + * {@inheritDoc} + */ + @Override + protected ResultSet findChildNodesCountByParentIdentifier(String parent= Cid) throws SQLException + { + if (findNodesCountByParentId =3D=3D null) + findNodesCountByParentId =3D dbConnection.prepareStatement(FIND_N= ODES_COUNT_BY_PARENTID); + else + findNodesCountByParentId.clearParameters(); = + findNodesCountByParentId.setString(1, parentCid); + findNodesCountByParentId.setString(2, containerName); + return findNodesCountByParentId.executeQuery(); + } + /** * {@inheritDoc} */ Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-29 20:16:22 UT= C (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-30 10:36:38 UT= C (rev 906) @@ -77,6 +77,8 @@ protected PreparedStatement findValueByPropertyIdOrderNumber; = protected PreparedStatement findNodesByParentId; + = + protected PreparedStatement findNodesCountByParentId; = protected PreparedStatement findPropertiesByParentId; = @@ -185,6 +187,8 @@ FIND_VALUE_BY_PROPERTYID_OREDERNUMB =3D "select DATA from JCR_MVALUE= where PROPERTY_ID=3D? and ORDER_NUM=3D?"; = FIND_NODES_BY_PARENTID =3D "select * from JCR_MITEM" + " where I_CLA= SS=3D1 and PARENT_ID=3D?" + " order by N_ORDER_NUM"; + = + FIND_NODES_COUNT_BY_PARENTID =3D "select count(ID) from JCR_MITEM" += " where I_CLASS=3D1 and PARENT_ID=3D?"; = FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_MITEM" + " where = I_CLASS=3D2 and PARENT_ID=3D?" + " order by ID"; = @@ -428,6 +432,21 @@ * {@inheritDoc} */ @Override + protected ResultSet findChildNodesCountByParentIdentifier(String parent= Identifier) throws SQLException + { + if (findNodesCountByParentId =3D=3D null) + findNodesCountByParentId =3D dbConnection.prepareStatement(FIND_N= ODES_COUNT_BY_PARENTID); + else + findNodesCountByParentId.clearParameters(); + + findNodesCountByParentId.setString(1, parentIdentifier); + return findNodesCountByParentId.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override protected ResultSet findChildPropertiesByParentIdentifier(String parent= Identifier) throws SQLException { if (findPropertiesByParentId =3D=3D null) Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-29 20:16:22 U= TC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-30 10:36:38 U= TC (rev 906) @@ -75,6 +75,8 @@ = protected PreparedStatement findNodesByParentId; = + protected PreparedStatement findNodesCountByParentId; + protected PreparedStatement findPropertiesByParentId; = protected PreparedStatement insertItem; @@ -193,6 +195,9 @@ FIND_NODES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D1 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by N_ORDER_NUM"; = + FIND_NODES_COUNT_BY_PARENTID =3D + "select count(ID) from JCR_SITEM" + " where I_CLASS=3D1 and CONTA= INER_NAME=3D? and PARENT_ID=3D?"; + FIND_PROPERTIES_BY_PARENTID =3D "select * from JCR_SITEM" + " where I_CLASS=3D2 and CONTAINER_NAM= E=3D? and PARENT_ID=3D?" + " order by ID"; = @@ -339,6 +344,22 @@ * {@inheritDoc} */ @Override + protected ResultSet findChildNodesCountByParentIdentifier(String parent= Cid) throws SQLException + { + if (findNodesCountByParentId =3D=3D null) + findNodesCountByParentId =3D dbConnection.prepareStatement(FIND_N= ODES_COUNT_BY_PARENTID); + else + findNodesCountByParentId.clearParameters(); + + findNodesCountByParentId.setString(1, containerName); + findNodesCountByParentId.setString(2, parentCid); + return findNodesCountByParentId.executeQuery(); + } + + /** + * {@inheritDoc} + */ + @Override protected ResultSet findChildPropertiesByParentIdentifier(String parent= Cid) throws SQLException { if (findPropertiesByParentId =3D=3D null) Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/storage/WorkspaceStorageConnection.java 2009-11-29 20:16:22 UTC (rev 9= 05) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/storage/WorkspaceStorageConnection.java 2009-11-30 10:36:38 UTC (rev 9= 06) @@ -93,6 +93,15 @@ * if connection is closed */ List getChildNodesData(NodeData parent) throws RepositoryExce= ption, IllegalStateException; + = + /** + * Reads count of parent child nodes. + * + * @param parent NodeData + * @return long, childs count + * @throws RepositoryException if error occurs + */ + int getChildNodesCount(NodeData parent) throws RepositoryException; = /** * Reads List of PropertyData from the storag= e using item's parent Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/BaseStandaloneTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/BaseStandaloneTest.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/BaseStandaloneTest.java 2009-11-30 10:36:38 UTC (rev 906) @@ -387,7 +387,7 @@ return testFile; } = - protected void checkMixins(String[] mixins, NodeImpl node) + protected void checkMixins(String[] mixins, NodeImpl node) throws Repos= itoryException { try { Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/api/core/query/UpperLowerCaseQueryTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/core/query/UpperLowerCaseQueryTest.java 2009-11-29 20:16:22 UTC (r= ev 905) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/core/query/UpperLowerCaseQueryTest.java 2009-11-30 10:36:38 UTC (r= ev 906) @@ -16,9 +16,9 @@ */ package org.exoplatform.services.jcr.api.core.query; = - - +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import java.util.Random; import java.util.Set; = @@ -32,295 +32,276 @@ * fn:upper-case() in XPath, LOWER() and UPPER() in SQL and UpperCase and * LowerCase in JQOM. */ -public class UpperLowerCaseQueryTest extends AbstractQueryTest { +public class UpperLowerCaseQueryTest extends AbstractQueryTest +{ = -// /** -// * Maps operator strings to QueryObjectModelConstants. -// */ -// private static final Map OPERATORS =3D new HashMap(); -// -// static { -// OPERATORS.put("=3D", new Integer(OPERATOR_EQUAL_TO)); -// OPERATORS.put(">", new Integer(OPERATOR_GREATER_THAN)); -// OPERATORS.put(">=3D", new Integer(OPERATOR_GREATER_THAN_OR_EQUAL= _TO)); -// OPERATORS.put("<", new Integer(OPERATOR_LESS_THAN)); -// OPERATORS.put("<=3D", new Integer(OPERATOR_LESS_THAN_OR_EQUAL_TO= )); -// OPERATORS.put("like", new Integer(OPERATOR_LIKE)); -// OPERATORS.put("!=3D", new Integer(OPERATOR_NOT_EQUAL_TO)); -// } + // /** + // * Maps operator strings to QueryObjectModelConstants. + // */ + // private static final Map OPERATORS =3D new HashMap(); + // + // static { + // OPERATORS.put("=3D", new Integer(OPERATOR_EQUAL_TO)); + // OPERATORS.put(">", new Integer(OPERATOR_GREATER_THAN)); + // OPERATORS.put(">=3D", new Integer(OPERATOR_GREATER_THAN_OR_EQ= UAL_TO)); + // OPERATORS.put("<", new Integer(OPERATOR_LESS_THAN)); + // OPERATORS.put("<=3D", new Integer(OPERATOR_LESS_THAN_OR_EQUAL= _TO)); + // OPERATORS.put("like", new Integer(OPERATOR_LIKE)); + // OPERATORS.put("!=3D", new Integer(OPERATOR_NOT_EQUAL_TO)); + // } = - public void testEqualsGeneralComparison() throws RepositoryException { - check(new String[]{"foo", "Foo", "fOO", "FOO", "fooBar", "fo", "fo= oo"}, - "=3D", - "foo", - new boolean[]{true, true, true, true, false, false, false}= ); - check(new String[]{"foo"}, "=3D", "", new boolean[]{false}); - check(new String[]{""}, "=3D", "", new boolean[]{true}); - } + public void testEqualsGeneralComparison() throws RepositoryException + { + check(new String[]{"foo", "Foo", "fOO", "FOO", "fooBar", "fo", "fooo= "}, "=3D", "foo", new boolean[]{true, true, + true, true, false, false, false}); + check(new String[]{"foo"}, "=3D", "", new boolean[]{false}); + check(new String[]{""}, "=3D", "", new boolean[]{true}); + } = - public void testGreaterThanGeneralComparison() throws RepositoryExcept= ion { - // check edges - check(new String[]{"foo", "FOO", "FoO", "fOo", "FON", "fon", "fo",= "FO"}, - ">", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"foo ", "FOOa", "FoOO", "fOo1", "FOp", "foP", "= fp", "g", "G"}, - ">", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, - ">", - "foo", - new boolean[]{false, true, true, false, false, false}); - } + public void testGreaterThanGeneralComparison() throws RepositoryExcepti= on + { + // check edges + check(new String[]{"foo", "FOO", "FoO", "fOo", "FON", "fon", "fo", "= FO"}, ">", "foo", new boolean[]{false, false, + false, false, false, false, false, false}); + check(new String[]{"foo ", "FOOa", "FoOO", "fOo1", "FOp", "foP", "fp= ", "g", "G"}, ">", "foo", new boolean[]{true, + true, true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, ">", = "foo", new boolean[]{false, true, true, + false, false, false}); + } = - public void testLessThanGeneralComparison() throws RepositoryException= { - // check edges - check(new String[]{"foo", "FOO", "FoO", "fOo", "foOo", "foo ", "fo= oa", "fop"}, - "<", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"fo", "FOn", "FoN", "fO", "FO1", "fn", "fN", "E= ", "e"}, - "<", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, - "<", - "foo", - new boolean[]{false, false, false, true, true, true}); - } + public void testLessThanGeneralComparison() throws RepositoryException + { + // check edges + check(new String[]{"foo", "FOO", "FoO", "fOo", "foOo", "foo ", "fooa= ", "fop"}, "<", "foo", new boolean[]{false, + false, false, false, false, false, false, false}); + check(new String[]{"fo", "FOn", "FoN", "fO", "FO1", "fn", "fN", "E",= "e"}, "<", "foo", new boolean[]{true, true, + true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fooo", "FooO", "fo", "FON", "fon"}, "<", = "foo", new boolean[]{false, false, false, + true, true, true}); + } = - public void testGreaterEqualsGeneralComparison() throws RepositoryExce= ption { - // check edges - check(new String[]{"fo", "FO", "Fon", "fONo", "FON", "fO", "fo", "= FO"}, - ">=3D", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"foo", "FoO", "FoOO", "fOo1", "FOp", "foP", "fp= ", "g", "G"}, - ">=3D", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fooo", "FOo", "fo", "FON", "fon"}, - ">=3D", - "foo", - new boolean[]{true, true, true, false, false, false}); - } + public void testGreaterEqualsGeneralComparison() throws RepositoryExcep= tion + { + // check edges + check(new String[]{"fo", "FO", "Fon", "fONo", "FON", "fO", "fo", "FO= "}, ">=3D", "foo", new boolean[]{false, false, + false, false, false, false, false, false}); + check(new String[]{"foo", "FoO", "FoOO", "fOo1", "FOp", "foP", "fp",= "g", "G"}, ">=3D", "foo", new boolean[]{true, + true, true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fooo", "FOo", "fo", "FON", "fon"}, ">=3D"= , "foo", new boolean[]{true, true, true, false, + false, false}); + } = - public void testLessEqualsGeneralComparison() throws RepositoryExcepti= on { - // check edges - check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "= fp", "G"}, - "<=3D", - "foo", - new boolean[]{false, false, false, false, false, false, fa= lse, false}); - check(new String[]{"foo", "FoO", "Foo", "fOn", "FO", "fo", "f", "E= ", "e"}, - "<=3D", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - // check combinations - check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, - "<=3D", - "foo", - new boolean[]{true, true, true, false, false, false}); - } + public void testLessEqualsGeneralComparison() throws RepositoryException + { + // check edges + check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "fp= ", "G"}, "<=3D", "foo", new boolean[]{false, + false, false, false, false, false, false, false}); + check(new String[]{"foo", "FoO", "Foo", "fOn", "FO", "fo", "f", "E",= "e"}, "<=3D", "foo", new boolean[]{true, true, + true, true, true, true, true, true, true}); + // check combinations + check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, "<=3D"= , "foo", new boolean[]{true, true, true, false, + false, false}); + } = - public void testNotEqualsGeneralComparison() throws RepositoryExceptio= n { - // check edges - check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "= fp", "G", ""}, - "!=3D", - "foo", - new boolean[]{true, true, true, true, true, true, true, tr= ue, true}); - check(new String[]{"foo", "FoO", "Foo", "foO", "FOO"}, - "!=3D", - "foo", - new boolean[]{false, false, false, false, false}); - // check combinations - check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, - "!=3D", - "foo", - new boolean[]{false, true, false, true, true, true}); - } + public void testNotEqualsGeneralComparison() throws RepositoryException + { + // check edges + check(new String[]{"fooo", "FOoo", "Fop", "fOpo", "FOP", "fOo ", "fp= ", "G", ""}, "!=3D", "foo", new boolean[]{true, + true, true, true, true, true, true, true, true}); + check(new String[]{"foo", "FoO", "Foo", "foO", "FOO"}, "!=3D", "foo"= , new boolean[]{false, false, false, false, + false}); + // check combinations + check(new String[]{"foo", "fo", "FOo", "fop", "FOP", "fooo"}, "!=3D"= , "foo", new boolean[]{false, true, false, + true, true, true}); + } = - public void testLikeComparison() throws RepositoryException { - check(new String[]{"foo", "Foo", "fOO", "FO "}, - "like", - "fo_", - new boolean[]{true, true, true, true}); - check(new String[]{"foo", "Foo", "fOO", "FOO"}, - "like", - "f_o", - new boolean[]{true, true, true, true}); - check(new String[]{"foo", "Foo", "fOO", " OO"}, - "like", - "_oo", - new boolean[]{true, true, true, true}); - check(new String[]{"foo", "Foa", "fOO", "FO", "foRm", "fPo", "fno"= , "FPo", "Fno"}, - "like", - "fo%", - new boolean[]{true, true, true, true, true, false, false, = false, false}); - } + public void testLikeComparison() throws RepositoryException + { + check(new String[]{"foo", "Foo", "fOO", "FO "}, "like", "fo_", new b= oolean[]{true, true, true, true}); + check(new String[]{"foo", "Foo", "fOO", "FOO"}, "like", "f_o", new b= oolean[]{true, true, true, true}); + check(new String[]{"foo", "Foo", "fOO", " OO"}, "like", "_oo", new b= oolean[]{true, true, true, true}); + check(new String[]{"foo", "Foa", "fOO", "FO", "foRm", "fPo", "fno", = "FPo", "Fno"}, "like", "fo%", new boolean[]{ + true, true, true, true, true, false, false, false, false}); + } = - public void testLikeComparisonRandom() throws RepositoryException { - String abcd =3D "abcd"; - Random random =3D new Random(); - for (int i =3D 0; i < 50; i++) { - String pattern =3D ""; - pattern +=3D getRandomChar(abcd, random); - pattern +=3D getRandomChar(abcd, random); + public void testLikeComparisonRandom() throws RepositoryException + { + String abcd =3D "abcd"; + Random random =3D new Random(); + for (int i =3D 0; i < 50; i++) + { + String pattern =3D ""; + pattern +=3D getRandomChar(abcd, random); + pattern +=3D getRandomChar(abcd, random); = - // create 10 random values with 4 characters - String[] values =3D new String[10]; - boolean[] matches =3D new boolean[10]; - for (int n =3D 0; n < 10; n++) { - // at least the first character always matches - String value =3D String.valueOf(pattern.charAt(0)); - for (int r =3D 1; r < 4; r++) { - char c =3D getRandomChar(abcd, random); - if (random.nextBoolean()) { - c =3D Character.toUpperCase(c); - } - value +=3D c; - } - matches[n] =3D value.toLowerCase().startsWith(pattern); - values[n] =3D value; + // create 10 random values with 4 characters + String[] values =3D new String[10]; + boolean[] matches =3D new boolean[10]; + for (int n =3D 0; n < 10; n++) + { + // at least the first character always matches + String value =3D String.valueOf(pattern.charAt(0)); + for (int r =3D 1; r < 4; r++) + { + char c =3D getRandomChar(abcd, random); + if (random.nextBoolean()) + { + c =3D Character.toUpperCase(c); + } + value +=3D c; } - pattern +=3D "%"; - check(values, "like", pattern, matches); - } - } + matches[n] =3D value.toLowerCase().startsWith(pattern); + values[n] =3D value; + } + pattern +=3D "%"; + check(values, "like", pattern, matches); + } + } = - public void testRangeWithEmptyString() throws RepositoryException { - check(new String[]{" ", "a", "A", "1", "3", "!", "@"}, - ">", - "", - new boolean[]{true, true, true, true, true, true, true}); - check(new String[]{"", "a", "A", "1", "3", "!", "@"}, - ">=3D", - "", - new boolean[]{true, true, true, true, true, true, true}); - check(new String[]{"", "a", "A", "1", "3", "!", "@"}, - "<", - "", - new boolean[]{false, false, false, false, false, false, fa= lse}); - check(new String[]{"", "a", "A", "1", "3", "!", "@"}, - "<=3D", - "", - new boolean[]{true, false, false, false, false, false, fal= se}); - } + public void testRangeWithEmptyString() throws RepositoryException + { + check(new String[]{" ", "a", "A", "1", "3", "!", "@"}, ">", "", new = boolean[]{true, true, true, true, true, true, + true}); + check(new String[]{"", "a", "A", "1", "3", "!", "@"}, ">=3D", "", ne= w boolean[]{true, true, true, true, true, true, + true}); + check(new String[]{"", "a", "A", "1", "3", "!", "@"}, "<", "", new b= oolean[]{false, false, false, false, false, + false, false}); + check(new String[]{"", "a", "A", "1", "3", "!", "@"}, "<=3D", "", ne= w boolean[]{true, false, false, false, false, + false, false}); + } = - public void testInvalidQuery() throws RepositoryException { - try { - executeXPathQuery("//*[fn:lower-case(@foo) =3D 123]", new Node= []{}); - fail("must throw InvalidQueryException"); - } catch (InvalidQueryException e) { - // correct - } + public void testInvalidQuery() throws RepositoryException + { + try + { + executeXPathQuery("//*[fn:lower-case(@foo) =3D 123]", new Node[]{= }); + fail("must throw InvalidQueryException"); + } + catch (InvalidQueryException e) + { + // correct + } = - try { - executeSQLQuery("select * from nt:base where LOWER(foo) =3D 12= 3", new Node[]{}); - fail("must throw InvalidQueryException"); - } catch (InvalidQueryException e) { - // correct - } - } + try + { + executeSQLQuery("select * from nt:base where LOWER(foo) =3D 123",= new Node[]{}); + fail("must throw InvalidQueryException"); + } + catch (InvalidQueryException e) + { + // correct + } + } = - public void testWrongCaseNeverMatches() throws RepositoryException { - Node n =3D testRootNode.addNode("node"); - n.setProperty("foo", "Bar"); - testRootNode.save(); - executeXPathQuery(testPath + "/*[jcr:like(fn:lower-case(@foo), 'BA= %')]", new Node[]{}); - } + public void testWrongCaseNeverMatches() throws RepositoryException + { + Node n =3D testRootNode.addNode("node"); + n.setProperty("foo", "Bar"); + testRootNode.save(); + executeXPathQuery(testPath + "/*[jcr:like(fn:lower-case(@foo), 'BA%'= )]", new Node[]{}); + } = - //----------------------------< internal >----------------------------= ------ + //----------------------------< internal >-----------------------------= ----- = - private void check(String[] values, String operation, String queryTerm= , boolean[] matches) - throws RepositoryException { - if (values.length !=3D matches.length) { - throw new IllegalArgumentException("values and matches must ha= ve same length"); - } - // create log message - StringBuffer logMsg =3D new StringBuffer(); - logMsg.append("queryTerm: ").append(queryTerm); - logMsg.append(" values: "); - String separator =3D ""; - for (int i =3D 0; i < values.length; i++) { - logMsg.append(separator); - separator =3D ", "; - if (matches[i]) { - logMsg.append("+"); - } else { - logMsg.append("-"); - } - logMsg.append(values[i]); - } - log.println(logMsg.toString()); - for (NodeIterator it =3D testRootNode.getNodes(); it.hasNext();) { - it.nextNode().remove(); - } - Set matchingNodes =3D new HashSet(); - for (int i =3D 0; i < values.length; i++) { - Node n =3D testRootNode.addNode("node" + i); - n.setProperty(propertyName1, values[i]); - if (matches[i]) { - matchingNodes.add(n); - } - } - testRootNode.save(); + private void check(String[] values, String operation, String queryTerm,= boolean[] matches) + throws RepositoryException + { + if (values.length !=3D matches.length) + { + throw new IllegalArgumentException("values and matches must have = same length"); + } + // create log message + StringBuffer logMsg =3D new StringBuffer(); + logMsg.append("queryTerm: ").append(queryTerm); + logMsg.append(" values: "); + String separator =3D ""; + for (int i =3D 0; i < values.length; i++) + { + logMsg.append(separator); + separator =3D ", "; + if (matches[i]) + { + logMsg.append("+"); + } + else + { + logMsg.append("-"); + } + logMsg.append(values[i]); + } + log.println(logMsg.toString()); + for (NodeIterator it =3D testRootNode.getNodes(); it.hasNext();) + { + it.nextNode().remove(); + } + List matchingNodes =3D new ArrayList(); + for (int i =3D 0; i < values.length; i++) + { + Node n =3D testRootNode.addNode("node" + i); + n.setProperty(propertyName1, values[i]); + if (matches[i]) + { + matchingNodes.add(n); + } + } + testRootNode.save(); = - Node[] nodes =3D (Node[]) matchingNodes.toArray(new Node[matchingN= odes.size()]); - String sqlOperation =3D operation; - if (operation.equals("!=3D")) { - sqlOperation =3D "<>"; - } + Node[] nodes =3D (Node[])matchingNodes.toArray(new Node[matchingNode= s.size()]); + String sqlOperation =3D operation; + if (operation.equals("!=3D")) + { + sqlOperation =3D "<>"; + } = - // run queries with lower-case - String xpath =3D testPath; - if (operation.equals("like")) { - xpath +=3D "/*[jcr:like(fn:lower-case(@" + propertyName1 + - "), '" + queryTerm.toLowerCase() + "')]"; - } else { - xpath +=3D "/*[fn:lower-case(@" + propertyName1 + - ") " + operation + " '" + queryTerm.toLowerCase() + "'= ]"; - } - executeXPathQuery(xpath, nodes); + // run queries with lower-case + String xpath =3D testPath; + if (operation.equals("like")) + { + xpath +=3D "/*[jcr:like(fn:lower-case(@" + propertyName1 + "), '"= + queryTerm.toLowerCase() + "')]"; + } + else + { + xpath +=3D "/*[fn:lower-case(@" + propertyName1 + ") " + operatio= n + " '" + queryTerm.toLowerCase() + "']"; + } + executeXPathQuery(xpath, nodes); = - String sql =3D "select * from nt:base where jcr:path like '" + - testRoot + "/%' and LOWER(" + propertyName1 + ") " + - sqlOperation + " '" + queryTerm.toLowerCase() + "'"; - executeSQLQuery(sql, nodes); + String sql =3D + "select * from nt:base where jcr:path like '" + testRoot + "/%' a= nd LOWER(" + propertyName1 + ") " + + sqlOperation + " '" + queryTerm.toLowerCase() + "'"; + executeSQLQuery(sql, nodes); = + // run queries with upper-case + xpath =3D testPath; + if (operation.equals("like")) + { + xpath +=3D "/*[jcr:like(fn:upper-case(@" + propertyName1 + "), '"= + queryTerm.toUpperCase() + "')]"; + } + else + { + xpath +=3D "/*[fn:upper-case(@" + propertyName1 + ") " + operatio= n + " '" + queryTerm.toUpperCase() + "']"; + } + executeXPathQuery(xpath, nodes); = + sql =3D + "select * from nt:base where jcr:path like '" + testRoot + "/%' a= nd UPPER(" + propertyName1 + ") " + + sqlOperation + " '" + queryTerm.toUpperCase() + "'"; + executeSQLQuery(sql, nodes); = - // run queries with upper-case - xpath =3D testPath; - if (operation.equals("like")) { - xpath +=3D "/*[jcr:like(fn:upper-case(@" + propertyName1 + - "), '" + queryTerm.toUpperCase() + "')]"; - } else { - xpath +=3D "/*[fn:upper-case(@" + propertyName1 + - ") " + operation + " '" + queryTerm.toUpperCase() + "'= ]"; - } - executeXPathQuery(xpath, nodes); + } = - sql =3D "select * from nt:base where jcr:path like '" + - testRoot + "/%' and UPPER(" + propertyName1 + ") " + - sqlOperation + " '" + queryTerm.toUpperCase() + "'"; - executeSQLQuery(sql, nodes); + private char getRandomChar(String pool, Random random) + { + return pool.charAt(random.nextInt(pool.length())); + } = - - } - - private char getRandomChar(String pool, Random random) { - return pool.charAt(random.nextInt(pool.length())); - } - -// protected static int getOperatorForString(String operator) { -// Integer i =3D (Integer) OPERATORS.get(operator); -// if (i =3D=3D null) { -// throw new IllegalArgumentException("unknown operator: " + op= erator); -// } -// return i.intValue(); -// } + // protected static int getOperatorForString(String operator) { + // Integer i =3D (Integer) OPERATORS.get(operator); + // if (i =3D=3D null) { + // throw new IllegalArgumentException("unknown operator: " += operator); + // } + // return i.intValue(); + // } } Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/servi= ces/jcr/impl/core/TestNodeOrder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestNodeOrder.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestNodeOrder.java 2009-11-30 10:36:38 UTC (rev 906) @@ -0,0 +1,271 @@ +/* + * 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. + */ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.core; + +import javax.jcr.ItemExistsException; +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.Session; + +import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.datamodel.NodeData; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 13.11.2009 + * + * @author Peter N= edonosko = + * @version $Id$ + */ +public class TestNodeOrder extends JcrImplBaseTest +{ + + public void testOrder() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + testNode.addNode("z"); + session.save(); + testNode.addNode("a"); + session.save(); + testNode.addNode("b"); + session.save(); + testNode.addNode("c"); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(4, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderInSession() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(4, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderCombined() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("y"); + session.save(); + + testNode.addNode("c"); + testNode.addNode("a"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(8, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderWithRefreshDiscard() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("y"); + root.refresh(false); // discard added a and y + + testNode.addNode("c"); + testNode.addNode("a"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(6, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + + public void testOrderWithInvalidation() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("y"); + + // add some in another session + Session another =3D repository.login(credentials, root.getSession().= getWorkspace().getName()); + Node anotherTest =3D another.getRootNode().getNode("testNode"); + another.save(); + anotherTest.addNode("a"); + anotherTest.addNode("y"); + another.save(); + another.logout(); + + try + { + session.save(); + fail("Nodes already added in another session, ItemExistsException= should be thrown"); + } + catch (ItemExistsException e) + { + // ok + root.refresh(false); // discard a and y + } + + testNode.addNode("c"); + testNode.addNode("a"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(8, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + = + public void testOrderWithRefreshKeep() throws Exception + { + Node testNode =3D root.addNode("testNode"); + session.save(); + + testNode.addNode("a"); + testNode.addNode("a"); + testNode.addNode("z"); + testNode.addNode("a"); + session.save(); + + // add some in another session + Session another =3D repository.login(credentials, root.getSession().= getWorkspace().getName()); + Node anotherTest =3D another.getRootNode().getNode("testNode"); + another.save(); + anotherTest.addNode("a"); + anotherTest.addNode("y"); + another.save(); + another.logout(); + + //root.refresh(true); // refresh to see another Session + testNode.addNode("a"); + testNode.addNode("y"); + session.save(); + + // check + NodeIterator nodes =3D testNode.getNodes(); + assertEquals(8, nodes.getSize()); + + int order =3D 0; + for (; nodes.hasNext();) + { + NodeImpl n =3D (NodeImpl)nodes.nextNode(); + int orderNumb =3D ((NodeData)n.getData()).getOrderNumber(); + log.info(orderNumb + ": " + n.getPath()); + + assertEquals(order++, orderNumb); + } + } + +} Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/impl/core/TestNodeOrder.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/servi= ces/jcr/load/perf/TestGetNodesPerf.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/load/perf/TestGetNodesPerf.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/load/perf/TestGetNodesPerf.java 2009-11-30 10:36:38 UTC (rev 906) @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2003-2009 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.load.perf; + +import org.exoplatform.services.jcr.JcrAPIBaseTest; +import org.exoplatform.services.jcr.impl.core.SessionImpl; + +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.Session; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: 2009 + * + * @author Anatoliy= Bazko = + * @version $Id$ + */ +public class TestGetNodesPerf extends JcrAPIBaseTest +{ + private static final String testName =3D "testRoot"; + + private static final int sessionCount =3D 10; + + private static final int tryCount =3D 5; + + private Session[] sessions =3D new Session[sessionCount]; + + private GetNodesThread[] threads =3D new GetNodesThread[sessionCount]; + + public void testGetNodes() throws Exception + { + for (int i =3D 0; i < sessionCount; i++) + { + sessions[i] =3D (SessionImpl)repository.login(credentials, "ws"); + } + + Node testRoot =3D session.getRootNode().addNode(testName); + session.save(); + + log.info("adding..."); + int nodesCount =3D 50000; + for (int i =3D 0; i < nodesCount; i++) + { + testRoot.addNode("_" + i + "_node"); + } + log.info("saving..."); + session.save(); + + log.info("waiting for 10 seconds..."); + Thread.sleep(10000); + + System.gc(); + Runtime rt =3D Runtime.getRuntime(); + long usedMemory =3D rt.totalMemory() - rt.freeMemory(); + + log.info("getting nodes..."); + for (int k =3D 0; k < tryCount; k++) + { + for (int i =3D 0; i < sessionCount; i++) + { + threads[i] =3D new GetNodesThread(sessions[i]); + threads[i].start(); + } + + outer : while (true) + { + for (int i =3D 0; i < sessionCount; i++) + { + if (threads[i].isAlive()) + { + Thread.sleep(1000); + continue outer; + } + } + + break; + } + + log.info("waiting for 10 seconds..."); + Thread.sleep(10000); + } + log.info("Memory used: " + (rt.totalMemory() - rt.freeMemory() - use= dMemory) / 1024 / 1024 + "Mb"); + } + + private class GetNodesThread extends Thread + { + private final Session curSession; + + private NodeIterator nodes; + + GetNodesThread(Session session) + { + this.curSession =3D session; + } + + @Override + public void run() + { + try + { + Node testRoot =3D curSession.getRootNode().getNode(testName); + + long startTime =3D System.currentTimeMillis(); + nodes =3D testRoot.getNodes(); + log.info("Total time: " + (System.currentTimeMillis() - startT= ime) + "ms"); + + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } +} Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/load/perf/TestGetNodesPerf.java ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/BaseStandaloneTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/BaseStandaloneTest.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/BaseStandaloneTest.java 2009-11-30 10:36:38 UTC (rev 906) @@ -388,7 +388,7 @@ return testFile; } = - protected void checkMixins(String[] mixins, NodeImpl node) + protected void checkMixins(String[] mixins, NodeImpl node) throws Repos= itoryException { try { Modified: jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/ser= vices/ftp/BaseStandaloneTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/= ftp/BaseStandaloneTest.java 2009-11-29 20:16:22 UTC (rev 905) +++ jcr/trunk/exo.jcr.component.ftp/src/test/java/org/exoplatform/services/= ftp/BaseStandaloneTest.java 2009-11-30 10:36:38 UTC (rev 906) @@ -343,7 +343,7 @@ return testFile; } = - protected void checkMixins(String[] mixins, NodeImpl node) + protected void checkMixins(String[] mixins, NodeImpl node) throws Repos= itoryException { try { --===============8596519177521570231==-- From do-not-reply at jboss.org Mon Nov 30 06:57:22 2009 Content-Type: multipart/mixed; boundary="===============4457390128203539908==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r907 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc and 1 other directory. Date: Mon, 30 Nov 2009 06:57:22 -0500 Message-ID: <200911301157.nAUBvMsl008987@svn01.web.mwc.hst.phx2.redhat.com> --===============4457390128203539908== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: pnedonosko Date: 2009-11-30 06:57:21 -0500 (Mon, 30 Nov 2009) New Revision: 907 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jdbc/JDBCStorageConnection.java Log: EXOJCR-201: Fqn.ROOT handling fix for exists(); comments; delete deprecated= in JDBC conn Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -30 10:36:38 UTC (rev 906) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -30 11:57:21 UTC (rev 907) @@ -109,7 +109,13 @@ this.cache =3D cache; } = - // helpers + /** + * Made for read of ItemData with cache invalidation. + * NOT USED! + * = + * @param node Node + * @return ItemData + */ @Deprecated protected ItemData readItemData(Node node) { @@ -923,7 +929,6 @@ updateChildsACL(childNode, newACL); } } - } = /** Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-30 10:36:38= UTC (rev 906) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-30 11:57:21= UTC (rev 907) @@ -560,7 +560,7 @@ } } } - else if (name.get(0).equals(Fqn.ROOT) || name.get(0).equals(JBoss= CacheStorage.PROPS) + else if (name.equals(Fqn.ROOT) || name.get(0).equals(JBossCacheSt= orage.PROPS) || name.get(0).equals(JBossCacheStorage.NODES) || name.get(0).= equals(JBossCacheStorage.LOCKS) || name.get(0).equals(JBossCacheStorage.REFS)) { Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-30 10:36:38= UTC (rev 906) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-30 11:57:21= UTC (rev 907) @@ -418,6 +418,7 @@ /** * {@inheritDoc} */ + @Deprecated public void delete(NodeData data) throws RepositoryException, Unsupport= edOperationException, InvalidItemStateException, IllegalStateException { @@ -449,6 +450,7 @@ /** * {@inheritDoc} */ + @Deprecated public void delete(PropertyData data) throws RepositoryException, Unsup= portedOperationException, InvalidItemStateException, IllegalStateException { --===============4457390128203539908==-- From do-not-reply at jboss.org Mon Nov 30 11:41:43 2009 Content-Type: multipart/mixed; boundary="===============7626445603702737019==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r908 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache. Date: Mon, 30 Nov 2009 11:41:43 -0500 Message-ID: <200911301641.nAUGfhbW003809@svn01.web.mwc.hst.phx2.redhat.com> --===============7626445603702737019== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2009-11-30 11:41:43 -0500 (Mon, 30 Nov 2009) New Revision: 908 Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/ser= vices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java Log: EXOJCR-243: reimplemented addLockData() method using Node.putIfAbent() to p= revent concurrency race situation. Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatf= orm/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -30 11:57:21 UTC (rev 907) +++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11= -30 16:41:43 UTC (rev 908) @@ -300,7 +300,7 @@ InvalidItemStateException, IllegalStateException { startBatch(); - = + // check if parent is cached Node parent =3D nodesRoot.getChild(makeNodeFqn= (data.getParentIdentifier())); if (parent =3D=3D null) @@ -1339,33 +1339,31 @@ { throw new RepositoryException("Lock data to write can't be null!"= ); } - // check that there is no lock data for given node - Node node =3D locksRoot.getChild(makeNodeFqn(l= ockData.getNodeIdentifier())); - // node is not null: check if lockData exists - if (node !=3D null) + // addChild will add if absent or return old if present + Node node =3D locksRoot.addChild(makeNodeFqn(l= ockData.getNodeIdentifier())); + // this will prevent from deleting by eviction. + node.setResident(true); + + // this will return null if success. And old data if something exist= s... + LockData oldLockData =3D (LockData)node.putIfAbsent(JBossCacheStorag= e.LOCK_DATA, lockData); + // if oldLockData is present (not null): + // 1. this is Lock.refresh(): oldLockData and lockData will have the= same tokens = + // 2. this node is already locked: data-s will have different tokens + + if (oldLockData !=3D null) { - LockData oldLockData =3D (LockData)node.get(JBossCacheStorage.LOC= K_DATA); - // if old data exists and hash differs, then it was newly locked!= Exception, can't lock - // already locked node. - if (oldLockData !=3D null && oldLockData.getTokenHash() !=3D lock= Data.getTokenHash()) + // if LockData already present with different lock token, then no= de has already been locked! = + if (oldLockData.getTokenHash() !=3D lockData.getTokenHash()) { throw new LockException("Unable to write lock data. Node [" + = lockData.getNodeIdentifier() + "] already has LockData!"); } + else + { + // token is the same, then Lock is just refreshed. Putting new= LockData. + node.put(JBossCacheStorage.LOCK_DATA, lockData); + } } - else - { - // JBoss node doesn't exists, create it - node =3D locksRoot.addChild(makeNodeFqn(lockData.getNodeIdentifie= r())); - node.setResident(true); - } - // try to write LockData = - if (node =3D=3D null) - { - throw new RepositoryException("Unable to write to cache!"); - } - // this will prevent from deleting it by eviction. - node.put(JBossCacheStorage.LOCK_DATA, lockData); } = /** --===============7626445603702737019==--