From do-not-reply at jboss.org Fri Oct 1 03:20:13 2010 Content-Type: multipart/mixed; boundary="===============0982080440701988258==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3228 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Fri, 01 Oct 2010 03:20:12 -0400 Message-ID: <201010010720.o917KCvC028326@svn01.web.mwc.hst.phx2.redhat.com> --===============0982080440701988258== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-01 03:20:11 -0400 (Fri, 01 Oct 2010) New Revision: 3228 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/exojcr-backup-service.xml Log: EXOJCR-747 : Make backup restore easier documentation. Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/exojcr-backup-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-09-30 15:29:38 UTC (rev = 3227) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-10-01 07:20:11 UTC (rev = 3228) @@ -478,9 +478,15 @@
Restore existing workspace or repository = + + Restore of existing workspace or repository will be available = from + JCR 1.14.0-CR1. + + Restore of existed system workspace was not supported. When ne= ed - restore of system workspace, than we need restore all repository. + restore of system workspace, than we need restore full + repository. = The resore of existed workspace or repositry is avaleble. --===============0982080440701988258==-- From do-not-reply at jboss.org Fri Oct 1 05:05:09 2010 Content-Type: multipart/mixed; boundary="===============5516755832324090677==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3229 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version. Date: Fri, 01 Oct 2010 05:05:09 -0400 Message-ID: <201010010905.o91959Nf012598@svn01.web.mwc.hst.phx2.redhat.com> --===============5516755832324090677== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-01 05:05:08 -0400 (Fri, 01 Oct 2010) New Revision: 3229 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/version/ItemDataRestoreVisitor.java Log: EXOJCR-961: remain node only for versionable node and OnParentVersionAction= is VERSION for other cases all works accordingly to spec Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/version/ItemDataRestoreVisitor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ItemDataRestoreVisitor.java 2010-10-01 07:20:11 UTC = (rev 3228) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/version/ItemDataRestoreVisitor.java 2010-10-01 09:05:08 UTC = (rev 3229) @@ -199,11 +199,7 @@ nodeTypeDataManager.getChildNodeDefinition(node.getQPath().= getName(), parent.getPrimaryTypeName(), parent.getMixinTypeNames()).getOnParentVersion(); = - // ItemDataCopyIgnoredVisitory - if (onParentVersion !=3D OnParentVersionAction.COPY - && onParentVersion !=3D OnParentVersionAction.VERSION - && onParentVersion !=3D OnParentVersionAction.IGNORE - || onParentVersion =3D=3D OnParentVersionAction.VERSION + if (onParentVersion =3D=3D OnParentVersionAction.VERSION && nodeTypeDataManager.isNodeType(Constants.MIX_VERSIONABLE= , node.getPrimaryTypeName(), node.getMixinTypeNames())) { --===============5516755832324090677==-- From do-not-reply at jboss.org Fri Oct 1 05:12:12 2010 Content-Type: multipart/mixed; boundary="===============9177543159759156077==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3230 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Fri, 01 Oct 2010 05:12:12 -0400 Message-ID: <201010010912.o919CCQV012830@svn01.web.mwc.hst.phx2.redhat.com> --===============9177543159759156077== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-01 05:12:11 -0400 (Fri, 01 Oct 2010) New Revision: 3230 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/exojcr-backup-service.xml Log: EXOJCR-747: fix doc Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/exojcr-backup-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-10-01 09:05:08 UTC (rev = 3229) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-10-01 09:12:11 UTC (rev = 3230) @@ -6,6 +6,11 @@ = eXo JCR Backup Service = + + Restore of system workspace is not supported only as part of + restoring of whole repository. + +
Concept = @@ -479,16 +484,10 @@ Restore existing workspace or repository = - Restore of existing workspace or repository will be available = from - JCR 1.14.0-CR1. + Restoring of existing workspace or repository available from J= CR + 1.14.0-CR1. = - - Restore of existed system workspace was not supported. When ne= ed - restore of system workspace, than we need restore full - repository. - - The resore of existed workspace or repositry is avaleble. = For restore will be used spacial methods: --===============9177543159759156077==-- From do-not-reply at jboss.org Fri Oct 1 06:14:43 2010 Content-Type: multipart/mixed; boundary="===============3040729238034492070==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3231 - in jcr/trunk/exo.jcr.component.webdav/src: test/java/org/exoplatform/services/jcr/webdav/command and 1 other directories. Date: Fri, 01 Oct 2010 06:14:43 -0400 Message-ID: <201010011014.o91AEhlg021540@svn01.web.mwc.hst.phx2.redhat.com> --===============3040729238034492070== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2010-10-01 06:14:43 -0400 (Fri, 01 Oct 2010) New Revision: 3231 Added: jcr/trunk/exo.jcr.component.webdav/src/test/resources/rh_nodetype.xml jcr/trunk/exo.jcr.component.webdav/src/test/resources/test.txt Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/resource/FileResource.java jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/service= s/jcr/webdav/command/TestGet.java Log: EXOJCR-956 : Returning creation date if last modified date is missing. Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/resource/FileResource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resource/FileResource.java 2010-10-01 09:12:11 UTC (rev 3230) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/resource/FileResource.java 2010-10-01 10:14:43 UTC (rev 3231) @@ -222,7 +222,15 @@ } else if (name.equals(GETLASTMODIFIED)) { - Calendar modified =3D contentNode().getProperty("jcr:lastModified= ").getDate(); + Calendar modified; + try + { + modified =3D contentNode().getProperty("jcr:lastModified").get= Date(); + } + catch (PathNotFoundException e) + { + modified =3D node.getProperty("jcr:created").getDate(); + } HierarchicalProperty lastModified =3D new HierarchicalProperty(na= me, modified, MODIFICATION_PATTERN); lastModified.setAttribute("b:dt", "dateTime.rfc1123"); return lastModified; @@ -268,7 +276,9 @@ return lockDiscovery(token, owner, "86400"); } else + { throw new PathNotFoundException(); + } } else if (name.equals(ISVERSIONED)) { Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/= services/jcr/webdav/command/TestGet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestGet.java 2010-10-01 09:12:11 UTC (rev 3230) +++ jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestGet.java 2010-10-01 10:14:43 UTC (rev 3231) @@ -19,18 +19,28 @@ package org.exoplatform.services.jcr.webdav.command; = import org.exoplatform.common.http.HTTPStatus; +import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.impl.core.version.VersionImpl; import org.exoplatform.services.jcr.webdav.BaseStandaloneTest; import org.exoplatform.services.jcr.webdav.WebDavConstants.WebDAVMethods; import org.exoplatform.services.jcr.webdav.utils.TestUtils; +import org.exoplatform.services.rest.ext.provider.XSLTStreamingOutput; import org.exoplatform.services.rest.impl.ContainerResponse; = import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; +import java.util.Calendar; = +import javax.jcr.Node; + /** * Created by The eXo Platform SAS Author : Dmytro Katayev * work.visor.ck(a)gmail.com Aug 13, 2008 @@ -59,17 +69,61 @@ StringWriter sw =3D new StringWriter(); char[] buffer =3D new char[1024]; for (int n; (n =3D r.read(buffer)) !=3D -1;) + { sw.write(buffer, 0, n); + } String str =3D sw.toString(); assertEquals(fileContent, str); } - = + public void testNotFoundGet() throws Exception { ContainerResponse response =3D service(WebDAVMethods.GET, getPathWS(= ) + "/not-found" + path, "", null, null); assertEquals(HTTPStatus.NOT_FOUND, response.getStatus()); } = + /** + * Details can be found here: https://jira.jboss.org/browse/EXOJCR-956 + * @throws Exception + */ + public void testMissingJcrLastModifiedProperty() throws Exception + { + File file =3D new File("src/test/resources/rh_nodetype.xml"); + assertTrue("src/test/resources/rh_nodetype.xml not found", file.exis= ts()); + FileInputStream fis =3D new FileInputStream(file); + + session.getWorkspace().getNamespaceRegistry().registerNamespace("rh"= , "www.vn.vnn"); + session.getWorkspace().getNodeTypesHolder().registerNodeTypes(fis, E= xtendedNodeTypeManager.IGNORE_IF_EXISTS, + NodeTypeDataManager.TEXT_XML); + + Node podcast =3D session.getRootNode().addNode("podcast", "rh:podcas= t"); + + Node nodeToAdd =3D podcast.addNode("rh:podcastFile", "nt:file"); + Node contentNodeOfNodeToAdd =3D nodeToAdd.addNode("jcr:content", "nt= :resource"); + contentNodeOfNodeToAdd.setProperty("jcr:data", new FileInputStream("= src/test/resources/test.txt")); + contentNodeOfNodeToAdd.setProperty("jcr:mimeType", "text/plain"); + contentNodeOfNodeToAdd.setProperty("jcr:lastModified", Calendar.getI= nstance()); + session.save(); + + podcast.addMixin("mix:versionable"); + session.save(); + + VersionImpl v =3D (VersionImpl)podcast.checkin(); + session.save(); + + podcast.checkout(); + session.save(); + + String path =3D + getPathWS() + "/jcr:system/jcr:versionStorage/" + v.getContaining= History().getIdentifier() + + "/1/jcr:frozenNode/rh:podcastFile"; + + ContainerResponse response =3D service(WebDAVMethods.GET, path, "", = null, null); + assertEquals("Successful result expected (200), but actual is: " + r= esponse.getStatus(), 200, response + .getStatus()); + + } + @Override protected String getRepositoryName() { Added: jcr/trunk/exo.jcr.component.webdav/src/test/resources/rh_nodetype.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/rh_nodetype.xml = (rev 0) +++ jcr/trunk/exo.jcr.component.webdav/src/test/resources/rh_nodetype.xml 2= 010-10-01 10:14:43 UTC (rev 3231) @@ -0,0 +1,52 @@ + + + +nt:base + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +nt:file + + + + + \ No newline at end of file Property changes on: jcr/trunk/exo.jcr.component.webdav/src/test/resources/= rh_nodetype.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/trunk/exo.jcr.component.webdav/src/test/resources/test.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/trunk/exo.jcr.component.webdav/src/test/resources/test.txt = (rev 0) +++ jcr/trunk/exo.jcr.component.webdav/src/test/resources/test.txt 2010-10-= 01 10:14:43 UTC (rev 3231) @@ -0,0 +1,3 @@ +hello = +its a little text file for server tests +Here is all right, I suppose :^) \ No newline at end of file Property changes on: jcr/trunk/exo.jcr.component.webdav/src/test/resources/= test.txt ___________________________________________________________________ Name: svn:mime-type + text/plain --===============3040729238034492070==-- From do-not-reply at jboss.org Mon Oct 4 04:34:25 2010 Content-Type: multipart/mixed; boundary="===============1794667923815851624==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3232 - in jcr/branches/1.12.x/exo.jcr.component.webdav/src: test/java/org/exoplatform/services/jcr/webdav/command and 1 other directories. Date: Mon, 04 Oct 2010 04:34:25 -0400 Message-ID: <201010040834.o948YPA3008823@svn01.web.mwc.hst.phx2.redhat.com> --===============1794667923815851624== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2010-10-04 04:34:24 -0400 (Mon, 04 Oct 2010) New Revision: 3232 Added: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/rh_nodet= ype.xml jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/test.txt Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatfo= rm/services/jcr/webdav/resource/FileResource.java jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatfo= rm/services/jcr/webdav/command/TestGet.java Log: JCR-1467: applying the patch Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/ex= oplatform/services/jcr/webdav/resource/FileResource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/resource/FileResource.java 2010-10-01 10:14:43 UTC = (rev 3231) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/resource/FileResource.java 2010-10-04 08:34:24 UTC = (rev 3232) @@ -222,7 +222,15 @@ } else if (name.equals(GETLASTMODIFIED)) { - Calendar modified =3D contentNode().getProperty("jcr:lastModified= ").getDate(); + Calendar modified; + try + { + modified =3D contentNode().getProperty("jcr:lastModified").get= Date(); + } + catch (PathNotFoundException e) + { + modified =3D node.getProperty("jcr:created").getDate(); + } HierarchicalProperty lastModified =3D new HierarchicalProperty(na= me, modified, MODIFICATION_PATTERN); lastModified.setAttribute("b:dt", "dateTime.rfc1123"); return lastModified; @@ -268,7 +276,9 @@ return lockDiscovery(token, owner, "86400"); } else + { throw new PathNotFoundException(); + } } else if (name.equals(ISVERSIONED)) { Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/ex= oplatform/services/jcr/webdav/command/TestGet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatf= orm/services/jcr/webdav/command/TestGet.java 2010-10-01 10:14:43 UTC (rev 3= 231) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatf= orm/services/jcr/webdav/command/TestGet.java 2010-10-04 08:34:24 UTC (rev 3= 232) @@ -19,18 +19,28 @@ package org.exoplatform.services.jcr.webdav.command; = import org.exoplatform.common.http.HTTPStatus; +import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.impl.core.version.VersionImpl; import org.exoplatform.services.jcr.webdav.BaseStandaloneTest; import org.exoplatform.services.jcr.webdav.WebDavConstants.WebDAVMethods; import org.exoplatform.services.jcr.webdav.utils.TestUtils; +import org.exoplatform.services.rest.ext.provider.XSLTStreamingOutput; import org.exoplatform.services.rest.impl.ContainerResponse; = import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; +import java.util.Calendar; = +import javax.jcr.Node; + /** * Created by The eXo Platform SAS Author : Dmytro Katayev * work.visor.ck(a)gmail.com Aug 13, 2008 @@ -59,17 +69,61 @@ StringWriter sw =3D new StringWriter(); char[] buffer =3D new char[1024]; for (int n; (n =3D r.read(buffer)) !=3D -1;) + { sw.write(buffer, 0, n); + } String str =3D sw.toString(); assertEquals(fileContent, str); } - = + public void testNotFoundGet() throws Exception { ContainerResponse response =3D service(WebDAVMethods.GET, getPathWS(= ) + "/not-found" + path, "", null, null); assertEquals(HTTPStatus.NOT_FOUND, response.getStatus()); } = + /** + * Details can be found here: https://jira.jboss.org/browse/EXOJCR-956 + * @throws Exception + */ + public void testMissingJcrLastModifiedProperty() throws Exception + { + File file =3D new File("src/test/resources/rh_nodetype.xml"); + assertTrue("src/test/resources/rh_nodetype.xml not found", file.exis= ts()); + FileInputStream fis =3D new FileInputStream(file); + + session.getWorkspace().getNamespaceRegistry().registerNamespace("rh"= , "www.vn.vnn"); + session.getWorkspace().getNodeTypesHolder().registerNodeTypes(fis, E= xtendedNodeTypeManager.IGNORE_IF_EXISTS, + NodeTypeDataManager.TEXT_XML); + + Node podcast =3D session.getRootNode().addNode("podcast", "rh:podcas= t"); + + Node nodeToAdd =3D podcast.addNode("rh:podcastFile", "nt:file"); + Node contentNodeOfNodeToAdd =3D nodeToAdd.addNode("jcr:content", "nt= :resource"); + contentNodeOfNodeToAdd.setProperty("jcr:data", new FileInputStream("= src/test/resources/test.txt")); + contentNodeOfNodeToAdd.setProperty("jcr:mimeType", "text/plain"); + contentNodeOfNodeToAdd.setProperty("jcr:lastModified", Calendar.getI= nstance()); + session.save(); + + podcast.addMixin("mix:versionable"); + session.save(); + + VersionImpl v =3D (VersionImpl)podcast.checkin(); + session.save(); + + podcast.checkout(); + session.save(); + + String path =3D + getPathWS() + "/jcr:system/jcr:versionStorage/" + v.getContaining= History().getIdentifier() + + "/1/jcr:frozenNode/rh:podcastFile"; + + ContainerResponse response =3D service(WebDAVMethods.GET, path, "", = null, null); + assertEquals("Successful result expected (200), but actual is: " + r= esponse.getStatus(), 200, response + .getStatus()); + + } + @Override protected String getRepositoryName() { Added: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/rh_n= odetype.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/rh_node= type.xml (rev 0) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/rh_node= type.xml 2010-10-04 08:34:24 UTC (rev 3232) @@ -0,0 +1,52 @@ + + + +nt:base + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +nt:file + + + + + \ No newline at end of file Property changes on: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/= resources/rh_nodetype.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Added: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/test= .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/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/test.tx= t (rev 0) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/resources/test.tx= t 2010-10-04 08:34:24 UTC (rev 3232) @@ -0,0 +1,3 @@ +hello = +its a little text file for server tests +Here is all right, I suppose :^) \ No newline at end of file Property changes on: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/= resources/test.txt ___________________________________________________________________ Name: svn:mime-type + text/plain --===============1794667923815851624==-- From do-not-reply at jboss.org Mon Oct 4 06:38:01 2010 Content-Type: multipart/mixed; boundary="===============5452106933295453780==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3233 - jcr/tags/1.14.0-Beta02. Date: Mon, 04 Oct 2010 06:38:01 -0400 Message-ID: <201010041038.o94Ac1ZK026262@svn01.web.mwc.hst.phx2.redhat.com> --===============5452106933295453780== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-04 06:38:01 -0400 (Mon, 04 Oct 2010) New Revision: 3233 Modified: jcr/tags/1.14.0-Beta02/pom.xml Log: [maven-release-plugin] prepare branch 1.14-CNK Modified: jcr/tags/1.14.0-Beta02/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.14.0-Beta02/pom.xml 2010-10-04 08:34:24 UTC (rev 3232) +++ jcr/tags/1.14.0-Beta02/pom.xml 2010-10-04 10:38:01 UTC (rev 3233) @@ -34,9 +34,9 @@ eXo JCR = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/1.= 14.0-Beta02 - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= ags/1.14.0-Beta02 - http://fisheye.jboss.org/browse/exo-jcr/jcr/tags/1.14.0-Beta02 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.14-CNK + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.14-CNK + http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.14-CNK = --===============5452106933295453780==-- From do-not-reply at jboss.org Mon Oct 4 06:38:19 2010 Content-Type: multipart/mixed; boundary="===============0108486488028965454==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3234 - in jcr/branches: 1.14-CNK and 1 other directory. Date: Mon, 04 Oct 2010 06:38:19 -0400 Message-ID: <201010041038.o94AcJp0026273@svn01.web.mwc.hst.phx2.redhat.com> --===============0108486488028965454== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-04 06:38:19 -0400 (Mon, 04 Oct 2010) New Revision: 3234 Added: jcr/branches/1.14-CNK/ jcr/branches/1.14-CNK/pom.xml Removed: jcr/branches/1.14-CNK/pom.xml Log: [maven-release-plugin] copy for branch 1.14-CNK Copied: jcr/branches/1.14-CNK (from rev 3232, jcr/tags/1.14.0-Beta02) Deleted: jcr/branches/1.14-CNK/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.14.0-Beta02/pom.xml 2010-10-04 08:34:24 UTC (rev 3232) +++ jcr/branches/1.14-CNK/pom.xml 2010-10-04 10:38:19 UTC (rev 3234) @@ -1,471 +0,0 @@ - - - - 4.0.0 - - org.exoplatform - foundation-parent - 7 - - - org.exoplatform.jcr - jcr-parent - 1.14.0-Beta02 - pom - eXo JCR - - - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/1.= 14.0-Beta02 - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= ags/1.14.0-Beta02 - http://fisheye.jboss.org/browse/exo-jcr/jcr/tags/1.14.0-Beta02 - - - - exo-jcr - 1.14 - 2.3.0-Beta02 - 2.4.0-Beta02 - 2.2.0-Beta02 - 1 - - - - - - org.exoplatform.kernel - exo.kernel.commons - ${org.exoplatform.kernel.version} - - - org.exoplatform.kernel - exo.kernel.commons.test - ${org.exoplatform.kernel.version} - - - 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.component.ext - ${project.version} - - - org.exoplatform.jcr - exo.jcr.component.core - ${project.version} - - - org.exoplatform.jcr - 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.web - ${project.version} - - - org.exoplatform.jcr - exo.jcr.framework.ftpclient - ${project.version} - - - org.exoplatform.jcr - exo.jcr.cluster.testclient - ${project.version} - - - org.exoplatform.jcr - exo.jcr.applications.fckeditor - ${project.version} - war - - - org.exoplatform.jcr - exo.jcr.applications.browser - ${project.version} - war - - - org.exoplatform.jcr - exo.jcr.applications.rest - ${project.version} - war - - - org.exoplatform.jcr - exo.jcr.connectors.localadapter - rar - ${project.version} - - - commons-lang - commons-lang - 2.4 - - - commons-chain - commons-chain - 1.0 - - - org.jibx - jibx-run - 1.2.1 - - - picocontainer - picocontainer - 1.1 - - - xml-apis - xml-apis - 1.0.b2 - - - org.slf4j - slf4j-api - 1.5.8 - - - org.slf4j - slf4j-log4j12 - 1.5.8 - = - - stax - stax-api - 1.0.1 - - - javax.jcr - jcr - 1.0 - - - javax.servlet - servlet-api - 2.4 - - - javax.annotation - jsr250-api - 1.0 - - - javax.ws.rs - jsr311-api - 1.0 - - - javax.transaction - jta - 1.0.1B - - - 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 - - - com.sun.xml.stream - sjsxp - 1.0 - - - commons-dbcp - commons-dbcp - 1.2.2 - - - commons-pool - commons-pool - - - - - commons-pool - commons-pool - 1.5.4 - - - commons-beanutils - commons-beanutils - 1.8.0 - - - commons-logging - commons-logging - 1.1 - - - javax.xml.stream - stax-api - 1.0 - = - - xpp3 - xpp3 - 1.1.3.4.O - = - - concurrent - concurrent - 1.3.4 - - - commons-collections - commons-collections - 3.2 - - - org.apache.ws.commons - ws-commons-util - 1.0.1 - - - org.apache.jackrabbit - jackrabbit-jcr-tests - 1.6.0 - sources - - - hsqldb - hsqldb - 1.8.0.7 - - - jgroups - jgroups - 2.6.13.GA - - - commons-fileupload - commons-fileupload - 1.2.1 - - - com.sun.xml.bind - jaxb-impl - 2.1.7 - - - javax.resource - connector - 1.5 - - - commons-io - commons-io - 1.3 - - - org.jboss.cache - jbosscache-core - 3.2.6.GA - - - jboss.jbossts - jbossjts - 4.6.1.GA - - - jboss.jbossts - jbossts-common - 4.6.1.GA - - - org.aspectj - aspectjrt - 1.6.8 - = - - - - - junit - junit - test - - - org.slf4j - slf4j-log4j12 - test - = - - - - - src/main/java - - **/*.xml - **/*.xsl - **/*.properties - **/*.ion - **/*.conf - **/*.config - - - - src/main/resources - - **/*.xml - **/*.xsl - **/*.properties - **/login.conf - **/*.ion - **/*.conf - **/*.config - - - - - - src/test/java - - **/*.properties - **/*.xml - **/*.txt - **/*.conf - **/*.config - - - - src/test/resources - - **/*.properties - **/*.xml - **/*.txt - **/*.conf - **/*.config - - - - - - exo.jcr.component.core - exo.jcr.component.statistics - exo.jcr.component.ext - exo.jcr.component.ftp - exo.jcr.component.webdav - exo.jcr.connectors.localadapter - exo.jcr.framework.command - exo.jcr.framework.web - exo.jcr.framework.ftpclient - applications - exo.jcr.docs - packaging/module - - Copied: jcr/branches/1.14-CNK/pom.xml (from rev 3233, jcr/tags/1.14.0-Beta0= 2/pom.xml) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/pom.xml (rev 0) +++ jcr/branches/1.14-CNK/pom.xml 2010-10-04 10:38:19 UTC (rev 3234) @@ -0,0 +1,471 @@ + + + + 4.0.0 + + org.exoplatform + foundation-parent + 7 + + + org.exoplatform.jcr + jcr-parent + 1.14.0-Beta02 + pom + eXo JCR + + + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.14-CNK + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.14-CNK + http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.14-CNK + + + + exo-jcr + 1.14 + 2.3.0-Beta02 + 2.4.0-Beta02 + 2.2.0-Beta02 + 1 + + + + + + org.exoplatform.kernel + exo.kernel.commons + ${org.exoplatform.kernel.version} + + + org.exoplatform.kernel + exo.kernel.commons.test + ${org.exoplatform.kernel.version} + + + 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.component.ext + ${project.version} + + + org.exoplatform.jcr + exo.jcr.component.core + ${project.version} + + + org.exoplatform.jcr + 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.web + ${project.version} + + + org.exoplatform.jcr + exo.jcr.framework.ftpclient + ${project.version} + + + org.exoplatform.jcr + exo.jcr.cluster.testclient + ${project.version} + + + org.exoplatform.jcr + exo.jcr.applications.fckeditor + ${project.version} + war + + + org.exoplatform.jcr + exo.jcr.applications.browser + ${project.version} + war + + + org.exoplatform.jcr + exo.jcr.applications.rest + ${project.version} + war + + + org.exoplatform.jcr + exo.jcr.connectors.localadapter + rar + ${project.version} + + + commons-lang + commons-lang + 2.4 + + + commons-chain + commons-chain + 1.0 + + + org.jibx + jibx-run + 1.2.1 + + + picocontainer + picocontainer + 1.1 + + + xml-apis + xml-apis + 1.0.b2 + + + org.slf4j + slf4j-api + 1.5.8 + + + org.slf4j + slf4j-log4j12 + 1.5.8 + = + + stax + stax-api + 1.0.1 + + + javax.jcr + jcr + 1.0 + + + javax.servlet + servlet-api + 2.4 + + + javax.annotation + jsr250-api + 1.0 + + + javax.ws.rs + jsr311-api + 1.0 + + + javax.transaction + jta + 1.0.1B + + + 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 + + + com.sun.xml.stream + sjsxp + 1.0 + + + commons-dbcp + commons-dbcp + 1.2.2 + + + commons-pool + commons-pool + + + + + commons-pool + commons-pool + 1.5.4 + + + commons-beanutils + commons-beanutils + 1.8.0 + + + commons-logging + commons-logging + 1.1 + + + javax.xml.stream + stax-api + 1.0 + = + + xpp3 + xpp3 + 1.1.3.4.O + = + + concurrent + concurrent + 1.3.4 + + + commons-collections + commons-collections + 3.2 + + + org.apache.ws.commons + ws-commons-util + 1.0.1 + + + org.apache.jackrabbit + jackrabbit-jcr-tests + 1.6.0 + sources + + + hsqldb + hsqldb + 1.8.0.7 + + + jgroups + jgroups + 2.6.13.GA + + + commons-fileupload + commons-fileupload + 1.2.1 + + + com.sun.xml.bind + jaxb-impl + 2.1.7 + + + javax.resource + connector + 1.5 + + + commons-io + commons-io + 1.3 + + + org.jboss.cache + jbosscache-core + 3.2.6.GA + + + jboss.jbossts + jbossjts + 4.6.1.GA + + + jboss.jbossts + jbossts-common + 4.6.1.GA + + + org.aspectj + aspectjrt + 1.6.8 + = + + + + + junit + junit + test + + + org.slf4j + slf4j-log4j12 + test + = + + + + + src/main/java + + **/*.xml + **/*.xsl + **/*.properties + **/*.ion + **/*.conf + **/*.config + + + + src/main/resources + + **/*.xml + **/*.xsl + **/*.properties + **/login.conf + **/*.ion + **/*.conf + **/*.config + + + + + + src/test/java + + **/*.properties + **/*.xml + **/*.txt + **/*.conf + **/*.config + + + + src/test/resources + + **/*.properties + **/*.xml + **/*.txt + **/*.conf + **/*.config + + + + + + exo.jcr.component.core + exo.jcr.component.statistics + exo.jcr.component.ext + exo.jcr.component.ftp + exo.jcr.component.webdav + exo.jcr.connectors.localadapter + exo.jcr.framework.command + exo.jcr.framework.web + exo.jcr.framework.ftpclient + applications + exo.jcr.docs + packaging/module + + --===============0108486488028965454==-- From do-not-reply at jboss.org Mon Oct 4 07:16:53 2010 Content-Type: multipart/mixed; boundary="===============7700525832356817790==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3235 - in jcr/branches/1.14-CNK: applications and 24 other directories. Date: Mon, 04 Oct 2010 07:16:53 -0400 Message-ID: <201010041116.o94BGrh6002054@svn01.web.mwc.hst.phx2.redhat.com> --===============7700525832356817790== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-04 07:16:53 -0400 (Mon, 04 Oct 2010) New Revision: 3235 Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.backupconsole/po= m.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.browser/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.config/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.fckeditor/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.jboss/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.jetty/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.jonas/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.rest/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.applications.tomcat/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.cluster.testclient/pom.xml jcr/branches/1.14-CNK/applications/exo.jcr.ear/pom.xml jcr/branches/1.14-CNK/applications/pom.xml jcr/branches/1.14-CNK/exo.jcr.component.core/pom.xml jcr/branches/1.14-CNK/exo.jcr.component.ext/pom.xml jcr/branches/1.14-CNK/exo.jcr.component.ftp/pom.xml jcr/branches/1.14-CNK/exo.jcr.component.statistics/pom.xml jcr/branches/1.14-CNK/exo.jcr.component.webdav/pom.xml jcr/branches/1.14-CNK/exo.jcr.connectors.localadapter/pom.xml jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/pom.xml jcr/branches/1.14-CNK/exo.jcr.docs/pom.xml jcr/branches/1.14-CNK/exo.jcr.framework.command/pom.xml jcr/branches/1.14-CNK/exo.jcr.framework.ftpclient/pom.xml jcr/branches/1.14-CNK/exo.jcr.framework.web/pom.xml jcr/branches/1.14-CNK/packaging/module/pom.xml jcr/branches/1.14-CNK/pom.xml Log: EXOJCR-987: prepare branch 1.14-CNK Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.backupcon= sole/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/applications/exo.jcr.applications.backupconsole/p= om.xml 2010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.backupconsole/p= om.xml 2010-10-04 11:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.applications.backupconsole eXo JCR :: Applications :: Backup Console Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.browser/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/applications/exo.jcr.applications.browser/pom.xml= 2010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.browser/pom.xml= 2010-10-04 11:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.applications.browser war Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.config/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/branches/1.14-CNK/applications/exo.jcr.applications.config/pom.xml = 2010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.config/pom.xml = 2010-10-04 11:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.applications.config pom Modified: jcr/branches/1.14-CNK/applications/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/branches/1.14-CNK/applications/exo.jcr.applications.fckeditor/pom.x= ml 2010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.fckeditor/pom.x= ml 2010-10-04 11:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.applications.fckeditor war Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.jboss/pom= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/applications/exo.jcr.applications.jboss/pom.xml 2= 010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.jboss/pom.xml 2= 010-10-04 11:16:53 UTC (rev 3235) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT ear runtime Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.jetty/pom= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/applications/exo.jcr.applications.jetty/pom.xml 2= 010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.jetty/pom.xml 2= 010-10-04 11:16:53 UTC (rev 3235) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.applications.config = Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.jonas/pom= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/applications/exo.jcr.applications.jonas/pom.xml 2= 010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.jonas/pom.xml 2= 010-10-04 11:16:53 UTC (rev 3235) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT ear runtime Modified: jcr/branches/1.14-CNK/applications/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/branches/1.14-CNK/applications/exo.jcr.applications.rest/pom.xml 20= 10-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.rest/pom.xml 20= 10-10-04 11:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.applications.rest war Modified: jcr/branches/1.14-CNK/applications/exo.jcr.applications.tomcat/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/branches/1.14-CNK/applications/exo.jcr.applications.tomcat/pom.xml = 2010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.applications.tomcat/pom.xml = 2010-10-04 11:16:53 UTC (rev 3235) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.applications.config = Modified: jcr/branches/1.14-CNK/applications/exo.jcr.cluster.testclient/pom= .xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/applications/exo.jcr.cluster.testclient/pom.xml 2= 010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.cluster.testclient/pom.xml 2= 010-10-04 11:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.cluster.testclient eXo JCR :: Cluster :: Test Client Modified: jcr/branches/1.14-CNK/applications/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.14-CNK/applications/exo.jcr.ear/pom.xml 2010-10-04 10:38= :19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/applications/exo.jcr.ear/pom.xml 2010-10-04 11:16= :53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.ear ear Modified: jcr/branches/1.14-CNK/applications/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/applications/pom.xml 2010-10-04 10:38:19 UTC (rev= 3234) +++ jcr/branches/1.14-CNK/applications/pom.xml 2010-10-04 11:16:53 UTC (rev= 3235) @@ -22,12 +22,12 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT = 4.0.0 jcr-applications-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT = eXo JCR :: Applications :: Reactor pom Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.component.core/pom.xml 2010-10-04 10:38:1= 9 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/pom.xml 2010-10-04 11:16:5= 3 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.component.core eXo JCR :: Component :: Core Service Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.component.ext/pom.xml 2010-10-04 10:38:19= UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.component.ext/pom.xml 2010-10-04 11:16:53= UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.component.ext eXo JCR :: Component :: Extension Service Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.component.ftp/pom.xml 2010-10-04 10:38:19= UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.component.ftp/pom.xml 2010-10-04 11:16:53= UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.component.ftp eXo JCR :: Component :: FTP Service Modified: jcr/branches/1.14-CNK/exo.jcr.component.statistics/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.statistics/pom.xml 2010-10-04 1= 0:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.component.statistics/pom.xml 2010-10-04 1= 1:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.component.statistics eXo JCR :: Component :: Statistics Provider Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.component.webdav/pom.xml 2010-10-04 10:38= :19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.component.webdav/pom.xml 2010-10-04 11:16= :53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.component.webdav eXo JCR :: Component :: Webdav Service Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.connectors.localadapter/pom.xml 2010-10-0= 4 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.connectors.localadapter/pom.xml 2010-10-0= 4 11:16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.connectors.localadapter rar Modified: jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/en/pom.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 20= 10-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 20= 10-10-04 11:16:53 UTC (rev 3235) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs.developer - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2010-= 10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2010-= 10-04 11:16:53 UTC (rev 3235) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.14-CNK/exo.jcr.docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.docs/pom.xml 2010-10-04 10:38:19 UTC (rev= 3234) +++ jcr/branches/1.14-CNK/exo.jcr.docs/pom.xml 2010-10-04 11:16:53 UTC (rev= 3235) @@ -22,7 +22,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.framework.command/pom.xml 2010-10-04 10:3= 8:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.framework.command/pom.xml 2010-10-04 11:1= 6:53 UTC (rev 3235) @@ -12,7 +12,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.framework.command eXo JCR :: Framework :: Command Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.framework.ftpclient/pom.xml 2010-10-04 10= :38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.framework.ftpclient/pom.xml 2010-10-04 11= :16:53 UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.framework.ftpclient eXo JCR :: Framework :: FTP Client Modified: jcr/branches/1.14-CNK/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.14-CNK/exo.jcr.framework.web/pom.xml 2010-10-04 10:38:19= UTC (rev 3234) +++ jcr/branches/1.14-CNK/exo.jcr.framework.web/pom.xml 2010-10-04 11:16:53= UTC (rev 3235) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT exo.jcr.framework.web eXo JCR :: Framework :: Web Modified: jcr/branches/1.14-CNK/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.14-CNK/packaging/module/pom.xml 2010-10-04 10:38:19 UTC = (rev 3234) +++ jcr/branches/1.14-CNK/packaging/module/pom.xml 2010-10-04 11:16:53 UTC = (rev 3235) @@ -4,7 +4,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT jcr.packaging.module pom Modified: jcr/branches/1.14-CNK/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/pom.xml 2010-10-04 10:38:19 UTC (rev 3234) +++ jcr/branches/1.14-CNK/pom.xml 2010-10-04 11:16:53 UTC (rev 3235) @@ -29,7 +29,7 @@ = org.exoplatform.jcr jcr-parent - 1.14.0-Beta02 + 1.14-CNK-SNAPSHOT pom eXo JCR = --===============7700525832356817790==-- From do-not-reply at jboss.org Mon Oct 4 10:01:56 2010 Content-Type: multipart/mixed; boundary="===============4838382243798862802==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3236 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl. Date: Mon, 04 Oct 2010 10:01:55 -0400 Message-ID: <201010041401.o94E1tJX021384@svn01.web.mwc.hst.phx2.redhat.com> --===============4838382243798862802== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-04 10:01:54 -0400 (Mon, 04 Oct 2010) New Revision: 3236 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/RepositoryServiceImpl.java Log: EXOJCR-971: prevent unauthorized access to the methods of RepositoryService= Impl Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/RepositoryServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/RepositoryServiceImpl.java 2010-10-04 11:16:53 UTC (rev 3235) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryServiceImpl.java 2010-10-04 14:01:54 UTC (rev 3236) @@ -30,6 +30,7 @@ import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.ManageableRepository; import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions; import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceLi= stener; import org.exoplatform.services.jcr.impl.core.RepositoryImpl; import org.exoplatform.services.jcr.impl.core.SessionRegistry; @@ -43,8 +44,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.StringTokenizer; -import java.util.Map.Entry; = import javax.jcr.RepositoryException; = @@ -120,6 +121,13 @@ public synchronized void createRepository(RepositoryEntry rEntry) throw= s RepositoryConfigurationException, RepositoryException { + // Need privileges to manage repository. + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); + } + if (repositoryContainers.containsKey(rEntry.getName())) { throw new RepositoryConfigurationException("Repository container = " + rEntry.getName() + " already started"); @@ -161,6 +169,13 @@ = public RepositoryServiceConfiguration getConfig() { + // Need privileges to manage repository. + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); + } + return config; } = @@ -207,6 +222,13 @@ = public void setCurrentRepositoryName(String repositoryName) throws Repo= sitoryConfigurationException { + // Need privileges to manage repository. + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); + } + if (!repositoryContainers.containsKey(repositoryName)) throw new RepositoryConfigurationException("Repository is not con= figured. Name " + repositoryName); currentRepositoryName.set(repositoryName); @@ -214,6 +236,13 @@ = public void start() { + // Need privileges to manage repository. + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); + } + try { ExoContainer container =3D null; @@ -246,6 +275,13 @@ = public void stop() { + // Need privileges to manage repository. + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); + } + for (Entry entry : repositoryContainers= .entrySet()) { entry.getValue().stop(); @@ -351,6 +387,13 @@ */ private void removeRepository(String name, boolean allowRemoveDefaultRe= pository) throws RepositoryException { + // Need privileges to manage repository. + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); + } + if (!canRemoveRepository(name, allowRemoveDefaultRepository)) throw new RepositoryException("Repository " + name + " in use. If= you want to " + " remove repository close all open sessions"); --===============4838382243798862802==-- From do-not-reply at jboss.org Mon Oct 4 10:39:54 2010 Content-Type: multipart/mixed; boundary="===============5372149679607007177==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3237 - in kernel/branches/2.2.x/exo.kernel.container/src: test/java/org/exoplatform/container/configuration and 1 other directory. Date: Mon, 04 Oct 2010 10:39:54 -0400 Message-ID: <201010041439.o94EdsVm028761@svn01.web.mwc.hst.phx2.redhat.com> --===============5372149679607007177== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-04 10:39:54 -0400 (Mon, 04 Oct 2010) New Revision: 3237 Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform= /container/StandaloneContainer.java kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform= /container/configuration/TestConfigurationManagerImpl.java Log: JCR-1466: StandaloneContainer.initConfigurationURL fixed Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exop= latform/container/StandaloneContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/StandaloneContainer.java 2010-10-04 14:01:54 UTC (rev 3236) +++ kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/StandaloneContainer.java 2010-10-04 14:39:54 UTC (rev 3237) @@ -332,12 +332,13 @@ J2EEServerInfo env =3D new J2EEServerInfo(); = // (2) exo-configuration.xml in AS (standalone) home directory - configurationURL =3D new URL("file:" + env.getServerHome() + "/ex= o-configuration.xml"); + configurationURL =3D (new File(env.getServerHome() + "/exo-config= uration.xml")).toURI().toURL(); = // (3) AS_HOME/conf/exo-conf (JBossAS usecase) if (!fileExists(configurationURL)) { - configurationURL =3D new URL("file:" + env.getExoConfiguration= Directory() + "/exo-configuration.xml"); + configurationURL =3D + (new File(env.getExoConfigurationDirectory() + "/exo-config= uration.xml")).toURI().toURL(); } = // (4) conf/exo-configuration.xml in war/ear(?) Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exop= latform/container/configuration/TestConfigurationManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/java/org/exoplatfor= m/container/configuration/TestConfigurationManagerImpl.java 2010-10-04 14:0= 1:54 UTC (rev 3236) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatfor= m/container/configuration/TestConfigurationManagerImpl.java 2010-10-04 14:3= 9:54 UTC (rev 3237) @@ -198,7 +198,33 @@ url =3D cm3.getURL("configuration\\empty-config-fake.xml"); checkURL(url, true); = } + = + public void testGetFileURL() throws Exception + { + // Empty CM + ConfigurationManager cm =3D new ConfigurationManagerImpl(); + URL url =3D cm.getURL(null); + assertNull(url); + url =3D cm.getURL("file:F:\\somepath\\path\\configuration.xml"); + assertEquals("file:/F:/somepath/path/configuration.xml", url.toStrin= g()); = + //make context configuration starting fith "file:D:..." + try + { + cm.addConfiguration("file:D:\\somepath\\config.xml"); + } + catch (Exception e) + { + // thats is ok, because such config does not exists, = + // but ConfigurationManagerInmp.contextPath going to be initializ= ed + // thats all we need to reproduce bug. + } + + // now lets check relative url + url =3D cm.getURL("configuration.xml"); + assertEquals("file:/D:/somepath/configuration.xml", url.toString()); + } + private void checkURL(URL url) throws Exception { checkURL(url, false); --===============5372149679607007177==-- From do-not-reply at jboss.org Mon Oct 4 10:48:43 2010 Content-Type: multipart/mixed; boundary="===============1380720962590770355==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3238 - in kernel/trunk/exo.kernel.container/src: test/java/org/exoplatform/container/configuration and 1 other directory. Date: Mon, 04 Oct 2010 10:48:43 -0400 Message-ID: <201010041448.o94Emh4L029077@svn01.web.mwc.hst.phx2.redhat.com> --===============1380720962590770355== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-04 10:48:42 -0400 (Mon, 04 Oct 2010) New Revision: 3238 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/StandaloneContainer.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/configuration/TestConfigurationManagerImpl.java Log: EXOJCR-988: StandaloneContainer.initConfigurationURL fixed Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/StandaloneContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/StandaloneContainer.java 2010-10-04 14:39:54 UTC (rev 3237) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/StandaloneContainer.java 2010-10-04 14:48:42 UTC (rev 3238) @@ -332,12 +332,13 @@ J2EEServerInfo env =3D new J2EEServerInfo(); = // (2) exo-configuration.xml in AS (standalone) home directory - configurationURL =3D new URL("file:" + env.getServerHome() + "/ex= o-configuration.xml"); + configurationURL =3D (new File(env.getServerHome() + "/exo-config= uration.xml")).toURI().toURL(); = // (3) AS_HOME/conf/exo-conf (JBossAS usecase) if (!fileExists(configurationURL)) { - configurationURL =3D new URL("file:" + env.getExoConfiguration= Directory() + "/exo-configuration.xml"); + configurationURL =3D + (new File(env.getExoConfigurationDirectory() + "/exo-config= uration.xml")).toURI().toURL(); } = // (4) conf/exo-configuration.xml in war/ear(?) Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/configuration/TestConfigurationManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/configuration/TestConfigurationManagerImpl.java 2010-10-04 14:39:54 UTC = (rev 3237) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/configuration/TestConfigurationManagerImpl.java 2010-10-04 14:48:42 UTC = (rev 3238) @@ -1,441 +1,467 @@ -/* - * Copyright (C) 2003-2010 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<http://www.gnu.org/licenses/>= ;. - */ -package org.exoplatform.container.configuration; - -import junit.framework.TestCase; - -import org.exoplatform.container.xml.Configuration; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Enumeration; -import java.util.Set; - -import javax.servlet.RequestDispatcher; -import javax.servlet.Servlet; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; - -/** - * Created by The eXo Platform SAS - * Author : Nicolas Filotto = - * nicolas.filotto(a)exoplatform.com - * 22 f=EF=BF=BDvr. 2010 = - */ -public class TestConfigurationManagerImpl extends TestCase -{ - public void testGetURL() throws Exception - { - // Empty CM - ConfigurationManager cm =3D new ConfigurationManagerImpl(); - URL url =3D cm.getURL(null); - assertNull(url); - url =3D cm.getURL("jar:/org/exoplatform/container/configuration/empt= y-config.xml"); - checkURL(url); - url =3D cm.getURL("jar:/org/exoplatform/container/configuration/empt= y-config-fake.xml"); - assertNull(url); - url =3D cm.getURL("classpath:/org/exoplatform/container/configuratio= n/empty-config.xml"); - checkURL(url); - url =3D cm.getURL("classpath:/org/exoplatform/container/configuratio= n/empty-config-fake.xml"); - assertNull(url); - try - { - url =3D cm.getURL("war:/org/exoplatform/container/configuration/e= mpty-config.xml"); - fail("An error should be thrown"); - } - catch (Exception e) - { - // ok; - } - try - { - url =3D cm.getURL("war:/org/exoplatform/container/configuration/e= mpty-config-fake.xml"); - fail("An error should be thrown"); - } - catch (Exception e) - { - // ok; - } - String sURL =3D getClass().getResource("empty-config.xml").toString(= ); - assertNotNull(sURL); - assertTrue("the expected path should starts with file:", sURL.starts= With("file:")); - sURL =3D sURL.substring(0, sURL.lastIndexOf('/')); - sURL =3D sURL.substring(0, sURL.lastIndexOf('/')); - url =3D cm.getURL(sURL + "/configuration/empty-config.xml"); - checkURL(url); - url =3D cm.getURL(sURL + "/configuration/empty-config-fake.xml"); - checkURL(url, true); - url =3D cm.getURL(sURL + "\\configuration\\empty-config.xml"); - checkURL(url); - url =3D cm.getURL(sURL + "\\configuration\\empty-config-fake.xml"); - checkURL(url, true); - String incompleteURL =3D "file:/" + getClass().getResource("empty-co= nfig.xml").getPath(); - incompleteURL =3D incompleteURL.substring(0, incompleteURL.lastIndex= Of('/')); - url =3D cm.getURL(incompleteURL + "/empty-config.xml"); - checkURL(url); - url =3D cm.getURL(incompleteURL + "/empty-config-fake.xml"); - checkURL(url, true); - incompleteURL =3D "file:" + getClass().getResource("empty-config.xml= ").getPath(); - incompleteURL =3D incompleteURL.substring(0, incompleteURL.lastIndex= Of('/')); - url =3D cm.getURL(incompleteURL + "/empty-config.xml"); - checkURL(url); - url =3D cm.getURL(incompleteURL + "/empty-config-fake.xml"); - checkURL(url, true); = - url =3D cm.getURL("org/exoplatform/container/configuration/empty-con= fig.xml"); - assertNull(url); - url =3D cm.getURL("org/exoplatform/container/configuration/empty-con= fig-fake.xml"); - assertNull(url); - = - // CM with ClassLoader - ConfigurationManager cm1 =3D new ConfigurationManagerImpl(Thread.cur= rentThread().getContextClassLoader(), null); - url =3D cm1.getURL(null); - assertNull(url); = - url =3D cm1.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config.xml"); - checkURL(url); - url =3D cm1.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); - assertNull(url); - url =3D cm1.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config.xml"); - checkURL(url); - url =3D cm1.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config-fake.xml"); - assertNull(url); - url =3D cm1.getURL("war:/org/exoplatform/container/configuration/emp= ty-config.xml"); - checkURL(url); - url =3D cm1.getURL("war:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); - assertNull(url); - url =3D cm1.getURL(sURL + "/configuration/empty-config.xml"); - checkURL(url); - url =3D cm1.getURL(sURL + "/configuration/empty-config-fake.xml"); - checkURL(url, true); - url =3D cm1.getURL("org/exoplatform/container/configuration/empty-co= nfig.xml"); - assertNull(url); - url =3D cm1.getURL("org/exoplatform/container/configuration/empty-co= nfig-fake.xml"); - assertNull(url); - = - // CM with ServletContext - ConfigurationManager cm2 =3D new ConfigurationManagerImpl(new MockSe= rvletContext(), null); - url =3D cm2.getURL(null); - assertNull(url); = - url =3D cm2.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config.xml"); - checkURL(url); - url =3D cm2.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); - assertNull(url); - url =3D cm2.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config.xml"); - checkURL(url); - url =3D cm2.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config-fake.xml"); - assertNull(url); - url =3D cm2.getURL("war:/org/exoplatform/container/configuration/emp= ty-config.xml"); - checkURL(url); - url =3D cm2.getURL("war:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); - assertNull(url); - url =3D cm2.getURL(sURL + "/configuration/empty-config.xml"); - checkURL(url); - url =3D cm2.getURL(sURL + "/configuration/empty-config-fake.xml"); - checkURL(url, true); - url =3D cm2.getURL("org/exoplatform/container/configuration/empty-co= nfig.xml"); - assertNull(url); - url =3D cm2.getURL("org/exoplatform/container/configuration/empty-co= nfig-fake.xml"); - assertNull(url); = - = - // CM with Context path - ConfigurationManager cm3 =3D new ConfigurationManagerImpl(); - String path =3D getClass().getResource("empty-config.xml").getPath(); - assertNotNull(path); - path =3D path.substring(0, path.lastIndexOf('/')); = - cm3.addConfiguration((new File(path)).toURI().toURL()); - url =3D cm3.getURL(null); - assertNull(url); = - url =3D cm3.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config.xml"); - checkURL(url); - url =3D cm3.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); - assertNull(url); - url =3D cm3.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config.xml"); - checkURL(url); - url =3D cm3.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config-fake.xml"); - assertNull(url); - try - { - url =3D cm3.getURL("war:/org/exoplatform/container/configuration/= empty-config.xml"); - fail("An error should be thrown"); - } - catch (Exception e) - { - // ok; - } - try - { - url =3D cm3.getURL("war:/org/exoplatform/container/configuration/= empty-config-fake.xml"); - fail("An error should be thrown"); - } - catch (Exception e) - { - // ok; - } - url =3D cm3.getURL(sURL + "/configuration/empty-config.xml"); - checkURL(url); - url =3D cm3.getURL(sURL + "/configuration/empty-config-fake.xml"); - checkURL(url, true); - url =3D cm3.getURL("configuration/empty-config.xml"); - checkURL(url); - url =3D cm3.getURL("configuration/empty-config-fake.xml"); - checkURL(url, true); = - url =3D cm3.getURL("configuration\\empty-config.xml"); - checkURL(url); - url =3D cm3.getURL("configuration\\empty-config-fake.xml"); - checkURL(url, true); = - } - - public void testImport() throws Exception - { - // no import - ConfigurationManager cm =3D new ConfigurationManagerImpl(); - cm.addConfiguration("classpath:/org/exoplatform/container/configurat= ion/config-manager-configuration-a.xml"); - Configuration conf =3D cm.getConfiguration(); - assertNotNull(conf.getComponent("A")); - assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWit= h("config-manager-configuration-a.xml")); - assertNull(conf.getComponent("B")); - assertNull(conf.getComponent("C")); - = - // b import a - cm =3D new ConfigurationManagerImpl(); - cm.addConfiguration("classpath:/org/exoplatform/container/configurat= ion/config-manager-configuration-b.xml"); - conf =3D cm.getConfiguration(); - assertNotNull(conf.getComponent("A")); - assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWit= h("config-manager-configuration-a.xml")); - assertNotNull(conf.getComponent("B")); - assertTrue(conf.getComponent("B").getDocumentURL().getFile().endsWit= h("config-manager-configuration-b.xml")); - assertNull(conf.getComponent("C")); - = - // c import b and b import a - cm =3D new ConfigurationManagerImpl(); - cm.addConfiguration("classpath:/org/exoplatform/container/configurat= ion/config-manager-configuration-c.xml"); - conf =3D cm.getConfiguration(); - assertNotNull(conf.getComponent("A")); - assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWit= h("config-manager-configuration-a.xml")); - assertNotNull(conf.getComponent("B")); - assertTrue(conf.getComponent("B").getDocumentURL().getFile().endsWit= h("config-manager-configuration-b.xml")); - assertNotNull(conf.getComponent("C")); - assertTrue(conf.getComponent("C").getDocumentURL().getFile().endsWit= h("config-manager-configuration-c.xml")); - } - = - private void checkURL(URL url) throws Exception - { - checkURL(url, false); - } - = - private void checkURL(URL url, boolean empty) throws Exception - { - assertNotNull(url); - InputStream is =3D null; - try - { - is =3D url.openStream(); - if (empty) - { - assertNull(is); - } - else - { - assertNotNull(is); - assertTrue(is.available() > 0); = - } - } - catch (IOException e) - { - if (empty) - { - // OK - } = - else - { - throw e; - } - } - finally - { - if (is !=3D null) - { - try - { - is.close(); - } - catch (Exception e) - { - // ignore me - } - } - } - } - = - private static class MockServletContext implements ServletContext - { - - public Object getAttribute(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public Enumeration getAttributeNames() - { - // TODO Auto-generated method stub - return null; - } - - public ServletContext getContext(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public String getContextPath() - { - // TODO Auto-generated method stub - return null; - } - - public String getInitParameter(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public Enumeration getInitParameterNames() - { - // TODO Auto-generated method stub - return null; - } - - public int getMajorVersion() - { - // TODO Auto-generated method stub - return 0; - } - - public String getMimeType(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public int getMinorVersion() - { - // TODO Auto-generated method stub - return 0; - } - - public RequestDispatcher getNamedDispatcher(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public String getRealPath(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public RequestDispatcher getRequestDispatcher(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public URL getResource(String arg0) throws MalformedURLException - { - // We remove "/WEB-INF/ - String path =3D arg0.substring(ConfigurationManagerImpl.WAR_CONF_= LOCATION.length() + 1); - return Thread.currentThread().getContextClassLoader().getResource= (path); - } - - public InputStream getResourceAsStream(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public Set getResourcePaths(String arg0) - { - // TODO Auto-generated method stub - return null; - } - - public String getServerInfo() - { - // TODO Auto-generated method stub - return null; - } - - public Servlet getServlet(String arg0) throws ServletException - { - // TODO Auto-generated method stub - return null; - } - - public String getServletContextName() - { - // TODO Auto-generated method stub - return null; - } - - public Enumeration getServletNames() - { - // TODO Auto-generated method stub - return null; - } - - public Enumeration getServlets() - { - // TODO Auto-generated method stub - return null; - } - - public void log(String arg0) - { - // TODO Auto-generated method stub - = - } - - public void log(Exception arg0, String arg1) - { - // TODO Auto-generated method stub - = - } - - public void log(String arg0, Throwable arg1) - { - // TODO Auto-generated method stub - = - } - - public void removeAttribute(String arg0) - { - // TODO Auto-generated method stub - = - } - - public void setAttribute(String arg0, Object arg1) - { - // TODO Auto-generated method stub - = - } - = - } -} +/* + * Copyright (C) 2003-2010 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<http://www.gnu.org/licenses/>= ;. + */ +package org.exoplatform.container.configuration; + +import junit.framework.TestCase; + +import org.exoplatform.container.xml.Configuration; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Enumeration; +import java.util.Set; + +import javax.servlet.RequestDispatcher; +import javax.servlet.Servlet; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; + +/** + * Created by The eXo Platform SAS + * Author : Nicolas Filotto = + * nicolas.filotto(a)exoplatform.com + * 22 f=EF=BF=BDvr. 2010 = + */ +public class TestConfigurationManagerImpl extends TestCase +{ + public void testGetURL() throws Exception + { + // Empty CM + ConfigurationManager cm =3D new ConfigurationManagerImpl(); + URL url =3D cm.getURL(null); + assertNull(url); + url =3D cm.getURL("jar:/org/exoplatform/container/configuration/empt= y-config.xml"); + checkURL(url); + url =3D cm.getURL("jar:/org/exoplatform/container/configuration/empt= y-config-fake.xml"); + assertNull(url); + url =3D cm.getURL("classpath:/org/exoplatform/container/configuratio= n/empty-config.xml"); + checkURL(url); + url =3D cm.getURL("classpath:/org/exoplatform/container/configuratio= n/empty-config-fake.xml"); + assertNull(url); + try + { + url =3D cm.getURL("war:/org/exoplatform/container/configuration/e= mpty-config.xml"); + fail("An error should be thrown"); + } + catch (Exception e) + { + // ok; + } + try + { + url =3D cm.getURL("war:/org/exoplatform/container/configuration/e= mpty-config-fake.xml"); + fail("An error should be thrown"); + } + catch (Exception e) + { + // ok; + } + String sURL =3D getClass().getResource("empty-config.xml").toString(= ); + assertNotNull(sURL); + assertTrue("the expected path should starts with file:", sURL.starts= With("file:")); + sURL =3D sURL.substring(0, sURL.lastIndexOf('/')); + sURL =3D sURL.substring(0, sURL.lastIndexOf('/')); + url =3D cm.getURL(sURL + "/configuration/empty-config.xml"); + checkURL(url); + url =3D cm.getURL(sURL + "/configuration/empty-config-fake.xml"); + checkURL(url, true); + url =3D cm.getURL(sURL + "\\configuration\\empty-config.xml"); + checkURL(url); + url =3D cm.getURL(sURL + "\\configuration\\empty-config-fake.xml"); + checkURL(url, true); + String incompleteURL =3D "file:/" + getClass().getResource("empty-co= nfig.xml").getPath(); + incompleteURL =3D incompleteURL.substring(0, incompleteURL.lastIndex= Of('/')); + url =3D cm.getURL(incompleteURL + "/empty-config.xml"); + checkURL(url); + url =3D cm.getURL(incompleteURL + "/empty-config-fake.xml"); + checkURL(url, true); + incompleteURL =3D "file:" + getClass().getResource("empty-config.xml= ").getPath(); + incompleteURL =3D incompleteURL.substring(0, incompleteURL.lastIndex= Of('/')); + url =3D cm.getURL(incompleteURL + "/empty-config.xml"); + checkURL(url); + url =3D cm.getURL(incompleteURL + "/empty-config-fake.xml"); + checkURL(url, true); = + url =3D cm.getURL("org/exoplatform/container/configuration/empty-con= fig.xml"); + assertNull(url); + url =3D cm.getURL("org/exoplatform/container/configuration/empty-con= fig-fake.xml"); + assertNull(url); + = + // CM with ClassLoader + ConfigurationManager cm1 =3D new ConfigurationManagerImpl(Thread.cur= rentThread().getContextClassLoader(), null); + url =3D cm1.getURL(null); + assertNull(url); = + url =3D cm1.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config.xml"); + checkURL(url); + url =3D cm1.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); + assertNull(url); + url =3D cm1.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config.xml"); + checkURL(url); + url =3D cm1.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config-fake.xml"); + assertNull(url); + url =3D cm1.getURL("war:/org/exoplatform/container/configuration/emp= ty-config.xml"); + checkURL(url); + url =3D cm1.getURL("war:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); + assertNull(url); + url =3D cm1.getURL(sURL + "/configuration/empty-config.xml"); + checkURL(url); + url =3D cm1.getURL(sURL + "/configuration/empty-config-fake.xml"); + checkURL(url, true); + url =3D cm1.getURL("org/exoplatform/container/configuration/empty-co= nfig.xml"); + assertNull(url); + url =3D cm1.getURL("org/exoplatform/container/configuration/empty-co= nfig-fake.xml"); + assertNull(url); + = + // CM with ServletContext + ConfigurationManager cm2 =3D new ConfigurationManagerImpl(new MockSe= rvletContext(), null); + url =3D cm2.getURL(null); + assertNull(url); = + url =3D cm2.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config.xml"); + checkURL(url); + url =3D cm2.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); + assertNull(url); + url =3D cm2.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config.xml"); + checkURL(url); + url =3D cm2.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config-fake.xml"); + assertNull(url); + url =3D cm2.getURL("war:/org/exoplatform/container/configuration/emp= ty-config.xml"); + checkURL(url); + url =3D cm2.getURL("war:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); + assertNull(url); + url =3D cm2.getURL(sURL + "/configuration/empty-config.xml"); + checkURL(url); + url =3D cm2.getURL(sURL + "/configuration/empty-config-fake.xml"); + checkURL(url, true); + url =3D cm2.getURL("org/exoplatform/container/configuration/empty-co= nfig.xml"); + assertNull(url); + url =3D cm2.getURL("org/exoplatform/container/configuration/empty-co= nfig-fake.xml"); + assertNull(url); = + = + // CM with Context path + ConfigurationManager cm3 =3D new ConfigurationManagerImpl(); + String path =3D getClass().getResource("empty-config.xml").getPath(); + assertNotNull(path); + path =3D path.substring(0, path.lastIndexOf('/')); = + cm3.addConfiguration((new File(path)).toURI().toURL()); + url =3D cm3.getURL(null); + assertNull(url); = + url =3D cm3.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config.xml"); + checkURL(url); + url =3D cm3.getURL("jar:/org/exoplatform/container/configuration/emp= ty-config-fake.xml"); + assertNull(url); + url =3D cm3.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config.xml"); + checkURL(url); + url =3D cm3.getURL("classpath:/org/exoplatform/container/configurati= on/empty-config-fake.xml"); + assertNull(url); + try + { + url =3D cm3.getURL("war:/org/exoplatform/container/configuration/= empty-config.xml"); + fail("An error should be thrown"); + } + catch (Exception e) + { + // ok; + } + try + { + url =3D cm3.getURL("war:/org/exoplatform/container/configuration/= empty-config-fake.xml"); + fail("An error should be thrown"); + } + catch (Exception e) + { + // ok; + } + url =3D cm3.getURL(sURL + "/configuration/empty-config.xml"); + checkURL(url); + url =3D cm3.getURL(sURL + "/configuration/empty-config-fake.xml"); + checkURL(url, true); + url =3D cm3.getURL("configuration/empty-config.xml"); + checkURL(url); + url =3D cm3.getURL("configuration/empty-config-fake.xml"); + checkURL(url, true); = + url =3D cm3.getURL("configuration\\empty-config.xml"); + checkURL(url); + url =3D cm3.getURL("configuration\\empty-config-fake.xml"); + checkURL(url, true); = + } + + public void testGetFileURL() throws Exception + { + // Empty CM + ConfigurationManager cm =3D new ConfigurationManagerImpl(); + URL url =3D cm.getURL(null); + assertNull(url); + url =3D cm.getURL("file:F:\\somepath\\path\\configuration.xml"); + assertEquals("file:/F:/somepath/path/configuration.xml", url.toStrin= g()); + + //make context configuration starting fith "file:D:..." + try + { + cm.addConfiguration("file:D:\\somepath\\config.xml"); + } + catch (Exception e) + { + // thats is ok, because such config does not exists, = + // but ConfigurationManagerInmp.contextPath going to be initializ= ed + // thats all we need to reproduce bug. + } + + // now lets check relative url + url =3D cm.getURL("configuration.xml"); + assertEquals("file:/D:/somepath/configuration.xml", url.toString()); + } + + public void testImport() throws Exception + { + // no import + ConfigurationManager cm =3D new ConfigurationManagerImpl(); + cm.addConfiguration("classpath:/org/exoplatform/container/configurat= ion/config-manager-configuration-a.xml"); + Configuration conf =3D cm.getConfiguration(); + assertNotNull(conf.getComponent("A")); + assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWit= h("config-manager-configuration-a.xml")); + assertNull(conf.getComponent("B")); + assertNull(conf.getComponent("C")); + = + // b import a + cm =3D new ConfigurationManagerImpl(); + cm.addConfiguration("classpath:/org/exoplatform/container/configurat= ion/config-manager-configuration-b.xml"); + conf =3D cm.getConfiguration(); + assertNotNull(conf.getComponent("A")); + assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWit= h("config-manager-configuration-a.xml")); + assertNotNull(conf.getComponent("B")); + assertTrue(conf.getComponent("B").getDocumentURL().getFile().endsWit= h("config-manager-configuration-b.xml")); + assertNull(conf.getComponent("C")); + = + // c import b and b import a + cm =3D new ConfigurationManagerImpl(); + cm.addConfiguration("classpath:/org/exoplatform/container/configurat= ion/config-manager-configuration-c.xml"); + conf =3D cm.getConfiguration(); + assertNotNull(conf.getComponent("A")); + assertTrue(conf.getComponent("A").getDocumentURL().getFile().endsWit= h("config-manager-configuration-a.xml")); + assertNotNull(conf.getComponent("B")); + assertTrue(conf.getComponent("B").getDocumentURL().getFile().endsWit= h("config-manager-configuration-b.xml")); + assertNotNull(conf.getComponent("C")); + assertTrue(conf.getComponent("C").getDocumentURL().getFile().endsWit= h("config-manager-configuration-c.xml")); + } + = + private void checkURL(URL url) throws Exception + { + checkURL(url, false); + } + = + private void checkURL(URL url, boolean empty) throws Exception + { + assertNotNull(url); + InputStream is =3D null; + try + { + is =3D url.openStream(); + if (empty) + { + assertNull(is); + } + else + { + assertNotNull(is); + assertTrue(is.available() > 0); = + } + } + catch (IOException e) + { + if (empty) + { + // OK + } = + else + { + throw e; + } + } + finally + { + if (is !=3D null) + { + try + { + is.close(); + } + catch (Exception e) + { + // ignore me + } + } + } + } + = + private static class MockServletContext implements ServletContext + { + + public Object getAttribute(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public Enumeration getAttributeNames() + { + // TODO Auto-generated method stub + return null; + } + + public ServletContext getContext(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public String getContextPath() + { + // TODO Auto-generated method stub + return null; + } + + public String getInitParameter(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public Enumeration getInitParameterNames() + { + // TODO Auto-generated method stub + return null; + } + + public int getMajorVersion() + { + // TODO Auto-generated method stub + return 0; + } + + public String getMimeType(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public int getMinorVersion() + { + // TODO Auto-generated method stub + return 0; + } + + public RequestDispatcher getNamedDispatcher(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public String getRealPath(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public RequestDispatcher getRequestDispatcher(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public URL getResource(String arg0) throws MalformedURLException + { + // We remove "/WEB-INF/ + String path =3D arg0.substring(ConfigurationManagerImpl.WAR_CONF_= LOCATION.length() + 1); + return Thread.currentThread().getContextClassLoader().getResource= (path); + } + + public InputStream getResourceAsStream(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public Set getResourcePaths(String arg0) + { + // TODO Auto-generated method stub + return null; + } + + public String getServerInfo() + { + // TODO Auto-generated method stub + return null; + } + + public Servlet getServlet(String arg0) throws ServletException + { + // TODO Auto-generated method stub + return null; + } + + public String getServletContextName() + { + // TODO Auto-generated method stub + return null; + } + + public Enumeration getServletNames() + { + // TODO Auto-generated method stub + return null; + } + + public Enumeration getServlets() + { + // TODO Auto-generated method stub + return null; + } + + public void log(String arg0) + { + // TODO Auto-generated method stub + = + } + + public void log(Exception arg0, String arg1) + { + // TODO Auto-generated method stub + = + } + + public void log(String arg0, Throwable arg1) + { + // TODO Auto-generated method stub + = + } + + public void removeAttribute(String arg0) + { + // TODO Auto-generated method stub + = + } + + public void setAttribute(String arg0, Object arg1) + { + // TODO Auto-generated method stub + = + } + = + } +} --===============1380720962590770355==-- From do-not-reply at jboss.org Tue Oct 5 03:16:07 2010 Content-Type: multipart/mixed; boundary="===============3220632597538394219==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3239 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Tue, 05 Oct 2010 03:16:07 -0400 Message-ID: <201010050716.o957G7hw013630@svn01.web.mwc.hst.phx2.redhat.com> --===============3220632597538394219== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-05 03:16:06 -0400 (Tue, 05 Oct 2010) New Revision: 3239 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/backup-client.xml Log: EXOJCR-946: Adopt Backup client article Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-04 14:48:42 UTC (rev 3238) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-05 07:16:06 UTC (rev 3239) @@ -976,16 +976,16 @@ Go to folder of "backup client" ../jcr/trunk/applications/java/standalone/backupco= nsole + role=3D"bold">../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole . - build the application : - mvn clean install + mvn clean install -P deploy = = Go to ../jcr/trunk/applications/java/standalone/backupco= nsole/target/backupconsole-binary + role=3D"bold">../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole/target/backupconsole-binary and use it. @@ -996,7 +996,7 @@ = - Run jarjava -jar exo.jcr.applications.back= upconsole-1.11.1-SNAPSHOT.jar <command> + Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command> or use jcrbackup.cmd (or .sh); --===============3220632597538394219==-- From do-not-reply at jboss.org Tue Oct 5 03:16:36 2010 Content-Type: multipart/mixed; boundary="===============0287915629031737219==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3240 - jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Tue, 05 Oct 2010 03:16:36 -0400 Message-ID: <201010050716.o957Ga2Z013679@svn01.web.mwc.hst.phx2.redhat.com> --===============0287915629031737219== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-05 03:16:35 -0400 (Tue, 05 Oct 2010) New Revision: 3240 Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docb= ook/en-US/modules/jcr/backup/backup-client.xml Log: EXOJCR-946: Adopt Backup client article Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/ma= in/docbook/en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-05 07:16:06 UTC (re= v 3239) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-05 07:16:35 UTC (re= v 3240) @@ -976,16 +976,16 @@ Go to folder of "backup client" ../jcr/trunk/applications/java/standalone/backupco= nsole + role=3D"bold">../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole . - build the application : - mvn clean install + mvn clean install -P deploy = = Go to ../jcr/trunk/applications/java/standalone/backupco= nsole/target/backupconsole-binary + role=3D"bold">../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole/target/backupconsole-binary and use it. @@ -996,7 +996,7 @@ = - Run jarjava -jar exo.jcr.applications.back= upconsole-1.11.1-SNAPSHOT.jar <command> + Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command> or use jcrbackup.cmd (or .sh); --===============0287915629031737219==-- From do-not-reply at jboss.org Tue Oct 5 05:03:50 2010 Content-Type: multipart/mixed; boundary="===============7203254911195392084==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3241 - in jcr/trunk/exo.jcr.connectors.localadapter: src/main/rar/META-INF and 1 other directory. Date: Tue, 05 Oct 2010 05:03:49 -0400 Message-ID: <201010050903.o9593nLB030444@svn01.web.mwc.hst.phx2.redhat.com> --===============7203254911195392084== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-05 05:03:49 -0400 (Tue, 05 Oct 2010) New Revision: 3241 Modified: jcr/trunk/exo.jcr.connectors.localadapter/pom.xml jcr/trunk/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml Log: EXOJCR-949: Updating eXo JCR version in ra.xml automatically 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 2010-10-05 07:16:35 U= TC (rev 3240) +++ jcr/trunk/exo.jcr.connectors.localadapter/pom.xml 2010-10-05 09:03:49 U= TC (rev 3241) @@ -121,6 +121,13 @@ + + + src/main/rar + ${project.build.directory} + true + + org.apache.maven.plugins @@ -146,6 +153,7 @@ org.apache.maven.plugins maven-rar-plugin + ${project.build.directory}/META-INF/ra.xml true Modified: jcr/trunk/exo.jcr.connectors.localadapter/src/main/rar/META-INF/r= a.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/rar/META-INF/ra.xml = 2010-10-05 07:16:35 UTC (rev 3240) +++ jcr/trunk/exo.jcr.connectors.localadapter/src/main/rar/META-INF/ra.xml = 2010-10-05 09:03:49 UTC (rev 3241) @@ -25,7 +25,7 @@ JCR repository exoplatform - 1.14.0-CR1-SNAPSHOT + ${project.version} false --===============7203254911195392084==-- From do-not-reply at jboss.org Tue Oct 5 06:36:49 2010 Content-Type: multipart/mixed; boundary="===============8440882601717688010==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3242 - in jcr/branches/1.12.x/exo.jcr.connectors.localadapter: src/main/rar/META-INF and 1 other directory. Date: Tue, 05 Oct 2010 06:36:48 -0400 Message-ID: <201010051036.o95AamKw008238@svn01.web.mwc.hst.phx2.redhat.com> --===============8440882601717688010== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-05 06:36:48 -0400 (Tue, 05 Oct 2010) New Revision: 3242 Modified: jcr/branches/1.12.x/exo.jcr.connectors.localadapter/pom.xml jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-IN= F/ra.xml Log: JCR-1471: Updating eXo JCR version in ra.xml automatically Modified: jcr/branches/1.12.x/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.x/exo.jcr.connectors.localadapter/pom.xml 2010-10-05 = 09:03:49 UTC (rev 3241) +++ jcr/branches/1.12.x/exo.jcr.connectors.localadapter/pom.xml 2010-10-05 = 10:36:48 UTC (rev 3242) @@ -121,6 +121,13 @@ + + + src/main/rar + ${project.build.directory} + true + + org.apache.maven.plugins @@ -146,6 +153,7 @@ org.apache.maven.plugins maven-rar-plugin + ${project.build.directory}/META-INF/ra.xml true Modified: jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/= META-INF/ra.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-I= NF/ra.xml 2010-10-05 09:03:49 UTC (rev 3241) +++ jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-I= NF/ra.xml 2010-10-05 10:36:48 UTC (rev 3242) @@ -25,7 +25,7 @@ JCR repository exoplatform - 1.12.5-GA-SNAPSHOT + ${project.version} false --===============8440882601717688010==-- From do-not-reply at jboss.org Tue Oct 5 07:04:55 2010 Content-Type: multipart/mixed; boundary="===============7220160634602834517==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3243 - jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Tue, 05 Oct 2010 07:04:55 -0400 Message-ID: <201010051104.o95B4tvk014898@svn01.web.mwc.hst.phx2.redhat.com> --===============7220160634602834517== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-05 07:04:54 -0400 (Tue, 05 Oct 2010) New Revision: 3243 Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docb= ook/en-US/modules/jcr/backup/backup-client.xml Log: JCR-1472: revert doc changes Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/ma= in/docbook/en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-05 10:36:48 UTC (re= v 3242) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-05 11:04:54 UTC (re= v 3243) @@ -976,16 +976,16 @@ Go to folder of "backup client" ../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole + role=3D"bold">../jcr/trunk/applications/java/standalone/backupco= nsole . - build the application : - mvn clean install -P deploy + mvn clean install = = Go to ../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole/target/backupconsole-binary + role=3D"bold">../jcr/trunk/applications/java/standalone/backupco= nsole/target/backupconsole-binary and use it. @@ -996,7 +996,7 @@ = - Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command> + Run jarjava -jar exo.jcr.applications.back= upconsole-1.11.1-SNAPSHOT.jar <command> or use jcrbackup.cmd (or .sh); --===============7220160634602834517==-- From do-not-reply at jboss.org Tue Oct 5 07:32:44 2010 Content-Type: multipart/mixed; boundary="===============4479141262096130249==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3244 - jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Tue, 05 Oct 2010 07:32:44 -0400 Message-ID: <201010051132.o95BWiJX016338@svn01.web.mwc.hst.phx2.redhat.com> --===============4479141262096130249== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-05 07:32:43 -0400 (Tue, 05 Oct 2010) New Revision: 3244 Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docb= ook/en-US/modules/jcr/backup/backup-client.xml Log: JCR-1471: Adopt Backup client article Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/ma= in/docbook/en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-05 11:04:54 UTC (re= v 3243) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-05 11:32:43 UTC (re= v 3244) @@ -976,19 +976,23 @@ Go to folder of "backup client" ../jcr/trunk/applications/java/standalone/backupco= nsole + role=3D"bold">${JCR-SRC-HOME}/applications/exo.jcr.applications.= backupconsole . - build the application : - mvn clean install + mvn clean install -P deploy = = Go to ../jcr/trunk/applications/java/standalone/backupco= nsole/target/backupconsole-binary + role=3D"bold">${JCR-SRC-HOME}/applications/exo.jcr.applications.= backupconsole/target/backupconsole-binary and use it. + + + ${JCR-SRC-HOME} the path = where eXo JCR sources located +
=
@@ -996,7 +1000,7 @@ = - Run jarjava -jar exo.jcr.applications.back= upconsole-1.11.1-SNAPSHOT.jar <command> + Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command> or use jcrbackup.cmd (or .sh); --===============4479141262096130249==-- From do-not-reply at jboss.org Tue Oct 5 07:33:25 2010 Content-Type: multipart/mixed; boundary="===============4614887042164204393==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3245 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Tue, 05 Oct 2010 07:33:25 -0400 Message-ID: <201010051133.o95BXPa6016352@svn01.web.mwc.hst.phx2.redhat.com> --===============4614887042164204393== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-05 07:33:24 -0400 (Tue, 05 Oct 2010) New Revision: 3245 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/backup-client.xml Log: EXOJCR-946: Adopt Backup client article Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-05 11:32:43 UTC (rev 3244) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-05 11:33:24 UTC (rev 3245) @@ -976,7 +976,7 @@ Go to folder of "backup client" ../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole + role=3D"bold">${JCR-SRC-HOME}/applications/exo.jcr.applications.= backupconsole . - build the application : mvn clean install -P deploy = @@ -985,10 +985,14 @@ = Go to ../jcr/trunk/applications/exo.jcr.applications.bac= kupconsole/target/backupconsole-binary + role=3D"bold">${JCR-SRC-HOME}/applications/exo.jcr.applications.= backupconsole/target/backupconsole-binary and use it. + + + ${JCR-SRC-HOME} the path = where eXo JCR sources located +
=
--===============4614887042164204393==-- From do-not-reply at jboss.org Tue Oct 5 10:59:11 2010 Content-Type: multipart/mixed; boundary="===============0938029445778835888==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3246 - in ws/trunk: exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json and 5 other directories. Date: Tue, 05 Oct 2010 10:59:11 -0400 Message-ID: <201010051459.o95ExBvX011600@svn01.web.mwc.hst.phx2.redhat.com> --===============0938029445778835888== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2010-10-05 10:59:07 -0400 (Tue, 05 Oct 2010) New Revision: 3246 Added: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/JsonStack.java ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/ObjectBuilder.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/JsonTest.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/ObjectBuilderTest.java ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/im= pl/provider/JsonEntityTest.java Removed: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/JavaNumericTypeTest.java ws/trunk/exo.ws.frameworks.json/src/test/resources/MultiDimension.txt ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/im= pl/provider/JsonEntityTest.java Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/BeanBuilder.java ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/JsonDefaultHandler.java ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/JsonGeneratorImpl.java ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/JsonParserImpl.java ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/JsonUtils.java ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/JsonWriterImpl.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/Book.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/JsonGeneratorTest.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/JsonParserTest.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/JsonUtilsTest.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/JsonWriterTest.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/TransferJavaBeanTest.java ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framewo= rks/json/impl/groovy/GroovyBeanTest.java ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/im= pl/provider/JsonEntityProvider.java Log: EXOJCR-989 Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/= frameworks/json/impl/BeanBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/BeanBuilder.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/BeanBuilder.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -18,506 +18,27 @@ */ package org.exoplatform.ws.frameworks.json.impl; = -import org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types; import org.exoplatform.ws.frameworks.json.value.JsonValue; = -import java.lang.reflect.Array; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.Map; - /** * @author Andrey Parfonov * @version $Id: BeanBuilder.java 34417 2009-07-23 14:42:56Z dkatayev $ + * @deprecated use {@link ObjectBuilder#createObject(Class, JsonValue)} in= stead */ public class BeanBuilder { = - static final Collection SKIP_METHODS =3D new HashSet(); - - static - { - // Since we need support for Groovy must skip this. - // All "Groovy Objects" implements interface groovy.lang.GroovyObject - // and has method setMetaClass. Not need to process it. - SKIP_METHODS.add("setMetaClass"); - } - /** - * Create Java Bean from Json Source. + * Create Java Bean from JSON Source. * * @param clazz the Class of target Object. - * @param jsonValue the Json representation. + * @param jsonValue the JSON representation. * @return Object. * @throws Exception if any errors occurs. */ - @SuppressWarnings("unchecked") public Object createObject(Class clazz, JsonValue jsonValue) throws = Exception { - if (JsonUtils.getType(clazz) =3D=3D Types.ENUM) - { - // Enum is not instantiable via CLass.getInstance(). - // This is used when enum is member of array or collection. - Class c =3D clazz; - return Enum.valueOf(c, jsonValue.getStringValue()); - } - Object object =3D clazz.newInstance(); - Method[] methods =3D clazz.getMethods(); - - for (Method method : methods) - { - String methodName =3D method.getName(); - Class[] parameterTypes =3D method.getParameterTypes(); - - if (!SKIP_METHODS.contains(methodName) && methodName.startsWith("= set") && parameterTypes.length =3D=3D 1 - && methodName.length() > 3) - { - Class methodParameterClazz =3D parameterTypes[0]; - String key =3D methodName.substring(3); - // first letter to lower case - key =3D (key.length() > 1) ? Character.toLowerCase(key.charAt(= 0)) + key.substring(1) : key.toLowerCase(); - - // Bug : WS-53 - if (jsonValue.isNull()) - { - return null; - } - - if (!jsonValue.isObject()) - { - throw new JsonException("Unsupported type of jsonValue for = parameter of method " + clazz.getName() + "#" - + method.getName()); - } - - JsonValue childJsonValue =3D jsonValue.getElement(key); - - if (childJsonValue =3D=3D null) - { - continue; - } - - // if one of known primitive type or array of primitive type - if (JsonUtils.isKnownType(methodParameterClazz)) - { - method.invoke(object, new Object[]{createObjectKnownTypes(m= ethodParameterClazz, childJsonValue)}); - } - else - { - Types type =3D JsonUtils.getType(methodParameterClazz); - // other type Collection, Map or Object[]. - if (type !=3D null) - { - switch (type) - { - case ENUM : { - Class c =3D methodParameterClazz; - Enum en =3D Enum.valueOf(c, childJsonValue.getS= tringValue()); - method.invoke(object, new Object[]{en}); - } - break; - case ARRAY_OBJECT : { - Object array =3D createArray(methodParameterClazz,= childJsonValue); - method.invoke(object, new Object[]{array}); - } - break; - case COLLECTION : { - Type[] genericParameterTypes =3D method.getGeneric= ParameterTypes(); - Class parameterizedTypeClass =3D null; - if (genericParameterTypes.length =3D=3D 1) - { - if (genericParameterTypes[0] instanceof Paramet= erizedType) - { - ParameterizedType parameterizedType =3D (Par= ameterizedType)genericParameterTypes[0]; - try - { - // Collection can't be parameterized by o= ther Collection, - // Array, etc. - parameterizedTypeClass =3D (Class)para= meterizedType.getActualTypeArguments()[0]; - } - catch (ClassCastException e) - { - throw new JsonException("Unsupported para= meter in method " + clazz.getName() + "#" - + method.getName() - + ". This type of Collection can't be = restored from JSON source.\n" - + "Collection is parameterized by wron= g Type: " + parameterizedType + "."); - } - } - else - { - throw new JsonException("Unsupported paramet= er in method " + clazz.getName() + "#" - + method.getName() + ". Collection is not= parameterized. " - + "Collection is not supported. \nColl= ection must be parameterized by" - + " any types, or by JavaBean with 'get' = and 'set' methods."); - } - } - Constructor constructor =3D null; - if (methodParameterClazz.isInterface() - || Modifier.isAbstract(methodParameterClazz.get= Modifiers())) - { - try - { - constructor =3D - ArrayList.class.asSubclass(methodParamete= rClazz).getConstructor( - new Class[]{Collection.class}); - } - catch (Exception e) - { - try - { - constructor =3D - HashSet.class.asSubclass(methodParamet= erClazz).getConstructor( - new Class[]{Collection.class}); - } - catch (Exception e1) - { - try - { - constructor =3D - LinkedList.class.asSubclass(methodP= arameterClazz).getConstructor( - new Class[]{Collection.class}); - } - catch (Exception e2) - { - // ignore exception here - } - } - } - } - else - { - constructor =3D methodParameterClazz.getConstru= ctor(new Class[]{Collection.class}); - } - if (constructor =3D=3D null) - { - throw new JsonException("Can't find satisfied c= onstructor for : " + methodParameterClazz - + ", method : " + clazz.getName() + "#" + me= thod.getName()); - } - - ArrayList sourceCollection =3D new ArrayLi= st(childJsonValue.size()); - - Iterator values =3D childJsonValue.getE= lements(); - - while (values.hasNext()) - { - JsonValue v =3D values.next(); - if (!JsonUtils.isKnownType(parameterizedTypeCla= ss)) - { - sourceCollection.add(createObject(parameteri= zedTypeClass, v)); - } - else - { - sourceCollection.add(createObjectKnownTypes(= parameterizedTypeClass, v)); - } - } - - constructor.newInstance(sourceCollection); - method.invoke(object, constructor.newInstance(sour= ceCollection)); - } - break; - case MAP : { - Type[] genericParameterTypes =3D method.getGeneric= ParameterTypes(); - Class parameterizedTypeClass =3D null; - if (genericParameterTypes.length =3D=3D 1) - { - if (genericParameterTypes[0] instanceof Paramet= erizedType) - { - ParameterizedType parameterizedType =3D (Par= ameterizedType)genericParameterTypes[0]; - if (!String.class - .isAssignableFrom((Class)parameterized= Type.getActualTypeArguments()[0])) - { - throw new JsonException("Unsupported para= meter in method " + clazz.getName() + "#" - + method.getName() + ". Key of Map mus= t be String."); - } - try - { - parameterizedTypeClass =3D (Class)para= meterizedType.getActualTypeArguments()[1]; - } - catch (Exception e) - { - throw new JsonException("Unsupported para= meter in method " + clazz.getName() + "#" - + method.getName() + ". This type of M= ap can't be restored from JSON source.\n" - + "Map is parameterized by wrong Type:= " + parameterizedType + "."); - } - } - else - { - throw new JsonException("Unsupported paramet= er in method " + clazz.getName() + "#" - + method.getName() + ". Map is not parame= terized. " - + "Map is not supported. \nMap = must be parameterized by" - + "String and any types or JavaBean with = 'get' and 'set' methods."); - } - } - Constructor constructor =3D null; - if (methodParameterClazz.isInterface() - || Modifier.isAbstract(methodParameterClazz.get= Modifiers())) - { - try - { - constructor =3D - HashMap.class.asSubclass(methodParameterC= lazz).getConstructor(new Class[]{Map.class}); - } - catch (Exception e) - { - try - { - constructor =3D - Hashtable.class.asSubclass(methodParam= eterClazz).getConstructor( - new Class[]{Map.class}); - } - catch (Exception e1) - { - try - { - constructor =3D - LinkedHashMap.class.asSubclass(meth= odParameterClazz).getConstructor( - new Class[]{Map.class}); - } - catch (Exception e2) - { - // ignore exception here - } - } - } - } - else - { - constructor =3D methodParameterClazz.getConstru= ctor(new Class[]{Map.class}); - } - - if (constructor =3D=3D null) - { - throw new JsonException("Can't find satisfied c= onstructor for : " + methodParameterClazz - + ", method : " + clazz.getName() + "#" + me= thod.getName()); - } - - HashMap sourceMap =3D new HashMap<= String, Object>(childJsonValue.size()); - - Iterator keys =3D childJsonValue.getKeys(); - - while (keys.hasNext()) - { - String k =3D keys.next(); - JsonValue v =3D childJsonValue.getElement(k); - if (!JsonUtils.isKnownType(parameterizedTypeCla= ss)) - { - sourceMap.put(k, createObject(parameterizedT= ypeClass, v)); - } - else - { - sourceMap.put(k, createObjectKnownTypes(para= meterizedTypeClass, v)); - } - } - - method.invoke(object, constructor.newInstance(sour= ceMap)); - - } - break; - default : - // it must never happen! - throw new JsonException("Can't restore parameter o= f method : " + clazz.getName() + "#" - + method.getName() + " from JSON source."); - } - - } - else - { - method.invoke(object, createObject(methodParameterClazz,= childJsonValue)); - } - } - } - } - - return object; + return ObjectBuilder.createObject(clazz, jsonValue); } = - /** - * Create array of Java Object from Json Source include multi-dimension - * array. - * - * @param clazz the Class of target Object. - * @param jsonValue the Json representation. - * @return Object. - * @throws Exception if any errors occurs. - */ - private Object createArray(Class clazz, JsonValue jsonValue) throws = Exception - { - - Class componentType =3D clazz.getComponentType(); - Object array =3D Array.newInstance(componentType, jsonValue.size()); - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - - if (componentType.isArray()) - { - if (JsonUtils.isKnownType(componentType)) - { - while (values.hasNext()) - { - JsonValue v =3D values.next(); - Array.set(array, i++, createObjectKnownTypes(componentType,= v)); - } - } - else - { - while (values.hasNext()) - { - JsonValue v =3D values.next(); - Array.set(array, i++, createArray(componentType, v)); - } - } - } - else - { - while (values.hasNext()) - { - JsonValue v =3D values.next(); - Array.set(array, i++, createObject(componentType, v)); - } - } - return array; - } - - /** - * Create Objects of known types. - * - * @param clazz class. - * @param jsonValue JsonValue , @see {@link JsonValue} - * @return Object. - * @throws JsonException if type is unknown. - */ - private Object createObjectKnownTypes(Class clazz, JsonValue jsonVal= ue) throws JsonException - { - Types t =3D JsonUtils.getType(clazz); - switch (t) - { - case NULL : - return null; - case BOOLEAN : - return jsonValue.getBooleanValue(); - case BYTE : - return jsonValue.getByteValue(); - case SHORT : - return jsonValue.getShortValue(); - case INT : - return jsonValue.getIntValue(); - case LONG : - return jsonValue.getLongValue(); - case FLOAT : - return jsonValue.getFloatValue(); - case DOUBLE : - return jsonValue.getDoubleValue(); - case CHAR : - // TODO check String length - return jsonValue.getStringValue().charAt(0); - case STRING : - return jsonValue.getStringValue(); - case ARRAY_BOOLEAN : { - boolean[] params =3D new boolean[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getBooleanValue(); - } - return params; - } - case ARRAY_BYTE : { - byte[] params =3D new byte[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getByteValue(); - } - return params; - } - case ARRAY_SHORT : { - short[] params =3D new short[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getShortValue(); - } - return params; - } - case ARRAY_INT : { - int[] params =3D new int[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getIntValue(); - } - return params; - } - case ARRAY_LONG : { - long[] params =3D new long[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getLongValue(); - } - return params; - } - case ARRAY_FLOAT : { - float[] params =3D new float[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getFloatValue(); - } - return params; - } - case ARRAY_DOUBLE : { - double[] params =3D new double[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getDoubleValue(); - } - return params; - } - case ARRAY_CHAR : { - char[] params =3D new char[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - // TODO better checking an transformation string to char - while (values.hasNext()) - { - params[i++] =3D values.next().getStringValue().charAt(0); - } - return params; - } - case ARRAY_STRING : { - String[] params =3D new String[jsonValue.size()]; - Iterator values =3D jsonValue.getElements(); - int i =3D 0; - while (values.hasNext()) - { - params[i++] =3D values.next().getStringValue(); - } - return params; - } - default : - // Nothing to do for other type. Exception will be thrown. - break; - } - throw new JsonException("Unknown type " + clazz.getName()); - } - } Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/= frameworks/json/impl/JsonDefaultHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonDefaultHandler.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonDefaultHandler.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -28,8 +28,6 @@ import org.exoplatform.ws.frameworks.json.value.impl.ObjectValue; import org.exoplatform.ws.frameworks.json.value.impl.StringValue; = -import java.util.Stack; - /** * @author Andrey Parfonov * @version $Id: JsonDefaultHandler.java 34417 2009-07-23 14:42:56Z dkatay= ev $ @@ -37,27 +35,19 @@ public class JsonDefaultHandler implements JsonHandler { = - /** - * The key. - */ + /** The key. */ private String key; = - /** - * JsonValue which is currently in process. - */ + /** JsonValue which is currently in process. */ private JsonValue current; = - /** - * Stack of JsonValues. - */ - private Stack values; + /** Stack of JsonValues. */ + private JsonStack values; = - /** - * Constructs new JsonHandler. - */ + /** Constructs new JsonHandler. */ public JsonDefaultHandler() { - this.values =3D new Stack(); + this.values =3D new JsonStack(); } = /** @@ -66,9 +56,13 @@ public void characters(char[] characters) { if (current.isObject()) + { current.addElement(key, parseCharacters(characters)); + } else if (current.isArray()) + { current.addElement(parseCharacters(characters)); + } } = /** @@ -101,10 +95,18 @@ public void startArray() { ArrayValue o =3D new ArrayValue(); - if (current.isObject()) + if (current =3D=3D null) + { + current =3D o; + } + else if (current.isObject()) + { current.addElement(key, o); + } else if (current.isArray()) + { current.addElement(o); + } values.push(current); current =3D o; } @@ -122,14 +124,28 @@ } ObjectValue o =3D new ObjectValue(); if (current.isObject()) + { current.addElement(key, o); + } else if (current.isArray()) + { current.addElement(o); + } values.push(current); current =3D o; } = /** + * Reset JSON events handler and prepare it for next usage. + */ + public void reset() + { + current =3D null; + key =3D null; + values.clear(); + } + + /** * {@inheritDoc} */ public JsonValue getJsonObject() @@ -139,13 +155,13 @@ = /** * Parse characters array dependent of context. + * * @param characters the characters array. * @return JsonValue. */ private JsonValue parseCharacters(char[] characters) { String s =3D new String(characters); - if (characters[0] =3D=3D '"' && characters[characters.length - 1] = =3D=3D '"') { return new StringValue(s.substring(1, s.length() - 1)); @@ -232,9 +248,6 @@ } } // if can't parse return as string - ///////////////////////////////////////////// - //TODO may be better generate exception here - ///////////////////////////////////////////// return new StringValue(s); } = Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/= frameworks/json/impl/JsonGeneratorImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonGeneratorImpl.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonGeneratorImpl.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -71,23 +71,7 @@ */ public JsonValue createJsonArray(Collection collection) throws JsonE= xception { - if (collection =3D=3D null) - return new NullValue(); - - JsonValue jsonArray =3D new ArrayValue(); - for (Object o : collection) - { - // If : - // 1. Known types (primitive, String, array of primitive or Strin= g) - // 2. Array of any object (expect for Java Bean) - // 3. Collection - // 4. Map - if (JsonUtils.getType(o) !=3D null) - jsonArray.addElement(createJsonValue(o)); - else - jsonArray.addElement(createJsonObject(o)); - } - return jsonArray; + return createJsonValue(collection); } = /** @@ -101,77 +85,20 @@ public JsonValue createJsonArray(Object array) throws JsonException { if (array =3D=3D null) + { return new NullValue(); - + } Types t =3D JsonUtils.getType(array); - JsonValue jsonArray =3D new ArrayValue(); - int length =3D Array.getLength(array); - if (t =3D=3D Types.ARRAY_BOOLEAN) + if (t =3D=3D Types.ARRAY_BOOLEAN || t =3D=3D Types.ARRAY_BYTE || t = =3D=3D Types.ARRAY_SHORT || t =3D=3D Types.ARRAY_INT + || t =3D=3D Types.ARRAY_LONG || t =3D=3D Types.ARRAY_FLOAT || t = =3D=3D Types.ARRAY_DOUBLE || t =3D=3D Types.ARRAY_CHAR + || t =3D=3D Types.ARRAY_STRING || t =3D=3D Types.ARRAY_OBJECT) { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new BooleanValue(Array.getBoolean(array, = i))); + return createJsonValue(array); } - else if (t =3D=3D Types.ARRAY_BYTE) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new LongValue(Array.getByte(array, i))); - } - else if (t =3D=3D Types.ARRAY_SHORT) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new LongValue(Array.getShort(array, i))); - } - else if (t =3D=3D Types.ARRAY_INT) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new LongValue(Array.getInt(array, i))); - } - else if (t =3D=3D Types.ARRAY_LONG) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new LongValue(Array.getLong(array, i))); - } - else if (t =3D=3D Types.ARRAY_FLOAT) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new DoubleValue(Array.getFloat(array, i))= ); - } - else if (t =3D=3D Types.ARRAY_DOUBLE) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new DoubleValue(Array.getDouble(array, i)= )); - } - else if (t =3D=3D Types.ARRAY_CHAR) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new StringValue(Character.toString(Array.= getChar(array, i)))); - } - else if (t =3D=3D Types.ARRAY_STRING) - { - for (int i =3D 0; i < length; i++) - jsonArray.addElement(new StringValue((String)Array.get(array, = i))); - } - else if (t =3D=3D Types.ARRAY_OBJECT) - { - for (int i =3D 0; i < length; i++) - { - Object el =3D Array.get(array, i); - // If : - // 1. Known types (primitive, String, array of primitive or St= ring) - // 2. Array of any object (expect for Java Bean) - // 3. Collection - // 4. Map - if (JsonUtils.getType(el) !=3D null) - jsonArray.addElement(createJsonValue(el)); - else - jsonArray.addElement(createJsonObject(el)); - } - } else { throw new JsonException("Invalid argument, must be array."); } - return jsonArray; } = /** @@ -181,52 +108,35 @@ * @return JSON representation of map * @throws JsonException if map can't be transformed in JSON representa= tion */ - public JsonValue createJsonObject(Map map) throws JsonE= xception + public JsonValue createJsonObjectFromMap(Map map) throws Jso= nException { - if (map =3D=3D null) - return new NullValue(); - - JsonValue jsonObject =3D new ObjectValue(); - Set keys =3D map.keySet(); - for (String k : keys) - { - Object o =3D map.get(k); - // If : - // 1. Known types (primitive, String, array of primitive or Strin= g) - // 2. Array of any object (expect for Java Bean) - // 3. Collection - // 4. Map - if (JsonUtils.getType(o) !=3D null) - jsonObject.addElement(k, createJsonValue(o)); - else - jsonObject.addElement(k, createJsonObject(o)); - } - return jsonObject; + return createJsonValue(map); } = /** - * {@inheritDoc} + * Create JSON object from specified object. Object must be conform wit= h java + * bean structure. + * + * @param object source object + * @return JSON representation of object + * @throws JsonException if map can't be transformed in JSON representa= tion */ public JsonValue createJsonObject(Object object) throws JsonException { - Method[] methods =3D object.getClass().getMethods(); - - List transientFields =3D getTransientFields(object.getClass(= )); - + Class clazz =3D object.getClass(); + Method[] methods =3D clazz.getMethods(); + Set transientFields =3D getTransientFields(clazz); JsonValue jsonRootValue =3D new ObjectValue(); - for (Method method : methods) { String methodName =3D method.getName(); - /* * Method must be as follow: - * 1. Name starts from "get" plus at least one character or start= s from - * "is" plus at least one more character and return boolean type - * 2. Must be without parameters - * 3. Must not be in list of skipped methods + * 1. Name starts from "get" plus at least one character or + * starts from "is" plus one more character and return boolean ty= pe; + * 2. Must be without parameters; + * 3. Not be in SKIP_METHODS set. */ - String key =3D null; if (!SKIP_METHODS.contains(methodName) && method.getParameterType= s().length =3D=3D 0) { @@ -240,7 +150,6 @@ key =3D methodName.substring(2); } } - if (key !=3D null) { // First letter of key to lower case. @@ -252,12 +161,6 @@ { // Get result of invoke method get... Object invokeResult =3D method.invoke(object, new Object= [0]); - - // If : - // 1. Known types (primitive, String, array of primitive= or String) - // 2. Array of any object (expect for Java Bean) - // 3. Collection - // 4. Map if (JsonUtils.getType(invokeResult) !=3D null) { jsonRootValue.addElement(key, createJsonValue(invokeR= esult)); @@ -266,15 +169,14 @@ { jsonRootValue.addElement(key, createJsonObject(invoke= Result)); } - } catch (InvocationTargetException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } catch (IllegalAccessException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } } @@ -292,8 +194,8 @@ @SuppressWarnings("unchecked") private JsonValue createJsonValue(Object object) throws JsonException { - Types t =3D JsonUtils.getType(object); - switch (t) + Types type =3D JsonUtils.getType(object); + switch (type) { case NULL : return new NullValue(); @@ -413,7 +315,6 @@ jsonArray.addElement(createJsonObject(el)); } } - return jsonArray; } case COLLECTION : { @@ -430,7 +331,6 @@ jsonArray.addElement(createJsonObject(o)); } } - return jsonArray; } case MAP : @@ -449,13 +349,11 @@ jsonObject.addElement(k, createJsonObject(o)); } } - return jsonObject; default : // Must not be here! return null; } - } = /** @@ -463,18 +361,20 @@ * be not serialized in JSON representation. * * @param clazz the class. - * @return list of fields which must be skiped. + * @return set of fields which must be skiped. */ - private List getTransientFields(Class clazz) + private static Set getTransientFields(Class clazz) { - List l =3D new ArrayList(); + Set set =3D new HashSet(); Field[] fields =3D clazz.getDeclaredFields(); for (Field f : fields) { if (Modifier.isTransient(f.getModifiers())) - l.add(f.getName()); + { + set.add(f.getName()); + } } - return l; + return set; } = } Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/= frameworks/json/impl/JsonParserImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonParserImpl.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonParserImpl.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -28,7 +28,6 @@ import java.io.InputStreamReader; import java.io.PushbackReader; import java.io.Reader; -import java.util.Stack; = /** * @author Andrey Parfonov @@ -37,74 +36,71 @@ public class JsonParserImpl implements JsonParser { = - /** - * JsonHandler will serve events from parser. - */ - private JsonHandler jsonHandler; + /** JsonHandler will serve events from parser. */ + private JsonHandler eventHandler; = - /** - * @see {@link java.io.PushbackReader} . - */ + /** Stack of JSON tokens. */ + private final JsonStack stack; + + /** @see {@link java.io.PushbackReader}. */ private PushbackReader pushbackReader; = - /** - * Stack of JSON tokens. - */ - private Stack jsonTokens =3D new Stack(); - - /** - * Default constructor. - */ public JsonParserImpl() { + stack =3D new JsonStack(); } = /** * {@inheritDoc} */ - public void parse(Reader reader, JsonHandler handler) throws JsonExcept= ion + public void parse(Reader reader, JsonHandler eventHandler) throws JsonE= xception { - jsonHandler =3D handler; - pushbackReader =3D new PushbackReader(reader); - try + this.pushbackReader =3D new PushbackReader(reader); + this.eventHandler =3D eventHandler; + this.stack.clear(); + + char c =3D 0; + while ((c =3D next()) !=3D 0) { - char c =3D 0; - while ((c =3D next()) !=3D 0) + if (c =3D=3D '{') { - if (c =3D=3D '{') - readObject(); - else - throw new JsonException("Syntax error. Unexpected '" + c + = "'. Must be '{'."); + readObject(); } - if (!jsonTokens.isEmpty()) - throw new JsonException("Syntax error. Missing one or more clo= se bracket(s)."); + else if (c =3D=3D '[') + { + readArray(); + } + else + { + throw new JsonException("Syntax error. Unexpected '" + c + "'.= Must be '{'."); + } } - catch (Exception e) + if (!stack.isEmpty()) { - throw new JsonException(e); + throw new JsonException("Syntax error. Missing one or more close = bracket(s)."); } } = /** * {@inheritDoc} */ - public void parse(InputStream sream, JsonHandler handler) throws JsonEx= ception + public void parse(InputStream sream, JsonHandler eventHandler) throws J= sonException { - parse(new InputStreamReader(sream, JsonUtils.DEFAULT_CHARSET), handl= er); + parse(new InputStreamReader(sream, JsonUtils.DEFAULT_CHARSET), event= Handler); } = /** * Read JSON object token, it minds all characters from '{' to '}'. - * = + * * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private void readObject() throws JsonException { char c =3D 0; // inform handler about start of object - jsonHandler.startObject(); - jsonTokens.push(JsonToken.object); + eventHandler.startObject(); + stack.push(JsonToken.object); for (;;) { switch (c =3D next()) @@ -116,11 +112,12 @@ break; case '}' : // inform handler about end of object - jsonHandler.endObject(); + eventHandler.endObject(); // check is allowed end of object now - if (JsonToken.object !=3D jsonTokens.pop()) + if (JsonToken.object !=3D stack.pop()) + { throw new JsonException("Syntax error. Unexpected end of= object."); - + } // check is allowed char after end of json object switch (c =3D next()) { @@ -137,11 +134,13 @@ throw new JsonException("Syntax error. Excpected " + = "for ',' or ']' or '}' but found '" + c + "'."); } - return; // end for(;;) + // end for(;;) + return; case '[' : readArray(); break; - case ',' : // nothing to do just must not be default is switch + case ',' : + // nothing to do just must not be default is switch break; default : back(c); @@ -152,7 +151,9 @@ back(c); // object/array/value if (c !=3D '{' && c !=3D '[') + { readValue(); + } break; } } @@ -160,16 +161,16 @@ = /** * Read JSON array token, it minds all characters from '[' to ']'. - * = + * * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private void readArray() throws JsonException { char c =3D 0; // inform handler about start of array - jsonHandler.startArray(); - jsonTokens.push(JsonToken.array); + eventHandler.startArray(); + stack.push(JsonToken.array); for (;;) { switch (c =3D next()) @@ -178,22 +179,37 @@ throw new JsonException("Syntax error. Unexpected end of ar= ray. Array must end by ']'."); case ']' : // inform handler about end of array - jsonHandler.endArray(); + eventHandler.endArray(); // check is allowed end of array now - if (JsonToken.array !=3D jsonTokens.pop()) + if (JsonToken.array !=3D stack.pop()) + { throw new JsonException("Syntax error. Unexpected end of= array."); + } // check is allowed char after end of json array - - c =3D next(",]}"); - back(c); - return; // end for(;;) + switch (c =3D next()) + { + // end of stream + case 0 : + break; + case ',' : + case ']' : + case '}' : + back(c); + break; + default : + // must not happen + throw new JsonException("Syntax error. Excpected for = ',' or ']' or '}' but found '" + c + "'."); + } + // end for(;;) + return; case '[' : readArray(); break; case '{' : readObject(); break; - case ',' : // nothing to do just must not be default + case ',' : + // nothing to do just must not be default break; default : back(c); @@ -205,28 +221,32 @@ = /** * Read key from stream. - * = + * * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private void readKey() throws JsonException { char c =3D next(); if (c !=3D '"') + { throw new JsonException("Syntax error. Key must start from quote,= but found '" + c + "'."); + } back(c); String s =3D new String(nextString()); // if key as "" if (s.length() =3D=3D 2) + { throw new JsonException("Missing key."); - jsonHandler.key(s.substring(1, s.length() - 1)); + } + eventHandler.key(s.substring(1, s.length() - 1)); } = /** * Read value from stream. - * = + * * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private void readValue() throws JsonException { @@ -235,7 +255,7 @@ if (c =3D=3D '"') { // value will be read as string - jsonHandler.characters(nextString()); + eventHandler.characters(nextString()); } else { @@ -245,11 +265,13 @@ { // Bug : WS-66 if (c =3D=3D 0) + { throw new JsonException("Unexpected end of stream."); + } cw.append(c); } back(c); - jsonHandler.characters(cw.toCharArray()); + eventHandler.characters(cw.toCharArray()); } c =3D next(",]}"); back(c); @@ -259,10 +281,10 @@ * Get next char from stream, skipping whitespace and comments. Comment= s: One * line comment from // to end of line; Multi-line comments from / and = * to * * and / - * = + * * @return the next char. * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private char next() throws JsonException { @@ -291,39 +313,41 @@ { c =3D pushbackReader.read(); if (c =3D=3D '/') + { break; + } } if (c =3D=3D -1) { throw new JsonException("Syntax error. Missing end= of comment."); } } - } else { back((char)c); return '/'; } - } else if (c =3D=3D -1 || c > ' ') + { break; + } } return (c =3D=3D -1) ? 0 : (char)c; } catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = /** * Get next char from stream. - * = + * * @return the next char. * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private char nextAny() throws JsonException { @@ -334,48 +358,55 @@ } catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = /** * Get next char from stream. And check is this char equals expected. - * = + * * @param c the expected char. * @return the next char. * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private char next(char c) throws JsonException { char n =3D next(); if (n !=3D c) + { throw new JsonException("Expected for '" + c + "' but found '" + = n + "'."); + } return n; } = /** - * Get next char from stream. And check is this char presents in given = string. - * = + * Get next char from stream. And check is this char presents in given + * string. + * * @param s the string. * @return the next char. * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private char next(String s) throws JsonException { char n =3D next(); // if char present in string if (s.indexOf(n) >=3D 0) + { return n; + } // else error char[] ch =3D s.toCharArray(); - StringBuffer sb =3D new StringBuffer(); + StringBuilder sb =3D new StringBuilder(); int i =3D 0; for (char c : ch) { if (i > 0) + { sb.append(" or "); + } i++; sb.append('\'').append(c).append('\''); } @@ -384,11 +415,11 @@ = /** * Get next n characters from stream. - * = + * * @param n the number of characters. * @return the array of characters. * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private char[] next(int n) throws JsonException { @@ -397,21 +428,23 @@ { int i =3D pushbackReader.read(buff); if (i =3D=3D -1) + { throw new JsonException("Unexpected end of stream."); + } return buff; } - catch (Exception e) + catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = /** * Get array chars up to given and include it. - * = + * * @return the char array. * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private char[] nextString() throws JsonException { @@ -460,7 +493,9 @@ default : cw.append(c); if (c =3D=3D '"') + { return cw.toCharArray(); + } break; } } @@ -468,10 +503,10 @@ = /** * Push back given char to stream. - * = + * * @param c the char for pushing back. * @throws JsonException if JSON document has wrong format or i/o error - * occurs. + * occurs. */ private void back(char c) throws JsonException { @@ -479,9 +514,9 @@ { pushbackReader.unread(c); } - catch (Exception e) + catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = Added: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/fra= meworks/json/impl/JsonStack.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonStack.java (rev 0) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonStack.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -0,0 +1,63 @@ +/** + * Copyright (C) 2010 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.ws.frameworks.json.impl; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Andrey Parfonov + * @version $Id$ + */ +class JsonStack +{ + + private final List elements; + + JsonStack() + { + elements =3D new ArrayList(16); + } + + boolean isEmpty() + { + return elements.isEmpty(); + } + + T peek() + { + return isEmpty() ? null : elements.get(elements.size() - 1); + } + + T pop() + { + return isEmpty() ? null : elements.remove(elements.size() - 1); + } + + void push(T token) + { + elements.add(token); + } + + void clear() + { + elements.clear(); + } +} Property changes on: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exop= latform/ws/frameworks/json/impl/JsonStack.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/= frameworks/json/impl/JsonUtils.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonUtils.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonUtils.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -105,9 +105,7 @@ /** Map. */ MAP, = - /** - * Enum. - */ + /** Enum. */ ENUM } = @@ -179,7 +177,7 @@ = /** * Transform Java String to JSON string. - * = + * * @param string source String. * @return result. */ @@ -240,7 +238,7 @@ *
  • String
  • *
  • Array of T where T satisfies 2 or 3 or 4 * - * = + * * @param o Object * @return true if Object has one of described above type, * false otherwise @@ -258,7 +256,7 @@ *
  • String
  • *
  • Array of T where T satisfies 1 or 2 or 3 * - * = + * * @param clazz class. * @return true if class object represent one of described * above, false otherwise @@ -277,11 +275,12 @@ *
  • Map<String, ?>
  • * * then null will be returned - * = + * * @param o Object. * @return {@link Types} or null (see above) * @see {@link KNOWN_TYPES}. */ + @SuppressWarnings("unchecked") public static Types getType(Object o) { if (o =3D=3D null) @@ -309,7 +308,7 @@ *
  • Map
  • * * then null will be returned - * = + * * @param o Object. * @return {@link Types} or null (see above) * @see {@link KNOWN_TYPES}. Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/= frameworks/json/impl/JsonWriterImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonWriterImpl.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonWriterImpl.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -26,7 +26,6 @@ import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; -import java.util.Stack; = /** * @author Andrey Parfonov @@ -35,37 +34,278 @@ public class JsonWriterImpl implements JsonWriter { = - /** - * Stack for control position in document. - */ - private final Stack jsonTokens =3D new Stack(); +// /** +// * Stack for control position in document. +// */ +// private final Stack jsonTokens =3D new Stack(); +// +// /** +// * Writer. +// */ +// private final Writer writer; +// +// /** +// * Indicate is current value is the first, if not before value must b= e written +// * comma. +// */ +// private boolean commaFirst =3D false; +// +// /** +// * Constructs JsonWriter. +// * +// * @param writer Writer. +// */ +// public JsonWriterImpl(Writer writer) +// { +// this.writer =3D writer; +// } +// +// /** +// * Constructs JsonWriter. +// * +// * @param out OutputStream. +// * @throws UnsupportedEncodingException +// */ +// public JsonWriterImpl(OutputStream out) +// { +// this(new OutputStreamWriter(out, JsonUtils.DEFAULT_CHARSET)); +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeStartObject() throws JsonException +// { +// if (!jsonTokens.isEmpty()) +// { +// // Object can be stated after key with followed ':' or as array= item. +// if (jsonTokens.peek() !=3D JsonToken.key && jsonTokens.peek() != =3D JsonToken.array) +// throw new JsonException("Syntax error. Unexpected element '{= '."); +// } +// try +// { +// if (commaFirst) // needed ',' before +// writer.write(','); +// writer.write('{'); +// // if at the top of stack is 'key' then remove it. +// if (!jsonTokens.isEmpty() && jsonTokens.peek() =3D=3D JsonToken= .key) +// jsonTokens.pop(); +// jsonTokens.push(JsonToken.object); // remember new object opened +// commaFirst =3D false; +// } +// catch (IOException e) +// { +// throw new JsonException(e); +// } +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeEndObject() throws JsonException +// { +// try +// { +// if (jsonTokens.pop() !=3D JsonToken.object) // wrong JSON struc= ture. +// throw new JsonException("Sysntax error. Unexpected element '= }'."); +// writer.write('}'); +// commaFirst =3D true; +// } +// catch (IOException e) +// { +// throw new JsonException(e); +// } +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeStartArray() throws JsonException +// { +// if (jsonTokens.isEmpty() || (jsonTokens.peek() !=3D JsonToken.key = && jsonTokens.peek() !=3D JsonToken.array)) +// throw new JsonException("Sysntax error. Unexpected element '['.= ."); +// try +// { +// if (commaFirst) // needed ',' before +// writer.write(','); +// writer.write('['); +// if (jsonTokens.peek() =3D=3D JsonToken.key) +// // if at the top of stack is 'key' then remove it. +// jsonTokens.pop(); +// jsonTokens.push(JsonToken.array); // remember new array opened +// commaFirst =3D false; +// } +// catch (IOException e) +// { +// throw new JsonException(e); +// } +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeEndArray() throws JsonException +// { +// try +// { +// if (jsonTokens.pop() !=3D JsonToken.array) // wrong JSON struct= ure +// throw new JsonException("Sysntax error. Unexpected element '= ]'."); +// writer.write(']'); +// commaFirst =3D true; +// } +// catch (IOException e) +// { +// throw new JsonException(e); +// } +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeKey(String key) throws JsonException +// { +// if (key =3D=3D null) +// throw new JsonException("Key is null."); +// if (jsonTokens.isEmpty() || jsonTokens.peek() !=3D JsonToken.objec= t) +// throw new JsonException("Sysntax error. Unexpected characters '= " + key + "'." + jsonTokens); +// try +// { +// if (commaFirst) +// writer.write(','); +// // create JSON representation for given string. +// writer.write(JsonUtils.getJsonString(key)); +// writer.write(':'); +// commaFirst =3D false; +// jsonTokens.push(JsonToken.key); +// } +// catch (IOException e) +// { +// throw new JsonException(e); +// } +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeString(String value) throws JsonException +// { +// write(JsonUtils.getJsonString(value)); +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeValue(long value) throws JsonException +// { +// write(Long.toString(value)); +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeValue(double value) throws JsonException +// { +// write(Double.toString(value)); +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeValue(boolean value) throws JsonException +// { +// write(Boolean.toString(value)); +// } +// +// /** +// * {@inheritDoc} +// */ +// public void writeNull() throws JsonException +// { +// write("null"); +// } +// +// /** +// * {@inheritDoc} +// */ +// public void flush() throws JsonException +// { +// try +// { +// writer.flush(); +// } +// catch (IOException e) +// { +// new JsonException(e); +// } +// } +// +// /** +// * {@inheritDoc} +// */ +// public void close() throws JsonException +// { +// try +// { +// writer.close(); +// } +// catch (IOException e) +// { +// new JsonException(e); +// } +// } +// +// /** +// * Write single String. +// * +// * @param value String. +// * @throws JsonException if any errors occurs. +// */ +// private void write(String value) throws JsonException +// { +// try +// { +// if (jsonTokens.isEmpty() || (jsonTokens.peek() !=3D JsonToken.k= ey && jsonTokens.peek() !=3D JsonToken.array)) +// throw new JsonException("Sysntax error. Unexpected character= s '" + value + "'."); +// if (commaFirst) +// writer.write(','); +// writer.write(value); +// commaFirst =3D true; +// if (jsonTokens.peek() =3D=3D JsonToken.key) +// jsonTokens.pop(); +// } +// catch (IOException e) +// { +// throw new JsonException(e); +// } +// } = - /** - * Writer. - */ + + /** Stack for control position in document. */ + private final JsonStack stack; + + /** Writer. */ private final Writer writer; = - /** - * Indicate is current value is the first, if not before value must be = written - * comma. - */ - private boolean commaFirst =3D false; + /** Indicate is comma must be written before next object or value. */ + private boolean commaFirst; = /** * Constructs JsonWriter. - * = + * * @param writer Writer. */ public JsonWriterImpl(Writer writer) { this.writer =3D writer; + this.stack =3D new JsonStack(); + this.commaFirst =3D false; } = /** * Constructs JsonWriter. - * = + * * @param out OutputStream. - * @throws UnsupportedEncodingException = + * @throws UnsupportedEncodingException */ public JsonWriterImpl(OutputStream out) { @@ -77,26 +317,32 @@ */ public void writeStartObject() throws JsonException { - if (!jsonTokens.isEmpty()) + JsonToken token =3D stack.peek(); + // Object can be stated after key with followed ':' or as array item. + if (token !=3D null && token !=3D JsonToken.key && token !=3D JsonTo= ken.array) { - // Object can be stated after key with followed ':' or as array i= tem. - if (jsonTokens.peek() !=3D JsonToken.key && jsonTokens.peek() != =3D JsonToken.array) - throw new JsonException("Syntax error. Unexpected element '{'.= "); + throw new JsonException("Syntax error. Unexpected element '{'."); } try { - if (commaFirst) // needed ',' before + if (commaFirst) + { + // needed ',' before writer.write(','); + } writer.write('{'); // if at the top of stack is 'key' then remove it. - if (!jsonTokens.isEmpty() && jsonTokens.peek() =3D=3D JsonToken.k= ey) - jsonTokens.pop(); - jsonTokens.push(JsonToken.object); // remember new object opened + if (token =3D=3D JsonToken.key) + { + stack.pop(); + } + // remember new object opened + stack.push(JsonToken.object); commaFirst =3D false; } catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = @@ -107,14 +353,19 @@ { try { - if (jsonTokens.pop() !=3D JsonToken.object) // wrong JSON structu= re. + JsonToken token =3D stack.pop(); + if (token !=3D JsonToken.object) + { + System.out.println(token); + // wrong JSON structure. throw new JsonException("Sysntax error. Unexpected element '}'= ."); + } writer.write('}'); commaFirst =3D true; } catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = @@ -123,22 +374,32 @@ */ public void writeStartArray() throws JsonException { - if (jsonTokens.isEmpty() || (jsonTokens.peek() !=3D JsonToken.key &&= jsonTokens.peek() !=3D JsonToken.array)) - throw new JsonException("Sysntax error. Unexpected element '['.."= ); + JsonToken token =3D stack.peek(); + //if (token !=3D JsonToken.key && token !=3D JsonToken.array) + if (token !=3D null && token !=3D JsonToken.key && token !=3D JsonTo= ken.array) + { + throw new JsonException("Sysntax error. Unexpected element '['."); + } try { - if (commaFirst) // needed ',' before + if (commaFirst) + { + // needed ',' before writer.write(','); + } writer.write('['); - if (jsonTokens.peek() =3D=3D JsonToken.key) + if (token =3D=3D JsonToken.key) + { // if at the top of stack is 'key' then remove it. - jsonTokens.pop(); - jsonTokens.push(JsonToken.array); // remember new array opened + stack.pop(); + } + // remember new array opened + stack.push(JsonToken.array); commaFirst =3D false; } catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = @@ -147,16 +408,20 @@ */ public void writeEndArray() throws JsonException { + JsonToken token =3D stack.pop(); try { - if (jsonTokens.pop() !=3D JsonToken.array) // wrong JSON structure + if (token !=3D JsonToken.array) + { + // wrong JSON structure throw new JsonException("Sysntax error. Unexpected element ']'= ."); + } writer.write(']'); commaFirst =3D true; } catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = @@ -166,22 +431,30 @@ public void writeKey(String key) throws JsonException { if (key =3D=3D null) + { throw new JsonException("Key is null."); - if (jsonTokens.isEmpty() || jsonTokens.peek() !=3D JsonToken.object) - throw new JsonException("Sysntax error. Unexpected characters '" = + key + "'." + jsonTokens); + } + + JsonToken token =3D stack.peek(); + if (token !=3D JsonToken.object) + { + throw new JsonException("Sysntax error. Unexpected characters '" = + key + "'."); + } try { if (commaFirst) + { writer.write(','); + } // create JSON representation for given string. writer.write(JsonUtils.getJsonString(key)); writer.write(':'); commaFirst =3D false; - jsonTokens.push(JsonToken.key); + stack.push(JsonToken.key); } catch (IOException e) { - throw new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = @@ -226,57 +499,66 @@ } = /** - * {@inheritDoc} + * Write single String. + * + * @param value String. + * @throws JsonException if any errors occurs. */ - public void flush() throws JsonException + private void write(String value) throws JsonException { + JsonToken token =3D stack.peek(); try { - writer.flush(); + if (token !=3D JsonToken.key && token !=3D JsonToken.array) + { + throw new JsonException("Sysntax error. Unexpected characters = '" + value + "'."); + } + if (commaFirst) + { + writer.write(','); + } + writer.write(value); + commaFirst =3D true; + if (token =3D=3D JsonToken.key) + { + // if at the top of stack is 'key' then remove it. + stack.pop(); + } } catch (IOException e) { - new JsonException(e); + throw new JsonException(e.getMessage(), e); } } = /** * {@inheritDoc} */ - public void close() throws JsonException + public void flush() throws JsonException { try { - writer.close(); + writer.flush(); } catch (IOException e) { - new JsonException(e); + new JsonException(e.getMessage(), e); } } = /** - * Write single String. - * = - * @param value String. - * @throws JsonException if any errors occurs. + * {@inheritDoc} */ - private void write(String value) throws JsonException + public void close() throws JsonException { try { - if (jsonTokens.isEmpty() || (jsonTokens.peek() !=3D JsonToken.key= && jsonTokens.peek() !=3D JsonToken.array)) - throw new JsonException("Sysntax error. Unexpected characters = '" + value + "'."); - if (commaFirst) - writer.write(','); - writer.write(value); - commaFirst =3D true; - if (jsonTokens.peek() =3D=3D JsonToken.key) - jsonTokens.pop(); + writer.close(); } catch (IOException e) { - throw new JsonException(e); + new JsonException(e.getMessage(), e); } } + } Added: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/fra= meworks/json/impl/ObjectBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/ObjectBuilder.java (rev 0) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/ObjectBuilder.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -0,0 +1,586 @@ +/* + * 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.ws.frameworks.json.impl; + +import org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types; +import org.exoplatform.ws.frameworks.json.value.JsonValue; + +import java.lang.reflect.Array; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.Map; + +/** + * @author Andrey Parfonov + * @version $Id$ + */ +public class ObjectBuilder +{ + static final Collection SKIP_METHODS =3D new HashSet(); + static + { + // Since we need support for Groovy must skip this. + // All "Groovy Objects" implements interface groovy.lang.GroovyObject + // and has method setMetaClass. Not need to process it. + SKIP_METHODS.add("setMetaClass"); + } + + /** + * Create array of Java Object from JSON source include multi-dimension + * array. + * + * @param clazz the Class of target Object. + * @param jsonArray the JSON representation of array + * @return result array + * @throws JsonException if any errors occurs + */ + public static Object createArray(Class clazz, JsonValue jsonArray) t= hrows JsonException + { + Object array =3D null; + if (jsonArray !=3D null && !jsonArray.isNull()) + { + Class componentType =3D clazz.getComponentType(); + array =3D Array.newInstance(componentType, jsonArray.size()); + Iterator values =3D jsonArray.getElements(); + int i =3D 0; + + if (componentType.isArray()) + { + if (JsonUtils.isKnownType(componentType)) + { + while (values.hasNext()) + { + JsonValue v =3D values.next(); + Array.set(array, i++, createObjectKnownTypes(componentTy= pe, v)); + } + } + else + { + while (values.hasNext()) + { + JsonValue v =3D values.next(); + Array.set(array, i++, createArray(componentType, v)); + } + } + } + else + { + if (JsonUtils.isKnownType(componentType)) + { + while (values.hasNext()) + { + JsonValue v =3D values.next(); + Array.set(array, i++, createObjectKnownTypes(componentTy= pe, v)); + } + } + else + { + while (values.hasNext()) + { + JsonValue v =3D values.next(); + Array.set(array, i++, createObject(componentType, v)); + } + } + } + } + return array; + } + + /** + * Create instance of collectionClass from JSON representa= tion. + * If collectionClass is interface then appropriate + * implementation of interface will be returned. + * + * @param collectionClass collection type + * @param genericType generic type of collection + * @param jsonArray the JSON representation of collection + * @return result collection + * @throws JsonException if any errors occurs + */ + public static > T createCollection(Class col= lectionClass, Type genericType, + JsonValue jsonArray) throws JsonException + { + T collection =3D null; + if (jsonArray !=3D null && !jsonArray.isNull()) + { + Class actualType =3D null; + if (genericType instanceof ParameterizedType) + { + // Collection can't be parameterized by other Collection, Arra= y, etc. + ParameterizedType parameterizedType =3D (ParameterizedType)gen= ericType; + try + { + actualType =3D (Class)parameterizedType.getActualTypeArg= uments()[0]; + } + catch (ClassCastException e) + { + throw new JsonException("This type of Collection can't be r= estored from JSON source. " + + "\nCollection is parameterized by wrong Type: " + para= meterizedType + "."); + } + } + else + { + throw new JsonException("Collection is not parameterized. Coll= ection is not supported. " + + "\nCollection must be parameterized by any types, or by J= avaBean with 'get' and 'set' methods."); + } + + Constructor constructor =3D null; + if (collectionClass.isInterface() || Modifier.isAbstract(collecti= onClass.getModifiers())) + { + try + { + constructor =3D ArrayList.class.asSubclass(collectionClass)= .getConstructor(new Class[]{Collection.class}); + } + catch (Exception e) + { + try + { + constructor =3D HashSet.class.asSubclass(collectionClass= ).getConstructor(new Class[]{Collection.class}); + } + catch (Exception e1) + { + try + { + constructor =3D + LinkedList.class.asSubclass(collectionClass).getCo= nstructor(new Class[]{Collection.class}); + } + catch (Exception e2) + { + // ignore exception here + } + } + } + } + else + { + try + { + constructor =3D collectionClass.getConstructor(new Class[]{= Collection.class}); + } + catch (Exception e) + { + throw new JsonException(e.getMessage(), e); + } + } + + if (constructor =3D=3D null) + { + throw new JsonException("Can't find satisfied constructor for = : " + collectionClass); + } + + ArrayList sourceCollection =3D new ArrayList(json= Array.size()); + Iterator values =3D jsonArray.getElements(); + while (values.hasNext()) + { + JsonValue v =3D values.next(); + if (!JsonUtils.isKnownType(actualType)) + { + sourceCollection.add(createObject(actualType, v)); + } + else + { + sourceCollection.add(createObjectKnownTypes(actualType, v)); + } + } + try + { + collection =3D constructor.newInstance(sourceCollection); + } + catch (Exception e) + { + throw new JsonException(e.getMessage(), e); + } + } + return collection; + } + + /** + * Create instance of mapClass from JSON representation. If + * mapClass is interface then appropriate implementation of + * interface will be returned. + * + * @param mapClass map type + * @param genericType actual type of map + * @param jsonObject source JSON object + * @return map + * @throws JsonException if any errors occurs + */ + public static > T createObject(Class mapCla= ss, Type genericType, JsonValue jsonObject) + throws JsonException + { + T map =3D null; + if (jsonObject !=3D null && !jsonObject.isNull()) + { + Class valueActualType =3D null; + if (genericType instanceof ParameterizedType) + { + ParameterizedType parameterizedType =3D (ParameterizedType)gen= ericType; + if (!String.class.isAssignableFrom((Class)parameterizedType= .getActualTypeArguments()[0])) + { + throw new JsonException("Key of Map must be String. "); + } + try + { + valueActualType =3D (Class)parameterizedType.getActualTy= peArguments()[1]; + } + catch (ClassCastException e) + { + throw new JsonException("This type of Map can't be restored= from JSON source." + + "\nMap is parameterized by wrong Type: " + parameteriz= edType + "."); + } + } + else + { + throw new JsonException("Map is not parameterized. Map is not supported." + + "\nMap must be parameterized by String and any types or J= avaBean with 'get' and 'set' methods."); + } + Constructor constructor =3D null; + if (mapClass.isInterface() || Modifier.isAbstract(mapClass.getMod= ifiers())) + { + try + { + constructor =3D HashMap.class.asSubclass(mapClass).getConst= ructor(new Class[]{Map.class}); + } + catch (Exception e) + { + try + { + constructor =3D Hashtable.class.asSubclass(mapClass).get= Constructor(new Class[]{Map.class}); + } + catch (Exception e1) + { + try + { + constructor =3D LinkedHashMap.class.asSubclass(mapCla= ss).getConstructor(new Class[]{Map.class}); + } + catch (Exception e2) + { + // ignore exception here + } + } + } + } + else + { + try + { + constructor =3D mapClass.getConstructor(new Class[]{Map.cla= ss}); + } + catch (Exception e) + { + throw new JsonException(e.getMessage(), e); + } + } + + if (constructor =3D=3D null) + { + throw new JsonException("Can't find satisfied constructor for = : " + mapClass); + } + + HashMap sourceMap =3D new HashMap= (jsonObject.size()); + Iterator keys =3D jsonObject.getKeys(); + while (keys.hasNext()) + { + String k =3D keys.next(); + JsonValue v =3D jsonObject.getElement(k); + if (!JsonUtils.isKnownType(valueActualType)) + { + sourceMap.put(k, createObject(valueActualType, v)); + } + else + { + sourceMap.put(k, createObjectKnownTypes(valueActualType, v)= ); + } + } + try + { + map =3D constructor.newInstance(sourceMap); + } + catch (Exception e) + { + throw new JsonException(e.getMessage(), e); + } + } + return map; + } + + /** + * Create Java Bean from Json Source. + * + * @param clazz the Class of target Object. + * @param jsonValue the Json representation. + * @return Object. + * @throws JsonException if any errors occurs. + */ + @SuppressWarnings("unchecked") + public static T createObject(Class clazz, JsonValue jsonValue) t= hrows JsonException + { + if (jsonValue =3D=3D null || jsonValue.isNull()) + { + return null; + } + + Types type =3D JsonUtils.getType(clazz); + if (type =3D=3D Types.ENUM) + { + // Enum is not instantiable via CLass.getInstance(). + // This is used when enum is member of array or collection. + Class c =3D clazz; + return (T)Enum.valueOf(c, jsonValue.getStringValue()); + } + + if (!jsonValue.isObject()) + { + throw new JsonException("Unsupported type of jsonValue. "); + } + + T object =3D null; + try + { + object =3D clazz.newInstance(); + } + catch (Exception e) + { + throw new JsonException("Unable instantiate object. " + e.getMess= age(), e); + } + + Method[] methods =3D clazz.getMethods(); + + for (Method method : methods) + { + String methodName =3D method.getName(); + Class[] parameterTypes =3D method.getParameterTypes(); + // 3 is length of prefix 'set' + if (!SKIP_METHODS.contains(methodName) && methodName.startsWith("= set") && parameterTypes.length =3D=3D 1 + && methodName.length() > 3) + { + Class methodParameterClass =3D parameterTypes[0]; + // 3 is length of prefix 'set' + String key =3D methodName.substring(3); + // first letter to lower case + key =3D (key.length() > 1) ? Character.toLowerCase(key.charAt(= 0)) + key.substring(1) : key.toLowerCase(); + + JsonValue childJsonValue =3D jsonValue.getElement(key); + if (childJsonValue =3D=3D null) + { + continue; + } + // if one of known primitive type or array of primitive type + try + { + + if (JsonUtils.isKnownType(methodParameterClass)) + { + method.invoke(object, new Object[]{createObjectKnownType= s(methodParameterClass, childJsonValue)}); + } + else + { + Types parameterType =3D JsonUtils.getType(methodParamete= rClass); + // other type Collection, Map or Object[]. + if (parameterType !=3D null) + { + if (parameterType =3D=3D Types.ENUM) + { + Class c =3D methodParameterClass; + Enum en =3D Enum.valueOf(c, childJsonValue.getS= tringValue()); + method.invoke(object, new Object[]{en}); + } + else if (parameterType =3D=3D Types.ARRAY_OBJECT) + { + Object array =3D createArray(methodParameterClass,= childJsonValue); + method.invoke(object, new Object[]{array}); + } + else if (parameterType =3D=3D Types.COLLECTION) + { + Class c =3D methodParameterClass; + method + .invoke(object, createCollection(c, method.getG= enericParameterTypes()[0], childJsonValue)); + } + else if (parameterType =3D=3D Types.MAP) + { + Class c =3D methodParameterClass; + method.invoke(object, createObject(c, method.getGe= nericParameterTypes()[0], childJsonValue)); + } + else + { + // it must never happen! + throw new JsonException("Can't restore parameter o= f method : " + clazz.getName() + "#" + + method.getName() + " from JSON source."); + } + } + else + { + method.invoke(object, createObject(methodParameterCla= ss, childJsonValue)); + } + } + } + catch (Exception e) + { + throw new JsonException("Unable restore parameter via metho= d " + clazz.getName() + "#" + + method.getName() + ". " + e.getMessage(), e); + } + } + } + return object; + } + + /** + * Create Objects of known types. + * + * @param clazz class. + * @param jsonValue JsonValue , @see {@link JsonValue} + * @return Object. + * @throws JsonException if type is unknown. + */ + private static Object createObjectKnownTypes(Class clazz, JsonValue = jsonValue) throws JsonException + { + Types t =3D JsonUtils.getType(clazz); + switch (t) + { + case NULL : + return null; + case BOOLEAN : + return jsonValue.getBooleanValue(); + case BYTE : + return jsonValue.getByteValue(); + case SHORT : + return jsonValue.getShortValue(); + case INT : + return jsonValue.getIntValue(); + case LONG : + return jsonValue.getLongValue(); + case FLOAT : + return jsonValue.getFloatValue(); + case DOUBLE : + return jsonValue.getDoubleValue(); + case CHAR : + // TODO check String length + return jsonValue.getStringValue().charAt(0); + case STRING : + return jsonValue.getStringValue(); + case ARRAY_BOOLEAN : { + boolean[] params =3D new boolean[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getBooleanValue(); + } + return params; + } + case ARRAY_BYTE : { + byte[] params =3D new byte[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getByteValue(); + } + return params; + } + case ARRAY_SHORT : { + short[] params =3D new short[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getShortValue(); + } + return params; + } + case ARRAY_INT : { + int[] params =3D new int[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getIntValue(); + } + return params; + } + case ARRAY_LONG : { + long[] params =3D new long[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getLongValue(); + } + return params; + } + case ARRAY_FLOAT : { + float[] params =3D new float[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getFloatValue(); + } + return params; + } + case ARRAY_DOUBLE : { + double[] params =3D new double[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getDoubleValue(); + } + return params; + } + case ARRAY_CHAR : { + char[] params =3D new char[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + // TODO better checking an transformation string to char + while (values.hasNext()) + { + params[i++] =3D values.next().getStringValue().charAt(0); + } + return params; + } + case ARRAY_STRING : { + String[] params =3D new String[jsonValue.size()]; + Iterator values =3D jsonValue.getElements(); + int i =3D 0; + while (values.hasNext()) + { + params[i++] =3D values.next().getStringValue(); + } + return params; + } + default : + // Nothing to do for other type. Exception will be thrown. + break; + } + throw new JsonException("Unknown type " + clazz.getName()); + } + +} Property changes on: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exop= latform/ws/frameworks/json/impl/ObjectBuilder.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/= frameworks/json/Book.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/Book.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/Book.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -20,7 +20,7 @@ = /** * @author Andrey Parfonov - * @version $Id: Book.java 34417 2009-07-23 14:42:56Z dkatayev $ + * @version $Id: Book.java 45 2010-10-05 06:51:11Z andrew00x $ */ public class Book { @@ -135,10 +135,33 @@ return sb.toString(); } = - public boolean equals(Book book) + public int hashCode() { - return book.getAuthor().equals(author) && book.getTitle().equals(tit= le) && book.getIsdn() =3D=3D isdn - && book.getPages() =3D=3D pages && book.getPrice() =3D=3D price &= & book.isAvailability() =3D=3D availability - && book.getDelivery() =3D=3D delivery; + int hash =3D 8; + hash =3D hash * 31 + (author !=3D null ? author.hashCode() : 0); + hash =3D hash * 31 + (title !=3D null ? title.hashCode() : 0); + hash =3D (int)(hash * 31 + isdn); + hash =3D hash * 31 + pages; + hash =3D (int)(hash * 31 + Double.doubleToLongBits(pages)); + hash =3D (int)(hash * 31 + Double.doubleToLongBits(pages)); + hash =3D hash + (availability ? 1 : 0); + hash =3D hash + (delivery ? 1 : 0); + return hash; } + + public boolean equals(Object other) + { + if (other =3D=3D null) + return false; + if (other.getClass() !=3D getClass()) + return false; + Book book =3D (Book)other; + return (author !=3D null && author.equals(book.getAuthor())) // + && (title !=3D null && title.equals(book.getTitle())) // + && (isdn =3D=3D book.getIsdn()) // + && (pages =3D=3D book.getPages()) // + && (price =3D=3D book.getPrice()) // + && (availability =3D=3D book.isAvailability()) // + && (delivery =3D=3D book.getDelivery()); + } } Deleted: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/f= rameworks/json/impl/JavaNumericTypeTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JavaNumericTypeTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JavaNumericTypeTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -1,103 +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.ws.frameworks.json.impl; - -import junit.framework.TestCase; - -import org.exoplatform.ws.frameworks.json.JsonHandler; -import org.exoplatform.ws.frameworks.json.value.JsonValue; - -import java.io.ByteArrayInputStream; -import java.io.InputStreamReader; -import java.util.Iterator; - -/** - * @author Andrey Parfonov - * @version $Id: JavaNumericTypeTest.java 34417 2009-07-23 14:42:56Z dkata= yev $ - */ -public class JavaNumericTypeTest extends TestCase -{ - - @Override - protected void setUp() throws Exception - { - super.setUp(); - } - - public void testLong() throws Exception - { - JsonParserImpl jsonParser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - String jsonString =3D - "{" + "\"long\":[" + "1, 0xAA, 077, 123, 32765, 77787, 123456789,= " + "0x123456, 0123456, -2387648, -123456789" - + "]" + "}"; - - jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), jsonHandler); - JsonValue jv =3D jsonHandler.getJsonObject(); - assertTrue(jv.getElement("long").isArray()); - Iterator values =3D jv.getElement("long").getElements(); - int i =3D 0; - while (values.hasNext()) - { - JsonValue v =3D values.next(); - assertTrue(v.isNumeric()); - assertTrue(v.isLong()); - assertFalse(v.isDouble()); - if (i =3D=3D 0) - assertEquals(1L, v.getLongValue()); - if (i =3D=3D 3) - assertEquals(123L, v.getLongValue()); - if (i =3D=3D 6) - assertEquals(123456789L, v.getLongValue()); - i++; - } - } - - public void testDouble() throws Exception - { - JsonParserImpl jsonParser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - String jsonString =3D - "{" + "\"double\":[" + "1.0, 0.0006382746, 111111.2222222, 999999= 9999999.9999999999999," - + "9827394873249.8, 1.23456789E8, 123456.789E8, 32154783524786= 51238.0," - + "982.8, 0.00000000000023456789E8, 1.789E8, 0.000000000000000= 0000321547835247865123," - + "982.8, -0.00000000000023456789E8, -1.789E-8, -0.00000000000= 00000000321547835247865123" + "]" + "}"; - - jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), jsonHandler); - JsonValue jv =3D jsonHandler.getJsonObject(); - assertTrue(jv.getElement("double").isArray()); - Iterator values =3D jv.getElement("double").getElements(); - int i =3D 0; - while (values.hasNext()) - { - JsonValue v =3D values.next(); - assertTrue(v.isNumeric()); - assertFalse(v.isLong()); - assertTrue(v.isDouble()); - if (i =3D=3D 0) - assertEquals(1.0, v.getDoubleValue()); - if (i =3D=3D 2) - assertEquals(111111.2222222, v.getDoubleValue()); - if (i =3D=3D 9) - assertEquals(0.00000000000023456789E8, v.getDoubleValue()); - i++; - } - } - -} Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/= frameworks/json/impl/JsonGeneratorTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonGeneratorTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonGeneratorTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -18,8 +18,6 @@ */ package org.exoplatform.ws.frameworks.json.impl; = -import junit.framework.TestCase; - import org.exoplatform.ws.frameworks.json.BeanWithBookEnum; import org.exoplatform.ws.frameworks.json.BeanWithSimpleEnum; import org.exoplatform.ws.frameworks.json.BeanWithTransientField; @@ -42,7 +40,7 @@ * @author Andrey Parfonov * @version $Id: JsonGeneratorTest.java 34417 2009-07-23 14:42:56Z dkataye= v $ */ -public class JsonGeneratorTest extends TestCase +public class JsonGeneratorTest extends JsonTest { = @Override @@ -51,98 +49,103 @@ super.setUp(); } = - public void testSimpleObject() throws Exception + public void testBean() throws Exception { - int _pages =3D 386; - long _isdn =3D 93011099534534L; - double _price =3D 19.37; - String _title =3D "JUnit in Action"; - String _author =3D "Vincent Masson"; - boolean _delivery =3D true; - boolean _availability =3D true; - Book book =3D new Book(); - book.setAuthor(_author); - book.setTitle(_title); - book.setPages(_pages); - book.setPrice(_price); - book.setIsdn(_isdn); - book.setAvailability(_availability); - book.setDelivery(_delivery); + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(jun= itBook); + assertTrue(jsonValue.isObject()); + assertEquals(junitBook.getAuthor(), jsonValue.getElement("author").g= etStringValue()); + assertEquals(junitBook.getTitle(), jsonValue.getElement("title").get= StringValue()); + assertEquals(junitBook.getPages(), jsonValue.getElement("pages").get= IntValue()); + assertEquals(junitBook.getPrice(), jsonValue.getElement("price").get= DoubleValue()); + assertEquals(junitBook.getIsdn(), jsonValue.getElement("isdn").getLo= ngValue()); + assertEquals(junitBook.getDelivery(), jsonValue.getElement("delivery= ").getBooleanValue()); + assertEquals(junitBook.isAvailability(), jsonValue.getElement("avail= ability").getBooleanValue()); + } = - JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(boo= k); + public void testArray() throws Exception + { + Book[] a =3D new Book[]{junitBook, csharpBook, javaScriptBook}; + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonArray(a); + assertTrue(jsonValue.isArray()); + Iterator iterator =3D jsonValue.getElements(); + assertEquals(a[0].getTitle(), iterator.next().getElement("title").ge= tStringValue()); + assertEquals(a[1].getTitle(), iterator.next().getElement("title").ge= tStringValue()); + assertEquals(a[2].getTitle(), iterator.next().getElement("title").ge= tStringValue()); + //System.out.println(jsonValue); + } + + public void testArrayNull() throws Exception + { + Book[] a =3D null; + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonArray(a); + assertTrue(jsonValue.isNull()); + } + + public void testCollection() throws Exception + { + List l =3D Arrays.asList(junitBook, csharpBook, javaScriptBook= ); + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonArray(l); + assertTrue(jsonValue.isArray()); + Iterator iterator =3D jsonValue.getElements(); + assertEquals(l.get(0).getTitle(), iterator.next().getElement("title"= ).getStringValue()); + assertEquals(l.get(1).getTitle(), iterator.next().getElement("title"= ).getStringValue()); + assertEquals(l.get(2).getTitle(), iterator.next().getElement("title"= ).getStringValue()); + //System.out.println(jsonValue); + } + + public void testCollectionNull() throws Exception + { + List l =3D null; + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonArray(l); + assertTrue(jsonValue.isNull()); + } + + public void testMap() throws Exception + { + Map m =3D new HashMap(); + m.put("junit", junitBook); + m.put("csharp", csharpBook); + m.put("js", javaScriptBook); + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObjectFrom= Map(m); assertTrue(jsonValue.isObject()); - assertEquals(_author, jsonValue.getElement("author").getStringValue(= )); - assertEquals(_title, jsonValue.getElement("title").getStringValue()); - assertEquals(_pages, jsonValue.getElement("pages").getIntValue()); - assertEquals(_price, jsonValue.getElement("price").getDoubleValue()); - assertEquals(_isdn, jsonValue.getElement("isdn").getLongValue()); - assertEquals(_delivery, jsonValue.getElement("delivery").getBooleanV= alue()); - assertEquals(_availability, jsonValue.getElement("availability").get= BooleanValue()); + assertEquals(junitBook.getTitle(), jsonValue.getElement("junit").get= Element("title").getStringValue()); + assertEquals(csharpBook.getTitle(), jsonValue.getElement("csharp").g= etElement("title").getStringValue()); + assertEquals(javaScriptBook.getTitle(), jsonValue.getElement("js").g= etElement("title").getStringValue()); + //System.out.println(jsonValue); } = - public void testSimpleObject2() throws Exception + public void testMapNull() throws Exception { - int _pages =3D 386; - int _isdn =3D 930110995; - double _price =3D 19.37; - String _title =3D "JUnit in Action"; - String _author =3D "Vincent Masson"; - boolean _delivery =3D false; - boolean _availability =3D true; - Book book =3D new Book(); - book.setAuthor(_author); - book.setTitle(_title); - book.setPages(_pages); - book.setPrice(_price); - book.setIsdn(_isdn); - book.setAvailability(_availability); - book.setDelivery(_delivery); + Map m =3D null; + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObjectFrom= Map(m); + assertTrue(jsonValue.isNull()); + } = + public void testBeanWrapper() throws Exception + { BookWrapper bookWrapper =3D new BookWrapper(); - bookWrapper.setBook(book); + bookWrapper.setBook(junitBook); JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(boo= kWrapper); assertTrue(jsonValue.isObject()); - assertEquals(_author, jsonValue.getElement("book").getElement("autho= r").getStringValue()); - assertEquals(_title, jsonValue.getElement("book").getElement("title"= ).getStringValue()); - assertEquals(_pages, jsonValue.getElement("book").getElement("pages"= ).getIntValue()); - assertEquals(_price, jsonValue.getElement("book").getElement("price"= ).getDoubleValue()); - assertEquals(_isdn, jsonValue.getElement("book").getElement("isdn").= getLongValue()); - assertEquals(_delivery, jsonValue.getElement("book").getElement("del= ivery").getBooleanValue()); - assertEquals(_availability, jsonValue.getElement("book").getElement(= "availability").getBooleanValue()); + assertEquals(junitBook.getAuthor(), jsonValue.getElement("book").get= Element("author").getStringValue()); + assertEquals(junitBook.getTitle(), jsonValue.getElement("book").getE= lement("title").getStringValue()); + assertEquals(junitBook.getPages(), jsonValue.getElement("book").getE= lement("pages").getIntValue()); + assertEquals(junitBook.getPrice(), jsonValue.getElement("book").getE= lement("price").getDoubleValue()); + assertEquals(junitBook.getIsdn(), jsonValue.getElement("book").getEl= ement("isdn").getLongValue()); + assertEquals(junitBook.getDelivery(), jsonValue.getElement("book").g= etElement("delivery").getBooleanValue()); + assertEquals(junitBook.isAvailability(), jsonValue.getElement("book"= ).getElement("availability") + .getBooleanValue()); } = - public void testSimpleObject3() throws Exception + public void testBeanCollection() throws Exception { - Book book =3D new Book(); - book.setAuthor("Vincent Masson"); - book.setTitle("JUnit in Action"); - book.setPages(386); - book.setPrice(19.37); - book.setIsdn(93011099534534L); - book.setAvailability(true); - book.setDelivery(true); List l =3D new ArrayList(); - l.add(book); - book =3D new Book(); - book.setAuthor("Christian Gross"); - book.setTitle("Beginning C# 2008 from novice to professional"); - book.setPages(511); - book.setPrice(23.56); - book.setIsdn(9781590598696L); - book.setAvailability(true); - book.setDelivery(true); - l.add(book); - book =3D new Book(); - book.setAuthor("Chuck Easttom"); - book.setTitle("Advanced JavaScript, Third Edition"); - book.setPages(617); - book.setPrice(25.99); - book.setIsdn(9781598220339L); - book.setAvailability(true); - book.setDelivery(true); - l.add(book); + l.add(junitBook); + l.add(csharpBook); + l.add(javaScriptBook); BookStorage bookStorage =3D new BookStorage(); bookStorage.setBooks(l); + JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(boo= kStorage); assertTrue(jsonValue.isObject()); Iterator iterator =3D jsonValue.getElement("books").getEl= ements(); @@ -151,35 +154,19 @@ assertEquals(l.get(2).getTitle(), iterator.next().getElement("title"= ).getStringValue()); } = - public void testBeanWithCollections() throws Exception + public void testBeanMap() throws Exception { JavaMapBean mb =3D new JavaMapBean(); + Map m =3D new HashMap(); - Book book =3D new Book(); - book.setAuthor("Vincent Masson"); - book.setTitle("JUnit in Action"); - book.setPages(386); - book.setPrice(19.37); - book.setIsdn(93011099534534L); - m.put("test", book); + m.put("test", junitBook); mb.setHashMap((HashMap)m); = List l =3D new ArrayList(); - l.add(book); - book =3D new Book(); - book.setAuthor("Christian Gross"); - book.setTitle("Beginning C# 2008 from novice to professional"); - book.setPages(511); - book.setPrice(23.56); - book.setIsdn(9781590598696L); - l.add(book); - book =3D new Book(); - book.setAuthor("Chuck Easttom"); - book.setTitle("Advanced JavaScript, Third Edition"); - book.setPages(617); - book.setPrice(25.99); - book.setIsdn(9781598220339L); - l.add(book); + l.add(junitBook); + l.add(csharpBook); + l.add(javaScriptBook); + Map> hu =3D new HashMap>(); hu.put("1", l); hu.put("2", l); @@ -195,31 +182,22 @@ JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(mb); = assertEquals(str.get("key2"), jsonValue.getElement("strings").getEle= ment("key2").getStringValue()); - assertNotNull(jsonValue.getElement("hashMap")); - assertNotNull(jsonValue.getElement("mapList")); - assertEquals("JUnit in Action", jsonValue.getElement("mapList").getE= lement("3").getElements().next().getElement( - "title").getStringValue()); - System.out.println(jsonValue); + assertEquals("JUnit in Action", + jsonValue.getElement("mapList").getElement("3").getElements().nex= t().getElement("title").getStringValue()); + // System.out.println(jsonValue); } = - public void testBeanWithTransientField() throws Exception + public void testBeanTransientField() throws Exception { BeanWithTransientField trBean =3D new BeanWithTransientField(); JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(trB= ean); assertEquals("visible", jsonValue.getElement("field").getStringValue= ()); - try - { - assertEquals("invisible", jsonValue.getElement("transientField").= getStringValue()); - fail("It must not be serialized"); - } - catch (NullPointerException e) - { - } + assertNull(jsonValue.getElement("transientField")); } = - public void testEnumSerialization() throws Exception + public void testBeanEnum() throws Exception { BeanWithSimpleEnum be =3D new BeanWithSimpleEnum(); be.setName("name"); @@ -227,7 +205,7 @@ be.setCounts(new StringEnum[]{StringEnum.ONE, StringEnum.TWO}); be.setCountList(Arrays.asList(StringEnum.ONE, StringEnum.TWO, String= Enum.TREE)); JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(be); - System.out.println(jsonValue); + //System.out.println(jsonValue); = assertEquals("name", jsonValue.getElement("name").getStringValue()); = @@ -255,12 +233,12 @@ assertTrue(tmp.contains(StringEnum.TREE.name())); } = - public void testEnumSerialization2() throws Exception + public void testBeanEnumObject() throws Exception { BeanWithBookEnum be =3D new BeanWithBookEnum(); be.setBook(BookEnum.JUNIT_IN_ACTION); JsonValue jsonValue =3D new JsonGeneratorImpl().createJsonObject(be); - System.out.println(jsonValue); + //System.out.println(jsonValue); assertEquals(BookEnum.JUNIT_IN_ACTION.name(), jsonValue.getElement("= book").getStringValue()); } = Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/= frameworks/json/impl/JsonParserTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonParserTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonParserTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -18,271 +18,189 @@ */ package org.exoplatform.ws.frameworks.json.impl; = -import junit.framework.TestCase; - -import org.exoplatform.ws.frameworks.json.BeanWithBookEnum; -import org.exoplatform.ws.frameworks.json.BeanWithSimpleEnum; -import org.exoplatform.ws.frameworks.json.Book; -import org.exoplatform.ws.frameworks.json.BookEnum; -import org.exoplatform.ws.frameworks.json.BookStorage; -import org.exoplatform.ws.frameworks.json.JavaCollectionBean; -import org.exoplatform.ws.frameworks.json.JavaMapBean; -import org.exoplatform.ws.frameworks.json.JsonHandler; import org.exoplatform.ws.frameworks.json.JsonParser; -import org.exoplatform.ws.frameworks.json.StringEnum; import org.exoplatform.ws.frameworks.json.value.JsonValue; +import org.exoplatform.ws.frameworks.json.value.impl.ArrayValue; +import org.exoplatform.ws.frameworks.json.value.impl.BooleanValue; +import org.exoplatform.ws.frameworks.json.value.impl.DoubleValue; +import org.exoplatform.ws.frameworks.json.value.impl.LongValue; +import org.exoplatform.ws.frameworks.json.value.impl.ObjectValue; +import org.exoplatform.ws.frameworks.json.value.impl.StringValue; = import java.io.ByteArrayInputStream; import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; = /** * @author Andrey Parfonov * @version $Id: JsonParserTest.java 34417 2009-07-23 14:42:56Z dkatayev $ */ -public class JsonParserTest extends TestCase +public class JsonParserTest extends JsonTest { = - ArrayList sourceCollection_; - @Override protected void setUp() throws Exception { super.setUp(); - sourceCollection_ =3D new ArrayList(3); - Book book =3D new Book(); - book.setAuthor("Vincent Masson"); - book.setTitle("JUnit in Action"); - book.setPages(386); - book.setPrice(19.37); - book.setIsdn(93011099534534L); - sourceCollection_.add(book); - Book book1 =3D new Book(); - book1.setAuthor("Christian Gross"); - book1.setTitle("Beginning C# 2008 from novice to professional"); - book1.setPages(511); - book1.setPrice(23.56); - book1.setIsdn(9781590598696L); - sourceCollection_.add(book1); - Book book2 =3D new Book(); - book2.setAuthor("Chuck Easttom"); - book2.setTitle("Advanced JavaScript. Third Edition"); - book2.setPages(617); - book2.setPrice(25.99); - book2.setIsdn(9781598220339L); - sourceCollection_.add(book2); } = - public void testCollection() throws Exception + public void testArrayString() throws Exception { - // test restore Collection of standard Java Object from JSON source - JsonParserImpl jsonParser =3D new JsonParserImpl(); - String jsonString =3D - "{" + "\"strings\":[\"JUnit in Action\",\"Advanced JavaScript\",\= "Beginning C# 2008\"]," - + "\"chars\":[\"b\",\"o\",\"o\",\"k\"]," + "\"integers\":[386,= 421, 565]" + "}"; - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), jsonHandler); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - Object o =3D new BeanBuilder().createObject(JavaCollectionBean.class= , jsonValue); - List s =3D ((JavaCollectionBean)o).getStrings(); + String jsonString =3D "[\"JUnit in Action\",\"Advanced JavaScript\",= \"Beginning C# 2008\"]"; + JsonParser jsonParser =3D new JsonParserImpl(); + + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + assertTrue(jsonValue.isArray()); + Set s =3D new HashSet(); + for (Iterator elements =3D jsonValue.getElements(); eleme= nts.hasNext();) + { + JsonValue next =3D elements.next(); + assertTrue(next.isString()); + s.add(next.getStringValue()); + } assertEquals(3, s.size()); - assertEquals("JUnit in Action", s.get(0)); - assertEquals("Advanced JavaScript", s.get(1)); - assertEquals("Beginning C# 2008", s.get(2)); - List c =3D ((JavaCollectionBean)o).getChars(); - assertEquals('b', c.get(0).charValue()); - assertEquals('o', c.get(1).charValue()); - assertEquals('o', c.get(2).charValue()); - assertEquals('k', c.get(3).charValue()); - List i =3D ((JavaCollectionBean)o).getIntegers(); - assertEquals(386, i.get(0).intValue()); - assertEquals(421, i.get(1).intValue()); - assertEquals(565, i.get(2).intValue()); - // more testing for other type of Collection with custom object + assertTrue(s.contains("JUnit in Action")); + assertTrue(s.contains("Advanced JavaScript")); + assertTrue(s.contains("Beginning C# 2008")); } = - public void testCollection2() throws Exception + public void testArrayLong() throws Exception { - // test restore Collection of other Java Object from JSON source - JsonParserImpl jsonParser =3D new JsonParserImpl(); - // check restore different type of Collection - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( - "CollectionTest.txt")), jsonHandler); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - Object o =3D new BeanBuilder().createObject(JavaCollectionBean.class= , jsonValue); + String jsonString =3D "[1, 0xAA, 077, 123, 32765, 77787, 123456789, = 0x123456, 0123456, -2387648, -123456789]"; = - assertEquals(3, ((JavaCollectionBean)o).getArrayList().size()); - assertTrue(((JavaCollectionBean)o).getArrayList().get(0).equals(sour= ceCollection_.get(0))); - assertTrue(((JavaCollectionBean)o).getArrayList().get(1).equals(sour= ceCollection_.get(1))); - assertTrue(((JavaCollectionBean)o).getArrayList().get(2).equals(sour= ceCollection_.get(2))); + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), handler); + JsonValue jsonValue =3D handler.getJsonObject(); = - assertEquals(3, ((JavaCollectionBean)o).getVector().size()); - assertTrue(((JavaCollectionBean)o).getVector().get(0).equals(sourceC= ollection_.get(0))); - assertTrue(((JavaCollectionBean)o).getVector().get(1).equals(sourceC= ollection_.get(1))); - assertTrue(((JavaCollectionBean)o).getVector().get(2).equals(sourceC= ollection_.get(2))); - - assertEquals(3, ((JavaCollectionBean)o).getLinkedList().size()); - assertTrue(((JavaCollectionBean)o).getLinkedList().get(0).equals(sou= rceCollection_.get(0))); - assertTrue(((JavaCollectionBean)o).getLinkedList().get(1).equals(sou= rceCollection_.get(1))); - assertTrue(((JavaCollectionBean)o).getLinkedList().get(2).equals(sou= rceCollection_.get(2))); - - assertEquals(3, ((JavaCollectionBean)o).getLinkedHashSet().size()); - - assertEquals(3, ((JavaCollectionBean)o).getHashSet().size()); - - assertEquals(3, ((JavaCollectionBean)o).getList().size()); - assertTrue(((JavaCollectionBean)o).getList().get(0).equals(sourceCol= lection_.get(0))); - assertTrue(((JavaCollectionBean)o).getList().get(1).equals(sourceCol= lection_.get(1))); - assertTrue(((JavaCollectionBean)o).getList().get(2).equals(sourceCol= lection_.get(2))); - - assertEquals(3, ((JavaCollectionBean)o).getSet().size()); - - assertEquals(3, ((JavaCollectionBean)o).getQueue().size()); - - assertEquals(3, ((JavaCollectionBean)o).getCollection().size()); - - assertEquals(3, ((JavaCollectionBean)o).getArray().length); - assertTrue(((JavaCollectionBean)o).getArray()[0].equals(sourceCollec= tion_.get(0))); - assertTrue(((JavaCollectionBean)o).getArray()[1].equals(sourceCollec= tion_.get(1))); - assertTrue(((JavaCollectionBean)o).getArray()[2].equals(sourceCollec= tion_.get(2))); + assertTrue(jsonValue.isArray()); + int i =3D 0; + for (Iterator elements =3D jsonValue.getElements(); eleme= nts.hasNext(); i++) + { + JsonValue next =3D elements.next(); + assertTrue(next.isNumeric()); + assertTrue(next.isLong()); + assertFalse(next.isDouble()); + if (i =3D=3D 0) + assertEquals(1L, next.getLongValue()); + if (i =3D=3D 3) + assertEquals(123L, next.getLongValue()); + if (i =3D=3D 6) + assertEquals(123456789L, next.getLongValue()); + } } = - public void testMap() throws Exception + public void testArrayDouble() throws Exception { - JsonParserImpl jsonParser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); String jsonString =3D - "{" + "\"strings\":{" + "\"book\":\"Beginning C# 2008\"," + "\"au= thor\":\"Christian Gross\"" + "}," - + "\"integers\":{" + "\"one\":1," + "\"two\":2," + "\"three\":= 3" + "}," + "\"booleans\":{" - + "\"true\":true," + "\"false\":false" + "}" + "}"; - jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), jsonHandler); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - Object o =3D new BeanBuilder().createObject(JavaMapBean.class, jsonV= alue); + "[1.0, 0.0006382746, 111111.2222222, 9999999999999.9999999999999," + + "9827394873249.8, 1.23456789E8, 123456.789E8, 32154783524786= 51238.0," + + "982.8, 0.00000000000023456789E8, 1.789E8, 0.000000000000000= 0000321547835247865123," + + "982.8, -0.00000000000023456789E8, -1.789E-8, -0.00000000000= 00000000321547835247865123]"; = - assertEquals("Beginning C# 2008", ((JavaMapBean)o).getStrings().get(= "book")); - assertEquals("Christian Gross", ((JavaMapBean)o).getStrings().get("a= uthor")); + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), handler); + JsonValue jsonValue =3D handler.getJsonObject(); = - assertEquals(1, ((JavaMapBean)o).getIntegers().get("one").intValue()= ); - assertEquals(2, ((JavaMapBean)o).getIntegers().get("two").intValue()= ); - assertEquals(3, ((JavaMapBean)o).getIntegers().get("three").intValue= ()); - - assertTrue(((JavaMapBean)o).getBooleans().get("true")); - assertFalse(((JavaMapBean)o).getBooleans().get("false")); + assertTrue(jsonValue.isArray()); + int i =3D 0; + for (Iterator elements =3D jsonValue.getElements(); eleme= nts.hasNext(); i++) + { + JsonValue next =3D elements.next(); + assertTrue(next.isNumeric()); + assertFalse(next.isLong()); + assertTrue(next.isDouble()); + if (i =3D=3D 0) + assertEquals(1.0, next.getDoubleValue()); + if (i =3D=3D 2) + assertEquals(111111.2222222, next.getDoubleValue()); + if (i =3D=3D 9) + assertEquals(0.00000000000023456789E8, next.getDoubleValue()); + } } = - public void testMap2() throws Exception + public void testArrayMixed() throws Exception { - JsonParserImpl jsonParser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( - "MapTest.txt")), jsonHandler); - JsonValue jv =3D jsonHandler.getJsonObject(); - Object o =3D new BeanBuilder().createObject(JavaMapBean.class, jv); + String jsonString =3D "[1.0, \"to be or not to be\", 111, true, {\"o= bject\":{\"foo\":\"bar\"}}]"; = - assertTrue(((JavaMapBean)o).getMap().get("JUnit").equals(sourceColle= ction_.get(0))); - assertTrue(((JavaMapBean)o).getMap().get("C#").equals(sourceCollecti= on_.get(1))); - assertTrue(((JavaMapBean)o).getMap().get("JavaScript").equals(source= Collection_.get(2))); + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), handler); + JsonValue jsonValue =3D handler.getJsonObject(); = - assertTrue(((JavaMapBean)o).getHashMap().get("JUnit").equals(sourceC= ollection_.get(0))); - assertTrue(((JavaMapBean)o).getHashMap().get("C#").equals(sourceColl= ection_.get(1))); - assertTrue(((JavaMapBean)o).getHashMap().get("JavaScript").equals(so= urceCollection_.get(2))); + assertTrue(jsonValue.isArray()); + ArrayValue exp =3D new ArrayValue(); + exp.addElement(new DoubleValue(1.0D)); + exp.addElement(new StringValue("to be or not to be")); + exp.addElement(new LongValue(111)); + exp.addElement(new BooleanValue(true)); + ObjectValue o =3D new ObjectValue(); + o.addElement("foo", new StringValue("bar")); + ObjectValue o1 =3D new ObjectValue(); + o1.addElement("object", o); + exp.addElement(o1); = - assertTrue(((JavaMapBean)o).getHashtable().get("JUnit").equals(sourc= eCollection_.get(0))); - assertTrue(((JavaMapBean)o).getHashtable().get("C#").equals(sourceCo= llection_.get(1))); - assertTrue(((JavaMapBean)o).getHashtable().get("JavaScript").equals(= sourceCollection_.get(2))); - - assertTrue(((JavaMapBean)o).getLinkedHashMap().get("JUnit").equals(s= ourceCollection_.get(0))); - assertTrue(((JavaMapBean)o).getLinkedHashMap().get("C#").equals(sour= ceCollection_.get(1))); - assertTrue(((JavaMapBean)o).getLinkedHashMap().get("JavaScript").equ= als(sourceCollection_.get(2))); - + Iterator elements =3D jsonValue.getElements(); + Iterator expElements =3D jsonValue.getElements(); + for (; elements.hasNext() && expElements.hasNext();) + { + JsonValue next =3D elements.next(); + JsonValue expNext =3D expElements.next(); + assertEquals(expNext.toString(), next.toString()); + } + // Both must be empty + assertFalse(elements.hasNext() || expElements.hasNext()); } = - public void testBean() throws Exception + public void testObject() throws Exception { - JsonParserImpl jsonParser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( - "BookStorage.txt")), jsonHandler); - JsonValue jv =3D jsonHandler.getJsonObject(); - Object o =3D new BeanBuilder().createObject(BookStorage.class, jv); - assertTrue(((BookStorage)o).getBooks().get(0).equals(sourceCollectio= n_.get(0))); - assertTrue(((BookStorage)o).getBooks().get(1).equals(sourceCollectio= n_.get(1))); - assertTrue(((BookStorage)o).getBooks().get(2).equals(sourceCollectio= n_.get(2))); - } + String jsonString =3D + "{\"foo\":\"bar\", \"book\":{\"author\":\"Christian Gross\",\"tit= le\":\"Beginning C# 2008\"}}"; = - public void testMultiDimensionArray() throws Exception - { JsonParser jsonParser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( - "MultiDimension.txt")), jsonHandler); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - // System.out.println(jsonValue); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + assertTrue(jsonValue.isObject()); - assertTrue(jsonValue.getElement("books").isArray()); - assertTrue(jsonValue.getElement("books").getElements().next().isArra= y()); - assertTrue(jsonValue.getElement("books").getElements().next().getEle= ments().next().isArray()); - assertTrue(jsonValue.getElement("books").getElements().next().getEle= ments().next().getElements().next() - .isObject()); - assertEquals("JUnit in Action", jsonValue.getElement("books").getEle= ments().next().getElements().next() - .getElements().next().getElement("title").getStringValue()); + JsonValue sValue =3D jsonValue.getElement("foo"); + assertTrue(sValue.isString()); + assertEquals("bar", sValue.getStringValue()); + JsonValue bookValue =3D jsonValue.getElement("book"); + assertTrue(bookValue.isObject()); + assertEquals("Beginning C# 2008", bookValue.getElement("title").getS= tringValue()); + assertEquals("Christian Gross", bookValue.getElement("author").getSt= ringValue()); } = - public void testEnumSerialization() throws Exception + public void testMultiDimensionArray() throws Exception { - String source =3D - "{\"countList\":[\"ONE\",\"TWO\",\"TREE\"], \"name\":\"andrew\",\= "count\":\"TREE\",\"counts\":[\"TWO\",\"TREE\"]}"; - JsonParser parser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - parser.parse(new ByteArrayInputStream(source.getBytes()), jsonHandle= r); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - // System.out.println(jsonValue); + String jsonString =3D "[\"foo0\", [\"foo1\", \"bar1\", [\"foo2\", \"= bar2\"]], \"bar0\"]"; = - BeanWithSimpleEnum o =3D (BeanWithSimpleEnum)new BeanBuilder().creat= eObject(BeanWithSimpleEnum.class, jsonValue); + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(new ByteArrayInputStream(json= String.getBytes())), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + //System.out.println(jsonValue); = - assertEquals("andrew", o.getName()); + ArrayValue exp =3D new ArrayValue(); + exp.addElement(new StringValue("foo0")); + ArrayValue l1 =3D new ArrayValue(); + exp.addElement(l1); + l1.addElement(new StringValue("foo1")); + l1.addElement(new StringValue("bar1")); + ArrayValue l2 =3D new ArrayValue(); + l1.addElement(l2); + l2.addElement(new StringValue("foo2")); + l2.addElement(new StringValue("bar2")); + exp.addElement(new StringValue("bar0")); = - assertEquals(StringEnum.TREE, o.getCount()); - - StringEnum[] counts =3D o.getCounts(); - assertEquals(2, counts.length); - - List tmp =3D Arrays.asList(counts); - assertTrue(tmp.contains(StringEnum.TWO)); - assertTrue(tmp.contains(StringEnum.TREE)); - - tmp =3D o.getCountList(); - assertEquals(3, tmp.size()); - assertTrue(tmp.contains(StringEnum.ONE)); - assertTrue(tmp.contains(StringEnum.TWO)); - assertTrue(tmp.contains(StringEnum.TREE)); + assertEquals(exp.toString(), jsonValue.toString()); } = - public void testEnumSerialization2() throws Exception - { - String source =3D "{\"book\":\"BEGINNING_C\"}"; - JsonParser parser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - parser.parse(new ByteArrayInputStream(source.getBytes()), jsonHandle= r); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - //System.out.println(jsonValue); - BeanWithBookEnum o =3D (BeanWithBookEnum)new BeanBuilder().createObj= ect(BeanWithBookEnum.class, jsonValue); - assertEquals(BookEnum.BEGINNING_C, o.getBook()); - } - = - public void testArray() throws Exception - { - String source =3D "{\"array\":[\"a\",\"b\",\"c\"]}"; - JsonParser parser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - parser.parse(new ByteArrayInputStream(source.getBytes()), jsonHandle= r); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - System.out.println(jsonValue.getElement("array").isArray()); - = - = - } - } Added: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/fra= meworks/json/impl/JsonTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonTest.java (rev 0) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -0,0 +1,70 @@ +/* + * 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.ws.frameworks.json.impl; + +import junit.framework.TestCase; + +import org.exoplatform.ws.frameworks.json.Book; + +/** + * @author Andrey Parfonov + * @version $Id$ + */ +public abstract class JsonTest extends TestCase +{ + + protected Book junitBook; + + protected Book csharpBook; + + protected Book javaScriptBook; + + protected void setUp() throws Exception + { + super.setUp(); + + junitBook =3D new Book(); + junitBook.setAuthor("Vincent Masson"); + junitBook.setTitle("JUnit in Action"); + junitBook.setPages(386); + junitBook.setPrice(19.37); + junitBook.setIsdn(93011099534534L); + junitBook.setAvailability(false); + junitBook.setDelivery(false); + + csharpBook =3D new Book(); + csharpBook.setAuthor("Christian Gross"); + csharpBook.setTitle("Beginning C# 2008 from novice to professional"); + csharpBook.setPages(511); + csharpBook.setPrice(23.56); + csharpBook.setIsdn(9781590598696L); + csharpBook.setAvailability(false); + csharpBook.setDelivery(false); + + javaScriptBook =3D new Book(); + javaScriptBook.setAuthor("Chuck Easttom"); + javaScriptBook.setTitle("Advanced JavaScript. Third Edition"); + javaScriptBook.setPages(617); + javaScriptBook.setPrice(25.99); + javaScriptBook.setIsdn(9781598220339L); + javaScriptBook.setAvailability(false); + javaScriptBook.setDelivery(false); + } + +} Property changes on: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exop= latform/ws/frameworks/json/impl/JsonTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/= frameworks/json/impl/JsonUtilsTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonUtilsTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonUtilsTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -18,13 +18,11 @@ */ package org.exoplatform.ws.frameworks.json.impl; = -import junit.framework.TestCase; - /** * @author Andrey Parfonov * @version $Id: JsonUtilsTest.java 34417 2009-07-23 14:42:56Z dkatayev $ */ -public class JsonUtilsTest extends TestCase +public class JsonUtilsTest extends JsonTest { = @Override @@ -42,34 +40,34 @@ assertEquals(JsonUtils.getJsonString("str\\ing"), "\"str\\\\ing\""); assertEquals(JsonUtils.getJsonString("stri\"ng"), "\"stri\\\"ng\""); assertEquals(JsonUtils.getJsonString("stri/ng"), "\"stri/ng\""); - int i =3D 0; - for (char c =3D '\u0000'; c < '\u0020'; c++, i++) - { - System.out.print(JsonUtils.getJsonString(c + "") + " "); - if (i > 10) - { - System.out.println(); - i =3D 0; - } - } - for (char c =3D '\u0080'; c < '\u00a0'; c++, i++) - { - System.out.print(JsonUtils.getJsonString(c + " ")); - if (i > 10) - { - System.out.println(); - i =3D 0; - } - } - for (char c =3D '\u2000'; c < '\u2100'; c++, i++) - { - System.out.print(JsonUtils.getJsonString(c + " ")); - if (i > 10) - { - System.out.println(); - i =3D 0; - } - } + // int i =3D 0; + // for (char c =3D '\u0000'; c < '\u0020'; c++, i++) + // { + // System.out.print(JsonUtils.getJsonString(c + "") + " "); + // if (i > 10) + // { + // System.out.println(); + // i =3D 0; + // } + // } + // for (char c =3D '\u0080'; c < '\u00a0'; c++, i++) + // { + // System.out.print(JsonUtils.getJsonString(c + " ")); + // if (i > 10) + // { + // System.out.println(); + // i =3D 0; + // } + // } + // for (char c =3D '\u2000'; c < '\u2100'; c++, i++) + // { + // System.out.print(JsonUtils.getJsonString(c + " ")); + // if (i > 10) + // { + // System.out.println(); + // i =3D 0; + // } + // } } = } Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/= frameworks/json/impl/JsonWriterTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonWriterTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/JsonWriterTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -18,15 +18,13 @@ */ package org.exoplatform.ws.frameworks.json.impl; = -import junit.framework.TestCase; - import java.io.ByteArrayOutputStream; = /** * @author Andrey Parfonov * @version $Id: JsonWriterTest.java 34417 2009-07-23 14:42:56Z dkatayev $ */ -public class JsonWriterTest extends TestCase +public class JsonWriterTest extends JsonTest { = @Override Added: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/fra= meworks/json/impl/ObjectBuilderTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/ObjectBuilderTest.java (rev 0) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/ObjectBuilderTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -0,0 +1,363 @@ +/* + * 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.ws.frameworks.json.impl; + +import org.exoplatform.ws.frameworks.json.BeanWithBookEnum; +import org.exoplatform.ws.frameworks.json.BeanWithSimpleEnum; +import org.exoplatform.ws.frameworks.json.Book; +import org.exoplatform.ws.frameworks.json.BookEnum; +import org.exoplatform.ws.frameworks.json.BookStorage; +import org.exoplatform.ws.frameworks.json.JavaCollectionBean; +import org.exoplatform.ws.frameworks.json.JavaMapBean; +import org.exoplatform.ws.frameworks.json.JsonParser; +import org.exoplatform.ws.frameworks.json.StringEnum; +import org.exoplatform.ws.frameworks.json.value.JsonValue; + +import java.io.ByteArrayInputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author Andrey Parfonov + * @version $Id$ + */ +public class ObjectBuilderTest extends JsonTest +{ + private ArrayList sourceCollection; + + @Override + protected void setUp() throws Exception + { + super.setUp(); + sourceCollection =3D new ArrayList(3); + sourceCollection.add(junitBook); + sourceCollection.add(csharpBook); + sourceCollection.add(javaScriptBook); + } + + public void testCollectionArrayList() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getArrayList().size()); + assertTrue(o.getArrayList().get(0).equals(sourceCollection.get(0))); + assertTrue(o.getArrayList().get(1).equals(sourceCollection.get(1))); + assertTrue(o.getArrayList().get(2).equals(sourceCollection.get(2))); + } + + public void testCollectionVector() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getVector().size()); + assertTrue(o.getVector().get(0).equals(sourceCollection.get(0))); + assertTrue(o.getVector().get(1).equals(sourceCollection.get(1))); + assertTrue(o.getVector().get(2).equals(sourceCollection.get(2))); + } + + public void testCollectionLinkedList() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getLinkedList().size()); + assertTrue(o.getLinkedList().get(0).equals(sourceCollection.get(0))); + assertTrue(o.getLinkedList().get(1).equals(sourceCollection.get(1))); + assertTrue(o.getLinkedList().get(2).equals(sourceCollection.get(2))); + } + + public void testCollectionLinkedHashSet() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getLinkedHashSet().size()); + assertTrue(o.getLinkedHashSet().contains(sourceCollection.get(0))); + assertTrue(o.getLinkedHashSet().contains(sourceCollection.get(1))); + assertTrue(o.getLinkedHashSet().contains(sourceCollection.get(2))); + } + + public void testCollectionHashSet() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getHashSet().size()); + assertTrue(o.getHashSet().contains(sourceCollection.get(0))); + assertTrue(o.getHashSet().contains(sourceCollection.get(1))); + assertTrue(o.getHashSet().contains(sourceCollection.get(2))); + } + + public void testCollectionList() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getList().size()); + assertTrue(o.getList().get(0).equals(sourceCollection.get(0))); + assertTrue(o.getList().get(1).equals(sourceCollection.get(1))); + assertTrue(o.getList().get(2).equals(sourceCollection.get(2))); + } + + public void testCollectionSet() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getSet().size()); + assertTrue(o.getSet().contains(sourceCollection.get(0))); + assertTrue(o.getSet().contains(sourceCollection.get(1))); + assertTrue(o.getSet().contains(sourceCollection.get(2))); + } + + public void testCollectionQueue() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getQueue().size()); + assertTrue(o.getQueue().contains(sourceCollection.get(0))); + assertTrue(o.getQueue().contains(sourceCollection.get(1))); + assertTrue(o.getQueue().contains(sourceCollection.get(2))); + } + + public void testCollectionCollection() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getCollection().size()); + assertTrue(o.getCollection().contains(sourceCollection.get(0))); + assertTrue(o.getCollection().contains(sourceCollection.get(1))); + assertTrue(o.getCollection().contains(sourceCollection.get(2))); + } + + public void testCollectionArray() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + // check restore different type of Collection + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "CollectionTest.txt")), handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + JavaCollectionBean o =3D ObjectBuilder.createObject(JavaCollectionBe= an.class, jsonValue); + + assertEquals(3, o.getArray().length); + assertTrue(o.getArray()[0].equals(sourceCollection.get(0))); + assertTrue(o.getArray()[1].equals(sourceCollection.get(1))); + assertTrue(o.getArray()[2].equals(sourceCollection.get(2))); + } + + public void testMap2() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "MapTest.txt")), handler); + JsonValue jv =3D handler.getJsonObject(); + JavaMapBean o =3D ObjectBuilder.createObject(JavaMapBean.class, jv); + + assertTrue(o.getMap().get("JUnit").equals(sourceCollection.get(0))); + assertTrue(o.getMap().get("C#").equals(sourceCollection.get(1))); + assertTrue(o.getMap().get("JavaScript").equals(sourceCollection.get(= 2))); + + assertTrue(o.getHashMap().get("JUnit").equals(sourceCollection.get(0= ))); + assertTrue(o.getHashMap().get("C#").equals(sourceCollection.get(1))); + assertTrue(o.getHashMap().get("JavaScript").equals(sourceCollection.= get(2))); + + assertTrue(o.getHashtable().get("JUnit").equals(sourceCollection.get= (0))); + assertTrue(o.getHashtable().get("C#").equals(sourceCollection.get(1)= )); + assertTrue(o.getHashtable().get("JavaScript").equals(sourceCollectio= n.get(2))); + + assertTrue(o.getLinkedHashMap().get("JUnit").equals(sourceCollection= .get(0))); + assertTrue(o.getLinkedHashMap().get("C#").equals(sourceCollection.ge= t(1))); + assertTrue(o.getLinkedHashMap().get("JavaScript").equals(sourceColle= ction.get(2))); + + } + + public void testMapMap() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "MapTest.txt")), handler); + JsonValue jv =3D handler.getJsonObject(); + JavaMapBean o =3D ObjectBuilder.createObject(JavaMapBean.class, jv); + + assertTrue(o.getMap().get("JUnit").equals(sourceCollection.get(0))); + assertTrue(o.getMap().get("C#").equals(sourceCollection.get(1))); + assertTrue(o.getMap().get("JavaScript").equals(sourceCollection.get(= 2))); + } + + public void testMapHashMap() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "MapTest.txt")), handler); + JsonValue jv =3D handler.getJsonObject(); + JavaMapBean o =3D ObjectBuilder.createObject(JavaMapBean.class, jv); + + assertTrue(o.getHashMap().get("JUnit").equals(sourceCollection.get(0= ))); + assertTrue(o.getHashMap().get("C#").equals(sourceCollection.get(1))); + assertTrue(o.getHashMap().get("JavaScript").equals(sourceCollection.= get(2))); + } + + public void testMapHashtable() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "MapTest.txt")), handler); + JsonValue jv =3D handler.getJsonObject(); + JavaMapBean o =3D ObjectBuilder.createObject(JavaMapBean.class, jv); + + assertTrue(o.getHashtable().get("JUnit").equals(sourceCollection.get= (0))); + assertTrue(o.getHashtable().get("C#").equals(sourceCollection.get(1)= )); + assertTrue(o.getHashtable().get("JavaScript").equals(sourceCollectio= n.get(2))); + } + + public void testMapLinkedHashMap() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "MapTest.txt")), handler); + JsonValue jv =3D handler.getJsonObject(); + JavaMapBean o =3D ObjectBuilder.createObject(JavaMapBean.class, jv); + + assertTrue(o.getLinkedHashMap().get("JUnit").equals(sourceCollection= .get(0))); + assertTrue(o.getLinkedHashMap().get("C#").equals(sourceCollection.ge= t(1))); + assertTrue(o.getLinkedHashMap().get("JavaScript").equals(sourceColle= ction.get(2))); + } + + public void testBean() throws Exception + { + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( + "BookStorage.txt")), handler); + JsonValue jv =3D handler.getJsonObject(); + BookStorage o =3D ObjectBuilder.createObject(BookStorage.class, jv); + assertTrue(o.getBooks().get(0).equals(sourceCollection.get(0))); + assertTrue(o.getBooks().get(1).equals(sourceCollection.get(1))); + assertTrue(o.getBooks().get(2).equals(sourceCollection.get(2))); + } + + public void testEnumSerialization() throws Exception + { + String source =3D + "{\"countList\":[\"ONE\",\"TWO\",\"TREE\"], \"name\":\"andrew\",\= "count\":\"TREE\",\"counts\":[\"TWO\",\"TREE\"]}"; + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new ByteArrayInputStream(source.getBytes()), handle= r); + JsonValue jsonValue =3D handler.getJsonObject(); + //System.out.println(jsonValue); + + BeanWithSimpleEnum o =3D ObjectBuilder.createObject(BeanWithSimpleEn= um.class, jsonValue); + + assertEquals("andrew", o.getName()); + + assertEquals(StringEnum.TREE, o.getCount()); + + StringEnum[] counts =3D o.getCounts(); + assertEquals(2, counts.length); + + List tmp =3D Arrays.asList(counts); + assertTrue(tmp.contains(StringEnum.TWO)); + assertTrue(tmp.contains(StringEnum.TREE)); + + tmp =3D o.getCountList(); + assertEquals(3, tmp.size()); + assertTrue(tmp.contains(StringEnum.ONE)); + assertTrue(tmp.contains(StringEnum.TWO)); + assertTrue(tmp.contains(StringEnum.TREE)); + } + + public void testEnumSerialization2() throws Exception + { + String source =3D "{\"book\":\"BEGINNING_C\"}"; + JsonParser jsonParser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + jsonParser.parse(new ByteArrayInputStream(source.getBytes()), handle= r); + JsonValue jsonValue =3D handler.getJsonObject(); + //System.out.println(jsonValue); + BeanWithBookEnum o =3D ObjectBuilder.createObject(BeanWithBookEnum.c= lass, jsonValue); + assertEquals(BookEnum.BEGINNING_C, o.getBook()); + } +} Property changes on: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exop= latform/ws/frameworks/json/impl/ObjectBuilderTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/= frameworks/json/impl/TransferJavaBeanTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/TransferJavaBeanTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/TransferJavaBeanTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -18,8 +18,6 @@ */ package org.exoplatform.ws.frameworks.json.impl; = -import junit.framework.TestCase; - import org.exoplatform.ws.frameworks.json.Book; import org.exoplatform.ws.frameworks.json.JsonHandler; import org.exoplatform.ws.frameworks.json.JsonParser; @@ -33,7 +31,7 @@ * @author Andrey Parfonov * @version $Id: TransferJavaBeanTest.java 34417 2009-07-23 14:42:56Z dkat= ayev $ */ -public class TransferJavaBeanTest extends TestCase +public class TransferJavaBeanTest extends JsonTest { = @Override @@ -71,7 +69,7 @@ = jsonParser.parse(in, jsonHandler); JsonValue jsonValue =3D jsonHandler.getJsonObject(); - Book newBook =3D (Book)new BeanBuilder().createObject(Book.class, js= onValue); + Book newBook =3D ObjectBuilder.createObject(Book.class, jsonValue); assertEquals(author, newBook.getAuthor()); assertEquals(title, newBook.getTitle()); assertEquals(pages, newBook.getPages()); Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/= frameworks/json/impl/groovy/GroovyBeanTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/java/org/exoplatform/ws/framew= orks/json/impl/groovy/GroovyBeanTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/framew= orks/json/impl/groovy/GroovyBeanTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -23,10 +23,10 @@ import junit.framework.TestCase; = import org.exoplatform.ws.frameworks.json.JsonHandler; -import org.exoplatform.ws.frameworks.json.impl.BeanBuilder; import org.exoplatform.ws.frameworks.json.impl.JsonDefaultHandler; import org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl; import org.exoplatform.ws.frameworks.json.impl.JsonParserImpl; +import org.exoplatform.ws.frameworks.json.impl.ObjectBuilder; import org.exoplatform.ws.frameworks.json.value.JsonValue; import org.exoplatform.ws.frameworks.json.value.impl.ObjectValue; import org.exoplatform.ws.frameworks.json.value.impl.StringValue; @@ -46,7 +46,7 @@ JsonValue ov =3D new ObjectValue(); StringValue sv =3D new StringValue("test restore groovy bean"); ov.addElement("value", sv); - assertEquals("test restore groovy bean", new BeanBuilder().createObj= ect(c, ov).toString()); + assertEquals("test restore groovy bean", ObjectBuilder.createObject(= c, ov).toString()); } = @SuppressWarnings("unchecked") @@ -89,7 +89,7 @@ jsonParser.parse(new InputStreamReader(Thread.currentThread().getCon= textClassLoader().getResourceAsStream( "BookStorage.txt")), jsonHandler); JsonValue jv =3D jsonHandler.getJsonObject(); - GroovyObject o =3D (GroovyObject)new BeanBuilder().createObject(c, j= v); + GroovyObject o =3D (GroovyObject)ObjectBuilder.createObject(c, jv); //System.out.println(o); List books =3D (List)o.getProperty("book= s"); assertEquals(3, books.size()); Deleted: ws/trunk/exo.ws.frameworks.json/src/test/resources/MultiDimension.= 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 --- ws/trunk/exo.ws.frameworks.json/src/test/resources/MultiDimension.txt 2= 010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.frameworks.json/src/test/resources/MultiDimension.txt 2= 010-10-05 14:59:07 UTC (rev 3246) @@ -1,36 +0,0 @@ -/* don't edit me */ -{ -"books":[ -[ - [ {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}], - [ {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}, - {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}] -], -[ - [ {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}, - {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}], - [ {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}, - {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}, - {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}, - {"title":"JUnit in Action","pages":386,"isdn":93011099534534,"price":1= 9.37,"author":"Vincent Masson"}, - {"title":"Beginning C# 2008 from novice to professional","pages":511,"= isdn":9781590598696,"price":23.56,"author":"Christian Gross"}, - {"title":"Advanced JavaScript. Third Edition","pages":617,"isdn":97815= 98220339,"price":25.99,"author":"Chuck Easttom"}] -] -] -} \ No newline at end of file Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/= rest/impl/provider/JsonEntityProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/provider/JsonEntityProvider.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityProvider.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -19,15 +19,14 @@ package org.exoplatform.services.rest.impl.provider; = import org.exoplatform.services.rest.provider.EntityProvider; -import org.exoplatform.ws.frameworks.json.JsonHandler; -import org.exoplatform.ws.frameworks.json.JsonParser; -import org.exoplatform.ws.frameworks.json.JsonWriter; -import org.exoplatform.ws.frameworks.json.impl.BeanBuilder; import org.exoplatform.ws.frameworks.json.impl.JsonDefaultHandler; import org.exoplatform.ws.frameworks.json.impl.JsonException; import org.exoplatform.ws.frameworks.json.impl.JsonGeneratorImpl; import org.exoplatform.ws.frameworks.json.impl.JsonParserImpl; +import org.exoplatform.ws.frameworks.json.impl.JsonUtils; import org.exoplatform.ws.frameworks.json.impl.JsonWriterImpl; +import org.exoplatform.ws.frameworks.json.impl.ObjectBuilder; +import org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types; import org.exoplatform.ws.frameworks.json.value.JsonValue; = import java.io.IOException; @@ -35,6 +34,8 @@ import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Type; +import java.util.Collection; +import java.util.Map; = import javax.ws.rs.Consumes; import javax.ws.rs.Produces; @@ -71,19 +72,38 @@ /** * {@inheritDoc} */ + @SuppressWarnings("unchecked") public Object readFrom(Class type, Type genericType, Annotation= [] annotations, MediaType mediaType, MultivaluedMap httpHeaders, InputStream entityStream= ) throws IOException { try { - JsonParser jsonParser =3D new JsonParserImpl(); - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - jsonParser.parse(entityStream, jsonHandler); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); - // jsonValue can be null if stream empty - if (jsonValue =3D=3D null) - return null; - return new BeanBuilder().createObject(type, jsonValue); + JsonParserImpl parser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + + parser.parse(entityStream, handler); + JsonValue jsonValue =3D handler.getJsonObject(); + + Types jtype =3D JsonUtils.getType(type); + if (jtype =3D=3D Types.ARRAY_BOOLEAN || jtype =3D=3D Types.ARRAY_= BYTE || jtype =3D=3D Types.ARRAY_SHORT + || jtype =3D=3D Types.ARRAY_INT || jtype =3D=3D Types.ARRAY_LO= NG || jtype =3D=3D Types.ARRAY_FLOAT + || jtype =3D=3D Types.ARRAY_DOUBLE || jtype =3D=3D Types.ARRAY= _CHAR || jtype =3D=3D Types.ARRAY_STRING + || jtype =3D=3D Types.ARRAY_OBJECT) + { + return ObjectBuilder.createArray(type, jsonValue); + } + if (jtype =3D=3D Types.COLLECTION) + { + Class c =3D type; + return ObjectBuilder.createCollection(c, genericType, jsonValu= e); + } + if (jtype =3D=3D Types.MAP) + { + Class c =3D type; + return ObjectBuilder.createObject(c, genericType, jsonValue); + } + return ObjectBuilder.createObject(type, jsonValue); + } catch (Exception e) { @@ -111,14 +131,37 @@ /** * {@inheritDoc} */ + @SuppressWarnings("unchecked") public void writeTo(Object t, Class type, Type genericType, Annotati= on[] annotations, MediaType mediaType, MultivaluedMap httpHeaders, OutputStream entityStrea= m) throws IOException { try { - JsonValue jv =3D new JsonGeneratorImpl().createJsonObject(t); - JsonWriter jsonWriter =3D new JsonWriterImpl(entityStream); - jv.writeTo(jsonWriter); + JsonGeneratorImpl generator =3D new JsonGeneratorImpl(); + JsonValue jsonValue =3D null; + Types jtype =3D JsonUtils.getType(type); + if (jtype =3D=3D Types.ARRAY_BOOLEAN || jtype =3D=3D Types.ARRAY_= BYTE || jtype =3D=3D Types.ARRAY_SHORT + || jtype =3D=3D Types.ARRAY_INT || jtype =3D=3D Types.ARRAY_LO= NG || jtype =3D=3D Types.ARRAY_FLOAT + || jtype =3D=3D Types.ARRAY_DOUBLE || jtype =3D=3D Types.ARRAY= _CHAR || jtype =3D=3D Types.ARRAY_STRING + || jtype =3D=3D Types.ARRAY_OBJECT) + { + jsonValue =3D generator.createJsonArray(t); + } + else if (jtype =3D=3D Types.COLLECTION) + { + jsonValue =3D generator.createJsonArray((Collection)t); + } + else if (jtype =3D=3D Types.MAP) + { + jsonValue =3D generator.createJsonObjectFromMap((Map)t); + } + else + { + jsonValue =3D generator.createJsonObject(t); + } + + JsonWriterImpl jsonWriter =3D new JsonWriterImpl(entityStream); + jsonValue.writeTo(jsonWriter); jsonWriter.flush(); } catch (JsonException e) Deleted: ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/r= est/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/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityTest.java 2010-10-05 11:33:24 UTC (rev 3245) +++ ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -1,132 +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.provider; - -import org.exoplatform.services.rest.BaseTest; -import org.exoplatform.services.rest.generated.Book; -import org.exoplatform.services.rest.impl.ContainerResponse; -import org.exoplatform.services.rest.impl.MultivaluedMapImpl; -import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWrite= r; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MultivaluedMap; - -/** - * @author Andrey Parfonov - * @version $Id: $ - */ -public class JsonEntityTest extends BaseTest -{ - - @Path("/") - public static class Resource1 - { - @POST - @Consumes("application/json") - public void m1(Book book) - { - assertEquals("Hamlet", book.getTitle()); - assertEquals("William Shakespeare", book.getAuthor()); - assertTrue(book.isSendByPost()); - } - } - - @Path("/") - public static class Resource2 - { - @GET - @Produces("application/json") - public Book m1() - { - Book book =3D new Book(); - book.setTitle("Hamlet"); - book.setAuthor("William Shakespeare"); - book.setSendByPost(true); - return book; - } - - // Without @Produces annotation also should work. - @POST - public Book m2() - { - Book book =3D new Book(); - book.setTitle("Hamlet\n"); - book.setAuthor("William Shakespeare\n"); - book.setSendByPost(false); - return book; - } - } - - private byte[] jsonData; - - public void setUp() throws Exception - { - super.setUp(); - jsonData =3D - ("{\"title\":\"Hamlet\"," + "\"author\":\"William Shakespeare\","= + "\"sendByPost\":true}").getBytes("UTF-8"); - } - - public void testJsonEntityParameter() throws Exception - { - Resource1 r1 =3D new Resource1(); - registry(r1); - MultivaluedMap h =3D new MultivaluedMapImpl(); - // Object is transfered via JSON - h.putSingle("content-type", "application/json"); - // 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, launcher.service("POST", "/", "", h, jsonData, nul= l).getStatus()); - unregistry(r1); - } - - public void testJsonReturn() throws Exception - { - Resource2 r2 =3D new Resource2(); - registry(r2); - MultivaluedMap h =3D new MultivaluedMapImpl(); - h.putSingle("accept", "application/json"); - ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); - - // Resource2#m1() - 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(); - assertEquals("Hamlet", book.getTitle()); - assertEquals("William Shakespeare", book.getAuthor()); - assertTrue(book.isSendByPost()); - - // Resource2#m2() - response =3D launcher.service("POST", "/", "", h, null, writer, null= ); - assertEquals(200, response.getStatus()); - assertEquals("application/json", response.getContentType().toString(= )); - book =3D (Book)response.getEntity(); - assertEquals("Hamlet\n", book.getTitle()); - assertEquals("William Shakespeare\n", book.getAuthor()); - assertFalse(book.isSendByPost()); -// writer =3D new ByteArrayContainerResponseWriter(); - unregistry(r2); - } - -} Added: ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/res= t/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/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityTest.java (rev 0) +++ ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityTest.java 2010-10-05 14:59:07 UTC (rev 3246) @@ -0,0 +1,475 @@ +/* + * 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.provider; + +import org.exoplatform.services.rest.BaseTest; +import org.exoplatform.services.rest.generated.Book; +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.ws.frameworks.json.impl.JsonDefaultHandler; +import org.exoplatform.ws.frameworks.json.impl.JsonParserImpl; +import org.exoplatform.ws.frameworks.json.impl.ObjectBuilder; + +import java.io.ByteArrayInputStream; +import java.lang.reflect.ParameterizedType; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MultivaluedMap; + +/** + * @author Andrey Parfonov + * @version $Id$ + */ +public class JsonEntityTest extends BaseTest +{ + + @Path("/") + public static class ResourceBook + { + @POST + @Consumes("application/json") + public void m1(Book book) + { + assertEquals("Hamlet", book.getTitle()); + assertEquals("William Shakespeare", book.getAuthor()); + assertTrue(book.isSendByPost()); + } + } + + @Path("/") + public static class ResourceBookArray + { + @POST + @Consumes("application/json") + public void m1(Book[] b) + { + assertEquals("Hamlet", b[0].getTitle()); + assertEquals("William Shakespeare", b[0].getAuthor()); + assertTrue(b[0].isSendByPost()); + assertEquals("Collected Stories", b[1].getTitle()); + assertEquals("Gabriel Garcia Marquez", b[1].getAuthor()); + assertTrue(b[1].isSendByPost()); + } + } + + @Path("/") + public static class ResourceBookCollection + { + @POST + @Consumes("application/json") + public void m1(List b) + { + assertEquals("Hamlet", b.get(0).getTitle()); + assertEquals("William Shakespeare", b.get(0).getAuthor()); + assertTrue(b.get(0).isSendByPost()); + assertEquals("Collected Stories", b.get(1).getTitle()); + assertEquals("Gabriel Garcia Marquez", b.get(1).getAuthor()); + assertTrue(b.get(1).isSendByPost()); + } + } + + @Path("/") + public static class ResourceBookMap + { + @POST + @Consumes("application/json") + public void m1(Map b) + { + assertEquals("Hamlet", b.get("12345").getTitle()); + assertEquals("William Shakespeare", b.get("12345").getAuthor()); + assertTrue(b.get("12345").isSendByPost()); + assertEquals("Collected Stories", b.get("54321").getTitle()); + assertEquals("Gabriel Garcia Marquez", b.get("54321").getAuthor()= ); + assertTrue(b.get("54321").isSendByPost()); + } + } + + @Path("/") + public static class ResourceBook2 + { + @GET + @Produces("application/json") + public Book m1() + { + Book book =3D new Book(); + book.setTitle("Hamlet"); + book.setAuthor("William Shakespeare"); + book.setSendByPost(true); + return book; + } + + // Without @Produces annotation also should work. + @POST + public Book m2() + { + return m1(); + } + } + + @Path("/") + public static class ResourceBookArray2 + { + @GET + @Produces("application/json") + public Book[] m1() + { + return createArray(); + } + + // Without @Produces annotation also should work. + @POST + public Book[] m2() + { + return createArray(); + } + + private Book[] createArray() + { + Book book1 =3D new Book(); + book1.setTitle("Hamlet"); + book1.setAuthor("William Shakespeare"); + book1.setSendByPost(true); + Book book2 =3D new Book(); + book2.setTitle("Collected Stories"); + book2.setAuthor("Gabriel Garcia Marquez"); + book2.setSendByPost(true); + return new Book[]{book1, book2}; + } + } + + @Path("/") + public static class ResourceBookCollection2 + { + @GET + @Produces("application/json") + public List m1() + { + return createCollection(); + } + + // Without @Produces annotation also should work. + @POST + public List m2() + { + return createCollection(); + } + + private List createCollection() + { + Book book1 =3D new Book(); + book1.setTitle("Hamlet"); + book1.setAuthor("William Shakespeare"); + book1.setSendByPost(true); + Book book2 =3D new Book(); + book2.setTitle("Collected Stories"); + book2.setAuthor("Gabriel Garcia Marquez"); + book2.setSendByPost(true); + return Arrays.asList(book1, book2); + } + } + + @Path("/") + public static class ResourceBookMap2 + { + @GET + @Produces("application/json") + public Map m1() + { + return createMap(); + } + + // Without @Produces annotation also should work. + @POST + public Map m2() + { + return createMap(); + } + + private Map createMap() + { + Book book1 =3D new Book(); + book1.setTitle("Hamlet"); + book1.setAuthor("William Shakespeare"); + book1.setSendByPost(true); + Book book2 =3D new Book(); + book2.setTitle("Collected Stories"); + book2.setAuthor("Gabriel Garcia Marquez"); + book2.setSendByPost(true); + Map m =3D new HashMap(); + m.put("12345", book1); + m.put("54321", book2); + return m; + } + } + + private byte[] jsonBookData; + + private byte[] jsonArrayData; + + private byte[] jsonMapData; + + public void setUp() throws Exception + { + super.setUp(); + jsonBookData =3D + ("{\"title\":\"Hamlet\", \"author\":\"William Shakespeare\", \"se= ndByPost\":true}").getBytes("UTF-8"); + jsonArrayData =3D + ("[{\"title\":\"Hamlet\", \"author\":\"William Shakespeare\", \"s= endByPost\":true}," + + "{\"title\":\"Collected Stories\", \"author\":\"Gabriel Garc= ia Marquez\", \"sendByPost\":true}]") + .getBytes("UTF-8"); + jsonMapData =3D + ("{\"12345\":{\"title\":\"Hamlet\", \"author\":\"William Shakespe= are\", \"sendByPost\":true}," + + "\"54321\":{\"title\":\"Collected Stories\", \"author\":\"Ga= briel Garcia Marquez\", \"sendByPost\":true}}") + .getBytes("UTF-8"); + } + + public void testJsonEntityBean() throws Exception + { + ResourceBook r1 =3D new ResourceBook(); + registry(r1); + MultivaluedMap h =3D new MultivaluedMapImpl(); + // Object is transfered via JSON + h.putSingle("content-type", "application/json"); + // 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", "" + jsonBookData.length); + assertEquals(204, launcher.service("POST", "/", "", h, jsonBookData,= null).getStatus()); + unregistry(r1); + } + + public void testJsonEntityArray() throws Exception + { + ResourceBookArray r1 =3D new ResourceBookArray(); + registry(r1); + MultivaluedMap h =3D new MultivaluedMapImpl(); + // Object is transfered via JSON + h.putSingle("content-type", "application/json"); + h.putSingle("content-length", "" + jsonArrayData.length); + assertEquals(204, launcher.service("POST", "/", "", h, jsonArrayData= , null).getStatus()); + unregistry(r1); + } + + public void testJsonEntityCollection() throws Exception + { + ResourceBookCollection r1 =3D new ResourceBookCollection(); + registry(r1); + MultivaluedMap h =3D new MultivaluedMapImpl(); + // Object is transfered via JSON + h.putSingle("content-type", "application/json"); + h.putSingle("content-length", "" + jsonArrayData.length); + assertEquals(204, launcher.service("POST", "/", "", h, jsonArrayData= , null).getStatus()); + unregistry(r1); + } + + public void testJsonEntityMap() throws Exception + { + ResourceBookMap r1 =3D new ResourceBookMap(); + registry(r1); + MultivaluedMap h =3D new MultivaluedMapImpl(); + // Object is transfered via JSON + h.putSingle("content-type", "application/json"); + h.putSingle("content-length", "" + jsonMapData.length); + assertEquals(204, launcher.service("POST", "/", "", h, jsonMapData, = null).getStatus()); + unregistry(r1); + } + + public void testJsonReturnBean() throws Exception + { + ResourceBook2 r2 =3D new ResourceBook2(); + registry(r2); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("accept", "application/json"); + ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); + + // ResourceBook2#m1() + ContainerResponse response =3D launcher.service("GET", "/", "", h, n= ull, writer, null); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + JsonParserImpl parser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + Book book =3D ObjectBuilder.createObject(Book.class, handler.getJson= Object()); + assertEquals("Hamlet", book.getTitle()); + assertEquals("William Shakespeare", book.getAuthor()); + assertTrue(book.isSendByPost()); + + // ResourceBook2#m2() + writer.reset(); + handler.reset(); + response =3D launcher.service("POST", "/", "", h, null, writer, null= ); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + book =3D ObjectBuilder.createObject(Book.class, handler.getJsonObjec= t()); + assertEquals("Hamlet", book.getTitle()); + assertEquals("William Shakespeare", book.getAuthor()); + assertTrue(book.isSendByPost()); + + unregistry(r2); + } + + public void testJsonReturnBeanArray() throws Exception + { + ResourceBookArray2 r2 =3D new ResourceBookArray2(); + registry(r2); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("accept", "application/json"); + ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); + + // ResourceBookArray2#m1() + ContainerResponse response =3D launcher.service("GET", "/", "", h, n= ull, writer, null); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + JsonParserImpl parser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + Book[] book =3D (Book[])ObjectBuilder.createArray(new Book[0].getCla= ss(), handler.getJsonObject()); + assertEquals("Hamlet", book[0].getTitle()); + assertEquals("William Shakespeare", book[0].getAuthor()); + assertTrue(book[0].isSendByPost()); + assertEquals("Collected Stories", book[1].getTitle()); + assertEquals("Gabriel Garcia Marquez", book[1].getAuthor()); + assertTrue(book[1].isSendByPost()); + //System.out.println("array: " + new String(writer.getBody())); + + // ResourceBookArray2#m2() + writer.reset(); + handler.reset(); + response =3D launcher.service("POST", "/", "", h, null, writer, null= ); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + book =3D (Book[])ObjectBuilder.createArray(new Book[0].getClass(), h= andler.getJsonObject()); + assertEquals("Hamlet", book[0].getTitle()); + assertEquals("William Shakespeare", book[0].getAuthor()); + assertTrue(book[0].isSendByPost()); + assertEquals("Collected Stories", book[1].getTitle()); + assertEquals("Gabriel Garcia Marquez", book[1].getAuthor()); + assertTrue(book[1].isSendByPost()); + //System.out.println("array: " + new String(writer.getBody())); + + unregistry(r2); + } + + @SuppressWarnings({"unchecked", "serial"}) + public void testJsonReturnBeanCollection() throws Exception + { + ResourceBookCollection2 r2 =3D new ResourceBookCollection2(); + registry(r2); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("accept", "application/json"); + ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); + + // ResourceBookCollection2#m1() + ContainerResponse response =3D launcher.service("GET", "/", "", h, n= ull, writer, null); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + JsonParserImpl parser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + ParameterizedType genericType =3D (ParameterizedType)new ArrayList() + { + }.getClass().getGenericSuperclass(); + //System.out.println(">>>>>"+genericType); + List book =3D ObjectBuilder.createCollection(List.class, gener= icType, handler.getJsonObject()); + assertEquals("Hamlet", book.get(0).getTitle()); + assertEquals("William Shakespeare", book.get(0).getAuthor()); + assertTrue(book.get(0).isSendByPost()); + assertEquals("Collected Stories", book.get(1).getTitle()); + assertEquals("Gabriel Garcia Marquez", book.get(1).getAuthor()); + assertTrue(book.get(1).isSendByPost()); + //System.out.println("collection: " + new String(writer.getBody())); + + // ResourceBookCollection2#m2() + writer.reset(); + handler.reset(); + response =3D launcher.service("POST", "/", "", h, null, writer, null= ); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + book =3D ObjectBuilder.createCollection(List.class, genericType, han= dler.getJsonObject()); + assertEquals("Hamlet", book.get(0).getTitle()); + assertEquals("William Shakespeare", book.get(0).getAuthor()); + assertTrue(book.get(0).isSendByPost()); + assertEquals("Collected Stories", book.get(1).getTitle()); + assertEquals("Gabriel Garcia Marquez", book.get(1).getAuthor()); + assertTrue(book.get(1).isSendByPost()); + //System.out.println("collection: " + new String(writer.getBody())); + + unregistry(r2); + } + + @SuppressWarnings({"unchecked", "serial"}) + public void testJsonReturnBeanMap() throws Exception + { + ResourceBookMap2 r2 =3D new ResourceBookMap2(); + registry(r2); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("accept", "application/json"); + ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); + + // ResourceBookMap2#m1() + ContainerResponse response =3D launcher.service("GET", "/", "", h, n= ull, writer, null); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + JsonParserImpl parser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + ParameterizedType genericType =3D (ParameterizedType)new HashMap() + { + }.getClass().getGenericSuperclass(); + //System.out.println(">>>>>" + genericType); + Map book =3D ObjectBuilder.createObject(Map.class, gen= ericType, handler.getJsonObject()); + assertEquals("Hamlet", book.get("12345").getTitle()); + assertEquals("William Shakespeare", book.get("12345").getAuthor()); + assertTrue(book.get("12345").isSendByPost()); + assertEquals("Collected Stories", book.get("54321").getTitle()); + assertEquals("Gabriel Garcia Marquez", book.get("54321").getAuthor()= ); + assertTrue(book.get("54321").isSendByPost()); + //System.out.println("map: " + new String(writer.getBody())); + + // ResourceBookMap2#m2() + writer.reset(); + handler.reset(); + response =3D launcher.service("POST", "/", "", h, null, writer, null= ); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + parser.parse(new ByteArrayInputStream(writer.getBody()), handler); + book =3D ObjectBuilder.createObject(Map.class, genericType, handler.= getJsonObject()); + assertEquals("Hamlet", book.get("12345").getTitle()); + assertEquals("William Shakespeare", book.get("12345").getAuthor()); + assertTrue(book.get("12345").isSendByPost()); + assertEquals("Collected Stories", book.get("54321").getTitle()); + assertEquals("Gabriel Garcia Marquez", book.get("54321").getAuthor()= ); + assertTrue(book.get("54321").isSendByPost()); + //System.out.println("map: " + new String(writer.getBody())); + + unregistry(r2); + } +} Property changes on: ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatfor= m/services/rest/impl/provider/JsonEntityTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native --===============0938029445778835888==-- From do-not-reply at jboss.org Wed Oct 6 03:47:53 2010 Content-Type: multipart/mixed; boundary="===============7878168683436356757==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3249 - in jcr/trunk/exo.jcr.component.ext/src: main/java/org/exoplatform/services/jcr/ext/backup/impl and 1 other directories. Date: Wed, 06 Oct 2010 03:47:53 -0400 Message-ID: <201010060747.o967lrmu027952@svn01.web.mwc.hst.phx2.redhat.com> --===============7878168683436356757== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-06 03:47:53 -0400 (Wed, 06 Oct 2010) New Revision: 3249 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/backup/ExtendedBackupManager.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/backup/impl/BackupManagerImpl.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/backup/TestBackupManager.java Log: EXOJCR-747 : Make backup restore easier implementation. Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/backup/ExtendedBackupManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/backup/ExtendedBackupManager.java 2010-10-06 06:56:19 UTC (rev 3248) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/backup/ExtendedBackupManager.java 2010-10-06 07:47:53 UTC (rev 3249) @@ -30,7 +30,7 @@ public interface ExtendedBackupManager extends BackupManager { /** - * Restore existed workspace. Previous data will be deleted. + * Restore existing workspace. Previous data will be deleted. * For getting status of workspace restore can use = * BackupManager.getLastRestore(String repositoryName, String workspace= Name) method = * = @@ -45,11 +45,11 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedWorkspace(String workspaceBackupIdentifier, String r= epositoryName, WorkspaceEntry workspaceEntry, + void restoreExistingWorkspace(String workspaceBackupIdentifier, String = repositoryName, WorkspaceEntry workspaceEntry, boolean asynchronous) throws BackupOperationException, BackupConfigu= rationException; = /** - * Restore existed workspace. Previous data will be deleted. + * Restore existing workspace. Previous data will be deleted. * For getting status of workspace restore can use = * BackupManager.getLastRestore(String repositoryName, String workspace= Name) method = * = @@ -64,10 +64,10 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedWorkspace(BackupChainLog log, String repositoryName,= WorkspaceEntry workspaceEntry, boolean asynchronous) throws BackupOperati= onException, BackupConfigurationException; + void restoreExistingWorkspace(BackupChainLog log, String repositoryName= , WorkspaceEntry workspaceEntry, boolean asynchronous) throws BackupOperat= ionException, BackupConfigurationException; = /** - * Restore existed repository. Previous data will be deleted. + * Restore existing repository. Previous data will be deleted. * For getting status of repository restore can use = * BackupManager.getLastRestore(String repositoryName) method = * = @@ -82,10 +82,10 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedRepository(String repositoryBackupIdentifier, Repos= itoryEntry repositoryEntry, boolean asynchronous) throws BackupOperationEx= ception, BackupConfigurationException; + void restoreExistingRepository(String repositoryBackupIdentifier, Repo= sitoryEntry repositoryEntry, boolean asynchronous) throws BackupOperationE= xception, BackupConfigurationException; = /** - * Restore existed repository. Previous data will be deleted. + * Restore existing repository. Previous data will be deleted. * For getting status of repository restore can use = * BackupManager.getLastRestore(String repositoryName) method = * = @@ -100,7 +100,7 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedRepository(RepositoryBackupChainLog log, RepositoryE= ntry repositoryEntry, boolean asynchronous) + void restoreExistingRepository(RepositoryBackupChainLog log, Repository= Entry repositoryEntry, boolean asynchronous) throws BackupOperationException, BackupConfigurationException; = } Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/backup/impl/BackupManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/backup/impl/BackupManagerImpl.java 2010-10-06 06:56:19 UTC (rev 324= 8) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/backup/impl/BackupManagerImpl.java 2010-10-06 07:47:53 UTC (rev 324= 9) @@ -1610,7 +1610,7 @@ /** * {@inheritDoc} */ - public void restoreExistedRepository(RepositoryBackupChainLog rblog, Re= positoryEntry repositoryEntry, + public void restoreExistingRepository(RepositoryBackupChainLog rblog, R= epositoryEntry repositoryEntry, boolean asynchronous) throws BackupOperationException, BackupC= onfigurationException { try @@ -1682,7 +1682,7 @@ /** * {@inheritDoc} */ - public void restoreExistedRepository(String repositoryBackupIdentifier,= RepositoryEntry repositoryEntry, + public void restoreExistingRepository(String repositoryBackupIdentifier= , RepositoryEntry repositoryEntry, boolean asynchronous) throws BackupOperationException, BackupC= onfigurationException { RepositoryBackupChainLog backupChainLog =3D null; @@ -1701,13 +1701,13 @@ throw new BackupConfigurationException("Can not founf backup of r= epository with id \"" + repositoryBackupIdentifier + "\""); } = - this.restoreExistedRepository(backupChainLog, repositoryEntry, async= hronous); + this.restoreExistingRepository(backupChainLog, repositoryEntry, asyn= chronous); } = /** * {@inheritDoc} */ - public void restoreExistedWorkspace(BackupChainLog log, String reposito= ryName, WorkspaceEntry workspaceEntry, + public void restoreExistingWorkspace(BackupChainLog log, String reposit= oryName, WorkspaceEntry workspaceEntry, boolean asynchronous) throws BackupOperationException, BackupC= onfigurationException { try = @@ -1748,7 +1748,7 @@ /** * {@inheritDoc} */ - public void restoreExistedWorkspace(String workspaceBackupIdentifier, S= tring repositoryName, + public void restoreExistingWorkspace(String workspaceBackupIdentifier, = String repositoryName, WorkspaceEntry workspaceEntry, boolean asynchronous) throws Ba= ckupOperationException, BackupConfigurationException { @@ -1768,7 +1768,7 @@ throw new BackupConfigurationException("Can not founf backup of w= orkspace with id \"" + workspaceBackupIdentifier + "\""); } = - this.restoreExistedWorkspace(backupChainLog, repositoryName, workspa= ceEntry, asynchronous); + this.restoreExistingWorkspace(backupChainLog, repositoryName, worksp= aceEntry, asynchronous); } = } Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/backup/TestBackupManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/backup/TestBackupManager.java 2010-10-06 06:56:19 UTC (rev 3248) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/backup/TestBackupManager.java 2010-10-06 07:47:53 UTC (rev 3249) @@ -1279,7 +1279,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedWorkspace(bchLog, re.getName(), ws1, false); + backup.restoreExistingWorkspace(bchLog, re.getName(), ws1, false); = // check SessionImpl back1 =3D null; @@ -1356,7 +1356,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedWorkspace(bchLog, re.getName(), ws1, true); + backup.restoreExistingWorkspace(bchLog, re.getName(), ws1, true); = while (backup.getLastRestore(repository.getName(), ws1.getName())= .getStateRestore() !=3D JobWorkspaceRestore.RESTORE_SUCCESSFUL && backup.getLastRestore(repository.getName(), ws1.getName()).= getStateRestore() !=3D JobWorkspaceRestore.RESTORE_FAIL) @@ -1439,7 +1439,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedWorkspace(bchLog.getBackupId(), re.getName()= , ws1, true); + backup.restoreExistingWorkspace(bchLog.getBackupId(), re.getName(= ), ws1, true); = while (backup.getLastRestore(repository.getName(), ws1.getName())= .getStateRestore() !=3D JobWorkspaceRestore.RESTORE_SUCCESSFUL && backup.getLastRestore(repository.getName(), ws1.getName()).= getStateRestore() !=3D JobWorkspaceRestore.RESTORE_FAIL) @@ -1511,7 +1511,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedRepository(bchLog, re, false); + backup.restoreExistingRepository(bchLog, re, false); = assertEquals(JobWorkspaceRestore.RESTORE_SUCCESSFUL, backup.getLa= stRepositoryRestore(re.getName()) .getStateRestore()); @@ -1599,7 +1599,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedRepository(bchLog, re, false); + backup.restoreExistingRepository(bchLog, re, false); = assertEquals(JobWorkspaceRestore.RESTORE_SUCCESSFUL, backup.getLa= stRepositoryRestore(re.getName()) .getStateRestore()); @@ -1673,7 +1673,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedRepository(bchLog, re, true); + backup.restoreExistingRepository(bchLog, re, true); = JobRepositoryRestore job =3D backup.getLastRepositoryRestore(re.g= etName()); = @@ -1755,7 +1755,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedRepository(bchLog.getBackupId(), re, true); + backup.restoreExistingRepository(bchLog.getBackupId(), re, true); = JobRepositoryRestore job =3D backup.getLastRepositoryRestore(re.g= etName()); = @@ -1857,7 +1857,7 @@ assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = - backup.restoreExistedWorkspace(bchLog, re.getName(), ws1, false); + backup.restoreExistingWorkspace(bchLog, re.getName(), ws1, false); = // check SessionImpl back1 =3D null; --===============7878168683436356757==-- From do-not-reply at jboss.org Wed Oct 6 03:48:31 2010 Content-Type: multipart/mixed; boundary="===============2361097509389551717==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3250 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Wed, 06 Oct 2010 03:48:31 -0400 Message-ID: <201010060748.o967mVWS027965@svn01.web.mwc.hst.phx2.redhat.com> --===============2361097509389551717== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-06 03:48:31 -0400 (Wed, 06 Oct 2010) New Revision: 3250 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/exojcr-backup-service.xml Log: EXOJCR-747 : Make backup restore easier documentation. Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/exojcr-backup-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-10-06 07:47:53 UTC (rev = 3249) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-10-06 07:48:31 UTC (rev = 3250) @@ -483,17 +483,12 @@
    Restore existing workspace or repository = - - Restoring of existing workspace or repository available from J= CR - 1.14.0-CR1. - + The resore of existing workspace or repositry is avaleble. = - The resore of existed workspace or repositry is avaleble. - For restore will be used spacial methods: = /** - * Restore existed workspace. Previous data will be deleted. + * Restore existing workspace. Previous data will be deleted. * For getting status of workspace restore can use = * BackupManager.getLastRestore(String repositoryName, String workspace= Name) method = * = @@ -508,11 +503,11 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedWorkspace(String workspaceBackupIdentifier, String r= epositoryName, WorkspaceEntry workspaceEntry, + void restoreExistingWorkspace(String workspaceBackupIdentifier, String = repositoryName, WorkspaceEntry workspaceEntry, boolean asynchronous) throws BackupOperationException, BackupConfigu= rationException; = /** - * Restore existed workspace. Previous data will be deleted. + * Restore existing workspace. Previous data will be deleted. * For getting status of workspace restore use can use = * BackupManager.getLastRestore(String repositoryName, String workspace= Name) method = * = @@ -527,10 +522,10 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedWorkspace(BackupChainLog log, String repositoryName,= WorkspaceEntry workspaceEntry, boolean asynchronous) throws BackupOperati= onException, BackupConfigurationException; + void restoreExistingWorkspace(BackupChainLog log, String repositoryName= , WorkspaceEntry workspaceEntry, boolean asynchronous) throws BackupOperat= ionException, BackupConfigurationException; = /** - * Restore existed repository. Previous data will be deleted. + * Restore existing repository. Previous data will be deleted. * For getting status of repository restore can use = * BackupManager.getLastRestore(String repositoryName) method = * = @@ -545,10 +540,10 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedRepository(String repositoryBackupIdentifier, Repos= itoryEntry repositoryEntry, boolean asynchronous) throws BackupOperationEx= ception, BackupConfigurationException; + void restoreExistingRepository(String repositoryBackupIdentifier, Repo= sitoryEntry repositoryEntry, boolean asynchronous) throws BackupOperationE= xception, BackupConfigurationException; = /** - * Restore existed repository. Previous data will be deleted. + * Restore existing repository. Previous data will be deleted. * For getting status of repository restore can use = * BackupManager.getLastRestore(String repositoryName) method = * = @@ -563,7 +558,7 @@ * @throws BackupConfigurationException * if configuration exception occurred */ - void restoreExistedRepository(RepositoryBackupChainLog log, RepositoryE= ntry repositoryEntry, boolean asynchronous) + void restoreExistingRepository(RepositoryBackupChainLog log, Repository= Entry repositoryEntry, boolean asynchronous) throws BackupOperationException, BackupConfigurationException; = These methods for restore will do: --===============2361097509389551717==-- From do-not-reply at jboss.org Wed Oct 6 05:31:30 2010 Content-Type: multipart/mixed; boundary="===============4544228671371904538==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3251 - in ws/trunk: exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider and 1 other directories. Date: Wed, 06 Oct 2010 05:31:30 -0400 Message-ID: <201010060931.o969VUvd012189@svn01.web.mwc.hst.phx2.redhat.com> --===============4544228671371904538== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2010-10-06 05:31:29 -0400 (Wed, 06 Oct 2010) New Revision: 3251 Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framewo= rks/json/impl/JsonGeneratorImpl.java ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/im= pl/provider/JsonEntityProvider.java ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/im= pl/provider/JsonEntityTest.java Log: EXOJCR-992 Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/= frameworks/json/impl/JsonGeneratorImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonGeneratorImpl.java 2010-10-06 07:48:31 UTC (rev 3250) +++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/framew= orks/json/impl/JsonGeneratorImpl.java 2010-10-06 09:31:29 UTC (rev 3251) @@ -29,6 +29,7 @@ import org.exoplatform.ws.frameworks.json.value.impl.ObjectValue; import org.exoplatform.ws.frameworks.json.value.impl.StringValue; = +import java.io.StringReader; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; @@ -114,6 +115,22 @@ } = /** + * Create JSON object from specified string imply it is JSON object in = String + * format. + * + * @param s source string + * @return JSON representation of map + * @throws JsonException if map can't be transformed in JSON representa= tion + */ + public JsonValue createJsonObjectFromString(String s) throws JsonExcept= ion + { + JsonParserImpl parser =3D new JsonParserImpl(); + JsonDefaultHandler handler =3D new JsonDefaultHandler(); + parser.parse(new StringReader(s), handler); + return handler.getJsonObject(); + } + + /** * Create JSON object from specified object. Object must be conform wit= h java * bean structure. * Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/= rest/impl/provider/JsonEntityProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/provider/JsonEntityProvider.java 2010-10-06 07:48:31 UTC (rev 3250) +++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityProvider.java 2010-10-06 09:31:29 UTC (rev 3251) @@ -29,19 +29,27 @@ import org.exoplatform.ws.frameworks.json.impl.JsonUtils.Types; import org.exoplatform.ws.frameworks.json.value.JsonValue; = +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.Reader; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collection; import java.util.Map; = +import javax.activation.DataSource; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.StreamingOutput; import javax.ws.rs.ext.Provider; +import javax.xml.bind.JAXBElement; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; = /** * @author Andrey Parfonov @@ -60,13 +68,30 @@ // Or probably enough check only content type 'application/json' // and if this content type set trust it and try parse/write = + /** Do not process via JSON "known" JAX-RS types. */ + private static final Class[] IGNORED =3D + new Class[]{byte[].class, DataSource.class, DOMSource.class, File= .class, InputStream.class, JAXBElement.class, + MultivaluedMap.class, Reader.class, SAXSource.class, StreamingOut= put.class, StreamSource.class, String.class}; + + private static boolean isIgnored(Class type) + { + for (Class c : IGNORED) + { + if (c.isAssignableFrom(type)) + { + return true; + } + } + return false; + } + /** * {@inheritDoc} */ public boolean isReadable(Class type, Type genericType, Annotation[]= annotations, MediaType mediaType) { - // say as support all objects, see _TODO_ above - return Object.class.isAssignableFrom(type); + // return Object.class.isAssignableFrom(type); + return !isIgnored(type); } = /** @@ -124,8 +149,8 @@ */ public boolean isWriteable(Class type, Type genericType, Annotation[= ] annotations, MediaType mediaType) { - // say as support all objects, see _TODO_ above - return Object.class.isAssignableFrom(type); + // return Object.class.isAssignableFrom(type); + return !isIgnored(type); } = /** Modified: ws/trunk/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/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityTest.java 2010-10-06 07:48:31 UTC (rev 3250) +++ ws/trunk/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityTest.java 2010-10-06 09:31:29 UTC (rev 3251) @@ -40,7 +40,9 @@ import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; = /** * @author Andrey Parfonov @@ -111,6 +113,17 @@ } = @Path("/") + public static class ResourceString + { + @POST + @Consumes("application/json") + public void m1(String b) + { + assertEquals(jsonBook, b); + } + } + + @Path("/") public static class ResourceBook2 { @GET @@ -228,6 +241,33 @@ } } = + @Path("/") + public static class ResourceString2 + { + @GET + @Produces("application/json") + public String m1() + { + return jsonBook; + } + + @POST + public Response m2() + { + return Response.ok(jsonBook).type(MediaType.APPLICATION_JSON).bui= ld(); + } + } + + private static String jsonBook =3D "{\"title\":\"Hamlet\", \"author\":\= "William Shakespeare\", \"sendByPost\":true}"; + + private static String jsonArray =3D + "[{\"title\":\"Hamlet\", \"author\":\"William Shakespeare\", \"sendB= yPost\":true}," + + "{\"title\":\"Collected Stories\", \"author\":\"Gabriel Garcia = Marquez\", \"sendByPost\":true}]"; + + private static String jsonMap =3D + "{\"12345\":{\"title\":\"Hamlet\", \"author\":\"William Shakespeare\= ", \"sendByPost\":true}," + + "\"54321\":{\"title\":\"Collected Stories\", \"author\":\"Gabri= el Garcia Marquez\", \"sendByPost\":true}}"; + private byte[] jsonBookData; = private byte[] jsonArrayData; @@ -237,16 +277,9 @@ public void setUp() throws Exception { super.setUp(); - jsonBookData =3D - ("{\"title\":\"Hamlet\", \"author\":\"William Shakespeare\", \"se= ndByPost\":true}").getBytes("UTF-8"); - jsonArrayData =3D - ("[{\"title\":\"Hamlet\", \"author\":\"William Shakespeare\", \"s= endByPost\":true}," - + "{\"title\":\"Collected Stories\", \"author\":\"Gabriel Garc= ia Marquez\", \"sendByPost\":true}]") - .getBytes("UTF-8"); - jsonMapData =3D - ("{\"12345\":{\"title\":\"Hamlet\", \"author\":\"William Shakespe= are\", \"sendByPost\":true}," - + "\"54321\":{\"title\":\"Collected Stories\", \"author\":\"Ga= briel Garcia Marquez\", \"sendByPost\":true}}") - .getBytes("UTF-8"); + jsonBookData =3D jsonBook.getBytes("UTF-8"); + jsonArrayData =3D jsonArray.getBytes("UTF-8"); + jsonMapData =3D jsonMap.getBytes("UTF-8"); } = public void testJsonEntityBean() throws Exception @@ -299,6 +332,17 @@ unregistry(r1); } = + public void testJsonEntityString() throws Exception + { + ResourceString r1 =3D new ResourceString(); + registry(r1); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("content-type", "application/json"); + h.putSingle("content-length", "" + jsonBookData.length); + assertEquals(204, launcher.service("POST", "/", "", h, jsonBookData,= null).getStatus()); + unregistry(r1); + } + public void testJsonReturnBean() throws Exception { ResourceBook2 r2 =3D new ResourceBook2(); @@ -472,4 +516,30 @@ = unregistry(r2); } + + public void testJsonReturnString() throws Exception + { + ResourceString2 r2 =3D new ResourceString2(); + registry(r2); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("accept", "application/json"); + ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); + + // ResourceString2#m1() + ContainerResponse response =3D launcher.service("GET", "/", "", h, n= ull, writer, null); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + assertEquals(jsonBook, response.getEntity()); + //System.out.println("string: " + new String(writer.getBody())); + + // ResourceString2#m2() + writer.reset(); + response =3D launcher.service("POST", "/", "", h, null, writer, null= ); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + assertEquals(jsonBook, response.getEntity()); + //System.out.println("string: " + new String(writer.getBody())); + + unregistry(r2); + } } --===============4544228671371904538==-- From do-not-reply at jboss.org Wed Oct 6 10:10:46 2010 Content-Type: multipart/mixed; boundary="===============4700205266526843519==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3252 - in kernel/trunk/exo.kernel.component.common: src/main/java/org/exoplatform/services and 6 other directories. Date: Wed, 06 Oct 2010 10:10:45 -0400 Message-ID: <201010061410.o96EAjl0022360@svn01.web.mwc.hst.phx2.redhat.com> --===============4700205266526843519== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-06 10:10:44 -0400 (Wed, 06 Oct 2010) New Revision: 3252 Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/RPCException.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/RPCService.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/RemoteCommand.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/SingleMethodCallCommand.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/impl/ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/impl/RPCServiceImpl.java kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/rpc/ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/rpc/impl/ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/rpc/impl/TestRPCServiceImpl.java kernel/trunk/exo.kernel.component.common/src/test/resources/conf/portal/= udp.xml Modified: kernel/trunk/exo.kernel.component.common/pom.xml Log: EXOJCR-967: Implementation of the RPCService 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 2010-10-06 09:31:29 UT= C (rev 3251) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2010-10-06 14:10:44 UT= C (rev 3252) @@ -93,6 +93,10 @@ javax.transaction jta + + jgroups + jgroups + Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/rpc/RPCException.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/RPCException.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/RPCException.java 2010-10-06 14:10:44 UTC (rev 3252) @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 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.rpc; + +/** + * The root class of all the Exception related to the RPC Service + * = + * @author Nicolas Fi= lotto + * @version $Id$ + */ +public class RPCException extends Exception +{ + + /** + * The serial version UID + */ + private static final long serialVersionUID =3D -9113831373947878170L; + + public RPCException(String message, Throwable cause) + { + super(message, cause); + } + + public RPCException(String message) + { + super(message); + } +} Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/rpc/RPCService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/RPCService.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/RPCService.java 2010-10-06 14:10:44 UTC (rev 3252) @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2010 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.rpc; + +import java.io.Serializable; +import java.util.List; + +/** + * This service provides mechanism to communicate with the other cluster n= odes. This service will + * be based of JGroups as an underlying Transport. + * @author Nicolas Fi= lotto + * @version $Id$ + */ +public interface RPCService +{ + + /** + * The permission needed to access to any methods of the RPCService + */ + public static final RuntimePermission ACCESS_RPC_SERVICE_PERMISSION =3D= new RuntimePermission("accessRPCService"); + + /** + * Executes a command on all the cluster nodes. This method is equivale= nt to the other method of the + * same type but with the default timeout. The command must be register= ed first otherwise an = + * {@link RPCException} will be thrown. + * + * @param command The command to execute on each cluster node + * @param synchronous if true, sets group request mode to {@link org.jg= roups.blocks.GroupRequest#GET_ALL}, + * and if false sets it to {@link org.jgroups.blocks.GroupRequest#GET_= NONE}. + * @param args an array of {@link Serializable} objects corresponding t= o parameters of the command = + * to execute remotely + * @return a list of responses from all the members of the cluster. If = we met an exception on a given node, = + * the RPCException will be the corresponding response of this particul= ar node + * @throws RPCException in the event of problems. + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + List executeCommandOnAllNodes(RemoteCommand command, boolean sy= nchronous, Serializable... args) + throws RPCException, SecurityException; + + /** + * Executes a command synchronously on all the cluster nodes. The comma= nd must be registered first otherwise an = + * {@link RPCException} will be thrown. + * + * @param command The command to execute on each cluster node + * @param timeout a timeout after which to throw a replication exceptio= n. + * @param args an array of {@link Serializable} objects corresponding t= o parameters of the command = + * to execute remotely + * @return a list of responses from all the members of the cluster. If = we met an exception on a given node, = + * the RPCException will be the corresponding response of this particul= ar node + * @throws RPCException in the event of problems. + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + List executeCommandOnAllNodes(RemoteCommand command, long timeo= ut, Serializable... args) + throws RPCException, SecurityException; + + /** + * Executes a command on the coordinator only. This method is equivalen= t to the other method of the + * same type but with the default timeout. The command must be register= ed first otherwise an = + * {@link RPCException} will be thrown. + * + * @param command The command to execute on the coordinator node + * @param synchronous if true, sets group request mode to {@link org.jg= roups.blocks.GroupRequest#GET_ALL}, = + * and if false sets it to {@link org.jgroups.blocks.GroupRequest#GET_N= ONE}. + * @param args an array of {@link Serializable} objects corresponding t= o parameters of the command = + * to execute remotely + * @return the response of the coordinator. + * @throws RPCException in the event of problems. + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + Object executeCommandOnCoordinator(RemoteCommand command, boolean synch= ronous, Serializable... args) + throws RPCException, SecurityException; + + /** + * Executes a command synchronously on the coordinator only. The comman= d must be registered first otherwise an = + * {@link RPCException} will be thrown. + * + * @param command The command to execute on the coordinator node + * @param timeout a timeout after which to throw a replication exceptio= n. + * @param args an array of {@link Serializable} objects corresponding t= o parameters of the command = + * to execute remotely + * @return the response of the coordinator. + * @throws RPCException in the event of problems. + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + Object executeCommandOnCoordinator(RemoteCommand command, long timeout,= Serializable... args) throws RPCException, + SecurityException; + + /** + * Register a new {@link RemoteCommand} instance, it will be mapped to = its id. If a command with the + * same Id has already been registered, a warning will be printed into = the log file and the new + * command will replace the old one. + * @param command the instance of the {@link RemoteCommand} to register + * @return the command itself if it could be registered null otherwise = + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + RemoteCommand registerCommand(RemoteCommand command) throws SecurityExc= eption; + + /** + * Unregister a {@link RemoteCommand} instance, if the id is known or t= he instance itself is known + * otherwise it will be ignored + * @param command the command to unregister + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + void unregisterCommand(RemoteCommand command) throws SecurityException; +} \ No newline at end of file Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/rpc/RemoteCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/RemoteCommand.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/RemoteCommand.java 2010-10-06 14:10:44 UTC (rev 3252) @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2010 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.rpc; + +import java.io.Serializable; + +/** + * This class represents the command that can be executed on a remote ser= ver. + * A RemoteCommand needs to be ThreadSafe since it can be re-used by seve= ral + * threads in parallel. + * @author Nicolas Fi= lotto + * @version $Id$ + */ +public interface RemoteCommand +{ + /** + * This method will execute the command on the local machine. + * @param container The container from which the services needed for th= e command + * will be extracted + * @param args The parameters needed to execute the command + * @return arbitrary return value generated by performing this command + * @throws Throwable in the event of problems. + */ + Serializable execute(Serializable[] args) throws Throwable; + + /** + * Gives the id of the command + * @return the unique ID of the command + */ + String getId(); +} Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/rpc/SingleMethodCallCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/SingleMethodCallCommand.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/SingleMethodCallCommand.java 2010-10-06 14:10:44 UTC (rev 3252) @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2010 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.rpc; + +import java.io.Serializable; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.Arrays; + +/** + * This command will allow you to call one specific method with the argume= nts given by the execute method + * on a component. + * = + * @author Nicolas Fi= lotto + * @version $Id$ + */ +public class SingleMethodCallCommand implements RemoteCommand +{ + + /** + * The component on which we want to execute the method + */ + private final Object component; + + /** + * The method that we want to call + */ + private final Method method; + + /** + * The id of the command + */ + private final String id; + + /** + * = + * @param component the component on which we want to execute the method + * @param methodName the name of the method + * @param parameterTypes the parameter array + * @throws NoSuchMethodException if a matching method is not found. + * @exception SecurityException + * If a security manager, s, is present and any of = the + * following conditions is met: + * + *
      + * + *
    • invocation of = + * {@link SecurityManager#checkMemberAccess + * s.checkMemberAccess(this, Member.DECLARED)} denies + * access to the declared method + * + *
    • the caller's class loader is not the same as or an + * ancestor of the class loader for the current class and + * invocation of {@link SecurityManager#checkPackageAc= cess + * s.checkPackageAccess()} denies access to the packa= ge + * of this class + * + *
    + * @throws ClassNotFoundException If the last parameter type is an arra= y and we = + * cannot find the type of the array + */ + public SingleMethodCallCommand(Object component, String methodName, Cla= ss... parameterTypes) + throws SecurityException, NoSuchMethodException, ClassNotFoundExcept= ion + { + if (component =3D=3D null) + { + throw new IllegalArgumentException("The component cannot be null"= ); + } + if (methodName =3D=3D null || (methodName =3D methodName.trim()).len= gth() =3D=3D 0) + { + throw new IllegalArgumentException("The methodName cannot be empt= y"); + } + this.component =3D component; + this.method =3D component.getClass().getDeclaredMethod(methodName, p= arameterTypes); + if (!Modifier.isPublic(method.getModifiers())) + { + throw new IllegalArgumentException("The method '" + methodName + = "' is not public"); + } + this.id =3D getId(component, method); + } + + /** + * {@inheritDoc} + */ + public Serializable execute(Serializable[] args) throws Throwable + { + try + { + return (Serializable)method.invoke(component, (Object[])args); + } + catch (Exception e) + { + throw new Exception("Could not execute the method " + id + " with= the arguments " + Arrays.toString(args), e); + } + } + + /** + * {@inheritDoc} + */ + public String getId() + { + return id; + } + + /** + * Gives a unique Id from the component and the method + */ + private static String getId(Object component, Method method) + { + StringBuilder sb =3D new StringBuilder(); + sb.append(component.getClass().getName()); + sb.append('.'); + sb.append(method.getName()); + sb.append('('); + boolean first =3D true; + for (Class c : method.getParameterTypes()) + { + if (first) + { + first =3D false; + } + else + { + sb.append(','); + } + sb.append(c.getSimpleName()); + } + sb.append(')'); + return sb.toString(); + } +} Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/rpc/impl/RPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/impl/RPCServiceImpl.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/impl/RPCServiceImpl.java 2010-10-06 14:10:44 UTC (rev 3252) @@ -0,0 +1,788 @@ +/* + * Copyright (C) 2010 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.rpc.impl; + +import org.exoplatform.commons.utils.PropertyManager; +import org.exoplatform.container.ExoContainer; +import org.exoplatform.container.ExoContainerContext; +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 org.exoplatform.services.rpc.RPCException; +import org.exoplatform.services.rpc.RPCService; +import org.exoplatform.services.rpc.RemoteCommand; +import org.jgroups.Address; +import org.jgroups.Channel; +import org.jgroups.ChannelException; +import org.jgroups.JChannel; +import org.jgroups.MembershipListener; +import org.jgroups.Message; +import org.jgroups.View; +import org.jgroups.blocks.GroupRequest; +import org.jgroups.blocks.MessageDispatcher; +import org.jgroups.blocks.RequestHandler; +import org.jgroups.conf.ConfiguratorFactory; +import org.jgroups.conf.ProtocolStackConfigurator; +import org.jgroups.util.Rsp; +import org.jgroups.util.RspList; +import org.picocontainer.Startable; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; +import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Vector; +import java.util.concurrent.CountDownLatch; + +/** + * This class is a basic implementation of the {@link RPCService}, it is m= ainly based on the + * {@link MessageDispatcher}. This implementation is not designed to give = the best possible + * performances, it only aims to give a way to communicate with other node= s. + * = + * @author Nicolas Fi= lotto + * @version $Id$ + */ +public class RPCServiceImpl implements RPCService, Startable, RequestHandl= er, MembershipListener +{ + + /** + * Connection logger. + */ + private static final Log LOG =3D ExoLogger.getLogger("exo.kernel.compon= ent.common.RPCServiceImpl"); + + /** + * The name of the parameter for the location of the JGroups configurat= ion. + */ + public static final String PARAM_JGROUPS_CONFIG =3D "jgroups-configurat= ion"; + + /** + * The name of the parameter for the name of the cluster. + */ + public static final String PARAM_CLUSTER_NAME =3D "jgroups-cluster-name= "; + + /** + * The name of the parameter for the default timeout + */ + public static final String PARAM_DEFAULT_TIMEOUT =3D "jgroups-default-t= imeout"; + + /** + * The value of the default timeout + */ + public static final int DEFAULT_TIMEOUT =3D 0; + + /** + * The default value of the cluster name + */ + public static final String CLUSTER_NAME =3D "RPCService-Cluster"; + + /** + * The configurator used to create the JGroups Channel + */ + private final ProtocolStackConfigurator configurator; + + /** + * The name of the cluster + */ + private final String clusterName; + + /** + * The JGroups Channel used to communicate with other nodes + */ + protected Channel channel; + + /** + * The current list of all the members of the cluster + */ + protected volatile Vector
    members; + + /** + * The address of the current coordinator + */ + protected volatile Address coordinator; + + /** + * The default value of the timeout + */ + private long defaultTimeout =3D DEFAULT_TIMEOUT; + + /** + * The dispatcher used to launch the command of the cluster nodes + */ + private MessageDispatcher dispatcher; + + /** + * The signal that indicates that the service is started, it will be us= ed + * to make the application wait until the service is fully started to + * ensure that all the commands have been registered before handling + * incoming messages. + */ + private final CountDownLatch startSignal =3D new CountDownLatch(1); + + /** + * Current State of the {@link RPCServiceImpl} + */ + private volatile State state; + + /** + * All the commands that have been registered + */ + private volatile Map commands =3D + Collections.unmodifiableMap(new HashMap()); + + /** + * The public constructor + * @param ctx the {@link ExoContainerContext} from which we will extrac= t the corresponding + * {@link ExoContainer} + * @param params the list of initial parameters + * @param configManager the configuration manager used to get the confi= guration + * of JGroups + */ + public RPCServiceImpl(ExoContainerContext ctx, InitParams params, Confi= gurationManager configManager) + { + if (params =3D=3D null) + { + throw new IllegalArgumentException("The RPCServiceImpl requires s= ome parameters"); + } + URL properties =3D getProperties(params, configManager); + if (LOG.isInfoEnabled()) + { + LOG.info("The JGroups configuration used for the RPCServiceImpl w= ill be loaded from " + properties); + } + try + { + this.configurator =3D ConfiguratorFactory.getStackConfigurator(pr= operties); + } + catch (ChannelException e) + { + throw new RuntimeException("Cannot load the JGroups configuration= from " + properties, e); + } + this.clusterName =3D getClusterName(ctx, params); + if (LOG.isDebugEnabled()) + { + LOG.debug("The cluster name of the RPCServiceImpl has been set to= " + clusterName); + } + String sTimeout =3D getValueParam(params, PARAM_DEFAULT_TIMEOUT); + if (sTimeout !=3D null) + { + defaultTimeout =3D Integer.parseInt(sTimeout); + if (LOG.isDebugEnabled()) + { + LOG.debug("The default timeout of the RPCServiceImpl has been = set to " + defaultTimeout); + } + } + this.state =3D State.INITIALIZED; + } + + /** + * {@inheritDoc} + */ + public List executeCommandOnAllNodes(RemoteCommand command, boo= lean synchronous, Serializable... args) + throws RPCException + { + return executeCommandOnAllNodesMain(command, synchronous, defaultTim= eout, args); + } + + /** + * {@inheritDoc} + */ + public List executeCommandOnAllNodes(RemoteCommand command, lon= g timeout, Serializable... args) + throws RPCException + { + return executeCommandOnAllNodesMain(command, true, timeout, args); + } + + /** + * Executes a command on all the cluster nodes. This method is equivale= nt to the other method of the + * same type but with the default timeout. The command must be register= ed first otherwise an = + * {@link RPCException} will be thrown. + * + * @param command The command to execute on each cluster node + * @param synchronous if true, sets group request mode to {@link org.jg= roups.blocks.GroupRequest#GET_ALL}, + * and if false sets it to {@link org.jgroups.blocks.GroupRequest#GET_= NONE}. + * @param timeout a timeout after which to throw a replication exceptio= n. + * @param args an array of {@link Serializable} objects corresponding t= o parameters of the command = + * to execute remotely + * @return a list of responses from all the members of the cluster. If = we met an exception on a given node, = + * the RPCException will be the corresponding response of this particul= ar node + * @throws RPCException in the event of problems. + */ + protected List executeCommandOnAllNodesMain(RemoteCommand comma= nd, boolean synchronous, long timeout, + Serializable... args) throws RPCException + { + return excecuteCommand(members, command, synchronous, timeout, args); + } + + /** + * {@inheritDoc} + */ + public Object executeCommandOnCoordinator(RemoteCommand command, boolea= n synchronous, Serializable... args) + throws RPCException + { + return executeCommandOnCoordinatorMain(command, synchronous, default= Timeout, args); + } + + /** + * {@inheritDoc} + */ + public Object executeCommandOnCoordinator(RemoteCommand command, long t= imeout, Serializable... args) + throws RPCException + { + return executeCommandOnCoordinatorMain(command, true, timeout, args); + } + + /** + * Executes a command on the coordinator only. This method is equivalen= t to the other method of the + * same type but with the default timeout. The command must be register= ed first otherwise an = + * {@link RPCException} will be thrown. + * + * @param command The command to execute on the coordinator node + * @param synchronous if true, sets group request mode to {@link org.jg= roups.blocks.GroupRequest#GET_ALL}, = + * and if false sets it to {@link org.jgroups.blocks.GroupRequest#GET_N= ONE}. + * @param timeout a timeout after which to throw a replication exceptio= n. + * @param args an array of {@link Serializable} objects corresponding t= o parameters of the command = + * to execute remotely + * @return the response of the coordinator. + * @throws RPCException in the event of problems. + */ + protected Object executeCommandOnCoordinatorMain(RemoteCommand command,= boolean synchronous, long timeout, + Serializable... args) throws RPCException + { + Address coordinator =3D this.coordinator; + Vector
    v =3D new Vector
    (1); + v.add(coordinator); + List lResults =3D excecuteCommand(v, command, synchronous, t= imeout, args); + Object result =3D lResults =3D=3D null || lResults.size() =3D=3D 0 ?= null : lResults.get(0); + if (result instanceof MemberHasLeftException) + { + if (coordinator.equals(this.coordinator)) + { + throw new RPCException("The coordinator did not change, we fac= ed an unexpected situation", + (MemberHasLeftException)result); + } + else + { + // The coordinator has changed, we will automatically retry wi= th the new coordinator + return executeCommandOnCoordinator(command, synchronous, timeo= ut, args); + } + } + else if (result instanceof RPCException) + { + throw (RPCException)result; + } + return result; + } + + /** + * Execute the command on all the nodes corresponding to the list of de= stinations. + * @param dests the list of members on which the command needs to be ex= ecuted + * @param command the command to execute + * @param synchronous if true, sets group request mode to {@link org.jg= roups.blocks.GroupRequest#GET_ALL}, and if false sets = + * it to {@link org.jgroups.blocks.GroupRequest#GET_NONE}. + * @param timeout a timeout after which to throw a replication exceptio= n. + * @param args the list of parameters + * @return a list of responses from all the targeted members of the clu= ster. + * @throws RPCException in the event of problems. + */ + protected List excecuteCommand(final Vector
    dests, Rem= oteCommand command, + final boolean synchronous, final long timeout, Serializable... args)= throws RPCException + { + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); + } + if (state !=3D State.STARTED) + { + throw new RPCException( + "Cannot execute any commands if the service is not started, th= e current state of the service is " + state); + } + String commandId =3D command.getId(); + if (commands.get(commandId) !=3D command) + { + throw new RPCException("Command " + commandId + " unknown, please= register your command first"); + } + final Message msg =3D new Message(); + msg.setObject(new MessageBody(commandId, args)); + RspList rsps =3D AccessController.doPrivileged(new PrivilegedAction<= RspList>() + { + public RspList run() + { + return dispatcher.castMessage(dests, msg, synchronous ? GroupR= equest.GET_ALL : GroupRequest.GET_NONE, + timeout); + } + }); + + if (LOG.isTraceEnabled()) + LOG.trace("responses: " + rsps); + if (rsps =3D=3D null) + throw new RPCException("Could not get the responses for command "= + commandId + "."); + if (!synchronous) + return Collections.emptyList();// async case + if (LOG.isTraceEnabled()) + { + LOG.trace("(" + channel.getLocalAddress() + "): responses for com= mand " + commandId + ":\n" + rsps); + } + List retval =3D new ArrayList(rsps.size()); + for (Address dest : dests) + { + Rsp rsp =3D rsps.get(dest); + if (rsp =3D=3D null || (rsp.wasSuspected() && !rsp.wasReceived())) + { + // The corresponding member has left + retval.add(new MemberHasLeftException("No response for the mem= ber " + dest + + ", this member has probably left the cluster.")); + } + else if (!rsp.wasReceived()) + { + retval.add(new RPCException("Replication timeout for " + rsp.g= etSender() + ", rsp=3D" + rsp)); + } + else + { + Object value =3D rsp.getValue(); + if (value instanceof RPCException) + { + // if we have any application-level exceptions make sure we= throw them!! + if (LOG.isTraceEnabled()) + LOG.trace("Recieved exception'" + value + "' from " + rs= p.getSender(), (RPCException)value); + } + retval.add(value); + } + } + return retval; + } + + /** + * {@inheritDoc} + */ + public Object handle(Message msg) + { + String commandId =3D null; + try + { + // Ensure that the service is fully started before trying to exec= ute any command + startSignal.await(); + MessageBody body =3D (MessageBody)msg.getObject(); + RemoteCommand command =3D getCommand(commandId =3D body.getComman= dId()); + if (command =3D=3D null) + { + return new RPCException("Command " + commandId + " unkown, ple= ase register your command first"); + } + Object execResult =3D command.execute(body.getArgs()); + if (LOG.isTraceEnabled()) + LOG.trace("Command : " + commandId + " executed, result is: " = + execResult); + return execResult; + } + catch (Throwable x) + { + if (LOG.isTraceEnabled()) + LOG.trace("Problems invoking command.", x); + return new RPCException("Cannot execute the command " + (commandI= d =3D=3D null ? "" : commandId), x); + } + } + + /** + * {@inheritDoc} + */ + public void block() + { + } + + /** + * {@inheritDoc} + */ + public void suspect(Address suspectedMbr) + { + } + + /** + * {@inheritDoc} + */ + public void viewAccepted(View view) + { + this.members =3D view.getMembers(); + this.coordinator =3D members !=3D null && members.size() > 0 ? membe= rs.get(0) : null; + } + + /** + * {@inheritDoc} + */ + public synchronized RemoteCommand registerCommand(RemoteCommand command) + { + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); + } + if (command !=3D null) + { + String commandId =3D command.getId(); + if (commandId =3D=3D null) + { + throw new IllegalArgumentException("The command Id cannot be n= ull"); + } + Map tmpCommands =3D new HashMap(this.commands); + RemoteCommand oldCommand =3D tmpCommands.put(commandId, command); + if (oldCommand !=3D null && PropertyManager.isDevelopping()) + { + LOG.warn("A command has already been registered with the id " = + commandId + + ", this command will be replaced with the new one"); + } + this.commands =3D Collections.unmodifiableMap(tmpCommands); + return command; + } + return null; + } + + /** + * {@inheritDoc} + */ + public synchronized void unregisterCommand(RemoteCommand command) + { + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); + } + if (command !=3D null) + { + String commandId =3D command.getId(); + if (commandId =3D=3D null) + { + throw new IllegalArgumentException("The command Id cannot be n= ull"); + } + if (commands.get(commandId) !=3D command) + { + // We prevent to remove any command that has not been register= ed, thus we expect that + // the registered instance is exactly the same instance as the= one that we want to + // unregister + if (PropertyManager.isDevelopping()) + { + LOG.warn("Cannot unregister an unknown RemoteCommand, eithe= r the command id " + commandId + + " is unknown or the instance of RemoteCommand to unreg= ister is unknown"); + } + return; + } + Map tmpCommands =3D new HashMap(this.commands); + tmpCommands.remove(commandId); + this.commands =3D Collections.unmodifiableMap(tmpCommands); + } + } + + /** + * Gives the {@link RemoteCommand} corresponding to the given id + * @param commandId the command id of the command to retrieve + * @return the corresponding {@link RemoteCommand} + */ + protected RemoteCommand getCommand(String commandId) + { + return commands.get(commandId); + } + + /** + * {@inheritDoc} + */ + public void start() + { + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); + } + try + { + this.channel =3D new JChannel(configurator); + channel.setOpt(Channel.AUTO_RECONNECT, true); + this.dispatcher =3D new MessageDispatcher(channel, null, this, th= is); + doPriviledgedExceptionAction(new PrivilegedExceptionAction() + { + public Void run() throws Exception + { + channel.connect(clusterName); + return null; + } + }); + } + catch (ChannelException e) + { + throw new RuntimeException("Cannot initialize the Channel needed = for the RPCServiceImpl", e); + } + finally + { + this.state =3D State.STARTED; + startSignal.countDown(); + } + } + + /** + * {@inheritDoc} + */ + public void stop() + { + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); + } + this.state =3D State.STOPPED; + if (channel !=3D null && channel.isOpen()) + { + if (LOG.isInfoEnabled()) + LOG.info("Disconnecting and closing the Channel"); + AccessController.doPrivileged(new PrivilegedAction() + { + public Void run() + { + channel.disconnect(); + return null; + } + }); + channel.close(); + channel =3D null; + } + if (dispatcher !=3D null) + { + dispatcher.stop(); + dispatcher =3D null; + } + } + + /** + * Gives the value of the default timeout + * @return the default timeout + */ + public long getDefaultTimeout() + { + return defaultTimeout; + } + + /** + * Gives the name of the cluster + * @return the name of the cluster + */ + public String getClusterName() + { + return clusterName; + } + + /** + * Gives the value of the {@link ValueParam} corresponding to the given= key + * @param params the list of initial parameters from which we want to e= xtract the {@link ValueParam} + * @param parameterKey the name of the {@link ValueParam} that we are l= ooking for + * @return the value if it exists, null otherwise + */ + private static String getValueParam(InitParams params, String parameter= Key) + { + try + { + return params.getValueParam(parameterKey).getValue().trim(); + } + catch (NullPointerException e) + { + return null; + } + } + + /** + * Gives the {@link URL} corresponding to the location of the JGroups c= onfiguration + * @param params the initial parameters from which we extract the param= eter = + * PARAM_JGROUPS_CONFIG = + * @param configManager the configuration manager used to get the {@lin= k URL} corresponding + * to the path given in the configuration of the RPCServiceImpl + * @return The {@link URL} corresponding to the location of the JGroups= configuration, + * it will throw {@link RuntimeException} otherwise since it is a manda= tory configuration. + */ + private static URL getProperties(InitParams params, ConfigurationManage= r configManager) + { + String configPath =3D getValueParam(params, PARAM_JGROUPS_CONFIG); + if (configPath =3D=3D null) + { + throw new IllegalArgumentException("The parameter '" + PARAM_JGRO= UPS_CONFIG + + "' of RPCServiceImpl is mandatory"); + } + URL properties; + try + { + properties =3D configManager.getResource(configPath); + } + catch (Exception e) + { + throw new IllegalArgumentException("Cannot find the JGroups confi= guration at " + configPath, e); + } + if (properties =3D=3D null) + { + throw new IllegalArgumentException("Cannot find the JGroups confi= guration at " + configPath); + } + return properties; + } + + /** + * Gives the name of the cluster that will be able to support several p= ortal containers + * since the name will be post fixed with "-${container-name}" + * @param ctx the context from which we extract the name of the contain= er + * @param params the list of initial parameters from which we get the v= alue of the parameter + * PARAM_CLUSTER_NAME if it exists otherwise the value wil= l be "RPCService-Cluster" + */ + private static String getClusterName(ExoContainerContext ctx, InitParam= s params) + { + String clusterName =3D getValueParam(params, PARAM_CLUSTER_NAME); + if (clusterName =3D=3D null) + { + clusterName =3D CLUSTER_NAME; + } + return clusterName +=3D "-" + ctx.getName(); + } + + /** + * Execute a privilege action + */ + private static E doPriviledgedExceptionAction(PrivilegedExceptionAc= tion action) throws ChannelException + { + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof ChannelException) + { + throw (ChannelException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * This intern class will be used to = + */ + public static class MessageBody implements Externalizable + { + /** + * The Id of the command to execute + */ + private String commandId; + + /** + * The list of parameters; + */ + private Serializable[] args; + + public MessageBody() + { + } + + public MessageBody(String commandId, Serializable[] args) + { + this.commandId =3D commandId; + this.args =3D args; + } + + public String getCommandId() + { + return commandId; + } + + public Serializable[] getArgs() + { + return args; + } + + /** + * {@inheritDoc} + */ + public void readExternal(ObjectInput in) throws IOException, ClassNo= tFoundException + { + this.commandId =3D in.readUTF(); + int size =3D in.readInt(); + if (size =3D=3D -1) + { + this.args =3D null; + } + else + { + this.args =3D new Serializable[size]; + for (int i =3D 0; i < size; i++) + { + args[i] =3D (Serializable)in.readObject(); + } + } + } + + /** + * {@inheritDoc} + */ + public void writeExternal(ObjectOutput out) throws IOException + { + out.writeUTF(commandId); + if (args =3D=3D null) + { + out.writeInt(-1); + } + else + { + out.writeInt(args.length); + for (int i =3D 0; i < args.length; i++) + { + out.writeObject(args[i]); + } + } + } + } + + /** + * All the potential states of the {@link RPCServiceImpl} + */ + public enum State { + INITIALIZED, STARTED, STOPPED + } + + public static class MemberHasLeftException extends RPCException + { + + /** + * The serial version UID + */ + private static final long serialVersionUID =3D 3558158913564367637L; + + public MemberHasLeftException(String message) + { + super(message); + } + } +} Added: kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatfo= rm/services/rpc/impl/TestRPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-06 14:10:44 UTC (rev 3252) @@ -0,0 +1,1062 @@ +/* + * Copyright (C) 2010 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.rpc.impl; + +import org.exoplatform.container.PortalContainer; +import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.container.xml.InitParams; +import org.exoplatform.container.xml.ValueParam; +import org.exoplatform.services.rpc.RPCException; +import org.exoplatform.services.rpc.RemoteCommand; +import org.exoplatform.services.rpc.SingleMethodCallCommand; +import org.exoplatform.services.rpc.impl.RPCServiceImpl.MemberHasLeftExcep= tion; +import org.exoplatform.test.BasicTestCase; +import org.jgroups.Address; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; +import java.util.Vector; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicReference; + +/** + * This is the unit test class for the service {@link RPCServiceImpl} + * = + * @author Nicolas Fi= lotto + * @version $Id$ + * + */ +public class TestRPCServiceImpl extends BasicTestCase +{ + private PortalContainer container; + private ConfigurationManager configManager; + = + public void setUp() throws Exception + { + container =3D PortalContainer.getInstance(); + configManager =3D (ConfigurationManager)container.getComponentInstan= ceOfType(ConfigurationManager.class); + } + = + public void testParameters() + { + InitParams params =3D null; + try + { + new RPCServiceImpl(container.getContext(), params, configManager); + fail("We expect a IllegalArgumentException since the jgroups conf= ig cannot be found"); + } + catch (IllegalArgumentException e) + { + // OK + } + params =3D new InitParams(); + try + { + new RPCServiceImpl(container.getContext(), params, configManager); + fail("We expect a IllegalArgumentException since the jgroups conf= ig cannot be found"); + } + catch (IllegalArgumentException e) + { + // OK + } + ValueParam paramConf =3D new ValueParam(); + paramConf.setName(RPCServiceImpl.PARAM_JGROUPS_CONFIG); + params.addParameter(paramConf); + try + { + new RPCServiceImpl(container.getContext(), params, configManager); + fail("We expect a IllegalArgumentException since the jgroups conf= ig cannot be found"); + } + catch (IllegalArgumentException e) + { + // OK + } + paramConf.setValue("fakePath"); + try + { + new RPCServiceImpl(container.getContext(), params, configManager); + fail("We expect a IllegalArgumentException since the jgroups conf= ig cannot be found"); + } + catch (IllegalArgumentException e) + { + // OK + } + paramConf.setValue("jar:/conf/portal/udp.xml"); + RPCServiceImpl service =3D null; + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + assertEquals(RPCServiceImpl.DEFAULT_TIMEOUT, service.getDefaultTi= meout()); + assertEquals(RPCServiceImpl.CLUSTER_NAME + "-" + container.getCon= text().getName(), service.getClusterName()); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } + ValueParam paramTimeout =3D new ValueParam(); + paramTimeout.setName(RPCServiceImpl.PARAM_DEFAULT_TIMEOUT); + paramTimeout.setValue("fakeValue"); + params.addParameter(paramTimeout); + try + { + new RPCServiceImpl(container.getContext(), params, configManager); + fail("We expect a NumberFormatException since the timeout is not = properly set"); + } + catch (NumberFormatException e) + { + // OK + } + paramTimeout.setValue("60"); + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + assertEquals(60, service.getDefaultTimeout()); + assertEquals(RPCServiceImpl.CLUSTER_NAME + "-" + container.getCon= text().getName(), service.getClusterName()); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } + ValueParam paramClusterName =3D new ValueParam(); + paramClusterName.setName(RPCServiceImpl.PARAM_CLUSTER_NAME); + paramClusterName.setValue("MyName"); + params.addParameter(paramClusterName); + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + assertEquals(60, service.getDefaultTimeout()); + assertEquals(paramClusterName.getValue() + "-" + container.getCon= text().getName(), service.getClusterName()); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } + } + = + public void testStates() throws Exception + { + InitParams params =3D new InitParams(); + ValueParam paramConf =3D new ValueParam(); + paramConf.setName(RPCServiceImpl.PARAM_JGROUPS_CONFIG); + paramConf.setValue("jar:/conf/portal/udp.xml"); = + params.addParameter(paramConf); + RPCServiceImpl service =3D null; + RemoteCommand foo =3D new RemoteCommand() + { + = + public String getId() + { + return "foo"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return null; + } + }; + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + = + service.registerCommand(foo); + try + { + service.executeCommandOnAllNodes(foo, true); + fail("We expect a RPCException since the current state is not = the expected one"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnAllNodes(foo, 10); + fail("We expect a RPCException since the current state is not = the expected one"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnCoordinator(foo, true); + fail("We expect a RPCException since the current state is not = the expected one"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnCoordinator(foo, 10); + fail("We expect a RPCException since the current state is not = the expected one"); + } + catch (RPCException e) + { + // OK + } + service.start(); + service.executeCommandOnAllNodes(foo, true); + service.executeCommandOnAllNodes(foo, 10); + service.executeCommandOnCoordinator(foo, true); + service.executeCommandOnCoordinator(foo, 10); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } + try + { + service.executeCommandOnAllNodes(foo, true); + fail("We expect a RPCException since the current state is not the= expected one"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnAllNodes(foo, 10); + fail("We expect a RPCException since the current state is not the= expected one"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnCoordinator(foo, true); + fail("We expect a RPCException since the current state is not the= expected one"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnCoordinator(foo, 10); + fail("We expect a RPCException since the current state is not the= expected one"); + } + catch (RPCException e) + { + // OK + } = + } + = + public void testCommands() throws Exception + { + InitParams params =3D new InitParams(); + ValueParam paramConf =3D new ValueParam(); + paramConf.setName(RPCServiceImpl.PARAM_JGROUPS_CONFIG); + paramConf.setValue("jar:/conf/portal/udp.xml"); = + params.addParameter(paramConf); + RPCServiceImpl service =3D null; + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + RemoteCommand fake =3D new RemoteCommand() + { + = + public String getId() + { + return "fake"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return null; + } + }; + RemoteCommand fake2 =3D new RemoteCommand() + { + = + public String getId() + { + return "fake2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return null; + } + }; + RemoteCommand fake2_Unregistered =3D new RemoteCommand() + { + = + public String getId() + { + return "fake2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return null; + } + }; = + service.registerCommand(fake2); + RemoteCommand Exception =3D new RemoteCommand() + { + = + public String getId() + { + return "Exception"; + } + = + public String execute(Serializable[] args) throws Throwable + { + throw new Exception("MyException"); + } + }; + service.registerCommand(Exception); + RemoteCommand Error =3D new RemoteCommand() + { + = + public String getId() + { + return "Error"; + } + = + public String execute(Serializable[] args) throws Throwable + { + throw new Error("MyError"); + } + } ; + service.registerCommand(Error); + RemoteCommand StringValue =3D new RemoteCommand() + { + = + public String getId() + { + return "StringValue"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "OK"; + } + }; = + service.registerCommand(StringValue); + RemoteCommand NullValue =3D new RemoteCommand() + { + = + public String getId() + { + return "NullValue"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return null; + } + }; = + service.registerCommand(NullValue); + RemoteCommand LongTask =3D new RemoteCommand() + { + = + public String getId() + { + return "LongTask"; + } + = + public String execute(Serializable[] args) throws Throwable + { + Thread.sleep(2000); + return null; + } + }; = + service.registerCommand(LongTask); = + service.start(); + try + { + service.executeCommandOnAllNodes(fake, true); + fail("We expect a RPCException since the command is unknown"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnCoordinator(fake, true); + fail("We expect a RPCException since the command is unknown"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnAllNodes(fake2_Unregistered, true); + fail("We expect a RPCException since the command is unknown"); + } + catch (RPCException e) + { + // OK + } + try + { + service.executeCommandOnCoordinator(fake2_Unregistered, true); + fail("We expect a RPCException since the command is unknown"); + } + catch (RPCException e) + { + // OK + } = + List result; + result =3D service.executeCommandOnAllNodes(Exception, true); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertTrue("We expect a RPCException since one node could not exe= cute the command", result.get(0) instanceof RPCException); + try + { + service.executeCommandOnCoordinator(Exception, true); + fail("We expect a RPCException since one node could not execut= e the command"); + } + catch (RPCException e) + { + // OK + } + result =3D service.executeCommandOnAllNodes(Error, true); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertTrue("We expect a RPCException since one node could not exe= cute the command", result.get(0) instanceof RPCException); + try + { + service.executeCommandOnCoordinator(Error, true); + fail("We expect a RPCException since one node could not execut= e the command"); + } + catch (RPCException e) + { + // OK + } + result =3D service.executeCommandOnAllNodes(LongTask, true); + assertNotNull(result); + assertTrue(result.size() =3D=3D 1); + assertNull(result.get(0)); + Object o =3D service.executeCommandOnCoordinator(LongTask, true); + assertNull(o); + result =3D service.executeCommandOnAllNodes(LongTask, 1000); + assertNotNull(result); + assertTrue(result.size() =3D=3D 1); + assertTrue("We expect an RPCException due to a Replication Timeou= t", result.get(0) instanceof RPCException); + try + { + service.executeCommandOnCoordinator(LongTask, 1000); + fail("We expect an RPCException due to a Replication Timeout"); + } + catch (RPCException e) + { + // OK + } + result =3D service.executeCommandOnAllNodes(LongTask, false); + assertNotNull(result); + assertTrue(result.isEmpty()); + assertNull(service.executeCommandOnCoordinator(LongTask, false)); + = + result =3D service.executeCommandOnAllNodes(StringValue, true); + assertNotNull(result); + assertTrue(result.size() =3D=3D 1); + assertEquals("OK", result.get(0)); + o =3D service.executeCommandOnCoordinator(StringValue, true); + assertEquals("OK", o); + result =3D service.executeCommandOnAllNodes(NullValue, true); + assertNotNull(result); + assertTrue(result.size() =3D=3D 1); + assertNull(result.get(0)); + o =3D service.executeCommandOnCoordinator(NullValue, true); + assertNull(o); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } = + } + + public void testSeveralNodes() throws Exception + { + InitParams params =3D new InitParams(); + ValueParam paramConf =3D new ValueParam(); + paramConf.setName(RPCServiceImpl.PARAM_JGROUPS_CONFIG); + paramConf.setValue("jar:/conf/portal/udp.xml"); = + params.addParameter(paramConf); + RPCServiceImpl service1 =3D null, service2 =3D null; + try + { + service1 =3D new RPCServiceImpl(container.getContext(), params, c= onfigManager); + service2 =3D new RPCServiceImpl(container.getContext(), params, c= onfigManager); + RemoteCommand CmdUnknownOnNode2 =3D new RemoteCommand() + { + = + public String getId() + { + return "CmdUnknownOnNode2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "OK"; + } + }; + service1.registerCommand(CmdUnknownOnNode2); + RemoteCommand ExceptionOnNode2 =3D new RemoteCommand() + { + = + public String getId() + { + return "ExceptionOnNode2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "OK"; + } + }; = + service1.registerCommand(ExceptionOnNode2); + RemoteCommand ErrorOnNode2 =3D new RemoteCommand() + { + = + public String getId() + { + return "ErrorOnNode2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "OK"; + } + }; = + service1.registerCommand(ErrorOnNode2); + = + RemoteCommand LongTaskOnNode2 =3D new RemoteCommand() + { + = + public String getId() + { + return "LongTaskOnNode2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "OK"; + } + }; = + service1.registerCommand(LongTaskOnNode2); = + service1.registerCommand(new RemoteCommand() + { + = + public String getId() + { + return "LongTask"; + } + = + public String execute(Serializable[] args) throws Throwable + { + Thread.sleep(20000); + return "OldCoordinator"; + } + }); = + service1.registerCommand(new RemoteCommand() + { + = + public String getId() + { + return "OK"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "OK"; + } + }); = + service2.registerCommand(new RemoteCommand() + { + = + public String getId() + { + return "ExceptionOnNode2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + throw new Exception("MyException"); + } + }); + service2.registerCommand(new RemoteCommand() + { + = + public String getId() + { + return "ErrorOnNode2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + throw new Error("MyError"); + } + }); + service2.registerCommand(new RemoteCommand() + { + = + public String getId() + { + return "LongTaskOnNode2"; + } + = + public String execute(Serializable[] args) throws Throwable + { + Thread.sleep(2000); + return null; + } + }); + RemoteCommand OK =3D new RemoteCommand() + { + = + public String getId() + { + return "OK"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "OK"; + } + }; + service2.registerCommand(OK); + final RemoteCommand LongTask =3D new RemoteCommand() + { + = + public String getId() + { + return "LongTask"; + } + = + public String execute(Serializable[] args) throws Throwable + { + return "NewCoordinator"; + } + }; + service2.registerCommand(LongTask); = + service1.start(); + service2.start(); + List result; + Object o; + result =3D service1.executeCommandOnAllNodes(CmdUnknownOnNode2, t= rue); + assertTrue(result !=3D null && result.size() =3D=3D 2); + assertEquals("OK", result.get(0)); + assertTrue("We expect a RPCException since the command is unknown= on node 2", result.get(1) instanceof RPCException); + o =3D service1.executeCommandOnCoordinator(CmdUnknownOnNode2, tru= e); + assertEquals("OK", o); + + result =3D service1.executeCommandOnAllNodes(ExceptionOnNode2, tr= ue); + assertTrue(result !=3D null && result.size() =3D=3D 2); + assertEquals("OK", result.get(0)); + assertTrue("We expect a RPCException since the command fails on n= ode 2", result.get(1) instanceof RPCException); + o =3D service1.executeCommandOnCoordinator(ExceptionOnNode2, true= ); + assertEquals("OK", o); + + result =3D service1.executeCommandOnAllNodes(ErrorOnNode2, true); + assertTrue(result !=3D null && result.size() =3D=3D 2); + assertEquals("OK", result.get(0)); + assertTrue("We expect a RPCException since the command fails on n= ode 2", result.get(1) instanceof RPCException); = + o =3D service1.executeCommandOnCoordinator(ErrorOnNode2, true); + assertEquals("OK", o); + = + result =3D service1.executeCommandOnAllNodes(LongTaskOnNode2, 100= 0); + assertNotNull(result); + assertTrue(result.size() =3D=3D 2); + assertEquals("OK", result.get(0)); + assertTrue("We expect an RPCException due to a Replication Timeou= t", result.get(1) instanceof RPCException); + o =3D service1.executeCommandOnCoordinator(LongTaskOnNode2, 1000); + assertEquals("OK", o); + = + Vector
    allMembers =3D service1.members; + Vector
    coordinatorOnly =3D new Vector
    (1); + coordinatorOnly.add(service1.coordinator); + = + final RPCServiceImpl service =3D service2; + final AtomicReference error =3D new AtomicReference(); + final CountDownLatch doneSignal =3D new CountDownLatch(1); + Thread t =3D new Thread() + { + @Override + public void run() + { + try + { + Object o =3D service.executeCommandOnCoordinator(LongTas= k, true); + assertEquals("NewCoordinator", o); + } + catch (Throwable e) + { + error.set(e); + } + finally + { + doneSignal.countDown(); + } + } = + }; + t.start(); + service1.stop(); + doneSignal.await(); + assertNull(error.get() !=3D null ? error.get().getMessage() : "",= error.get()); + result =3D service2.excecuteCommand(allMembers, OK, true, 0); + assertNotNull(result); + assertTrue(result.size() =3D=3D 2); + assertTrue("We expect an RPCException due to a member that has le= ft", result.get(0) instanceof MemberHasLeftException); + assertEquals("OK", result.get(1)); + result =3D service2.excecuteCommand(coordinatorOnly, OK, true, 0); + assertNotNull(result); + assertTrue(result.size() =3D=3D 1); + assertTrue("We expect an RPCException due to a member that has le= ft", result.get(0) instanceof MemberHasLeftException); + } + finally + { + if (service1 !=3D null) + { + service1.stop(); = + } + if (service2 !=3D null) + { + service2.stop(); = + } + } = + } + = + public void testSingleMethodCallCommand() throws Exception + { + try + { + new SingleMethodCallCommand(null, null); + fail("we expect an IllegalArgumentException"); + } + catch (IllegalArgumentException e) + { + // OK + } + MyService myService =3D new MyService(); + try + { + new SingleMethodCallCommand(myService, null); + fail("we expect an IllegalArgumentException"); + } + catch (IllegalArgumentException e) + { + // OK + } + try + { + new SingleMethodCallCommand(myService, "foo"); + fail("we expect an NoSuchMethodException"); + } + catch (NoSuchMethodException e) + { + // OK + } + try + { + new SingleMethodCallCommand(myService, "getPrivateName"); + fail("we expect an IllegalArgumentException since only the public= methods are allowed"); + } + catch (IllegalArgumentException e) + { + // OK + } + InitParams params =3D new InitParams(); + ValueParam paramConf =3D new ValueParam(); + paramConf.setName(RPCServiceImpl.PARAM_JGROUPS_CONFIG); + paramConf.setValue("jar:/conf/portal/udp.xml"); = + params.addParameter(paramConf); + RPCServiceImpl service =3D null; + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + RemoteCommand getName =3D service.registerCommand(new SingleMetho= dCallCommand(myService, "getName")); + RemoteCommand add =3D service.registerCommand(new SingleMethodCal= lCommand(myService, "add", int.class)); + RemoteCommand evaluate1 =3D service.registerCommand(new SingleMet= hodCallCommand(myService, "evaluate", int[].class)); + RemoteCommand evaluate2 =3D service.registerCommand(new SingleMet= hodCallCommand(myService, "evaluate", List.class)); + RemoteCommand total1 =3D service.registerCommand(new SingleMethod= CallCommand(myService, "total", int.class)); + RemoteCommand total2 =3D service.registerCommand(new SingleMethod= CallCommand(myService, "total", int.class, int.class)); + RemoteCommand total3 =3D service.registerCommand(new SingleMethod= CallCommand(myService, "total", int[].class)); + RemoteCommand total4 =3D service.registerCommand(new SingleMethod= CallCommand(myService, "total", String.class, long.class, int[].class)); + RemoteCommand testTypes1 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", String[].class)); + RemoteCommand testTypes2 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", int[].class)); + RemoteCommand testTypes3 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", long[].class)); + RemoteCommand testTypes4 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", byte[].class)); + RemoteCommand testTypes5 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", short[].class)); + RemoteCommand testTypes6 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", char[].class)); + RemoteCommand testTypes7 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", double[].class)); + RemoteCommand testTypes8 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", float[].class)); + RemoteCommand testTypes9 =3D service.registerCommand(new SingleMe= thodCallCommand(myService, "testTypes", boolean[].class)); + + service.start(); + List result; + = + assertEquals("name", service.executeCommandOnCoordinator(getName,= true)); + result =3D service.executeCommandOnAllNodes(getName, true); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals("name", result.get(0)); + = + assertEquals(10, service.executeCommandOnCoordinator(add, true, 1= 0)); + result =3D service.executeCommandOnAllNodes(add, true, 10); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(20, result.get(0)); + = + assertEquals(100, service.executeCommandOnCoordinator(evaluate1, = true, new int[]{10, 10, 10, 30, 40})); + result =3D service.executeCommandOnAllNodes(evaluate1, true, new = int[]{10, 10, 10, 30, 40}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(100, result.get(0)); + = + List values =3D new ArrayList(); + values.add(10); + values.add(10); + values.add(10); + values.add(30); + values.add(40); + assertEquals(100, service.executeCommandOnCoordinator(evaluate2, = true, (Serializable)values)); + result =3D service.executeCommandOnAllNodes(evaluate2, true, (Ser= ializable)values); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(100, result.get(0)); + = + assertEquals(10, service.executeCommandOnCoordinator(total1, true= , 10)); + result =3D service.executeCommandOnAllNodes(total1, true, 10); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(10, result.get(0)); + = + assertEquals(20, service.executeCommandOnCoordinator(total2, true= , 10, 10)); + result =3D service.executeCommandOnAllNodes(total2, true, 10, 10); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(20, result.get(0)); + = + assertEquals(100, service.executeCommandOnCoordinator(total3, tru= e, new int[]{10, 10, 10, 30, 40})); + result =3D service.executeCommandOnAllNodes(total3, true, new int= []{10, 10, 10, 30, 40}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(100, result.get(0)); + = + assertEquals(100, service.executeCommandOnCoordinator(total4, tru= e, "foo", 50, new int[]{10, 10, 10, 30, 40})); + result =3D service.executeCommandOnAllNodes(total4, true, "foo", = 50, new int[]{10, 10, 10, 30, 40}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(100, result.get(0)); + = + assertEquals(0, service.executeCommandOnCoordinator(total4, true,= "foo", 50, null)); + result =3D service.executeCommandOnAllNodes(total4, true, "foo", = 50, null); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(0, result.get(0)); + = + try + { + service.executeCommandOnCoordinator(total4, true, "foo", 50); + fail("We expect a RPCException since the list of arguments mis= match with what is expected"); + } + catch (RPCException e) + { + // OK + } = + result =3D service.executeCommandOnAllNodes(total4, true, "foo", = 50); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertTrue("We expect a RPCException since the list of arguments = mismatch with what is expected", result.get(0) instanceof RPCException); + = + assertEquals("foo", service.executeCommandOnCoordinator(testTypes= 1, true, (Serializable)new String[]{"foo"})); + result =3D service.executeCommandOnAllNodes(testTypes1, true, (Se= rializable)new String[]{"foo"}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals("foo", result.get(0)); + = + assertEquals(10, service.executeCommandOnCoordinator(testTypes2, = true, new int[]{10})); + result =3D service.executeCommandOnAllNodes(testTypes2, true, new= int[]{10}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(10, result.get(0)); + = + assertEquals(11L, service.executeCommandOnCoordinator(testTypes3,= true, new long[]{10})); + result =3D service.executeCommandOnAllNodes(testTypes3, true, new= long[]{10}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(11L, result.get(0)); + = + assertEquals((byte)12, service.executeCommandOnCoordinator(testTy= pes4, true, new byte[]{10})); + result =3D service.executeCommandOnAllNodes(testTypes4, true, new= byte[]{10}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals((byte)12, result.get(0)); + = + assertEquals((short)13, service.executeCommandOnCoordinator(testT= ypes5, true, new short[]{10})); + result =3D service.executeCommandOnAllNodes(testTypes5, true, new= short[]{10}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals((short)13, result.get(0)); + = + assertEquals('a', service.executeCommandOnCoordinator(testTypes6,= true, new char[]{'a'})); + result =3D service.executeCommandOnAllNodes(testTypes6, true, new= char[]{'a'}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals('a', result.get(0)); + = + assertEquals(10.5, service.executeCommandOnCoordinator(testTypes7= , true, new double[]{10})); + result =3D service.executeCommandOnAllNodes(testTypes7, true, new= double[]{10}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(10.5, result.get(0)); + = + assertEquals((float)11.5, service.executeCommandOnCoordinator(tes= tTypes8, true, new float[]{10})); + result =3D service.executeCommandOnAllNodes(testTypes8, true, new= float[]{10}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals((float)11.5, result.get(0)); + = + assertEquals(true, service.executeCommandOnCoordinator(testTypes9= , true, new boolean[]{true})); + result =3D service.executeCommandOnAllNodes(testTypes9, true, new= boolean[]{true}); + assertTrue(result !=3D null && result.size() =3D=3D 1); + assertEquals(true, result.get(0)); + = + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } = + } + = + public static class MyService + { + private int value =3D 0; + = + public int add(int i) + { + return value +=3D i; + } + = + @SuppressWarnings("unused") + private String getPrivateName() + { + return "name"; + } + = + public String getName() + { + return "name"; + } + = + public int total(int i) + { + return i; + } + = + public int total(int i1, int i2) + { + return i1 + i2; + } + = + public int total(int... values) + { + int total =3D 0; + for (int i : values) + { + total +=3D i; + } + return total; + } + = + public int total(String s, long l, int... values) + { + int total =3D 0; + if (values !=3D null) + { + for (int i : values) + { + total +=3D i; + } = + } + return total; + } + = + public int evaluate(int[] values) + { + int total =3D 0; + for (int i : values) + { + total +=3D i; + } + return total; = + } + = + public int evaluate(List values) + { + int total =3D 0; + for (int i : values) + { + total +=3D i; + } + return total; = + } + = + public String testTypes(String... values) + { + return values[0]; + } + = + public boolean testTypes(boolean... values) + { + return values[0]; + } + = + public char testTypes(char... values) + { + return values[0]; + } + = + public double testTypes(double... values) + { + return values[0] + 0.5; + } + = + public float testTypes(float... values) + { + return (float)(values[0] + 1.5); + } + = + public int testTypes(int... values) + { + return values[0]; + } + = + public long testTypes(long... values) + { + return values[0] + 1; + } + = + public byte testTypes(byte... values) + { + return (byte)(values[0] + 2); + } + = + public short testTypes(short... values) + { + return (short)(values[0] + 3); + } + } +} Added: kernel/trunk/exo.kernel.component.common/src/test/resources/conf/por= tal/udp.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/conf/portal= /udp.xml (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/test/resources/conf/portal= /udp.xml 2010-10-06 14:10:44 UTC (rev 3252) @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + --===============4700205266526843519==-- From do-not-reply at jboss.org Wed Oct 6 11:35:09 2010 Content-Type: multipart/mixed; boundary="===============8035668917933780445==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3253 - kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/services/rpc/impl. Date: Wed, 06 Oct 2010 11:35:09 -0400 Message-ID: <201010061535.o96FZ9Np031804@svn01.web.mwc.hst.phx2.redhat.com> --===============8035668917933780445== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-06 11:35:09 -0400 (Wed, 06 Oct 2010) New Revision: 3253 Modified: kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/rpc/impl/TestRPCServiceImpl.java Log: EXOJCR-967: Extends the timeout to prevent issue with TestRPCServiceImpl.te= stSeveralNodes Modified: kernel/trunk/exo.kernel.component.common/src/test/java/org/exopla= tform/services/rpc/impl/TestRPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-06 14:10:44 UTC (rev 3252) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-06 15:35:09 UTC (rev 3253) @@ -581,7 +581,7 @@ = public String execute(Serializable[] args) throws Throwable { - Thread.sleep(20000); + Thread.sleep(30000); return "OldCoordinator"; } }); = --===============8035668917933780445==-- From do-not-reply at jboss.org Wed Oct 6 13:09:15 2010 Content-Type: multipart/mixed; boundary="===============1352316116598990192==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3254 - in jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules: kernel and 1 other directory. Date: Wed, 06 Oct 2010 13:09:15 -0400 Message-ID: <201010061709.o96H9FgC015632@svn01.web.mwc.hst.phx2.redhat.com> --===============1352316116598990192== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-06 13:09:15 -0400 (Wed, 06 Oct 2010) New Revision: 3254 Added: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/rpc-service.xml Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel.xml Log: EXOJCR-967: The doc Added: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en= -US/modules/kernel/rpc-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml (rev 0) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml 2010-10-06 17:09:15 UTC (rev 3254) @@ -0,0 +1,211 @@ + + + + + + RPC Service + +
    + Description + + The RPCService is only needed in a cluser + environment, it is used to communicate with the other cluster nodes. It + allows to execute a command on all the cluster nodes or on the coordin= ator + i.e. the oldest node in the cluster. The RPCService + has been designed to rely on JGroups capabilites and should not be used + for heavy load. It can be used for example to notify other nodes that + something happened or to collect some information from the other + nodes. + + The RPCService relies on 2 main interfaces + which are the org.exoplatform.services.rpc.RPCService + that defines the service itslef and the + org.exoplatform.services.rpc.RemoteCommand that + defines the command that we can execute on other nodes. The arguments = that + will be given to the RemoteCommand must be + Serializable and its return type also in order to + prevent any issue due to the serialization. To prevent to execute any + RemoteCommand that could be malicious and to allo= w to + use non Serializable command, you need to register + the command first before using it. Since the service will keep only one + instance of RemoteCommand per command Id, the + implementation of the RemoteCommand must be thread + safe. + + To be usable, all the RemoteCommands must be + registered before being used on all the cluster nodes, which means that + the command registration must be done in the constructor of your compo= nent + in other words before that the RPCService is star= ted. + If you try to launch a command that has been registered but the + RPCService is not yet launched, you will get an + RPCException due to an illegal state. This has for + consequences that you will be able to execute a command only once your + component will be started. + + See an example below: + + public class MyService implements Startable +{ + private RPCService rpcService; + private RemoteCommand sayHelloCommand; + = + public MyService(RPCService rpcService) + { + this.rpcService =3D rpcService; + // Register the command before that the RPCService is started + sayHelloCommand =3D rpcService.registerCommand(new RemoteCommand() + { + public Serializable execute(Serializable[] args) throws Throwable + { + System.out.println("Hello !"); + return null; + } + + public String getId() + { + return "hello-world-command"; + } + }); + } + + public void start() + { + // Since the RPCService is a dependency of RPCService, it will be st= arted before + // so I can execute my command + try + { + // This will make all the nodes say "Hello !" + rpcService.executeCommandOnAllNodes(sayHelloCommand, false); + } + catch (SecurityException e) + { + e.printStackTrace(); + } + catch (RPCException e) + { + e.printStackTrace(); + } + } + + public void stop() + { + } +} + + In the previous example, We register the command + sayHelloCommand in the constructor of + MyService and we execute this command in the start + method. + + + We expect to have one RPCService instance= per + PortalContainer in a portal mode and only one + RPCService instance in a standalone mode + +
    + +
    + Configuration + + The configuration of the RPCService should = be + added only in a cluster environment. See below an example of + configuration + + <configuration> +.... = + <component> + <key>org.exoplatform.services.rpc.RPCService</key> + <type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type&= gt; + <init-params> + <value-param> + <name>jgroups-configuration</name> + <value>classpath:/udp.xml</value> + </value-param> + <value-param> + <name>jgroups-cluster-name</name> + <value>RPCService-Cluster</value> + </value-param> + <value-param> + <name>jgroups-default-timeout</name> + <value>0</value> + </value-param> + </init-params> + </component> = +... +</configuration> + + + Fields description + + + + + jgroups-configuration + + This is the location of the configuration of jgroups. T= his + parameter is mandatory. + + + + jgroups-cluster-name + + This is the name of the cluster. This parameter is opti= onal + and its default value is RPCService-Cluster. + Since we could have several instances of the + RPCService, the final name will be + "${jgroups-cluster-name}-${container-name}" + + + + jgroups-default-timeout + + This is the default timeout to use if the timeout is not + given, if no response could be get after this timeout an excep= tion + will be thrown. This parameter is optional and its default val= ue + is 0 which means that we don't use any timeout by default. + + + +
    +
    + +
    + The SingleMethodCallCommand + + Most of the time we only need to call a method on a given object, + this can be done thanks to the + org.exoplatform.services.rpc.SingleMethodCallCommand + which is the implementation of a RemoteCommand + proposed by default. This command will dynamically execute a method on= a + given object. + + // Register the command first +RemoteCommand commandGetName =3D rpcService.registerCommand(new SingleMeth= odCallCommand(myService, "getName")); +// Execute the command on the coordinator +String name =3D rpcService.executeCommandOnCoordinator(commandGetName, tru= e); +// Print the name +System.out.println("Name : " + name); + + This example: + + + + Register a SingleMethodCallCommand that + will call getName() on the Object + myService anytime the command will be + executed. + + + + Execute the command synchronously on the coordinator, assumi= ng + that the same command (with the same id) has already been register= ed + on the coordinator + + + + Print the name got from the coordinator + + +
    +
    Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel.xml 2010-10-06 15:35:09 UTC (rev 3253) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel.xml 2010-10-06 17:09:15 UTC (rev 3254) @@ -56,5 +56,8 @@ = + + = --===============1352316116598990192==-- From do-not-reply at jboss.org Thu Oct 7 02:54:55 2010 Content-Type: multipart/mixed; boundary="===============3526576404433336495==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3255 - ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider. Date: Thu, 07 Oct 2010 02:54:55 -0400 Message-ID: <201010070654.o976stRj000697@svn01.web.mwc.hst.phx2.redhat.com> --===============3526576404433336495== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2010-10-07 02:54:54 -0400 (Thu, 07 Oct 2010) New Revision: 3255 Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/im= pl/provider/JsonEntityProvider.java Log: EXOJCR-992 : exclude some more types Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/= rest/impl/provider/JsonEntityProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/provider/JsonEntityProvider.java 2010-10-06 17:09:15 UTC (rev 3254) +++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/i= mpl/provider/JsonEntityProvider.java 2010-10-07 06:54:54 UTC (rev 3255) @@ -34,6 +34,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.Reader; +import java.io.Writer; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collection; @@ -68,10 +69,11 @@ // Or probably enough check only content type 'application/json' // and if this content type set trust it and try parse/write = - /** Do not process via JSON "known" JAX-RS types. */ + /** Do not process via JSON "known" JAX-RS types and some more. */ private static final Class[] IGNORED =3D - new Class[]{byte[].class, DataSource.class, DOMSource.class, File= .class, InputStream.class, JAXBElement.class, - MultivaluedMap.class, Reader.class, SAXSource.class, StreamingOut= put.class, StreamSource.class, String.class}; + new Class[]{byte[].class, char[].class, DataSource.class, DOMSour= ce.class, File.class, InputStream.class, + OutputStream.class, JAXBElement.class, MultivaluedMap.class, Read= er.class, Writer.class, SAXSource.class, + StreamingOutput.class, StreamSource.class, String.class}; = private static boolean isIgnored(Class type) { --===============3526576404433336495==-- From do-not-reply at jboss.org Thu Oct 7 03:25:24 2010 Content-Type: multipart/mixed; boundary="===============2152708465595376496==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3256 - in kernel/trunk/exo.kernel.component.common: src/main/java/org/exoplatform/services/naming and 2 other directories. Date: Thu, 07 Oct 2010 03:25:24 -0400 Message-ID: <201010070725.o977POF7008214@svn01.web.mwc.hst.phx2.redhat.com> --===============2152708465595376496== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-07 03:25:24 -0400 (Thu, 07 Oct 2010) New Revision: 3256 Modified: kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextBinder.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextInitializer.java kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/naming/InitialContextTest.java kernel/trunk/exo.kernel.component.common/src/test/resources/conf/portal/= test-configuration.xml Log: EXOJCR-977: support different files for different InitialContextBinder inst= ances 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 2010-10-07 06:54:54 UT= C (rev 3255) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2010-10-07 07:25:24 UT= C (rev 3256) @@ -105,7 +105,6 @@ maven-surefire-plugin - **/InitialContextTest.java **/TransactionTest.java Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/naming/InitialContextBinder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/naming/InitialContextBinder.java 2010-10-07 06:54:54 UTC (rev 3255) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextBinder.java 2010-10-07 07:25:24 UTC (rev 3256) @@ -25,8 +25,8 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import java.util.Map.Entry; import java.util.Stack; -import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; = import javax.naming.NameAlreadyBoundException; @@ -91,20 +91,16 @@ * initial context initializer * @param initParams * initialization parameters - * @throws XMLStreamException = * @throws FileNotFoundException = - * @throws FileNotFoundException * @throws XMLStreamException - * @throws NamingException = * @throws NamingException */ - InitialContextBinder(InitialContextInitializer initialContextInitialize= r) throws FileNotFoundException, - XMLStreamException, NamingException + InitialContextBinder(InitialContextInitializer initialContextInitialize= r, String bindingsStorePath) + throws FileNotFoundException, XMLStreamException, NamingException { this.initialContextInitializer =3D initialContextInitializer; - this.bindings =3D new ConcurrentHashMap(); - this.bindingsStorePath =3D System.getProperty("java.io.tmpdir") + Fi= le.separator + "bind-references.xml"; + this.bindingsStorePath =3D bindingsStorePath; = if (new File(bindingsStorePath).exists()) { @@ -117,6 +113,15 @@ } = /** + * InitialContextBinder constructor. + */ + InitialContextBinder(InitialContextInitializer initialContextInitialize= r) throws FileNotFoundException, + XMLStreamException, NamingException + { + this(initialContextInitializer, InitialContextInitializer.DEFAULT_BI= NDING_STORE_PATH); + } + + /** * Constructs references from params, binds in initial contexts and per= sists list of all binded * references into file. * = Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/naming/InitialContextInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/naming/InitialContextInitializer.java 2010-10-07 06:54:54 UTC (rev= 3255) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextInitializer.java 2010-10-07 07:25:24 UTC (rev= 3256) @@ -23,9 +23,11 @@ import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.PropertiesParam; import org.exoplatform.container.xml.Property; +import org.exoplatform.container.xml.ValueParam; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = +import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Collection; @@ -55,6 +57,11 @@ = final public static String PROPERTIES_MANDATORY =3D "mandatory-properti= es"; = + final public static String BINDINGS_STORE_PATH =3D "bindings-store-path= "; + + final public static String DEFAULT_BINDING_STORE_PATH =3D System.getPro= perty("java.io.tmpdir") + File.separator + + "bind-references.xml"; + private static Log LOG =3D ExoLogger.getLogger("exo.kernel.component.co= mmon.InitialContextInitializer"); = private List bindReferencesPlugins; @@ -107,8 +114,18 @@ initialContext =3D new InitialContext(); bindReferencesPlugins =3D new ArrayList(); = + ValueParam bindingStorePathParam =3D params.getValueParam(BINDINGS_S= TORE_PATH); + // binder - binder =3D new InitialContextBinder(this); + if (bindingStorePathParam =3D=3D null) + { + binder =3D new InitialContextBinder(this, DEFAULT_BINDING_STORE_P= ATH); + } + else + { + binder =3D new InitialContextBinder(this, bindingStorePathParam.g= etValue()); + } + } = private void setSystemProperty(String propName, String propValue, Strin= g propParamName) @@ -133,7 +150,7 @@ initialContext.rebind(name, reference); = // binder - binder =3D new InitialContextBinder(this); + binder =3D new InitialContextBinder(this, DEFAULT_BINDING_STORE_PATH= ); } = /** Modified: kernel/trunk/exo.kernel.component.common/src/test/java/org/exopla= tform/services/naming/InitialContextTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/= services/naming/InitialContextTest.java 2010-10-07 06:54:54 UTC (rev 3255) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/naming/InitialContextTest.java 2010-10-07 07:25:24 UTC (rev 3256) @@ -18,18 +18,24 @@ */ package org.exoplatform.services.naming; = -import junit.framework.TestCase; - -import org.exoplatform.container.StandaloneContainer; - +import java.io.File; +import java.io.FileNotFoundException; import java.util.Enumeration; +import java.util.HashMap; import java.util.List; +import java.util.Map; = import javax.naming.CompositeName; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.Name; +import javax.naming.NamingException; +import javax.xml.stream.XMLStreamException; = +import junit.framework.TestCase; + +import org.exoplatform.container.PortalContainer; + /** * Created by The eXo Platform SAS .
    Prerequisites: default-context-f= actory * =3D org.exoplatform.services.naming.impl.SimpleContextFactory @@ -42,14 +48,14 @@ = private static String TEST_CONTEXT_FACTORY =3D "org.exoplatform.service= s.naming.SimpleContextFactory"; = - private StandaloneContainer container; + private PortalContainer container; = public void setUp() throws Exception { = - StandaloneContainer.setConfigurationPath("src/test/java/conf/standal= one/test-configuration.xml"); + // StandaloneContainer.setConfigurationPath("src/test/resources= /conf/standalone/test-configuration.xml"); = - container =3D StandaloneContainer.getInstance(); + container =3D PortalContainer.getInstance(); } = public void testConfig() throws Exception @@ -98,4 +104,27 @@ } } = + /* = + * Tests if InitialContextInitializer correctly gets bindings-store-pat= h from = + * param-value and pass it to InitialContexBinder, thus provides usage = of different files + * for different instances of the class. = + */ + public void testDifferentFileUsage() throws FileNotFoundException, Nami= ngException, XMLStreamException + { + + InitialContextInitializer initializer =3D + (InitialContextInitializer)container.getComponentInstanceOfType(I= nitialContextInitializer.class); + + Map refAddr =3D new HashMap(); + refAddr.put("driverClassName", "org.hsqldb.jdbcDriver"); + refAddr.put("url", "jdbc:hsqldb:file:target/temp/data/portal"); + refAddr.put("username", "sa"); + refAddr.put("password", ""); + + initializer.bind("testjdbcjcr1", "javax.sql.DataSource", "org.apache= .commons.dbcp.BasicDataSourceFactory", null, + refAddr); + + assertTrue(new File("target/store-path.xml").exists()); + } + } Modified: kernel/trunk/exo.kernel.component.common/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.common/src/test/resources/conf/portal= /test-configuration.xml 2010-10-07 06:54:54 UTC (rev 3255) +++ kernel/trunk/exo.kernel.component.common/src/test/resources/conf/portal= /test-configuration.xml 2010-10-07 07:25:24 UTC (rev 3256) @@ -52,11 +52,6 @@ = - org.exoplatform.services.naming.InitialContextBinder - org.exoplatform.services.naming.InitialContextBinder - - - org.exoplatform.services.mail.MailService org.exoplatform.services.mail.impl.MailServiceImpl @@ -78,6 +73,84 @@ = + org.exoplatform.services.naming.InitialContextInitializer + org.exoplatform.services.naming.InitialContextInitializer + + + 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 + + + + + + + + + + tx.userTransaction + addPlugin + org.exoplatform.services.naming.BindReferencePlugin + + + bind-name + UserTransaction + + + class-name + javax.transaction.UserTransaction + + + factory + org.objectweb.jotm.UserTransactionFactory + + + + ref-addresses + ref-addresses + + + + + + + = + bindings-store-path = + target/store-path.xml = + = + + default-properties + Default initial context properties + + + + + + + + org.exoplatform.services.scheduler.JobSchedulerService org.exoplatform.services.scheduler.impl.JobSchedulerServiceImp= l --===============2152708465595376496==-- From do-not-reply at jboss.org Thu Oct 7 03:26:21 2010 Content-Type: multipart/mixed; boundary="===============6225629915573661025==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3257 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel. Date: Thu, 07 Oct 2010 03:26:21 -0400 Message-ID: <201010070726.o977QL1l008298@svn01.web.mwc.hst.phx2.redhat.com> --===============6225629915573661025== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-07 03:26:21 -0400 (Thu, 07 Oct 2010) New Revision: 3257 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/initialcontext-binder-service.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/jndi-naming.xml Log: EXOJCR-977: support different files for different InitialContextBinder inst= ances Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/initialcontext-binder-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/initialcontext-binder-service.xml 2010-10-07 07:25:24 UTC (= rev 3256) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/initialcontext-binder-service.xml 2010-10-07 07:26:21 UTC (= rev 3257) @@ -1,59 +1,47 @@ - - - - - Initial Context Binder service - - Initial Context Binder is responsible for binding references at - runtime, persisting in file and automatically rebinding after restart. J= ava - temp directory is used to persist references in bind-references.xml - file. - - - Available since Kernel 2.2.1-GA - - -
    - API - - Service provide methods for binding reference. - - public void bind(String bindName, String className, St= ring factory, String factoryLocation, Map<String, String> refAddr) th= rows NamingException, FileNotFoundException, XMLStreamExcept - - - - bindName - name of binding - - - - className - the fully-qualified name of the class of the obj= ect - to which this Reference refers - - - - factory - the name of the factory class for creating an inst= ance - of the object to which this Reference refers - - - - factoryLocation - the location of the factory class - - - - refAddr - object's properties map - - -
    - -
    - Configuration - - A configuration example - - <component> = - <key>org.exoplatform.services.naming.InitialContextBinder</key= > = - <type>org.exoplatform.services.naming.InitialContextBinder</ty= pe> = -</component> -
    -
    + + + + + + Initial Context Binder + + Initial Context Binder is responsible for binding references at + runtime, persisting in file and automatically rebinding. Java temp direc= tory + is used to persist references in bind-references.xml file by default. In + case when need to definde special file it can be done by add parameter to + InitialContextInitializer + configuration. + +
    + API + + Service provide methods for binding reference. + + public void bind(String bindName, String className, St= ring factory, String factoryLocation, Map<String, String> refAddr) th= rows NamingException, FileNotFoundException, XMLStreamExcept + + + + bindName - name of binding + + + + className - the fully-qualified name of the class of the obj= ect + to which this Reference refers + + + + factory - the name of the factory class for creating an inst= ance + of the object to which this Reference refers + + + + factoryLocation - the location of the factory class + + + + refAddr - object's properties map + + +
    +
    Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/jndi-naming.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/jndi-naming.xml 2010-10-07 07:25:24 UTC (rev 3256) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/jndi-naming.xml 2010-10-07 07:26:21 UTC (rev 3257) @@ -131,9 +131,18 @@ <description>Mandatory initial context properties</descri= ption> <property name=3D"java.naming.provider.url" value=3D"rmi://loca= lhost:9999"/> </properties-param> + <value-param>. + <name>bindings-store-path</name>. + <value>bind-references.xml</value>. + </value-param>. </init-params> </component> = + where + + binding-store-path is file pa= th + which stores binded datasources in runtime + The BindReferencePlugin component plugin configuration example (for JDBC datasource): = @@ -188,9 +197,7 @@ = InitialContextInitalizer also provides feature of references binding in runtime. References have bind in runtime will be - persisted and automatically rebinded on a next system start. Java temp - directory is used to persist references in bind-references.xml - file. + persisted and automatically rebinded on a next system start. = Service provides methods for binding reference. = --===============6225629915573661025==-- From do-not-reply at jboss.org Fri Oct 8 05:07:55 2010 Content-Type: multipart/mixed; boundary="===============3951666028888872128==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3258 - in jcr/trunk/exo.jcr.component.core: src/main/java/org/exoplatform/services/jcr/impl/xml/importing and 1 other directory. Date: Fri, 08 Oct 2010 05:07:54 -0400 Message-ID: <201010080907.o9897sY9006606@svn01.web.mwc.hst.phx2.redhat.com> --===============3951666028888872128== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-08 05:07:54 -0400 (Fri, 08 Oct 2010) New Revision: 3258 Modified: jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/xml/importing/SystemViewImporter.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/xml/importing/WorkspaceContentImporter.java Log: EXOJCR-955: NPE when try to import data via WorkspaceContentImporter 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 2010-10-07 07:26:21 UTC (rev 3= 257) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2010-10-08 09:07:54 UTC (rev 3= 258) @@ -420,7 +420,6 @@ org/exoplatform/services/jcr/**/impl/**/TestDBC= leanerService.java org/exoplatform/services/jcr/**/impl/**/TestSav= eConfiguration.java org/exoplatform/services/jcr/**/impl/**/ValueSt= oragePluginTest.java - org/exoplatform/services/jcr/**/impl/**/TestWor= kspaceRestore.java org/exoplatform/services/jcr/**/impl/**/TestSes= sionCleaner.java org/exoplatform/services/jcr/**/impl/**/Base*.j= ava org/exoplatform/services/jcr/**/impl/**/TestJCR= SerializationStream.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/xml/importing/SystemViewImporter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/importing/SystemViewImporter.java 2010-10-07 07:26:21 UTC (re= v 3257) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/importing/SystemViewImporter.java 2010-10-08 09:07:54 UTC (re= v 3258) @@ -18,6 +18,21 @@ */ package org.exoplatform.services.jcr.impl.xml.importing; = +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.jcr.NamespaceRegistry; +import javax.jcr.PathNotFoundException; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.jcr.ValueFormatException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.nodetype.NoSuchNodeTypeException; + import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.core.ExtendedPropertyType; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; @@ -47,21 +62,6 @@ import org.exoplatform.services.log.Log; import org.exoplatform.services.security.ConversationState; = -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.jcr.NamespaceRegistry; -import javax.jcr.PathNotFoundException; -import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; -import javax.jcr.ValueFormatException; -import javax.jcr.nodetype.ConstraintViolationException; -import javax.jcr.nodetype.NoSuchNodeTypeException; - /** * Created by The eXo Platform SAS. * = @@ -159,7 +159,7 @@ = ImportNodeData currentNodeInfo =3D (ImportNodeData)getParent(); = - NodePropertiesInfo currentNodePropertiesInfo =3D mapNodeProper= tiesInfo.get(currentNodeInfo.getQPath().getAsString()); + NodePropertiesInfo currentNodePropertiesInfo =3D mapNodeProper= tiesInfo.get(currentNodeInfo.getIdentifier()); = currentNodePropertiesInfo.addProperty(propertyData); } @@ -219,7 +219,7 @@ = changesLog.add(new ItemState(newNodeData, ItemState.ADDED, true, = getAncestorToSave())); = - mapNodePropertiesInfo.put(newNodeData.getQPath().getAsString(), n= ew NodePropertiesInfo(newNodeData)); = + mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new NodePr= opertiesInfo(newNodeData)); = tree.push(newNodeData); = @@ -307,7 +307,7 @@ { ImportNodeData currentNodeInfo =3D (ImportNodeData)tree.pop(); = - NodePropertiesInfo currentNodePropertiesInfo =3D mapNodePropertiesIn= fo.get(currentNodeInfo.getQPath().getAsString()); = + NodePropertiesInfo currentNodePropertiesInfo =3D mapNodePropertiesIn= fo.get(currentNodeInfo.getIdentifier()); = if (currentNodePropertiesInfo !=3D null) { @@ -571,7 +571,7 @@ = tree.push(currentNodeInfo); = - mapNodePropertiesInfo.put(currentNodeInfo.getQPath().getAsString(), = new NodePropertiesInfo(currentNodeInfo)); + mapNodePropertiesInfo.put(currentNodeInfo.getIdentifier(), new NodeP= ropertiesInfo(currentNodeInfo)); = return propertyData; } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/xml/importing/WorkspaceContentImporter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/importing/WorkspaceContentImporter.java 2010-10-07 07:26:21 U= TC (rev 3257) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/importing/WorkspaceContentImporter.java 2010-10-08 09:07:54 U= TC (rev 3258) @@ -18,6 +18,11 @@ */ package org.exoplatform.services.jcr.impl.xml.importing; = +import java.util.Map; + +import javax.jcr.NamespaceRegistry; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; @@ -35,11 +40,6 @@ import org.exoplatform.services.log.Log; import org.exoplatform.services.security.ConversationState; = -import java.util.Map; - -import javax.jcr.NamespaceRegistry; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. * = @@ -136,6 +136,8 @@ changesLog.add(new ItemState(newNodeData, ItemState.ADDED, tru= e, parentData.getQPath())); } tree.push(newNodeData); + + mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new NodePr= opertiesInfo(newNodeData)); } else { --===============3951666028888872128==-- From do-not-reply at jboss.org Fri Oct 8 05:34:36 2010 Content-Type: multipart/mixed; boundary="===============1329559245272093675==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3259 - in jcr/branches/1.12.x/exo.jcr.component.core: src/main/java/org/exoplatform/services/jcr/impl/xml/importing and 1 other directory. Date: Fri, 08 Oct 2010 05:34:36 -0400 Message-ID: <201010080934.o989Yasa007269@svn01.web.mwc.hst.phx2.redhat.com> --===============1329559245272093675== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-08 05:34:35 -0400 (Fri, 08 Oct 2010) New Revision: 3259 Modified: jcr/branches/1.12.x/exo.jcr.component.core/pom.xml jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/xml/importing/SystemViewImporter.java jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/xml/importing/WorkspaceContentImporter.java Log: EXOJCR-955: NPE when try to import data via WorkspaceContentImporter Modified: jcr/branches/1.12.x/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.x/exo.jcr.component.core/pom.xml 2010-10-08 09:07:54 = UTC (rev 3258) +++ jcr/branches/1.12.x/exo.jcr.component.core/pom.xml 2010-10-08 09:34:35 = UTC (rev 3259) @@ -409,7 +409,6 @@ org/exoplatform/services/jcr/**/impl/**/TestRep= ositoryManagement.java org/exoplatform/services/jcr/**/impl/**/TestSav= eConfiguration.java org/exoplatform/services/jcr/**/impl/**/ValueSt= oragePluginTest.java - org/exoplatform/services/jcr/**/impl/**/TestWor= kspaceRestore.java org/exoplatform/services/jcr/**/impl/**/TestSes= sionCleaner.java org/exoplatform/services/jcr/**/impl/**/Base*.j= ava org/exoplatform/services/jcr/**/impl/**/TestJCR= SerializationStream.java Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/xml/importing/SystemViewImporter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/xml/importing/SystemViewImporter.java 2010-10-08 09:07:= 54 UTC (rev 3258) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/xml/importing/SystemViewImporter.java 2010-10-08 09:34:= 35 UTC (rev 3259) @@ -18,21 +18,6 @@ */ package org.exoplatform.services.jcr.impl.xml.importing; = -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.jcr.NamespaceRegistry; -import javax.jcr.PathNotFoundException; -import javax.jcr.PropertyType; -import javax.jcr.RepositoryException; -import javax.jcr.ValueFormatException; -import javax.jcr.nodetype.ConstraintViolationException; -import javax.jcr.nodetype.NoSuchNodeTypeException; - import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.core.ExtendedPropertyType; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; @@ -62,6 +47,21 @@ import org.exoplatform.services.log.Log; import org.exoplatform.services.security.ConversationState; = +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.jcr.NamespaceRegistry; +import javax.jcr.PathNotFoundException; +import javax.jcr.PropertyType; +import javax.jcr.RepositoryException; +import javax.jcr.ValueFormatException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.nodetype.NoSuchNodeTypeException; + /** * Created by The eXo Platform SAS. * = @@ -159,7 +159,7 @@ = ImportNodeData currentNodeInfo =3D (ImportNodeData)getParent(); = - NodePropertiesInfo currentNodePropertiesInfo =3D mapNodeProper= tiesInfo.get(currentNodeInfo.getQPath().getAsString()); + NodePropertiesInfo currentNodePropertiesInfo =3D mapNodeProper= tiesInfo.get(currentNodeInfo.getIdentifier()); = currentNodePropertiesInfo.addProperty(propertyData); } = @@ -219,7 +219,7 @@ = changesLog.add(new ItemState(newNodeData, ItemState.ADDED, true, = getAncestorToSave())); = - mapNodePropertiesInfo.put(newNodeData.getQPath().getAsString(), n= ew NodePropertiesInfo(newNodeData)); = + mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new NodePr= opertiesInfo(newNodeData)); = tree.push(newNodeData); = @@ -307,14 +307,14 @@ { ImportNodeData currentNodeInfo =3D (ImportNodeData)tree.pop(); = - NodePropertiesInfo currentNodePropertiesInfo =3D mapNodePropertiesIn= fo.get(currentNodeInfo.getQPath().getAsString()); = + NodePropertiesInfo currentNodePropertiesInfo =3D mapNodePropertiesIn= fo.get(currentNodeInfo.getIdentifier()); = if (currentNodePropertiesInfo !=3D null) { checkProperties(currentNodePropertiesInfo); } = - mapNodePropertiesInfo.remove(currentNodeInfo.getQPath().getAsString(= )); + mapNodePropertiesInfo.remove(currentNodeInfo.getIdentifier()); = currentNodeInfo.setMixinTypeNames(currentNodeInfo.getMixinTypeNames(= )); = @@ -567,8 +567,8 @@ = tree.push(currentNodeInfo); = - mapNodePropertiesInfo.put(currentNodeInfo.getQPath().getAsString(), = new NodePropertiesInfo(currentNodeInfo)); - = + mapNodePropertiesInfo.put(currentNodeInfo.getIdentifier(), new NodeP= ropertiesInfo(currentNodeInfo)); + return propertyData; } = Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/xml/importing/WorkspaceContentImporter.java 2010-10-08 = 09:07:54 UTC (rev 3258) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/xml/importing/WorkspaceContentImporter.java 2010-10-08 = 09:34:35 UTC (rev 3259) @@ -18,6 +18,11 @@ */ package org.exoplatform.services.jcr.impl.xml.importing; = +import java.util.Map; + +import javax.jcr.NamespaceRegistry; +import javax.jcr.RepositoryException; + import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; @@ -35,11 +40,6 @@ import org.exoplatform.services.log.Log; import org.exoplatform.services.security.ConversationState; = -import java.util.Map; - -import javax.jcr.NamespaceRegistry; -import javax.jcr.RepositoryException; - /** * Created by The eXo Platform SAS. * = @@ -136,6 +136,8 @@ changesLog.add(new ItemState(newNodeData, ItemState.ADDED, tru= e, parentData.getQPath())); } tree.push(newNodeData); + + mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new NodePr= opertiesInfo(newNodeData)); } else { --===============1329559245272093675==-- From do-not-reply at jboss.org Fri Oct 8 06:07:12 2010 Content-Type: multipart/mixed; boundary="===============2342362881045390929==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3260 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing. Date: Fri, 08 Oct 2010 06:07:12 -0400 Message-ID: <201010081007.o98A7CBq014693@svn01.web.mwc.hst.phx2.redhat.com> --===============2342362881045390929== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-08 06:07:12 -0400 (Fri, 08 Oct 2010) New Revision: 3260 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/xml/importing/SystemViewImporter.java Log: EXOJCR-955: NPE when try to import data via WorkspaceContentImporter Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/xml/importing/SystemViewImporter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/importing/SystemViewImporter.java 2010-10-08 09:34:35 UTC (re= v 3259) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/importing/SystemViewImporter.java 2010-10-08 10:07:12 UTC (re= v 3260) @@ -314,7 +314,7 @@ checkProperties(currentNodePropertiesInfo); } = - mapNodePropertiesInfo.remove(currentNodeInfo.getQPath().getAsString(= )); + mapNodePropertiesInfo.remove(currentNodeInfo.getIdentifier()); = currentNodeInfo.setMixinTypeNames(currentNodeInfo.getMixinTypeNames(= )); = --===============2342362881045390929==-- From do-not-reply at jboss.org Fri Oct 8 07:45:06 2010 Content-Type: multipart/mixed; boundary="===============2887051186280654110==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3261 - kernel/branches/2.2.x/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils. Date: Fri, 08 Oct 2010 07:45:06 -0400 Message-ID: <201010081145.o98Bj6Vj025491@svn01.web.mwc.hst.phx2.redhat.com> --===============2887051186280654110== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-08 07:45:06 -0400 (Fri, 08 Oct 2010) New Revision: 3261 Modified: kernel/branches/2.2.x/exo.kernel.commons/src/main/java/org/exoplatform/c= ommons/utils/MapResourceBundle.java kernel/branches/2.2.x/exo.kernel.commons/src/main/java/org/exoplatform/c= ommons/utils/QName.java Log: JCR-1473:merge performance improvements Modified: kernel/branches/2.2.x/exo.kernel.commons/src/main/java/org/exopla= tform/commons/utils/MapResourceBundle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.commons/src/main/java/org/exoplatform/= commons/utils/MapResourceBundle.java 2010-10-08 10:07:12 UTC (rev 3260) +++ kernel/branches/2.2.x/exo.kernel.commons/src/main/java/org/exoplatform/= commons/utils/MapResourceBundle.java 2010-10-08 11:45:06 UTC (rev 3261) @@ -25,8 +25,6 @@ import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; -import java.util.Set; -import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; = @@ -36,41 +34,43 @@ public class MapResourceBundle extends ResourceBundle implements Serializa= ble { = - private final static String REGEXP =3D "#\\{.*\\}"; + private final static Pattern PATTERN =3D Pattern.compile("#\\{.*\\}"); = - private Map props =3D new HashMap(); + private Map props; = private Locale locale; = public MapResourceBundle(Locale l) { this.locale =3D l; + this.props =3D new HashMap(); } = public MapResourceBundle(ResourceBundle rB, Locale l) { + Map props =3D new HashMap(); + doMerge(props, rB); + + // this.locale =3D l; - initMap(rB); + this.props =3D props; } = - private void initMap(ResourceBundle rB) + private static void doMerge(Map props, ResourceBundle r= B) { - Enumeration e =3D rB.getKeys(); + Enumeration e =3D rB.getKeys(); while (e.hasMoreElements()) { - String s =3D (String)e.nextElement(); - try + String key =3D e.nextElement(); + if (props.get(key) =3D=3D null) { - if (props.get(s) =3D=3D null) + Object o =3D rB.getObject(key); + if (o instanceof String) { - String[] newArray =3D rB.getStringArray(s); - props.put(s, newArray); + String value =3D (String)o; + props.put(key.intern(), value.intern()); } } - catch (ClassCastException ex) - { - props.put(s, rB.getObject(s)); - } } } = @@ -79,9 +79,20 @@ return props.get(key); } = - public Enumeration getKeys() + public Enumeration getKeys() { - return new Vector(props.keySet()).elements(); + final Iterator i =3D props.keySet().iterator(); + return new Enumeration() + { + public boolean hasMoreElements() + { + return i.hasNext(); + } + public String nextElement() + { + return i.next(); + } + }; } = public Locale getLocale() @@ -89,69 +100,63 @@ return this.locale; } = - public void add(String key, Object value) + public void add(String key, Object o) { - props.put(key, value); + if (key !=3D null && o instanceof String) + { + String value =3D (String)o; + props.put(key.intern(), value.intern()); + } } = public void remove(String key) { - props.remove(key); + if (key !=3D null) + { + props.remove(key); + } } = public void merge(ResourceBundle bundle) { - Enumeration e =3D bundle.getKeys(); - while (e.hasMoreElements()) - { - String s =3D (String)e.nextElement(); - Object value =3D bundle.getObject(s); - try - { - String[] newArray =3D bundle.getStringArray(s); - if (props.get(s) =3D=3D null) - { - props.put(s, newArray); - } - } - catch (ClassCastException ex) - { - props.put(s, value); - } - } + doMerge(props, bundle); } = public void resolveDependencies() { - Map tempMap =3D new HashMap(); - Set keys =3D props.keySet(); - Pattern pattern =3D Pattern.compile(REGEXP); - for (Iterator iter =3D keys.iterator(); iter.hasNext();) + Map tempMap =3D new HashMap(); + for (String element : props.keySet()) { - String element =3D (String)iter.next(); - String value =3D lookupKey(element, pattern); - tempMap.put(element, value); + String value =3D lookupKey(element); + if (value !=3D null) + { + tempMap.put(element.intern(), value.intern()); + } } props =3D tempMap; } = - private String lookupKey(String key, Pattern pattern) + private String lookupKey(String key) { - String s =3D (String)props.get(key); + String s =3D props.get(key); if (s =3D=3D null) + { return key; - Matcher matcher =3D pattern.matcher(s); + } + + // + Matcher matcher =3D PATTERN.matcher(s); if (matcher.find()) { - return recursivedResolving(s, pattern); + return recursivedResolving(s); } return s; } = - private String recursivedResolving(String key, Pattern pattern) + private String recursivedResolving(String key) { String resolved =3D key; - StringBuffer sB =3D new StringBuffer(); + StringBuilder sB =3D new StringBuilder(); while (resolved.indexOf("#{") !=3D -1) { sB.setLength(0); @@ -159,7 +164,7 @@ int lastIndex =3D resolved.indexOf('}', firstIndex); String realKey =3D resolved.substring(firstIndex + 2, lastIndex); sB.append(resolved.substring(0, firstIndex)); - sB.append(lookupKey(realKey, pattern)); + sB.append(lookupKey(realKey)); sB.append(resolved.substring(lastIndex + 1)); resolved =3D sB.toString(); } Modified: kernel/branches/2.2.x/exo.kernel.commons/src/main/java/org/exopla= tform/commons/utils/QName.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.commons/src/main/java/org/exoplatform/= commons/utils/QName.java 2010-10-08 10:07:12 UTC (rev 3260) +++ kernel/branches/2.2.x/exo.kernel.commons/src/main/java/org/exoplatform/= commons/utils/QName.java 2010-10-08 11:45:06 UTC (rev 3261) @@ -37,14 +37,23 @@ protected final int hashCode; = public QName(String namespace, String name) - { - this.namespace =3D (namespace !=3D null ? namespace : "").intern(); - this.name =3D (name !=3D null ? name : ""); - - this.stringName =3D ("[" + this.namespace + "]" + this.name); - - int hk =3D 31 + this.namespace.hashCode(); - this.hashCode =3D hk * 31 + this.name.hashCode(); + { = + if (namespace =3D=3D null) = + { + namespace =3D ""; + } + if (name =3D=3D null) + { + name =3D ""; + } = + String stringName =3D ("[" + namespace + "]" + name); + int hashCode =3D (31 + namespace.hashCode()) * 31 + name.hashCode(); + = + // = + this.namespace =3D namespace; + this.name =3D name; + this.stringName =3D stringName; + this.hashCode =3D hashCode; } = public String getNamespace() --===============2887051186280654110==-- From do-not-reply at jboss.org Fri Oct 8 08:04:25 2010 Content-Type: multipart/mixed; boundary="===============9037778074661195710==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3262 - in jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core and 1 other directory. Date: Fri, 08 Oct 2010 08:04:25 -0400 Message-ID: <201010081204.o98C4Pfc031968@svn01.web.mwc.hst.phx2.redhat.com> --===============9037778074661195710== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-08 08:04:24 -0400 (Fri, 08 Oct 2010) New Revision: 3262 Added: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/core/JCRPathExt.java Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/datamodel/InternalQName.java jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/datamodel/QPathEntry.java jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/core/JCRName.java jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/core/JCRPath.java jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/core/LocationFactory.java Log: JCR-1473: merge performance improvements Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/datamodel/InternalQName.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/datamodel/InternalQName.java 2010-10-08 11:45:06 UTC (rev 32= 61) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/datamodel/InternalQName.java 2010-10-08 12:04:24 UTC (rev 32= 62) @@ -32,7 +32,7 @@ = /** * InternalQName constructor. - * = + * * @param namespace * - namespace URI * @param name @@ -79,9 +79,18 @@ if (o =3D=3D null) return false; = - if (!(o instanceof InternalQName)) - return false; + if (o instanceof InternalQName) + { + InternalQName that =3D (InternalQName)o; + if (hashCode =3D=3D that.hashCode) + { + String s1 =3D getAsString(); + String s2 =3D that.getAsString(); + return s1.equals(s2); + } + } = - return hashCode =3D=3D o.hashCode() && getAsString().equals(((QName)= o).getAsString()); + return false; + } } Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/datamodel/QPathEntry.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/datamodel/QPathEntry.java 2010-10-08 11:45:06 UTC (rev 3261) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/datamodel/QPathEntry.java 2010-10-08 12:04:24 UTC (rev 3262) @@ -32,6 +32,10 @@ */ private final int index; = + private String cachedToString; + + private String cachedToStringShowIndex; + /** * QPathEntry constructor. * = @@ -128,7 +132,44 @@ */ public String getAsString(boolean showIndex) { - return super.getAsString() + (showIndex ? QPath.PREFIX_DELIMITER + t= his.index : ""); + if (showIndex) + { + if (cachedToStringShowIndex !=3D null) + { + return cachedToStringShowIndex; + } + } + else + { + if (cachedToString !=3D null) + { + return cachedToString; + } + } + + // + String res; + if (showIndex) + { + res =3D super.getAsString() + QPath.PREFIX_DELIMITER + this.index; + } + else + { + res =3D super.getAsString(); + } + + // + if (showIndex) + { + cachedToStringShowIndex =3D res; + } + else + { + cachedToString =3D res; + } + + // + return res; } = /** Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/core/JCRName.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/JCRName.java 2010-10-08 11:45:06 UTC (rev 3261) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/JCRName.java 2010-10-08 12:04:24 UTC (rev 3262) @@ -40,17 +40,43 @@ = protected final int hashCode; = + protected JCRName(InternalQName qname, String prefix) + { + this(qname.getNamespace(), qname.getName(), prefix); + } + + JCRName(JCRPath.PathElement that) + { + this.prefix =3D that.prefix; + this.name =3D that.name; + this.namespace =3D that.namespace; + this.stringName =3D that.stringName; + this.hashCode =3D that.hashCode; + } + JCRName(String namespace, String name, String prefix) { - this.name =3D name.intern(); - this.namespace =3D namespace.intern(); - this.prefix =3D prefix.intern(); + int hk =3D 31 + namespace.hashCode(); + hk =3D hk * 31 + name.hashCode(); + int hashCode =3D hk * 31 + prefix.hashCode(); = - this.stringName =3D ((this.prefix.length() =3D=3D 0 ? "" : this.pref= ix + ":") + this.name); + // + String stringName; + if (prefix.length() =3D=3D 0) + { + stringName =3D name; + } + else + { + stringName =3D prefix + ":" + name; + } = - int hk =3D 31 + this.namespace.hashCode(); - hk =3D hk * 31 + this.name.hashCode(); - this.hashCode =3D hk * 31 + this.prefix.hashCode(); + // + this.name =3D name; + this.namespace =3D namespace; + this.prefix =3D prefix; + this.stringName =3D stringName; + this.hashCode =3D hashCode; } = /** Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/core/JCRPath.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/JCRPath.java 2010-10-08 11:45:06 UTC (rev 3261) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/JCRPath.java 2010-10-08 12:04:24 UTC (rev 3262) @@ -18,16 +18,15 @@ */ package org.exoplatform.services.jcr.impl.core; = +import org.exoplatform.services.jcr.core.NamespaceAccessor; +import org.exoplatform.services.jcr.datamodel.InternalQName; 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.log.ExoLogger; import org.exoplatform.services.log.Log; = -import java.util.ArrayList; +import javax.jcr.RepositoryException; = -import javax.jcr.PathNotFoundException; - /** * Created by The eXo Platform SAS. * = @@ -35,7 +34,7 @@ * @version $Id: JCRPath.java 11907 2008-03-13 15:36:21Z ksm $ */ = -public class JCRPath +public abstract class JCRPath { = public final static String ROOT_PATH =3D "/"; @@ -48,250 +47,117 @@ = protected static Log log =3D ExoLogger.getLogger("exo.jcr.component.cor= e.JCRPath"); = - protected PathElement[] names; - - JCRPath() + public static JCRPath createJCRPath() { - this.names =3D new PathElement[0]; + return JCRPathExt.ROOT; } = - public boolean isAbsolute() + public static JCRPath createJCRPath(NamespaceAccessor namespaces, QPath= qpath) throws RepositoryException { - if (names.length > 0) - { - PathElement first =3D names[0]; - if (first.getName().equals(ROOT_NAME)) - { - return true; - } - } - return false; + return new JCRPathExt(namespaces, qpath.getEntries()); } = - JCRPath addEntry(String namespace, String name, String prefix, int inde= x) + public static JCRPath createJCRPath(NamespaceAccessor namespaces, QPath= Entry[] relPath) throws RepositoryException { - if (name.equals(THIS_RELPATH)) - return this; - - if (name.equals(PARENT_RELPATH)) - { - return addEntry(new MoveUpElement()); - } - - return addEntry(new PathElement(namespace, name, prefix, index)); + return new JCRPathExt(namespaces, relPath); } = - JCRPath addEntry(PathElement entry) - { - if (names.length > 0 && entry instanceof MoveUpElement && !(names[na= mes.length - 1] instanceof MoveUpElement)) - { - return removeLastEntry(); - } + public abstract boolean isAbsolute(); = - PathElement[] newNames =3D new PathElement[names.length + 1]; - for (int i =3D 0; i < names.length; i++) - newNames[i] =3D names[i]; - newNames[names.length] =3D entry; - names =3D newNames; - return this; - } + abstract JCRPath addEntry(String namespace, String name, String prefix,= int index); = - JCRPath removeLastEntry() - { + abstract JCRPath addEntry(PathElement entry); = - if (names.length <=3D 0) - { - log.warn("Wrong relative path. Can't move up in path hierarhy. " = + getAsString(true)); - return this; - } + abstract JCRPath add(JCRPath path); = - PathElement[] newNames =3D new PathElement[names.length - 1]; - for (int i =3D 0; i < newNames.length; i++) - newNames[i] =3D names[i]; - names =3D newNames; - return this; - } + abstract JCRPath addEntries(PathElement... entries); = - public JCRPath makeParentPath() - { - return makeAncestorPath(1); - } + public abstract JCRPath makeParentPath(); = - /** - * Makes ancestor path by relative degree (For ex relativeDegree =3D=3D= 1 means parent path etc) - * = - * @param relativeDegree - * @return - * @throws PathNotFoundException - */ - public JCRPath makeAncestorPath(int relativeDegree) - { + public abstract JCRPath makeAncestorPath(int relativeDegree); = - JCRPath path =3D new JCRPath(); - for (int i =3D 0; i < names.length - relativeDegree; i++) - path.addEntry(names[i]); - return path; - } + public abstract PathElement[] getRelPath(int relativeDegree); = - public PathElement[] getRelPath(int relativeDegree) - { - ArrayList entries =3D new ArrayList(); - for (int i =3D names.length - relativeDegree; i < names.length; i++) - entries.add(names[i]); - PathElement[] relPath =3D new PathElement[entries.size()]; - for (int i =3D 0; i < relPath.length; i++) - relPath[i] =3D entries.get(i); - return relPath; - } + public abstract QPath getInternalPath(); = - public QPath getInternalPath() - { + public abstract String getAsString(boolean showIndex); = - QPathEntry[] entries =3D new QPathEntry[names.length]; + public abstract int getDepth(); = - for (int i =3D 0; i < names.length; i++) - entries[i] =3D new QPathEntry(names[i].getNamespace(), names[i].g= etName(), names[i].getIndex()); + public abstract int getLength(); = - QPath qpath =3D new QPath(entries); - return qpath; - } + public abstract PathElement getEntry(int index); = - public String getAsString(boolean showIndex) - { + public abstract PathElement[] getEntries(); = - // [PN] 27.06.07 - String path =3D ""; - if (isAbsolute()) - { - if (size() =3D=3D 1) - return "/"; + public abstract boolean isDescendantOf(JCRPath ancestorLocation, boolea= n childOnly); = - for (int i =3D 1; i < names.length; i++) - { - path +=3D "/" + names[i].getAsString(showIndex); - } - } - else - { - // relative - for (int i =3D 0; i < names.length; i++) - { - path +=3D i > 0 ? "/" + names[i].getAsString(showIndex) : name= s[i].getAsString(showIndex); - } - } + public abstract boolean isAncestorOf(JCRPath descendantLocation, boolea= n childOnly); = - return path; - } + public abstract PathElement getName(); = - public int getDepth() - { - return size() - 1; - } + public abstract int getIndex(); = - public boolean isDescendantOf(JCRPath ancestorLocation, boolean childOn= ly) - { - int depthDiff =3D getDepth() - ancestorLocation.getDepth(); - if (depthDiff <=3D 0 || (childOnly && depthDiff !=3D 1)) - return false; + public abstract boolean isIndexSetExplicitly(); = - JCRPath.PathElement[] anotherNames =3D ancestorLocation.getEntries(); - for (int i =3D 0; i < anotherNames.length; i++) - { - boolean result =3D anotherNames[i].equals(names[i]); - if (!result) - return false; - } - return true; - } + public abstract boolean isSameNameSibling(JCRPath anotherPath); = - public boolean isAncestorOf(JCRPath descendantLocation, boolean childOn= ly) - { - return descendantLocation.isDescendantOf(this, childOnly); - } + public abstract boolean equals(Object obj); = - private int size() + protected JCRPath() { - return names.length; } = - public JCRName getName() + public static class PathElement extends JCRName { - if (size() > 0) - return names[size() - 1]; = - return new ThisElement(); - } + private final int index; = - public int getIndex() - { - return names[size() - 1].getIndex(); - } + private final boolean indexSetExplicitly; = - public boolean isIndexSetExplicitly() - { - return names[size() - 1].isIndexSetExplicitly(); - } + private String cachedToString; = - public boolean isSameNameSibling(JCRPath anotherPath) - { - JCRName[] anotherNames =3D anotherPath.getEntries(); - for (int i =3D 0; i < anotherNames.length - 1; i++) - { - boolean result =3D anotherNames[i].equals(names[i]); - if (!result) - return false; - } - return getName().getName().equals(anotherPath.getName().getName()) - && this.getName().getPrefix().equals(anotherPath.getName().getPre= fix()); - } + private String cachedToStringShowIndex; = - public boolean equals(Object obj) - { - if (this =3D=3D obj) + public PathElement(String namespace, String name, String prefix, int= index) { - return true; - } - if (obj instanceof JCRPath) - { - JCRPath other =3D (JCRPath)obj; - return this.getInternalPath().equals(other.getInternalPath()); - } - return false; - } + super(namespace, name, prefix); = - PathElement[] getEntries() - { - return names; - } - - public class ThisElement extends PathElement - { - - ThisElement() - { - super(Constants.NS_DEFAULT_URI, THIS_RELPATH, Constants.NS_EMPTY_= PREFIX, -1); + // + if (index =3D=3D -1) + { + this.index =3D 1; + this.indexSetExplicitly =3D false; + } + else + { + this.index =3D index; + this.indexSetExplicitly =3D true; + } } - } = - public class MoveUpElement extends PathElement - { - - MoveUpElement() + public PathElement(InternalQName qname, String prefix, int index) { - super(Constants.NS_DEFAULT_URI, PARENT_RELPATH, Constants.NS_EMPT= Y_PREFIX, -1); + super(qname, prefix); + + // + if (index =3D=3D -1) + { + this.index =3D 1; + this.indexSetExplicitly =3D false; + } + else + { + this.index =3D index; + this.indexSetExplicitly =3D true; + } } - } = - public class PathElement extends JCRName - { - - private final int index; - - private final boolean indexSetExplicitly; - - public PathElement(String namespace, String name, String prefix, int= index) + public PathElement(PathElement that, int index) { - super(namespace, name, prefix); + super(that); + + // if (index =3D=3D -1) { this.index =3D 1; @@ -306,7 +172,7 @@ = public PathElement clone(int newIndex) { - return new PathElement(this.namespace, this.name, this.prefix, ne= wIndex); + return new PathElement(this, newIndex); } = public int getIndex() @@ -324,12 +190,38 @@ = public String getAsString(boolean showIndex) { - String indexStr; + if (showIndex) + { + if (cachedToStringShowIndex !=3D null) + { + return cachedToStringShowIndex; + } + } + else + { + if (cachedToString !=3D null) + { + return cachedToString; + } + } + + StringBuffer sb =3D new StringBuffer(super.getAsString()); if (showIndex || getIndex() > 1) - indexStr =3D "[" + getIndex() + "]"; + sb.append("[").append(index).append("]"); + String res =3D sb.toString(); + + // + if (showIndex) + { + cachedToStringShowIndex =3D res; + } else - indexStr =3D ""; - return (super.getAsString() + indexStr); + { + cachedToString =3D res; + } + + // + return res; } = public boolean isIndexSetExplicitly() @@ -337,5 +229,4 @@ return indexSetExplicitly; } } - } Added: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplat= form/services/jcr/impl/core/JCRPathExt.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/JCRPathExt.java (rev 0) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/JCRPathExt.java 2010-10-08 12:04:24 UTC (rev 3262) @@ -0,0 +1,394 @@ +/* + * 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 org.exoplatform.services.jcr.core.NamespaceAccessor; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; +import org.exoplatform.services.jcr.impl.Constants; + +import javax.jcr.RepositoryException; + +/** + * Created by The eXo Platform SAS. + * + * @author Gennady Azarenk= ov + * @version $Id: JCRPath.java 11907 2008-03-13 15:36:21Z ksm $ + */ + +public class JCRPathExt extends JCRPath +{ + + private static PathElement[] EMPTY_PATH =3D new PathElement[0]; + + private static final PathElement THIS_ELEMENT =3D new PathElement(Const= ants.NS_DEFAULT_URI, THIS_RELPATH, Constants.NS_EMPTY_PREFIX, -1); + + private static final PathElement MOVE_UP_ELEMENT =3D new PathElement(Co= nstants.NS_DEFAULT_URI, PARENT_RELPATH, Constants.NS_EMPTY_PREFIX, -1); + + protected final PathElement[] names; + + protected final int size; + + protected String cachedToString; + + protected String cachedToStringShowIndex; + + protected QPath cachedInternalQPath; + + public final static JCRPathExt ROOT =3D new JCRPathExt(); + + private JCRPathExt() + { + this(EMPTY_PATH); + } + + JCRPathExt(NamespaceAccessor namespaces, QPathEntry[] path) throws Repo= sitoryException + { + PathElement[] names =3D new PathElement[path.length]; + int size =3D 0; + for (QPathEntry entry : path) + { + String prefix =3D namespaces.getNamespacePrefixByURI(entry.getNam= espace()); + PathElement element =3D element(entry.getNamespace(), entry.getNa= me(), prefix, entry.getIndex()); + size =3D addEntry(names, size, element); + } + + // + this.names =3D names; + this.size =3D size; + } + + JCRPathExt(JCRPathExt that, PathElement[] addedEntries, int addedSize) + { + PathElement[] names =3D new PathElement[that.size + addedSize]; + int size =3D 0; + for (int i =3D 0;i < that.size;i++) + { + size =3D addEntry(names, size, that.names[i]); + } + for (int i =3D 0;i < addedSize;i++) + { + size =3D addEntry(names, size, addedEntries[i]); + } + + // + this.names =3D names; + this.size =3D size; + } + + JCRPathExt(PathElement[] names) + { + this(names, names.length); + } + + JCRPathExt(PathElement[] names, int size) + { + if (size < 0) + { + throw new AssertionError("Size value is negative: " + size); + } + if (size > names.length) + { + throw new AssertionError("Size value is too large: " + size + " i= nstead of max: " + names.length); + } + + // + this.names =3D names; + this.size =3D size; + } + + public boolean isAbsolute() + { + if (size > 0) + { + PathElement first =3D names[0]; + if (first.getName().equals(ROOT_NAME)) + { + return true; + } + } + return false; + } + + @Override + JCRPath add(JCRPath path) + { + return new JCRPathExt(this, ((JCRPathExt)path).names, ((JCRPathExt)p= ath).size); + } + + @Override + JCRPath addEntries(PathElement... entries) + { + return new JCRPathExt(this, entries, entries.length); + } + + JCRPathExt addEntry(String namespace, String name, String prefix, int i= ndex) + { + return addEntry(element(namespace, name, prefix, index)); + } + + public JCRPathExt makeAncestorPath(int relativeDegree) + { + return new JCRPathExt(names, size - relativeDegree); + } + + JCRPathExt addEntry(PathElement entry) + { + return new JCRPathExt(this, new PathElement[]{entry}, 1); + } + + private static PathElement element(String namespace, String name, Strin= g prefix, int index) + { + if (name.equals(THIS_RELPATH)) + { + return THIS_ELEMENT; + } + else if (name.equals(PARENT_RELPATH)) + { + return MOVE_UP_ELEMENT; + } + else + { + return new PathElement(namespace, name, prefix, index); + } + } + + private static int addEntry(PathElement[] entries, int size, PathElemen= t entry) + { + if (entry =3D=3D THIS_ELEMENT) + { + return size; + } + if (size > 0 && entry =3D=3D MOVE_UP_ELEMENT && !(entries[size - 1] = =3D=3D MOVE_UP_ELEMENT)) + { + if (size <=3D 0) + { + log.warn("Wrong relative path. Can't move up in path hierarhy.= "); + return 0; + } + return size - 1; + } + + // + entries[size] =3D entry; + + // + return size + 1; + } + + public JCRPathExt makeParentPath() + { + return makeAncestorPath(1); + } + + @Override + public int getLength() + { + return size; + } + + @Override + public PathElement getEntry(int index) + { + if (index > size) + { + throw new ArrayIndexOutOfBoundsException(); + } + return names[index]; + } + + public PathElement[] getRelPath(int relativeDegree) + { + PathElement[] relPath =3D new PathElement[relativeDegree]; + System.arraycopy(names, size - relativeDegree, relPath, 0, relativeD= egree); + return relPath; + } + + public QPath getInternalPath() + { + if (cachedInternalQPath =3D=3D null) + { + QPathEntry[] entries =3D new QPathEntry[size]; + + for (int i =3D 0; i < size; i++) + entries[i] =3D new QPathEntry(names[i].getNamespace(), names[i= ].getName(), names[i].getIndex()); + + cachedInternalQPath =3D new QPath(entries); + } + + return cachedInternalQPath; + } + + public String getAsString(boolean showIndex) + { + if (showIndex) + { + if (cachedToStringShowIndex !=3D null) + { + return cachedToStringShowIndex; + } + } + else + { + if (cachedToString !=3D null) + { + return cachedToString; + } + } + + // [PN] 27.06.07 + String path; + if (isAbsolute()) + { + if (size =3D=3D 1) + { + path =3D "/"; + } + else + { + StringBuilder builder =3D new StringBuilder(); + for (int i =3D 1; i < size; i++) + { + builder.append("/").append(names[i].getAsString(showIndex)); + } + path =3D builder.toString(); + } + } + else + { + // relative + StringBuilder builder =3D new StringBuilder(); + for (int i =3D 0; i < size; i++) + { + if (i > 0) + { + builder.append("/"); + } + else + { + + } + builder.append(names[i].getAsString(showIndex)); + } + path =3D builder.toString(); + } + + + // + if (showIndex) + { + cachedToStringShowIndex =3D path; + } + else + { + cachedToString =3D path; + } + + // + return path; + } + + public int getDepth() + { + return size - 1; + } + + public boolean isDescendantOf(JCRPath ancestorLocation, boolean childOn= ly) + { + return isDescendantOf((JCRPathExt)ancestorLocation, childOnly); + } + + public boolean isDescendantOf(JCRPathExt ancestorLocation, boolean chil= dOnly) + { + int depthDiff =3D getDepth() - ancestorLocation.getDepth(); + if (depthDiff <=3D 0 || (childOnly && depthDiff !=3D 1)) + return false; + + JCRPathExt.PathElement[] anotherNames =3D ancestorLocation.names; + for (int i =3D 0; i < ancestorLocation.size; i++) + { + boolean result =3D anotherNames[i].equals(names[i]); + if (!result) + return false; + } + return true; + } + + public boolean isAncestorOf(JCRPath descendantLocation, boolean childOn= ly) + { + return descendantLocation.isDescendantOf(this, childOnly); + } + + public PathElement getName() + { + if (size > 0) + return names[size - 1]; + + return THIS_ELEMENT; + } + + public int getIndex() + { + return names[size - 1].getIndex(); + } + + public boolean isIndexSetExplicitly() + { + return names[size - 1].isIndexSetExplicitly(); + } + + public boolean isSameNameSibling(JCRPath anotherPath) + { + return isSameNameSibling((JCRPathExt)anotherPath); + } + + public boolean isSameNameSibling(JCRPathExt anotherPath) + { + JCRName[] anotherNames =3D anotherPath.names; + for (int i =3D 0; i < anotherPath.size - 1; i++) + { + boolean result =3D anotherNames[i].equals(names[i]); + if (!result) + return false; + } + return getName().getName().equals(anotherPath.getName().getName()) + && this.getName().getPrefix().equals(anotherPath.getName().getPre= fix()); + } + + public boolean equals(Object obj) + { + if (this =3D=3D obj) + { + return true; + } + if (obj instanceof JCRPathExt) + { + JCRPathExt other =3D (JCRPathExt)obj; + return this.getInternalPath().equals(other.getInternalPath()); + } + return false; + } + + public PathElement[] getEntries() + { + return names.clone(); + } + +} Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/core/LocationFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/LocationFactory.java 2010-10-08 11:45:06 UTC (rev = 3261) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/LocationFactory.java 2010-10-08 12:04:24 UTC (rev = 3262) @@ -65,19 +65,8 @@ */ public JCRPath createJCRPath(JCRPath parentLoc, String relPath) throws = RepositoryException { - - JCRPath path =3D new JCRPath(); - for (int i =3D 0; i < parentLoc.getEntries().length; i++) - { - path.addEntry(parentLoc.getEntries()[i]); - } - JCRPath addPath =3D parseNames(relPath, false); - for (int i =3D 0; i < addPath.getEntries().length; i++) - { - path.addEntry(addPath.getEntries()[i]); - } - return path; + return parentLoc.add(addPath); } = /** @@ -125,30 +114,21 @@ */ public JCRPath createJCRPath(QPath qPath) throws RepositoryException { - - JCRPath path =3D new JCRPath(); - for (int i =3D 0; i < qPath.getEntries().length; i++) - { - QPathEntry entry =3D qPath.getEntries()[i]; - String prefix =3D namespaces.getNamespacePrefixByURI(entry.getNam= espace()); - path.addEntry(entry.getNamespace(), entry.getName(), prefix, entr= y.getIndex()); - } - - return path; + return JCRPath.createJCRPath(namespaces, qPath); } = public JCRName createJCRName(InternalQName qname) throws RepositoryExce= ption { String prefix =3D namespaces.getNamespacePrefixByURI(qname.getNamesp= ace()); - return new JCRName(qname.getNamespace(), qname.getName(), prefix); + return new JCRName(qname, prefix); } = public String formatPathElement(QPathEntry qe) throws RepositoryExcepti= on { String prefix =3D namespaces.getNamespacePrefixByURI(qe.getNamespace= ()); - JCRPath p =3D new JCRPath(); - p.addEntry(qe.getNamespace(), qe.getName(), prefix, qe.getIndex()); - return p.getEntries()[0].getAsString(false); + JCRPath p =3D JCRPath.createJCRPath(); + p =3D p.addEntry(qe.getNamespace(), qe.getName(), prefix, qe.getInde= x()); + return p.getEntry(0).getAsString(false); } = /** @@ -160,25 +140,17 @@ */ public JCRName parseJCRName(String name) throws RepositoryException { - JCRPath.PathElement entry =3D parsePathEntry(new JCRPath(), name); - - return new JCRName(entry.getNamespace(), entry.getName(), entry.getP= refix()); + JCRPath path =3D parsePathEntry(JCRPath.createJCRPath(), name); + JCRPath.PathElement entry =3D path.getName(); + return new JCRName(entry); } = public JCRPath.PathElement[] createRelPath(QPathEntry[] relPath) throws= RepositoryException { - JCRPath path =3D new JCRPath(); - // JCRPath.PathElement[] entries =3D new JCRPath.PathElement[relPath= .length]; - for (QPathEntry element : relPath) - { - String uri =3D namespaces.getNamespaceURIByPrefix(element.getName= space()); - String prefix =3D namespaces.getNamespacePrefixByURI(uri); - path.addEntry(uri, element.getName(), prefix, element.getIndex()); - } - return path.getEntries(); + return JCRPath.createJCRPath(namespaces, relPath).getEntries(); } = - private JCRPath.PathElement parsePathEntry(JCRPath path, String name) t= hrows RepositoryException + private JCRPath parsePathEntry(JCRPath path, String name) throws Reposi= toryException { = // should be reset here (if there is explicit index) or @@ -232,8 +204,8 @@ throw new RepositoryException("Illegal path entry: \"" + name = + "\""); } = - path.addEntry(namespaces.getNamespaceURIByPrefix(prefix), someNam= e, prefix, index); - return (JCRPath.PathElement)path.getName(); + path =3D path.addEntry(namespaces.getNamespaceURIByPrefix(prefix)= , someName, prefix, index); + return path; = } catch (Exception e) @@ -250,7 +222,7 @@ throw new RepositoryException("Illegal relPath: \"" + path + "\""= ); } = - JCRPath jcrPath =3D new JCRPath(); + JCRPath jcrPath =3D JCRPath.createJCRPath(); int start =3D 0; if (!absolute) { @@ -262,7 +234,7 @@ { throw new RepositoryException("Illegal relPath: \"" + path + "= \""); } - jcrPath.addEntry(namespaces.getNamespaceURIByPrefix(""), "", "", = -1); + jcrPath =3D jcrPath.addEntry(namespaces.getNamespaceURIByPrefix("= "), "", "", -1); } else { @@ -280,7 +252,7 @@ = if (start + 1 !=3D path.length()) { - parsePathEntry(jcrPath, qname); + jcrPath =3D parsePathEntry(jcrPath, qname); } else { --===============9037778074661195710==-- From do-not-reply at jboss.org Fri Oct 8 08:39:12 2010 Content-Type: multipart/mixed; boundary="===============0264458403398140618==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3263 - jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene. Date: Fri, 08 Oct 2010 08:39:12 -0400 Message-ID: <201010081239.o98CdCk1001005@svn01.web.mwc.hst.phx2.redhat.com> --===============0264458403398140618== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2010-10-08 08:39:11 -0400 (Fri, 08 Oct 2010) New Revision: 3263 Removed: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/IndexMerger.java Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/MultiIndex.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/RedoLog.java Log: EXOJCR-987 Getting rid of Merger and actions inside MultiIndex Deleted: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exo= platform/services/jcr/impl/core/query/lucene/IndexMerger.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/IndexMerger.java 2010-10-08 12:04:2= 4 UTC (rev 3262) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/IndexMerger.java 2010-10-08 12:39:1= 1 UTC (rev 3263) @@ -1,572 +0,0 @@ -/* - * 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.lucene; - -import EDU.oswego.cs.dl.util.concurrent.Mutex; -import EDU.oswego.cs.dl.util.concurrent.Sync; - -import org.apache.commons.collections.Buffer; -import org.apache.commons.collections.BufferUtils; -import org.apache.commons.collections.buffer.UnboundedFifoBuffer; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.Term; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -/** - * Merges indexes in a separate daemon thread. - */ -class IndexMerger extends Thread implements IndexListener -{ - - /** - * Logger instance for this class. - */ - private static final Logger log =3D LoggerFactory.getLogger("exo.jcr.co= mponent.core.IndexMerger"); - - /** - * Marker task to signal the background thread to quit. - */ - private static final Merge QUIT =3D new Merge(new Index[0]); - - /** - * minMergeDocs config parameter. - */ - private int minMergeDocs =3D SearchIndex.DEFAULT_MIN_MERGE_DOCS; - - /** - * maxMergeDocs config parameter - */ - private int maxMergeDocs =3D SearchIndex.DEFAULT_MAX_MERGE_DOCS; - - /** - * mergeFactor config parameter - */ - private int mergeFactor =3D SearchIndex.DEFAULT_MERGE_FACTOR; - - /** - * Queue of merge Tasks - */ - private final Buffer mergeTasks =3D BufferUtils.blockingBuffer(new Unbo= undedFifoBuffer()); - - /** - * List of id Term that identify documents that were delet= ed - * while a merge was running. - */ - private final List deletedDocuments =3D Collections.synchronizedList(ne= w ArrayList()); - - /** - * List of IndexBuckets in ascending document limit. - */ - private final List indexBuckets =3D new ArrayList(); - - /** - * The MultiIndex this index merger is working on. - */ - private final MultiIndex multiIndex; - - /** - * Monitor object to synchronize merge calculation. - */ - private final Object lock =3D new Object(); - - /** - * Mutex that is acquired when replacing indexes on MultiIndex. - */ - private final Sync indexReplacement =3D new Mutex(); - - /** - * When released, indicates that this index merger is idle. - */ - private final Sync mergerIdle =3D new Mutex(); - - /** - * Creates an IndexMerger. - * - * @param multiIndex the MultiIndex. - */ - IndexMerger(MultiIndex multiIndex) - { - this.multiIndex =3D multiIndex; - setName("IndexMerger"); - setDaemon(true); - try - { - mergerIdle.acquire(); - } - catch (InterruptedException e) - { - // will never happen, lock is free upon construction - throw new InternalError("Unable to acquire mutex after constructi= on"); - } - } - - /** - * Informs the index merger that an index was added / created. - * - * @param name the name of the index. - * @param numDocs the number of documents it contains. - */ - void indexAdded(String name, int numDocs) - { - if (numDocs < 0) - { - throw new IllegalArgumentException("numDocs must be positive"); - } - // multiple threads may enter this method: - // - the background thread of this IndexMerger, when it replaces ind= exes - // after a successful merge - // - a regular thread that updates the workspace - // - // therefore we have to synchronize this block - synchronized (lock) - { - // initially create buckets - if (indexBuckets.size() =3D=3D 0) - { - long lower =3D 0; - long upper =3D minMergeDocs; - while (upper < maxMergeDocs) - { - indexBuckets.add(new IndexBucket(lower, upper, true)); - lower =3D upper + 1; - upper *=3D mergeFactor; - } - // one with upper =3D maxMergeDocs - indexBuckets.add(new IndexBucket(lower, maxMergeDocs, false)); - // and another one as overflow, just in case... - indexBuckets.add(new IndexBucket(maxMergeDocs + 1, Long.MAX_VA= LUE, false)); - } - - // put index in bucket - IndexBucket bucket =3D (IndexBucket)indexBuckets.get(indexBuckets= .size() - 1); - for (int i =3D 0; i < indexBuckets.size(); i++) - { - bucket =3D (IndexBucket)indexBuckets.get(i); - if (bucket.fits(numDocs)) - { - break; - } - } - bucket.add(new Index(name, numDocs)); - - if (log.isDebugEnabled()) - { - log.debug("index added: name=3D" + name + ", numDocs=3D" + num= Docs); - } - - // if bucket does not allow merge, we don't have to continue - if (!bucket.allowsMerge()) - { - return; - } - - // check if we need a merge - if (bucket.size() >=3D mergeFactor) - { - long targetMergeDocs =3D bucket.upper; - targetMergeDocs =3D Math.min(targetMergeDocs * mergeFactor, ma= xMergeDocs); - // sum up docs in bucket - List indexesToMerge =3D new ArrayList(); - int mergeDocs =3D 0; - for (Iterator it =3D bucket.iterator(); it.hasNext() && mergeD= ocs <=3D targetMergeDocs;) - { - indexesToMerge.add(it.next()); - } - if (indexesToMerge.size() > 2) - { - // found merge - Index[] idxs =3D (Index[])indexesToMerge.toArray(new Index[= indexesToMerge.size()]); - bucket.removeAll(indexesToMerge); - if (log.isDebugEnabled()) - { - log.debug("requesting merge for " + indexesToMerge); - } - mergeTasks.add(new Merge(idxs)); - log.debug("merge queue now contains " + mergeTasks.size() += " tasks."); - } - } - } - } - - /** - * @inheritDoc - */ - public void documentDeleted(Term id) - { - log.debug("document deleted: " + id.text()); - deletedDocuments.add(id); - } - - /** - * When the calling thread returns this index merger will be idle, that= is - * there will be no merge tasks pending anymore. The method returns imm= ediately - * if there are currently no tasks pending at all. - */ - void waitUntilIdle() throws InterruptedException - { - mergerIdle.acquire(); - // and immediately release again - mergerIdle.release(); - } - - /** - * Signals this IndexMerger to stop and waits until it - * has terminated. - */ - void dispose() - { - log.debug("dispose IndexMerger"); - // get mutex for index replacements - try - { - indexReplacement.acquire(); - } - catch (InterruptedException e) - { - log.warn("Interrupted while acquiring index replacement sync: " += e); - // try to stop IndexMerger without the sync - } - - // clear task queue - mergeTasks.clear(); - - // send quit - mergeTasks.add(QUIT); - log.debug("quit sent"); - - try - { - // give the merger thread some time to quit, - // it is possible that the merger is busy working on a large inde= x. - // if that is the case we will just ignore it and the daemon will - // die without being able to finish the merge. - // at this point it is not possible anymore to replace indexes - // on the MultiIndex because we hold the indexReplacement Sync. - this.join(500); - if (isAlive()) - { - log.info("Unable to stop IndexMerger. Daemon is busy."); - } - else - { - log.debug("IndexMerger thread stopped"); - } - log.debug("merge queue size: " + mergeTasks.size()); - } - catch (InterruptedException e) - { - log.warn("Interrupted while waiting for IndexMerger thread to ter= minate."); - } - } - - /** - * Implements the index merging. - */ - public void run() - { - for (;;) - { - boolean isIdle =3D false; - if (mergeTasks.size() =3D=3D 0) - { - mergerIdle.release(); - isIdle =3D true; - } - Merge task =3D (Merge)mergeTasks.remove(); - if (task =3D=3D QUIT) - { - mergerIdle.release(); - break; - } - if (isIdle) - { - try - { - mergerIdle.acquire(); - } - catch (InterruptedException e) - { - Thread.interrupted(); - log.warn("Unable to acquire mergerIdle sync"); - } - } - - log.debug("accepted merge request"); - - // reset deleted documents - deletedDocuments.clear(); - - // get readers - String[] names =3D new String[task.indexes.length]; - for (int i =3D 0; i < task.indexes.length; i++) - { - names[i] =3D task.indexes[i].name; - } - try - { - log.debug("create new index"); - PersistentIndex index =3D multiIndex.getOrCreateIndex(null); - boolean success =3D false; - try - { - - log.debug("get index readers from MultiIndex"); - IndexReader[] readers =3D multiIndex.getIndexReaders(names,= this); - try - { - // do the merge - long time =3D System.currentTimeMillis(); - index.addIndexes(readers); - time =3D System.currentTimeMillis() - time; - int docCount =3D 0; - for (int i =3D 0; i < readers.length; i++) - { - docCount +=3D readers[i].numDocs(); - } - log.info("merged " + docCount + " documents in " + time = + " ms into " + index.getName() + "."); - } - finally - { - for (int i =3D 0; i < readers.length; i++) - { - try - { - Util.closeOrRelease(readers[i]); - } - catch (IOException e) - { - log.warn("Unable to close IndexReader: " + e); - } - } - } - - // inform multi index - // if we cannot get the sync immediately we have to quit - if (!indexReplacement.attempt(0)) - { - log.debug("index merging canceled"); - break; - } - try - { - log.debug("replace indexes"); - multiIndex.replaceIndexes(names, index, deletedDocuments= ); - } - finally - { - indexReplacement.release(); - } - - success =3D true; - - } - finally - { - if (!success) - { - // delete index - log.debug("deleting index " + index.getName()); - multiIndex.deleteIndex(index); - } - } - } - catch (Throwable e) - { - log.error("Error while merging indexes: ", e); - } - } - log.info("IndexMerger terminated"); - } - - //-----------------------< merge properties >--------------------------= ----- - - /** - * The merge factor. - */ - public void setMergeFactor(int mergeFactor) - { - this.mergeFactor =3D mergeFactor; - } - - /** - * The initial threshold for number of documents to merge to a new inde= x. - */ - public void setMinMergeDocs(int minMergeDocs) - { - this.minMergeDocs =3D minMergeDocs; - } - - /** - * The maximum number of document to merge. - */ - public void setMaxMergeDocs(int maxMergeDocs) - { - this.maxMergeDocs =3D maxMergeDocs; - } - - //------------------------------< internal >---------------------------= ----- - - /** - * Implements a simple struct that holds the name of an index and how - * many document it contains. Index is comparable using the - * number of documents it contains. - */ - private static final class Index implements Comparable - { - - /** - * The name of the index. - */ - private final String name; - - /** - * The number of documents the index contains. - */ - private final int numDocs; - - /** - * Creates a new index struct. - * - * @param name name of an index. - * @param numDocs number of documents it contains. - */ - Index(String name, int numDocs) - { - this.name =3D name; - this.numDocs =3D numDocs; - } - - /** - * Indexes are first ordered by {@link #numDocs} and then by {@link - * #name}. - * - * @param o the other Index. - * @return a negative integer, zero, or a positive integer as this - * Index is less than, equal to, or greater than the specifi= ed - * Index. - */ - public int compareTo(Object o) - { - Index other =3D (Index)o; - int val =3D numDocs < other.numDocs ? -1 : (numDocs =3D=3D other.= numDocs ? 0 : 1); - if (val !=3D 0) - { - return val; - } - else - { - return name.compareTo(other.name); - } - } - - /** - * @inheritDoc - */ - public String toString() - { - return name + ":" + numDocs; - } - } - - /** - * Defines a merge task, to merge a couple of indexes into a new index. - */ - private static final class Merge - { - - private final Index[] indexes; - - /** - * Merge task, to merge indexes into a new index with - * name. - * - * @param indexes the indexes to merge. - */ - Merge(Index[] indexes) - { - this.indexes =3D new Index[indexes.length]; - System.arraycopy(indexes, 0, this.indexes, 0, indexes.length); - } - } - - /** - * Implements a List with a document limit value. An - * IndexBucket contains {@link Index}es with documents less - * or equal the document limit of the bucket. - */ - private static final class IndexBucket extends ArrayList - { - - /** - * The lower document limit. - */ - private final long lower; - - /** - * The upper document limit. - */ - private final long upper; - - /** - * Flag indicating if indexes in this bucket can be merged. - */ - private final boolean allowMerge; - - /** - * Creates a new IndexBucket. Limits are both inclusive. - * - * @param lower document limit. - * @param upper document limit. - * @param allowMerge if indexes in this bucket can be merged. - */ - IndexBucket(long lower, long upper, boolean allowMerge) - { - this.lower =3D lower; - this.upper =3D upper; - this.allowMerge =3D allowMerge; - } - - /** - * Returns true if the number of documents fit in this - * IndexBucket; otherwise false - * - * @param numDocs the number of documents. - * @return true if numDocs fit. - */ - boolean fits(long numDocs) - { - return numDocs >=3D lower && numDocs <=3D upper; - } - - /** - * Returns true if indexes in this bucket can be merged. - * - * @return true if indexes in this bucket can be merged. - */ - boolean allowsMerge() - { - return allowMerge; - } - } -} Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/MultiIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-08 12:04:24= UTC (rev 3262) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-08 12:39:11= UTC (rev 3263) @@ -171,11 +171,6 @@ private long lastFileSystemFlushTime; = /** - * The IndexMerger for this MultiIndex. - */ - private final IndexMerger merger; - - /** * Timer to schedule flushes of this index after some idle time. */ private static final Timer FLUSH_TIMER =3D new Timer(true); @@ -265,12 +260,6 @@ // as of 1.5 deletable file is not used anymore removeDeletable(); = - // initialize IndexMerger - merger =3D new IndexMerger(this); - merger.setMaxMergeDocs(handler.getMaxMergeDocs()); - merger.setMergeFactor(handler.getMergeFactor()); - merger.setMinMergeDocs(handler.getMinMergeDocs()); - // this method is run in privileged mode internally IndexingQueueStore store =3D new IndexingQueueStore(indexDir); = @@ -299,7 +288,6 @@ index.setUseCompoundFile(handler.getUseCompoundFile()); index.setTermInfosIndexDivisor(handler.getTermInfosIndexDivisor()= ); indexes.add(index); - merger.indexAdded(index.getName(), index.getNumDocuments()); } = // init volatile index @@ -398,10 +386,16 @@ { long count =3D 0; // traverse and index workspace - executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); + = + // TODO: this was removed + //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); + = // NodeData rootState =3D (NodeData) stateMgr.getItemData(root= Id); count =3D createIndex(indexingTree.getIndexingRoot(), stateMgr= , count); - executeAndLog(new Commit(getTransactionId())); + = + // TODO : this was replaced + //executeAndLog(new Commit(getTransactionId())); + = log.info("Created initial index for {} nodes", new Long(count)= ); releaseMultiReader(); scheduleFlushTask(); @@ -467,23 +461,67 @@ try { long transactionId =3D nextTransactionId++; - executeAndLog(new Start(transactionId)); + = + // TODO: this was removed + //executeAndLog(new Start(transactionId)); = for (Iterator it =3D remove.iterator(); it.hasNext();) { - executeAndLog(new DeleteNode(transactionId, (String)it.n= ext())); + // TODO this was replaced + //executeAndLog(new DeleteNode(transactionId, (String)it= .next())); + = + String uuidString =3D (String)it.next(); + // check if indexing queue is still working on + // this node from a previous update + Document doc =3D indexingQueue.removeDocument(uuidString= ); + if (doc !=3D null) + { + Util.disposeDocument(doc); + } + Term idTerm =3D new Term(FieldNames.UUID, uuidString); + // if the document cannot be deleted from the volatile i= ndex + // delete it from one of the persistent indexes. + int num =3D volatileIndex.removeDocument(idTerm); + if (num =3D=3D 0) + { + for (int i =3D indexes.size() - 1; i >=3D 0; i--) + { + // only look in registered indexes + PersistentIndex idx =3D (PersistentIndex)indexes.g= et(i); + if (indexNames.contains(idx.getName())) + { + num =3D idx.removeDocument(idTerm); + if (num > 0) + { + break; + } + } + } + } + = + = + = } for (Iterator it =3D add.iterator(); it.hasNext();) { Document doc =3D (Document)it.next(); if (doc !=3D null) { - executeAndLog(new AddNode(transactionId, doc)); + // TODO: ths is replaced + //executeAndLog(new AddNode(transactionId, doc)); + + if (doc !=3D null) + { + volatileIndex.addDocuments(new Document[]{doc}); + } + = // commit volatile index if needed flush |=3D checkVolatileCommit(); } } - executeAndLog(new Commit(transactionId)); + = + // TODO : this was replaced + //executeAndLog(new Commit(transactionId)); = // flush whole index when volatile index has been commited. if (flush) @@ -558,11 +596,15 @@ try { Term idTerm =3D new Term(FieldNames.UUID, uuid.toString()); - executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); + = + // TODO: this was removed + //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); + = num =3D volatileIndex.removeDocument(idTerm); if (num > 0) { - redoLog.append(new DeleteNode(getTransactionId(), uuid)); + // TODO: removed line + //redoLog.append(new DeleteNode(getTransactionId(), uuid)); } for (int i =3D 0; i < indexes.size(); i++) { @@ -573,12 +615,14 @@ int removed =3D index.removeDocument(idTerm); if (removed > 0) { - redoLog.append(new DeleteNode(getTransactionId(), uuid)); + // TODO: removed line + //redoLog.append(new DeleteNode(getTransactionId(), uuid= )); } num +=3D removed; } } - executeAndLog(new Commit(getTransactionId())); + // TODO : this was replaced + //executeAndLog(new Commit(getTransactionId())); } finally { @@ -792,7 +836,8 @@ // if we are reindexing there is already an active transaction if (!reindexing) { - executeAndLog(new Start(Action.INTERNAL_TRANS_REPL_INDEXES)= ); + // TODO: this was removed + //executeAndLog(new Start(Action.INTERNAL_TRANS_REPL_INDEXE= S)); } // delete obsolete indexes Set names =3D new HashSet(Arrays.asList(obsoleteIndexes)); @@ -802,16 +847,37 @@ String indexName =3D (String)it.next(); if (indexNames.contains(indexName)) { - executeAndLog(new DeleteIndex(getTransactionId(), indexN= ame)); + // TODO this was replaced + //executeAndLog(new DeleteIndex(getTransactionId(), inde= xName)); + = + for (Iterator it2 =3D indexes.iterator(); it2.hasNext();) + { + PersistentIndex idx =3D (PersistentIndex)it2.next(); + if (idx.getName().equals(indexName)) + { + idx.close(); + deleteIndex(idx); + break; + } + } + = } } = // Index merger does not log an action when it creates the // target // index of the merge. We have to do this here. - executeAndLog(new CreateIndex(getTransactionId(), index.getNam= e())); + // TODO this was replaced + ///executeAndLog(new CreateIndex(getTransactionId(), index.get= Name())); = - executeAndLog(new AddIndex(getTransactionId(), index.getName()= )); + PersistentIndex idx =3D getOrCreateIndex(index.getName()); + = + // TODO: this is replaced + //executeAndLog(new AddIndex(getTransactionId(), index.getName= ())); + if (!indexNames.contains(index.getName())) + { + indexNames.addName(index.getName()); + } = // delete documents in index for (Iterator it =3D deleted.iterator(); it.hasNext();) @@ -825,7 +891,9 @@ { // only commit if we are not reindexing // when reindexing the final commit is done at the very end - executeAndLog(new Commit(getTransactionId())); + = + // TODO : this was replaced + //executeAndLog(new Commit(getTransactionId())); } } finally @@ -954,7 +1022,6 @@ // stop index merger // when calling this method we must not lock this MultiIndex, oth= erwise // a deadlock might occur - merger.dispose(); = synchronized (this) { @@ -1108,7 +1175,8 @@ synchronized (this) { // commit volatile index - executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); + // TODO: this was removed + //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); commitVolatileIndex(); = // commit persistent indexes @@ -1126,11 +1194,17 @@ // check if index still contains documents if (index.getNumDocuments() =3D=3D 0) { - executeAndLog(new DeleteIndex(getTransactionId(), index.= getName())); + // TODO THIS was replaced + //executeAndLog(new DeleteIndex(getTransactionId(), inde= x.getName())); + + index.close(); + deleteIndex(index); + } } } - executeAndLog(new Commit(getTransactionId())); + // TODO : this was replaced + //executeAndLog(new Commit(getTransactionId())); = indexNames.write(); = @@ -1329,16 +1403,31 @@ = long time =3D System.currentTimeMillis(); // create index - CreateIndex create =3D new CreateIndex(getTransactionId(), null); - executeAndLog(create); + = + //TODO this was replaced +// CreateIndex create =3D new CreateIndex(getTransactionId(), null= ); +// executeAndLog(create); + = + PersistentIndex idx =3D getOrCreateIndex(null); = // commit volatile index - executeAndLog(new VolatileCommit(getTransactionId(), create.getIn= dexName())); + = + // TODO THIS IS REPLACED + //executeAndLog(new VolatileCommit(getTransactionId(), idx.getNam= e())); = + idx.copyIndex(volatileIndex); + resetVolatileIndex(); + = + // TODO this is replaced // add new index - AddIndex add =3D new AddIndex(getTransactionId(), create.getIndex= Name()); - executeAndLog(add); +// AddIndex add =3D new AddIndex(getTransactionId(), create.getInd= exName()); +// executeAndLog(add); = + if (!indexNames.contains(idx.getName())) + { + indexNames.addName(idx.getName()); + } + = // create new volatile index resetVolatileIndex(); = @@ -1376,7 +1465,11 @@ { return count; } - executeAndLog(new AddNode(getTransactionId(), node.getIdentifier())); + = + // TODO: this is replaced + //executeAndLog(new AddNode(getTransactionId(), node.getIdentifier()= )); + volatileIndex.addDocuments(new Document[]{createDocument(node)}); + = if (++count % 100 =3D=3D 0) { = @@ -1552,11 +1645,45 @@ { for (Iterator it =3D finished.keySet().iterator(); it.hasNe= xt();) { - executeAndLog(new DeleteNode(getTransactionId(), (String= )it.next())); + // TODO this was replaced + //executeAndLog(new DeleteNode(getTransactionId(), (Stri= ng)it.next())); + = + String uuidString =3D (String)it.next(); + // check if indexing queue is still working on + // this node from a previous update + Document doc =3D indexingQueue.removeDocument(uuidString= ); + if (doc !=3D null) + { + Util.disposeDocument(doc); + } + Term idTerm =3D new Term(FieldNames.UUID, uuidString); + // if the document cannot be deleted from the volatile i= ndex + // delete it from one of the persistent indexes. + int num =3D volatileIndex.removeDocument(idTerm); + if (num =3D=3D 0) + { + for (int i =3D indexes.size() - 1; i >=3D 0; i--) + { + // only look in registered indexes + PersistentIndex idx =3D (PersistentIndex)indexes.g= et(i); + if (indexNames.contains(idx.getName())) + { + num =3D idx.removeDocument(idTerm); + if (num > 0) + { + return; + } + } + } + } + = + = } for (Iterator it =3D finished.values().iterator(); it.hasNe= xt();) { - executeAndLog(new AddNode(getTransactionId(), (Document)= it.next())); + // TODO this was replaced + //executeAndLog(new AddNode(getTransactionId(), (Documen= t)it.next())); + volatileIndex.addDocuments(new Document[]{(Document)it.n= ext()}); } } else @@ -1790,35 +1917,35 @@ Action a; if (actionLabel.equals(Action.ADD_NODE)) { - a =3D AddNode.fromString(transactionId, arguments); + a =3D AddNode_.fromString(transactionId, arguments); } else if (actionLabel.equals(Action.ADD_INDEX)) { - a =3D AddIndex.fromString(transactionId, arguments); + a =3D AddIndex_.fromString(transactionId, arguments); } else if (actionLabel.equals(Action.COMMIT)) { - a =3D Commit.fromString(transactionId, arguments); + a =3D Commit_.fromString(transactionId, arguments); } else if (actionLabel.equals(Action.CREATE_INDEX)) { - a =3D CreateIndex.fromString(transactionId, arguments); + a =3D CreateIndex_.fromString(transactionId, arguments); } else if (actionLabel.equals(Action.DELETE_INDEX)) { - a =3D DeleteIndex.fromString(transactionId, arguments); + a =3D DeleteIndex_.fromString(transactionId, arguments); } else if (actionLabel.equals(Action.DELETE_NODE)) { - a =3D DeleteNode.fromString(transactionId, arguments); + a =3D DeleteNode_.fromString(transactionId, arguments); } else if (actionLabel.equals(Action.START)) { - a =3D Start.fromString(transactionId, arguments); + a =3D Start_.fromString(transactionId, arguments); } else if (actionLabel.equals(Action.VOLATILE_COMMIT)) { - a =3D VolatileCommit.fromString(transactionId, arguments); + a =3D VolatileCommit_.fromString(transactionId, arguments); } else { @@ -1831,7 +1958,7 @@ /** * Adds an index to the MultiIndex's active persistent index list. */ - private static class AddIndex extends Action + private static class AddIndex_ extends Action { = /** @@ -1848,7 +1975,7 @@ * the name of the index to add, or null if = an * index with a new name should be created. */ - AddIndex(long transactionId, String indexName) + AddIndex_(long transactionId, String indexName) { super(transactionId, Action.TYPE_ADD_INDEX); this.indexName =3D indexName; @@ -1865,9 +1992,9 @@ * @throws IllegalArgumentException * if the arguments are malformed. */ - static AddIndex fromString(long transactionId, String arguments) + static AddIndex_ fromString(long transactionId, String arguments) { - return new AddIndex(transactionId, arguments); + return new AddIndex_(transactionId, arguments); } = /** @@ -1882,9 +2009,6 @@ if (!index.indexNames.contains(indexName)) { index.indexNames.addName(indexName); - // now that the index is in the active list let the merger know - // about it - index.merger.indexAdded(indexName, idx.getNumDocuments()); } } = @@ -1907,7 +2031,7 @@ /** * Adds a node to the index. */ - private static class AddNode extends Action + private static class AddNode_ extends Action { = /** @@ -1935,7 +2059,7 @@ * @param uuid * the uuid of the node to add. */ - AddNode(long transactionId, String uuid) + AddNode_(long transactionId, String uuid) { super(transactionId, Action.TYPE_ADD_NODE); this.uuid =3D uuid; @@ -1949,7 +2073,7 @@ * @param doc * the document to add. */ - AddNode(long transactionId, Document doc) + AddNode_(long transactionId, Document doc) { this(transactionId, doc.get(FieldNames.UUID)); this.doc =3D doc; @@ -1966,14 +2090,14 @@ * @throws IllegalArgumentException * if the arguments are malformed. Not a UUID. */ - static AddNode fromString(long transactionId, String arguments) thro= ws IllegalArgumentException + static AddNode_ fromString(long transactionId, String arguments) thr= ows IllegalArgumentException { // simple length check if (arguments.length() !=3D Constants.UUID_FORMATTED_LENGTH) { throw new IllegalArgumentException("arguments is not a uuid"); } - return new AddNode(transactionId, arguments); + return new AddNode_(transactionId, arguments); } = /** @@ -2021,7 +2145,7 @@ /** * Commits a transaction. */ - private static class Commit extends Action + private static class Commit_ extends Action { = /** @@ -2030,7 +2154,7 @@ * @param transactionId * the id of the transaction that is committed. */ - Commit(long transactionId) + Commit_(long transactionId) { super(transactionId, Action.TYPE_COMMIT); } @@ -2044,9 +2168,9 @@ * ignored by this method. * @return the Commit action. */ - static Commit fromString(long transactionId, String arguments) + static Commit_ fromString(long transactionId, String arguments) { - return new Commit(transactionId); + return new Commit_(transactionId); } = /** @@ -2074,7 +2198,7 @@ * Creates an new sub index but does not add it to the active persistent * index list. */ - private static class CreateIndex extends Action + private static class CreateIndex_ extends Action { = /** @@ -2091,7 +2215,7 @@ * the name of the index to add, or null if = an * index with a new name should be created. */ - CreateIndex(long transactionId, String indexName) + CreateIndex_(long transactionId, String indexName) { super(transactionId, Action.TYPE_CREATE_INDEX); this.indexName =3D indexName; @@ -2108,10 +2232,10 @@ * @throws IllegalArgumentException * if the arguments are malformed. */ - static CreateIndex fromString(long transactionId, String arguments) + static CreateIndex_ fromString(long transactionId, String arguments) { // when created from String, this action is executed as redo acti= on - return new CreateIndex(transactionId, arguments); + return new CreateIndex_(transactionId, arguments); } = /** @@ -2171,7 +2295,7 @@ /** * Closes and deletes an index that is no longer in use. */ - private static class DeleteIndex extends Action + private static class DeleteIndex_ extends Action { = /** @@ -2187,7 +2311,7 @@ * @param indexName * the name of the index to delete. */ - DeleteIndex(long transactionId, String indexName) + DeleteIndex_(long transactionId, String indexName) { super(transactionId, Action.TYPE_DELETE_INDEX); this.indexName =3D indexName; @@ -2204,9 +2328,9 @@ * @throws IllegalArgumentException * if the arguments are malformed. */ - static DeleteIndex fromString(long transactionId, String arguments) + static DeleteIndex_ fromString(long transactionId, String arguments) { - return new DeleteIndex(transactionId, arguments); + return new DeleteIndex_(transactionId, arguments); } = /** @@ -2249,7 +2373,7 @@ /** * Deletes a node from the index. */ - private static class DeleteNode extends Action + private static class DeleteNode_ extends Action { = /** @@ -2271,7 +2395,7 @@ * @param uuid * the uuid of the node to delete. */ - DeleteNode(long transactionId, String uuid) + DeleteNode_(long transactionId, String uuid) { super(transactionId, Action.TYPE_DELETE_NODE); this.uuid =3D uuid; @@ -2288,14 +2412,14 @@ * @throws IllegalArgumentException * if the arguments are malformed. Not a UUID. */ - static DeleteNode fromString(long transactionId, String arguments) + static DeleteNode_ fromString(long transactionId, String arguments) { // simple length check if (arguments.length() !=3D Constants.UUID_FORMATTED_LENGTH) { throw new IllegalArgumentException("arguments is not a uuid"); } - return new DeleteNode(transactionId, arguments); + return new DeleteNode_(transactionId, arguments); } = /** @@ -2355,7 +2479,7 @@ /** * Starts a transaction. */ - private static class Start extends Action + private static class Start_ extends Action { = /** @@ -2364,7 +2488,7 @@ * @param transactionId * the id of the transaction that started. */ - Start(long transactionId) + Start_(long transactionId) { super(transactionId, Action.TYPE_START); } @@ -2378,9 +2502,9 @@ * ignored by this method. * @return the Start action. */ - static Start fromString(long transactionId, String arguments) + static Start_ fromString(long transactionId, String arguments) { - return new Start(transactionId); + return new Start_(transactionId); } = /** @@ -2407,7 +2531,7 @@ /** * Commits the volatile index to disk. */ - private static class VolatileCommit extends Action + private static class VolatileCommit_ extends Action { = /** @@ -2421,7 +2545,7 @@ * @param transactionId * the id of the transaction that executes this action. */ - VolatileCommit(long transactionId, String targetIndex) + VolatileCommit_(long transactionId, String targetIndex) { super(transactionId, Action.TYPE_VOLATILE_COMMIT); this.targetIndex =3D targetIndex; @@ -2436,9 +2560,9 @@ * ignored by this implementation. * @return the VolatileCommit action. */ - static VolatileCommit fromString(long transactionId, String argument= s) + static VolatileCommit_ fromString(long transactionId, String argumen= ts) { - return new VolatileCommit(transactionId, arguments); + return new VolatileCommit_(transactionId, arguments); } = /** @@ -2500,7 +2624,6 @@ protected void setReadOny() { // try to stop merger in safe way - merger.dispose(); flushTask.cancel(); FLUSH_TIMER.purge(); this.redoLog =3D null; @@ -2532,18 +2655,8 @@ attemptDelete(); = // now that we are ready, start index merger - merger.start(); if (redoLogApplied) { - // wait for the index merge to finish pending jobs - try - { - merger.waitUntilIdle(); - } - catch (InterruptedException e) - { - // move on - } flush(); } = Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/RedoLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/RedoLog.java 2010-10-08 12:04:24 UT= C (rev 3262) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/RedoLog.java 2010-10-08 12:39:11 UT= C (rev 3263) @@ -193,7 +193,10 @@ out.close(); out =3D null; } - dir.deleteFile(REDO_LOG); + if (dir.fileExists(REDO_LOG)) + { + dir.deleteFile(REDO_LOG); + } entryCount =3D 0; return null; } @@ -208,17 +211,17 @@ private void initOut() throws IOException { SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() + { + public Object run() throws Exception { - public Object run() throws Exception - { if (out =3D=3D null) { OutputStream os =3D new IndexOutputStream(dir.createOutput(= REDO_LOG)); out =3D new BufferedWriter(new OutputStreamWriter(os)); } - return null; - } - }); + return null; + } + }); } = /** @@ -231,9 +234,9 @@ private void read(final ActionCollector collector) throws IOException { SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() + { + public Object run() throws Exception { - public Object run() throws Exception - { if (!dir.fileExists(REDO_LOG)) { return null; @@ -269,9 +272,9 @@ } } } - return null; - } - }); + return null; + } + }); } = //-----------------------< internal >----------------------------------= ----- --===============0264458403398140618==-- From do-not-reply at jboss.org Fri Oct 8 09:03:56 2010 Content-Type: multipart/mixed; boundary="===============7349350063708105368==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3264 - jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene. Date: Fri, 08 Oct 2010 09:03:56 -0400 Message-ID: <201010081303.o98D3uOX008270@svn01.web.mwc.hst.phx2.redhat.com> --===============7349350063708105368== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2010-10-08 09:03:55 -0400 (Fri, 08 Oct 2010) New Revision: 3264 Removed: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/Recovery.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/RedoLog.java Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/MultiIndex.java Log: EXOJCR-987 : actions and redo successfully deleted Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/MultiIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-08 12:39:11= UTC (rev 3263) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-08 13:03:55= UTC (rev 3264) @@ -23,7 +23,6 @@ import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener; @@ -156,11 +155,6 @@ private final Object updateMonitor =3D new Object(); = /** - * true if the redo log contained entries on startup. - */ - private boolean redoLogApplied =3D false; - - /** * The time this index was last flushed or a transaction was committed. */ private long lastFlushTime; @@ -182,11 +176,6 @@ private TimerTask flushTask; = /** - * The RedoLog of this MultiIndex. - */ - private RedoLog redoLog =3D null; - - /** * The indexing queue with pending text extraction jobs. */ private IndexingQueue indexingQueue; @@ -202,11 +191,6 @@ private long nextTransactionId =3D 0; = /** - * The current transaction id. - */ - private long currentTransactionId =3D -1; - - /** * Flag indicating whether re-indexing is running. */ private boolean reindexing =3D false; @@ -386,16 +370,16 @@ { long count =3D 0; // traverse and index workspace - = + // TODO: this was removed //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); - = + // NodeData rootState =3D (NodeData) stateMgr.getItemData(root= Id); count =3D createIndex(indexingTree.getIndexingRoot(), stateMgr= , count); - = + // TODO : this was replaced //executeAndLog(new Commit(getTransactionId())); - = + log.info("Created initial index for {} nodes", new Long(count)= ); releaseMultiReader(); scheduleFlushTask(); @@ -461,15 +445,15 @@ try { long transactionId =3D nextTransactionId++; - = - // TODO: this was removed + + // TODO: this was removed //executeAndLog(new Start(transactionId)); = for (Iterator it =3D remove.iterator(); it.hasNext();) { // TODO this was replaced //executeAndLog(new DeleteNode(transactionId, (String)it= .next())); - = + String uuidString =3D (String)it.next(); // check if indexing queue is still working on // this node from a previous update @@ -498,9 +482,7 @@ } } } - = - = - = + } for (Iterator it =3D add.iterator(); it.hasNext();) { @@ -514,13 +496,13 @@ { volatileIndex.addDocuments(new Document[]{doc}); } - = + // commit volatile index if needed flush |=3D checkVolatileCommit(); } } - = - // TODO : this was replaced + + // TODO : this was replaced //executeAndLog(new Commit(transactionId)); = // flush whole index when volatile index has been commited. @@ -596,10 +578,10 @@ try { Term idTerm =3D new Term(FieldNames.UUID, uuid.toString()); - = - // TODO: this was removed + + // TODO: this was removed //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); - = + num =3D volatileIndex.removeDocument(idTerm); if (num > 0) { @@ -621,7 +603,7 @@ num +=3D removed; } } - // TODO : this was replaced + // TODO : this was replaced //executeAndLog(new Commit(getTransactionId())); } finally @@ -849,7 +831,7 @@ { // TODO this was replaced //executeAndLog(new DeleteIndex(getTransactionId(), inde= xName)); - = + for (Iterator it2 =3D indexes.iterator(); it2.hasNext();) { PersistentIndex idx =3D (PersistentIndex)it2.next(); @@ -860,7 +842,7 @@ break; } } - = + } } = @@ -871,7 +853,7 @@ ///executeAndLog(new CreateIndex(getTransactionId(), index.get= Name())); = PersistentIndex idx =3D getOrCreateIndex(index.getName()); - = + // TODO: this is replaced //executeAndLog(new AddIndex(getTransactionId(), index.getName= ())); if (!indexNames.contains(index.getName())) @@ -891,8 +873,8 @@ { // only commit if we are not reindexing // when reindexing the final commit is done at the very end - = - // TODO : this was replaced + + // TODO : this was replaced //executeAndLog(new Commit(getTransactionId())); } } @@ -1130,17 +1112,6 @@ } = /** - * Returns true if the redo log contained entries while th= is - * index was instantiated; false otherwise. - * = - * @return true if the redo log contained entries. - */ - boolean getRedoLogApplied() - { - return redoLogApplied; - } - - /** * Removes the index from the list of active sub indexes. = The * Index is not acutally deleted right away, but postponed to the * transaction commit. @@ -1198,19 +1169,17 @@ //executeAndLog(new DeleteIndex(getTransactionId(), inde= x.getName())); = index.close(); - deleteIndex(index); + deleteIndex(index); = } } } - // TODO : this was replaced + // TODO : this was replaced //executeAndLog(new Commit(getTransactionId())); = indexNames.write(); = // reset redo log - redoLog.clear(); - lastFlushTime =3D System.currentTimeMillis(); lastFileSystemFlushTime =3D System.currentTimeMillis(); } @@ -1326,48 +1295,6 @@ } = /** - * Returns the current transaction id. - * = - * @return the current transaction id. - */ - private long getTransactionId() - { - return currentTransactionId; - } - - /** - * Executes action a and appends the action to the redo lo= g if - * successful. - * = - * @param a - * the Action to execute. - * @return the executed action. - * @throws IOException - * if an error occurs while executing the action or appendi= ng - * the action to the redo log. - */ - private Action executeAndLog(final Action a) throws IOException - { - return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedE= xceptionAction() - { - public Action run() throws Exception - { - a.execute(MultiIndex.this); - redoLog.append(a); - // please note that flushing the redo log is only required on - // commit, but we also want to keep track of new indexes for s= ure. - // otherwise it might happen that unused index folders are orp= haned - // after a crash. - if (a.getType() =3D=3D Action.TYPE_COMMIT || a.getType() =3D= =3D Action.TYPE_ADD_INDEX) - { - redoLog.flush(); - } - return a; - } - }); - } - - /** * Checks if it is needed to commit the volatile index according to * {@link SearchIndex#getMaxVolatileIndexSize()}. * = @@ -1403,31 +1330,31 @@ = long time =3D System.currentTimeMillis(); // create index - = + //TODO this was replaced -// CreateIndex create =3D new CreateIndex(getTransactionId(), null= ); -// executeAndLog(create); - = + // CreateIndex create =3D new CreateIndex(getTransactionI= d(), null); + // executeAndLog(create); + PersistentIndex idx =3D getOrCreateIndex(null); = // commit volatile index - = + // TODO THIS IS REPLACED //executeAndLog(new VolatileCommit(getTransactionId(), idx.getNam= e())); = idx.copyIndex(volatileIndex); resetVolatileIndex(); - = + // TODO this is replaced // add new index -// AddIndex add =3D new AddIndex(getTransactionId(), create.getInd= exName()); -// executeAndLog(add); + // AddIndex add =3D new AddIndex(getTransactionId(), crea= te.getIndexName()); + // executeAndLog(add); = if (!indexNames.contains(idx.getName())) { indexNames.addName(idx.getName()); } - = + // create new volatile index resetVolatileIndex(); = @@ -1465,11 +1392,11 @@ { return count; } - = + // TODO: this is replaced //executeAndLog(new AddNode(getTransactionId(), node.getIdentifier()= )); volatileIndex.addDocuments(new Document[]{createDocument(node)}); - = + if (++count % 100 =3D=3D 0) { = @@ -1565,7 +1492,6 @@ { try { - if (redoLog.hasEntries()) { log.debug("Flushing index after being idle for " + idleTime= + " ms."); synchronized (updateMonitor) @@ -1647,7 +1573,7 @@ { // TODO this was replaced //executeAndLog(new DeleteNode(getTransactionId(), (Stri= ng)it.next())); - = + String uuidString =3D (String)it.next(); // check if indexing queue is still working on // this node from a previous update @@ -1676,8 +1602,7 @@ } } } - = - = + } for (Iterator it =3D finished.values().iterator(); it.hasNe= xt();) { @@ -1703,899 +1628,6 @@ // >--------------------------------------- = /** - * Defines an action on an MultiIndex. - */ - public abstract static class Action - { - - /** - * Action identifier in redo log for transaction start action. - */ - static final String START =3D "STR"; - - /** - * Action type for start action. - */ - public static final int TYPE_START =3D 0; - - /** - * Action identifier in redo log for add node action. - */ - static final String ADD_NODE =3D "ADD"; - - /** - * Action type for add node action. - */ - public static final int TYPE_ADD_NODE =3D 1; - - /** - * Action identifier in redo log for node delete action. - */ - static final String DELETE_NODE =3D "DEL"; - - /** - * Action type for delete node action. - */ - public static final int TYPE_DELETE_NODE =3D 2; - - /** - * Action identifier in redo log for transaction commit action. - */ - static final String COMMIT =3D "COM"; - - /** - * Action type for commit action. - */ - public static final int TYPE_COMMIT =3D 3; - - /** - * Action identifier in redo log for volatile index commit action. - */ - static final String VOLATILE_COMMIT =3D "VOL_COM"; - - /** - * Action type for volatile index commit action. - */ - public static final int TYPE_VOLATILE_COMMIT =3D 4; - - /** - * Action identifier in redo log for index create action. - */ - static final String CREATE_INDEX =3D "CRE_IDX"; - - /** - * Action type for create index action. - */ - public static final int TYPE_CREATE_INDEX =3D 5; - - /** - * Action identifier in redo log for index add action. - */ - static final String ADD_INDEX =3D "ADD_IDX"; - - /** - * Action type for add index action. - */ - public static final int TYPE_ADD_INDEX =3D 6; - - /** - * Action identifier in redo log for delete index action. - */ - static final String DELETE_INDEX =3D "DEL_IDX"; - - /** - * Action type for delete index action. - */ - public static final int TYPE_DELETE_INDEX =3D 7; - - /** - * Transaction identifier for internal actions like volatile index - * commit triggered by timer thread. - */ - static final long INTERNAL_TRANSACTION =3D -1; - - /** - * Transaction identifier for internal action that replaces indexs. - */ - static final long INTERNAL_TRANS_REPL_INDEXES =3D -2; - - /** - * The id of the transaction that executed this action. - */ - private final long transactionId; - - /** - * The action type. - */ - private final int type; - - /** - * Creates a new Action. - * = - * @param transactionId - * the id of the transaction that executed this action. - * @param type - * the action type. - */ - Action(long transactionId, int type) - { - this.transactionId =3D transactionId; - this.type =3D type; - } - - /** - * Returns the transaction id for this Action. - * = - * @return the transaction id for this Action. - */ - long getTransactionId() - { - return transactionId; - } - - /** - * Returns the action type. - * = - * @return the action type. - */ - int getType() - { - return type; - } - - /** - * Executes this action on the index. - * = - * @param index - * the index where to execute the action. - * @throws IOException - * if the action fails due to some I/O error in the inde= x or - * some other error. - */ - public abstract void execute(MultiIndex index) throws IOException; - - /** - * Executes the inverse operation of this action. That is, does an u= ndo - * of this action. This default implementation does nothing, but ret= urns - * silently. - * = - * @param index - * the index where to undo the action. - * @throws IOException - * if the action cannot be undone. - */ - public void undo(MultiIndex index) throws IOException - { - } - - /** - * Returns a String representation of this action that = can - * be written to the {@link RedoLog}. - * = - * @return a String representation of this action. - */ - @Override - public abstract String toString(); - - /** - * Parses an line in the redo log and created an {@link Action}. - * = - * @param line - * the line from the redo log. - * @return an Action. - * @throws IllegalArgumentException - * if the line is malformed. - */ - static Action fromString(String line) throws IllegalArgumentException - { - int endTransIdx =3D line.indexOf(' '); - if (endTransIdx =3D=3D -1) - { - throw new IllegalArgumentException(line); - } - long transactionId; - try - { - transactionId =3D Long.parseLong(line.substring(0, endTransIdx= )); - } - catch (NumberFormatException e) - { - throw new IllegalArgumentException(line); - } - int endActionIdx =3D line.indexOf(' ', endTransIdx + 1); - if (endActionIdx =3D=3D -1) - { - // action does not have arguments - endActionIdx =3D line.length(); - } - String actionLabel =3D line.substring(endTransIdx + 1, endActionI= dx); - String arguments =3D ""; - if (endActionIdx + 1 <=3D line.length()) - { - arguments =3D line.substring(endActionIdx + 1); - } - Action a; - if (actionLabel.equals(Action.ADD_NODE)) - { - a =3D AddNode_.fromString(transactionId, arguments); - } - else if (actionLabel.equals(Action.ADD_INDEX)) - { - a =3D AddIndex_.fromString(transactionId, arguments); - } - else if (actionLabel.equals(Action.COMMIT)) - { - a =3D Commit_.fromString(transactionId, arguments); - } - else if (actionLabel.equals(Action.CREATE_INDEX)) - { - a =3D CreateIndex_.fromString(transactionId, arguments); - } - else if (actionLabel.equals(Action.DELETE_INDEX)) - { - a =3D DeleteIndex_.fromString(transactionId, arguments); - } - else if (actionLabel.equals(Action.DELETE_NODE)) - { - a =3D DeleteNode_.fromString(transactionId, arguments); - } - else if (actionLabel.equals(Action.START)) - { - a =3D Start_.fromString(transactionId, arguments); - } - else if (actionLabel.equals(Action.VOLATILE_COMMIT)) - { - a =3D VolatileCommit_.fromString(transactionId, arguments); - } - else - { - throw new IllegalArgumentException(line); - } - return a; - } - } - - /** - * Adds an index to the MultiIndex's active persistent index list. - */ - private static class AddIndex_ extends Action - { - - /** - * The name of the index to add. - */ - private String indexName; - - /** - * Creates a new AddIndex action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param indexName - * the name of the index to add, or null if = an - * index with a new name should be created. - */ - AddIndex_(long transactionId, String indexName) - { - super(transactionId, Action.TYPE_ADD_INDEX); - this.indexName =3D indexName; - } - - /** - * Creates a new AddIndex action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * the name of the index to add. - * @return the AddIndex action. - * @throws IllegalArgumentException - * if the arguments are malformed. - */ - static AddIndex_ fromString(long transactionId, String arguments) - { - return new AddIndex_(transactionId, arguments); - } - - /** - * Adds a sub index to index. - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - PersistentIndex idx =3D index.getOrCreateIndex(indexName); - if (!index.indexNames.contains(indexName)) - { - index.indexNames.addName(indexName); - } - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - StringBuffer logLine =3D new StringBuffer(); - logLine.append(Long.toString(getTransactionId())); - logLine.append(' '); - logLine.append(Action.ADD_INDEX); - logLine.append(' '); - logLine.append(indexName); - return logLine.toString(); - } - } - - /** - * Adds a node to the index. - */ - private static class AddNode_ extends Action - { - - /** - * The maximum length of a AddNode String. - */ - private static final int ENTRY_LENGTH =3D - Long.toString(Long.MAX_VALUE).length() + Action.ADD_NODE.length()= + Constants.UUID_FORMATTED_LENGTH + 2; - - /** - * The uuid of the node to add. - */ - private final String uuid; - - /** - * The document to add to the index, or null if not - * available. - */ - private Document doc; - - /** - * Creates a new AddNode action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param uuid - * the uuid of the node to add. - */ - AddNode_(long transactionId, String uuid) - { - super(transactionId, Action.TYPE_ADD_NODE); - this.uuid =3D uuid; - } - - /** - * Creates a new AddNode action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param doc - * the document to add. - */ - AddNode_(long transactionId, Document doc) - { - this(transactionId, doc.get(FieldNames.UUID)); - this.doc =3D doc; - } - - /** - * Creates a new AddNode action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * the arguments to this action. The uuid of the node to = add - * @return the AddNode action. - * @throws IllegalArgumentException - * if the arguments are malformed. Not a UUID. - */ - static AddNode_ fromString(long transactionId, String arguments) thr= ows IllegalArgumentException - { - // simple length check - if (arguments.length() !=3D Constants.UUID_FORMATTED_LENGTH) - { - throw new IllegalArgumentException("arguments is not a uuid"); - } - return new AddNode_(transactionId, arguments); - } - - /** - * Adds a node to the index. - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - if (doc =3D=3D null) - { - try - { - doc =3D index.createDocument(uuid); - } - catch (RepositoryException e) - { - // node does not exist anymore - log.debug(e.getMessage()); - } - } - if (doc !=3D null) - { - index.volatileIndex.addDocuments(new Document[]{doc}); - } - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - StringBuffer logLine =3D new StringBuffer(ENTRY_LENGTH); - logLine.append(Long.toString(getTransactionId())); - logLine.append(' '); - logLine.append(Action.ADD_NODE); - logLine.append(' '); - logLine.append(uuid); - return logLine.toString(); - } - } - - /** - * Commits a transaction. - */ - private static class Commit_ extends Action - { - - /** - * Creates a new Commit action. - * = - * @param transactionId - * the id of the transaction that is committed. - */ - Commit_(long transactionId) - { - super(transactionId, Action.TYPE_COMMIT); - } - - /** - * Creates a new Commit action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * ignored by this method. - * @return the Commit action. - */ - static Commit_ fromString(long transactionId, String arguments) - { - return new Commit_(transactionId); - } - - /** - * Touches the last flush time (sets it to the current time). - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - index.lastFlushTime =3D System.currentTimeMillis(); - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - return Long.toString(getTransactionId()) + ' ' + Action.COMMIT; - } - } - - /** - * Creates an new sub index but does not add it to the active persistent - * index list. - */ - private static class CreateIndex_ extends Action - { - - /** - * The name of the index to add. - */ - private String indexName; - - /** - * Creates a new CreateIndex action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param indexName - * the name of the index to add, or null if = an - * index with a new name should be created. - */ - CreateIndex_(long transactionId, String indexName) - { - super(transactionId, Action.TYPE_CREATE_INDEX); - this.indexName =3D indexName; - } - - /** - * Creates a new CreateIndex action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * the name of the index to create. - * @return the AddIndex action. - * @throws IllegalArgumentException - * if the arguments are malformed. - */ - static CreateIndex_ fromString(long transactionId, String arguments) - { - // when created from String, this action is executed as redo acti= on - return new CreateIndex_(transactionId, arguments); - } - - /** - * Creates a new index. - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - PersistentIndex idx =3D index.getOrCreateIndex(indexName); - indexName =3D idx.getName(); - } - - /** - * @inheritDoc - */ - @Override - public void undo(MultiIndex index) throws IOException - { - if (index.hasIndex(indexName)) - { - PersistentIndex idx =3D index.getOrCreateIndex(indexName); - idx.close(); - index.deleteIndex(idx); - } - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - StringBuffer logLine =3D new StringBuffer(); - logLine.append(Long.toString(getTransactionId())); - logLine.append(' '); - logLine.append(Action.CREATE_INDEX); - logLine.append(' '); - logLine.append(indexName); - return logLine.toString(); - } - - /** - * Returns the index name that has been created. If this method is - * called before {@link #execute(MultiIndex)} it will return - * null. - * = - * @return the name of the index that has been created. - */ - String getIndexName() - { - return indexName; - } - } - - /** - * Closes and deletes an index that is no longer in use. - */ - private static class DeleteIndex_ extends Action - { - - /** - * The name of the index to add. - */ - private String indexName; - - /** - * Creates a new DeleteIndex action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param indexName - * the name of the index to delete. - */ - DeleteIndex_(long transactionId, String indexName) - { - super(transactionId, Action.TYPE_DELETE_INDEX); - this.indexName =3D indexName; - } - - /** - * Creates a new DeleteIndex action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * the name of the index to delete. - * @return the DeleteIndex action. - * @throws IllegalArgumentException - * if the arguments are malformed. - */ - static DeleteIndex_ fromString(long transactionId, String arguments) - { - return new DeleteIndex_(transactionId, arguments); - } - - /** - * Removes a sub index from index. - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - // get index if it exists - for (Iterator it =3D index.indexes.iterator(); it.hasNext();) - { - PersistentIndex idx =3D (PersistentIndex)it.next(); - if (idx.getName().equals(indexName)) - { - idx.close(); - index.deleteIndex(idx); - break; - } - } - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - StringBuffer logLine =3D new StringBuffer(); - logLine.append(Long.toString(getTransactionId())); - logLine.append(' '); - logLine.append(Action.DELETE_INDEX); - logLine.append(' '); - logLine.append(indexName); - return logLine.toString(); - } - } - - /** - * Deletes a node from the index. - */ - private static class DeleteNode_ extends Action - { - - /** - * The maximum length of a DeleteNode String. - */ - private static final int ENTRY_LENGTH =3D - Long.toString(Long.MAX_VALUE).length() + Action.DELETE_NODE.lengt= h() + Constants.UUID_FORMATTED_LENGTH + 2; - - /** - * The uuid of the node to remove. - */ - private final String uuid; - - /** - * Creates a new DeleteNode action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param uuid - * the uuid of the node to delete. - */ - DeleteNode_(long transactionId, String uuid) - { - super(transactionId, Action.TYPE_DELETE_NODE); - this.uuid =3D uuid; - } - - /** - * Creates a new DeleteNode action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * the uuid of the node to delete. - * @return the DeleteNode action. - * @throws IllegalArgumentException - * if the arguments are malformed. Not a UUID. - */ - static DeleteNode_ fromString(long transactionId, String arguments) - { - // simple length check - if (arguments.length() !=3D Constants.UUID_FORMATTED_LENGTH) - { - throw new IllegalArgumentException("arguments is not a uuid"); - } - return new DeleteNode_(transactionId, arguments); - } - - /** - * Deletes a node from the index. - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - String uuidString =3D uuid.toString(); - // check if indexing queue is still working on - // this node from a previous update - Document doc =3D index.indexingQueue.removeDocument(uuidString); - if (doc !=3D null) - { - Util.disposeDocument(doc); - } - Term idTerm =3D new Term(FieldNames.UUID, uuidString); - // if the document cannot be deleted from the volatile index - // delete it from one of the persistent indexes. - int num =3D index.volatileIndex.removeDocument(idTerm); - if (num =3D=3D 0) - { - for (int i =3D index.indexes.size() - 1; i >=3D 0; i--) - { - // only look in registered indexes - PersistentIndex idx =3D (PersistentIndex)index.indexes.get(= i); - if (index.indexNames.contains(idx.getName())) - { - num =3D idx.removeDocument(idTerm); - if (num > 0) - { - return; - } - } - } - } - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - StringBuffer logLine =3D new StringBuffer(ENTRY_LENGTH); - logLine.append(Long.toString(getTransactionId())); - logLine.append(' '); - logLine.append(Action.DELETE_NODE); - logLine.append(' '); - logLine.append(uuid); - return logLine.toString(); - } - } - - /** - * Starts a transaction. - */ - private static class Start_ extends Action - { - - /** - * Creates a new Start transaction action. - * = - * @param transactionId - * the id of the transaction that started. - */ - Start_(long transactionId) - { - super(transactionId, Action.TYPE_START); - } - - /** - * Creates a new Start action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * ignored by this method. - * @return the Start action. - */ - static Start_ fromString(long transactionId, String arguments) - { - return new Start_(transactionId); - } - - /** - * Sets the current transaction id on index. - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - index.currentTransactionId =3D getTransactionId(); - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - return Long.toString(getTransactionId()) + ' ' + Action.START; - } - } - - /** - * Commits the volatile index to disk. - */ - private static class VolatileCommit_ extends Action - { - - /** - * The name of the target index to commit to. - */ - private final String targetIndex; - - /** - * Creates a new VolatileCommit action. - * = - * @param transactionId - * the id of the transaction that executes this action. - */ - VolatileCommit_(long transactionId, String targetIndex) - { - super(transactionId, Action.TYPE_VOLATILE_COMMIT); - this.targetIndex =3D targetIndex; - } - - /** - * Creates a new VolatileCommit action. - * = - * @param transactionId - * the id of the transaction that executes this action. - * @param arguments - * ignored by this implementation. - * @return the VolatileCommit action. - */ - static VolatileCommit_ fromString(long transactionId, String argumen= ts) - { - return new VolatileCommit_(transactionId, arguments); - } - - /** - * Commits the volatile index to disk. - * = - * @inheritDoc - */ - @Override - public void execute(MultiIndex index) throws IOException - { - VolatileIndex volatileIndex =3D index.getVolatileIndex(); - PersistentIndex persistentIndex =3D index.getOrCreateIndex(target= Index); - persistentIndex.copyIndex(volatileIndex); - index.resetVolatileIndex(); - } - - /** - * @inheritDoc - */ - @Override - public String toString() - { - StringBuffer logLine =3D new StringBuffer(); - logLine.append(Long.toString(getTransactionId())); - logLine.append(' '); - logLine.append(Action.VOLATILE_COMMIT); - logLine.append(' '); - logLine.append(targetIndex); - return logLine.toString(); - } - } - - /** * @see org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListe= ner#onChangeMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode) */ public void onChangeMode(IndexerIoMode mode) @@ -2626,7 +1658,6 @@ // try to stop merger in safe way flushTask.cancel(); FLUSH_TIMER.purge(); - this.redoLog =3D null; } = /** @@ -2644,21 +1675,12 @@ releaseMultiReader(); } = - this.redoLog =3D new RedoLog(indexDir); - redoLogApplied =3D redoLog.hasEntries(); - - // run recovery - Recovery.run(this, redoLog); - // enqueue unused segments for deletion enqueueUnusedSegments(); attemptDelete(); = // now that we are ready, start index merger - if (redoLogApplied) - { - flush(); - } + flush(); = if (indexNames.size() > 0) { @@ -2749,4 +1771,10 @@ } } } + + @Deprecated + public boolean getRedoLogApplied() + { + return false; + } } Deleted: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exo= platform/services/jcr/impl/core/query/lucene/Recovery.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/Recovery.java 2010-10-08 12:39:11 U= TC (rev 3263) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/Recovery.java 2010-10-08 13:03:55 U= TC (rev 3264) @@ -1,203 +0,0 @@ -/* - * 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.lucene; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -/** - * Implements the recovery process. - */ -class Recovery -{ - - /** - * The logger instance for this class. - */ - private static final Logger log =3D LoggerFactory.getLogger("exo.jcr.co= mponent.core.Recovery"); - - /** - * The MultiIndex where to run the recovery on. - */ - private final MultiIndex index; - - /** - * The redo redoLog. - */ - private final RedoLog redoLog; - - /** - * The ids of the uncommitted transactions. Set of Integer objects. - */ - private final Set losers =3D new HashSet(); - - /** - * Creates a new Recovery instance. - * - * @param index the MultiIndex to recover. - * @param redoLog the redo redoLog. - */ - private Recovery(MultiIndex index, RedoLog redoLog) - { - this.index =3D index; - this.redoLog =3D redoLog; - } - - /** - * Runs a recovery on index if redoLog contai= ns - * log entries. - *

    - * If recovery succeeds the index is flushed and the redo = log - * is cleared. That is, the index is stable.
    - * If recovery fails an IOException is thrown, and the redo log will not - * be modified. The recovery process can then be executed again, after - * fixing the cause of the IOException (e.g. disk full). - * - * @param index the index to recover. - * @param redoLog the redo log. - * @throws IOException if the recovery fails. - */ - static void run(MultiIndex index, RedoLog redoLog) throws IOException - { - if (!redoLog.hasEntries()) - { - log.debug("RedoLog is empty, no recovery needed."); - return; - } - log.info("Found uncommitted redo log. Applying changes now..."); - Recovery r =3D new Recovery(index, redoLog); - r.run(); - log.info("Redo changes applied."); - } - - /** - * Runs the recovery process. - * - * @throws IOException if the recovery fails. - */ - private void run() throws IOException - { - List actions =3D redoLog.getActions(); - - // find loser transactions - for (Iterator it =3D actions.iterator(); it.hasNext();) - { - MultiIndex.Action a =3D (MultiIndex.Action)it.next(); - if (a.getType() =3D=3D MultiIndex.Action.TYPE_START) - { - losers.add(new Long(a.getTransactionId())); - } - else if (a.getType() =3D=3D MultiIndex.Action.TYPE_COMMIT) - { - losers.remove(new Long(a.getTransactionId())); - } - } - - // find last volatile commit without changes from a loser - int lastSafeVolatileCommit =3D -1; - Set transactionIds =3D new HashSet(); - for (int i =3D 0; i < actions.size(); i++) - { - MultiIndex.Action a =3D (MultiIndex.Action)actions.get(i); - if (a.getType() =3D=3D MultiIndex.Action.TYPE_COMMIT) - { - transactionIds.clear(); - } - else if (a.getType() =3D=3D MultiIndex.Action.TYPE_VOLATILE_COMMI= T) - { - transactionIds.retainAll(losers); - // check if transactionIds contains losers - if (transactionIds.size() > 0) - { - // found dirty volatile commit - break; - } - else - { - lastSafeVolatileCommit =3D i; - } - } - else - { - transactionIds.add(new Long(a.getTransactionId())); - } - } - - // delete dirty indexes - for (int i =3D lastSafeVolatileCommit + 1; i < actions.size(); i++) - { - MultiIndex.Action a =3D (MultiIndex.Action)actions.get(i); - if (a.getType() =3D=3D MultiIndex.Action.TYPE_CREATE_INDEX) - { - a.undo(index); - } - } - - // replay actions up to last safe volatile commit - // ignore add node actions, they are included in volatile commits - for (int i =3D 0; i < actions.size() && i <=3D lastSafeVolatileCommi= t; i++) - { - MultiIndex.Action a =3D (MultiIndex.Action)actions.get(i); - switch (a.getType()) - { - case MultiIndex.Action.TYPE_ADD_INDEX : - case MultiIndex.Action.TYPE_CREATE_INDEX : - case MultiIndex.Action.TYPE_DELETE_INDEX : - case MultiIndex.Action.TYPE_DELETE_NODE : - // ignore actions by the index merger. - // the previously created index of a merge has been - // deleted because it was considered dirty. - // we are conservative here and let the index merger do - // its work again. - if (a.getTransactionId() =3D=3D MultiIndex.Action.INTERNAL_= TRANS_REPL_INDEXES) - { - continue; - } - a.execute(index); - } - } - - // now replay the rest until we encounter a loser transaction - for (int i =3D lastSafeVolatileCommit + 1; i < actions.size(); i++) - { - MultiIndex.Action a =3D (MultiIndex.Action)actions.get(i); - if (losers.contains(new Long(a.getTransactionId()))) - { - break; - } - else - { - // ignore actions by the index merger. - if (a.getTransactionId() =3D=3D MultiIndex.Action.INTERNAL_TRA= NS_REPL_INDEXES) - { - continue; - } - a.execute(index); - } - } - - // now we are consistent again -> flush - index.flush(); - index.releaseMultiReader(); - } -} Deleted: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exo= platform/services/jcr/impl/core/query/lucene/RedoLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/RedoLog.java 2010-10-08 12:39:11 UT= C (rev 3263) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/RedoLog.java 2010-10-08 13:03:55 UT= C (rev 3264) @@ -1,291 +0,0 @@ -/* - * 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.lucene; - -import org.apache.lucene.store.Directory; -import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Index= InputStream; -import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Index= OutputStream; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.security.PrivilegedExceptionAction; -import java.util.ArrayList; -import java.util.List; - -/** - * Implements a redo log for changes that have not been committed to disk.= While - * nodes are added to and removed from the volatile index (held in memory)= a - * redo log is written to keep track of the changes. In case the Jackrabbit - * process terminates unexpected the redo log is applied when Jackrabbit is - * restarted the next time. - *

    - * This class is not thread-safe. - */ -class RedoLog -{ - - /** - * Logger instance for this class - */ - private static final Logger log =3D LoggerFactory.getLogger("exo.jcr.co= mponent.core.RedoLog"); - - /** - * Default name of the redo log file - */ - private static final String REDO_LOG =3D "redo.log"; - - /** - * Implements a {@link ActionCollector} that counts all entries and sets - * {@link #entryCount}. - */ - private final ActionCollector ENTRY_COUNTER =3D new ActionCollector() - { - public void collect(MultiIndex.Action a) - { - entryCount++; - } - }; - - /** - * The directory where the log file is stored. - */ - private final Directory dir; - - /** - * The number of log entries in the log file - */ - private int entryCount =3D 0; - - /** - * Writer to the log file - */ - private Writer out; - - /** - * Creates a new RedoLog instance, which stores its log in= the - * given directory. - * - * @param dir the directory where the redo log file is located. - * @throws IOException if an error occurs while reading the redo log. - */ - RedoLog(Directory dir) throws IOException - { - this.dir =3D dir; - read(ENTRY_COUNTER); - } - - /** - * Returns true if this redo log contains any entries, - * false otherwise. - * @return true if this redo log contains any entries, - * false otherwise. - */ - boolean hasEntries() - { - return entryCount > 0; - } - - /** - * Returns the number of entries in this redo log. - * @return the number of entries in this redo log. - */ - int getSize() - { - return entryCount; - } - - /** - * Returns a List with all {@link MultiIndex.Action} instances in the - * redo log. - * - * @return an List with all {@link MultiIndex.Action} instances in the - * redo log. - * @throws IOException if an error occurs while reading from the redo l= og. - */ - List getActions() throws IOException - { - final List actions =3D new ArrayList(); - read(new ActionCollector() - { - public void collect(MultiIndex.Action a) - { - actions.add(a); - } - }); - return actions; - } - - /** - * Appends an action to the log. - * - * @param action the action to append. - * @throws IOException if the node cannot be written to the redo - * log. - */ - void append(final MultiIndex.Action action) throws IOException - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - initOut(); - out.write(action.toString() + "\n"); - entryCount++; - return null; - } - }); - } - - /** - * Flushes all pending writes to the underlying file. - * @throws IOException if an error occurs while writing. - */ - void flush() throws IOException - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - if (out !=3D null) - { - out.flush(); - } - return null; - } - }); - } - - /** - * Clears the redo log. - * @throws IOException if the redo log cannot be cleared. - */ - void clear() throws IOException - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - if (out !=3D null) - { - out.close(); - out =3D null; - } - if (dir.fileExists(REDO_LOG)) - { - dir.deleteFile(REDO_LOG); - } - entryCount =3D 0; - return null; - } - }); - } - - /** - * Initializes the {@link #out} stream if it is not yet set. - * @throws IOException if an error occurs while creating the - * output stream. - */ - private void initOut() throws IOException - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - if (out =3D=3D null) - { - OutputStream os =3D new IndexOutputStream(dir.createOutput(= REDO_LOG)); - out =3D new BufferedWriter(new OutputStreamWriter(os)); - } - return null; - } - }); - } - - /** - * Reads the log file and calls back {@link RedoLog.ActionCollector}. - * - * @param collector called back for each {@link MultiIndex.Action} read. - * @throws IOException if an error occurs while reading from the - * log file. - */ - private void read(final ActionCollector collector) throws IOException - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - if (!dir.fileExists(REDO_LOG)) - { - return null; - } - InputStream in =3D new IndexInputStream(dir.openInput(REDO_LOG= )); - try - { - BufferedReader reader =3D new BufferedReader(new InputStrea= mReader(in)); - String line; - while ((line =3D reader.readLine()) !=3D null) - { - try - { - collector.collect(MultiIndex.Action.fromString(line)); - } - catch (IllegalArgumentException e) - { - log.warn("Malformed redo entry: " + e.getMessage()); - } - } - } - finally - { - if (in !=3D null) - { - try - { - in.close(); - } - catch (IOException e) - { - log.warn("Exception while closing redo log: " + e.toS= tring()); - } - } - } - return null; - } - }); - } - - //-----------------------< internal >----------------------------------= ----- - - /** - * Helper interface to collect Actions read from the redo log. - */ - interface ActionCollector - { - - /** Called when an action is created */ - void collect(MultiIndex.Action action); - } -} --===============7349350063708105368==-- From do-not-reply at jboss.org Fri Oct 8 10:40:50 2010 Content-Type: multipart/mixed; boundary="===============1473433891670044966==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3265 - kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/utils. Date: Fri, 08 Oct 2010 10:40:49 -0400 Message-ID: <201010081440.o98Een9s018726@svn01.web.mwc.hst.phx2.redhat.com> --===============1473433891670044966== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-08 10:40:49 -0400 (Fri, 08 Oct 2010) New Revision: 3265 Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/MapResourceBundle.java Log: EXOJCR-996: Merge performance improvements Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/utils/MapResourceBundle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/MapResourceBundle.java 2010-10-08 13:03:55 UTC (rev 3264) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/MapResourceBundle.java 2010-10-08 14:40:49 UTC (rev 3265) @@ -1,181 +1,183 @@ -/* - * 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.commons.utils; - -import java.io.Serializable; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Locale; -import java.util.Map; -import java.util.ResourceBundle; -import java.util.Set; -import java.util.Vector; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * @author Benjamin Mestrallet benjamin.mestrallet(a)exoplatform.com - */ -public class MapResourceBundle extends ResourceBundle implements Serializa= ble -{ - - /** - * The serial version UID - */ - private static final long serialVersionUID =3D -7020823660841958748L; - - private final static String REGEXP =3D "#\\{.*\\}"; - - private Map props =3D new HashMap(); - - private Locale locale; - - public MapResourceBundle(Locale l) - { - this.locale =3D l; - } - - public MapResourceBundle(ResourceBundle rB, Locale l) - { - this.locale =3D l; - initMap(rB); - } - - private void initMap(ResourceBundle rB) - { - Enumeration e =3D rB.getKeys(); - while (e.hasMoreElements()) - { - String s =3D (String)e.nextElement(); - try - { - if (props.get(s) =3D=3D null) - { - String[] newArray =3D rB.getStringArray(s); - props.put(s, newArray); - } - } - catch (ClassCastException ex) - { - props.put(s, rB.getObject(s)); - } - } - } - - protected Object handleGetObject(String key) - { - return props.get(key); - } - - public Enumeration getKeys() - { - return new Vector(props.keySet()).elements(); - } - - public Locale getLocale() - { - return this.locale; - } - - public void add(String key, Object value) - { - props.put(key, value); - } - - public void remove(String key) - { - props.remove(key); - } - - public void merge(ResourceBundle bundle) - { - Enumeration e =3D bundle.getKeys(); - while (e.hasMoreElements()) - { - String s =3D (String)e.nextElement(); - Object value =3D bundle.getObject(s); - try - { - String[] newArray =3D bundle.getStringArray(s); - if (props.get(s) =3D=3D null) - { - props.put(s, newArray); - } - } - catch (ClassCastException ex) - { - props.put(s, value); - } - } - } - - public void resolveDependencies() - { - Map tempMap =3D new HashMap(props); - Set keys =3D tempMap.keySet(); - Pattern pattern =3D Pattern.compile(REGEXP); - for (Iterator iter =3D keys.iterator(); iter.hasNext();) - { - String element =3D (String)iter.next(); - String value =3D lookupKey(tempMap, element, pattern, new HashSet= ()); - tempMap.put(element, value); - } - props =3D tempMap; - } - - private String lookupKey(Map props, String key, Pattern pattern, Set callStack) - { - String s =3D (String)props.get(key); - if (s =3D=3D null || callStack.contains(key)) - { - // The value cannot be found or it has already been asked which m= eans that - // a loop has been detected - return key; - } - callStack.add(key); - Matcher matcher =3D pattern.matcher(s); - if (matcher.find()) - { - return recursivedResolving(props, s, pattern, callStack); - } - // The value could be resolved thus it can be removed from the callS= tack - callStack.remove(key); - return s; - } - - private String recursivedResolving(Map props, String value, Pattern pat= tern, Set callStack) - { - String resolved =3D value; - StringBuilder sB =3D new StringBuilder(); - while (resolved.indexOf("#{") !=3D -1) - { - sB.setLength(0); - int firstIndex =3D resolved.indexOf('#'); - int lastIndex =3D resolved.indexOf('}', firstIndex); - String realKey =3D resolved.substring(firstIndex + 2, lastIndex); - sB.append(resolved.substring(0, firstIndex)); - sB.append(lookupKey(props, realKey, pattern, callStack)); - sB.append(resolved.substring(lastIndex + 1)); - resolved =3D sB.toString(); - } - return resolved; - } -} +/* + * 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.commons.utils; + +import java.io.Serializable; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author Benjamin Mestrallet benjamin.mestrallet(a)exoplatform.com + */ +public class MapResourceBundle extends ResourceBundle implements Serializa= ble +{ + + /** + * The serial version UID + */ + private static final long serialVersionUID =3D -7020823660841958748L; + + private final static Pattern PATTERN =3D Pattern.compile("#\\{.*\\}"); + + private Map props; + + private Locale locale; + + public MapResourceBundle(Locale l) + { + this.locale =3D l; + this.props =3D new HashMap(); + } + + public MapResourceBundle(ResourceBundle rB, Locale l) + { + Map props =3D new HashMap(); + doMerge(props, rB); + + // + this.locale =3D l; + this.props =3D props; + } + + private static void doMerge(Map props, ResourceBundle r= B) + { + Enumeration e =3D rB.getKeys(); + while (e.hasMoreElements()) + { + String key =3D e.nextElement(); + if (props.get(key) =3D=3D null) + { + Object o =3D rB.getObject(key); + if (o instanceof String) + { + String value =3D (String)o; + props.put(key.intern(), value.intern()); + } + } + } + } + + protected Object handleGetObject(String key) + { + return props.get(key); + } + + public Enumeration getKeys() + { + final Iterator i =3D props.keySet().iterator(); + return new Enumeration() + { + public boolean hasMoreElements() + { + return i.hasNext(); + } + public String nextElement() + { + return i.next(); + } + }; + } + + public Locale getLocale() + { + return this.locale; + } + + public void add(String key, Object o) + { + if (key !=3D null && o instanceof String) + { + String value =3D (String)o; + props.put(key.intern(), value.intern()); + } + } + + public void remove(String key) + { + if (key !=3D null) + { + props.remove(key); + } + } + + public void merge(ResourceBundle bundle) + { + doMerge(props, bundle); + } + + public void resolveDependencies() + { + Map tempMap =3D new HashMap(props); + for (String element : props.keySet()) + { + String value =3D lookupKey(tempMap, element, new HashSet(= )); + if (value !=3D null) + { + tempMap.put(element.intern(), value.intern()); + } + } + props =3D tempMap; + } + + private String lookupKey(Map props, String key, Set callStack) + { + String s =3D props.get(key); + if (s =3D=3D null || callStack.contains(key)) + { + // The value cannot be found or it has already been asked which m= eans that + // a loop has been detected + return key; + } + callStack.add(key); + Matcher matcher =3D PATTERN.matcher(s); + if (matcher.find()) + { + return recursivedResolving(props, s, callStack); + } + // The value could be resolved thus it can be removed from the callS= tack + callStack.remove(key); + return s; + } + + private String recursivedResolving(Map props, String value, Set= callStack) + { + String resolved =3D value; + StringBuilder sB =3D new StringBuilder(); + while (resolved.indexOf("#{") !=3D -1) + { + sB.setLength(0); + int firstIndex =3D resolved.indexOf('#'); + int lastIndex =3D resolved.indexOf('}', firstIndex); + String realKey =3D resolved.substring(firstIndex + 2, lastIndex); + sB.append(resolved.substring(0, firstIndex)); + sB.append(lookupKey(props, realKey, callStack)); + sB.append(resolved.substring(lastIndex + 1)); + resolved =3D sB.toString(); + } + return resolved; + } +} --===============1473433891670044966==-- From do-not-reply at jboss.org Fri Oct 8 11:24:49 2010 Content-Type: multipart/mixed; boundary="===============0272578606694077470==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3266 - in kernel/trunk/exo.kernel.component.common/src: main/java/org/exoplatform/services/rpc/impl and 1 other directories. Date: Fri, 08 Oct 2010 11:24:49 -0400 Message-ID: <201010081524.o98FOn6S027057@svn01.web.mwc.hst.phx2.redhat.com> --===============0272578606694077470== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-08 11:24:49 -0400 (Fri, 08 Oct 2010) New Revision: 3266 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/RPCService.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/impl/RPCServiceImpl.java kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/rpc/impl/TestRPCServiceImpl.java Log: EXOJCR-967: The method isCoordinator has been added Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/RPCService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/RPCService.java 2010-10-08 14:40:49 UTC (rev 3265) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/RPCService.java 2010-10-08 15:24:49 UTC (rev 3266) @@ -124,4 +124,11 @@ * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION */ void unregisterCommand(RemoteCommand command) throws SecurityException; + = + /** + * Indicates whether the local node is the coordinator of the cluster + * @return true if the coordinator is the coordinator, false otherwise + * throws RPCException in case the {@link RPCService} is in an illegal = state + */ + boolean isCoordinator() throws RPCException; = } \ No newline at end of file Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/impl/RPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/impl/RPCServiceImpl.java 2010-10-08 14:40:49 UTC (rev 3265) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/impl/RPCServiceImpl.java 2010-10-08 15:24:49 UTC (rev 3266) @@ -130,6 +130,11 @@ protected volatile Address coordinator; = /** + * Indicates whether the current node is the coordinator of the cluster= or not + */ + protected volatile boolean isCoordinator; + = + /** * The default value of the timeout */ private long defaultTimeout =3D DEFAULT_TIMEOUT; @@ -430,6 +435,7 @@ { this.members =3D view.getMembers(); this.coordinator =3D members !=3D null && members.size() > 0 ? membe= rs.get(0) : null; + this.isCoordinator =3D coordinator !=3D null && coordinator.equals(c= hannel.getLocalAddress()); } = /** @@ -498,6 +504,19 @@ } = /** + * {@inheritDoc} + */ + public boolean isCoordinator() throws RPCException + { + if (state !=3D State.STARTED) + { + throw new RPCException("Cannot know whether the local node is a c= oordinator or not if " + + "the service is not started, the current state of the service i= s " + state); + } + return isCoordinator; + } + + /** * Gives the {@link RemoteCommand} corresponding to the given id * @param commandId the command id of the command to retrieve * @return the corresponding {@link RemoteCommand} @@ -553,6 +572,7 @@ security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); } this.state =3D State.STOPPED; + this.isCoordinator =3D false; if (channel !=3D null && channel.isOpen()) { if (LOG.isInfoEnabled()) Modified: kernel/trunk/exo.kernel.component.common/src/test/java/org/exopla= tform/services/rpc/impl/TestRPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-08 14:40:49 UTC (rev 3265) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-08 15:24:49 UTC (rev 3266) @@ -221,7 +221,17 @@ { // OK } + try + { + service.isCoordinator(); + fail("We expect a RPCException since the current state is not = the expected one"); + } + catch (RPCException e) + { + // OK + } service.start(); + assertEquals(true, service.isCoordinator()); service.executeCommandOnAllNodes(foo, true); service.executeCommandOnAllNodes(foo, 10); service.executeCommandOnCoordinator(foo, true); @@ -668,6 +678,8 @@ service2.registerCommand(LongTask); = service1.start(); service2.start(); + assertEquals(true, service1.isCoordinator()); + assertEquals(false, service2.isCoordinator()); List result; Object o; result =3D service1.executeCommandOnAllNodes(CmdUnknownOnNode2, t= rue); @@ -739,6 +751,16 @@ assertNotNull(result); assertTrue(result.size() =3D=3D 1); assertTrue("We expect an RPCException due to a member that has le= ft", result.get(0) instanceof MemberHasLeftException); + try + { + service1.isCoordinator(); + fail("We expect a RPCException since the current state is not = the expected one"); + } + catch (RPCException e) + { + // OK + } + assertEquals(true, service2.isCoordinator()); = } finally { --===============0272578606694077470==-- From do-not-reply at jboss.org Fri Oct 8 15:42:07 2010 Content-Type: multipart/mixed; boundary="===============9047510335307984095==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3267 - kernel/branches/2.2.x. Date: Fri, 08 Oct 2010 15:42:06 -0400 Message-ID: <201010081942.o98Jg6p8030224@svn01.web.mwc.hst.phx2.redhat.com> --===============9047510335307984095== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 15:42:06 -0400 (Fri, 08 Oct 2010) New Revision: 3267 Modified: kernel/branches/2.2.x/pom.xml Log: [maven-release-plugin] prepare branch 2.2.5-GA_REL Modified: kernel/branches/2.2.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/pom.xml 2010-10-08 15:24:49 UTC (rev 3266) +++ kernel/branches/2.2.x/pom.xml 2010-10-08 19:42:06 UTC (rev 3267) @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/br= anches/2.2.x/ - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/branches/2.2.x/ - http://fisheye.jboss.org/browse/exo-jcr/kernel/branches/2.2.x + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/br= anches/2.2.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/branches/2.2.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/kernel/branches/2.2.5-G= A_REL = --===============9047510335307984095==-- From do-not-reply at jboss.org Fri Oct 8 15:42:30 2010 Content-Type: multipart/mixed; boundary="===============0254982006854175668==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3268 - kernel/branches. Date: Fri, 08 Oct 2010 15:42:30 -0400 Message-ID: <201010081942.o98JgUQk030235@svn01.web.mwc.hst.phx2.redhat.com> --===============0254982006854175668== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 15:42:30 -0400 (Fri, 08 Oct 2010) New Revision: 3268 Added: kernel/branches/2.2.5-GA_REL/ Log: [maven-release-plugin] copy for branch 2.2.5-GA_REL Copied: kernel/branches/2.2.5-GA_REL (from rev 3267, kernel/branches/2.2.x) --===============0254982006854175668==-- From do-not-reply at jboss.org Fri Oct 8 15:43:00 2010 Content-Type: multipart/mixed; boundary="===============2341798383672823737==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3269 - in kernel/branches/2.2.x: exo.kernel.commons and 12 other directories. Date: Fri, 08 Oct 2010 15:43:00 -0400 Message-ID: <201010081943.o98Jh0qm030249@svn01.web.mwc.hst.phx2.redhat.com> --===============2341798383672823737== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 15:43:00 -0400 (Fri, 08 Oct 2010) New Revision: 3269 Modified: kernel/branches/2.2.x/exo.kernel.commons/pom.xml kernel/branches/2.2.x/exo.kernel.component.cache/pom.xml kernel/branches/2.2.x/exo.kernel.component.command/pom.xml kernel/branches/2.2.x/exo.kernel.component.common/pom.xml kernel/branches/2.2.x/exo.kernel.component.ext.cache.impl.jboss.v3/pom.x= ml kernel/branches/2.2.x/exo.kernel.component.remote/pom.xml kernel/branches/2.2.x/exo.kernel.container/pom.xml kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int-demo/p= om.xml kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int-tests/= pom.xml kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int/pom.xml kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-kernel-ext= ras/pom.xml kernel/branches/2.2.x/exo.kernel.mc-integration/pom.xml kernel/branches/2.2.x/packaging/module/pom.xml kernel/branches/2.2.x/pom.xml Log: [maven-release-plugin] prepare release 2.2.5-GA_REL Modified: kernel/branches/2.2.x/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/2.2.x/exo.kernel.commons/pom.xml 2010-10-08 19:42:30 UT= C (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.commons/pom.xml 2010-10-08 19:43:00 UT= C (rev 3269) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.commons Modified: kernel/branches/2.2.x/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/2.2.x/exo.kernel.component.cache/pom.xml 2010-10-08 19:= 42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.component.cache/pom.xml 2010-10-08 19:= 43:00 UTC (rev 3269) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.component.cache Modified: kernel/branches/2.2.x/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/2.2.x/exo.kernel.component.command/pom.xml 2010-10-08 1= 9:42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.component.command/pom.xml 2010-10-08 1= 9:43:00 UTC (rev 3269) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.component.command Modified: kernel/branches/2.2.x/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/2.2.x/exo.kernel.component.common/pom.xml 2010-10-08 19= :42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.component.common/pom.xml 2010-10-08 19= :43:00 UTC (rev 3269) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.component.common Modified: kernel/branches/2.2.x/exo.kernel.component.ext.cache.impl.jboss.v= 3/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.component.ext.cache.impl.jboss.v3/pom.= xml 2010-10-08 19:42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.component.ext.cache.impl.jboss.v3/pom.= xml 2010-10-08 19:43:00 UTC (rev 3269) @@ -23,7 +23,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT exo.kernel.component.ext.cache.impl.jboss.v3 eXo Kernel :: Cache Extension :: JBoss Cache Implementation Modified: kernel/branches/2.2.x/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/2.2.x/exo.kernel.component.remote/pom.xml 2010-10-08 19= :42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.component.remote/pom.xml 2010-10-08 19= :43:00 UTC (rev 3269) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.component.remote Modified: kernel/branches/2.2.x/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/2.2.x/exo.kernel.container/pom.xml 2010-10-08 19:42:30 = UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.container/pom.xml 2010-10-08 19:43:00 = UTC (rev 3269) @@ -12,7 +12,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT exo.kernel.container eXo Kernel :: Container Modified: kernel/branches/2.2.x/exo.kernel.mc-integration/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/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int/pom.x= ml 2010-10-08 19:42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int/pom.x= ml 2010-10-08 19:43:00 UTC (rev 3269) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-int Modified: kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int= -demo/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int-demo/= pom.xml 2010-10-08 19:42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int-demo/= pom.xml 2010-10-08 19:43:00 UTC (rev 3269) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-int-demo Modified: kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int= -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/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int-tests= /pom.xml 2010-10-08 19:42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-int-tests= /pom.xml 2010-10-08 19:43:00 UTC (rev 3269) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-int-tests Modified: kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-ker= nel-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/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-kernel-ex= tras/pom.xml 2010-10-08 19:42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.mc-integration/exo.kernel.mc-kernel-ex= tras/pom.xml 2010-10-08 19:43:00 UTC (rev 3269) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-kernel-extras Modified: kernel/branches/2.2.x/exo.kernel.mc-integration/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.mc-integration/pom.xml 2010-10-08 19:4= 2:30 UTC (rev 3268) +++ kernel/branches/2.2.x/exo.kernel.mc-integration/pom.xml 2010-10-08 19:4= 3:00 UTC (rev 3269) @@ -6,7 +6,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = mc-integration-parent Modified: kernel/branches/2.2.x/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/2.2.x/packaging/module/pom.xml 2010-10-08 19:42:30 UTC = (rev 3268) +++ kernel/branches/2.2.x/packaging/module/pom.xml 2010-10-08 19:43:00 UTC = (rev 3269) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = 4.0.0 Modified: kernel/branches/2.2.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/pom.xml 2010-10-08 19:42:30 UTC (rev 3268) +++ kernel/branches/2.2.x/pom.xml 2010-10-08 19:43:00 UTC (rev 3269) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT pom = eXo Kernel @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/br= anches/2.2.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/branches/2.2.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/kernel/branches/2.2.5-G= A_REL + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/br= anches/2.2.x/ + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/branches/2.2.x/ + http://fisheye.jboss.org/browse/exo-jcr/kernel/branches/2.2.x = --===============2341798383672823737==-- From do-not-reply at jboss.org Fri Oct 8 15:50:26 2010 Content-Type: multipart/mixed; boundary="===============6879309683414565188==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3270 - core/branches/2.3.x. Date: Fri, 08 Oct 2010 15:50:26 -0400 Message-ID: <201010081950.o98JoQCr030473@svn01.web.mwc.hst.phx2.redhat.com> --===============6879309683414565188== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 15:50:26 -0400 (Fri, 08 Oct 2010) New Revision: 3270 Modified: core/branches/2.3.x/pom.xml Log: [maven-release-plugin] prepare branch 2.3.5-GA_REL Modified: core/branches/2.3.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.x/pom.xml 2010-10-08 19:43:00 UTC (rev 3269) +++ core/branches/2.3.x/pom.xml 2010-10-08 19:50:26 UTC (rev 3270) @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/bran= ches/2.3.x/ - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/branches/2.3.x/ - http://fisheye.jboss.org/browse/exo-jcr/core/branches/2.3.x + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/bran= ches/2.3.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/branches/2.3.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/core/branches/2.3.5-GA_= REL = --===============6879309683414565188==-- From do-not-reply at jboss.org Fri Oct 8 15:50:50 2010 Content-Type: multipart/mixed; boundary="===============6156463827825876689==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3271 - core/branches. Date: Fri, 08 Oct 2010 15:50:49 -0400 Message-ID: <201010081950.o98JonaK030507@svn01.web.mwc.hst.phx2.redhat.com> --===============6156463827825876689== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 15:50:49 -0400 (Fri, 08 Oct 2010) New Revision: 3271 Added: core/branches/2.3.5-GA_REL/ Log: [maven-release-plugin] copy for branch 2.3.5-GA_REL Copied: core/branches/2.3.5-GA_REL (from rev 3270, core/branches/2.3.x) --===============6156463827825876689==-- From do-not-reply at jboss.org Fri Oct 8 15:51:17 2010 Content-Type: multipart/mixed; boundary="===============5477992474785377677==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3272 - in core/branches/2.3.x: exo.core.component.database and 10 other directories. Date: Fri, 08 Oct 2010 15:51:17 -0400 Message-ID: <201010081951.o98JpHZm030551@svn01.web.mwc.hst.phx2.redhat.com> --===============5477992474785377677== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 15:51:17 -0400 (Fri, 08 Oct 2010) New Revision: 3272 Modified: core/branches/2.3.x/exo.core.component.database/pom.xml core/branches/2.3.x/exo.core.component.document/pom.xml core/branches/2.3.x/exo.core.component.ldap/pom.xml core/branches/2.3.x/exo.core.component.organization.api/pom.xml core/branches/2.3.x/exo.core.component.organization.jdbc/pom.xml core/branches/2.3.x/exo.core.component.organization.ldap/pom.xml core/branches/2.3.x/exo.core.component.script.groovy/pom.xml core/branches/2.3.x/exo.core.component.security.core/pom.xml core/branches/2.3.x/exo.core.component.web.css/pom.xml core/branches/2.3.x/exo.core.component.xml-processing/pom.xml core/branches/2.3.x/packaging/module/pom.xml core/branches/2.3.x/pom.xml Log: [maven-release-plugin] prepare release 2.3.5-GA_REL Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.database/pom.xml 2010-10-08 19:5= 0:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.database/pom.xml 2010-10-08 19:5= 1:17 UTC (rev 3272) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = exo.core.component.database Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.document/pom.xml 2010-10-08 19:5= 0:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.document/pom.xml 2010-10-08 19:5= 1:17 UTC (rev 3272) @@ -14,7 +14,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT exo.core.component.document eXo Core :: Component :: Demo Service Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.ldap/pom.xml 2010-10-08 19:50:49= UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.ldap/pom.xml 2010-10-08 19:51:17= UTC (rev 3272) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = exo.core.component.ldap Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.organization.api/pom.xml 2010-10= -08 19:50:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.organization.api/pom.xml 2010-10= -08 19:51:17 UTC (rev 3272) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT exo.core.component.organization.api eXo Core :: Component :: Organization Service API Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.organization.jdbc/pom.xml 2010-1= 0-08 19:50:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.organization.jdbc/pom.xml 2010-1= 0-08 19:51:17 UTC (rev 3272) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = exo.core.component.organization.jdbc Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.organization.ldap/pom.xml 2010-1= 0-08 19:50:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.organization.ldap/pom.xml 2010-1= 0-08 19:51:17 UTC (rev 3272) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = exo.core.component.organization.ldap Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.script.groovy/pom.xml 2010-10-08= 19:50:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.script.groovy/pom.xml 2010-10-08= 19:51:17 UTC (rev 3272) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = exo.core.component.script.groovy Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.security.core/pom.xml 2010-10-08= 19:50:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.security.core/pom.xml 2010-10-08= 19:51:17 UTC (rev 3272) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = exo.core.component.security.core Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.web.css/pom.xml 2010-10-08 19:50= :49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.web.css/pom.xml 2010-10-08 19:51= :17 UTC (rev 3272) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = exo.core.component.web.css Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.xml-processing/pom.xml 2010-10-0= 8 19:50:49 UTC (rev 3271) +++ core/branches/2.3.x/exo.core.component.xml-processing/pom.xml 2010-10-0= 8 19:51:17 UTC (rev 3272) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT exo.core.component.xml-processing eXo Core :: Component :: XML Processing Service Modified: core/branches/2.3.x/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/branches/2.3.x/packaging/module/pom.xml 2010-10-08 19:50:49 UTC (r= ev 3271) +++ core/branches/2.3.x/packaging/module/pom.xml 2010-10-08 19:51:17 UTC (r= ev 3272) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = 4.0.0 @@ -18,13 +18,13 @@ = - org.exoplatform.coreexo= .core.component.database2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.ldap2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.security.core2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.3.5-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.database2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.ldap2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.security.core2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.3.6-GA-SNAPSHOT = Modified: core/branches/2.3.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.x/pom.xml 2010-10-08 19:50:49 UTC (rev 3271) +++ core/branches/2.3.x/pom.xml 2010-10-08 19:51:17 UTC (rev 3272) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/bran= ches/2.3.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/branches/2.3.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/core/branches/2.3.5-GA_= REL + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/bran= ches/2.3.x/ + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/branches/2.3.x/ + http://fisheye.jboss.org/browse/exo-jcr/core/branches/2.3.x = --===============5477992474785377677==-- From do-not-reply at jboss.org Fri Oct 8 15:55:59 2010 Content-Type: multipart/mixed; boundary="===============2840475882688687923==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3273 - in core/branches/2.3.x: exo.core.component.organization.api and 5 other directories. Date: Fri, 08 Oct 2010 15:55:59 -0400 Message-ID: <201010081955.o98Jtx08030656@svn01.web.mwc.hst.phx2.redhat.com> --===============2840475882688687923== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 15:55:58 -0400 (Fri, 08 Oct 2010) New Revision: 3273 Modified: core/branches/2.3.x/exo.core.component.organization.api/pom.xml core/branches/2.3.x/exo.core.component.organization.jdbc/pom.xml core/branches/2.3.x/exo.core.component.organization.ldap/pom.xml core/branches/2.3.x/exo.core.component.script.groovy/pom.xml core/branches/2.3.x/exo.core.component.security.core/pom.xml core/branches/2.3.x/exo.core.component.xml-processing/pom.xml core/branches/2.3.x/pom.xml Log: [EXOJCR-XXX] -mUpgrade to next SNAPSHOTs Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.organization.api/pom.xml 2010-10= -08 19:51:17 UTC (rev 3272) +++ core/branches/2.3.x/exo.core.component.organization.api/pom.xml 2010-10= -08 19:55:58 UTC (rev 3273) @@ -118,4 +118,4 @@ - \ No newline at end of file + Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.organization.jdbc/pom.xml 2010-1= 0-08 19:51:17 UTC (rev 3272) +++ core/branches/2.3.x/exo.core.component.organization.jdbc/pom.xml 2010-1= 0-08 19:55:58 UTC (rev 3273) @@ -117,4 +117,4 @@ = = - \ No newline at end of file + Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.organization.ldap/pom.xml 2010-1= 0-08 19:51:17 UTC (rev 3272) +++ core/branches/2.3.x/exo.core.component.organization.ldap/pom.xml 2010-1= 0-08 19:55:58 UTC (rev 3273) @@ -80,4 +80,4 @@ = - \ No newline at end of file + Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.script.groovy/pom.xml 2010-10-08= 19:51:17 UTC (rev 3272) +++ core/branches/2.3.x/exo.core.component.script.groovy/pom.xml 2010-10-08= 19:55:58 UTC (rev 3273) @@ -47,4 +47,4 @@ groovy-all - \ No newline at end of file + Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.security.core/pom.xml 2010-10-08= 19:51:17 UTC (rev 3272) +++ core/branches/2.3.x/exo.core.component.security.core/pom.xml 2010-10-08= 19:55:58 UTC (rev 3273) @@ -79,4 +79,4 @@ - \ No newline at end of file + Modified: core/branches/2.3.x/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/branches/2.3.x/exo.core.component.xml-processing/pom.xml 2010-10-0= 8 19:51:17 UTC (rev 3272) +++ core/branches/2.3.x/exo.core.component.xml-processing/pom.xml 2010-10-0= 8 19:55:58 UTC (rev 3273) @@ -98,4 +98,4 @@ - \ No newline at end of file + Modified: core/branches/2.3.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.x/pom.xml 2010-10-08 19:51:17 UTC (rev 3272) +++ core/branches/2.3.x/pom.xml 2010-10-08 19:55:58 UTC (rev 3273) @@ -39,7 +39,7 @@ 2.3 = 1.2.1-GA - 2.2.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT = --===============2840475882688687923==-- From do-not-reply at jboss.org Fri Oct 8 16:03:09 2010 Content-Type: multipart/mixed; boundary="===============5874194539584196142==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3274 - ws/branches/2.1.x. Date: Fri, 08 Oct 2010 16:03:09 -0400 Message-ID: <201010082003.o98K39Nx032113@svn01.web.mwc.hst.phx2.redhat.com> --===============5874194539584196142== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:03:08 -0400 (Fri, 08 Oct 2010) New Revision: 3274 Modified: ws/branches/2.1.x/pom.xml Log: [maven-release-plugin] prepare branch 2.1.5-GA_REL Modified: ws/branches/2.1.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.x/pom.xml 2010-10-08 19:55:58 UTC (rev 3273) +++ ws/branches/2.1.x/pom.xml 2010-10-08 20:03:08 UTC (rev 3274) @@ -35,9 +35,9 @@ eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branch= es/2.1.x/ - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= branches/2.1.x/ - http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.1.x + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branch= es/2.1.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= branches/2.1.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.1.5-GA_RE= L = --===============5874194539584196142==-- From do-not-reply at jboss.org Fri Oct 8 16:03:32 2010 Content-Type: multipart/mixed; boundary="===============2973809623795513574==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3275 - ws/branches. Date: Fri, 08 Oct 2010 16:03:31 -0400 Message-ID: <201010082003.o98K3V45005028@svn01.web.mwc.hst.phx2.redhat.com> --===============2973809623795513574== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:03:31 -0400 (Fri, 08 Oct 2010) New Revision: 3275 Added: ws/branches/2.1.5-GA_REL/ Log: [maven-release-plugin] copy for branch 2.1.5-GA_REL Copied: ws/branches/2.1.5-GA_REL (from rev 3274, ws/branches/2.1.x) --===============2973809623795513574==-- From do-not-reply at jboss.org Fri Oct 8 16:03:52 2010 Content-Type: multipart/mixed; boundary="===============8602905243578192571==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3276 - in ws/branches/2.1.x: exo.ws.commons and 6 other directories. Date: Fri, 08 Oct 2010 16:03:51 -0400 Message-ID: <201010082003.o98K3pJD005042@svn01.web.mwc.hst.phx2.redhat.com> --===============8602905243578192571== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:03:51 -0400 (Fri, 08 Oct 2010) New Revision: 3276 Modified: ws/branches/2.1.x/exo.ws.commons/pom.xml ws/branches/2.1.x/exo.ws.frameworks.json/pom.xml ws/branches/2.1.x/exo.ws.frameworks.servlet/pom.xml ws/branches/2.1.x/exo.ws.rest.core/pom.xml ws/branches/2.1.x/exo.ws.rest.ext/pom.xml ws/branches/2.1.x/exo.ws.testframework/pom.xml ws/branches/2.1.x/packaging/module/pom.xml ws/branches/2.1.x/pom.xml Log: [maven-release-plugin] prepare release 2.1.5-GA_REL Modified: ws/branches/2.1.x/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/branches/2.1.x/exo.ws.commons/pom.xml 2010-10-08 20:03:31 UTC (rev 3= 275) +++ ws/branches/2.1.x/exo.ws.commons/pom.xml 2010-10-08 20:03:51 UTC (rev 3= 276) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT = exo.ws.commons Modified: ws/branches/2.1.x/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/branches/2.1.x/exo.ws.frameworks.json/pom.xml 2010-10-08 20:03:31 UT= C (rev 3275) +++ ws/branches/2.1.x/exo.ws.frameworks.json/pom.xml 2010-10-08 20:03:51 UT= C (rev 3276) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT = exo.ws.frameworks.json Modified: ws/branches/2.1.x/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/branches/2.1.x/exo.ws.frameworks.servlet/pom.xml 2010-10-08 20:03:31= UTC (rev 3275) +++ ws/branches/2.1.x/exo.ws.frameworks.servlet/pom.xml 2010-10-08 20:03:51= UTC (rev 3276) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/branches/2.1.x/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/branches/2.1.x/exo.ws.rest.core/pom.xml 2010-10-08 20:03:31 UTC (rev= 3275) +++ ws/branches/2.1.x/exo.ws.rest.core/pom.xml 2010-10-08 20:03:51 UTC (rev= 3276) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT = exo.ws.rest.core Modified: ws/branches/2.1.x/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/branches/2.1.x/exo.ws.rest.ext/pom.xml 2010-10-08 20:03:31 UTC (rev = 3275) +++ ws/branches/2.1.x/exo.ws.rest.ext/pom.xml 2010-10-08 20:03:51 UTC (rev = 3276) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT = exo.ws.rest.ext Modified: ws/branches/2.1.x/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/branches/2.1.x/exo.ws.testframework/pom.xml 2010-10-08 20:03:31 UTC = (rev 3275) +++ ws/branches/2.1.x/exo.ws.testframework/pom.xml 2010-10-08 20:03:51 UTC = (rev 3276) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT = exo.ws.testframework Modified: ws/branches/2.1.x/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/branches/2.1.x/packaging/module/pom.xml 2010-10-08 20:03:31 UTC (rev= 3275) +++ ws/branches/2.1.x/packaging/module/pom.xml 2010-10-08 20:03:51 UTC (rev= 3276) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT = 4.0.0 Modified: ws/branches/2.1.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.x/pom.xml 2010-10-08 20:03:31 UTC (rev 3275) +++ ws/branches/2.1.x/pom.xml 2010-10-08 20:03:51 UTC (rev 3276) @@ -30,14 +30,14 @@ = org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT pom eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branch= es/2.1.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= branches/2.1.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.1.5-GA_RE= L + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branch= es/2.1.x/ + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= branches/2.1.x/ + http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.1.x = --===============8602905243578192571==-- From do-not-reply at jboss.org Fri Oct 8 16:04:08 2010 Content-Type: multipart/mixed; boundary="===============6638900977141697578==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3277 - in ws/branches/2.1.x: exo.ws.testframework and 1 other directory. Date: Fri, 08 Oct 2010 16:04:08 -0400 Message-ID: <201010082004.o98K48X4005052@svn01.web.mwc.hst.phx2.redhat.com> --===============6638900977141697578== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:04:07 -0400 (Fri, 08 Oct 2010) New Revision: 3277 Modified: ws/branches/2.1.x/exo.ws.testframework/pom.xml ws/branches/2.1.x/pom.xml Log: [EXOJCR-XXX] -mUpgrade to next SNAPSHOTs Modified: ws/branches/2.1.x/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/branches/2.1.x/exo.ws.testframework/pom.xml 2010-10-08 20:03:51 UTC = (rev 3276) +++ ws/branches/2.1.x/exo.ws.testframework/pom.xml 2010-10-08 20:04:07 UTC = (rev 3277) @@ -38,4 +38,4 @@ servlet-api - \ No newline at end of file + Modified: ws/branches/2.1.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.x/pom.xml 2010-10-08 20:03:51 UTC (rev 3276) +++ ws/branches/2.1.x/pom.xml 2010-10-08 20:04:07 UTC (rev 3277) @@ -44,8 +44,8 @@ exo-ws 2.1 = - 2.2.5-GA-SNAPSHOT - 2.3.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = --===============6638900977141697578==-- From do-not-reply at jboss.org Fri Oct 8 16:04:50 2010 Content-Type: multipart/mixed; boundary="===============5176665511446883108==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3278 - in jcr/branches/1.12.x: applications/exo.jcr.applications.tomcat and 1 other directory. Date: Fri, 08 Oct 2010 16:04:49 -0400 Message-ID: <201010082004.o98K4n9j005064@svn01.web.mwc.hst.phx2.redhat.com> --===============5176665511446883108== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:04:49 -0400 (Fri, 08 Oct 2010) New Revision: 3278 Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.xml jcr/branches/1.12.x/pom.xml Log: [maven-release-plugin] prepare branch 1.12.5-GA_REL Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.xml 20= 10-10-08 20:04:07 UTC (rev 3277) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.xml 20= 10-10-08 20:04:49 UTC (rev 3278) @@ -101,14 +101,14 @@ - + - + - + Modified: jcr/branches/1.12.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/pom.xml 2010-10-08 20:04:07 UTC (rev 3277) +++ jcr/branches/1.12.x/pom.xml 2010-10-08 20:04:49 UTC (rev 3278) @@ -34,9 +34,9 @@ eXo JCR = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.12.x/ - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.12.x/ - http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.12.x + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.12.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.12.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.12.5-GA_RE= L = --===============5176665511446883108==-- From do-not-reply at jboss.org Fri Oct 8 16:05:18 2010 Content-Type: multipart/mixed; boundary="===============2483555317606327097==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3279 - jcr/branches. Date: Fri, 08 Oct 2010 16:05:17 -0400 Message-ID: <201010082005.o98K5HU9005113@svn01.web.mwc.hst.phx2.redhat.com> --===============2483555317606327097== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:05:13 -0400 (Fri, 08 Oct 2010) New Revision: 3279 Added: jcr/branches/1.12.5-GA_REL/ Log: [maven-release-plugin] copy for branch 1.12.5-GA_REL Copied: jcr/branches/1.12.5-GA_REL (from rev 3278, jcr/branches/1.12.x) --===============2483555317606327097==-- From do-not-reply at jboss.org Fri Oct 8 16:06:09 2010 Content-Type: multipart/mixed; boundary="===============8445395669535017625==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3280 - in jcr/branches/1.12.x: applications and 23 other directories. Date: Fri, 08 Oct 2010 16:06:09 -0400 Message-ID: <201010082006.o98K69pf005187@svn01.web.mwc.hst.phx2.redhat.com> --===============8445395669535017625== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:06:07 -0400 (Fri, 08 Oct 2010) New Revision: 3280 Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/pom.= xml jcr/branches/1.12.x/applications/exo.jcr.applications.browser/pom.xml jcr/branches/1.12.x/applications/exo.jcr.applications.config/pom.xml jcr/branches/1.12.x/applications/exo.jcr.applications.fckeditor/pom.xml jcr/branches/1.12.x/applications/exo.jcr.applications.jboss/pom.xml jcr/branches/1.12.x/applications/exo.jcr.applications.jonas/pom.xml jcr/branches/1.12.x/applications/exo.jcr.applications.rest/pom.xml jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.xml jcr/branches/1.12.x/applications/exo.jcr.cluster.testclient/pom.xml jcr/branches/1.12.x/applications/exo.jcr.ear/pom.xml jcr/branches/1.12.x/applications/pom.xml jcr/branches/1.12.x/exo.jcr.component.core/pom.xml jcr/branches/1.12.x/exo.jcr.component.ext/pom.xml jcr/branches/1.12.x/exo.jcr.component.ftp/pom.xml jcr/branches/1.12.x/exo.jcr.component.statistics/pom.xml jcr/branches/1.12.x/exo.jcr.component.webdav/pom.xml jcr/branches/1.12.x/exo.jcr.connectors.localadapter/pom.xml jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/pom.xml jcr/branches/1.12.x/exo.jcr.docs/pom.xml jcr/branches/1.12.x/exo.jcr.framework.command/pom.xml jcr/branches/1.12.x/exo.jcr.framework.ftpclient/pom.xml jcr/branches/1.12.x/exo.jcr.framework.web/pom.xml jcr/branches/1.12.x/packaging/module/pom.xml jcr/branches/1.12.x/pom.xml Log: [maven-release-plugin] prepare release 1.12.5-GA_REL Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/pom= .xml 2010-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/pom= .xml 2010-10-08 20:06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.applications.backupconsole eXo JCR :: Applications :: Backup Console Modified: jcr/branches/1.12.x/applications/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/branches/1.12.x/applications/exo.jcr.applications.browser/pom.xml 2= 010-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.browser/pom.xml 2= 010-10-08 20:06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.applications.browser war Modified: jcr/branches/1.12.x/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.x/applications/exo.jcr.applications.config/pom.xml 20= 10-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.config/pom.xml 20= 10-10-08 20:06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.applications.config pom Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.fckeditor/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.fckeditor/pom.xml= 2010-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.fckeditor/pom.xml= 2010-10-08 20:06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.applications.fckeditor war Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.jboss/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 --- jcr/branches/1.12.x/applications/exo.jcr.applications.jboss/pom.xml 201= 0-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.jboss/pom.xml 201= 0-10-08 20:06:07 UTC (rev 3280) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT ear runtime Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.jonas/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 --- jcr/branches/1.12.x/applications/exo.jcr.applications.jonas/pom.xml 201= 0-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.jonas/pom.xml 201= 0-10-08 20:06:07 UTC (rev 3280) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT ear runtime Modified: jcr/branches/1.12.x/applications/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/branches/1.12.x/applications/exo.jcr.applications.rest/pom.xml 2010= -10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.rest/pom.xml 2010= -10-08 20:06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.applications.rest war Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.= xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.xml 20= 10-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.tomcat/pom.xml 20= 10-10-08 20:06:07 UTC (rev 3280) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.applications.config = Modified: jcr/branches/1.12.x/applications/exo.jcr.cluster.testclient/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 --- jcr/branches/1.12.x/applications/exo.jcr.cluster.testclient/pom.xml 201= 0-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.cluster.testclient/pom.xml 201= 0-10-08 20:06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.cluster.testclient eXo JCR :: Cluster :: Test Client Modified: jcr/branches/1.12.x/applications/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.x/applications/exo.jcr.ear/pom.xml 2010-10-08 20:05:1= 3 UTC (rev 3279) +++ jcr/branches/1.12.x/applications/exo.jcr.ear/pom.xml 2010-10-08 20:06:0= 7 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.ear ear Modified: jcr/branches/1.12.x/applications/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/pom.xml 2010-10-08 20:05:13 UTC (rev 3= 279) +++ jcr/branches/1.12.x/applications/pom.xml 2010-10-08 20:06:07 UTC (rev 3= 280) @@ -22,12 +22,12 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT = 4.0.0 jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT = eXo JCR :: Applications :: Reactor pom Modified: jcr/branches/1.12.x/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.x/exo.jcr.component.core/pom.xml 2010-10-08 20:05:13 = UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.component.core/pom.xml 2010-10-08 20:06:07 = UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.component.core eXo JCR :: Component :: Core Service Modified: jcr/branches/1.12.x/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.x/exo.jcr.component.ext/pom.xml 2010-10-08 20:05:13 U= TC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.component.ext/pom.xml 2010-10-08 20:06:07 U= TC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.component.ext eXo JCR :: Component :: Extension Service Modified: jcr/branches/1.12.x/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.x/exo.jcr.component.ftp/pom.xml 2010-10-08 20:05:13 U= TC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.component.ftp/pom.xml 2010-10-08 20:06:07 U= TC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.component.ftp eXo JCR :: Component :: FTP Service Modified: jcr/branches/1.12.x/exo.jcr.component.statistics/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.statistics/pom.xml 2010-10-08 20:= 05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.component.statistics/pom.xml 2010-10-08 20:= 06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.component.statistics eXo JCR :: Component :: Statistics Provider Modified: jcr/branches/1.12.x/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.x/exo.jcr.component.webdav/pom.xml 2010-10-08 20:05:1= 3 UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/pom.xml 2010-10-08 20:06:0= 7 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.component.webdav eXo JCR :: Component :: Webdav Service Modified: jcr/branches/1.12.x/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.x/exo.jcr.connectors.localadapter/pom.xml 2010-10-08 = 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.connectors.localadapter/pom.xml 2010-10-08 = 20:06:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.connectors.localadapter rar Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 2010= -10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 2010= -10-08 20:06:07 UTC (rev 3280) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs.developer - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2010-10= -08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2010-10= -08 20:06:07 UTC (rev 3280) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.x/exo.jcr.docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/pom.xml 2010-10-08 20:05:13 UTC (rev 3= 279) +++ jcr/branches/1.12.x/exo.jcr.docs/pom.xml 2010-10-08 20:06:07 UTC (rev 3= 280) @@ -22,7 +22,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.x/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.x/exo.jcr.framework.command/pom.xml 2010-10-08 20:05:= 13 UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.framework.command/pom.xml 2010-10-08 20:06:= 07 UTC (rev 3280) @@ -12,7 +12,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.framework.command eXo JCR :: Framework :: Command Modified: jcr/branches/1.12.x/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.x/exo.jcr.framework.ftpclient/pom.xml 2010-10-08 20:0= 5:13 UTC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.framework.ftpclient/pom.xml 2010-10-08 20:0= 6:07 UTC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.framework.ftpclient eXo JCR :: Framework :: FTP Client Modified: jcr/branches/1.12.x/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.x/exo.jcr.framework.web/pom.xml 2010-10-08 20:05:13 U= TC (rev 3279) +++ jcr/branches/1.12.x/exo.jcr.framework.web/pom.xml 2010-10-08 20:06:07 U= TC (rev 3280) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT exo.jcr.framework.web eXo JCR :: Framework :: Web Modified: jcr/branches/1.12.x/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.x/packaging/module/pom.xml 2010-10-08 20:05:13 UTC (r= ev 3279) +++ jcr/branches/1.12.x/packaging/module/pom.xml 2010-10-08 20:06:07 UTC (r= ev 3280) @@ -4,7 +4,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT jcr.packaging.module pom Modified: jcr/branches/1.12.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/pom.xml 2010-10-08 20:05:13 UTC (rev 3279) +++ jcr/branches/1.12.x/pom.xml 2010-10-08 20:06:07 UTC (rev 3280) @@ -29,14 +29,14 @@ = org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.6-GA-SNAPSHOT pom eXo JCR = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.12.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.12.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.12.5-GA_RE= L + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.12.x/ + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.12.x/ + http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.12.x = --===============8445395669535017625==-- From do-not-reply at jboss.org Fri Oct 8 16:06:42 2010 Content-Type: multipart/mixed; boundary="===============3592306656592063706==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3281 - in jcr/branches/1.12.x: exo.jcr.connectors.localadapter/src/main/rar/META-INF and 1 other directory. Date: Fri, 08 Oct 2010 16:06:42 -0400 Message-ID: <201010082006.o98K6g9R005217@svn01.web.mwc.hst.phx2.redhat.com> --===============3592306656592063706== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 16:06:42 -0400 (Fri, 08 Oct 2010) New Revision: 3281 Modified: jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-IN= F/ra.xml jcr/branches/1.12.x/pom.xml Log: [EXOJCR-XXX] -mUpgrade to next SNAPSHOTs Modified: jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/= META-INF/ra.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-I= NF/ra.xml 2010-10-08 20:06:07 UTC (rev 3280) +++ jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-I= NF/ra.xml 2010-10-08 20:06:42 UTC (rev 3281) @@ -25,7 +25,7 @@ JCR repository exoplatform - ${project.version} + 1.12.6-GA-SNAPSHOT false Modified: jcr/branches/1.12.x/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/pom.xml 2010-10-08 20:06:07 UTC (rev 3280) +++ jcr/branches/1.12.x/pom.xml 2010-10-08 20:06:42 UTC (rev 3281) @@ -42,9 +42,9 @@ exo-jcr 1.12 - 2.2.5-GA-SNAPSHOT - 2.3.5-GA-SNAPSHOT - 2.1.5-GA-SNAPSHOT + 2.2.6-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT 1 = --===============3592306656592063706==-- From do-not-reply at jboss.org Fri Oct 8 17:00:14 2010 Content-Type: multipart/mixed; boundary="===============2406233244890905445==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3282 - jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-INF. Date: Fri, 08 Oct 2010 17:00:14 -0400 Message-ID: <201010082100.o98L0EOU007265@svn01.web.mwc.hst.phx2.redhat.com> --===============2406233244890905445== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-08 17:00:13 -0400 (Fri, 08 Oct 2010) New Revision: 3282 Modified: jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-IN= F/ra.xml Log: version in ra.xml isn't hardcoded any more Modified: jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/= META-INF/ra.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-I= NF/ra.xml 2010-10-08 20:06:42 UTC (rev 3281) +++ jcr/branches/1.12.x/exo.jcr.connectors.localadapter/src/main/rar/META-I= NF/ra.xml 2010-10-08 21:00:13 UTC (rev 3282) @@ -25,7 +25,7 @@ JCR repository exoplatform - 1.12.6-GA-SNAPSHOT + ${project.version} false --===============2406233244890905445==-- From do-not-reply at jboss.org Mon Oct 11 05:42:24 2010 Content-Type: multipart/mixed; boundary="===============5146614592068154298==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3283 - in kernel/trunk/exo.kernel.component.common/src: main/java/org/exoplatform/services/rpc/impl and 1 other directories. Date: Mon, 11 Oct 2010 05:42:24 -0400 Message-ID: <201010110942.o9B9gOcU013925@svn01.web.mwc.hst.phx2.redhat.com> --===============5146614592068154298== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-11 05:42:23 -0400 (Mon, 11 Oct 2010) New Revision: 3283 Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/TopologyChangeEvent.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/TopologyChangeListener.java Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/RPCService.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/impl/RPCServiceImpl.java kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/rpc/impl/TestRPCServiceImpl.java Log: EXOJCR-967: We now allow to listen to any topology changes Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/RPCService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/RPCService.java 2010-10-08 21:00:13 UTC (rev 3282) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/RPCService.java 2010-10-11 09:42:23 UTC (rev 3283) @@ -130,5 +130,21 @@ * @return true if the coordinator is the coordinator, false otherwise * throws RPCException in case the {@link RPCService} is in an illegal = state */ - boolean isCoordinator() throws RPCException; = + boolean isCoordinator() throws RPCException; + = + /** + * Register a new {@link TopologyChangeListener} + * @param listener the listener to be registered + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + void registerTopologyChangeListener(TopologyChangeListener listener) th= rows SecurityException; + = + /** + * Unregister a {@link TopologyChangeListener} if it exists + * @param listener the listener to unregister + * @throws SecurityException if the {@link SecurityManager} is installe= d and the call method + * doesn't have the {@link RuntimePermission} ACCESS_RPC_SERVICE_= PERMISSION + */ + void unregisterTopologyChangeListener(TopologyChangeListener listener) = throws SecurityException; } \ No newline at end of file Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/rpc/TopologyChangeEvent.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/TopologyChangeEvent.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/TopologyChangeEvent.java 2010-10-11 09:42:23 UTC (rev 3283) @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2010 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.rpc; + +/** + * The event triggered anytime the cluster has changed of topology + * @author Nicolas Fi= lotto + * @version $Id$ + * + */ +public class TopologyChangeEvent +{ + + /** + * Indicates whether the current node is the coordinator after this top= ology change + */ + private final boolean coordinator; + = + /** + * Indicates whether the coordinator has changed + */ + private final boolean coordinatorHasChanged; + + /** + * Default constructor + * @param coordinatorHasChanged this parameter is set to true if the = + * coordinator has changed, false otherwise + * @param coordinator this parameter is set to true if the= current node + * is the coordinator, false otherwise + */ + public TopologyChangeEvent(boolean coordinatorHasChanged, boolean coord= inator) + { + this.coordinator =3D coordinator; + this.coordinatorHasChanged =3D coordinatorHasChanged; + } + + /** + * Indicates whether the current node is the coordinator or not after t= he topology change + * @return true if the current node is the coordinator, false otherwise. + */ + public boolean isCoordinator() + { + return coordinator; + } + + /** + * Indicates whether the coordinator has changed after the topology cha= nge + * @return true if the coordinator has changed, fals= e otherwise. + */ + public boolean isCoordinatorHasChanged() + { + return coordinatorHasChanged; + } +} Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/rpc/TopologyChangeListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/TopologyChangeListener.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/TopologyChangeListener.java 2010-10-11 09:42:23 UTC (rev 3283) @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2010 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.rpc; + +/** + * This interface is used to allow some components to be notified anytime = the topology + * of the cluster changes, in other words any time a member of the cluste= r leave or join + * the cluster. + * = + * @author Nicolas Fi= lotto + * @version $Id$ + * + */ +public interface TopologyChangeListener +{ + + /** + * Called anytime the topology of the cluster changes + * @param event the event triggered when the topology changes + */ + void onChange(TopologyChangeEvent event); +} Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/impl/RPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/impl/RPCServiceImpl.java 2010-10-08 21:00:13 UTC (rev 3282) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/impl/RPCServiceImpl.java 2010-10-11 09:42:23 UTC (rev 3283) @@ -29,6 +29,8 @@ import org.exoplatform.services.rpc.RPCException; import org.exoplatform.services.rpc.RPCService; import org.exoplatform.services.rpc.RemoteCommand; +import org.exoplatform.services.rpc.TopologyChangeEvent; +import org.exoplatform.services.rpc.TopologyChangeListener; import org.jgroups.Address; import org.jgroups.Channel; import org.jgroups.ChannelException; @@ -61,6 +63,7 @@ import java.util.List; import java.util.Map; import java.util.Vector; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CountDownLatch; = /** @@ -103,7 +106,7 @@ * The default value of the cluster name */ public static final String CLUSTER_NAME =3D "RPCService-Cluster"; - + = /** * The configurator used to create the JGroups Channel */ @@ -151,6 +154,11 @@ * incoming messages. */ private final CountDownLatch startSignal =3D new CountDownLatch(1); + = + /** + * All the registered {@link TopologyChangeListener} + */ + private final List listeners =3D new CopyOnWrit= eArrayList(); = /** * Current State of the {@link RPCServiceImpl} @@ -434,11 +442,35 @@ public void viewAccepted(View view) { this.members =3D view.getMembers(); + Address currentCoordinator =3D coordinator; this.coordinator =3D members !=3D null && members.size() > 0 ? membe= rs.get(0) : null; this.isCoordinator =3D coordinator !=3D null && coordinator.equals(c= hannel.getLocalAddress()); + onTopologyChange(currentCoordinator !=3D null && !currentCoordinator= .equals(coordinator)); } = /** + * Called anytime the topology has changed, this method will notify all= the listeners + * currently registered + * @param coordinatorHasChanged this parameter is set to true if the = + * coordinator has changed, false otherwise + */ + private void onTopologyChange(boolean coordinatorHasChanged) + { + TopologyChangeEvent event =3D new TopologyChangeEvent(coordinatorHas= Changed, isCoordinator); + for (TopologyChangeListener listener : listeners) + { + try + { + listener.onChange(event); + } + catch (Exception e) + { + LOG.warn("An error occurs with the listener of type " + listen= er.getClass(), e); + } + } + } + + /** * {@inheritDoc} */ public synchronized RemoteCommand registerCommand(RemoteCommand command) @@ -517,6 +549,40 @@ } = /** + * {@inheritDoc} + */ + public void registerTopologyChangeListener(TopologyChangeListener liste= ner) throws SecurityException + { + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); + } + if (listener =3D=3D null) + { + return; + } + listeners.add(listener); = + } + + /** + * {@inheritDoc} + */ + public void unregisterTopologyChangeListener(TopologyChangeListener lis= tener) throws SecurityException + { + SecurityManager security =3D System.getSecurityManager(); + if (security !=3D null) + { + security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); + } + if (listener =3D=3D null) + { + return; + } + listeners.remove(listener); + } + + /** * Gives the {@link RemoteCommand} corresponding to the given id * @param commandId the command id of the command to retrieve * @return the corresponding {@link RemoteCommand} Modified: kernel/trunk/exo.kernel.component.common/src/test/java/org/exopla= tform/services/rpc/impl/TestRPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-08 21:00:13 UTC (rev 3282) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-11 09:42:23 UTC (rev 3283) @@ -25,6 +25,8 @@ import org.exoplatform.services.rpc.RPCException; import org.exoplatform.services.rpc.RemoteCommand; import org.exoplatform.services.rpc.SingleMethodCallCommand; +import org.exoplatform.services.rpc.TopologyChangeEvent; +import org.exoplatform.services.rpc.TopologyChangeListener; import org.exoplatform.services.rpc.impl.RPCServiceImpl.MemberHasLeftExcep= tion; import org.exoplatform.test.BasicTestCase; import org.jgroups.Address; @@ -519,7 +521,7 @@ paramConf.setName(RPCServiceImpl.PARAM_JGROUPS_CONFIG); paramConf.setValue("jar:/conf/portal/udp.xml"); = params.addParameter(paramConf); - RPCServiceImpl service1 =3D null, service2 =3D null; + RPCServiceImpl service1 =3D null, service2 =3D null; = try { service1 =3D new RPCServiceImpl(container.getContext(), params, c= onfigManager); @@ -591,7 +593,7 @@ = public String execute(Serializable[] args) throws Throwable { - Thread.sleep(30000); + Thread.sleep(3000); return "OldCoordinator"; } }); = @@ -675,9 +677,31 @@ return "NewCoordinator"; } }; - service2.registerCommand(LongTask); = + service2.registerCommand(LongTask); + MyListener listener1 =3D new MyListener(); + service1.registerTopologyChangeListener(listener1); + MyListener listener2 =3D new MyListener(); + service2.registerTopologyChangeListener(listener2); + assertFalse(listener1.coordinatorHasChanged); + assertFalse(listener1.isCoordinator); + assertEquals(0, listener1.count); + assertFalse(listener2.coordinatorHasChanged); + assertFalse(listener2.isCoordinator); + assertEquals(0, listener2.count); service1.start(); + assertFalse(listener1.coordinatorHasChanged); + assertTrue(listener1.isCoordinator); + assertEquals(1, listener1.count); + assertFalse(listener2.coordinatorHasChanged); + assertFalse(listener2.isCoordinator); + assertEquals(0, listener2.count); service2.start(); + assertFalse(listener1.coordinatorHasChanged); + assertTrue(listener1.isCoordinator); + assertEquals(2, listener1.count); + assertFalse(listener2.coordinatorHasChanged); + assertFalse(listener2.isCoordinator); + assertEquals(1, listener2.count); assertEquals(true, service1.isCoordinator()); assertEquals(false, service2.isCoordinator()); List result; @@ -740,6 +764,12 @@ }; t.start(); service1.stop(); + assertFalse(listener1.coordinatorHasChanged); + assertTrue(listener1.isCoordinator); + assertEquals(2, listener1.count); + assertTrue(listener2.coordinatorHasChanged); + assertTrue(listener2.isCoordinator); + assertEquals(2, listener2.count); = doneSignal.await(); assertNull(error.get() !=3D null ? error.get().getMessage() : "",= error.get()); result =3D service2.excecuteCommand(allMembers, OK, true, 0); @@ -1081,4 +1111,22 @@ return (short)(values[0] + 3); } } + = + private static class MyListener implements TopologyChangeListener + { + + private boolean coordinatorHasChanged; + private boolean isCoordinator; + private int count; + = + /** + * @see org.exoplatform.services.rpc.TopologyChangeListener#onChange= (org.exoplatform.services.rpc.TopologyChangeEvent) + */ + public void onChange(TopologyChangeEvent event) + { + this.coordinatorHasChanged =3D event.isCoordinatorHasChanged(); + this.isCoordinator =3D event.isCoordinator(); + count++; + } + } } --===============5146614592068154298==-- From do-not-reply at jboss.org Mon Oct 11 05:43:42 2010 Content-Type: multipart/mixed; boundary="===============2494281459706247785==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3284 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel. Date: Mon, 11 Oct 2010 05:43:42 -0400 Message-ID: <201010110943.o9B9hgDw013944@svn01.web.mwc.hst.phx2.redhat.com> --===============2494281459706247785== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-11 05:43:42 -0400 (Mon, 11 Oct 2010) New Revision: 3284 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/rpc-service.xml Log: EXOJCR-967: Doc about the TopologyChangeListener Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/rpc-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml 2010-10-11 09:42:23 UTC (rev 3283) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml 2010-10-11 09:43:42 UTC (rev 3284) @@ -18,12 +18,31 @@ something happened or to collect some information from the other nodes. = - The RPCService relies on 2 main interfaces - which are the org.exoplatform.services.rpc.RPCService - that defines the service itslef and the - org.exoplatform.services.rpc.RemoteCommand that - defines the command that we can execute on other nodes. The arguments = that - will be given to the RemoteCommand must be + The RPCService relies on 3 main interfaces + which are: + + + + The org.exoplatform.services.rpc.RPCService + that defines the service itslef + + + + The + org.exoplatform.services.rpc.RemoteCommand th= at + defines the command that we can execute on other nodes. + + + + The + org.exoplatform.services.rpc.TopologyChangeListener + that defines the listeners that will be notified anytime the topol= ogy + of the cluster changes. + + + + The arguments that will be given to the + RemoteCommand must be Serializable and its return type also in order to prevent any issue due to the serialization. To prevent to execute any RemoteCommand that could be malicious and to allo= w to --===============2494281459706247785==-- From do-not-reply at jboss.org Mon Oct 11 06:01:46 2010 Content-Type: multipart/mixed; boundary="===============4117267127722775311==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3285 - kernel/trunk/exo.kernel.component.common. Date: Mon, 11 Oct 2010 06:01:45 -0400 Message-ID: <201010111001.o9BA1jEX015224@svn01.web.mwc.hst.phx2.redhat.com> --===============4117267127722775311== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-11 06:01:45 -0400 (Mon, 11 Oct 2010) New Revision: 3285 Modified: kernel/trunk/exo.kernel.component.common/pom.xml Log: EXOJCR-967: Parameters for JGroups needed for some Linux Distributions adde= d to the pom 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 2010-10-11 09:43:42 UT= C (rev 3284) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2010-10-11 10:01:45 UT= C (rev 3285) @@ -104,6 +104,23 @@ org.apache.maven.plugins maven-surefire-plugin + + + + java.net.preferIPv4Stack + true + + + + bind.address + 127.0.0.1 + + + jgroups.stack + udp + + = **/TransactionTest.java --===============4117267127722775311==-- From do-not-reply at jboss.org Mon Oct 11 06:03:49 2010 Content-Type: multipart/mixed; boundary="===============1591286902293167009==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3286 - in jcr/trunk: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository and 1 other directories. Date: Mon, 11 Oct 2010 06:03:48 -0400 Message-ID: <201010111003.o9BA3m6R021056@svn01.web.mwc.hst.phx2.redhat.com> --===============1591286902293167009== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-11 06:03:48 -0400 (Mon, 11 Oct 2010) New Revision: 3286 Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/BackupClient.java jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/BackupClientImpl.java jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/BackupConsole.java jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/ClientTransportImpl.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/RestRepositoryService.java jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/backup-client.xml Log: EXOJCR-997: Whole Repository backup support in Backup Console tool Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/java/org/exoplatform/jcr/backupconsole/BackupClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupClient.java 2010-10-11 10:01:45 UT= C (rev 3285) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupClient.java 2010-10-11 10:03:48 UT= C (rev 3286) @@ -31,72 +31,108 @@ { = /** - * Start Backup. + * Start backup of repository or workspace. + * If workspaceName is 'null', then repository backup will be started. = * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @param backupDir path to backup folder on remote server. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name. + * @param workspaceName = + * String, the workspace name. + * @param backupDir = + * path to backup folder on remote server + * @return String = + * result + * @throws IOException = + * transport exception. + * @throws BackupExecuteException = + * backup client internal exception. */ String startBackUp(String repositoryName, String workspaceName, String = backupDir) throws IOException, BackupExecuteException; = /** - * Start Incremental Backup. + * Start Incremental Backup of repository or workspace. + * If workspaceName is 'null', then repository backup will be started. * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @param incr incemental job period. - * @param backupDir path to backup folder on remote server. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @param incr = + * incremental job period. + * @param backupDir = + * path to backup folder on remote server + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String startIncrementalBackUp(String repositoryName, String workspaceNa= me, String backupDir, long incr) throws IOException, BackupExecuteException; = /** - * Get Status. + * Get Status of backup. * = - * @param backupId the backup identifier. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param backupId = + * the backup identifier. + * @return String = + * result. + * @throws IOException = + * transport exception. + * @throws BackupExecuteException = + * backup client internal exception. */ String status(String backupId) throws IOException, BackupExecuteExcepti= on; = /** * Get information about backup service. * = - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String info() throws IOException, BackupExecuteException; = /** - * Get information about current restores. + * Get information about current restores of repository or workspace. + * If workspaceName is 'null', then will be get status of repository ba= ckup. * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String restores(String repositoryName, String workspaceName) throws IOE= xception, BackupExecuteException; = /** - * Restore repository from backup file. + * Restore repository or workspace from backup file. + * If workspaceName is 'null', then will be run restore of repository. * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @param backupId the backup identifier. - * @param config InputStream contains workspace configuration. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @param backupId = + * the backup identifier + * @param config = + * InputStream contains workspace configuration + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String restore(String repositoryName, String workspaceName, String back= upId, InputStream config) throws IOException, BackupExecuteException; @@ -104,22 +140,33 @@ /** * Stop backup. * = - * @param backupId the backup identifier. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param backupId = + * the backup identifier + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String stop(String backupId) throws IOException, BackupExecuteException; = /** - * Drop backup. + * Drop workspace or repository. + * If workspaceName is 'null', then repository will be dropped. * = - * @param forceClose force sessions close on droped workspace. - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param forceClose = + * force sessions close on repository or workspace + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String drop(boolean forceClose, String repositoryName, String workspace= Name) throws IOException, BackupExecuteException; @@ -127,18 +174,24 @@ /** * Get information about the current backups (in progress). * - * @return String result - * @throws IOException - * @throws BackupExecuteException + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String list() throws IOException, BackupExecuteException; = /** * Get information about the completed (ready to restore) backups. * - * @return String result - * @throws IOException - * @throws BackupExecuteException + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String listCompleted() throws IOException, BackupExecuteException; = Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-11 10:01:4= 5 UTC (rev 3285) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-11 10:03:4= 8 UTC (rev 3286) @@ -18,12 +18,22 @@ */ package org.exoplatform.jcr.backupconsole; = +import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; + +import javax.ws.rs.core.Response; + import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.RepositoryServiceConfiguration; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.ext.backup.BackupJob; import org.exoplatform.services.jcr.ext.backup.BackupManager; +import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain; +import org.exoplatform.services.jcr.ext.backup.impl.JobRepositoryRestore; import org.exoplatform.services.jcr.ext.backup.impl.JobWorkspaceRestore; import org.exoplatform.services.jcr.ext.backup.server.HTTPBackupAgent; import org.exoplatform.services.jcr.ext.backup.server.bean.BackupConfigBea= n; @@ -31,6 +41,7 @@ import org.exoplatform.services.jcr.ext.backup.server.bean.response.Detail= edInfo; import org.exoplatform.services.jcr.ext.backup.server.bean.response.ShortI= nfo; import org.exoplatform.services.jcr.ext.backup.server.bean.response.ShortI= nfoList; +import org.exoplatform.services.jcr.ext.repository.RestRepositoryService; import org.exoplatform.ws.frameworks.json.JsonHandler; import org.exoplatform.ws.frameworks.json.JsonParser; import org.exoplatform.ws.frameworks.json.impl.BeanBuilder; @@ -44,550 +55,1080 @@ import org.jibx.runtime.IUnmarshallingContext; import org.jibx.runtime.JiBXException; = -import java.io.ByteArrayInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -import javax.ws.rs.core.Response; - /** * Created by The eXo Platform SAS.
    Date: * = * @author Karpenko Sergiy * @version $Id: BackupClientImpl.java 111 2008-11-11 11:11:11Z serg $ */ -public class BackupClientImpl implements BackupClient { +public class BackupClientImpl + implements BackupClient +{ = - /** - * Block size. - */ - private static final int BLOCK_SIZE =3D 1024; + /** + * Block size. + */ + private static final int BLOCK_SIZE =3D 1024; = - /** - * Client transport. - */ - private ClientTransport transport; - = - /** - * The URL path. - */ - private final String path; + /** + * Client transport. + */ + private ClientTransport transport; = - /** - * User login. - */ - private final String userName; + /** + * The URL path. + */ + private final String path; = - /** - * User password. - */ - private final String pass; - = - /** - * Constructor. - * = - * @param transport ClientTransport implementation. - * @param login user login. - * @param pass user password. - */ - public BackupClientImpl(ClientTransport transport, String login, String = pass, String urlPath) { - this.transport =3D transport; - this.userName =3D login; - this.pass =3D pass; - = - if (urlPath =3D=3D null) - path =3D "/rest"; - else - path =3D urlPath; - } - = - /** - * {@inheritDoc} - */ - public String startBackUp(String repositoryName, String workspaceName, S= tring backupDir) throws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.START_BACKUP + - "/" + repositoryName + - "/" + workspaceName; + /** + * User login. + */ + private final String userName; = - BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL_BACK= UP_ONLY, - backupDir); - = - JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); - JsonValue json; - try { - json =3D generatorImpl.createJsonObject(bean); - } catch (JsonException e) { - throw new BackupExecuteException("Can not get json from : " + bean.= getClass().toString(), e); - } - = - BackupAgentResponse response =3D transport.executePOST(sURL, json.toS= tring()); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + /** + * User password. + */ + private final String pass; = - /** - * {@inheritDoc} - */ - public String startIncrementalBackUp(String repositoryName, String works= paceName, String backupDir, long incr) throws IOException, - = BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.START_BACKUP + - "/" + repositoryName + - "/" + workspaceName; + /** + * Constructor. + * = + * @param transport ClientTransport implementation. + * @param login user login. + * @param pass user password. + */ + public BackupClientImpl(ClientTransport transport, String login, String= pass, String urlPath) + { + this.transport =3D transport; + this.userName =3D login; + this.pass =3D pass; = - BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL_AND_= INCREMENTAL, - backupDir, - incr); - = - JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); - JsonValue json; - try { - json =3D generatorImpl.createJsonObject(bean); - } catch (JsonException e) { - throw new BackupExecuteException("Can not get json from : " + bean.= getClass().toString(), e); - } - = - BackupAgentResponse response =3D transport.executePOST(sURL, json.toS= tring()); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + if (urlPath =3D=3D null) + path =3D "/rest"; + else + path =3D urlPath; + } = - /** - * {@inheritDoc} - */ - public String status(String backupId) throws IOException, BackupExecuteE= xception { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.CURRENT_OR_COMPL= ETED_BACKUP_INFO + = - "/" + backupId; + /** + * {@inheritDoc} + */ + public String startBackUp(String repositoryName, String workspaceName, = String backupDir) throws IOException, + BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.START_BACKUP + + "/" + repositoryName + "/" + workspaceName; = - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - DetailedInfo info; - try { - info =3D (DetailedInfo) getObject(DetailedInfo.class, response.get= ResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get DetailedInfo from responc= e.", e); + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _BACKUP_ONLY, backupDir); + + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } } - = - if (info.getType() =3D=3D DetailedInfo.COMPLETED) { - String result =3D "\nThe completed (ready to restore) backup infor= mation : \n"; - = - BackupConfigBean configBean =3D info.getBackupConfig(); - = - result +=3D ("\t\tbackup id : " + info.getBackupId(= ) + "\n" = - + "\t\tbackup folder : " + configBean.getBacku= pDir() + "\n" = - + "\t\trepository name : " + info.getRepositoryN= ame() + "\n" - + "\t\tworkspace name : " + info.getWorkspaceNa= me() + "\n" - + "\t\tbackup type : " + (configBean.getBack= upType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : = "full only") + "\n" - + "\t\tstarted time : " + info.getStartedTime= () + "\n" - + (info.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + info.getFinishedTim= e() + "\n\n")); - = - return result; - } else { - String result =3D "\nThe current backup information : \n"; - = - BackupConfigBean configBean =3D info.getBackupConfig(); - = - result +=3D ("\t\tbackup id : " + info.getBackupId= () + "\n" = - + "\t\tbackup folder : " + configBean.getBack= upDir() + "\n" = - + "\t\trepository name : " + info.getRepository= Name() + "\n" - + "\t\tworkspace name : " + info.getWorkspaceN= ame() + "\n" - + "\t\tbackup type : " + (configBean.getBac= kupType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" := "full only") + "\n" - + "\t\tfull backup state : " + getState(info.getS= tate())) + "\n" - + (info.getBackupType() =3D=3D BackupManager.FULL_BACKUP= _ONLY ? "" : = - "\t\tincremental backup state : " + "working" + "\n") - + "\t\tstarted time : " + info.getStartedTim= e() + "\n" - + (info.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + info.getFinishedTi= me() + "\n\n"); - = - return result; + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.START= _BACKUP_REPOSITORY + "/" + repositoryName; + + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _BACKUP_ONLY, backupDir); + + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } } - } else { - return failureProcessing(response); - } - } + } = - /** - * {@inheritDoc} - */ - public String stop(String backupId) throws IOException, BackupExecuteExc= eption { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.STOP_BACKUP + = - "/" + backupId; + /** + * {@inheritDoc} + */ + public String startIncrementalBackUp(String repositoryName, String work= spaceName, String backupDir, long incr) + throws IOException, BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.START_BACKUP + + "/" + repositoryName + "/" + workspaceName; = - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _AND_INCREMENTAL, backupDir, incr); = - /** - * {@inheritDoc} - */ - public String restore(String repositoryName, String workspaceName, Strin= g backupId, InputStream config) throws IOException, - = BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.RESTORE + - "/" + repositoryName + - "/" + backupId; + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } = - = - WorkspaceEntry wEntry =3D null; - try { - wEntry =3D getWorkspaceEntry(config, repositoryName, workspaceName); - } catch (Throwable e) { - throw new BackupExecuteException("Can not get WorkspaceEntry for work= space '" + workspaceName + "' from config.", e); = - } - = - JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); - JsonValue json; - = - try { - json =3D generatorImpl.createJsonObject(wEntry); - } catch (JsonException e) { - throw new BackupExecuteException("Can not get json from : " + wEntr= y.getClass().toString(), e); - } - = - BackupAgentResponse response =3D transport.executePOST(sURL, json.toS= tring()); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } - } + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); = - /** - * {@inheritDoc} - */ - public String drop(boolean forceClose, String repositoryName, String wor= kspaceName) throws IOException, - BackupExecuteExce= ption { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.DROP_WORKSPACE + - "/" + repositoryName + - "/" + workspaceName + = - "/" + forceClose; + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.START= _BACKUP_REPOSITORY + "/" + repositoryName; = - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _AND_INCREMENTAL, backupDir, incr); = - /** - * {@inheritDoc} - */ - public String info() throws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackup= Agent.Constants.OperationType.BACKUP_SERVICE_INFO; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - BackupServiceInfoBean info; - try { - info =3D (BackupServiceInfoBean) getObject(BackupServiceInfoBean.c= lass, response.getResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get BackupServiceInfoBean fro= m responce.", e); + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } } - = - String result =3D "\nThe backup service information : \n" - + "\tfull backup type : " + info.getFu= llBackupType() + "\n" - + "\tincremetal backup type : " + info.getIn= crementalBackupType() + "\n" - + "\tbackup log folder : " + info.getBa= ckupLogDir() + "\n" - + "\tdefault incremental job period : " + info.getDe= faultIncrementalJobPeriod() + "\n\n"; - = - return result; - } else { - return failureProcessing(response); - } = - } = - /** - * {@inheritDoc} - */ - public String list() throws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackup= Agent.Constants.OperationType.CURRENT_BACKUPS_INFO; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - ShortInfoList infoList; - try { - infoList =3D (ShortInfoList) getObject(ShortInfoList.class, respon= se.getResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get ShortInfoList from respon= ce.", e); + } + + /** + * {@inheritDoc} + */ + public String status(String backupId) throws IOException, BackupExecute= Exception + { + + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRENT_= OR_COMPLETED_BACKUP_REPOSITORY_INFO + "/" + + backupId; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() !=3D Response.Status.OK.getStatusCode()) + { + + sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRE= NT_OR_COMPLETED_BACKUP_INFO + "/" + backupId; + + response =3D transport.executeGET(sURL); } - = - String result =3D "\nThe current backups information : \n"; - = - if (infoList.getBackups().size() =3D=3D 0) - result +=3D "\tNo active backups.\n\n"; - = - int count =3D 1; - for (ShortInfo shortInfo : infoList.getBackups()) { - result +=3D "\t" + count + ") Backup with id " + shortInfo.getBack= upId() + " :\n"; - = - result +=3D ("\t\trepository name : " + shortInfo.getRe= positoryName() + "\n" - + "\t\tworkspace name : " + shortInfo.getWork= spaceName() + "\n" - + "\t\tbackup type : " + (shortInfo.getBac= kupType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" := "full only") + "\n" = - + "\t\tfull backup state : " + getState(shortInf= o.getState())) + "\n" - + (shortInfo.getBackupType() =3D=3D BackupManager.FULL_B= ACKUP_ONLY ? "" : = - "\t\tincremental backup state : " + "working" + "\n") - + "\t\tstarted time : " + shortInfo.getStar= tedTime() + "\n" - + (shortInfo.getFinishedTime().equals("") ? "" : = - "\t\tfinished time : " + shortInfo.getFini= shedTime() + "\n"); - count++; - } = - = - return result; - } else { - return failureProcessing(response); - } - } = - /** - * {@inheritDoc} - */ - public String listCompleted() throws IOException, BackupExecuteException= { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackup= Agent.Constants.OperationType.COMPLETED_BACKUPS_INFO; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - ShortInfoList infoList; - try { - infoList =3D (ShortInfoList) getObject(ShortInfoList.class, respon= se.getResponseData()); - new String(response.getResponseData()); - } catch (Exception e) {e.printStackTrace(); - throw new RuntimeException("Can not get ShortInfoList from respon= ce.", e); + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) + { + DetailedInfo info; + try + { + info =3D (DetailedInfo) getObject(DetailedInfo.class, response= .getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get DetailedInfo from resp= once.", e); + } + + if (info.getType() =3D=3D DetailedInfo.COMPLETED) + { + String result =3D "\nThe completed (ready to restore) backup i= nformation : \n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup id : " + + info.getBackupId() + + "\n" + + "\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + (info.getWorkspaceName().equals("") ? "" := "\t\tworkspace name : " + + info.getWorkspaceName() + "\n") + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tstarte= d time : " + info.getStartedTime() + + "\n" + (info.getFinishedTime().equals("") = ? "\n" : "\t\tfinished time : " + + info.getFinishedTime() + "\n\n")); + + return result; + } + else + { + String result =3D "\nThe current backup information : \n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup id : " + + info.getBackupId() + + "\n" + + "\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + (info.getWorkspaceName().equals("") ? "" := "\t\tworkspace name : " + + info.getWorkspaceName() + "\n") + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tfull b= ackup state : " + getState(info + .getState())) + + "\n" + + (info.getBackupType() =3D=3D BackupManager= .FULL_BACKUP_ONLY ? "" + : "\t\tincremental backup state : "= + "working" + "\n") + + "\t\tstarted time : " + + info.getStartedTime() + + "\n" + + (info.getFinishedTime().equals("") ? "\n" = : "\t\tfinished time : " + + info.getFinishedTime() + "\n\n"); + + return result; + } } - = - String result =3D "\nThe completed (ready to restore) backups inform= ation : \n"; - = - if (infoList.getBackups().size() =3D=3D 0) - result +=3D "\tNo completed backups.\n\n"; - = - int count =3D 1; - for (ShortInfo shortInfo : infoList.getBackups()) { - result +=3D "\t" + count + ") Backup with id " + shortInfo.getBack= upId() + " :\n"; - = - result +=3D ("\t\trepository name : " + shortInfo.getRe= positoryName() + "\n" - + "\t\tworkspace name : " + shortInfo.getWork= spaceName() + "\n" - + "\t\tbackup type : " + (shortInfo.getBac= kupType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" := "full only") + "\n" = - + "\t\tstarted time : " + shortInfo.getStar= tedTime() + "\n" - + (shortInfo.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + shortInfo.getFini= shedTime() + "\n")); - count++; - } = - = - return result; - } else { - return failureProcessing(response); - } - } + else + { + return failureProcessing(response); + } + } = - /** - * {@inheritDoc} - */ - public String restores(String repositoryName, String workspaceName) thro= ws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.CURRENT_RESTORE_= INFO_ON_WS + - "/" + repositoryName + - "/" + workspaceName; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - DetailedInfo info; - try { - info =3D (DetailedInfo) getObject(DetailedInfo.class, response.get= ResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get DetailedInfo from responc= e.", e); + /** + * {@inheritDoc} + */ + public String stop(String backupId) throws IOException, BackupExecuteEx= ception + { + // first try to find current repository backup + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRENT_= BACKUPS_REPOSITORY_INFO; + + BackupAgentResponse repositoryResponse =3D transport.executeGET(sURL= ); + + if (repositoryResponse.getStatus() =3D=3D Response.Status.OK.getStat= usCode()) + { + ShortInfoList repositoryInfoList; + try + { + repositoryInfoList =3D (ShortInfoList) getObject(ShortInfoList= .class, repositoryResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + for (ShortInfo info : repositoryInfoList.getBackups()) + { + if (info.getBackupId().equals(backupId)) + { + // repository backup + sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType= .STOP_BACKUP_REPOSITORY + "/" + backupId; + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatu= sCode()) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + resp= onse.getStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } } - = - = - String result =3D "\nThe current restores information : \n"; - = - result +=3D "\tRestore with id " + info.getBackupId() + ":\n"; - = - BackupConfigBean configBean =3D info.getBackupConfig(); - = - result +=3D ("\t\tbackup folder : " + configBean.getBac= kupDir() + "\n" = - + "\t\trepository name : " + info.getRepositoryN= ame() + "\n" - + "\t\tworkspace name : " + info.getWorkspaceNa= me() + "\n" - + "\t\tbackup type : " + (configBean.getBack= upType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : = "full only") + "\n" - + "\t\trestore state : " + getRestoreState(in= fo.getState()) + "\n" - + "\t\tstarted time : " + info.getStartedTime= () + "\n" - + (info.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + info.getFinishedTim= e() + "\n\n")); - = - return result; - } else { - return failureProcessing(response); - } - } - = - = - /** - * Will be created the Object from JSON binary data. - * - * @param cl = - * Class - * @param data - * binary data (JSON) - * @return Object - * @throws Exception - * will be generated Exception - */ - private Object getObject(Class cl, byte[] data) throws Exception { = - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - JsonParser jsonParser =3D new JsonParserImpl(); - InputStream inputStream =3D new ByteArrayInputStream(data); - jsonParser.parse(inputStream, jsonHandler); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); = - return new BeanBuilder().createObject(cl, jsonValue); - } - = - = - private String getRestoreState(int restoreState) { - String state =3D "unknown sate of restore"; - = - switch (restoreState) { - case JobWorkspaceRestore.RESTORE_INITIALIZED: - state =3D "initialized"; - break; - = - case JobWorkspaceRestore.RESTORE_STARTED: - state =3D "started"; - break; - = - case JobWorkspaceRestore.RESTORE_SUCCESSFUL: - state =3D "successful"; - break; - = - case JobWorkspaceRestore.RESTORE_FAIL: - state =3D "fail"; - break; + // then try to find current workspace backup + sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.CURRENT_BACKUPS_INFO; = - default: - break; - } - = - return state; - } - = - /** - * getState. - * = - * @param state - * value of state - * @return String sate - */ - private String getState(int state) { - String st =3D ""; - switch (state) { + BackupAgentResponse workspaceResponse =3D transport.executeGET(sURL); + if (workspaceResponse.getStatus() =3D=3D Response.Status.OK.getStatu= sCode()) + { + ShortInfoList workspaceInfoList; + try + { + workspaceInfoList =3D (ShortInfoList) getObject(ShortInfoList.= class, workspaceResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } = - case BackupJob.FINISHED: - st =3D "finished"; - break; + for (ShortInfo info : workspaceInfoList.getBackups()) + { + if (info.getBackupId().equals(backupId)) + { + // workspace backup + sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBa= ckupAgent.Constants.OperationType.STOP_BACKUP + + "/" + backupId; = - case BackupJob.WORKING: - st =3D "working"; - break; + BackupAgentResponse response =3D transport.executeGET(sURL); = - case BackupJob.WAITING: - st =3D "waiting"; - break; + if (response.getStatus() =3D=3D Response.Status.OK.getStatu= sCode()) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + resp= onse.getStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } + } = - case BackupJob.STARTING: - st =3D "starting"; - break; - default: - break; - } + return "\nFailure :\n" + "\tmessage : There are no active backu= p with id " + backupId; + } = - return st; - } - = - /** - * failureProcessing. - * - * @param data - * response data - * @return String - * result - * @throws BackupExecuteException - * will be generated BackupExecuteException = - */ - private String failureProcessing(BackupAgentResponse response) throws Ba= ckupExecuteException { - try { - String result =3D "\nFailure :\n" - + "\tsatatus code : " + response.getStatus() + "\n" - + "\tmessage : " + new String(response.getRespo= nseData(), "UTF-8") + "\n\n"; - = - return result; - } catch (UnsupportedEncodingException e) { - throw new BackupExecuteException("Can not encoded the responce : " += e.getMessage(), e); - } - } - = - /** - * getWorkspaceEntry. - * - * @param wEntryStream - * InputStream, the workspace configuration - * @param workspaceName - * String, the workspace name = - * @return WorkspaceEntry - * return the workspace entry - * @throws FileNotFoundException - * will be generated the FileNotFoundException = - * @throws JiBXException - * will be generated the JiBXException = - * @throws RepositoryConfigurationException - * will be generated the RepositoryConfigurationException = - */ - private WorkspaceEntry getWorkspaceEntry(InputStream wEntryStream, Strin= g repositoryName, String workspaceName) throws FileNotFoundException, - = JiBXException, - = RepositoryConfigurationException { - WorkspaceEntry wsEntry =3D null; + /** + * {@inheritDoc} + */ + public String restore(String repositoryName, String workspaceName, Stri= ng backupId, InputStream config) + throws IOException, BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.RESTORE + "/" + + repositoryName + "/" + backupId; = - IBindingFactory factory =3D BindingDirectory.getFactory(RepositoryServ= iceConfiguration.class); - IUnmarshallingContext uctx =3D factory.createUnmarshallingContext(); - RepositoryServiceConfiguration conf =3D (RepositoryServiceConfiguratio= n) uctx.unmarshalDocument(wEntryStream, - = null); - RepositoryEntry rEntry =3D conf.getRepositoryConfiguration(repositoryN= ame); - = - for (WorkspaceEntry wEntry : rEntry.getWorkspaceEntries()) - if (wEntry.getName().equals(workspaceName)) - wsEntry =3D wEntry; - = + WorkspaceEntry wEntry =3D null; + try + { + wEntry =3D getWorkspaceEntry(config, repositoryName, workspace= Name); + } + catch (Throwable e) + { + throw new BackupExecuteException("Can not get WorkspaceEntry f= or workspace '" + workspaceName + + "' from config.", e); + } = - if (wsEntry =3D=3D null) - throw new RuntimeException("Can not find the workspace '" + workspac= eName - + "' in configuration."); + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; = - return wsEntry; - } + try + { + json =3D generatorImpl.createJsonObject(wEntry); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += wEntry.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.RESTO= RE_REPOSITORY + "/" + backupId; + + RepositoryEntry wEntry =3D null; + try + { + wEntry =3D getRepositoryEntry(config, repositoryName); + } + catch (Throwable e) + { + throw new BackupExecuteException("Can not get RepositoryEntry = for repository '" + repositoryName + + "' from config.", e); + } + + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + + try + { + json =3D generatorImpl.createJsonObject(wEntry); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += wEntry.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } + + /** + * {@inheritDoc} + */ + public String drop(boolean forceClose, String repositoryName, String wo= rkspaceName) throws IOException, + BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.DROP_WORKSPACE + + "/" + repositoryName + "/" + workspaceName + = "/" + forceClose; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + RestRepositoryService.Constants.BASE_URL + + RestRepositoryService.Constants.OperationType= .REMOVE_REPOSITORY + "/" + repositoryName + + "/" + forceClose; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } + + /** + * {@inheritDoc} + */ + public String info() throws IOException, BackupExecuteException + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.BACKUP_SERVICE_INFO; + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) + { + BackupServiceInfoBean info; + try + { + info =3D (BackupServiceInfoBean) getObject(BackupServiceInfoBe= an.class, response.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get BackupServiceInfoBean = from responce.", e); + } + + String result =3D + "\nThe backup service information : \n" + "\tfull backup= type : " + + info.getFullBackupType() + "\n" + "\tincremet= al backup type : " + + info.getIncrementalBackupType() + "\n" + "\tb= ackup log folder : " + + info.getBackupLogDir() + "\n" + "\tdefault in= cremental job period : " + + info.getDefaultIncrementalJobPeriod() + "\n\n= "; + + return result; + } + else + { + return failureProcessing(response); + } + } + + /** + * {@inheritDoc} + */ + public String list() throws IOException, BackupExecuteException + { + + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRENT_= BACKUPS_REPOSITORY_INFO; + BackupAgentResponse repositoryResponse =3D transport.executeGET(sURL= ); + + sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.CURRENT_BACKUPS_INFO; + BackupAgentResponse workspaceResponse =3D transport.executeGET(sURL); + + if ((repositoryResponse.getStatus() =3D=3D Response.Status.OK.getSta= tusCode()) + && (workspaceResponse.getStatus() =3D=3D Response.Status.OK= .getStatusCode())) + { + ShortInfoList repositoryInfoList; + try + { + repositoryInfoList =3D (ShortInfoList) getObject(ShortInfoList= .class, repositoryResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + ShortInfoList workspaceInfoList; + try + { + workspaceInfoList =3D (ShortInfoList) getObject(ShortInfoList.= class, workspaceResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + String result =3D "\nThe current backups information : \n"; + + if ((repositoryInfoList.getBackups().size() =3D=3D 0) && (workspa= ceInfoList.getBackups().size() =3D=3D 0)) + { + result +=3D "\tNo active backups.\n\n"; + } + + int count =3D 1; + for (ShortInfo shortInfo : repositoryInfoList.getBackups()) + { + result +=3D "\t" + count + ") Repository backup with id " + sh= ortInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tfull b= ackups state : " + getRepositoryBackupToFullState(shortInfo + .getState())) + + "\n" + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_BACKUP_ONLY ? "" + : "\t\tincremental backups state := " + "working" + "\n") + + "\t\tstarted time : " + + shortInfo.getStartedTime() + + "\n" + + (shortInfo.getFinishedTime().equals("") ? = "" : "\t\tfinished time : " + + shortInfo.getFinishedTime() + "\n= "); + count++; + } + + for (ShortInfo shortInfo : workspaceInfoList.getBackups()) + { + result +=3D "\t" + count + ") Workspace backup with id " + sho= rtInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tworkspace name : " + + shortInfo.getWorkspaceName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tfull b= ackup state : " + getState(shortInfo + .getState())) + + "\n" + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_BACKUP_ONLY ? "" + : "\t\tincremental backup state := " + "working" + "\n") + + "\t\tstarted time : " + + shortInfo.getStartedTime() + + "\n" + + (shortInfo.getFinishedTime().equals("") ? = "" : "\t\tfinished time : " + + shortInfo.getFinishedTime() + "\n= "); + count++; + } + + return result; + } + else + { + return failureProcessing(workspaceResponse); + } + } + + /** + * {@inheritDoc} + */ + public String listCompleted() throws IOException, BackupExecuteException + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.COMPLETE= D_BACKUPS_REPOSITORY_INFO; + BackupAgentResponse repositoryResponse =3D transport.executeGET(sURL= ); + + sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.COMPLETED_BACKUPS_INFO; + BackupAgentResponse workspaceResponse =3D transport.executeGET(sURL); + + if ((workspaceResponse.getStatus() =3D=3D Response.Status.OK.getStat= usCode()) + && (repositoryResponse.getStatus() =3D=3D Response.Status.O= K.getStatusCode())) + { + + ShortInfoList repositoryInfoList; + try + { + repositoryInfoList =3D (ShortInfoList) getObject(ShortInfoList= .class, repositoryResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + ShortInfoList workspaceInfoList; + try + { + workspaceInfoList =3D (ShortInfoList) getObject(ShortInfoList.= class, workspaceResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + String result =3D "\nThe completed (ready to restore) backups inf= ormation : \n"; + + if ((repositoryInfoList.getBackups().size() =3D=3D 0) && (workspa= ceInfoList.getBackups().size() =3D=3D 0)) + { + result +=3D "\tNo completed backups.\n\n"; + } + + int count =3D 1; + for (ShortInfo shortInfo : repositoryInfoList.getBackups()) + { + result +=3D "\t" + count + ") Repository backup with id " + sh= ortInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tstarte= d time : " + + shortInfo.getStartedTime() + "\n" + (short= Info.getFinishedTime().equals("") ? "\n" + : "\t\tfinished time : " + short= Info.getFinishedTime() + "\n")); + count++; + } + + for (ShortInfo shortInfo : workspaceInfoList.getBackups()) + { + result +=3D "\t" + count + ") Workspace backup with id " + sho= rtInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tworkspace name : " + + shortInfo.getWorkspaceName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tstarte= d time : " + + shortInfo.getStartedTime() + "\n" + (short= Info.getFinishedTime().equals("") ? "\n" + : "\t\tfinished time : " + short= Info.getFinishedTime() + "\n")); + count++; + } + + return result; + } + else + { + return failureProcessing(workspaceResponse); + } + } + + /** + * {@inheritDoc} + */ + public String restores(String repositoryName, String workspaceName) thr= ows IOException, BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRE= NT_RESTORE_INFO_ON_WS + "/" + repositoryName + + "/" + workspaceName; + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + DetailedInfo info; + try + { + info =3D (DetailedInfo) getObject(DetailedInfo.class, respo= nse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get DetailedInfo from r= esponce.", e); + } + + String result =3D "\nThe current restores information : \n"; + + result +=3D "\tWorkspace restore with id " + info.getBackupId(= ) + ":\n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + "\t\tworkspace name : " + + info.getWorkspaceName() + + "\n" + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\trestor= e state : " + + getRestoreState(info.getState()) + "\n" + = "\t\tstarted time : " + + info.getStartedTime() + "\n" + (info.getFi= nishedTime().equals("") ? "\n" + : "\t\tfinished time : " + info.ge= tFinishedTime() + "\n\n")); + + return result; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRE= NT_RESTORE_INFO_ON_REPOSITORY + "/" + + repositoryName; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + DetailedInfo info; + try + { + info =3D (DetailedInfo) getObject(DetailedInfo.class, respo= nse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get DetailedInfo from r= esponce.", e); + } + + String result =3D "\nThe current restores information : \n"; + + result +=3D "\tRepository restore with id " + info.getBackupId= () + ":\n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\trestor= e state : " + + getRepositoryRestoreState(info.getState())= + "\n" + "\t\tstarted time : " + + info.getStartedTime() + "\n" + (info.getFi= nishedTime().equals("") ? "\n" + : "\t\tfinished time : " + info.ge= tFinishedTime() + "\n\n")); + + return result; + } + else + { + return failureProcessing(response); + } + } + } + + /** + * Will be created the Object from JSON binary data. + * + * @param cl = + * Class + * @param data + * binary data (JSON) + * @return Object + * @throws Exception + * will be generated Exception + */ + private Object getObject(Class cl, byte[] data) throws Exception + { + JsonHandler jsonHandler =3D new JsonDefaultHandler(); + JsonParser jsonParser =3D new JsonParserImpl(); + InputStream inputStream =3D new ByteArrayInputStream(data); + jsonParser.parse(inputStream, jsonHandler); + JsonValue jsonValue =3D jsonHandler.getJsonObject(); + + return new BeanBuilder().createObject(cl, jsonValue); + } + + private String getRestoreState(int restoreState) + { + String state =3D "unknown sate of restore"; + + switch (restoreState) + { + case JobWorkspaceRestore.RESTORE_INITIALIZED : + state =3D "initialized"; + break; + + case JobWorkspaceRestore.RESTORE_STARTED : + state =3D "started"; + break; + + case JobWorkspaceRestore.RESTORE_SUCCESSFUL : + state =3D "successful"; + break; + + case JobWorkspaceRestore.RESTORE_FAIL : + state =3D "fail"; + break; + + default : + break; + } + + return state; + } + + private String getRepositoryRestoreState(int restoreState) + { + String state =3D "unknown sate of restore"; + + switch (restoreState) + { + case JobRepositoryRestore.REPOSITORY_RESTORE_INITIALIZED : + state =3D "initialized"; + break; + + case JobRepositoryRestore.REPOSITORY_RESTORE_STARTED : + state =3D "started"; + break; + + case JobRepositoryRestore.REPOSITORY_RESTORE_SUCCESSFUL : + state =3D "successful"; + break; + + case JobRepositoryRestore.REPOSITORY_RESTORE_FAIL : + state =3D "fail"; + break; + + default : + break; + } + + return state; + } + + /** + * getState. + * = + * @param state + * value of state + * @return String sate + */ + private String getState(int state) + { + String st =3D ""; + switch (state) + { + + case BackupJob.FINISHED : + st =3D "finished"; + break; + + case BackupJob.WORKING : + st =3D "working"; + break; + + case BackupJob.WAITING : + st =3D "waiting"; + break; + + case BackupJob.STARTING : + st =3D "starting"; + break; + default : + break; + } + + return st; + } + + /** + * getState. + * = + * @param state + * value of state + * @return String sate + */ + private String getRepositoryBackupToFullState(int state) + { + String st =3D ""; + switch (state) + { + + case RepositoryBackupChain.FINISHED : + st =3D "finished"; + break; + + case RepositoryBackupChain.WORKING : + st =3D "working"; + break; + + case RepositoryBackupChain.INITIALIZED : + st =3D "initialized"; + break; + + case RepositoryBackupChain.FULL_BACKUP_FINISHED_INCREMENTAL_BACKU= P_WORKING : + st =3D "finished"; + break; + default : + break; + } + + return st; + } + + /** + * failureProcessing. + * + * @param data + * response data + * @return String + * result + * @throws BackupExecuteException + * will be generated BackupExecuteException = + */ + private String failureProcessing(BackupAgentResponse response) throws B= ackupExecuteException + { + try + { + String result =3D + "\nFailure :\n" + "\tstatus code : " + response.getStatu= s() + "\n" + "\tmessage : " + + new String(response.getResponseData(), "UTF-8= ") + "\n\n"; + + return result; + } + catch (UnsupportedEncodingException e) + { + throw new BackupExecuteException("Can not encoded the responce : = " + e.getMessage(), e); + } + } + + /** + * getRepositoryEntry. + * + * @param wEntryStream + * InputStream, the workspace configuration + * @return RepositoryEntry + * return the workspace entry + * @throws FileNotFoundException + * will be generated the FileNotFoundException = + * @throws JiBXException + * will be generated the JiBXException = + * @throws RepositoryConfigurationException + * will be generated the RepositoryConfigurationException = + */ + private RepositoryEntry getRepositoryEntry(InputStream wEntryStream, St= ring repositoryName) + throws FileNotFoundException, JiBXException, RepositoryConfigu= rationException + { + IBindingFactory factory =3D BindingDirectory.getFactory(RepositorySe= rviceConfiguration.class); + IUnmarshallingContext uctx =3D factory.createUnmarshallingContext(); + RepositoryServiceConfiguration conf =3D (RepositoryServiceConfigurat= ion) uctx.unmarshalDocument(wEntryStream, null); + RepositoryEntry rEntry =3D conf.getRepositoryConfiguration(repositor= yName); + + return rEntry; + } + + /** + * getWorkspaceEntry. + * + * @param wEntryStream + * InputStream, the workspace configuration + * @param workspaceName + * String, the workspace name = + * @return WorkspaceEntry + * return the workspace entry + * @throws FileNotFoundException + * will be generated the FileNotFoundException = + * @throws JiBXException + * will be generated the JiBXException = + * @throws RepositoryConfigurationException + * will be generated the RepositoryConfigurationException = + */ + private WorkspaceEntry getWorkspaceEntry(InputStream wEntryStream, Stri= ng repositoryName, String workspaceName) + throws FileNotFoundException, JiBXException, RepositoryConfigu= rationException + { + RepositoryEntry rEntry =3D getRepositoryEntry(wEntryStream, reposito= ryName); + + WorkspaceEntry wsEntry =3D null; + + for (WorkspaceEntry wEntry : rEntry.getWorkspaceEntries()) + if (wEntry.getName().equals(workspaceName)) + wsEntry =3D wEntry; + + if (wsEntry =3D=3D null) + throw new RuntimeException("Can not find the workspace '" + works= paceName + "' in configuration."); + + return wsEntry; + } + } Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/java/org/exoplatform/jcr/backupconsole/BackupConsole.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-11 10:01:45 U= TC (rev 3285) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-11 10:03:48 U= TC (rev 3286) @@ -58,25 +58,33 @@ */ private static final String HELP_INFO =3D "Help info:\n" + " \n" + " : http(s)//login:pas= sword(a)host:port/ \n" - + " : start [] \n" + " = stop \n" - + " status \n" + " restores \n" - + " restore \= n" + " list [completed] \n" - + " info \n" + " drop [force-close-session]= \n" + " help \n\n" + + " : start [] \n" = + + " stop \n" + + " status \n" = + + " restores \n" + + " restore = \n" = + + " list [completed] \n" + + " info \n" = + + " drop [force-close-session] \n" = + + " help \n\n" = - + " start - start backup \n" + " stop - stop b= ackup \n" + + " start - start backup of repositpry or workspace \n" = + + " stop - stop backup \n" + " status - information about the current or completed b= ackup by 'backup_id' \n" - + " restores - information about the last restore on specif= ic workspace \n" - + " restore - restore the workspace from specific backup \= n" + + " restores - information about the last restore on specif= ic repository or workspace \n" + + " restore - restore the repository or workspace from spe= cific backup \n" + " list - information about the current backups (in pr= ogress) \n" + " list completed - information about the completed (ready to re= store) backups \n" - + " info - information about the service backup \n" + "= drop - delete the workspace \n" + + " info - information about the service backup \n" = + + " drop - delete the repository or workspace \n" + " help - print help information about backup console = \n\n" = - + " - // t= he workspace \n" + + " - /[/= ] the repository or workspace \n" + " - path to folder for backup on remote ser= ver \n" - + " - the identifier for backup \n" + " - incemental job period \n" - + " - path (local) to workspace configuration= \n" - + " force-close-session - close opened sessions on workspace. \n\= n"; + + " - the identifier for backup \n" = + + " - incemental job period \n" + + " - path (local) to repository or workspac= e configuration \n" + + " force-close-session - close opened sessions on repositpry or = workspace. \n\n"; = /** * Main. @@ -157,7 +165,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null); = if (curArg =3D=3D args.length) { @@ -233,7 +241,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null); = if (curArg < args.length) { @@ -276,7 +284,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null);; = if (curArg < args.length) { @@ -321,7 +329,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null); = // backup id if (curArg =3D=3D args.length) @@ -415,7 +423,7 @@ String repWS =3D args[curArg]; repWS =3D repWS.replaceAll("\\\\", "/"); = - if (!repWS.matches("[/][^/]+[/][^/]+")) + if ( !repWS.matches("[/][^/]+") && !repWS.matches("[/][^/]+[/][^/]+"= )) { System.out.println(INCORRECT_PARAM + "There is incorrect path to = workspace parameter: " + repWS); return null; Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-10-11 10:0= 1:45 UTC (rev 3285) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-10-11 10:0= 3:48 UTC (rev 3286) @@ -57,6 +57,16 @@ * Flag is SSL. */ private final String protocol; + = + /** + * Is realm get. + */ + private boolean isRealmGet =3D false; + = + /** + * Realm to connection + */ + private String realm; = /** * Constructor. @@ -124,7 +134,13 @@ HTTPConnection connection =3D new HTTPConnection(url); connection.removeModule(CookieModule.class); = - connection.addBasicAuthorization(getRealm(complURL), login, passw= ord); + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } + = + connection.addBasicAuthorization(realm, login, password); = HTTPResponse resp; if (postData =3D=3D null) @@ -164,7 +180,13 @@ HTTPConnection connection =3D new HTTPConnection(url); connection.removeModule(CookieModule.class); = - connection.addBasicAuthorization(getRealm(complURL), login, passw= ord); + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } + = + connection.addBasicAuthorization(realm, login, password); = HTTPResponse resp =3D connection.Get(url.getFile()); = Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/RestRepositoryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/RestRepositoryService.java 2010-10-11 10:01:45 UTC (rev = 3285) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/RestRepositoryService.java 2010-10-11 10:03:48 UTC (rev = 3286) @@ -18,20 +18,6 @@ */ package org.exoplatform.services.jcr.ext.repository; = -import org.exoplatform.common.http.HTTPStatus; -import org.exoplatform.services.jcr.RepositoryService; -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.config.RepositoryEntry; -import org.exoplatform.services.jcr.config.RepositoryServiceConfiguration; -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.core.ManageableRepository; -import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; -import org.exoplatform.services.jcr.impl.core.RepositoryImpl; -import org.exoplatform.services.jcr.impl.core.SessionRegistry; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.exoplatform.services.rest.resource.ResourceContainer; - import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; @@ -51,6 +37,20 @@ import javax.ws.rs.core.UriInfo; import javax.ws.rs.core.Response.Status; = +import org.exoplatform.services.jcr.RepositoryService; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.RepositoryServiceConfiguration; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.core.ManageableRepository; +import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; +import org.exoplatform.services.jcr.impl.RepositoryServiceImpl; +import org.exoplatform.services.jcr.impl.core.RepositoryImpl; +import org.exoplatform.services.jcr.impl.core.SessionRegistry; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.exoplatform.services.rest.resource.ResourceContainer; + /** * Created by The eXo Platform SAS. * = @@ -370,7 +370,7 @@ * @return Response * return the Response */ - @POST + @GET @RolesAllowed("administrators") @Path("/remove-repository/{repositoryName}/{forseSessionClose}") public Response removeRepository(@Context UriInfo uriInfo, @PathParam("= repositoryName") String repositoryName, @@ -390,14 +390,16 @@ } } = - if (repositoryService.canRemoveRepository(repositoryName)) + if (repositoryService.getDefaultRepository().getConfiguration().g= etName().equals(repositoryName)) { + ((RepositoryServiceImpl) repositoryService).removeDefaultRepos= itory(); + } + else + { repositoryService.removeRepository(repositoryName); - repositoryService.getConfig().retain(); // save configuration = to persistence (file or persister) - return Response.noContent().build(); } - return Response.status(HTTPStatus.CONFLICT).entity("Can't remove = repository " + repositoryName).cacheControl( - NO_CACHE).build(); + repositoryService.getConfig().retain(); // save configuration to = persistence (file or persister) = + return Response.ok().build(); } catch (RepositoryException e) { Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-11 10:01:45 UTC (rev 3285) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-11 10:03:48 UTC (rev 3286) @@ -938,33 +938,33 @@ Help info: <url> <cmd> = <url> : http(s)//login:password(a)host:port/<context> = - <cmd> : start <repo/ws> <backup_dir> [<incr>] = + <cmd> : start <repo[/ws]> <backup_dir> [<incr>= ] = stop <backup_id> = status <backup_id> = - restores <repo/ws> = - restore <repo/ws> <backup_id> <pathToConfigFile= > = + restores <repo[/ws]> = + restore <repo[/ws]> <backup_id> <pathToConfigFi= le> list [completed] = info = - drop [force-close-session] <repo/ws> = + drop [force-close-session] <repo[/ws]> = help = = - start - start backup = + start - start backup of repository or workspace stop - stop backup = status - information about the current or completed backup by 'ba= ckup_id' = - restores - information about the last restore on specific workspace = - restore - restore the workspace from specific backup = + restores - information about the last restore on specific repositor= y or workspace = + restore - restore the repository or workspace from specific backup = list - information about the current backups (in progress) = list completed - information about the completed (ready to restore) backu= ps = info - information about the service backup = - drop - delete the workspace = + drop - delete the repository or workspace = help - print help information about backup console = = - <repo/ws> - /<reponsitory-name>/<workspace-name&= gt; the workspace = + <repo[/ws]> - /<reponsitory-name>[/<workspace-name= >] the repository or workspace <backup_dir> - path to folder for backup on remote server = <backup_id> - the identifier for backup = <incr> - incemental job period = - <pathToConfigFile> - path (local) to workspace configuration = - force-close-session - close opened sessions on workspace. + <pathToConfigFile> - path (local) to repository or workspace conf= iguration = + force-close-session - close opened sessions on repositpry or workspace =
    @@ -991,7 +991,8 @@ = - ${JCR-SRC-HOME} the path = where eXo JCR sources located + ${JCR-SRC-HOME} the path = where + eXo JCR sources located
    = @@ -1323,4 +1324,244 @@ finished time : Fri, 17 Apr 2009 16:38:00 EEST + +
    + Full example about creating backup and restoring it for reposit= ory + 'repository' + +
    + Creating backup + + jcrbackup http://root:exo(a)127.0.0.1:8080 start /re= pository ../temp/backup 10000 + + Return : + + Successful : = + status code =3D 200 +
    + +
    + Getting information about current backups + + jcrbackup http://root:exo(a)127.0.0.1:8080 list + + Return : + + The current backups information : = + 1) Repository backup with id 9a4d40fb7f0000012ec8f0a4ec70b3da : + repository name : repository + backup type : full + incremetal + full backups state : finished + incremental backups state : working + started time : Mon, 11 Oct 2010 10:59:35 EEST +
    + +
    + Stopping backup by id + + Stop backup with id 9a4d40fb7f0000012ec8f0a4ec70b3da : + + jcrbackup http://root:exo(a)127.0.0.1:8080 stop 9a4d= 40fb7f0000012ec8f0a4ec70b3da + + Return : + + Successful : = + status code =3D 200 +
    + +
    + Deleting the repository "repository" and close all opened + sessions + + jcrbackup http://root:exo(a)127.0.0.1:8080 drop forc= e-close-session /repository + + Return : + + Successful : = + status code =3D 200 +
    + +
    + Restoring the workspace "backup" + + + + Delete/clean the database for workspace "repository" : When we use "single-db",= then + we will run the SQL queries for clean database := drop table JCR_SREF; + drop table JCR_SVALUE; + drop table JCR_SITEM; + + + + Delete the value storage for repository "repository"; + + + + Delete the index data for repository "repository"; + + + + Restore:jcrbackup http://root:exo(a)127.0.= 0.1:8080 restore /repository/backup 9a6dba327f000001325dfb228a181b07 /home/= rainf0x/exo-jcr-config_backup.xmlReturn + :Successful : = + status code =3D 200The + /home/rainf0x/exo-jcr-config_backup.xml content the configuration + for restored repository "repository" :<repos= itory-service default-repository=3D"repository"> + <repositories> + <repository name=3D"repository" system-workspace=3D"production" d= efault-workspace=3D"production"> + <security-domain>exo-domain</security-domain> + <access-control>optional</access-control> + <authentication-policy>org.exoplatform.services.jcr.impl.co= re.access.JAASAuthenticator</authentication-policy> + <workspaces> + <workspace name=3D"production"> + <!-- for system storage --> + <container class=3D"org.exoplatform.services.jcr.impl.st= orage.jdbc.optimisation.CQJDBCWorkspaceDataContainer"> + <properties> + <property name=3D"source-name" value=3D"jdbcjcr" /= > + <property name=3D"multi-db" value=3D"false" /> + <property name=3D"update-storage" value=3D"false" = /> + <property name=3D"max-buffer-size" value=3D"200k" = /> + <property name=3D"swap-directory" value=3D"../temp= /swap/production" /> + </properties> + <value-storages> + <value-storage id=3D"system" class=3D"org.exoplatf= orm.services.jcr.impl.storage.value.fs.TreeFileValueStorage"> + <properties> + <property name=3D"path" value=3D"../temp/val= ues/production" /> + </properties> + <filters> + <filter property-type=3D"Binary" /> + </filters> + </value-storage> + </value-storages> + </container> + <initializer class=3D"org.exoplatform.services.jcr.impl.= core.ScratchWorkspaceInitializer"> + <properties> + <property name=3D"root-nodetype" value=3D"nt:unstr= uctured" /> + </properties> + </initializer> + <cache enabled=3D"true" class=3D"org.exoplatform.service= s.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl"> + <properties> + <property name=3D"max-size" value=3D"10k" /> + <property name=3D"live-time" value=3D"1h" /> + </properties> + </cache> + <query-handler class=3D"org.exoplatform.services.jcr.imp= l.core.query.lucene.SearchIndex"> + <properties> + <property name=3D"index-dir" value=3D"../temp/jcrl= ucenedb/production" /> + </properties> + </query-handler> + <lock-manager> + <time-out>15m</time-out> + <persister class=3D"org.exoplatform.services.jcr.impl= .core.lock.FileSystemLockPersister"> + <properties> + <property name=3D"path" value=3D"../temp/lock/s= ystem" /> + </properties> + </persister> + </lock-manager> + </workspace> + + <workspace name=3D"backup"> + <container class=3D"org.exoplatform.services.jcr.impl.st= orage.jdbc.optimisation.CQJDBCWorkspaceDataContainer"> + <properties> + <property name=3D"source-name" value=3D"jdbcjcr" /= > + <property name=3D"multi-db" value=3D"false" /> + <property name=3D"update-storage" value=3D"false" = /> + <property name=3D"max-buffer-size" value=3D"200k" = /> + <property name=3D"swap-directory" value=3D"../temp= /swap/backup" /> + </properties> + <value-storages> + <value-storage id=3D"draft" class=3D"org.exoplatfo= rm.services.jcr.impl.storage.value.fs.TreeFileValueStorage"> + <properties> + <property name=3D"path" value=3D"../temp/val= ues/backup" /> + </properties> + <filters> + <filter property-type=3D"Binary" /> + </filters> + </value-storage> + </value-storages> + </container> + <initializer class=3D"org.exoplatform.services.jcr.impl.= core.ScratchWorkspaceInitializer"> + <properties> + <property name=3D"root-nodetype" value=3D"nt:unstr= uctured" /> + </properties> + </initializer> + <cache enabled=3D"true" class=3D"org.exoplatform.service= s.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl"> + <properties> + <property name=3D"max-size" value=3D"10k" /> + <property name=3D"live-time" value=3D"1h" /> + </properties> + </cache> + <query-handler class=3D"org.exoplatform.services.jcr.imp= l.core.query.lucene.SearchIndex"> + <properties> + <property name=3D"index-dir" value=3D"../temp/jcrl= ucenedb/backup" /> + </properties> + </query-handler> + </workspace> + + <workspace name=3D"digital-assets"> + <container class=3D"org.exoplatform.services.jcr.impl.st= orage.jdbc.optimisation.CQJDBCWorkspaceDataContainer"> + <properties> + <property name=3D"source-name" value=3D"jdbcjcr" /= > + <property name=3D"multi-db" value=3D"false" /> + <property name=3D"update-storage" value=3D"false" = /> + <property name=3D"max-buffer-size" value=3D"200k" = /> + <property name=3D"swap-directory" value=3D"../temp= /swap/digital-assets" /> + </properties> + <value-storages> + <value-storage id=3D"digital-assets" class=3D"org.= exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage"> + <properties> + <property name=3D"path" value=3D"../temp/val= ues/digital-assets" /> + </properties> + <filters> + <filter property-type=3D"Binary" /> + </filters> + </value-storage> + </value-storages> + </container> + <initializer class=3D"org.exoplatform.services.jcr.impl.= core.ScratchWorkspaceInitializer"> + <properties> + <property name=3D"root-nodetype" value=3D"nt:folde= r" /> + </properties> + </initializer> + <cache enabled=3D"true" class=3D"org.exoplatform.service= s.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl"> + <properties> + <property name=3D"max-size" value=3D"5k" /> + <property name=3D"live-time" value=3D"15m" /> + </properties> + </cache> + <query-handler class=3D"org.exoplatform.services.jcr.imp= l.core.query.lucene.SearchIndex"> + <properties> + <property name=3D"index-dir" value=3D"../temp/jcrl= ucenedb/digital-assets" /> + </properties> + </query-handler> + </workspace> + </workspaces> + </repository> + </repositories> +</repository-service> + + + +
    + +
    + Getting information about restore for repository + 'repository' + + jcrbackup http://root:exo(a)127.0.0.1:8080 restores = /repository + + Return: + + Repository restore with id 9a6dba327f000001325dfb2= 28a181b07: + backup folder : /home/rainf0x/java/exo-working/JCR-1459/exo-= tomcat/bin/../temp/backup/repository_repository_backup_1286786103858 + repository name : repository + backup type : full + incremetal + restore state : successful + started time : Mon, 11 Oct 2010 11:51:15 EEST + finished time : Mon, 11 Oct 2010 11:51:17 EEST +
    +
    --===============1591286902293167009==-- From do-not-reply at jboss.org Mon Oct 11 07:27:32 2010 Content-Type: multipart/mixed; boundary="===============0435030807699317509==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3287 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc. Date: Mon, 11 Oct 2010 07:27:32 -0400 Message-ID: <201010111127.o9BBRWEm030367@svn01.web.mwc.hst.phx2.redhat.com> --===============0435030807699317509== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-11 07:27:31 -0400 (Mon, 11 Oct 2010) New Revision: 3287 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/SingleMethodCallCommand.java Log: EXOJCR-967: The SingleMethodCallCommand only forbids private method calls Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/SingleMethodCallCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/SingleMethodCallCommand.java 2010-10-11 10:03:48 UTC (rev 3286) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/SingleMethodCallCommand.java 2010-10-11 11:27:31 UTC (rev 3287) @@ -88,9 +88,9 @@ } this.component =3D component; this.method =3D component.getClass().getDeclaredMethod(methodName, p= arameterTypes); - if (!Modifier.isPublic(method.getModifiers())) + if (Modifier.isPrivate(method.getModifiers())) { - throw new IllegalArgumentException("The method '" + methodName + = "' is not public"); + throw new IllegalArgumentException("The method '" + methodName + = "' cannot be private"); } this.id =3D getId(component, method); } --===============0435030807699317509==-- From do-not-reply at jboss.org Mon Oct 11 08:17:48 2010 Content-Type: multipart/mixed; boundary="===============4144942295842916740==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3288 - in jcr/branches/1.14-CNK/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 1 other directories. Date: Mon, 11 Oct 2010 08:17:48 -0400 Message-ID: <201010111217.o9BCHm0m006426@svn01.web.mwc.hst.phx2.redhat.com> --===============4144942295842916740== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2010-10-11 08:17:47 -0400 (Mon, 11 Oct 2010) New Revision: 3288 Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/MultiIndex.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/test/java/org/exoplatfo= rm/services/jcr/api/core/query/lucene/IndexingAggregateTest.java Log: EXOJCR-987 Getting rid of Volatile index Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-= 10-11 11:27:31 UTC (rev 3287) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-= 10-11 12:17:47 UTC (rev 3288) @@ -193,18 +193,18 @@ { setNames(set); // callback multiIndex to refresh lists - try - { - MultiIndex multiIndex =3D getMultiIndex(); - if (multiIndex !=3D null) - { - multiIndex.refreshIndexList(); - } - } - catch (IOException e) - { - log.error("Failed to update indexes! " + e.getMessage(), e); - } +// try +// { +// MultiIndex multiIndex =3D getMultiIndex(); +// if (multiIndex !=3D null) +// { +// //multiIndex.refreshIndexList(); +// } +// } +// catch (IOException e) +// { +// log.error("Failed to update indexes! " + e.getMessage(), = e); +// } } } } Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/MultiIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-11 11:27:31= UTC (rev 3287) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-11 12:17:47= UTC (rev 3288) @@ -25,7 +25,6 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; -import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener; import org.exoplatform.services.jcr.impl.core.query.IndexingTree; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Direc= toryManager; import org.exoplatform.services.jcr.impl.util.SecurityHelper; @@ -46,8 +45,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import java.util.Timer; -import java.util.TimerTask; +import java.util.Map.Entry; = import javax.jcr.ItemNotFoundException; import javax.jcr.RepositoryException; @@ -79,7 +77,7 @@ * thread and reader threads is done using {@link #updateMonitor} and * {@link #updateInProgress}. */ -public class MultiIndex implements IndexerIoModeListener, IndexUpdateMonit= orListener +public class MultiIndex { = /** @@ -93,17 +91,12 @@ private IndexInfos indexNames; = /** - * Names of index directories that can be deleted. - */ - private final Set deletable =3D new HashSet(); - - /** * List of open persistent indexes. This list may also contain an open * PersistentIndex owned by the IndexMerger daemon. Such an index is not * registered with indexNames and must not be used in regular in= dex * operations (delete node, etc.)! */ - private final List indexes =3D new ArrayList(); + private final List indexes =3D new ArrayList(); = /** * The internal namespace mappings of the query manager. @@ -126,18 +119,6 @@ private final SearchIndex handler; = /** - * The volatile index. - */ - private VolatileIndex volatileIndex; - - /** - * Flag indicating whether an update operation is in progress. - */ - // private boolean updateInProgress =3D false; - - private final IndexUpdateMonitor indexUpdateMonitor; - - /** * If not null points to a valid IndexReader = that * reads from all indexes, including volatile and persistent indexes. */ @@ -149,33 +130,6 @@ private final DocNumberCache cache; = /** - * Monitor to use to synchronize access to {@link #multiReader} and - * {@link #updateInProgress}. - */ - private final Object updateMonitor =3D new Object(); - - /** - * The time this index was last flushed or a transaction was committed. - */ - private long lastFlushTime; - - /** - * The time this index was last flushed or a transaction was committed. - */ - private long lastFileSystemFlushTime; - - /** - * Timer to schedule flushes of this index after some idle time. - */ - private static final Timer FLUSH_TIMER =3D new Timer(true); - - /** - * Task that is periodically called by {@link #FLUSH_TIMER} and checks = if - * index should be flushed. - */ - private TimerTask flushTask; - - /** * The indexing queue with pending text extraction jobs. */ private IndexingQueue indexingQueue; @@ -186,11 +140,6 @@ private final IndexingTree indexingTree; = /** - * The next transaction id. - */ - private long nextTransactionId =3D 0; - - /** * Flag indicating whether re-indexing is running. */ private boolean reindexing =3D false; @@ -220,7 +169,6 @@ IndexUpdateMonitor indexUpdateMonitor) throws IOException { this.modeHandler =3D modeHandler; - this.indexUpdateMonitor =3D indexUpdateMonitor; this.directoryManager =3D handler.getDirectoryManager(); // this method is run in privileged mode internally this.indexDir =3D directoryManager.getDirectory("."); @@ -228,18 +176,15 @@ this.cache =3D new DocNumberCache(handler.getCacheSize()); this.indexingTree =3D indexingTree; this.nsMappings =3D handler.getNamespaceMappings(); - this.flushTask =3D null; this.indexNames =3D indexInfos; this.indexNames.setDirectory(indexDir); // this method is run in privileged mode internally this.indexNames.read(); + this.indexNames.addName("1"); + this.indexNames.addName("2"); + this.indexNames.addName("3"); + this.indexNames.addName("4"); = - this.lastFileSystemFlushTime =3D System.currentTimeMillis(); - this.lastFlushTime =3D System.currentTimeMillis(); - - modeHandler.addIndexerIoModeListener(this); - indexUpdateMonitor.addIndexUpdateMonitorListener(this); - // this method is run in privileged mode internally // as of 1.5 deletable file is not used anymore removeDeletable(); @@ -251,6 +196,7 @@ this.indexingQueue =3D new IndexingQueue(store); // copy current index names Set currentNames =3D new HashSet(indexNames.getNames= ()); + //Set currentNames =3D new HashSet(); = // open persistent indexes for (String name : currentNames) @@ -259,12 +205,14 @@ // it is possible that indexNames still contains a name for // an index that has been deleted, but indexNames has not been // written to disk. - if (!directoryManager.hasDirectory(name)) - { - log.debug("index does not exist anymore: " + name); - // move on to next index - continue; - } + + // TODO THIS CHECK WAS SKIPPED + // if (!directoryManager.hasDirectory(name)) + // { + // log.debug("index does not exist anymore: " + name); + // // move on to next index + // continue; + // } PersistentIndex index =3D new PersistentIndex(name, handler.getTextAnalyzer(), handler.g= etSimilarity(), cache, indexingQueue, directoryManager); @@ -275,7 +223,8 @@ } = // init volatile index - resetVolatileIndex(); + // TODO commented line below: + //resetVolatileIndex(); = // set index format version and at the same time // initialize hierarchy cache if requested. @@ -296,10 +245,6 @@ }); } indexingQueue.initialize(this); - if (modeHandler.getMode() =3D=3D IndexerIoMode.READ_WRITE) - { - setReadWrite(); - } this.indexNames.setMultiIndex(this); } = @@ -314,7 +259,9 @@ { if (indexNames.size() =3D=3D 0) { - return volatileIndex.getNumDocuments(); + // TODO commented line below: + //return volatileIndex.getNumDocuments(); + return 0; } else { @@ -362,15 +309,16 @@ */ void createInitialIndex(ItemDataConsumer stateMgr) throws IOException { + + // TODO: re-study check!!! // only do an initial index if there are no indexes at all - if (indexNames.size() =3D=3D 0) + // if (indexNames.size() =3D=3D 0) { reindexing =3D true; try { long count =3D 0; // traverse and index workspace - // TODO: this was removed //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); = @@ -382,7 +330,8 @@ = log.info("Created initial index for {} nodes", new Long(count)= ); releaseMultiReader(); - scheduleFlushTask(); + // TODO commented line below: + //scheduleFlushTask(); } catch (Exception e) { @@ -396,10 +345,10 @@ reindexing =3D false; } } - else - { - throw new IllegalStateException("Index already present"); - } + // else + // { + // throw new IllegalStateException("Index already present"); + // } } = /** @@ -416,7 +365,7 @@ * @throws IOException * if an error occurs while updating the index. */ - synchronized void update(final Collection remove, final Collection add)= throws IOException + synchronized void update(final Collection remove, final Collect= ion add) throws IOException { SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() { @@ -435,26 +384,18 @@ log.warn("unable to prepare index reader " + "for querie= s during update", e); } } - - synchronized (updateMonitor) - { - //updateInProgress =3D true; - indexUpdateMonitor.setUpdateInProgress(true, false); - } - boolean flush =3D false; +// boolean flush =3D false; try { - long transactionId =3D nextTransactionId++; - // TODO: this was removed //executeAndLog(new Start(transactionId)); = - for (Iterator it =3D remove.iterator(); it.hasNext();) + for (Iterator it =3D remove.iterator(); it.hasNext(= );) { // TODO this was replaced //executeAndLog(new DeleteNode(transactionId, (String)it= .next())); = - String uuidString =3D (String)it.next(); + String uuidString =3D it.next(); // check if indexing queue is still working on // this node from a previous update Document doc =3D indexingQueue.removeDocument(uuidString= ); @@ -465,13 +406,15 @@ Term idTerm =3D new Term(FieldNames.UUID, uuidString); // if the document cannot be deleted from the volatile i= ndex // delete it from one of the persistent indexes. - int num =3D volatileIndex.removeDocument(idTerm); + + // TODO watch here + int num =3D getChunk(uuidString).removeDocument(idTerm); if (num =3D=3D 0) { for (int i =3D indexes.size() - 1; i >=3D 0; i--) { // only look in registered indexes - PersistentIndex idx =3D (PersistentIndex)indexes.g= et(i); + PersistentIndex idx =3D indexes.get(i); if (indexNames.contains(idx.getName())) { num =3D idx.removeDocument(idTerm); @@ -484,9 +427,9 @@ } = } - for (Iterator it =3D add.iterator(); it.hasNext();) + for (Iterator it =3D add.iterator(); it.hasNext()= ;) { - Document doc =3D (Document)it.next(); + Document doc =3D it.next(); if (doc !=3D null) { // TODO: ths is replaced @@ -494,38 +437,27 @@ = if (doc !=3D null) { - volatileIndex.addDocuments(new Document[]{doc}); + // TODO watch this + String uuid =3D doc.get(FieldNames.UUID); + getChunk(uuid).addDocuments(new Document[]{doc}); } = // commit volatile index if needed - flush |=3D checkVolatileCommit(); + // TODO commented line below: + //flush |=3D checkVolatileCommit(); } } = // TODO : this was replaced //executeAndLog(new Commit(transactionId)); = - // flush whole index when volatile index has been commited. - if (flush) - { - // if we are going to flush, need to set persistent upda= te - synchronized (updateMonitor) - { - indexUpdateMonitor.setUpdateInProgress(true, true); - } - flush(); - } + // TODO commented line below: + //flush(); + getChunk(null).commit(); } finally { - synchronized (updateMonitor) - { - //updateInProgress =3D false; - - indexUpdateMonitor.setUpdateInProgress(false, flush); - updateMonitor.notifyAll(); - releaseMultiReader(); - } + releaseMultiReader(); } return null; } @@ -569,11 +501,6 @@ */ synchronized int removeAllDocuments(String uuid) throws IOException { - synchronized (updateMonitor) - { - //updateInProgress =3D true; - indexUpdateMonitor.setUpdateInProgress(true, false); - } int num; try { @@ -582,7 +509,8 @@ // TODO: this was removed //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); = - num =3D volatileIndex.removeDocument(idTerm); + // TODO REMOVE WAS HERE + num =3D getChunk(uuid).removeDocument(idTerm); if (num > 0) { // TODO: removed line @@ -590,7 +518,7 @@ } for (int i =3D 0; i < indexes.size(); i++) { - PersistentIndex index =3D (PersistentIndex)indexes.get(i); + PersistentIndex index =3D indexes.get(i); // only remove documents from registered indexes if (indexNames.contains(index.getName())) { @@ -608,13 +536,7 @@ } finally { - synchronized (updateMonitor) - { - //updateInProgress =3D false; - indexUpdateMonitor.setUpdateInProgress(false, false); - updateMonitor.notifyAll(); - releaseMultiReader(); - } + releaseMultiReader(); } return num; } @@ -639,14 +561,14 @@ */ synchronized IndexReader[] getIndexReaders(String[] indexNames, IndexLi= stener listener) throws IOException { - Set names =3D new HashSet(Arrays.asList(indexNames)); - Map indexReaders =3D new HashMap(); + Set names =3D new HashSet(Arrays.asList(indexNames)); + Map indexReaders =3D new HashM= ap(); = try { - for (Iterator it =3D indexes.iterator(); it.hasNext();) + for (Iterator it =3D indexes.iterator(); it.hasN= ext();) { - PersistentIndex index =3D (PersistentIndex)it.next(); + PersistentIndex index =3D it.next(); if (names.contains(index.getName())) { indexReaders.put(index.getReadOnlyIndexReader(listener), in= dex); @@ -656,10 +578,10 @@ catch (IOException e) { // release readers obtained so far - for (Iterator it =3D indexReaders.entrySet().iterator(); it.hasNe= xt();) + for (Iterator> it =3D= indexReaders.entrySet().iterator(); it.hasNext();) { - Map.Entry entry =3D (Map.Entry)it.next(); - final ReadOnlyIndexReader reader =3D (ReadOnlyIndexReader)entr= y.getKey(); + Map.Entry entry =3D it.n= ext(); + final ReadOnlyIndexReader reader =3D entry.getKey(); try { SecurityHelper.doPriviledgedIOExceptionAction(new Privilege= dExceptionAction() @@ -675,77 +597,15 @@ { log.warn("Exception releasing index reader: " + ex); } - ((PersistentIndex)entry.getValue()).resetListener(); + (entry.getValue()).resetListener(); } throw e; } = - return (IndexReader[])indexReaders.keySet().toArray(new IndexReader[= indexReaders.size()]); + return indexReaders.keySet().toArray(new IndexReader[indexReaders.si= ze()]); } = /** - * Creates a new Persistent index. The new index is not registered with= this - * MultiIndex. - * = - * @param indexName - * the name of the index to open, or null if an - * index with a new name should be created. - * @return a new PersistentIndex. - * @throws IOException - * if a new index cannot be created. - */ - synchronized PersistentIndex getOrCreateIndex(String indexName) throws = IOException - { - // check existing - for (Iterator it =3D indexes.iterator(); it.hasNext();) - { - PersistentIndex idx =3D (PersistentIndex)it.next(); - if (idx.getName().equals(indexName)) - { - return idx; - } - } - - if (modeHandler.getMode() =3D=3D IndexerIoMode.READ_ONLY) - { - throw new UnsupportedOperationException("Can't create index in RE= AD_ONLY mode."); - } - - // otherwise open / create it - if (indexName =3D=3D null) - { - do - { - indexName =3D indexNames.newName(); - } - while (directoryManager.hasDirectory(indexName)); - } - PersistentIndex index; - try - { - index =3D - new PersistentIndex(indexName, handler.getTextAnalyzer(), hand= ler.getSimilarity(), cache, indexingQueue, - directoryManager); - } - catch (IOException e) - { - // do some clean up - if (!directoryManager.delete(indexName)) - { - deletable.add(indexName); - } - throw e; - } - index.setMaxFieldLength(handler.getMaxFieldLength()); - index.setUseCompoundFile(handler.getUseCompoundFile()); - index.setTermInfosIndexDivisor(handler.getTermInfosIndexDivisor()); - - // add to list of open indexes and return it - indexes.add(index); - return index; - } - - /** * Returns true if this multi index has an index segment w= ith * the given name. This method even returns true if an ind= ex * segments has not yet been loaded / initialized but exists on disk. @@ -759,9 +619,9 @@ synchronized boolean hasIndex(String indexName) throws IOException { // check existing - for (Iterator it =3D indexes.iterator(); it.hasNext();) + for (Iterator it =3D indexes.iterator(); it.hasNext= ();) { - PersistentIndex idx =3D (PersistentIndex)it.next(); + PersistentIndex idx =3D it.next(); if (idx.getName().equals(indexName)) { return true; @@ -772,131 +632,6 @@ } = /** - * Replaces the indexes with names obsoleteIndexes with - * index. Documents that must be deleted in index - * can be identified with Terms in deleted. - * = - * @param obsoleteIndexes - * the names of the indexes to replace. - * @param index - * the new index that is the result of a merge of the indexe= s to - * replace. - * @param deleted - * Terms that identify documents that must be - * deleted in index. - * @throws IOException - * if an exception occurs while replacing the indexes. - */ - void replaceIndexes(String[] obsoleteIndexes, final PersistentIndex ind= ex, Collection deleted) throws IOException - { - - if (handler.isInitializeHierarchyCache()) - { - // force initializing of caches - long time =3D System.currentTimeMillis(); - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExcep= tionAction() - { - public Object run() throws Exception - { - index.getReadOnlyIndexReader(true).release(); - return null; - } - }); - time =3D System.currentTimeMillis() - time; - log.debug("hierarchy cache initialized in {} ms", new Long(time)); - } - - synchronized (this) - { - synchronized (updateMonitor) - { - //updateInProgress =3D true; - indexUpdateMonitor.setUpdateInProgress(true, true); - } - try - { - // if we are reindexing there is already an active transaction - if (!reindexing) - { - // TODO: this was removed - //executeAndLog(new Start(Action.INTERNAL_TRANS_REPL_INDEXE= S)); - } - // delete obsolete indexes - Set names =3D new HashSet(Arrays.asList(obsoleteIndexes)); - for (Iterator it =3D names.iterator(); it.hasNext();) - { - // do not try to delete indexes that are already gone - String indexName =3D (String)it.next(); - if (indexNames.contains(indexName)) - { - // TODO this was replaced - //executeAndLog(new DeleteIndex(getTransactionId(), inde= xName)); - - for (Iterator it2 =3D indexes.iterator(); it2.hasNext();) - { - PersistentIndex idx =3D (PersistentIndex)it2.next(); - if (idx.getName().equals(indexName)) - { - idx.close(); - deleteIndex(idx); - break; - } - } - - } - } - - // Index merger does not log an action when it creates the - // target - // index of the merge. We have to do this here. - // TODO this was replaced - ///executeAndLog(new CreateIndex(getTransactionId(), index.get= Name())); - - PersistentIndex idx =3D getOrCreateIndex(index.getName()); - - // TODO: this is replaced - //executeAndLog(new AddIndex(getTransactionId(), index.getName= ())); - if (!indexNames.contains(index.getName())) - { - indexNames.addName(index.getName()); - } - - // delete documents in index - for (Iterator it =3D deleted.iterator(); it.hasNext();) - { - Term id =3D (Term)it.next(); - index.removeDocument(id); - } - index.commit(); - - if (!reindexing) - { - // only commit if we are not reindexing - // when reindexing the final commit is done at the very end - - // TODO : this was replaced - //executeAndLog(new Commit(getTransactionId())); - } - } - finally - { - synchronized (updateMonitor) - { - //updateInProgress =3D false; - indexUpdateMonitor.setUpdateInProgress(false, true); - updateMonitor.notifyAll(); - releaseMultiReader(); - } - } - } - if (reindexing) - { - // do some cleanup right away when reindexing - attemptDelete(); - } - } - - /** * Returns an read-only IndexReader that spans alls indexe= s of * this MultiIndex. * = @@ -926,74 +661,49 @@ { public CachingMultiIndexReader run() throws Exception { - synchronized (updateMonitor) + if (multiReader !=3D null) { - if (multiReader !=3D null) + multiReader.acquire(); + return multiReader; + } + // no reader available + // some other read thread might have created the reader in the + // meantime -> check again + if (multiReader =3D=3D null) + { + List readerList =3D new ArrayList(); + for (int i =3D 0; i < indexes.size(); i++) { - multiReader.acquire(); - return multiReader; - } - // no reader available - // wait until no update is in progress - while (indexUpdateMonitor.getUpdateInProgress()) - { - try - { - updateMonitor.wait(); - } - catch (InterruptedException e) - { - throw new IOException("Interrupted while waiting to a= quire reader"); - } - } - // some other read thread might have created the reader in = the - // meantime -> check again - if (multiReader =3D=3D null) - { - List readerList =3D new ArrayList(); - for (int i =3D 0; i < indexes.size(); i++) - { - PersistentIndex pIdx =3D (PersistentIndex)indexes.get= (i); + PersistentIndex pIdx =3D indexes.get(i); = - if (indexNames.contains(pIdx.getName())) + if (indexNames.contains(pIdx.getName())) + { + try { - try + readerList.add(pIdx.getReadOnlyIndexReader(initCac= he)); + } + catch (FileNotFoundException e) + { + if (directoryManager.hasDirectory(pIdx.getName())) { - readerList.add(pIdx.getReadOnlyIndexReader(init= Cache)); + throw e; } - catch (FileNotFoundException e) - { - if (directoryManager.hasDirectory(pIdx.getName(= ))) - { - throw e; - } - } } } - readerList.add(volatileIndex.getReadOnlyIndexReader()); - ReadOnlyIndexReader[] readers =3D - (ReadOnlyIndexReader[])readerList.toArray(new ReadOnl= yIndexReader[readerList.size()]); - multiReader =3D new CachingMultiIndexReader(readers, cac= he); } - multiReader.acquire(); - return multiReader; + // TODO commented line below: + //readerList.add(volatileIndex.getReadOnlyIndexReader()); + ReadOnlyIndexReader[] readers =3D readerList.toArray(new Re= adOnlyIndexReader[readerList.size()]); + multiReader =3D new CachingMultiIndexReader(readers, cache); } + multiReader.acquire(); + return multiReader; } }); = } = /** - * Returns the volatile index. - * = - * @return the volatile index. - */ - VolatileIndex getVolatileIndex() - { - return volatileIndex; - } - - /** * Closes this MultiIndex. */ void close() @@ -1007,11 +717,6 @@ = synchronized (this) { - // stop timer - if (flushTask !=3D null) - { - flushTask.cancel(); - } = // commit / close indexes try @@ -1022,18 +727,21 @@ { log.error("Exception while closing search index.", e); } - try - { - flush(); - } - catch (IOException e) - { - log.error("Exception while closing search index.", e); - } - volatileIndex.close(); + // try + // { + // // TODO commented line below: + // //flush(); + // } + // catch (IOException e) + // { + // log.error("Exception while closing search ind= ex.", e); + // } + // TODO commented line below: + //volatileIndex.close(); + // indexes will be closed now: for (int i =3D 0; i < indexes.size(); i++) { - ((PersistentIndex)indexes.get(i)).close(); + (indexes.get(i)).close(); } = // close indexing queue @@ -1112,83 +820,6 @@ } = /** - * Removes the index from the list of active sub indexes. = The - * Index is not acutally deleted right away, but postponed to the - * transaction commit. - *

    - * This method does not close the index, but rather expects that the in= dex - * has already been closed. - * = - * @param index - * the index to delete. - */ - synchronized void deleteIndex(PersistentIndex index) - { - // remove it from the lists if index is registered - indexes.remove(index); - indexNames.removeName(index.getName()); - synchronized (deletable) - { - log.debug("Moved " + index.getName() + " to deletable"); - deletable.add(index.getName()); - } - } - - /** - * Flushes this MultiIndex. Persists all pending changes a= nd - * resets the redo log. - * = - * @throws IOException - * if the flush fails. - */ - public void flush() throws IOException - { - synchronized (this) - { - // commit volatile index - // TODO: this was removed - //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); - commitVolatileIndex(); - - // commit persistent indexes - for (int i =3D indexes.size() - 1; i >=3D 0; i--) - { - PersistentIndex index =3D (PersistentIndex)indexes.get(i); - // only commit indexes we own - // index merger also places PersistentIndex instances in - // indexes, - // but does not make them public by registering the name in - // indexNames - if (indexNames.contains(index.getName())) - { - index.commit(); - // check if index still contains documents - if (index.getNumDocuments() =3D=3D 0) - { - // TODO THIS was replaced - //executeAndLog(new DeleteIndex(getTransactionId(), inde= x.getName())); - - index.close(); - deleteIndex(index); - - } - } - } - // TODO : this was replaced - //executeAndLog(new Commit(getTransactionId())); - - indexNames.write(); - - // reset redo log - lastFlushTime =3D System.currentTimeMillis(); - lastFileSystemFlushTime =3D System.currentTimeMillis(); - } - - // delete obsolete indexes - attemptDelete(); - } - - /** * Releases the {@link #multiReader} and sets it null. If = the * reader is already null this method does nothing. When t= his * method returns {@link #multiReader} is guaranteed to be null @@ -1227,143 +858,6 @@ // >------------------------------------- = /** - * Enqueues unused segments for deletion in {@link #deletable}. This me= thod - * does not synchronize on {@link #deletable}! A caller must ensure tha= t it - * is the only one acting on the {@link #deletable} map. - * = - * @throws IOException - * if an error occurs while reading directories. - */ - private void enqueueUnusedSegments() throws IOException - { - // walk through index segments - String[] dirNames =3D directoryManager.getDirectoryNames(); - for (int i =3D 0; i < dirNames.length; i++) - { - if (dirNames[i].startsWith("_") && !indexNames.contains(dirNames[= i])) - { - deletable.add(dirNames[i]); - } - } - } - - /** - * Cancel flush task and add new one - */ - private void scheduleFlushTask() - { - SecurityHelper.doPriviledgedAction(new PrivilegedAction() - { - public Object run() - { - // cancel task - if (flushTask !=3D null) - { - flushTask.cancel(); - } - // clear canceled tasks - FLUSH_TIMER.purge(); - // new flush task, cause canceled can't be re-used - flushTask =3D new TimerTask() - { - @Override - public void run() - { - // check if there are any indexing jobs finished - checkIndexingQueue(); - // check if volatile index should be flushed - checkFlush(); - } - }; - FLUSH_TIMER.schedule(flushTask, 0, 1000); - lastFlushTime =3D System.currentTimeMillis(); - lastFileSystemFlushTime =3D System.currentTimeMillis(); - return null; - } - }); - } - - /** - * Resets the volatile index to a new instance. - */ - private void resetVolatileIndex() throws IOException - { - volatileIndex =3D new VolatileIndex(handler.getTextAnalyzer(), handl= er.getSimilarity(), indexingQueue); - volatileIndex.setUseCompoundFile(handler.getUseCompoundFile()); - volatileIndex.setMaxFieldLength(handler.getMaxFieldLength()); - volatileIndex.setBufferSize(handler.getBufferSize()); - } - - /** - * Checks if it is needed to commit the volatile index according to - * {@link SearchIndex#getMaxVolatileIndexSize()}. - * = - * @return true if the volatile index has been committed, - * false otherwise. - * @throws IOException - * if an error occurs while committing the volatile index. - */ - private boolean checkVolatileCommit() throws IOException - { - if (volatileIndex.getRamSizeInBytes() >=3D handler.getMaxVolatileInd= exSize()) - { - commitVolatileIndex(); - return true; - } - return false; - } - - /** - * Commits the volatile index to a persistent index. The new persistent - * index is added to the list of indexes but not written to disk. When = this - * method returns a new volatile index has been created. - * = - * @throws IOException - * if an error occurs while writing the volatile index to d= isk. - */ - private void commitVolatileIndex() throws IOException - { - - // check if volatile index contains documents at all - if (volatileIndex.getNumDocuments() > 0) - { - - long time =3D System.currentTimeMillis(); - // create index - - //TODO this was replaced - // CreateIndex create =3D new CreateIndex(getTransactionI= d(), null); - // executeAndLog(create); - - PersistentIndex idx =3D getOrCreateIndex(null); - - // commit volatile index - - // TODO THIS IS REPLACED - //executeAndLog(new VolatileCommit(getTransactionId(), idx.getNam= e())); - - idx.copyIndex(volatileIndex); - resetVolatileIndex(); - - // TODO this is replaced - // add new index - // AddIndex add =3D new AddIndex(getTransactionId(), crea= te.getIndexName()); - // executeAndLog(add); - - if (!indexNames.contains(idx.getName())) - { - indexNames.addName(idx.getName()); - } - - // create new volatile index - resetVolatileIndex(); - - time =3D System.currentTimeMillis() - time; - log.debug("Committed in-memory index in " + time + "ms."); - } - } - - /** * Recursively creates an index starting with the NodeState * node. * = @@ -1395,7 +889,7 @@ = // TODO: this is replaced //executeAndLog(new AddNode(getTransactionId(), node.getIdentifier()= )); - volatileIndex.addDocuments(new Document[]{createDocument(node)}); + getChunk(node.getIdentifier()).addDocuments(new Document[]{createDoc= ument(node)}); = if (++count % 100 =3D=3D 0) { @@ -1406,7 +900,8 @@ { checkIndexingQueue(true); } - checkVolatileCommit(); + // TODO commented line below: + //checkVolatileCommit(); List children =3D stateMgr.getChildNodesData(node); for (NodeData nodeData : children) { @@ -1428,28 +923,6 @@ } = /** - * Attempts to delete all files recorded in {@link #deletable}. - */ - private void attemptDelete() - { - synchronized (deletable) - { - for (Iterator it =3D deletable.iterator(); it.hasNext();) - { - String indexName =3D (String)it.next(); - if (directoryManager.delete(indexName)) - { - it.remove(); - } - else - { - log.info("Unable to delete obsolete index: " + indexName); - } - } - } - } - - /** * Removes the deletable file if it exists. The file is not used anymor= e in * Jackrabbit versions >=3D 1.5. */ @@ -1477,52 +950,6 @@ } = /** - * Checks the duration between the last commit to this index and the cu= rrent - * time and flushes the index (if there are changes at all) if the dura= tion - * (idle time) is more than {@link SearchIndex#getVolatileIdleTime()} - * seconds. - */ - private synchronized void checkFlush() - { - long idleTime =3D System.currentTimeMillis() - lastFlushTime; - long volatileTime =3D System.currentTimeMillis() - lastFileSystemFlu= shTime; - // do not flush if volatileIdleTime is zero or negative - if ((handler.getVolatileIdleTime() > 0 && idleTime > handler.getVola= tileIdleTime() * 1000) - || (handler.getMaxVolatileTime() > 0 && volatileTime > handler.ge= tMaxVolatileTime() * 1000)) - { - try - { - { - log.debug("Flushing index after being idle for " + idleTime= + " ms."); - synchronized (updateMonitor) - { - //updateInProgress =3D true; - indexUpdateMonitor.setUpdateInProgress(true, true); - } - try - { - flush(); - } - finally - { - synchronized (updateMonitor) - { - //updateInProgress =3D false; - indexUpdateMonitor.setUpdateInProgress(false, true); - updateMonitor.notifyAll(); - releaseMultiReader(); - } - } - } - } - catch (IOException e) - { - log.error("Unable to commit volatile index", e); - } - } - } - - /** * Checks the indexing queue for finished text extrator jobs and update= s the * index accordingly if there are any new ones. This method is synchron= ized * and should only be called by the timer task that periodically checks= if @@ -1547,7 +974,7 @@ private void checkIndexingQueue(boolean transactionPresent) { Document[] docs =3D indexingQueue.getFinishedDocuments(); - Map finished =3D new HashMap(); + Map finished =3D new HashMap(); for (int i =3D 0; i < docs.length; i++) { String uuid =3D docs[i].get(FieldNames.UUID); @@ -1560,21 +987,21 @@ log.info("updating index with {} nodes from indexing queue.", new= Long(finished.size())); = // remove documents from the queue - for (Iterator it =3D finished.keySet().iterator(); it.hasNext();) + for (Iterator it =3D finished.keySet().iterator(); it.has= Next();) { - indexingQueue.removeDocument(it.next().toString()); + indexingQueue.removeDocument(it.next()); } = try { if (transactionPresent) { - for (Iterator it =3D finished.keySet().iterator(); it.hasNe= xt();) + for (Iterator it =3D finished.keySet().iterator(); = it.hasNext();) { // TODO this was replaced //executeAndLog(new DeleteNode(getTransactionId(), (Stri= ng)it.next())); = - String uuidString =3D (String)it.next(); + String uuidString =3D it.next(); // check if indexing queue is still working on // this node from a previous update Document doc =3D indexingQueue.removeDocument(uuidString= ); @@ -1585,13 +1012,13 @@ Term idTerm =3D new Term(FieldNames.UUID, uuidString); // if the document cannot be deleted from the volatile i= ndex // delete it from one of the persistent indexes. - int num =3D volatileIndex.removeDocument(idTerm); + int num =3D getChunk(uuidString).removeDocument(idTerm); if (num =3D=3D 0) { for (int i =3D indexes.size() - 1; i >=3D 0; i--) { // only look in registered indexes - PersistentIndex idx =3D (PersistentIndex)indexes.g= et(i); + PersistentIndex idx =3D indexes.get(i); if (indexNames.contains(idx.getName())) { num =3D idx.removeDocument(idTerm); @@ -1604,11 +1031,13 @@ } = } - for (Iterator it =3D finished.values().iterator(); it.hasNe= xt();) + for (Iterator it =3D finished.values().iterator()= ; it.hasNext();) { // TODO this was replaced //executeAndLog(new AddNode(getTransactionId(), (Documen= t)it.next())); - volatileIndex.addDocuments(new Document[]{(Document)it.n= ext()}); + Document doc =3D it.next(); + String uuid =3D doc.get(FieldNames.UUID); + getChunk(uuid).addDocuments(new Document[]{doc}); } } else @@ -1627,154 +1056,14 @@ // ------------------------< Actions // >--------------------------------------- = - /** - * @see org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListe= ner#onChangeMode(org.exoplatform.services.jcr.impl.core.query.IndexerIoMode) - */ - public void onChangeMode(IndexerIoMode mode) - { - try - { - switch (mode) - { - case READ_ONLY : - setReadOny(); - break; - case READ_WRITE : - setReadWrite(); - break; - } - } - catch (IOException e) - { - log.error("An error occurs while changing of mode " + mode, e); - } - } - - /** - * Sets mode to READ_ONLY, discarding flush task - */ - protected void setReadOny() - { - // try to stop merger in safe way - flushTask.cancel(); - FLUSH_TIMER.purge(); - } - - /** - * Sets mode to READ_WRITE, initiating recovery process - * = - * @throws IOException - */ - protected void setReadWrite() throws IOException - { - // Release all the current threads - synchronized (updateMonitor) - { - indexUpdateMonitor.setUpdateInProgress(false, true); - updateMonitor.notifyAll(); - releaseMultiReader(); - } - - // enqueue unused segments for deletion - enqueueUnusedSegments(); - attemptDelete(); - - // now that we are ready, start index merger - flush(); - - if (indexNames.size() > 0) - { - scheduleFlushTask(); - } - } - - /** - * Refresh list of indexes. Used to be called asynchronously when list = changes. New, actual list is read from = - * IndexInfos. - * @throws IOException - */ - public void refreshIndexList() throws IOException - { - // TODO: re-study synchronization here. - synchronized (updateMonitor) - { - // release reader if any - releaseMultiReader(); - // prepare added/removed sets - Set newList =3D new HashSet(indexNames.getNames()= ); - - // remove removed indexes - Iterator iterator =3D indexes.iterator(); - while (iterator.hasNext()) - { - PersistentIndex index =3D iterator.next(); - String name =3D index.getName(); - // if current index not in new list, close it, cause it is del= eted. - if (!newList.contains(name)) - { - index.close(); - iterator.remove(); - } - else - { - // remove from list, cause this segment of index still pres= ent and indexes list contains - // PersistentIndex instance related to this index.. - newList.remove(name); - } - } - // now newList contains ONLY new, added indexes, deleted indexes,= are removed from list. - for (String name : newList) - { - // only open if it still exists - // it is possible that indexNames still contains a name for - // an index that has been deleted, but indexNames has not been - // written to disk. - if (!directoryManager.hasDirectory(name)) - { - log.debug("index does not exist anymore: " + name); - // move on to next index - continue; - } - PersistentIndex index =3D - new PersistentIndex(name, handler.getTextAnalyzer(), handle= r.getSimilarity(), cache, indexingQueue, - directoryManager); - index.setMaxFieldLength(handler.getMaxFieldLength()); - index.setUseCompoundFile(handler.getUseCompoundFile()); - index.setTermInfosIndexDivisor(handler.getTermInfosIndexDiviso= r()); - indexes.add(index); - } - } - } - - /** - * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdate= MonitorListener#onUpdateInProgressChange(boolean) - */ - public void onUpdateInProgressChange(boolean updateInProgress) - { - if (modeHandler.getMode() =3D=3D IndexerIoMode.READ_ONLY) - { - if (!updateInProgress) - { - // wake up the sleeping threads - try - { - synchronized (updateMonitor) - { - updateMonitor.notifyAll(); - releaseMultiReader(); - } - } - catch (IOException e) - { - log.error("An erro occurs while trying to wake up the sleep= ing threads", e); - } - } - } - } - @Deprecated public boolean getRedoLogApplied() { return false; } + + private PersistentIndex getChunk(String uuid) + { + return indexes.get(0); + } } Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/test/java/org/ex= oplatform/services/jcr/api/core/query/lucene/IndexingAggregateTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/test/java/org/exoplatf= orm/services/jcr/api/core/query/lucene/IndexingAggregateTest.java 2010-10-1= 1 11:27:31 UTC (rev 3287) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/test/java/org/exoplatf= orm/services/jcr/api/core/query/lucene/IndexingAggregateTest.java 2010-10-1= 1 12:17:47 UTC (rev 3288) @@ -106,7 +106,7 @@ { SearchIndex index =3D (SearchIndex)getQueryHandler(); IndexingQueue queue =3D index.getIndex().getIndexingQueue(); - index.getIndex().flush(); + //index.getIndex().flush(); synchronized (index.getIndex()) { while (queue.getNumPendingDocuments() > 0) --===============4144942295842916740==-- From do-not-reply at jboss.org Mon Oct 11 08:57:26 2010 Content-Type: multipart/mixed; boundary="===============3423680585383511084==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3289 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Mon, 11 Oct 2010 08:57:26 -0400 Message-ID: <201010111257.o9BCvQkv008261@svn01.web.mwc.hst.phx2.redhat.com> --===============3423680585383511084== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-11 08:57:25 -0400 (Mon, 11 Oct 2010) New Revision: 3289 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/exojcr-backup-service.xml Log: EXOJCR-747: fix doc Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/exojcr-backup-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-10-11 12:17:47 UTC (rev = 3288) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/exojcr-backup-service.xml 2010-10-11 12:57:25 UTC (rev = 3289) @@ -483,7 +483,7 @@
    Restore existing workspace or repository = - The resore of existing workspace or repositry is avaleble. + The resore of existing workspace or repositry is available. = For restore will be used spacial methods: = --===============3423680585383511084==-- From do-not-reply at jboss.org Mon Oct 11 11:59:51 2010 Content-Type: multipart/mixed; boundary="===============5408843740644787026==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3290 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc. Date: Mon, 11 Oct 2010 11:59:50 -0400 Message-ID: <201010111559.o9BFxowC002268@svn01.web.mwc.hst.phx2.redhat.com> --===============5408843740644787026== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-11 11:59:50 -0400 (Mon, 11 Oct 2010) New Revision: 3290 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/SingleMethodCallCommand.java Log: EXOJCR-967: Revert last change, the SingleMethodCallCommand must only allow= public methods Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/SingleMethodCallCommand.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/SingleMethodCallCommand.java 2010-10-11 12:57:25 UTC (rev 3289) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/SingleMethodCallCommand.java 2010-10-11 15:59:50 UTC (rev 3290) @@ -88,9 +88,9 @@ } this.component =3D component; this.method =3D component.getClass().getDeclaredMethod(methodName, p= arameterTypes); - if (Modifier.isPrivate(method.getModifiers())) + if (!Modifier.isPublic(method.getModifiers())) { - throw new IllegalArgumentException("The method '" + methodName + = "' cannot be private"); + throw new IllegalArgumentException("The method '" + methodName + = "' is not public"); } this.id =3D getId(component, method); } --===============5408843740644787026==-- From do-not-reply at jboss.org Mon Oct 11 12:33:49 2010 Content-Type: multipart/mixed; boundary="===============8645960644302998628==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3291 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel. Date: Mon, 11 Oct 2010 12:33:49 -0400 Message-ID: <201010111633.o9BGXn31009975@svn01.web.mwc.hst.phx2.redhat.com> --===============8645960644302998628== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-11 12:33:49 -0400 (Mon, 11 Oct 2010) New Revision: 3291 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/rpc-service.xml Log: EXOJCR-967: Doc improved Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/rpc-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml 2010-10-11 15:59:50 UTC (rev 3290) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml 2010-10-11 16:33:49 UTC (rev 3291) @@ -199,9 +199,10 @@ proposed by default. This command will dynamically execute a method on= a given object. = - // Register the command first + // Register the command first (to be done before that = the RPCService has been started) RemoteCommand commandGetName =3D rpcService.registerCommand(new SingleMeth= odCallCommand(myService, "getName")); -// Execute the command on the coordinator +... +// Execute the command on the coordinator (can be done only after having s= tarted the RPCService) String name =3D rpcService.executeCommandOnCoordinator(commandGetName, tru= e); // Print the name System.out.println("Name : " + name); @@ -212,8 +213,8 @@ Register a SingleMethodCallCommand that will call getName() on the Object - myService anytime the command will be - executed. + myService anytime the command will be execute= d. + = @@ -226,5 +227,24 @@ Print the name got from the coordinator + + + As any RemoteCommand, it has to be regist= ered + before being executed and before the RPCService= is + launched. + + + + As any RemoteCommand, the command can be + executed only once the RPCService is + launched. + + + + The SingleMethodCallCommand only allow pu= blic + methods, if you try to register a non public method an + RPCException will be thrown at creation + level. +
    --===============8645960644302998628==-- From do-not-reply at jboss.org Tue Oct 12 05:47:35 2010 Content-Type: multipart/mixed; boundary="===============0852759236819127581==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3292 - in jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query: jbosscache and 1 other directories. Date: Tue, 12 Oct 2010 05:47:34 -0400 Message-ID: <201010120947.o9C9lYIE000798@svn01.web.mwc.hst.phx2.redhat.com> --===============0852759236819127581== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2010-10-12 05:47:34 -0400 (Tue, 12 Oct 2010) New Revision: 3292 Added: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/ChunkIndex.java Removed: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/MultiIndex.java Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/AbstractQueryHandler.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/QueryHandler.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/ConsistencyCheck.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/IndexInfos.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/IndexingQueue.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/SearchIndex.java Log: EXOJCR-987 : Cleaning up the code, simplifying. Refactoring. Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/AbstractQueryHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/AbstractQueryHandler.java 2010-10-11 16:33= :49 UTC (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/AbstractQueryHandler.java 2010-10-12 09:47= :34 UTC (rev 3292) @@ -21,7 +21,7 @@ import org.exoplatform.services.jcr.impl.core.query.lucene.DefaultIndexUpd= ateMonitor; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMoni= tor; -import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex; +import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = @@ -70,7 +70,7 @@ protected IndexerIoModeHandler modeHandler; = /** - * {@link IndexInfos} instance that is passed to {@link MultiIndex} + * {@link IndexInfos} instance that is passed to {@link ChunkIndex} */ protected IndexInfos indexInfos; = Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/QueryHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/QueryHandler.java 2010-10-11 16:33:49 UTC = (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/QueryHandler.java 2010-10-12 09:47:34 UTC = (rev 3292) @@ -23,7 +23,7 @@ import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMoni= tor; -import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex; +import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; = import java.io.IOException; @@ -156,7 +156,7 @@ QueryHits executeQuery(Query query) throws IOException; = /** - * Sets {@link IndexInfos} instance into QueryHandler, which is later p= assed to {@link MultiIndex}. + * Sets {@link IndexInfos} instance into QueryHandler, which is later p= assed to {@link ChunkIndex}. * = * @param indexInfos */ Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-= 10-11 16:33:49 UTC (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-= 10-12 09:47:34 UTC (rev 3292) @@ -22,7 +22,7 @@ import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; -import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex; +import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.exoplatform.services.jcr.impl.util.io.PrivilegedCacheHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Copied: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/core/query/lucene/ChunkIndex.java (from rev 3288,= jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/core/query/lucene/MultiIndex.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/ChunkIndex.java = (rev 0) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/ChunkIndex.java 2010-10-12 09:47:34= UTC (rev 3292) @@ -0,0 +1,795 @@ +/* + * 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.lucene; + +import org.apache.lucene.document.Document; +import org.apache.lucene.index.IndexReader; +import org.apache.lucene.index.Term; +import org.apache.lucene.store.Directory; +import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; +import org.exoplatform.services.jcr.datamodel.ItemData; +import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; +import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; +import org.exoplatform.services.jcr.impl.core.query.IndexingTree; +import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Direc= toryManager; +import org.exoplatform.services.jcr.impl.util.SecurityHelper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.security.PrivilegedExceptionAction; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Map.Entry; + +import javax.jcr.ItemNotFoundException; +import javax.jcr.RepositoryException; + +/** + * TODO REWRITE JAVADOC!!! + */ +public class ChunkIndex +{ + + /** + * The logger instance for this class + */ + private static final Logger log =3D LoggerFactory.getLogger("exo.jcr.co= mponent.core.MultiIndex"); + + /** + * Names of active persistent index directories. + */ + private IndexInfos indexNames; + + /** + * List of open persistent indexes. This list may also contain an open + * PersistentIndex owned by the IndexMerger daemon. Such an index is not + * registered with indexNames and must not be used in regular in= dex + * operations (delete node, etc.)! + */ + private final List indexes =3D new ArrayList(); + + /** + * The internal namespace mappings of the query manager. + */ + private final NamespaceMappings nsMappings; + + /** + * The directory manager. + */ + private final DirectoryManager directoryManager; + + /** + * The base directory to store the index. + */ + private final Directory indexDir; + + /** + * The query handler + */ + private final SearchIndex handler; + + /** + * If not null points to a valid IndexReader = that + * reads from all indexes, including volatile and persistent indexes. + */ + private CachingMultiIndexReader multiReader; + + /** + * Shared document number cache across all persistent indexes. + */ + private final DocNumberCache cache; + + /** + * The indexing queue with pending text extraction jobs. + */ + private IndexingQueue indexingQueue; + + /** + * Set<NodeId> of uuids that should not be indexed. + */ + private final IndexingTree indexingTree; + + /** + * Flag indicating whether re-indexing is running. + */ + private boolean reindexing =3D false; + + /** + * The index format version of this multi index. + */ + private final IndexFormatVersion version; + + /** + * The handler of the Indexer io mode + */ + private final IndexerIoModeHandler modeHandler; + + /** + * Creates a new MultiIndex. + * = + * @param handler + * the search handler + * @param excludedIDs + * Set<NodeId> that contains uuids that should not be ind= exed + * nor further traversed. + * @throws IOException + * if an error occurs + */ + ChunkIndex(SearchIndex handler, IndexingTree indexingTree, IndexerIoMod= eHandler modeHandler, IndexInfos indexInfos, + IndexUpdateMonitor indexUpdateMonitor) throws IOException + { + this.modeHandler =3D modeHandler; + this.directoryManager =3D handler.getDirectoryManager(); + // this method is run in privileged mode internally + this.indexDir =3D directoryManager.getDirectory("."); + this.handler =3D handler; + this.cache =3D new DocNumberCache(handler.getCacheSize()); + this.indexingTree =3D indexingTree; + this.nsMappings =3D handler.getNamespaceMappings(); + this.indexNames =3D indexInfos; + this.indexNames.setDirectory(indexDir); + // this method is run in privileged mode internally + this.indexNames.read(); + + // TODO remove hard-coded piece + this.indexNames.addName("1"); + this.indexNames.addName("2"); + this.indexNames.addName("3"); + this.indexNames.addName("4"); + + // this method is run in privileged mode internally + IndexingQueueStore store =3D new IndexingQueueStore(indexDir); + + // initialize indexing queue + this.indexingQueue =3D new IndexingQueue(store); + // copy current index names + Set currentNames =3D new HashSet(indexNames.getNames= ()); + + // open persistent indexes + for (String name : currentNames) + { + // only open if it still exists + // it is possible that indexNames still contains a name for + // an index that has been deleted, but indexNames has not been + // written to disk. + + // TODO THIS CHECK WAS SKIPPED + // if (!directoryManager.hasDirectory(name)) + // { + // log.debug("index does not exist anymore: " + name); + // // move on to next index + // continue; + // } + PersistentIndex index =3D + new PersistentIndex(name, handler.getTextAnalyzer(), handler.g= etSimilarity(), cache, indexingQueue, + directoryManager); + index.setMaxFieldLength(handler.getMaxFieldLength()); + index.setUseCompoundFile(handler.getUseCompoundFile()); + index.setTermInfosIndexDivisor(handler.getTermInfosIndexDivisor()= ); + indexes.add(index); + } + + // set index format version and at the same time + // initialize hierarchy cache if requested. + final CachingMultiIndexReader reader =3D getIndexReader(handler.isIn= itializeHierarchyCache()); + try + { + version =3D IndexFormatVersion.getVersion(reader); + } + finally + { + SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExcep= tionAction() + { + public Object run() throws Exception + { + reader.release(); + return null; + } + }); + } + indexingQueue.initialize(this); + this.indexNames.setMultiIndex(this); + } + + /** + * Returns the number of documents in this index. + * = + * @return the number of documents in this index. + * @throws IOException + * if an error occurs while reading from the index. + */ + int numDocs() throws IOException + { + if (indexNames.size() =3D=3D 0) + { + return 0; + } + else + { + final CachingMultiIndexReader reader =3D getIndexReader(); + try + { + return reader.numDocs(); + } + finally + { + SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedEx= ceptionAction() + { + public Object run() throws Exception + { + reader.release(); + return null; + } + }); + } + } + } + + /** + * @return the index format version for this multi index. + */ + IndexFormatVersion getIndexFormatVersion() + { + return version; + } + + /** + * Creates an initial index by traversing the node hierarchy starting a= t the + * node with rootId. + * = + * @param stateMgr + * the item state manager. + * @param rootId + * the id of the node from where to start. + * @param rootPath + * the path of the node from where to start. + * @throws IOException + * if an error occurs while indexing the workspace. + * @throws IllegalStateException + * if this index is not empty. + */ + void createInitialIndex(ItemDataConsumer stateMgr) throws IOException + { + // TODO: re-study check!!! = + CachingMultiIndexReader reader =3D getIndexReader(); + int numDocs =3D reader.numDocs(); + reader.release(); + if (numDocs =3D=3D 0) + { + reindexing =3D true; + try + { + long count =3D 0; + // traverse and index workspace + + // NodeData rootState =3D (NodeData) stateMgr.getItemData(root= Id); + count =3D createIndex(indexingTree.getIndexingRoot(), stateMgr= , count); + + log.info("Created initial index for {} nodes", new Long(count)= ); + releaseMultiReader(); + } + catch (Exception e) + { + String msg =3D "Error indexing workspace"; + IOException ex =3D new IOException(msg); + ex.initCause(e); + throw ex; + } + finally + { + reindexing =3D false; + } + } + else + { + throw new IllegalStateException("Index already present"); + } + } + + /** + * Atomically updates the index by removing some documents and adding + * others. + * = + * @param remove + * collection of UUIDs that identify documents = to + * remove + * @param add + * collection of Documents to add. Some of the + * elements in this collection may be null, to + * indicate that a node could not be indexed successfully. + * @throws IOException + * if an error occurs while updating the index. + */ + synchronized void update(final Collection remove, final Collect= ion add) throws IOException + { + SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() + { + public Object run() throws Exception + { + // make sure a reader is available during long updates + if (add.size() > handler.getBufferSize()) + { + try + { + getIndexReader().release(); + } + catch (IOException e) + { + // do not fail if an exception is thrown here + log.warn("unable to prepare index reader " + "for querie= s during update", e); + } + } + try + { + for (Iterator it =3D remove.iterator(); it.hasNext(= );) + { + String uuidString =3D it.next(); + // check if indexing queue is still working on + // this node from a previous update + Document doc =3D indexingQueue.removeDocument(uuidString= ); + if (doc !=3D null) + { + Util.disposeDocument(doc); + } + Term idTerm =3D new Term(FieldNames.UUID, uuidString); + getChunk(uuidString).removeDocument(idTerm); + } + for (Iterator it =3D add.iterator(); it.hasNext()= ;) + { + Document doc =3D it.next(); + if (doc !=3D null) + { + if (doc !=3D null) + { + String uuid =3D doc.get(FieldNames.UUID); + getChunk(uuid).addDocuments(new Document[]{doc}); + } + } + } + // TODO for owning indexes only + for (PersistentIndex idx : indexes) + { + idx.commit(); + } + } + finally + { + releaseMultiReader(); + } + return null; + } + }); + } + + /** + * Adds a document to the index. + * = + * @param doc + * the document to add. + * @throws IOException + * if an error occurs while adding the document to the inde= x. + */ + void addDocument(Document doc) throws IOException + { + update(Collections.EMPTY_LIST, Arrays.asList(new Document[]{doc})); + } + + /** + * Deletes the first document that matches the uuid. + * = + * @param uuid + * document that match this uuid will be delete= d. + * @throws IOException + * if an error occurs while deleting the document. + */ + void removeDocument(String uuid) throws IOException + { + update(Arrays.asList(new String[]{uuid}), Collections.EMPTY_LIST); + } + + /** + * Deletes all documents that match the uuid. + * = + * @param uuid + * documents that match this uuid will be delet= ed. + * @return the number of deleted documents. + * @throws IOException + * if an error occurs while deleting documents. + */ + synchronized int removeAllDocuments(String uuid) throws IOException + { + int num; + try + { + Term idTerm =3D new Term(FieldNames.UUID, uuid.toString()); + num =3D getChunk(uuid).removeDocument(idTerm); + for (int i =3D 0; i < indexes.size(); i++) + { + PersistentIndex index =3D indexes.get(i); + // TODO only remove documents from owning indexes + int removed =3D index.removeDocument(idTerm); + num +=3D removed; + } + } + finally + { + releaseMultiReader(); + } + return num; + } + + /** + * Returns an read-only IndexReader that spans alls indexe= s of + * this MultiIndex. + * = + * @return an IndexReader. + * @throws IOException + * if an error occurs constructing the IndexReader. + */ + public CachingMultiIndexReader getIndexReader() throws IOException + { + return getIndexReader(false); + } + + /** + * Returns an read-only IndexReader that spans alls indexe= s of + * this MultiIndex. + * = + * @param initCache + * when set true the hierarchy cache is complet= ely + * initialized before this call returns. + * @return an IndexReader. + * @throws IOException + * if an error occurs constructing the IndexReader. + */ + public synchronized CachingMultiIndexReader getIndexReader(final boolea= n initCache) throws IOException + { + return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedE= xceptionAction() + { + public CachingMultiIndexReader run() throws Exception + { + if (multiReader !=3D null) + { + multiReader.acquire(); + return multiReader; + } + // no reader available + // some other read thread might have created the reader in the + // meantime -> check again + if (multiReader =3D=3D null) + { + List readerList =3D new ArrayList(); + for (PersistentIndex idx : indexes) + { + readerList.add(idx.getReadOnlyIndexReader(initCache)); + } + ReadOnlyIndexReader[] readers =3D readerList.toArray(new Re= adOnlyIndexReader[readerList.size()]); + multiReader =3D new CachingMultiIndexReader(readers, cache); + } + multiReader.acquire(); + return multiReader; + } + }); + + } + + /** + * Closes this MultiIndex. + */ + void close() + { + if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE)) + { + + // stop index merger + // when calling this method we must not lock this MultiIndex, oth= erwise + // a deadlock might occur + + synchronized (this) + { + + // commit / close indexes + try + { + releaseMultiReader(); + } + catch (IOException e) + { + log.error("Exception while closing search index.", e); + } + + // TODO Should they be commited before close?! + for (int i =3D 0; i < indexes.size(); i++) + { + (indexes.get(i)).close(); + } + + // close indexing queue + indexingQueue.close(); + + // finally close directory + try + { + indexDir.close(); + } + catch (IOException e) + { + log.error("Exception while closing directory.", e); + } + } + } + } + + /** + * Returns the namespace mappings of this search index. + * = + * @return the namespace mappings of this search index. + */ + NamespaceMappings getNamespaceMappings() + { + return nsMappings; + } + + /** + * Returns the indexing queue for this multi index. + * = + * @return the indexing queue for this multi index. + */ + public IndexingQueue getIndexingQueue() + { + return indexingQueue; + } + + /** + * Returns a lucene Document for the node. + * = + * @param node + * the node to index. + * @return the index document. + * @throws RepositoryException + * if an error occurs while reading from the workspace. + */ + Document createDocument(NodeData node) throws RepositoryException + { + return handler.createDocument(node, nsMappings, version); + } + + /** + * Returns a lucene Document for the Node with id. + * = + * @param id + * the id of the node to index. + * @return the index document. + * @throws RepositoryException + * if an error occurs while reading from the workspace or if + * there is no node with id. + */ + Document createDocument(String id) throws RepositoryException + { + ItemData data =3D handler.getContext().getItemStateManager().getItem= Data(id); + if (data =3D=3D null) + { + throw new ItemNotFoundException("Item id=3D" + id + " not found"); + } + if (!data.isNode()) + { + throw new RepositoryException("Item with id " + id + " is not a n= ode"); + } + return createDocument((NodeData)data); + + } + + /** + * Releases the {@link #multiReader} and sets it null. If = the + * reader is already null this method does nothing. When t= his + * method returns {@link #multiReader} is guaranteed to be null + * even if an exception is thrown. + *

    + * Please note that this method does not take care of any synchronizati= on. A + * caller must ensure that it is the only thread operating on this multi + * index, or that it holds the {@link #updateMonitor}. + * = + * @throws IOException + * if an error occurs while releasing the reader. + */ + void releaseMultiReader() throws IOException + { + SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() + { + public Object run() throws Exception + { + if (multiReader !=3D null) + { + try + { + multiReader.release(); + } + finally + { + multiReader =3D null; + } + } + return null; + } + }); + } + + // -------------------------< internal + // >------------------------------------- + + /** + * Recursively creates an index starting with the NodeState + * node. + * = + * @param node + * the current NodeState. + * @param path + * the path of the current node. + * @param stateMgr + * the shared item state manager. + * @param count + * the number of nodes already indexed. + * @return the number of nodes indexed so far. + * @throws IOException + * if an error occurs while writing to the index. + * @throws ItemStateException + * if an node state cannot be found. + * @throws RepositoryException + * if any other error occurs + */ + private long createIndex(NodeData node, ItemDataConsumer stateMgr, long= count) throws IOException, + RepositoryException + { + if (indexingTree.isExcluded(node)) + { + return count; + } + getChunk(node.getIdentifier()).addDocuments(new Document[]{createDoc= ument(node)}); + + if (++count % 100 =3D=3D 0) + { + + log.info("indexing... {} ({})", node.getQPath().getAsString(), ne= w Long(count)); + } + if (count % 10 =3D=3D 0) + { + checkIndexingQueue(true); + } + List children =3D stateMgr.getChildNodesData(node); + for (NodeData nodeData : children) + { + + NodeData childState =3D (NodeData)stateMgr.getItemData(nodeData.g= etIdentifier()); + if (childState =3D=3D null) + { + handler.getOnWorkspaceInconsistencyHandler().handleMissingChil= dNode( + new ItemNotFoundException("Child not found "), handler, nod= eData.getQPath(), node, nodeData); + } + + if (nodeData !=3D null) + { + count =3D createIndex(nodeData, stateMgr, count); + } + } + + return count; + } + + /** + * Checks the indexing queue for finished text extrator jobs and update= s the + * index accordingly if there are any new ones. This method is synchron= ized + * and should only be called by the timer task that periodically checks= if + * there are documents ready in the indexing queue. A new transaction is + * used when documents are transfered from the indexing queue to the in= dex. + */ + private synchronized void checkIndexingQueue() + { + checkIndexingQueue(false); + } + + /** + * Checks the indexing queue for finished text extrator jobs and update= s the + * index accordingly if there are any new ones. + * = + * @param transactionPresent + * whether a transaction is in progress and the current + * {@link #getTransactionId()} should be used. If + * false a new transaction is created when docu= ments + * are transfered from the indexing queue to the index. + */ + private void checkIndexingQueue(boolean transactionPresent) + { + Document[] docs =3D indexingQueue.getFinishedDocuments(); + Map finished =3D new HashMap(); + for (int i =3D 0; i < docs.length; i++) + { + String uuid =3D docs[i].get(FieldNames.UUID); + finished.put(uuid, docs[i]); + } + + // now update index with the remaining ones if there are any + if (!finished.isEmpty()) + { + log.info("updating index with {} nodes from indexing queue.", new= Long(finished.size())); + + // remove documents from the queue + for (Iterator it =3D finished.keySet().iterator(); it.has= Next();) + { + indexingQueue.removeDocument(it.next()); + } + + try + { + if (transactionPresent) + { + for (Iterator it =3D finished.keySet().iterator(); = it.hasNext();) + { + String uuidString =3D it.next(); + // check if indexing queue is still working on + // this node from a previous update + Document doc =3D indexingQueue.removeDocument(uuidString= ); + if (doc !=3D null) + { + Util.disposeDocument(doc); + } + Term idTerm =3D new Term(FieldNames.UUID, uuidString); + // if the document cannot be deleted from the volatile i= ndex + // delete it from one of the persistent indexes. + getChunk(uuidString).removeDocument(idTerm); + } + for (Iterator it =3D finished.values().iterator()= ; it.hasNext();) + { + Document doc =3D it.next(); + String uuid =3D doc.get(FieldNames.UUID); + getChunk(uuid).addDocuments(new Document[]{doc}); + } + } + else + { + update(finished.keySet(), finished.values()); + } + } + catch (IOException e) + { + // update failed + log.warn("Failed to update index with deferred text extraction= ", e); + } + } + } + + @Deprecated + public boolean getRedoLogApplied() + { + return false; + } + + private PersistentIndex getChunk(String uuid) + { + return indexes.get(0); + } +} Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/ConsistencyCheck.java 2010-10-11 16= :33:49 UTC (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/ConsistencyCheck.java 2010-10-12 09= :47:34 UTC (rev 3292) @@ -61,7 +61,7 @@ /** * The index to check. */ - private final MultiIndex index; + private final ChunkIndex index; = /** * All the document UUIDs within the index. @@ -76,7 +76,7 @@ /** * Private constructor. */ - private ConsistencyCheck(MultiIndex index, ItemDataConsumer mgr) + private ConsistencyCheck(ChunkIndex index, ItemDataConsumer mgr) { this.index =3D index; this.stateMgr =3D mgr; @@ -91,7 +91,7 @@ * @throws IOException if an error occurs while checking. * @throws RepositoryException = */ - static ConsistencyCheck run(MultiIndex index, ItemDataConsumer mgr) thr= ows IOException, RepositoryException + static ConsistencyCheck run(ChunkIndex index, ItemDataConsumer mgr) thr= ows IOException, RepositoryException { ConsistencyCheck check =3D new ConsistencyCheck(index, mgr); check.run(); Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/IndexInfos.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/IndexInfos.java 2010-10-11 16:33:49= UTC (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/IndexInfos.java 2010-10-12 09:47:34= UTC (rev 3292) @@ -74,9 +74,9 @@ private Directory dir; = /** - * {@link MultiIndex} instance for callbacking when list of indexes cha= nged = + * {@link ChunkIndex} instance for callbacking when list of indexes cha= nged = */ - private MultiIndex multiIndex; + private ChunkIndex multiIndex; = /** * Creates a new IndexInfos using "indexes" as a filename. @@ -304,10 +304,10 @@ } = /** - * Sets {@link MultiIndex} instance. = + * Sets {@link ChunkIndex} instance. = * @param multiIndex */ - public void setMultiIndex(MultiIndex multiIndex) + public void setMultiIndex(ChunkIndex multiIndex) { this.multiIndex =3D multiIndex; } @@ -316,7 +316,7 @@ * Returns multiIndex instance = * @return */ - public MultiIndex getMultiIndex() + public ChunkIndex getMultiIndex() { return multiIndex; } Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/IndexingQueue.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/IndexingQueue.java 2010-10-11 16:33= :49 UTC (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/IndexingQueue.java 2010-10-12 09:47= :34 UTC (rev 3292) @@ -57,7 +57,7 @@ = /** * Flag that indicates whether this indexing queue had been - * {@link #initialize(MultiIndex) initialized}. + * {@link #initialize(ChunkIndex) initialized}. */ private volatile boolean initialized =3D false; = @@ -77,7 +77,7 @@ * @param index the multi index this indexing queue belongs to. * @throws IOException if an error occurs while reading from the index. */ - void initialize(final MultiIndex index) throws IOException + void initialize(final ChunkIndex index) throws IOException { SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() { Deleted: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exo= platform/services/jcr/impl/core/query/lucene/MultiIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-11 16:33:49= UTC (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-10-12 09:47:34= UTC (rev 3292) @@ -1,1069 +0,0 @@ -/* - * 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.lucene; - -import org.apache.lucene.document.Document; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.Term; -import org.apache.lucene.store.Directory; -import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; -import org.exoplatform.services.jcr.datamodel.ItemData; -import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; -import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; -import org.exoplatform.services.jcr.impl.core.query.IndexingTree; -import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Direc= toryManager; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Map.Entry; - -import javax.jcr.ItemNotFoundException; -import javax.jcr.RepositoryException; - -/** - * A MultiIndex consists of a {@link VolatileIndex} and multi= ple - * {@link PersistentIndex}es. The goal is to keep most parts of the index = open - * with index readers and write new index data to the volatile index. When= the - * volatile index reaches a certain size (see - * {@link SearchIndex#setMinMergeDocs(int)}) a new persistent index is cre= ated - * with the index data from the volatile index, the same happens when the - * volatile index has been idle for some time (see - * {@link SearchIndex#setVolatileIdleTime(int)}). The new persistent index= is - * then added to the list of already existing persistent indexes. Further - * operations on the new persistent index will however only require an - * IndexReader which serves for queries but also for delete - * operations on the index. - *

    - * The persistent indexes are merged from time to time. The merge behaviou= r is - * configurable using the methods: {@link SearchIndex#setMaxMergeDocs(int)= }, - * {@link SearchIndex#setMergeFactor(int)} and - * {@link SearchIndex#setMinMergeDocs(int)}. For detailed description of t= he - * configuration parameters see also the lucene IndexWriter c= lass. - *

    - * This class is thread-safe. - *

    - * Note on implementation: Multiple modifying threads are synchronized on a - * MultiIndex instance itself. Sychronization between a modif= ying - * thread and reader threads is done using {@link #updateMonitor} and - * {@link #updateInProgress}. - */ -public class MultiIndex -{ - - /** - * The logger instance for this class - */ - private static final Logger log =3D LoggerFactory.getLogger("exo.jcr.co= mponent.core.MultiIndex"); - - /** - * Names of active persistent index directories. - */ - private IndexInfos indexNames; - - /** - * List of open persistent indexes. This list may also contain an open - * PersistentIndex owned by the IndexMerger daemon. Such an index is not - * registered with indexNames and must not be used in regular in= dex - * operations (delete node, etc.)! - */ - private final List indexes =3D new ArrayList(); - - /** - * The internal namespace mappings of the query manager. - */ - private final NamespaceMappings nsMappings; - - /** - * The directory manager. - */ - private final DirectoryManager directoryManager; - - /** - * The base directory to store the index. - */ - private final Directory indexDir; - - /** - * The query handler - */ - private final SearchIndex handler; - - /** - * If not null points to a valid IndexReader = that - * reads from all indexes, including volatile and persistent indexes. - */ - private CachingMultiIndexReader multiReader; - - /** - * Shared document number cache across all persistent indexes. - */ - private final DocNumberCache cache; - - /** - * The indexing queue with pending text extraction jobs. - */ - private IndexingQueue indexingQueue; - - /** - * Set<NodeId> of uuids that should not be indexed. - */ - private final IndexingTree indexingTree; - - /** - * Flag indicating whether re-indexing is running. - */ - private boolean reindexing =3D false; - - /** - * The index format version of this multi index. - */ - private final IndexFormatVersion version; - - /** - * The handler of the Indexer io mode - */ - private final IndexerIoModeHandler modeHandler; - - /** - * Creates a new MultiIndex. - * = - * @param handler - * the search handler - * @param excludedIDs - * Set<NodeId> that contains uuids that should not be ind= exed - * nor further traversed. - * @throws IOException - * if an error occurs - */ - MultiIndex(SearchIndex handler, IndexingTree indexingTree, IndexerIoMod= eHandler modeHandler, IndexInfos indexInfos, - IndexUpdateMonitor indexUpdateMonitor) throws IOException - { - this.modeHandler =3D modeHandler; - this.directoryManager =3D handler.getDirectoryManager(); - // this method is run in privileged mode internally - this.indexDir =3D directoryManager.getDirectory("."); - this.handler =3D handler; - this.cache =3D new DocNumberCache(handler.getCacheSize()); - this.indexingTree =3D indexingTree; - this.nsMappings =3D handler.getNamespaceMappings(); - this.indexNames =3D indexInfos; - this.indexNames.setDirectory(indexDir); - // this method is run in privileged mode internally - this.indexNames.read(); - this.indexNames.addName("1"); - this.indexNames.addName("2"); - this.indexNames.addName("3"); - this.indexNames.addName("4"); - - // this method is run in privileged mode internally - // as of 1.5 deletable file is not used anymore - removeDeletable(); - - // this method is run in privileged mode internally - IndexingQueueStore store =3D new IndexingQueueStore(indexDir); - - // initialize indexing queue - this.indexingQueue =3D new IndexingQueue(store); - // copy current index names - Set currentNames =3D new HashSet(indexNames.getNames= ()); - //Set currentNames =3D new HashSet(); - - // open persistent indexes - for (String name : currentNames) - { - // only open if it still exists - // it is possible that indexNames still contains a name for - // an index that has been deleted, but indexNames has not been - // written to disk. - - // TODO THIS CHECK WAS SKIPPED - // if (!directoryManager.hasDirectory(name)) - // { - // log.debug("index does not exist anymore: " + name); - // // move on to next index - // continue; - // } - PersistentIndex index =3D - new PersistentIndex(name, handler.getTextAnalyzer(), handler.g= etSimilarity(), cache, indexingQueue, - directoryManager); - index.setMaxFieldLength(handler.getMaxFieldLength()); - index.setUseCompoundFile(handler.getUseCompoundFile()); - index.setTermInfosIndexDivisor(handler.getTermInfosIndexDivisor()= ); - indexes.add(index); - } - - // init volatile index - // TODO commented line below: - //resetVolatileIndex(); - - // set index format version and at the same time - // initialize hierarchy cache if requested. - final CachingMultiIndexReader reader =3D getIndexReader(handler.isIn= itializeHierarchyCache()); - try - { - version =3D IndexFormatVersion.getVersion(reader); - } - finally - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExcep= tionAction() - { - public Object run() throws Exception - { - reader.release(); - return null; - } - }); - } - indexingQueue.initialize(this); - this.indexNames.setMultiIndex(this); - } - - /** - * Returns the number of documents in this index. - * = - * @return the number of documents in this index. - * @throws IOException - * if an error occurs while reading from the index. - */ - int numDocs() throws IOException - { - if (indexNames.size() =3D=3D 0) - { - // TODO commented line below: - //return volatileIndex.getNumDocuments(); - return 0; - } - else - { - final CachingMultiIndexReader reader =3D getIndexReader(); - try - { - return reader.numDocs(); - } - finally - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedEx= ceptionAction() - { - public Object run() throws Exception - { - reader.release(); - return null; - } - }); - } - } - } - - /** - * @return the index format version for this multi index. - */ - IndexFormatVersion getIndexFormatVersion() - { - return version; - } - - /** - * Creates an initial index by traversing the node hierarchy starting a= t the - * node with rootId. - * = - * @param stateMgr - * the item state manager. - * @param rootId - * the id of the node from where to start. - * @param rootPath - * the path of the node from where to start. - * @throws IOException - * if an error occurs while indexing the workspace. - * @throws IllegalStateException - * if this index is not empty. - */ - void createInitialIndex(ItemDataConsumer stateMgr) throws IOException - { - - // TODO: re-study check!!! - // only do an initial index if there are no indexes at all - // if (indexNames.size() =3D=3D 0) - { - reindexing =3D true; - try - { - long count =3D 0; - // traverse and index workspace - // TODO: this was removed - //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); - - // NodeData rootState =3D (NodeData) stateMgr.getItemData(root= Id); - count =3D createIndex(indexingTree.getIndexingRoot(), stateMgr= , count); - - // TODO : this was replaced - //executeAndLog(new Commit(getTransactionId())); - - log.info("Created initial index for {} nodes", new Long(count)= ); - releaseMultiReader(); - // TODO commented line below: - //scheduleFlushTask(); - } - catch (Exception e) - { - String msg =3D "Error indexing workspace"; - IOException ex =3D new IOException(msg); - ex.initCause(e); - throw ex; - } - finally - { - reindexing =3D false; - } - } - // else - // { - // throw new IllegalStateException("Index already present"); - // } - } - - /** - * Atomically updates the index by removing some documents and adding - * others. - * = - * @param remove - * collection of UUIDs that identify documents = to - * remove - * @param add - * collection of Documents to add. Some of the - * elements in this collection may be null, to - * indicate that a node could not be indexed successfully. - * @throws IOException - * if an error occurs while updating the index. - */ - synchronized void update(final Collection remove, final Collect= ion add) throws IOException - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - // make sure a reader is available during long updates - if (add.size() > handler.getBufferSize()) - { - try - { - getIndexReader().release(); - } - catch (IOException e) - { - // do not fail if an exception is thrown here - log.warn("unable to prepare index reader " + "for querie= s during update", e); - } - } -// boolean flush =3D false; - try - { - // TODO: this was removed - //executeAndLog(new Start(transactionId)); - - for (Iterator it =3D remove.iterator(); it.hasNext(= );) - { - // TODO this was replaced - //executeAndLog(new DeleteNode(transactionId, (String)it= .next())); - - String uuidString =3D it.next(); - // check if indexing queue is still working on - // this node from a previous update - Document doc =3D indexingQueue.removeDocument(uuidString= ); - if (doc !=3D null) - { - Util.disposeDocument(doc); - } - Term idTerm =3D new Term(FieldNames.UUID, uuidString); - // if the document cannot be deleted from the volatile i= ndex - // delete it from one of the persistent indexes. - - // TODO watch here - int num =3D getChunk(uuidString).removeDocument(idTerm); - if (num =3D=3D 0) - { - for (int i =3D indexes.size() - 1; i >=3D 0; i--) - { - // only look in registered indexes - PersistentIndex idx =3D indexes.get(i); - if (indexNames.contains(idx.getName())) - { - num =3D idx.removeDocument(idTerm); - if (num > 0) - { - break; - } - } - } - } - - } - for (Iterator it =3D add.iterator(); it.hasNext()= ;) - { - Document doc =3D it.next(); - if (doc !=3D null) - { - // TODO: ths is replaced - //executeAndLog(new AddNode(transactionId, doc)); - - if (doc !=3D null) - { - // TODO watch this - String uuid =3D doc.get(FieldNames.UUID); - getChunk(uuid).addDocuments(new Document[]{doc}); - } - - // commit volatile index if needed - // TODO commented line below: - //flush |=3D checkVolatileCommit(); - } - } - - // TODO : this was replaced - //executeAndLog(new Commit(transactionId)); - - // TODO commented line below: - //flush(); - getChunk(null).commit(); - } - finally - { - releaseMultiReader(); - } - return null; - } - }); - } - - /** - * Adds a document to the index. - * = - * @param doc - * the document to add. - * @throws IOException - * if an error occurs while adding the document to the inde= x. - */ - void addDocument(Document doc) throws IOException - { - update(Collections.EMPTY_LIST, Arrays.asList(new Document[]{doc})); - } - - /** - * Deletes the first document that matches the uuid. - * = - * @param uuid - * document that match this uuid will be delete= d. - * @throws IOException - * if an error occurs while deleting the document. - */ - void removeDocument(String uuid) throws IOException - { - update(Arrays.asList(new String[]{uuid}), Collections.EMPTY_LIST); - } - - /** - * Deletes all documents that match the uuid. - * = - * @param uuid - * documents that match this uuid will be delet= ed. - * @return the number of deleted documents. - * @throws IOException - * if an error occurs while deleting documents. - */ - synchronized int removeAllDocuments(String uuid) throws IOException - { - int num; - try - { - Term idTerm =3D new Term(FieldNames.UUID, uuid.toString()); - - // TODO: this was removed - //executeAndLog(new Start(Action.INTERNAL_TRANSACTION)); - - // TODO REMOVE WAS HERE - num =3D getChunk(uuid).removeDocument(idTerm); - if (num > 0) - { - // TODO: removed line - //redoLog.append(new DeleteNode(getTransactionId(), uuid)); - } - for (int i =3D 0; i < indexes.size(); i++) - { - PersistentIndex index =3D indexes.get(i); - // only remove documents from registered indexes - if (indexNames.contains(index.getName())) - { - int removed =3D index.removeDocument(idTerm); - if (removed > 0) - { - // TODO: removed line - //redoLog.append(new DeleteNode(getTransactionId(), uuid= )); - } - num +=3D removed; - } - } - // TODO : this was replaced - //executeAndLog(new Commit(getTransactionId())); - } - finally - { - releaseMultiReader(); - } - return num; - } - - /** - * Returns IndexReaders for the indexes named - * indexNames. An IndexListener is registered= and - * notified when documents are deleted from one of the indexes in - * indexNames. - *

    - * Note: the number of IndexReaders returned by this metho= d is - * not necessarily the same as the number of index names passed. An ind= ex - * might have been deleted and is not reachable anymore. - * = - * @param indexNames - * the names of the indexes for which to obtain readers. - * @param listener - * the listener to notify when documents are deleted. - * @return the IndexReaders. - * @throws IOException - * if an error occurs acquiring the index readers. - */ - synchronized IndexReader[] getIndexReaders(String[] indexNames, IndexLi= stener listener) throws IOException - { - Set names =3D new HashSet(Arrays.asList(indexNames)); - Map indexReaders =3D new HashM= ap(); - - try - { - for (Iterator it =3D indexes.iterator(); it.hasN= ext();) - { - PersistentIndex index =3D it.next(); - if (names.contains(index.getName())) - { - indexReaders.put(index.getReadOnlyIndexReader(listener), in= dex); - } - } - } - catch (IOException e) - { - // release readers obtained so far - for (Iterator> it =3D= indexReaders.entrySet().iterator(); it.hasNext();) - { - Map.Entry entry =3D it.n= ext(); - final ReadOnlyIndexReader reader =3D entry.getKey(); - try - { - SecurityHelper.doPriviledgedIOExceptionAction(new Privilege= dExceptionAction() - { - public Object run() throws Exception - { - reader.release(); - return null; - } - }); - } - catch (IOException ex) - { - log.warn("Exception releasing index reader: " + ex); - } - (entry.getValue()).resetListener(); - } - throw e; - } - - return indexReaders.keySet().toArray(new IndexReader[indexReaders.si= ze()]); - } - - /** - * Returns true if this multi index has an index segment w= ith - * the given name. This method even returns true if an ind= ex - * segments has not yet been loaded / initialized but exists on disk. - * = - * @param indexName - * the name of the index segment. - * @return true if it exists; otherwise false. - * @throws IOException - * if an error occurs while checking existence of directory. - */ - synchronized boolean hasIndex(String indexName) throws IOException - { - // check existing - for (Iterator it =3D indexes.iterator(); it.hasNext= ();) - { - PersistentIndex idx =3D it.next(); - if (idx.getName().equals(indexName)) - { - return true; - } - } - // check if it exists on disk - return directoryManager.hasDirectory(indexName); - } - - /** - * Returns an read-only IndexReader that spans alls indexe= s of - * this MultiIndex. - * = - * @return an IndexReader. - * @throws IOException - * if an error occurs constructing the IndexReader. - */ - public CachingMultiIndexReader getIndexReader() throws IOException - { - return getIndexReader(false); - } - - /** - * Returns an read-only IndexReader that spans alls indexe= s of - * this MultiIndex. - * = - * @param initCache - * when set true the hierarchy cache is complet= ely - * initialized before this call returns. - * @return an IndexReader. - * @throws IOException - * if an error occurs constructing the IndexReader. - */ - public synchronized CachingMultiIndexReader getIndexReader(final boolea= n initCache) throws IOException - { - return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedE= xceptionAction() - { - public CachingMultiIndexReader run() throws Exception - { - if (multiReader !=3D null) - { - multiReader.acquire(); - return multiReader; - } - // no reader available - // some other read thread might have created the reader in the - // meantime -> check again - if (multiReader =3D=3D null) - { - List readerList =3D new ArrayList(); - for (int i =3D 0; i < indexes.size(); i++) - { - PersistentIndex pIdx =3D indexes.get(i); - - if (indexNames.contains(pIdx.getName())) - { - try - { - readerList.add(pIdx.getReadOnlyIndexReader(initCac= he)); - } - catch (FileNotFoundException e) - { - if (directoryManager.hasDirectory(pIdx.getName())) - { - throw e; - } - } - } - } - // TODO commented line below: - //readerList.add(volatileIndex.getReadOnlyIndexReader()); - ReadOnlyIndexReader[] readers =3D readerList.toArray(new Re= adOnlyIndexReader[readerList.size()]); - multiReader =3D new CachingMultiIndexReader(readers, cache); - } - multiReader.acquire(); - return multiReader; - } - }); - - } - - /** - * Closes this MultiIndex. - */ - void close() - { - if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE)) - { - - // stop index merger - // when calling this method we must not lock this MultiIndex, oth= erwise - // a deadlock might occur - - synchronized (this) - { - - // commit / close indexes - try - { - releaseMultiReader(); - } - catch (IOException e) - { - log.error("Exception while closing search index.", e); - } - // try - // { - // // TODO commented line below: - // //flush(); - // } - // catch (IOException e) - // { - // log.error("Exception while closing search ind= ex.", e); - // } - // TODO commented line below: - //volatileIndex.close(); - // indexes will be closed now: - for (int i =3D 0; i < indexes.size(); i++) - { - (indexes.get(i)).close(); - } - - // close indexing queue - indexingQueue.close(); - - // finally close directory - try - { - indexDir.close(); - } - catch (IOException e) - { - log.error("Exception while closing directory.", e); - } - } - } - } - - /** - * Returns the namespace mappings of this search index. - * = - * @return the namespace mappings of this search index. - */ - NamespaceMappings getNamespaceMappings() - { - return nsMappings; - } - - /** - * Returns the indexing queue for this multi index. - * = - * @return the indexing queue for this multi index. - */ - public IndexingQueue getIndexingQueue() - { - return indexingQueue; - } - - /** - * Returns a lucene Document for the node. - * = - * @param node - * the node to index. - * @return the index document. - * @throws RepositoryException - * if an error occurs while reading from the workspace. - */ - Document createDocument(NodeData node) throws RepositoryException - { - return handler.createDocument(node, nsMappings, version); - } - - /** - * Returns a lucene Document for the Node with id. - * = - * @param id - * the id of the node to index. - * @return the index document. - * @throws RepositoryException - * if an error occurs while reading from the workspace or if - * there is no node with id. - */ - Document createDocument(String id) throws RepositoryException - { - ItemData data =3D handler.getContext().getItemStateManager().getItem= Data(id); - if (data =3D=3D null) - { - throw new ItemNotFoundException("Item id=3D" + id + " not found"); - } - if (!data.isNode()) - { - throw new RepositoryException("Item with id " + id + " is not a n= ode"); - } - return createDocument((NodeData)data); - - } - - /** - * Releases the {@link #multiReader} and sets it null. If = the - * reader is already null this method does nothing. When t= his - * method returns {@link #multiReader} is guaranteed to be null - * even if an exception is thrown. - *

    - * Please note that this method does not take care of any synchronizati= on. A - * caller must ensure that it is the only thread operating on this multi - * index, or that it holds the {@link #updateMonitor}. - * = - * @throws IOException - * if an error occurs while releasing the reader. - */ - void releaseMultiReader() throws IOException - { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - if (multiReader !=3D null) - { - try - { - multiReader.release(); - } - finally - { - multiReader =3D null; - } - } - return null; - } - }); - } - - // -------------------------< internal - // >------------------------------------- - - /** - * Recursively creates an index starting with the NodeState - * node. - * = - * @param node - * the current NodeState. - * @param path - * the path of the current node. - * @param stateMgr - * the shared item state manager. - * @param count - * the number of nodes already indexed. - * @return the number of nodes indexed so far. - * @throws IOException - * if an error occurs while writing to the index. - * @throws ItemStateException - * if an node state cannot be found. - * @throws RepositoryException - * if any other error occurs - */ - private long createIndex(NodeData node, ItemDataConsumer stateMgr, long= count) throws IOException, - RepositoryException - { - // NodeId id =3D node.getNodeId(); - - if (indexingTree.isExcluded(node)) - { - return count; - } - - // TODO: this is replaced - //executeAndLog(new AddNode(getTransactionId(), node.getIdentifier()= )); - getChunk(node.getIdentifier()).addDocuments(new Document[]{createDoc= ument(node)}); - - if (++count % 100 =3D=3D 0) - { - - log.info("indexing... {} ({})", node.getQPath().getAsString(), ne= w Long(count)); - } - if (count % 10 =3D=3D 0) - { - checkIndexingQueue(true); - } - // TODO commented line below: - //checkVolatileCommit(); - List children =3D stateMgr.getChildNodesData(node); - for (NodeData nodeData : children) - { - - NodeData childState =3D (NodeData)stateMgr.getItemData(nodeData.g= etIdentifier()); - if (childState =3D=3D null) - { - handler.getOnWorkspaceInconsistencyHandler().handleMissingChil= dNode( - new ItemNotFoundException("Child not found "), handler, nod= eData.getQPath(), node, nodeData); - } - - if (nodeData !=3D null) - { - count =3D createIndex(nodeData, stateMgr, count); - } - } - - return count; - } - - /** - * Removes the deletable file if it exists. The file is not used anymor= e in - * Jackrabbit versions >=3D 1.5. - */ - private void removeDeletable() - { - SecurityHelper.doPriviledgedAction(new PrivilegedAction() - { - public Object run() - { - String fileName =3D "deletable"; - try - { - if (indexDir.fileExists(fileName)) - { - indexDir.deleteFile(fileName); - } - } - catch (IOException e) - { - log.warn("Unable to remove file 'deletable'.", e); - } - return null; - } - }); - } - - /** - * Checks the indexing queue for finished text extrator jobs and update= s the - * index accordingly if there are any new ones. This method is synchron= ized - * and should only be called by the timer task that periodically checks= if - * there are documents ready in the indexing queue. A new transaction is - * used when documents are transfered from the indexing queue to the in= dex. - */ - private synchronized void checkIndexingQueue() - { - checkIndexingQueue(false); - } - - /** - * Checks the indexing queue for finished text extrator jobs and update= s the - * index accordingly if there are any new ones. - * = - * @param transactionPresent - * whether a transaction is in progress and the current - * {@link #getTransactionId()} should be used. If - * false a new transaction is created when docu= ments - * are transfered from the indexing queue to the index. - */ - private void checkIndexingQueue(boolean transactionPresent) - { - Document[] docs =3D indexingQueue.getFinishedDocuments(); - Map finished =3D new HashMap(); - for (int i =3D 0; i < docs.length; i++) - { - String uuid =3D docs[i].get(FieldNames.UUID); - finished.put(uuid, docs[i]); - } - - // now update index with the remaining ones if there are any - if (!finished.isEmpty()) - { - log.info("updating index with {} nodes from indexing queue.", new= Long(finished.size())); - - // remove documents from the queue - for (Iterator it =3D finished.keySet().iterator(); it.has= Next();) - { - indexingQueue.removeDocument(it.next()); - } - - try - { - if (transactionPresent) - { - for (Iterator it =3D finished.keySet().iterator(); = it.hasNext();) - { - // TODO this was replaced - //executeAndLog(new DeleteNode(getTransactionId(), (Stri= ng)it.next())); - - String uuidString =3D it.next(); - // check if indexing queue is still working on - // this node from a previous update - Document doc =3D indexingQueue.removeDocument(uuidString= ); - if (doc !=3D null) - { - Util.disposeDocument(doc); - } - Term idTerm =3D new Term(FieldNames.UUID, uuidString); - // if the document cannot be deleted from the volatile i= ndex - // delete it from one of the persistent indexes. - int num =3D getChunk(uuidString).removeDocument(idTerm); - if (num =3D=3D 0) - { - for (int i =3D indexes.size() - 1; i >=3D 0; i--) - { - // only look in registered indexes - PersistentIndex idx =3D indexes.get(i); - if (indexNames.contains(idx.getName())) - { - num =3D idx.removeDocument(idTerm); - if (num > 0) - { - return; - } - } - } - } - - } - for (Iterator it =3D finished.values().iterator()= ; it.hasNext();) - { - // TODO this was replaced - //executeAndLog(new AddNode(getTransactionId(), (Documen= t)it.next())); - Document doc =3D it.next(); - String uuid =3D doc.get(FieldNames.UUID); - getChunk(uuid).addDocuments(new Document[]{doc}); - } - } - else - { - update(finished.keySet(), finished.values()); - } - } - catch (IOException e) - { - // update failed - log.warn("Failed to update index with deferred text extraction= ", e); - } - } - } - - // ------------------------< Actions - // >--------------------------------------- - - @Deprecated - public boolean getRedoLogApplied() - { - return false; - } - - private PersistentIndex getChunk(String uuid) - { - return indexes.get(0); - } -} Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/SearchIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-10-11 16:33:4= 9 UTC (rev 3291) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-10-12 09:47:3= 4 UTC (rev 3292) @@ -175,7 +175,7 @@ /** * The actual index */ - private MultiIndex index; + private ChunkIndex index; = /** * The analyzer we use for indexing. @@ -370,7 +370,7 @@ /** * Indicates the index format version which is relevant to a query. * This value may be different from what - * {@link MultiIndex#getIndexFormatVersion()} returns because queries m= ay be + * {@link ChunkIndex#getIndexFormatVersion()} returns because queries m= ay be * executed on two physical indexes with different formats. Index format * versions are considered backward compatible. That is, the lower vers= ion * of the two physical indexes is used for querying. @@ -570,7 +570,7 @@ indexingConfig =3D createIndexingConfiguration(nsMappings); analyzer.setIndexingConfig(indexingConfig); = - index =3D new MultiIndex(this, context.getIndexingTree(), modeHandle= r, getIndexInfos(), getIndexUpdateMonitor()); + index =3D new ChunkIndex(this, context.getIndexingTree(), modeHandle= r, getIndexInfos(), getIndexUpdateMonitor()); // if RW mode, create initial index and start check if (modeHandler.getMode() =3D=3D IndexerIoMode.READ_WRITE) { @@ -676,7 +676,7 @@ = /** * This implementation forwards the call to - * {@link MultiIndex#update(Collection, Collection)} and transforms the= two + * {@link ChunkIndex#update(Collection, Collection)} and transforms the= two * iterators to the required types. * = * @param remove @@ -1212,7 +1212,7 @@ * = * @return the actual index. */ - public MultiIndex getIndex() + public ChunkIndex getIndex() { return index; } --===============0852759236819127581==-- From do-not-reply at jboss.org Wed Oct 13 07:53:35 2010 Content-Type: multipart/mixed; boundary="===============0535651954641684695==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3293 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/rpc/impl and 1 other directories. Date: Wed, 13 Oct 2010 07:53:35 -0400 Message-ID: <201010131153.o9DBrZ2v002136@svn01.web.mwc.hst.phx2.redhat.com> --===============0535651954641684695== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-13 07:53:35 -0400 (Wed, 13 Oct 2010) New Revision: 3293 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/rpc-service.xml kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/impl/RPCServiceImpl.java kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/rpc/impl/TestRPCServiceImpl.java Log: EXOJCR-967: Parameters allow-failover and retry-timeout have been added Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/rpc-service.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml 2010-10-12 09:47:34 UTC (rev 3292) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/rpc-service.xml 2010-10-13 11:53:35 UTC (rev 3293) @@ -149,6 +149,14 @@ <name>jgroups-default-timeout</name> <value>0</value> </value-param> + <value-param> + <name>allow-failover</name> + <value>true</value> + </value-param> + <value-param> + <name>retry-timeout</name> + <value>20000</value> + </value-param> </init-params> </component> = ... @@ -182,8 +190,31 @@ This is the default timeout to use if the timeout is not given, if no response could be get after this timeout an excep= tion will be thrown. This parameter is optional and its default val= ue - is 0 which means that we don't use any timeout by default. + is 0 which means that we don't use any timeout by default. This + parameter is expressed in milliseconds. + + + allow-failover + + This is parameter indicates whether a command on the + coordinator needs to be relaunched or not if the coordintator + seems to have left the cluster. This parameter only affects the + behavior of the methods + executeCommandOnCoordinator. This paramet= er + is optional and its default value is true. + + + + retry-timeout + + This parameter is the maximum amount of time to wait un= til + the new coordinator is elected. This parameter is linked to the + parameter allow-failover, and thus used in + the exact same conditions. This parameter is optional and its + default value is 20000. This parameter is expressed in + milliseconds. + @@ -213,8 +244,8 @@ Register a SingleMethodCallCommand that will call getName() on the Object - myService anytime the command will be execute= d. - + myService anytime the command will be + executed. = Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/impl/RPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/impl/RPCServiceImpl.java 2010-10-12 09:47:34 UTC (rev 3292) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/impl/RPCServiceImpl.java 2010-10-13 11:53:35 UTC (rev 3293) @@ -85,27 +85,42 @@ /** * The name of the parameter for the location of the JGroups configurat= ion. */ - public static final String PARAM_JGROUPS_CONFIG =3D "jgroups-configurat= ion"; + protected static final String PARAM_JGROUPS_CONFIG =3D "jgroups-configu= ration"; = /** * The name of the parameter for the name of the cluster. */ - public static final String PARAM_CLUSTER_NAME =3D "jgroups-cluster-name= "; + protected static final String PARAM_CLUSTER_NAME =3D "jgroups-cluster-n= ame"; = /** * The name of the parameter for the default timeout */ - public static final String PARAM_DEFAULT_TIMEOUT =3D "jgroups-default-t= imeout"; + protected static final String PARAM_DEFAULT_TIMEOUT =3D "jgroups-defaul= t-timeout"; = /** + * The name of the parameter to allow the failover + */ + protected static final String PARAM_ALLOW_FAILOVER =3D "allow-failover"; + + /** + * The name of the parameter for the retry timeout + */ + protected static final String PARAM_RETRY_TIMEOUT =3D "retry-timeout"; + = + /** * The value of the default timeout */ - public static final int DEFAULT_TIMEOUT =3D 0; + protected static final int DEFAULT_TIMEOUT =3D 0; + = + /** + * The value of the default retry timeout + */ + protected static final int DEFAULT_RETRY_TIMEOUT =3D 20000; = /** * The default value of the cluster name */ - public static final String CLUSTER_NAME =3D "RPCService-Cluster"; + protected static final String CLUSTER_NAME =3D "RPCService-Cluster"; = /** * The configurator used to create the JGroups Channel @@ -113,6 +128,11 @@ private final ProtocolStackConfigurator configurator; = /** + * The lock used to synchronize all the threads waiting for a topology = change. + */ + private final Object topologyChangeLock =3D new Object(); + = + /** * The name of the cluster */ private final String clusterName; @@ -143,6 +163,16 @@ private long defaultTimeout =3D DEFAULT_TIMEOUT; = /** + * The value of the retry timeout + */ + private long retryTimeout =3D DEFAULT_RETRY_TIMEOUT; + = + /** + * Indicates whether the failover capabilities are enabled + */ + private boolean allowFailover =3D true; + = + /** * The dispatcher used to launch the command of the cluster nodes */ private MessageDispatcher dispatcher; @@ -212,6 +242,24 @@ LOG.debug("The default timeout of the RPCServiceImpl has been = set to " + defaultTimeout); } } + String sAllowFailover =3D getValueParam(params, PARAM_ALLOW_FAILOVER= ); + if (sAllowFailover !=3D null) + { + allowFailover =3D Boolean.valueOf(sAllowFailover); + if (LOG.isDebugEnabled()) + { + LOG.debug("The parameter '" + PARAM_ALLOW_FAILOVER + "' of the= RPCServiceImpl has been set to " + allowFailover); + } + } + sTimeout =3D getValueParam(params, PARAM_RETRY_TIMEOUT); + if (sTimeout !=3D null) + { + retryTimeout =3D Integer.parseInt(sTimeout); + if (LOG.isDebugEnabled()) + { + LOG.debug("The retry timeout of the RPCServiceImpl has been se= t to " + retryTimeout); + } + } this.state =3D State.INITIALIZED; } = @@ -294,18 +342,31 @@ v.add(coordinator); List lResults =3D excecuteCommand(v, command, synchronous, t= imeout, args); Object result =3D lResults =3D=3D null || lResults.size() =3D=3D 0 ?= null : lResults.get(0); - if (result instanceof MemberHasLeftException) + if (allowFailover && result instanceof MemberHasLeftException) { + // The failover capabilities have been enabled and the coordinato= r seems to have left if (coordinator.equals(this.coordinator)) { - throw new RPCException("The coordinator did not change, we fac= ed an unexpected situation", - (MemberHasLeftException)result); + synchronized(topologyChangeLock) + { + if (coordinator.equals(this.coordinator)) + { + if (LOG.isTraceEnabled()) + LOG.trace("The coordinator did not change yet, we wil= l relaunch the command after " + retryTimeout + " ms or once a topology cha= nge has been detected"); = + try + { + topologyChangeLock.wait(retryTimeout); + } + catch (InterruptedException e) + { + Thread.currentThread().interrupt(); + } = + } + } } - else - { - // The coordinator has changed, we will automatically retry wi= th the new coordinator - return executeCommandOnCoordinator(command, synchronous, timeo= ut, args); - } + if (LOG.isTraceEnabled()) + LOG.trace("The coordinator has changed, we will automatically = retry with the new coordinator"); = + return executeCommandOnCoordinator(command, synchronous, timeout,= args); } else if (result instanceof RPCException) { @@ -441,11 +502,18 @@ */ public void viewAccepted(View view) { - this.members =3D view.getMembers(); - Address currentCoordinator =3D coordinator; - this.coordinator =3D members !=3D null && members.size() > 0 ? membe= rs.get(0) : null; - this.isCoordinator =3D coordinator !=3D null && coordinator.equals(c= hannel.getLocalAddress()); - onTopologyChange(currentCoordinator !=3D null && !currentCoordinator= .equals(coordinator)); + boolean coordinatorHasChanged; + synchronized (topologyChangeLock) + { + this.members =3D view.getMembers(); + Address currentCoordinator =3D coordinator; + this.coordinator =3D members !=3D null && members.size() > 0 ? me= mbers.get(0) : null; + this.isCoordinator =3D coordinator !=3D null && coordinator.equal= s(channel.getLocalAddress()); + coordinatorHasChanged =3D currentCoordinator !=3D null && !curren= tCoordinator.equals(coordinator); + // Release all the nodes + topologyChangeLock.notifyAll(); + } + onTopologyChange(coordinatorHasChanged); } = /** @@ -665,7 +733,7 @@ * Gives the value of the default timeout * @return the default timeout */ - public long getDefaultTimeout() + protected long getDefaultTimeout() { return defaultTimeout; } @@ -674,12 +742,31 @@ * Gives the name of the cluster * @return the name of the cluster */ - public String getClusterName() + protected String getClusterName() { return clusterName; } + = + /** + * Gives the value of the retry timeout + * @return the value of the retry timeout + */ + protected long getRetryTimeout() + { + return retryTimeout; + } = /** + * Indicates whether the failover capabilities are enabled or not + * @return true if the failover capabilities are allowed, = false + * otherwise + */ + protected boolean isAllowFailover() + { + return allowFailover; + } + + /** * Gives the value of the {@link ValueParam} corresponding to the given= key * @param params the list of initial parameters from which we want to e= xtract the {@link ValueParam} * @param parameterKey the name of the {@link ValueParam} that we are l= ooking for Modified: kernel/trunk/exo.kernel.component.common/src/test/java/org/exopla= tform/services/rpc/impl/TestRPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-12 09:47:34 UTC (rev 3292) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/rpc/impl/TestRPCServiceImpl.java 2010-10-13 11:53:35 UTC (rev 3293) @@ -106,6 +106,8 @@ { service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); assertEquals(RPCServiceImpl.DEFAULT_TIMEOUT, service.getDefaultTi= meout()); + assertEquals(RPCServiceImpl.DEFAULT_RETRY_TIMEOUT, service.getRet= ryTimeout()); + assertEquals(true, service.isAllowFailover()); assertEquals(RPCServiceImpl.CLUSTER_NAME + "-" + container.getCon= text().getName(), service.getClusterName()); } finally @@ -133,6 +135,8 @@ { service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); assertEquals(60, service.getDefaultTimeout()); + assertEquals(RPCServiceImpl.DEFAULT_RETRY_TIMEOUT, service.getRet= ryTimeout()); + assertEquals(true, service.isAllowFailover()); assertEquals(RPCServiceImpl.CLUSTER_NAME + "-" + container.getCon= text().getName(), service.getClusterName()); } finally @@ -142,7 +146,72 @@ service.stop(); = } } - ValueParam paramClusterName =3D new ValueParam(); + ValueParam paramRetryTimeout =3D new ValueParam(); + paramRetryTimeout.setName(RPCServiceImpl.PARAM_RETRY_TIMEOUT); + paramRetryTimeout.setValue("fakeValue"); + params.addParameter(paramRetryTimeout); + try + { + new RPCServiceImpl(container.getContext(), params, configManager); + fail("We expect a NumberFormatException since the retry timeout i= s not properly set"); + } + catch (NumberFormatException e) + { + // OK + } = + paramRetryTimeout.setValue("60"); + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + assertEquals(60, service.getDefaultTimeout()); + assertEquals(60, service.getRetryTimeout()); + assertEquals(true, service.isAllowFailover()); + assertEquals(RPCServiceImpl.CLUSTER_NAME + "-" + container.getCon= text().getName(), service.getClusterName()); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } + ValueParam paramAllowFailover =3D new ValueParam(); + paramAllowFailover.setName(RPCServiceImpl.PARAM_ALLOW_FAILOVER); + paramAllowFailover.setValue("fakeValue"); + params.addParameter(paramAllowFailover); + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + assertEquals(60, service.getDefaultTimeout()); + assertEquals(60, service.getRetryTimeout()); + assertEquals(false, service.isAllowFailover()); + assertEquals(RPCServiceImpl.CLUSTER_NAME + "-" + container.getCon= text().getName(), service.getClusterName()); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } + paramAllowFailover.setValue("TRUE"); + try + { + service =3D new RPCServiceImpl(container.getContext(), params, co= nfigManager); + assertEquals(60, service.getDefaultTimeout()); + assertEquals(60, service.getRetryTimeout()); + assertEquals(true, service.isAllowFailover()); + assertEquals(RPCServiceImpl.CLUSTER_NAME + "-" + container.getCon= text().getName(), service.getClusterName()); + } + finally + { + if (service !=3D null) + { + service.stop(); = + } + } + = + ValueParam paramClusterName =3D new ValueParam(); = paramClusterName.setName(RPCServiceImpl.PARAM_CLUSTER_NAME); paramClusterName.setValue("MyName"); params.addParameter(paramClusterName); --===============0535651954641684695==-- From do-not-reply at jboss.org Thu Oct 14 09:01:16 2010 Content-Type: multipart/mixed; boundary="===============9091428069627943116==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3294 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache. Date: Thu, 14 Oct 2010 09:01:16 -0400 Message-ID: <201010141301.o9ED1GR2026561@svn01.web.mwc.hst.phx2.redhat.com> --===============9091428069627943116== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-14 09:01:15 -0400 (Thu, 14 Oct 2010) New Revision: 3294 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java Log: EXOJCR-998: Null values managed locally Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCa= che.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jbosscache/JBossCacheWorkspaceStorageCache.ja= va 2010-10-13 11:53:35 UTC (rev 3293) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.ja= va 2010-10-14 13:01:15 UTC (rev 3294) @@ -906,7 +906,7 @@ = // remove possible NullNodeData from cache boolean local =3D cache.isLocal(); - cache.setLocal(false); + cache.setLocal(true); = removeNullNode(node); = @@ -999,7 +999,7 @@ = // remove possible NullNodeData from cache boolean local =3D cache.isLocal(); - cache.setLocal(false); + cache.setLocal(true); = removeNullNode(prop); = @@ -1016,8 +1016,7 @@ cache.addToList(makeChildListFqn(childPropsList, prop.getParentId= entifier()), ITEM_LIST, prop.getIdentifier()); } = - ItemData result =3D - get(prop.getParentIdentifier(), prop.getQPath().getEntries()[prop= .getQPath().getEntries().length - 1]); + get(prop.getParentIdentifier(), prop.getQPath().getEntries()[prop.ge= tQPath().getEntries().length - 1]); = // add in ITEMS return (PropertyData)cache.put(makeItemFqn(prop.getIdentifier()), IT= EM_DATA, prop); --===============9091428069627943116==-- From do-not-reply at jboss.org Thu Oct 14 09:35:51 2010 Content-Type: multipart/mixed; boundary="===============4159822105827877556==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3295 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Thu, 14 Oct 2010 09:35:50 -0400 Message-ID: <201010141335.o9EDZo7x002179@svn01.web.mwc.hst.phx2.redhat.com> --===============4159822105827877556== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-14 09:35:50 -0400 (Thu, 14 Oct 2010) New Revision: 3295 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java Log: EXOJCR-993: Check that CacheableWorkspaceDataManager.getCachedItemData() me= thod can return NullNodeData 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 2010-10-= 14 13:01:15 UTC (rev 3294) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2010-10-= 14 13:35:50 UTC (rev 3295) @@ -28,6 +28,7 @@ import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.ItemType; import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.datamodel.NullNodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.datamodel.QPathEntry; @@ -158,30 +159,43 @@ { // from cache at first ItemData cdata =3D persistentManager.getCachedItemData(identifier); - if (cdata !=3D null) + if (cdata !=3D null && !(cdata instanceof NullNodeData)) + { return super.getItemData(identifier); + } = if (!this.equals(versionDataManager) && !identifier.equals(Constants= .ROOT_UUID)) { // search in System cache for /jcr:system nodes only cdata =3D versionDataManager.persistentManager.getCachedItemData(= identifier); - if (cdata !=3D null) + if (cdata !=3D null && !(cdata instanceof NullNodeData)) + { 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; } --===============4159822105827877556==-- From do-not-reply at jboss.org Thu Oct 14 10:11:54 2010 Content-Type: multipart/mixed; boundary="===============6033078938743553840==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3296 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache. Date: Thu, 14 Oct 2010 10:11:54 -0400 Message-ID: <201010141411.o9EEBsfT009853@svn01.web.mwc.hst.phx2.redhat.com> --===============6033078938743553840== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-14 10:11:54 -0400 (Thu, 14 Oct 2010) New Revision: 3296 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java Log: EXOJCR-998: support shareable cache Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCa= che.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jbosscache/JBossCacheWorkspaceStorageCache.ja= va 2010-10-14 13:35:50 UTC (rev 3295) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.ja= va 2010-10-14 14:11:54 UTC (rev 3296) @@ -332,7 +332,7 @@ JBOSSCACHE_EXPIRATION_DEFAULT)); = this.itemsRoot =3D Fqn.fromRelativeElements(rootFqn, ITEMS); - this.nullItemsRoot =3D Fqn.fromElements(NULL_ITEMS); + this.nullItemsRoot =3D Fqn.fromRelativeElements(rootFqn, NULL_ITEMS); this.childNodes =3D Fqn.fromRelativeElements(rootFqn, CHILD_NODES); this.childProps =3D Fqn.fromRelativeElements(rootFqn, CHILD_PROPS); this.childNodesList =3D Fqn.fromRelativeElements(rootFqn, CHILD_NODE= S_LIST); --===============6033078938743553840==-- From do-not-reply at jboss.org Fri Oct 15 10:52:05 2010 Content-Type: multipart/mixed; boundary="===============2631162297369230695==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3297 - in jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query: jbosscache and 1 other directories. Date: Fri, 15 Oct 2010 10:52:05 -0400 Message-ID: <201010151452.o9FEq502025944@svn01.web.mwc.hst.phx2.redhat.com> --===============2631162297369230695== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2010-10-15 10:52:04 -0400 (Fri, 15 Oct 2010) New Revision: 3297 Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/AbstractQueryHandler.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/QueryHandler.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/ChunkIndex.java jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatfo= rm/services/jcr/impl/core/query/lucene/SearchIndex.java Log: EXOJCR-987 : refactoring. Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/AbstractQueryHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/AbstractQueryHandler.java 2010-10-14 14:11= :54 UTC (rev 3296) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/AbstractQueryHandler.java 2010-10-15 14:52= :04 UTC (rev 3297) @@ -18,10 +18,10 @@ = import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.datamodel.NodeData; +import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.exoplatform.services.jcr.impl.core.query.lucene.DefaultIndexUpd= ateMonitor; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMoni= tor; -import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/QueryHandler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/QueryHandler.java 2010-10-14 14:11:54 UTC = (rev 3296) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/QueryHandler.java 2010-10-15 14:52:04 UTC = (rev 3297) @@ -21,9 +21,9 @@ import org.exoplatform.services.jcr.datamodel.NodeData; 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.ChunkIndex; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMoni= tor; -import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits; = import java.io.IOException; Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-= 10-14 14:11:54 UTC (rev 3296) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-= 10-15 14:52:04 UTC (rev 3297) @@ -21,8 +21,8 @@ import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener; +import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; -import org.exoplatform.services.jcr.impl.core.query.lucene.ChunkIndex; import org.exoplatform.services.jcr.impl.util.io.PrivilegedCacheHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/ChunkIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/ChunkIndex.java 2010-10-14 14:11:54= UTC (rev 3296) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/ChunkIndex.java 2010-10-15 14:52:04= UTC (rev 3297) @@ -17,21 +17,18 @@ package org.exoplatform.services.jcr.impl.core.query.lucene; = import org.apache.lucene.document.Document; -import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; -import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; +import org.exoplatform.services.jcr.impl.core.query.ChunkService; import org.exoplatform.services.jcr.impl.core.query.IndexingTree; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Direc= toryManager; import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = -import java.io.FileNotFoundException; import java.io.IOException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; @@ -39,12 +36,10 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.Map.Entry; = import javax.jcr.ItemNotFoundException; import javax.jcr.RepositoryException; @@ -61,17 +56,12 @@ private static final Logger log =3D LoggerFactory.getLogger("exo.jcr.co= mponent.core.MultiIndex"); = /** - * Names of active persistent index directories. - */ - private IndexInfos indexNames; - - /** * List of open persistent indexes. This list may also contain an open - * PersistentIndex owned by the IndexMerger daemon. Such an index is not + * PersistentIndexChunk owned by the IndexMerger daemon. Such an index = is not * registered with indexNames and must not be used in regular in= dex * operations (delete node, etc.)! */ - private final List indexes =3D new ArrayList(); + private final List indexes =3D new ArrayList(); = /** * The internal namespace mappings of the query manager. @@ -124,10 +114,7 @@ */ private final IndexFormatVersion version; = - /** - * The handler of the Indexer io mode - */ - private final IndexerIoModeHandler modeHandler; + private final ChunkService chunkService; = /** * Creates a new MultiIndex. @@ -140,10 +127,8 @@ * @throws IOException * if an error occurs */ - ChunkIndex(SearchIndex handler, IndexingTree indexingTree, IndexerIoMod= eHandler modeHandler, IndexInfos indexInfos, - IndexUpdateMonitor indexUpdateMonitor) throws IOException + ChunkIndex(SearchIndex handler, IndexingTree indexingTree) throws IOExc= eption { - this.modeHandler =3D modeHandler; this.directoryManager =3D handler.getDirectoryManager(); // this method is run in privileged mode internally this.indexDir =3D directoryManager.getDirectory("."); @@ -151,27 +136,20 @@ this.cache =3D new DocNumberCache(handler.getCacheSize()); this.indexingTree =3D indexingTree; this.nsMappings =3D handler.getNamespaceMappings(); - this.indexNames =3D indexInfos; - this.indexNames.setDirectory(indexDir); - // this method is run in privileged mode internally - this.indexNames.read(); + // TODO remove this stub + this.chunkService =3D new ChunkServiceImpl(); = - // TODO remove hard-coded piece - this.indexNames.addName("1"); - this.indexNames.addName("2"); - this.indexNames.addName("3"); - this.indexNames.addName("4"); - // this method is run in privileged mode internally IndexingQueueStore store =3D new IndexingQueueStore(indexDir); = // initialize indexing queue this.indexingQueue =3D new IndexingQueue(store); - // copy current index names - Set currentNames =3D new HashSet(indexNames.getNames= ()); = // open persistent indexes - for (String name : currentNames) + + Set assignedChunks =3D chunkService.getAssignedChunks(); + + for (int i =3D 0; i < chunkService.getChunkCount(); i++) { // only open if it still exists // it is possible that indexNames still contains a name for @@ -185,9 +163,10 @@ // // move on to next index // continue; // } - PersistentIndex index =3D - new PersistentIndex(name, handler.getTextAnalyzer(), handler.g= etSimilarity(), cache, indexingQueue, - directoryManager); + PersistentIndexChunk index =3D + new PersistentIndexChunk(i, handler.getTextAnalyzer(), handler= .getSimilarity(), cache, indexingQueue, + directoryManager, !assignedChunks.contains(Integer.valueOf(= i))); + = index.setMaxFieldLength(handler.getMaxFieldLength()); index.setUseCompoundFile(handler.getUseCompoundFile()); index.setTermInfosIndexDivisor(handler.getTermInfosIndexDivisor()= ); @@ -213,52 +192,105 @@ }); } indexingQueue.initialize(this); - this.indexNames.setMultiIndex(this); } = /** - * Returns the number of documents in this index. + * Adds a document to the index. * = - * @return the number of documents in this index. + * @param doc + * the document to add. * @throws IOException - * if an error occurs while reading from the index. + * if an error occurs while adding the document to the inde= x. */ - int numDocs() throws IOException + public void addDocument(Document doc) throws IOException { - if (indexNames.size() =3D=3D 0) + update(Collections.EMPTY_LIST, Arrays.asList(new Document[]{doc})); + } + + /** + * Closes this MultiIndex. + */ + public void close() + { + + // stop index merger + // when calling this method we must not lock this MultiIndex, otherw= ise + // a deadlock might occur + + synchronized (this) { - return 0; - } - else - { - final CachingMultiIndexReader reader =3D getIndexReader(); + + // commit / close indexes try { - return reader.numDocs(); + releaseMultiReader(); } - finally + catch (IOException e) { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedEx= ceptionAction() - { - public Object run() throws Exception - { - reader.release(); - return null; - } - }); + log.error("Exception while closing search index.", e); } + + // TODO Should they be commited before close?! + for (int i =3D 0; i < indexes.size(); i++) + { + (indexes.get(i)).close(); + } + + // close indexing queue + indexingQueue.close(); + + // finally close directory + try + { + indexDir.close(); + } + catch (IOException e) + { + log.error("Exception while closing directory.", e); + } } } = /** - * @return the index format version for this multi index. + * Returns a lucene Document for the node. + * = + * @param node + * the node to index. + * @return the index document. + * @throws RepositoryException + * if an error occurs while reading from the workspace. */ - IndexFormatVersion getIndexFormatVersion() + public Document createDocument(NodeData node) throws RepositoryException { - return version; + return handler.createDocument(node, nsMappings, version); } = /** + * Returns a lucene Document for the Node with id. + * = + * @param id + * the id of the node to index. + * @return the index document. + * @throws RepositoryException + * if an error occurs while reading from the workspace or if + * there is no node with id. + */ + public Document createDocument(String id) throws RepositoryException + { + ItemData data =3D handler.getContext().getItemStateManager().getItem= Data(id); + if (data =3D=3D null) + { + throw new ItemNotFoundException("Item id=3D" + id + " not found"); + } + if (!data.isNode()) + { + throw new RepositoryException("Item with id " + id + " is not a n= ode"); + } + return createDocument((NodeData)data); + + } + + /** * Creates an initial index by traversing the node hierarchy starting a= t the * node with rootId. * = @@ -273,9 +305,8 @@ * @throws IllegalStateException * if this index is not empty. */ - void createInitialIndex(ItemDataConsumer stateMgr) throws IOException + public void createInitialIndex(ItemDataConsumer stateMgr) throws IOExce= ption { - // TODO: re-study check!!! = CachingMultiIndexReader reader =3D getIndexReader(); int numDocs =3D reader.numDocs(); reader.release(); @@ -286,8 +317,6 @@ { long count =3D 0; // traverse and index workspace - - // NodeData rootState =3D (NodeData) stateMgr.getItemData(root= Id); count =3D createIndex(indexingTree.getIndexingRoot(), stateMgr= , count); = log.info("Created initial index for {} nodes", new Long(count)= ); @@ -312,138 +341,24 @@ } = /** - * Atomically updates the index by removing some documents and adding - * others. - * = - * @param remove - * collection of UUIDs that identify documents = to - * remove - * @param add - * collection of Documents to add. Some of the - * elements in this collection may be null, to - * indicate that a node could not be indexed successfully. - * @throws IOException - * if an error occurs while updating the index. + * @return the index format version for this multi index. */ - synchronized void update(final Collection remove, final Collect= ion add) throws IOException + public IndexFormatVersion getIndexFormatVersion() { - SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() - { - public Object run() throws Exception - { - // make sure a reader is available during long updates - if (add.size() > handler.getBufferSize()) - { - try - { - getIndexReader().release(); - } - catch (IOException e) - { - // do not fail if an exception is thrown here - log.warn("unable to prepare index reader " + "for querie= s during update", e); - } - } - try - { - for (Iterator it =3D remove.iterator(); it.hasNext(= );) - { - String uuidString =3D it.next(); - // check if indexing queue is still working on - // this node from a previous update - Document doc =3D indexingQueue.removeDocument(uuidString= ); - if (doc !=3D null) - { - Util.disposeDocument(doc); - } - Term idTerm =3D new Term(FieldNames.UUID, uuidString); - getChunk(uuidString).removeDocument(idTerm); - } - for (Iterator it =3D add.iterator(); it.hasNext()= ;) - { - Document doc =3D it.next(); - if (doc !=3D null) - { - if (doc !=3D null) - { - String uuid =3D doc.get(FieldNames.UUID); - getChunk(uuid).addDocuments(new Document[]{doc}); - } - } - } - // TODO for owning indexes only - for (PersistentIndex idx : indexes) - { - idx.commit(); - } - } - finally - { - releaseMultiReader(); - } - return null; - } - }); + return version; } = /** - * Adds a document to the index. + * Returns the indexing queue for this multi index. * = - * @param doc - * the document to add. - * @throws IOException - * if an error occurs while adding the document to the inde= x. + * @return the indexing queue for this multi index. */ - void addDocument(Document doc) throws IOException + public IndexingQueue getIndexingQueue() { - update(Collections.EMPTY_LIST, Arrays.asList(new Document[]{doc})); + return indexingQueue; } = /** - * Deletes the first document that matches the uuid. - * = - * @param uuid - * document that match this uuid will be delete= d. - * @throws IOException - * if an error occurs while deleting the document. - */ - void removeDocument(String uuid) throws IOException - { - update(Arrays.asList(new String[]{uuid}), Collections.EMPTY_LIST); - } - - /** - * Deletes all documents that match the uuid. - * = - * @param uuid - * documents that match this uuid will be delet= ed. - * @return the number of deleted documents. - * @throws IOException - * if an error occurs while deleting documents. - */ - synchronized int removeAllDocuments(String uuid) throws IOException - { - int num; - try - { - Term idTerm =3D new Term(FieldNames.UUID, uuid.toString()); - num =3D getChunk(uuid).removeDocument(idTerm); - for (int i =3D 0; i < indexes.size(); i++) - { - PersistentIndex index =3D indexes.get(i); - // TODO only remove documents from owning indexes - int removed =3D index.removeDocument(idTerm); - num +=3D removed; - } - } - finally - { - releaseMultiReader(); - } - return num; - } - - /** * Returns an read-only IndexReader that spans alls indexe= s of * this MultiIndex. * = @@ -484,7 +399,7 @@ if (multiReader =3D=3D null) { List readerList =3D new ArrayList(); - for (PersistentIndex idx : indexes) + for (PersistentIndexChunk idx : indexes) { readerList.add(idx.getReadOnlyIndexReader(initCache)); } @@ -495,153 +410,244 @@ return multiReader; } }); + } = + /** + * TODO solve this architecture issue + * This belongs only to MultiIndex with volatile present + * = + * @return + */ + @Deprecated + public boolean getRedoLogApplied() + { + return false; } = /** - * Closes this MultiIndex. + * Returns the number of documents in this index. + * = + * @return the number of documents in this index. + * @throws IOException + * if an error occurs while reading from the index. */ - void close() + public int numDocs() throws IOException { - if (modeHandler.getMode().equals(IndexerIoMode.READ_WRITE)) + final CachingMultiIndexReader reader =3D getIndexReader(); + try { - - // stop index merger - // when calling this method we must not lock this MultiIndex, oth= erwise - // a deadlock might occur - - synchronized (this) + return reader.numDocs(); + } + finally + { + SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExcep= tionAction() { - - // commit / close indexes - try + public Object run() throws Exception { - releaseMultiReader(); + reader.release(); + return null; } - catch (IOException e) - { - log.error("Exception while closing search index.", e); - } - - // TODO Should they be commited before close?! - for (int i =3D 0; i < indexes.size(); i++) - { - (indexes.get(i)).close(); - } - - // close indexing queue - indexingQueue.close(); - - // finally close directory - try - { - indexDir.close(); - } - catch (IOException e) - { - log.error("Exception while closing directory.", e); - } - } + }); } } = /** - * Returns the namespace mappings of this search index. - * = - * @return the namespace mappings of this search index. + * TODO */ - NamespaceMappings getNamespaceMappings() + public void reassignChunks() { - return nsMappings; - } = - /** - * Returns the indexing queue for this multi index. - * = - * @return the indexing queue for this multi index. - */ - public IndexingQueue getIndexingQueue() - { - return indexingQueue; } = /** - * Returns a lucene Document for the node. + * Deletes all documents that match the uuid. * = - * @param node - * the node to index. - * @return the index document. - * @throws RepositoryException - * if an error occurs while reading from the workspace. + * @param uuid + * documents that match this uuid will be delet= ed. + * @return the number of deleted documents. + * @throws IOException + * if an error occurs while deleting documents. */ - Document createDocument(NodeData node) throws RepositoryException + public synchronized int removeAllDocuments(String uuid) throws IOExcept= ion { - return handler.createDocument(node, nsMappings, version); + int num; + try + { + Term idTerm =3D new Term(FieldNames.UUID, uuid.toString()); + num =3D getChunk(uuid).removeDocument(idTerm); + for (int i =3D 0; i < indexes.size(); i++) + { + PersistentIndexChunk index =3D indexes.get(i); + // TODO only remove documents from owning indexes + int removed =3D index.removeDocument(idTerm); + num +=3D removed; + } + } + finally + { + releaseMultiReader(); + } + return num; } = /** - * Returns a lucene Document for the Node with id. + * Deletes the first document that matches the uuid. * = - * @param id - * the id of the node to index. - * @return the index document. - * @throws RepositoryException - * if an error occurs while reading from the workspace or if - * there is no node with id. + * @param uuid + * document that match this uuid will be delete= d. + * @throws IOException + * if an error occurs while deleting the document. */ - Document createDocument(String id) throws RepositoryException + public void removeDocument(String uuid) throws IOException { - ItemData data =3D handler.getContext().getItemStateManager().getItem= Data(id); - if (data =3D=3D null) - { - throw new ItemNotFoundException("Item id=3D" + id + " not found"); - } - if (!data.isNode()) - { - throw new RepositoryException("Item with id " + id + " is not a n= ode"); - } - return createDocument((NodeData)data); - + update(Arrays.asList(new String[]{uuid}), Collections.EMPTY_LIST); } = /** - * Releases the {@link #multiReader} and sets it null. If = the - * reader is already null this method does nothing. When t= his - * method returns {@link #multiReader} is guaranteed to be null - * even if an exception is thrown. - *

    - * Please note that this method does not take care of any synchronizati= on. A - * caller must ensure that it is the only thread operating on this multi - * index, or that it holds the {@link #updateMonitor}. + * Atomically updates the index by removing some documents and adding + * others. * = + * @param remove + * collection of UUIDs that identify documents = to + * remove + * @param add + * collection of Documents to add. Some of the + * elements in this collection may be null, to + * indicate that a node could not be indexed successfully. * @throws IOException - * if an error occurs while releasing the reader. + * if an error occurs while updating the index. */ - void releaseMultiReader() throws IOException + public synchronized void update(final Collection remove, final = Collection add) throws IOException { SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() { public Object run() throws Exception { - if (multiReader !=3D null) + // make sure a reader is available during long updates + if (add.size() > handler.getBufferSize()) { try { - multiReader.release(); + getIndexReader().release(); } - finally + catch (IOException e) { - multiReader =3D null; + // do not fail if an exception is thrown here + log.warn("unable to prepare index reader " + "for querie= s during update", e); } } + try + { + for (Iterator it =3D remove.iterator(); it.hasNext(= );) + { + String uuidString =3D it.next(); + // check if indexing queue is still working on + // this node from a previous update + Document doc =3D indexingQueue.removeDocument(uuidString= ); + if (doc !=3D null) + { + Util.disposeDocument(doc); + } + Term idTerm =3D new Term(FieldNames.UUID, uuidString); + getChunk(uuidString).removeDocument(idTerm); + } + for (Iterator it =3D add.iterator(); it.hasNext()= ;) + { + Document doc =3D it.next(); + if (doc !=3D null) + { + if (doc !=3D null) + { + String uuid =3D doc.get(FieldNames.UUID); + getChunk(uuid).addDocuments(new Document[]{doc}); + } + } + } + // TODO for owning indexes only + for (PersistentIndexChunk idx : indexes) + { + idx.commit(); + } + } + finally + { + releaseMultiReader(); + } return null; } }); } = - // -------------------------< internal - // >------------------------------------- + /** + * Checks the indexing queue for finished text extrator jobs and update= s the + * index accordingly if there are any new ones. + * = + * @param transactionPresent + * whether a transaction is in progress and the current + * {@link #getTransactionId()} should be used. If + * false a new transaction is created when docu= ments + * are transfered from the indexing queue to the index. + */ + private void checkIndexingQueue(boolean transactionPresent) + { + Document[] docs =3D indexingQueue.getFinishedDocuments(); + Map finished =3D new HashMap(); + for (int i =3D 0; i < docs.length; i++) + { + String uuid =3D docs[i].get(FieldNames.UUID); + finished.put(uuid, docs[i]); + } = + // now update index with the remaining ones if there are any + if (!finished.isEmpty()) + { + log.info("updating index with {} nodes from indexing queue.", new= Long(finished.size())); + + // remove documents from the queue + for (Iterator it =3D finished.keySet().iterator(); it.has= Next();) + { + indexingQueue.removeDocument(it.next()); + } + + try + { + if (transactionPresent) + { + for (Iterator it =3D finished.keySet().iterator(); = it.hasNext();) + { + String uuidString =3D it.next(); + // check if indexing queue is still working on + // this node from a previous update + Document doc =3D indexingQueue.removeDocument(uuidString= ); + if (doc !=3D null) + { + Util.disposeDocument(doc); + } + Term idTerm =3D new Term(FieldNames.UUID, uuidString); + // if the document cannot be deleted from the volatile i= ndex + // delete it from one of the persistent indexes. + getChunk(uuidString).removeDocument(idTerm); + } + for (Iterator it =3D finished.values().iterator()= ; it.hasNext();) + { + Document doc =3D it.next(); + String uuid =3D doc.get(FieldNames.UUID); + getChunk(uuid).addDocuments(new Document[]{doc}); + } + } + else + { + update(finished.keySet(), finished.values()); + } + } + catch (IOException e) + { + // update failed + log.warn("Failed to update index with deferred text extraction= ", e); + } + } + } + /** * Recursively creates an index starting with the NodeState * node. @@ -700,96 +706,43 @@ return count; } = - /** - * Checks the indexing queue for finished text extrator jobs and update= s the - * index accordingly if there are any new ones. This method is synchron= ized - * and should only be called by the timer task that periodically checks= if - * there are documents ready in the indexing queue. A new transaction is - * used when documents are transfered from the indexing queue to the in= dex. - */ - private synchronized void checkIndexingQueue() + private PersistentIndexChunk getChunk(String uuid) { - checkIndexingQueue(false); + return indexes.get(chunkService.getChunkId(uuid)); } = /** - * Checks the indexing queue for finished text extrator jobs and update= s the - * index accordingly if there are any new ones. + * Releases the {@link #multiReader} and sets it null. If = the + * reader is already null this method does nothing. When t= his + * method returns {@link #multiReader} is guaranteed to be null + * even if an exception is thrown. + *

    + * Please note that this method does not take care of any synchronizati= on. A + * caller must ensure that it is the only thread operating on this multi + * index, or that it holds the {@link #updateMonitor}. * = - * @param transactionPresent - * whether a transaction is in progress and the current - * {@link #getTransactionId()} should be used. If - * false a new transaction is created when docu= ments - * are transfered from the indexing queue to the index. + * @throws IOException + * if an error occurs while releasing the reader. */ - private void checkIndexingQueue(boolean transactionPresent) + private void releaseMultiReader() throws IOException { - Document[] docs =3D indexingQueue.getFinishedDocuments(); - Map finished =3D new HashMap(); - for (int i =3D 0; i < docs.length; i++) + SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptio= nAction() { - String uuid =3D docs[i].get(FieldNames.UUID); - finished.put(uuid, docs[i]); - } - - // now update index with the remaining ones if there are any - if (!finished.isEmpty()) - { - log.info("updating index with {} nodes from indexing queue.", new= Long(finished.size())); - - // remove documents from the queue - for (Iterator it =3D finished.keySet().iterator(); it.has= Next();) + public Object run() throws Exception { - indexingQueue.removeDocument(it.next()); - } - - try - { - if (transactionPresent) + if (multiReader !=3D null) { - for (Iterator it =3D finished.keySet().iterator(); = it.hasNext();) + try { - String uuidString =3D it.next(); - // check if indexing queue is still working on - // this node from a previous update - Document doc =3D indexingQueue.removeDocument(uuidString= ); - if (doc !=3D null) - { - Util.disposeDocument(doc); - } - Term idTerm =3D new Term(FieldNames.UUID, uuidString); - // if the document cannot be deleted from the volatile i= ndex - // delete it from one of the persistent indexes. - getChunk(uuidString).removeDocument(idTerm); + multiReader.release(); } - for (Iterator it =3D finished.values().iterator()= ; it.hasNext();) + finally { - Document doc =3D it.next(); - String uuid =3D doc.get(FieldNames.UUID); - getChunk(uuid).addDocuments(new Document[]{doc}); + multiReader =3D null; } } - else - { - update(finished.keySet(), finished.values()); - } + return null; } - catch (IOException e) - { - // update failed - log.warn("Failed to update index with deferred text extraction= ", e); - } - } + }); } - - @Deprecated - public boolean getRedoLogApplied() - { - return false; - } - - private PersistentIndex getChunk(String uuid) - { - return indexes.get(0); - } -} +} \ No newline at end of file Modified: jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/ex= oplatform/services/jcr/impl/core/query/lucene/SearchIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-10-14 14:11:5= 4 UTC (rev 3296) +++ jcr/branches/1.14-CNK/exo.jcr.component.core/src/main/java/org/exoplatf= orm/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-10-15 14:52:0= 4 UTC (rev 3297) @@ -570,7 +570,7 @@ indexingConfig =3D createIndexingConfiguration(nsMappings); analyzer.setIndexingConfig(indexingConfig); = - index =3D new ChunkIndex(this, context.getIndexingTree(), modeHandle= r, getIndexInfos(), getIndexUpdateMonitor()); + index =3D new ChunkIndex(this, context.getIndexingTree()); // if RW mode, create initial index and start check if (modeHandler.getMode() =3D=3D IndexerIoMode.READ_WRITE) { --===============2631162297369230695==-- From do-not-reply at jboss.org Tue Oct 19 04:11:38 2010 Content-Type: multipart/mixed; boundary="===============3272641562421091919==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3298 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/lock and 1 other directory. Date: Tue, 19 Oct 2010 04:11:38 -0400 Message-ID: <201010190811.o9J8BcUs015582@svn01.web.mwc.hst.phx2.redhat.com> --===============3272641562421091919== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-19 04:11:37 -0400 (Tue, 19 Oct 2010) New Revision: 3298 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/api/lock/TestLock.java Log: JCR-1482: Fix issue when after restarting JCR doesn't retrieve all lock dat= a from DB. After restarting server node will remain locked as expected. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-15 14:= 52:04 UTC (rev 3297) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-19 08:= 11:37 UTC (rev 3298) @@ -1065,7 +1065,7 @@ { public List execute(Object arg) throws LockException { - Set nodesId =3D cache.getChildrenNames(lockRoot); + Set nodesId =3D ((CacheSPI)cache= ).getNode(lockRoot).getChildrenNamesDirect(); = List locksData =3D new ArrayList(); for (Object nodeId : nodesId) Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/api/lock/TestLock.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/TestLock.java 2010-10-15 14:52:04 UTC (rev 3297) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/lock/TestLock.java 2010-10-19 08:11:37 UTC (rev 3298) @@ -42,6 +42,7 @@ = private Node lockedNode =3D null; = + @Override public void setUp() throws Exception { = @@ -428,4 +429,26 @@ assertFalse(childLockNode.isLocked()); = } + + /** + * Test indicate if locked node after restarting still locked. = + */ + public void testLockWithoutDBClean() throws Exception + { + String locNodeName =3D "TestLockNode"; + if (session.getRootNode().hasNode(locNodeName)) + { + Node node =3D session.getRootNode().getNode(locNodeName); + assertTrue(node.isLocked()); + } + else + { + Node node =3D session.getRootNode().addNode(locNodeName); + node.addMixin("mix:lockable"); + session.save(); + + node.lock(false, true); + } + } + } --===============3272641562421091919==-- From do-not-reply at jboss.org Tue Oct 19 07:35:09 2010 Content-Type: multipart/mixed; boundary="===============4465730393148266797==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3299 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache. Date: Tue, 19 Oct 2010 07:35:09 -0400 Message-ID: <201010191135.o9JBZ9Ki010543@svn01.web.mwc.hst.phx2.redhat.com> --===============4465730393148266797== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-19 07:35:09 -0400 (Tue, 19 Oct 2010) New Revision: 3299 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java Log: JCR-1482: Fix issue when after restarting JCR doesn't retrieve all lock dat= a from DB. After restarting server node will remain locked as expected. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-19 08:= 11:37 UTC (rev 3298) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-19 11:= 35:09 UTC (rev 3299) @@ -1065,7 +1065,7 @@ { public List execute(Object arg) throws LockException { - Set nodesId =3D ((CacheSPI)cache= ).getNode(lockRoot).getChildrenNamesDirect(); + Set nodesId =3D cache.getChildrenNames(lockRoot); = List locksData =3D new ArrayList(); for (Object nodeId : nodesId) Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/jbosscache/ControllerCacheLoader.java 2010-10-19 08:11:= 37 UTC (rev 3298) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java 2010-10-19 11:35:= 09 UTC (rev 3299) @@ -169,14 +169,7 @@ */ public Set getChildrenNames(Fqn fqn) throws Exception { - if (cache.getCacheStatus() =3D=3D CacheStatus.STARTING) - { - // Try to get the list of children name from the nested cache loa= der - return cl.getChildrenNames(fqn); - } - // All the data is loaded at startup, so no need to call the nested = cache loader for another - // cache status other than CacheStatus.STARTING - return null; + return cl.getChildrenNames(fqn); } = /** --===============4465730393148266797==-- From do-not-reply at jboss.org Tue Oct 19 08:50:40 2010 Content-Type: multipart/mixed; boundary="===============3873802169171468606==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3300 - in jcr/trunk/exo.jcr.component.webdav/src: main/java/org/exoplatform/services/jcr/webdav/command and 2 other directories. Date: Tue, 19 Oct 2010 08:50:40 -0400 Message-ID: <201010191250.o9JCoel8019752@svn01.web.mwc.hst.phx2.redhat.com> --===============3873802169171468606== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-19 08:50:39 -0400 (Tue, 19 Oct 2010) New Revision: 3300 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/WebDavConst.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/resource/VersionResource.java jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/service= s/jcr/webdav/command/TestGet.java Log: EXOJCR-1001: fixed date parsing during if-modified-since header usage Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/WebDavConst.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/WebDavConst.java 2010-10-19 11:35:09 UTC (rev 3299) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/WebDavConst.java 2010-10-19 12:50:39 UTC (rev 3300) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.jcr.webdav; = +import java.util.Hashtable; + import org.exoplatform.common.http.HTTPStatus; = -import java.util.Hashtable; - /** * Constants used for webdav service implemetation. * = @@ -468,7 +468,7 @@ /** * If-Modified-Since date psttern. */ - public static final String IF_MODIFIED_SINCE_PATTERN =3D "EEE, d MMM= yyyy HH:mm:ss z"; + public static final String IF_MODIFIED_SINCE_PATTERN =3D "EEE, dd MM= M yyyy HH:mm:ss z"; } = /** 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 2010-10-19 11:35:09 UTC (rev 3299) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/GetCommand.java 2010-10-19 12:50:39 UTC (rev 3300) @@ -18,6 +18,26 @@ */ package org.exoplatform.services.jcr.webdav.command; = +import java.io.InputStream; +import java.net.URI; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; + +import javax.jcr.Node; +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.xml.transform.stream.StreamSource; + import org.exoplatform.common.http.HTTPStatus; import org.exoplatform.common.util.HierarchicalProperty; import org.exoplatform.services.jcr.webdav.Range; @@ -39,26 +59,6 @@ import org.exoplatform.services.rest.ext.provider.XSLTStreamingOutput; import org.exoplatform.services.rest.impl.header.MediaTypeHelper; = -import java.io.InputStream; -import java.net.URI; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; - -import javax.jcr.Node; -import javax.jcr.PathNotFoundException; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.transform.stream.StreamSource; - /** * Created by The eXo Platform SAS Author : Vitaly Guly. @@ -118,7 +118,7 @@ VersionedResource versionedFile =3D new VersionedFileResour= ce(uri, node, nsContext); resource =3D versionedFile.getVersionHistory().getVersion(v= ersion); = - lastModifiedProperty =3D resource.getProperty(FileResource.= CREATIONDATE); + lastModifiedProperty =3D resource.getProperty(FileResource.= GETLASTMODIFIED); istream =3D ((VersionResource)resource).getContentAsStream(= ); } else @@ -133,10 +133,10 @@ = if (ifModifiedSince !=3D null) = { - DateFormat dateFormat =3D new SimpleDateFormat(WebDavConst.= DateFormat.IF_MODIFIED_SINCE_PATTERN, Locale.US); + DateFormat dateFormat =3D new SimpleDateFormat(WebDavConst.= DateFormat.MODIFICATION, Locale.US); Date lastModifiedDate =3D dateFormat.parse(lastModifiedProp= erty.getValue()); = - dateFormat =3D new SimpleDateFormat(WebDavConst.DateFormat.= MODIFICATION, Locale.US); + dateFormat =3D new SimpleDateFormat(WebDavConst.DateFormat.= IF_MODIFIED_SINCE_PATTERN, Locale.US); Date ifModifiedSinceDate =3D dateFormat.parse(ifModifiedSin= ce); = if(ifModifiedSinceDate.getTime() >=3D lastModifiedDate.getT= ime()){ Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/resource/VersionResource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resource/VersionResource.java 2010-10-19 11:35:09 UTC (rev 32= 99) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/resource/VersionResource.java 2010-10-19 12:50:39 UTC (rev 33= 00) @@ -18,10 +18,6 @@ */ package org.exoplatform.services.jcr.webdav.resource; = -import org.exoplatform.common.util.HierarchicalProperty; -import org.exoplatform.services.jcr.webdav.util.DeltaVConstants; -import org.exoplatform.services.jcr.webdav.xml.WebDavNamespaceContext; - import java.io.InputStream; import java.net.URI; import java.util.Calendar; @@ -34,6 +30,10 @@ import javax.jcr.version.Version; import javax.xml.namespace.QName; = +import org.exoplatform.common.util.HierarchicalProperty; +import org.exoplatform.services.jcr.webdav.util.DeltaVConstants; +import org.exoplatform.services.jcr.webdav.xml.WebDavNamespaceContext; + /** * Created by The eXo Platform SARL .
    * = @@ -174,6 +174,14 @@ return creationDate; = } + else if (DeltaVConstants.GETLASTMODIFIED.equals(name)) + { + Calendar created =3D version.getNode("jcr:frozenNode").getPropert= y("jcr:created").getDate(); + HierarchicalProperty creationDate =3D new HierarchicalProperty(na= me, created, MODIFICATION_PATTERN); + creationDate.setAttribute("b:dt", "dateTime.1123"); + return creationDate; + + } else { throw new PathNotFoundException(); Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/= services/jcr/webdav/command/TestGet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestGet.java 2010-10-19 11:35:09 UTC (rev 3299) +++ jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestGet.java 2010-10-19 12:50:39 UTC (rev 3300) @@ -18,29 +18,32 @@ */ package org.exoplatform.services.jcr.webdav.command; = -import org.exoplatform.common.http.HTTPStatus; -import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; -import org.exoplatform.services.jcr.impl.core.version.VersionImpl; -import org.exoplatform.services.jcr.webdav.BaseStandaloneTest; -import org.exoplatform.services.jcr.webdav.WebDavConstants.WebDAVMethods; -import org.exoplatform.services.jcr.webdav.utils.TestUtils; -import org.exoplatform.services.rest.ext.provider.XSLTStreamingOutput; -import org.exoplatform.services.rest.impl.ContainerResponse; - import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; +import java.text.SimpleDateFormat; import java.util.Calendar; +import java.util.Locale; = import javax.jcr.Node; +import javax.ws.rs.core.MultivaluedMap; = +import org.exoplatform.common.http.HTTPStatus; +import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.impl.core.version.VersionImpl; +import org.exoplatform.services.jcr.webdav.BaseStandaloneTest; +import org.exoplatform.services.jcr.webdav.WebDavConst; +import org.exoplatform.services.jcr.webdav.WebDavConstants.WebDAVMethods; +import org.exoplatform.services.jcr.webdav.utils.TestUtils; +import org.exoplatform.services.rest.ExtHttpHeaders; +import org.exoplatform.services.rest.impl.ContainerResponse; +import org.exoplatform.services.rest.impl.MultivaluedMapImpl; + /** * Created by The eXo Platform SAS Author : Dmytro Katayev * work.visor.ck(a)gmail.com Aug 13, 2008 @@ -124,6 +127,51 @@ = } = + /** + * Tests if date passed through header If-modified-since of GET method = parsed correctly. + * Details can be found here: http://jira.exoplatform.org/browse/JCR-14= 70 + * @throws Exception + */ + public void testIfModifiedSinceDateParsing() throws Exception + { + Node fileNode =3D session.getRootNode().addNode("node", "nt:file"); + fileNode.addMixin("mix:versionable"); + + Node contentNode =3D fileNode.addNode("jcr:content", "nt:resource"); + contentNode.setProperty("jcr:mimeType", "text/plain"); + + Calendar creationDate =3D Calendar.getInstance(); + Calendar IfModifiedSince =3D Calendar.getInstance(); + IfModifiedSince.add(Calendar.HOUR, -2); + creationDate.add(Calendar.HOUR, -1); + contentNode.setProperty("jcr:data", creationDate); + contentNode.setProperty("jcr:lastModified", creationDate); + + session.save(); + + fileNode.checkin(); + fileNode.checkout(); + + String path =3D + getPathWS() + "/" + fileNode.getName() + "?time=3D" + IfModifiedS= ince.getTimeInMillis() + "&version=3D1"; + + SimpleDateFormat dateFormat =3D new SimpleDateFormat(WebDavConst.Dat= eFormat.IF_MODIFIED_SINCE_PATTERN, Locale.US); + String ifModifiedSinceDate =3D dateFormat.format(IfModifiedSince.get= Time()); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + headers.add(ExtHttpHeaders.IF_MODIFIED_SINCE, ifModifiedSinceDate); + ContainerResponse response =3D service(WebDAVMethods.GET, path, "", = headers, null); + assertEquals(HTTPStatus.OK, response.getStatus()); + + headers.clear(); + + IfModifiedSince.add(Calendar.HOUR, +4); + ifModifiedSinceDate =3D dateFormat.format(IfModifiedSince.getTime()); + headers.add(ExtHttpHeaders.IF_MODIFIED_SINCE, ifModifiedSinceDate); + response =3D service(WebDAVMethods.GET, path, "", headers, null); + assertEquals(HTTPStatus.NOT_MODIFIED, response.getStatus()); + } + @Override protected String getRepositoryName() { --===============3873802169171468606==-- From do-not-reply at jboss.org Tue Oct 19 09:55:04 2010 Content-Type: multipart/mixed; boundary="===============2145531094190335984==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3301 - in jcr/branches/1.12.x/exo.jcr.component.webdav/src: main/java/org/exoplatform/services/jcr/webdav/command and 2 other directories. Date: Tue, 19 Oct 2010 09:55:03 -0400 Message-ID: <201010191355.o9JDt3AG028584@svn01.web.mwc.hst.phx2.redhat.com> --===============2145531094190335984== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-19 09:55:03 -0400 (Tue, 19 Oct 2010) New Revision: 3301 Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatfo= rm/services/jcr/webdav/WebDavConst.java jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatfo= rm/services/jcr/webdav/command/GetCommand.java jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatfo= rm/services/jcr/webdav/resource/VersionResource.java jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatfo= rm/services/jcr/webdav/command/TestGet.java Log: JCR-1470: fixed date parsing during if-modified-since header usage Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/ex= oplatform/services/jcr/webdav/WebDavConst.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/WebDavConst.java 2010-10-19 12:50:39 UTC (rev 3300) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/WebDavConst.java 2010-10-19 13:55:03 UTC (rev 3301) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.jcr.webdav; = +import java.util.Hashtable; + import org.exoplatform.common.http.HTTPStatus; = -import java.util.Hashtable; - /** * Constants used for webdav service implemetation. * = @@ -468,7 +468,7 @@ /** * If-Modified-Since date psttern. */ - public static final String IF_MODIFIED_SINCE_PATTERN =3D "EEE, d MMM= yyyy HH:mm:ss z"; + public static final String IF_MODIFIED_SINCE_PATTERN =3D "EEE, dd MM= M yyyy HH:mm:ss z"; } = /** Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/ex= oplatform/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/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/command/GetCommand.java 2010-10-19 12:50:39 UTC (re= v 3300) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/command/GetCommand.java 2010-10-19 13:55:03 UTC (re= v 3301) @@ -18,6 +18,26 @@ */ package org.exoplatform.services.jcr.webdav.command; = +import java.io.InputStream; +import java.net.URI; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; + +import javax.jcr.Node; +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.xml.transform.stream.StreamSource; + import org.exoplatform.common.http.HTTPStatus; import org.exoplatform.common.util.HierarchicalProperty; import org.exoplatform.services.jcr.webdav.Range; @@ -39,26 +59,6 @@ import org.exoplatform.services.rest.ext.provider.XSLTStreamingOutput; import org.exoplatform.services.rest.impl.header.MediaTypeHelper; = -import java.io.InputStream; -import java.net.URI; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; - -import javax.jcr.Node; -import javax.jcr.PathNotFoundException; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.transform.stream.StreamSource; - /** * Created by The eXo Platform SAS Author : Vitaly Guly. @@ -118,7 +118,7 @@ VersionedResource versionedFile =3D new VersionedFileResour= ce(uri, node, nsContext); resource =3D versionedFile.getVersionHistory().getVersion(v= ersion); = - lastModifiedProperty =3D resource.getProperty(FileResource.= CREATIONDATE); + lastModifiedProperty =3D resource.getProperty(FileResource.= GETLASTMODIFIED); istream =3D ((VersionResource)resource).getContentAsStream(= ); } else @@ -132,10 +132,10 @@ // check before any other reads if (ifModifiedSince !=3D null) = { - DateFormat dateFormat =3D new SimpleDateFormat(WebDavConst.= DateFormat.IF_MODIFIED_SINCE_PATTERN, Locale.US); + DateFormat dateFormat =3D new SimpleDateFormat(WebDavConst.= DateFormat.MODIFICATION, Locale.US); Date lastModifiedDate =3D dateFormat.parse(lastModifiedProp= erty.getValue()); = - dateFormat =3D new SimpleDateFormat(WebDavConst.DateFormat.= MODIFICATION, Locale.US); + dateFormat =3D new SimpleDateFormat(WebDavConst.DateFormat.= IF_MODIFIED_SINCE_PATTERN, Locale.US); Date ifModifiedSinceDate =3D dateFormat.parse(ifModifiedSin= ce); = if(ifModifiedSinceDate.getTime() >=3D lastModifiedDate.getT= ime()){ Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/ex= oplatform/services/jcr/webdav/resource/VersionResource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/resource/VersionResource.java 2010-10-19 12:50:39 U= TC (rev 3300) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/resource/VersionResource.java 2010-10-19 13:55:03 U= TC (rev 3301) @@ -18,10 +18,6 @@ */ package org.exoplatform.services.jcr.webdav.resource; = -import org.exoplatform.common.util.HierarchicalProperty; -import org.exoplatform.services.jcr.webdav.util.DeltaVConstants; -import org.exoplatform.services.jcr.webdav.xml.WebDavNamespaceContext; - import java.io.InputStream; import java.net.URI; import java.util.Calendar; @@ -34,6 +30,10 @@ import javax.jcr.version.Version; import javax.xml.namespace.QName; = +import org.exoplatform.common.util.HierarchicalProperty; +import org.exoplatform.services.jcr.webdav.util.DeltaVConstants; +import org.exoplatform.services.jcr.webdav.xml.WebDavNamespaceContext; + /** * Created by The eXo Platform SARL .
    * = @@ -174,6 +174,14 @@ return creationDate; = } + else if (DeltaVConstants.GETLASTMODIFIED.equals(name)) + { + Calendar created =3D version.getNode("jcr:frozenNode").getPropert= y("jcr:created").getDate(); + HierarchicalProperty creationDate =3D new HierarchicalProperty(na= me, created, MODIFICATION_PATTERN); + creationDate.setAttribute("b:dt", "dateTime.rfc1123"); + return creationDate; + + } else { throw new PathNotFoundException(); Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/ex= oplatform/services/jcr/webdav/command/TestGet.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatf= orm/services/jcr/webdav/command/TestGet.java 2010-10-19 12:50:39 UTC (rev 3= 300) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatf= orm/services/jcr/webdav/command/TestGet.java 2010-10-19 13:55:03 UTC (rev 3= 301) @@ -18,29 +18,32 @@ */ package org.exoplatform.services.jcr.webdav.command; = -import org.exoplatform.common.http.HTTPStatus; -import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; -import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; -import org.exoplatform.services.jcr.impl.core.version.VersionImpl; -import org.exoplatform.services.jcr.webdav.BaseStandaloneTest; -import org.exoplatform.services.jcr.webdav.WebDavConstants.WebDAVMethods; -import org.exoplatform.services.jcr.webdav.utils.TestUtils; -import org.exoplatform.services.rest.ext.provider.XSLTStreamingOutput; -import org.exoplatform.services.rest.impl.ContainerResponse; - import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; -import java.io.FileOutputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; +import java.text.SimpleDateFormat; import java.util.Calendar; +import java.util.Locale; = import javax.jcr.Node; +import javax.ws.rs.core.MultivaluedMap; = +import org.exoplatform.common.http.HTTPStatus; +import org.exoplatform.services.jcr.core.nodetype.ExtendedNodeTypeManager; +import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; +import org.exoplatform.services.jcr.impl.core.version.VersionImpl; +import org.exoplatform.services.jcr.webdav.BaseStandaloneTest; +import org.exoplatform.services.jcr.webdav.WebDavConst; +import org.exoplatform.services.jcr.webdav.WebDavConstants.WebDAVMethods; +import org.exoplatform.services.jcr.webdav.utils.TestUtils; +import org.exoplatform.services.rest.ExtHttpHeaders; +import org.exoplatform.services.rest.impl.ContainerResponse; +import org.exoplatform.services.rest.impl.MultivaluedMapImpl; + /** * Created by The eXo Platform SAS Author : Dmytro Katayev * work.visor.ck(a)gmail.com Aug 13, 2008 @@ -124,6 +127,52 @@ = } = + + /** + * Tests if date passed through header If-modified-since of GET method = parsed correctly. + * Details can be found here: http://jira.exoplatform.org/browse/JCR-14= 70 + * @throws Exception + */ + public void testIfModifiedSinceDateParsing() throws Exception + { + Node fileNode =3D session.getRootNode().addNode("node", "nt:file"); + fileNode.addMixin("mix:versionable"); + + Node contentNode =3D fileNode.addNode("jcr:content", "nt:resource"); + contentNode.setProperty("jcr:mimeType", "text/plain"); + + Calendar creationDate =3D Calendar.getInstance(); + Calendar IfModifiedSince =3D Calendar.getInstance(); + IfModifiedSince.add(Calendar.HOUR, -2); + creationDate.add(Calendar.HOUR, -1); + contentNode.setProperty("jcr:data", creationDate); + contentNode.setProperty("jcr:lastModified", creationDate); + + session.save(); + + fileNode.checkin(); + fileNode.checkout(); + + String path =3D + getPathWS() + "/" + fileNode.getName() + "?time=3D" + IfModifiedS= ince.getTimeInMillis() + "&version=3D1"; + + SimpleDateFormat dateFormat =3D new SimpleDateFormat(WebDavConst.Dat= eFormat.IF_MODIFIED_SINCE_PATTERN, Locale.US); + String ifModifiedSinceDate =3D dateFormat.format(IfModifiedSince.get= Time()); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + headers.add(ExtHttpHeaders.IF_MODIFIED_SINCE, ifModifiedSinceDate); + ContainerResponse response =3D service(WebDAVMethods.GET, path, "", = headers, null); + assertEquals(HTTPStatus.OK, response.getStatus()); + + headers.clear(); + + IfModifiedSince.add(Calendar.HOUR, +4); + ifModifiedSinceDate =3D dateFormat.format(IfModifiedSince.getTime()); + headers.add(ExtHttpHeaders.IF_MODIFIED_SINCE, ifModifiedSinceDate); + response =3D service(WebDAVMethods.GET, path, "", headers, null); + assertEquals(HTTPStatus.NOT_MODIFIED, response.getStatus()); + } + @Override protected String getRepositoryName() { --===============2145531094190335984==-- From do-not-reply at jboss.org Tue Oct 19 10:26:54 2010 Content-Type: multipart/mixed; boundary="===============5011712789705247747==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3302 - in jcr/branches/1.12.x/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/lock and 1 other directory. Date: Tue, 19 Oct 2010 10:26:54 -0400 Message-ID: <201010191426.o9JEQs3n003680@svn01.web.mwc.hst.phx2.redhat.com> --===============5011712789705247747== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-19 10:26:53 -0400 (Tue, 19 Oct 2010) New Revision: 3302 Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatform= /services/jcr/api/lock/TestLock.java Log: JCR-1482: Fix issue when after restarting JCR doesn't retrieve all lock dat= a from DB. After restarting server node will remain locked as expected. Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java 2010-10= -19 13:55:03 UTC (rev 3301) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java 2010-10= -19 14:26:53 UTC (rev 3302) @@ -140,14 +140,7 @@ */ public Set getChildrenNames(Fqn fqn) throws Exception { - if (cache.getCacheStatus() =3D=3D CacheStatus.STARTING) - { - // Try to get the list of children name from the nested cache loa= der - return cl.getChildrenNames(fqn); = - } - // All the data is loaded at startup, so no need to call the nested = cache loader for another - // cache status other than CacheStatus.STARTING - return null; + return cl.getChildrenNames(fqn); } = /** Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exop= latform/services/jcr/api/lock/TestLock.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatfor= m/services/jcr/api/lock/TestLock.java 2010-10-19 13:55:03 UTC (rev 3301) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/test/java/org/exoplatfor= m/services/jcr/api/lock/TestLock.java 2010-10-19 14:26:53 UTC (rev 3302) @@ -42,6 +42,7 @@ = private Node lockedNode =3D null; = + @Override public void setUp() throws Exception { = @@ -428,4 +429,26 @@ assertFalse(childLockNode.isLocked()); = } + + /** + * Test indicate if locked node after restarting still locked. = + */ + public void testLockWithoutDBClean() throws Exception + { + String locNodeName =3D "TestLockNode"; + if (session.getRootNode().hasNode(locNodeName)) + { + Node node =3D session.getRootNode().getNode(locNodeName); + assertTrue(node.isLocked()); + } + else + { + Node node =3D session.getRootNode().addNode(locNodeName); + node.addMixin("mix:lockable"); + session.save(); + + node.lock(false, true); + } + } + } --===============5011712789705247747==-- From do-not-reply at jboss.org Wed Oct 20 03:53:14 2010 Content-Type: multipart/mixed; boundary="===============7549381186568647203==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3303 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent: jbosscache and 1 other directory. Date: Wed, 20 Oct 2010 03:53:13 -0400 Message-ID: <201010200753.o9K7rDFb023552@svn01.web.mwc.hst.phx2.redhat.com> --===============7549381186568647203== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-20 03:53:13 -0400 (Wed, 20 Oct 2010) New Revision: 3303 Modified: 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/jbosscache/JBossCacheWorkspaceStorageCache.java Log: EXOJCR-965: added disable/enable cache feature support 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 2010-10-19= 14:26:53 UTC (rev 3302) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-10-20= 07:53:13 UTC (rev 3303) @@ -18,6 +18,14 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CountDownLatch; + +import javax.jcr.RepositoryException; +import javax.transaction.TransactionManager; + import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCa= che; import org.exoplatform.services.jcr.datamodel.ItemData; @@ -33,14 +41,6 @@ import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.transaction.TransactionService; = -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.CountDownLatch; - -import javax.jcr.RepositoryException; -import javax.transaction.TransactionManager; - /** * Created by The eXo Platform SAS. = * = @@ -393,83 +393,97 @@ @Override public ItemData getItemData(NodeData parentData, QPathEntry name, ItemT= ype itemType) throws RepositoryException { - - // 1. Try from cache - ItemData data =3D getCachedItemData(parentData, name, itemType); - - // 2. Try from container - if (data =3D=3D null) + if (cache.isEnabled()) { - final DataRequest request =3D new DataRequest(parentData.getIdent= ifier(), name); + // 1. Try from cache + ItemData data =3D getCachedItemData(parentData, name, itemType); = - try + // 2. Try from container + if (data =3D=3D null) { - request.start(); - // Try first to get the value from the cache since a - // request could have been launched just before - data =3D getCachedItemData(parentData, name, itemType); - if (data =3D=3D null) + final DataRequest request =3D new DataRequest(parentData.getId= entifier(), name); + + try { - data =3D getPersistedItemData(parentData, name, itemType); + request.start(); + // Try first to get the value from the cache since a + // request could have been launched just before + data =3D getCachedItemData(parentData, name, itemType); + if (data =3D=3D null) + { + data =3D getPersistedItemData(parentData, name, itemType= ); + } + else if (!data.isNode()) + { + fixPropertyValues((PropertyData)data); + } } - else if (!data.isNode()) + finally { - fixPropertyValues((PropertyData)data); + request.done(); } } - finally + else if (!data.isNode()) { - request.done(); + fixPropertyValues((PropertyData)data); } + + return data instanceof NullNodeData ? null : data; } - else if (!data.isNode()) + else { - fixPropertyValues((PropertyData)data); + return super.getItemData(parentData, name, itemType); } - - return data instanceof NullNodeData ? null : data; } = + /** * {@inheritDoc} */ @Override public ItemData getItemData(String identifier) throws RepositoryExcepti= on { - // 1. Try from cache - ItemData data =3D getCachedItemData(identifier); - - // 2 Try from container - if (data =3D=3D null) + if (cache.isEnabled()) { - final DataRequest request =3D new DataRequest(identifier); + // 1. Try from cache + ItemData data =3D getCachedItemData(identifier); = - try + // 2 Try from container + if (data =3D=3D null) { - request.start(); - // Try first to get the value from the cache since a - // request could have been launched just before - data =3D getCachedItemData(identifier); - if (data =3D=3D null) + final DataRequest request =3D new DataRequest(identifier); + + try { - data =3D getPersistedItemData(identifier); + request.start(); + // Try first to get the value from the cache since a + // request could have been launched just before + data =3D getCachedItemData(identifier); + if (data =3D=3D null) + { + data =3D getPersistedItemData(identifier); + } + else if (!data.isNode()) + { + fixPropertyValues((PropertyData)data); + } } - else if (!data.isNode()) + finally { - fixPropertyValues((PropertyData)data); + request.done(); } } - finally + else if (!data.isNode()) { - request.done(); + fixPropertyValues((PropertyData)data); } + + return data instanceof NullNodeData ? null : data; } - else if (!data.isNode()) + else { - fixPropertyValues((PropertyData)data); + return super.getItemData(identifier); } - - return data instanceof NullNodeData ? null : data; } = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCa= che.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jbosscache/JBossCacheWorkspaceStorageCache.ja= va 2010-10-19 14:26:53 UTC (rev 3302) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.ja= va 2010-10-20 07:53:13 UTC (rev 3303) @@ -18,6 +18,19 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache; = +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Set; + +import javax.jcr.RepositoryException; +import javax.transaction.TransactionManager; + import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; @@ -48,19 +61,6 @@ import org.jboss.cache.config.EvictionRegionConfig; import org.jboss.cache.eviction.ExpirationAlgorithmConfig; = -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.NoSuchElementException; -import java.util.Set; - -import javax.jcr.RepositoryException; -import javax.transaction.TransactionManager; - /** * Created by The eXo Platform SAS.

    * = @@ -98,6 +98,8 @@ = private static final Log LOG =3D ExoLogger.getLogger("exo.jcr.component= .core.JBossCacheWorkspaceStorageCache"); = + private final boolean enabled; + public static final String JBOSSCACHE_CONFIG =3D "jbosscache-configurat= ion"; = public static final String JBOSSCACHE_EXPIRATION =3D "jbosscache-expira= tion-time"; @@ -283,6 +285,8 @@ throw new RepositoryConfigurationException("Cache configuration n= ot found"); } = + enabled =3D wsConfig.getCache().isEnabled(); + // create cache using custom factory ExoJBossCacheFactory factory; = @@ -791,7 +795,7 @@ */ public boolean isEnabled() { - return true; + return enabled; } = // non-public members --===============7549381186568647203==-- From do-not-reply at jboss.org Wed Oct 20 04:10:24 2010 Content-Type: multipart/mixed; boundary="===============6133177124833276401==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3304 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: core and 1 other directory. Date: Wed, 20 Oct 2010 04:10:24 -0400 Message-ID: <201010200810.o9K8AOQ4030305@svn01.web.mwc.hst.phx2.redhat.com> --===============6133177124833276401== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-20 04:10:23 -0400 (Wed, 20 Oct 2010) New Revision: 3304 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/RepositoryContainer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/BackupWorkspaceInitializer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SysViewWorkspaceInitializer.java Log: EXOJCR-999: make BackupWorkspaceInitializer and SysViewWorkspaceInitializer= use ValueFactory.getFileCleaner(); WorkspaceFileCleanerHolder is per-repos= itory now; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-20 07:53:13 UTC (rev 3303) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-20 08:10:23 UTC (rev 3304) @@ -253,8 +253,8 @@ workspaceContainer.registerComponentImplementation(containerTy= pe); if (isSystem) { - registerComponentInstance(new SystemDataContainerHolder( - (WorkspaceDataContainer)workspaceContainer.getComponentI= nstanceOfType(WorkspaceDataContainer.class))); + registerComponentInstance(new SystemDataContainerHolder((Wo= rkspaceDataContainer)workspaceContainer + .getComponentInstanceOfType(WorkspaceDataContainer.class= ))); } } catch (ClassNotFoundException e) @@ -369,7 +369,6 @@ } workspaceContainer.registerComponentImplementation(initilizerType= ); workspaceContainer.registerComponentImplementation(SessionFactory= .class); - workspaceContainer.registerComponentImplementation(WorkspaceFileC= leanerHolder.class); = LocalWorkspaceDataManagerStub wsDataManager =3D (LocalWorkspaceDataManagerStub)workspaceContainer Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/BackupWorkspaceInitializer.java 2010-10-20 07:53:13 UTC (rev= 3303) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/BackupWorkspaceInitializer.java 2010-10-20 08:10:23 UTC (rev= 3304) @@ -90,7 +90,7 @@ super(config, repConfig, dataManager, namespaceRegistry, locationFac= tory, nodeTypeManager, valueFactory, accessManager); = - this.fileCleaner =3D new FileCleaner(); + this.fileCleaner =3D valueFactory.getFileCleaner(); = restoreDir =3D restorePath; = @@ -366,8 +366,6 @@ = restoreChangesLog.restore(); = - TransactionChangesLog log =3D restoreChangesLog.getItemDataChange= sLog(); - } else if (changesLogType =3D=3D RestoreChangesLog.Type.ItemDataChange= sLog_without_Streams) { 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 2010-10-20 07:53:13 UTC (re= v 3303) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SysViewWorkspaceInitializer.java 2010-10-20 08:10:23 UTC (re= v 3304) @@ -405,7 +405,7 @@ this.namespaceRegistry =3D namespaceRegistry; this.locationFactory =3D locationFactory; = - this.fileCleaner =3D new FileCleaner(false); // cleaner should be st= arted! + this.fileCleaner =3D valueFactory.getFileCleaner(); this.maxBufferSize =3D config.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, WorkspaceDataContainer.DEF_MAXBUFFERSIZE); @@ -457,7 +457,7 @@ this.namespaceRegistry =3D namespaceRegistry; this.locationFactory =3D locationFactory; = - this.fileCleaner =3D new FileCleaner(false); // cleaner should be st= arted! + this.fileCleaner =3D valueFactory.getFileCleaner(); this.maxBufferSize =3D config.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, WorkspaceDataContainer.DEF_MAXBUFFERSIZE); @@ -819,7 +819,6 @@ = public void start() { - fileCleaner.start(); } = public void stop() --===============6133177124833276401==-- From do-not-reply at jboss.org Wed Oct 20 09:24:48 2010 Content-Type: multipart/mixed; boundary="===============8951124319683975858==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3305 - in jcr/branches/1.12.x: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository and 1 other directories. Date: Wed, 20 Oct 2010 09:24:48 -0400 Message-ID: <201010201324.o9KDOmjf009703@svn01.web.mwc.hst.phx2.redhat.com> --===============8951124319683975858== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-20 09:24:47 -0400 (Wed, 20 Oct 2010) New Revision: 3305 Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/BackupClient.java jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/= services/jcr/ext/repository/RestRepositoryService.java jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docb= ook/en-US/modules/jcr/backup/backup-client.xml Log: JCR-1459: Whole Repository backup support in Backup Console tool Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/java/org/exoplatform/jcr/backupconsole/BackupClient.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupClient.java 2010-10-20 0= 8:10:23 UTC (rev 3304) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupClient.java 2010-10-20 1= 3:24:47 UTC (rev 3305) @@ -31,72 +31,108 @@ { = /** - * Start Backup. + * Start backup of repository or workspace. + * If workspaceName is 'null', then repository backup will be started. = * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @param backupDir path to backup folder on remote server. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name. + * @param workspaceName = + * String, the workspace name. + * @param backupDir = + * path to backup folder on remote server + * @return String = + * result + * @throws IOException = + * transport exception. + * @throws BackupExecuteException = + * backup client internal exception. */ String startBackUp(String repositoryName, String workspaceName, String = backupDir) throws IOException, BackupExecuteException; = /** - * Start Incremental Backup. + * Start Incremental Backup of repository or workspace. + * If workspaceName is 'null', then repository backup will be started. * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @param incr incemental job period. - * @param backupDir path to backup folder on remote server. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @param incr = + * incremental job period. + * @param backupDir = + * path to backup folder on remote server + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String startIncrementalBackUp(String repositoryName, String workspaceNa= me, String backupDir, long incr) throws IOException, BackupExecuteException; = /** - * Get Status. + * Get Status of backup. * = - * @param backupId the backup identifier. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param backupId = + * the backup identifier. + * @return String = + * result. + * @throws IOException = + * transport exception. + * @throws BackupExecuteException = + * backup client internal exception. */ String status(String backupId) throws IOException, BackupExecuteExcepti= on; = /** * Get information about backup service. * = - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String info() throws IOException, BackupExecuteException; = /** - * Get information about current restores. + * Get information about current restores of repository or workspace. + * If workspaceName is 'null', then will be get status of repository ba= ckup. * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String restores(String repositoryName, String workspaceName) throws IOE= xception, BackupExecuteException; = /** - * Restore repository from backup file. + * Restore repository or workspace from backup file. + * If workspaceName is 'null', then will be run restore of repository. * = - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @param backupId the backup identifier. - * @param config InputStream contains workspace configuration. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @param backupId = + * the backup identifier + * @param config = + * InputStream contains workspace configuration + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String restore(String repositoryName, String workspaceName, String back= upId, InputStream config) throws IOException, BackupExecuteException; @@ -104,22 +140,33 @@ /** * Stop backup. * = - * @param backupId the backup identifier. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param backupId = + * the backup identifier + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String stop(String backupId) throws IOException, BackupExecuteException; = /** - * Drop backup. + * Drop workspace or repository. + * If workspaceName is 'null', then repository will be dropped. * = - * @param forceClose force sessions close on droped workspace. - * @param repositoryName String, the repository name. - * @param workspaceName String, the workspace name. - * @return String result. - * @throws IOException transport exception. - * @throws BackupExecuteException backup client internal exception. + * @param forceClose = + * force sessions close on repository or workspace + * @param repositoryName = + * String, the repository name + * @param workspaceName = + * String, the workspace name + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String drop(boolean forceClose, String repositoryName, String workspace= Name) throws IOException, BackupExecuteException; @@ -127,18 +174,24 @@ /** * Get information about the current backups (in progress). * - * @return String result - * @throws IOException - * @throws BackupExecuteException + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String list() throws IOException, BackupExecuteException; = /** * Get information about the completed (ready to restore) backups. * - * @return String result - * @throws IOException - * @throws BackupExecuteException + * @return String = + * result + * @throws IOException = + * transport exception + * @throws BackupExecuteException = + * backup client internal exception */ String listCompleted() throws IOException, BackupExecuteException; = Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-= 20 08:10:23 UTC (rev 3304) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-= 20 13:24:47 UTC (rev 3305) @@ -18,12 +18,22 @@ */ package org.exoplatform.jcr.backupconsole; = +import java.io.ByteArrayInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; + +import javax.ws.rs.core.Response; + import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.RepositoryServiceConfiguration; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.ext.backup.BackupJob; import org.exoplatform.services.jcr.ext.backup.BackupManager; +import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain; +import org.exoplatform.services.jcr.ext.backup.impl.JobRepositoryRestore; import org.exoplatform.services.jcr.ext.backup.impl.JobWorkspaceRestore; import org.exoplatform.services.jcr.ext.backup.server.HTTPBackupAgent; import org.exoplatform.services.jcr.ext.backup.server.bean.BackupConfigBea= n; @@ -31,6 +41,7 @@ import org.exoplatform.services.jcr.ext.backup.server.bean.response.Detail= edInfo; import org.exoplatform.services.jcr.ext.backup.server.bean.response.ShortI= nfo; import org.exoplatform.services.jcr.ext.backup.server.bean.response.ShortI= nfoList; +import org.exoplatform.services.jcr.ext.repository.RestRepositoryService; import org.exoplatform.ws.frameworks.json.JsonHandler; import org.exoplatform.ws.frameworks.json.JsonParser; import org.exoplatform.ws.frameworks.json.impl.BeanBuilder; @@ -44,550 +55,1080 @@ import org.jibx.runtime.IUnmarshallingContext; import org.jibx.runtime.JiBXException; = -import java.io.ByteArrayInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -import javax.ws.rs.core.Response; - /** * Created by The eXo Platform SAS.
    Date: * = * @author Karpenko Sergiy * @version $Id: BackupClientImpl.java 111 2008-11-11 11:11:11Z serg $ */ -public class BackupClientImpl implements BackupClient { +public class BackupClientImpl + implements BackupClient +{ = - /** - * Block size. - */ - private static final int BLOCK_SIZE =3D 1024; + /** + * Block size. + */ + private static final int BLOCK_SIZE =3D 1024; = - /** - * Client transport. - */ - private ClientTransport transport; - = - /** - * The URL path. - */ - private final String path; + /** + * Client transport. + */ + private ClientTransport transport; = - /** - * User login. - */ - private final String userName; + /** + * The URL path. + */ + private final String path; = - /** - * User password. - */ - private final String pass; - = - /** - * Constructor. - * = - * @param transport ClientTransport implementation. - * @param login user login. - * @param pass user password. - */ - public BackupClientImpl(ClientTransport transport, String login, String = pass, String urlPath) { - this.transport =3D transport; - this.userName =3D login; - this.pass =3D pass; - = - if (urlPath =3D=3D null) - path =3D "/rest"; - else - path =3D urlPath; - } - = - /** - * {@inheritDoc} - */ - public String startBackUp(String repositoryName, String workspaceName, S= tring backupDir) throws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.START_BACKUP + - "/" + repositoryName + - "/" + workspaceName; + /** + * User login. + */ + private final String userName; = - BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL_BACK= UP_ONLY, - backupDir); - = - JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); - JsonValue json; - try { - json =3D generatorImpl.createJsonObject(bean); - } catch (JsonException e) { - throw new BackupExecuteException("Can not get json from : " + bean.= getClass().toString(), e); - } - = - BackupAgentResponse response =3D transport.executePOST(sURL, json.toS= tring()); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + /** + * User password. + */ + private final String pass; = - /** - * {@inheritDoc} - */ - public String startIncrementalBackUp(String repositoryName, String works= paceName, String backupDir, long incr) throws IOException, - = BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.START_BACKUP + - "/" + repositoryName + - "/" + workspaceName; + /** + * Constructor. + * = + * @param transport ClientTransport implementation. + * @param login user login. + * @param pass user password. + */ + public BackupClientImpl(ClientTransport transport, String login, String= pass, String urlPath) + { + this.transport =3D transport; + this.userName =3D login; + this.pass =3D pass; = - BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL_AND_= INCREMENTAL, - backupDir, - incr); - = - JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); - JsonValue json; - try { - json =3D generatorImpl.createJsonObject(bean); - } catch (JsonException e) { - throw new BackupExecuteException("Can not get json from : " + bean.= getClass().toString(), e); - } - = - BackupAgentResponse response =3D transport.executePOST(sURL, json.toS= tring()); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + if (urlPath =3D=3D null) + path =3D "/rest"; + else + path =3D urlPath; + } = - /** - * {@inheritDoc} - */ - public String status(String backupId) throws IOException, BackupExecuteE= xception { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.CURRENT_OR_COMPL= ETED_BACKUP_INFO + = - "/" + backupId; + /** + * {@inheritDoc} + */ + public String startBackUp(String repositoryName, String workspaceName, = String backupDir) throws IOException, + BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.START_BACKUP + + "/" + repositoryName + "/" + workspaceName; = - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - DetailedInfo info; - try { - info =3D (DetailedInfo) getObject(DetailedInfo.class, response.get= ResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get DetailedInfo from responc= e.", e); + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _BACKUP_ONLY, backupDir); + + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } } - = - if (info.getType() =3D=3D DetailedInfo.COMPLETED) { - String result =3D "\nThe completed (ready to restore) backup infor= mation : \n"; - = - BackupConfigBean configBean =3D info.getBackupConfig(); - = - result +=3D ("\t\tbackup id : " + info.getBackupId(= ) + "\n" = - + "\t\tbackup folder : " + configBean.getBacku= pDir() + "\n" = - + "\t\trepository name : " + info.getRepositoryN= ame() + "\n" - + "\t\tworkspace name : " + info.getWorkspaceNa= me() + "\n" - + "\t\tbackup type : " + (configBean.getBack= upType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : = "full only") + "\n" - + "\t\tstarted time : " + info.getStartedTime= () + "\n" - + (info.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + info.getFinishedTim= e() + "\n\n")); - = - return result; - } else { - String result =3D "\nThe current backup information : \n"; - = - BackupConfigBean configBean =3D info.getBackupConfig(); - = - result +=3D ("\t\tbackup id : " + info.getBackupId= () + "\n" = - + "\t\tbackup folder : " + configBean.getBack= upDir() + "\n" = - + "\t\trepository name : " + info.getRepository= Name() + "\n" - + "\t\tworkspace name : " + info.getWorkspaceN= ame() + "\n" - + "\t\tbackup type : " + (configBean.getBac= kupType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" := "full only") + "\n" - + "\t\tfull backup state : " + getState(info.getS= tate())) + "\n" - + (info.getBackupType() =3D=3D BackupManager.FULL_BACKUP= _ONLY ? "" : = - "\t\tincremental backup state : " + "working" + "\n") - + "\t\tstarted time : " + info.getStartedTim= e() + "\n" - + (info.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + info.getFinishedTi= me() + "\n\n"); - = - return result; + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.START= _BACKUP_REPOSITORY + "/" + repositoryName; + + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _BACKUP_ONLY, backupDir); + + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } } - } else { - return failureProcessing(response); - } - } + } = - /** - * {@inheritDoc} - */ - public String stop(String backupId) throws IOException, BackupExecuteExc= eption { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.STOP_BACKUP + = - "/" + backupId; + /** + * {@inheritDoc} + */ + public String startIncrementalBackUp(String repositoryName, String work= spaceName, String backupDir, long incr) + throws IOException, BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.START_BACKUP + + "/" + repositoryName + "/" + workspaceName; = - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _AND_INCREMENTAL, backupDir, incr); = - /** - * {@inheritDoc} - */ - public String restore(String repositoryName, String workspaceName, Strin= g backupId, InputStream config) throws IOException, - = BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.RESTORE + - "/" + repositoryName + - "/" + backupId; + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } = - = - WorkspaceEntry wEntry =3D null; - try { - wEntry =3D getWorkspaceEntry(config, repositoryName, workspaceName); - } catch (Throwable e) { - throw new BackupExecuteException("Can not get WorkspaceEntry for work= space '" + workspaceName + "' from config.", e); = - } - = - JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); - JsonValue json; - = - try { - json =3D generatorImpl.createJsonObject(wEntry); - } catch (JsonException e) { - throw new BackupExecuteException("Can not get json from : " + wEntr= y.getClass().toString(), e); - } - = - BackupAgentResponse response =3D transport.executePOST(sURL, json.toS= tring()); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } - } + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); = - /** - * {@inheritDoc} - */ - public String drop(boolean forceClose, String repositoryName, String wor= kspaceName) throws IOException, - BackupExecuteExce= ption { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.DROP_WORKSPACE + - "/" + repositoryName + - "/" + workspaceName + = - "/" + forceClose; + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.START= _BACKUP_REPOSITORY + "/" + repositoryName; = - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - return "\nSuccessful : \n" + - "\tstatus code =3D " + response.getStatus() + "\n"; - } else { - return failureProcessing(response); - } = - } + BackupConfigBean bean =3D new BackupConfigBean(BackupManager.FULL= _AND_INCREMENTAL, backupDir, incr); = - /** - * {@inheritDoc} - */ - public String info() throws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackup= Agent.Constants.OperationType.BACKUP_SERVICE_INFO; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - BackupServiceInfoBean info; - try { - info =3D (BackupServiceInfoBean) getObject(BackupServiceInfoBean.c= lass, response.getResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get BackupServiceInfoBean fro= m responce.", e); + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + try + { + json =3D generatorImpl.createJsonObject(bean); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += bean.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } } - = - String result =3D "\nThe backup service information : \n" - + "\tfull backup type : " + info.getFu= llBackupType() + "\n" - + "\tincremetal backup type : " + info.getIn= crementalBackupType() + "\n" - + "\tbackup log folder : " + info.getBa= ckupLogDir() + "\n" - + "\tdefault incremental job period : " + info.getDe= faultIncrementalJobPeriod() + "\n\n"; - = - return result; - } else { - return failureProcessing(response); - } = - } = - /** - * {@inheritDoc} - */ - public String list() throws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackup= Agent.Constants.OperationType.CURRENT_BACKUPS_INFO; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - ShortInfoList infoList; - try { - infoList =3D (ShortInfoList) getObject(ShortInfoList.class, respon= se.getResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get ShortInfoList from respon= ce.", e); + } + + /** + * {@inheritDoc} + */ + public String status(String backupId) throws IOException, BackupExecute= Exception + { + + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRENT_= OR_COMPLETED_BACKUP_REPOSITORY_INFO + "/" + + backupId; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() !=3D Response.Status.OK.getStatusCode()) + { + + sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRE= NT_OR_COMPLETED_BACKUP_INFO + "/" + backupId; + + response =3D transport.executeGET(sURL); } - = - String result =3D "\nThe current backups information : \n"; - = - if (infoList.getBackups().size() =3D=3D 0) - result +=3D "\tNo active backups.\n\n"; - = - int count =3D 1; - for (ShortInfo shortInfo : infoList.getBackups()) { - result +=3D "\t" + count + ") Backup with id " + shortInfo.getBack= upId() + " :\n"; - = - result +=3D ("\t\trepository name : " + shortInfo.getRe= positoryName() + "\n" - + "\t\tworkspace name : " + shortInfo.getWork= spaceName() + "\n" - + "\t\tbackup type : " + (shortInfo.getBac= kupType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" := "full only") + "\n" = - + "\t\tfull backup state : " + getState(shortInf= o.getState())) + "\n" - + (shortInfo.getBackupType() =3D=3D BackupManager.FULL_B= ACKUP_ONLY ? "" : = - "\t\tincremental backup state : " + "working" + "\n") - + "\t\tstarted time : " + shortInfo.getStar= tedTime() + "\n" - + (shortInfo.getFinishedTime().equals("") ? "" : = - "\t\tfinished time : " + shortInfo.getFini= shedTime() + "\n"); - count++; - } = - = - return result; - } else { - return failureProcessing(response); - } - } = - /** - * {@inheritDoc} - */ - public String listCompleted() throws IOException, BackupExecuteException= { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackup= Agent.Constants.OperationType.COMPLETED_BACKUPS_INFO; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - ShortInfoList infoList; - try { - infoList =3D (ShortInfoList) getObject(ShortInfoList.class, respon= se.getResponseData()); - new String(response.getResponseData()); - } catch (Exception e) {e.printStackTrace(); - throw new RuntimeException("Can not get ShortInfoList from respon= ce.", e); + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) + { + DetailedInfo info; + try + { + info =3D (DetailedInfo) getObject(DetailedInfo.class, response= .getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get DetailedInfo from resp= once.", e); + } + + if (info.getType() =3D=3D DetailedInfo.COMPLETED) + { + String result =3D "\nThe completed (ready to restore) backup i= nformation : \n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup id : " + + info.getBackupId() + + "\n" + + "\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + (info.getWorkspaceName().equals("") ? "" := "\t\tworkspace name : " + + info.getWorkspaceName() + "\n") + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tstarte= d time : " + info.getStartedTime() + + "\n" + (info.getFinishedTime().equals("") = ? "\n" : "\t\tfinished time : " + + info.getFinishedTime() + "\n\n")); + + return result; + } + else + { + String result =3D "\nThe current backup information : \n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup id : " + + info.getBackupId() + + "\n" + + "\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + (info.getWorkspaceName().equals("") ? "" := "\t\tworkspace name : " + + info.getWorkspaceName() + "\n") + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tfull b= ackup state : " + getState(info + .getState())) + + "\n" + + (info.getBackupType() =3D=3D BackupManager= .FULL_BACKUP_ONLY ? "" + : "\t\tincremental backup state : "= + "working" + "\n") + + "\t\tstarted time : " + + info.getStartedTime() + + "\n" + + (info.getFinishedTime().equals("") ? "\n" = : "\t\tfinished time : " + + info.getFinishedTime() + "\n\n"); + + return result; + } } - = - String result =3D "\nThe completed (ready to restore) backups inform= ation : \n"; - = - if (infoList.getBackups().size() =3D=3D 0) - result +=3D "\tNo completed backups.\n\n"; - = - int count =3D 1; - for (ShortInfo shortInfo : infoList.getBackups()) { - result +=3D "\t" + count + ") Backup with id " + shortInfo.getBack= upId() + " :\n"; - = - result +=3D ("\t\trepository name : " + shortInfo.getRe= positoryName() + "\n" - + "\t\tworkspace name : " + shortInfo.getWork= spaceName() + "\n" - + "\t\tbackup type : " + (shortInfo.getBac= kupType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" := "full only") + "\n" = - + "\t\tstarted time : " + shortInfo.getStar= tedTime() + "\n" - + (shortInfo.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + shortInfo.getFini= shedTime() + "\n")); - count++; - } = - = - return result; - } else { - return failureProcessing(response); - } - } + else + { + return failureProcessing(response); + } + } = - /** - * {@inheritDoc} - */ - public String restores(String repositoryName, String workspaceName) thro= ws IOException, BackupExecuteException { - String sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + = - HTTPBackupAgent.Constants.OperationType.CURRENT_RESTORE_= INFO_ON_WS + - "/" + repositoryName + - "/" + workspaceName; - BackupAgentResponse response =3D transport.executeGET(sURL); - = - if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) { - DetailedInfo info; - try { - info =3D (DetailedInfo) getObject(DetailedInfo.class, response.get= ResponseData()); - } catch (Exception e) { - throw new RuntimeException("Can not get DetailedInfo from responc= e.", e); + /** + * {@inheritDoc} + */ + public String stop(String backupId) throws IOException, BackupExecuteEx= ception + { + // first try to find current repository backup + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRENT_= BACKUPS_REPOSITORY_INFO; + + BackupAgentResponse repositoryResponse =3D transport.executeGET(sURL= ); + + if (repositoryResponse.getStatus() =3D=3D Response.Status.OK.getStat= usCode()) + { + ShortInfoList repositoryInfoList; + try + { + repositoryInfoList =3D (ShortInfoList) getObject(ShortInfoList= .class, repositoryResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + for (ShortInfo info : repositoryInfoList.getBackups()) + { + if (info.getBackupId().equals(backupId)) + { + // repository backup + sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType= .STOP_BACKUP_REPOSITORY + "/" + backupId; + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatu= sCode()) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + resp= onse.getStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } } - = - = - String result =3D "\nThe current restores information : \n"; - = - result +=3D "\tRestore with id " + info.getBackupId() + ":\n"; - = - BackupConfigBean configBean =3D info.getBackupConfig(); - = - result +=3D ("\t\tbackup folder : " + configBean.getBac= kupDir() + "\n" = - + "\t\trepository name : " + info.getRepositoryN= ame() + "\n" - + "\t\tworkspace name : " + info.getWorkspaceNa= me() + "\n" - + "\t\tbackup type : " + (configBean.getBack= upType() =3D=3D BackupManager.FULL_AND_INCREMENTAL ? "full + incremetal" : = "full only") + "\n" - + "\t\trestore state : " + getRestoreState(in= fo.getState()) + "\n" - + "\t\tstarted time : " + info.getStartedTime= () + "\n" - + (info.getFinishedTime().equals("") ? "\n" : = - "\t\tfinished time : " + info.getFinishedTim= e() + "\n\n")); - = - return result; - } else { - return failureProcessing(response); - } - } - = - = - /** - * Will be created the Object from JSON binary data. - * - * @param cl = - * Class - * @param data - * binary data (JSON) - * @return Object - * @throws Exception - * will be generated Exception - */ - private Object getObject(Class cl, byte[] data) throws Exception { = - JsonHandler jsonHandler =3D new JsonDefaultHandler(); - JsonParser jsonParser =3D new JsonParserImpl(); - InputStream inputStream =3D new ByteArrayInputStream(data); - jsonParser.parse(inputStream, jsonHandler); - JsonValue jsonValue =3D jsonHandler.getJsonObject(); = - return new BeanBuilder().createObject(cl, jsonValue); - } - = - = - private String getRestoreState(int restoreState) { - String state =3D "unknown sate of restore"; - = - switch (restoreState) { - case JobWorkspaceRestore.RESTORE_INITIALIZED: - state =3D "initialized"; - break; - = - case JobWorkspaceRestore.RESTORE_STARTED: - state =3D "started"; - break; - = - case JobWorkspaceRestore.RESTORE_SUCCESSFUL: - state =3D "successful"; - break; - = - case JobWorkspaceRestore.RESTORE_FAIL: - state =3D "fail"; - break; + // then try to find current workspace backup + sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.CURRENT_BACKUPS_INFO; = - default: - break; - } - = - return state; - } - = - /** - * getState. - * = - * @param state - * value of state - * @return String sate - */ - private String getState(int state) { - String st =3D ""; - switch (state) { + BackupAgentResponse workspaceResponse =3D transport.executeGET(sURL); + if (workspaceResponse.getStatus() =3D=3D Response.Status.OK.getStatu= sCode()) + { + ShortInfoList workspaceInfoList; + try + { + workspaceInfoList =3D (ShortInfoList) getObject(ShortInfoList.= class, workspaceResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } = - case BackupJob.FINISHED: - st =3D "finished"; - break; + for (ShortInfo info : workspaceInfoList.getBackups()) + { + if (info.getBackupId().equals(backupId)) + { + // workspace backup + sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBa= ckupAgent.Constants.OperationType.STOP_BACKUP + + "/" + backupId; = - case BackupJob.WORKING: - st =3D "working"; - break; + BackupAgentResponse response =3D transport.executeGET(sURL); = - case BackupJob.WAITING: - st =3D "waiting"; - break; + if (response.getStatus() =3D=3D Response.Status.OK.getStatu= sCode()) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + resp= onse.getStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } + } = - case BackupJob.STARTING: - st =3D "starting"; - break; - default: - break; - } + return "\nFailure :\n" + "\tmessage : There are no active backu= p with id " + backupId; + } = - return st; - } - = - /** - * failureProcessing. - * - * @param data - * response data - * @return String - * result - * @throws BackupExecuteException - * will be generated BackupExecuteException = - */ - private String failureProcessing(BackupAgentResponse response) throws Ba= ckupExecuteException { - try { - String result =3D "\nFailure :\n" - + "\tsatatus code : " + response.getStatus() + "\n" - + "\tmessage : " + new String(response.getRespo= nseData(), "UTF-8") + "\n\n"; - = - return result; - } catch (UnsupportedEncodingException e) { - throw new BackupExecuteException("Can not encoded the responce : " += e.getMessage(), e); - } - } - = - /** - * getWorkspaceEntry. - * - * @param wEntryStream - * InputStream, the workspace configuration - * @param workspaceName - * String, the workspace name = - * @return WorkspaceEntry - * return the workspace entry - * @throws FileNotFoundException - * will be generated the FileNotFoundException = - * @throws JiBXException - * will be generated the JiBXException = - * @throws RepositoryConfigurationException - * will be generated the RepositoryConfigurationException = - */ - private WorkspaceEntry getWorkspaceEntry(InputStream wEntryStream, Strin= g repositoryName, String workspaceName) throws FileNotFoundException, - = JiBXException, - = RepositoryConfigurationException { - WorkspaceEntry wsEntry =3D null; + /** + * {@inheritDoc} + */ + public String restore(String repositoryName, String workspaceName, Stri= ng backupId, InputStream config) + throws IOException, BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.RESTORE + "/" + + repositoryName + "/" + backupId; = - IBindingFactory factory =3D BindingDirectory.getFactory(RepositoryServ= iceConfiguration.class); - IUnmarshallingContext uctx =3D factory.createUnmarshallingContext(); - RepositoryServiceConfiguration conf =3D (RepositoryServiceConfiguratio= n) uctx.unmarshalDocument(wEntryStream, - = null); - RepositoryEntry rEntry =3D conf.getRepositoryConfiguration(repositoryN= ame); - = - for (WorkspaceEntry wEntry : rEntry.getWorkspaceEntries()) - if (wEntry.getName().equals(workspaceName)) - wsEntry =3D wEntry; - = + WorkspaceEntry wEntry =3D null; + try + { + wEntry =3D getWorkspaceEntry(config, repositoryName, workspace= Name); + } + catch (Throwable e) + { + throw new BackupExecuteException("Can not get WorkspaceEntry f= or workspace '" + workspaceName + + "' from config.", e); + } = - if (wsEntry =3D=3D null) - throw new RuntimeException("Can not find the workspace '" + workspac= eName - + "' in configuration."); + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; = - return wsEntry; - } + try + { + json =3D generatorImpl.createJsonObject(wEntry); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += wEntry.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.RESTO= RE_REPOSITORY + "/" + backupId; + + RepositoryEntry wEntry =3D null; + try + { + wEntry =3D getRepositoryEntry(config, repositoryName); + } + catch (Throwable e) + { + throw new BackupExecuteException("Can not get RepositoryEntry = for repository '" + repositoryName + + "' from config.", e); + } + + JsonGeneratorImpl generatorImpl =3D new JsonGeneratorImpl(); + JsonValue json; + + try + { + json =3D generatorImpl.createJsonObject(wEntry); + } + catch (JsonException e) + { + throw new BackupExecuteException("Can not get json from : " += wEntry.getClass().toString(), e); + } + + BackupAgentResponse response =3D transport.executePOST(sURL, json= .toString()); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } + + /** + * {@inheritDoc} + */ + public String drop(boolean forceClose, String repositoryName, String wo= rkspaceName) throws IOException, + BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAg= ent.Constants.OperationType.DROP_WORKSPACE + + "/" + repositoryName + "/" + workspaceName + = "/" + forceClose; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + RestRepositoryService.Constants.BASE_URL + + RestRepositoryService.Constants.OperationType= .REMOVE_REPOSITORY + "/" + repositoryName + + "/" + forceClose; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + return "\nSuccessful : \n" + "\tstatus code =3D " + response.g= etStatus() + "\n"; + } + else + { + return failureProcessing(response); + } + } + } + + /** + * {@inheritDoc} + */ + public String info() throws IOException, BackupExecuteException + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.BACKUP_SERVICE_INFO; + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode()) + { + BackupServiceInfoBean info; + try + { + info =3D (BackupServiceInfoBean) getObject(BackupServiceInfoBe= an.class, response.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get BackupServiceInfoBean = from responce.", e); + } + + String result =3D + "\nThe backup service information : \n" + "\tfull backup= type : " + + info.getFullBackupType() + "\n" + "\tincremet= al backup type : " + + info.getIncrementalBackupType() + "\n" + "\tb= ackup log folder : " + + info.getBackupLogDir() + "\n" + "\tdefault in= cremental job period : " + + info.getDefaultIncrementalJobPeriod() + "\n\n= "; + + return result; + } + else + { + return failureProcessing(response); + } + } + + /** + * {@inheritDoc} + */ + public String list() throws IOException, BackupExecuteException + { + + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRENT_= BACKUPS_REPOSITORY_INFO; + BackupAgentResponse repositoryResponse =3D transport.executeGET(sURL= ); + + sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.CURRENT_BACKUPS_INFO; + BackupAgentResponse workspaceResponse =3D transport.executeGET(sURL); + + if ((repositoryResponse.getStatus() =3D=3D Response.Status.OK.getSta= tusCode()) + && (workspaceResponse.getStatus() =3D=3D Response.Status.OK= .getStatusCode())) + { + ShortInfoList repositoryInfoList; + try + { + repositoryInfoList =3D (ShortInfoList) getObject(ShortInfoList= .class, repositoryResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + ShortInfoList workspaceInfoList; + try + { + workspaceInfoList =3D (ShortInfoList) getObject(ShortInfoList.= class, workspaceResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + String result =3D "\nThe current backups information : \n"; + + if ((repositoryInfoList.getBackups().size() =3D=3D 0) && (workspa= ceInfoList.getBackups().size() =3D=3D 0)) + { + result +=3D "\tNo active backups.\n\n"; + } + + int count =3D 1; + for (ShortInfo shortInfo : repositoryInfoList.getBackups()) + { + result +=3D "\t" + count + ") Repository backup with id " + sh= ortInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tfull b= ackups state : " + getRepositoryBackupToFullState(shortInfo + .getState())) + + "\n" + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_BACKUP_ONLY ? "" + : "\t\tincremental backups state := " + "working" + "\n") + + "\t\tstarted time : " + + shortInfo.getStartedTime() + + "\n" + + (shortInfo.getFinishedTime().equals("") ? = "" : "\t\tfinished time : " + + shortInfo.getFinishedTime() + "\n= "); + count++; + } + + for (ShortInfo shortInfo : workspaceInfoList.getBackups()) + { + result +=3D "\t" + count + ") Workspace backup with id " + sho= rtInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tworkspace name : " + + shortInfo.getWorkspaceName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tfull b= ackup state : " + getState(shortInfo + .getState())) + + "\n" + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_BACKUP_ONLY ? "" + : "\t\tincremental backup state := " + "working" + "\n") + + "\t\tstarted time : " + + shortInfo.getStartedTime() + + "\n" + + (shortInfo.getFinishedTime().equals("") ? = "" : "\t\tfinished time : " + + shortInfo.getFinishedTime() + "\n= "); + count++; + } + + return result; + } + else + { + return failureProcessing(workspaceResponse); + } + } + + /** + * {@inheritDoc} + */ + public String listCompleted() throws IOException, BackupExecuteException + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.COMPLETE= D_BACKUPS_REPOSITORY_INFO; + BackupAgentResponse repositoryResponse =3D transport.executeGET(sURL= ); + + sURL =3D path + HTTPBackupAgent.Constants.BASE_URL + HTTPBackupAgent= .Constants.OperationType.COMPLETED_BACKUPS_INFO; + BackupAgentResponse workspaceResponse =3D transport.executeGET(sURL); + + if ((workspaceResponse.getStatus() =3D=3D Response.Status.OK.getStat= usCode()) + && (repositoryResponse.getStatus() =3D=3D Response.Status.O= K.getStatusCode())) + { + + ShortInfoList repositoryInfoList; + try + { + repositoryInfoList =3D (ShortInfoList) getObject(ShortInfoList= .class, repositoryResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + ShortInfoList workspaceInfoList; + try + { + workspaceInfoList =3D (ShortInfoList) getObject(ShortInfoList.= class, workspaceResponse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get ShortInfoList from res= ponce.", e); + } + + String result =3D "\nThe completed (ready to restore) backups inf= ormation : \n"; + + if ((repositoryInfoList.getBackups().size() =3D=3D 0) && (workspa= ceInfoList.getBackups().size() =3D=3D 0)) + { + result +=3D "\tNo completed backups.\n\n"; + } + + int count =3D 1; + for (ShortInfo shortInfo : repositoryInfoList.getBackups()) + { + result +=3D "\t" + count + ") Repository backup with id " + sh= ortInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tstarte= d time : " + + shortInfo.getStartedTime() + "\n" + (short= Info.getFinishedTime().equals("") ? "\n" + : "\t\tfinished time : " + short= Info.getFinishedTime() + "\n")); + count++; + } + + for (ShortInfo shortInfo : workspaceInfoList.getBackups()) + { + result +=3D "\t" + count + ") Workspace backup with id " + sho= rtInfo.getBackupId() + " :\n"; + + result +=3D + ("\t\trepository name : " + + shortInfo.getRepositoryName() + + "\n" + + "\t\tworkspace name : " + + shortInfo.getWorkspaceName() + + "\n" + + "\t\tbackup type : " + + (shortInfo.getBackupType() =3D=3D BackupMa= nager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\tstarte= d time : " + + shortInfo.getStartedTime() + "\n" + (short= Info.getFinishedTime().equals("") ? "\n" + : "\t\tfinished time : " + short= Info.getFinishedTime() + "\n")); + count++; + } + + return result; + } + else + { + return failureProcessing(workspaceResponse); + } + } + + /** + * {@inheritDoc} + */ + public String restores(String repositoryName, String workspaceName) thr= ows IOException, BackupExecuteException + { + if (workspaceName !=3D null) + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRE= NT_RESTORE_INFO_ON_WS + "/" + repositoryName + + "/" + workspaceName; + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + DetailedInfo info; + try + { + info =3D (DetailedInfo) getObject(DetailedInfo.class, respo= nse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get DetailedInfo from r= esponce.", e); + } + + String result =3D "\nThe current restores information : \n"; + + result +=3D "\tWorkspace restore with id " + info.getBackupId(= ) + ":\n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + "\t\tworkspace name : " + + info.getWorkspaceName() + + "\n" + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\trestor= e state : " + + getRestoreState(info.getState()) + "\n" + = "\t\tstarted time : " + + info.getStartedTime() + "\n" + (info.getFi= nishedTime().equals("") ? "\n" + : "\t\tfinished time : " + info.ge= tFinishedTime() + "\n\n")); + + return result; + } + else + { + return failureProcessing(response); + } + } + else + { + String sURL =3D + path + HTTPBackupAgent.Constants.BASE_URL + + HTTPBackupAgent.Constants.OperationType.CURRE= NT_RESTORE_INFO_ON_REPOSITORY + "/" + + repositoryName; + + BackupAgentResponse response =3D transport.executeGET(sURL); + + if (response.getStatus() =3D=3D Response.Status.OK.getStatusCode(= )) + { + DetailedInfo info; + try + { + info =3D (DetailedInfo) getObject(DetailedInfo.class, respo= nse.getResponseData()); + } + catch (Exception e) + { + throw new RuntimeException("Can not get DetailedInfo from r= esponce.", e); + } + + String result =3D "\nThe current restores information : \n"; + + result +=3D "\tRepository restore with id " + info.getBackupId= () + ":\n"; + + BackupConfigBean configBean =3D info.getBackupConfig(); + + result +=3D + ("\t\tbackup folder : " + + configBean.getBackupDir() + + "\n" + + "\t\trepository name : " + + info.getRepositoryName() + + "\n" + + "\t\tbackup type : " + + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" + : "full only") + "\n" + "\t\trestor= e state : " + + getRepositoryRestoreState(info.getState())= + "\n" + "\t\tstarted time : " + + info.getStartedTime() + "\n" + (info.getFi= nishedTime().equals("") ? "\n" + : "\t\tfinished time : " + info.ge= tFinishedTime() + "\n\n")); + + return result; + } + else + { + return failureProcessing(response); + } + } + } + + /** + * Will be created the Object from JSON binary data. + * + * @param cl = + * Class + * @param data + * binary data (JSON) + * @return Object + * @throws Exception + * will be generated Exception + */ + private Object getObject(Class cl, byte[] data) throws Exception + { + JsonHandler jsonHandler =3D new JsonDefaultHandler(); + JsonParser jsonParser =3D new JsonParserImpl(); + InputStream inputStream =3D new ByteArrayInputStream(data); + jsonParser.parse(inputStream, jsonHandler); + JsonValue jsonValue =3D jsonHandler.getJsonObject(); + + return new BeanBuilder().createObject(cl, jsonValue); + } + + private String getRestoreState(int restoreState) + { + String state =3D "unknown sate of restore"; + + switch (restoreState) + { + case JobWorkspaceRestore.RESTORE_INITIALIZED : + state =3D "initialized"; + break; + + case JobWorkspaceRestore.RESTORE_STARTED : + state =3D "started"; + break; + + case JobWorkspaceRestore.RESTORE_SUCCESSFUL : + state =3D "successful"; + break; + + case JobWorkspaceRestore.RESTORE_FAIL : + state =3D "fail"; + break; + + default : + break; + } + + return state; + } + + private String getRepositoryRestoreState(int restoreState) + { + String state =3D "unknown sate of restore"; + + switch (restoreState) + { + case JobRepositoryRestore.REPOSITORY_RESTORE_INITIALIZED : + state =3D "initialized"; + break; + + case JobRepositoryRestore.REPOSITORY_RESTORE_STARTED : + state =3D "started"; + break; + + case JobRepositoryRestore.REPOSITORY_RESTORE_SUCCESSFUL : + state =3D "successful"; + break; + + case JobRepositoryRestore.REPOSITORY_RESTORE_FAIL : + state =3D "fail"; + break; + + default : + break; + } + + return state; + } + + /** + * getState. + * = + * @param state + * value of state + * @return String sate + */ + private String getState(int state) + { + String st =3D ""; + switch (state) + { + + case BackupJob.FINISHED : + st =3D "finished"; + break; + + case BackupJob.WORKING : + st =3D "working"; + break; + + case BackupJob.WAITING : + st =3D "waiting"; + break; + + case BackupJob.STARTING : + st =3D "starting"; + break; + default : + break; + } + + return st; + } + + /** + * getState. + * = + * @param state + * value of state + * @return String sate + */ + private String getRepositoryBackupToFullState(int state) + { + String st =3D ""; + switch (state) + { + + case RepositoryBackupChain.FINISHED : + st =3D "finished"; + break; + + case RepositoryBackupChain.WORKING : + st =3D "working"; + break; + + case RepositoryBackupChain.INITIALIZED : + st =3D "initialized"; + break; + + case RepositoryBackupChain.FULL_BACKUP_FINISHED_INCREMENTAL_BACKU= P_WORKING : + st =3D "finished"; + break; + default : + break; + } + + return st; + } + + /** + * failureProcessing. + * + * @param data + * response data + * @return String + * result + * @throws BackupExecuteException + * will be generated BackupExecuteException = + */ + private String failureProcessing(BackupAgentResponse response) throws B= ackupExecuteException + { + try + { + String result =3D + "\nFailure :\n" + "\tstatus code : " + response.getStatu= s() + "\n" + "\tmessage : " + + new String(response.getResponseData(), "UTF-8= ") + "\n\n"; + + return result; + } + catch (UnsupportedEncodingException e) + { + throw new BackupExecuteException("Can not encoded the responce : = " + e.getMessage(), e); + } + } + + /** + * getRepositoryEntry. + * + * @param wEntryStream + * InputStream, the workspace configuration + * @return RepositoryEntry + * return the workspace entry + * @throws FileNotFoundException + * will be generated the FileNotFoundException = + * @throws JiBXException + * will be generated the JiBXException = + * @throws RepositoryConfigurationException + * will be generated the RepositoryConfigurationException = + */ + private RepositoryEntry getRepositoryEntry(InputStream wEntryStream, St= ring repositoryName) + throws FileNotFoundException, JiBXException, RepositoryConfigu= rationException + { + IBindingFactory factory =3D BindingDirectory.getFactory(RepositorySe= rviceConfiguration.class); + IUnmarshallingContext uctx =3D factory.createUnmarshallingContext(); + RepositoryServiceConfiguration conf =3D (RepositoryServiceConfigurat= ion) uctx.unmarshalDocument(wEntryStream, null); + RepositoryEntry rEntry =3D conf.getRepositoryConfiguration(repositor= yName); + + return rEntry; + } + + /** + * getWorkspaceEntry. + * + * @param wEntryStream + * InputStream, the workspace configuration + * @param workspaceName + * String, the workspace name = + * @return WorkspaceEntry + * return the workspace entry + * @throws FileNotFoundException + * will be generated the FileNotFoundException = + * @throws JiBXException + * will be generated the JiBXException = + * @throws RepositoryConfigurationException + * will be generated the RepositoryConfigurationException = + */ + private WorkspaceEntry getWorkspaceEntry(InputStream wEntryStream, Stri= ng repositoryName, String workspaceName) + throws FileNotFoundException, JiBXException, RepositoryConfigu= rationException + { + RepositoryEntry rEntry =3D getRepositoryEntry(wEntryStream, reposito= ryName); + + WorkspaceEntry wsEntry =3D null; + + for (WorkspaceEntry wEntry : rEntry.getWorkspaceEntries()) + if (wEntry.getName().equals(workspaceName)) + wsEntry =3D wEntry; + + if (wsEntry =3D=3D null) + throw new RuntimeException("Can not find the workspace '" + works= paceName + "' in configuration."); + + return wsEntry; + } + } Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-20 = 08:10:23 UTC (rev 3304) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-20 = 13:24:47 UTC (rev 3305) @@ -58,25 +58,33 @@ */ private static final String HELP_INFO =3D "Help info:\n" + " \n" + " : http(s)//login:pas= sword(a)host:port/ \n" - + " : start [] \n" + " = stop \n" - + " status \n" + " restores \n" - + " restore \= n" + " list [completed] \n" - + " info \n" + " drop [force-close-session]= \n" + " help \n\n" + + " : start [] \n" = + + " stop \n" + + " status \n" = + + " restores \n" + + " restore = \n" = + + " list [completed] \n" + + " info \n" = + + " drop [force-close-session] \n" = + + " help \n\n" = - + " start - start backup \n" + " stop - stop b= ackup \n" + + " start - start backup of repositpry or workspace \n" = + + " stop - stop backup \n" + " status - information about the current or completed b= ackup by 'backup_id' \n" - + " restores - information about the last restore on specif= ic workspace \n" - + " restore - restore the workspace from specific backup \= n" + + " restores - information about the last restore on specif= ic repository or workspace \n" + + " restore - restore the repository or workspace from spe= cific backup \n" + " list - information about the current backups (in pr= ogress) \n" + " list completed - information about the completed (ready to re= store) backups \n" - + " info - information about the service backup \n" + "= drop - delete the workspace \n" + + " info - information about the service backup \n" = + + " drop - delete the repository or workspace \n" + " help - print help information about backup console = \n\n" = - + " - // t= he workspace \n" + + " - /[/= ] the repository or workspace \n" + " - path to folder for backup on remote ser= ver \n" - + " - the identifier for backup \n" + " - incemental job period \n" - + " - path (local) to workspace configuration= \n" - + " force-close-session - close opened sessions on workspace. \n\= n"; + + " - the identifier for backup \n" = + + " - incemental job period \n" + + " - path (local) to repository or workspac= e configuration \n" + + " force-close-session - close opened sessions on repositpry or = workspace. \n\n"; = /** * Main. @@ -157,7 +165,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null); = if (curArg =3D=3D args.length) { @@ -233,7 +241,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null); = if (curArg < args.length) { @@ -276,7 +284,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null);; = if (curArg < args.length) { @@ -321,7 +329,7 @@ return; = String repositoryName =3D getRepositoryName(pathToWS); - String workspaceName =3D getWorkspaceName(pathToWS); + String workspaceName =3D (pathToWS.split("/").length =3D=3D 3 = ? getWorkspaceName(pathToWS) : null); = // backup id if (curArg =3D=3D args.length) @@ -415,7 +423,7 @@ String repWS =3D args[curArg]; repWS =3D repWS.replaceAll("\\\\", "/"); = - if (!repWS.matches("[/][^/]+[/][^/]+")) + if ( !repWS.matches("[/][^/]+") && !repWS.matches("[/][^/]+[/][^/]+"= )) { System.out.println(INCORRECT_PARAM + "There is incorrect path to = workspace parameter: " + repWS); return null; Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-= 10-20 08:10:23 UTC (rev 3304) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-= 10-20 13:24:47 UTC (rev 3305) @@ -57,6 +57,16 @@ * Flag is SSL. */ private final String protocol; + = + /** + * Is realm get. + */ + private boolean isRealmGet =3D false; + = + /** + * Realm to connection + */ + private String realm; = /** * Constructor. @@ -124,7 +134,13 @@ HTTPConnection connection =3D new HTTPConnection(url); connection.removeModule(CookieModule.class); = - connection.addBasicAuthorization(getRealm(complURL), login, passw= ord); + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } + = + connection.addBasicAuthorization(realm, login, password); = HTTPResponse resp; if (postData =3D=3D null) @@ -164,7 +180,13 @@ HTTPConnection connection =3D new HTTPConnection(url); connection.removeModule(CookieModule.class); = - connection.addBasicAuthorization(getRealm(complURL), login, passw= ord); + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } + = + connection.addBasicAuthorization(realm, login, password); = HTTPResponse resp =3D connection.Get(url.getFile()); = Modified: jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exopl= atform/services/jcr/ext/repository/RestRepositoryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform= /services/jcr/ext/repository/RestRepositoryService.java 2010-10-20 08:10:23= UTC (rev 3304) +++ jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform= /services/jcr/ext/repository/RestRepositoryService.java 2010-10-20 13:24:47= UTC (rev 3305) @@ -18,20 +18,6 @@ */ package org.exoplatform.services.jcr.ext.repository; = -import org.exoplatform.common.http.HTTPStatus; -import org.exoplatform.services.jcr.RepositoryService; -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.config.RepositoryEntry; -import org.exoplatform.services.jcr.config.RepositoryServiceConfiguration; -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.core.ManageableRepository; -import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; -import org.exoplatform.services.jcr.impl.core.RepositoryImpl; -import org.exoplatform.services.jcr.impl.core.SessionRegistry; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; -import org.exoplatform.services.rest.resource.ResourceContainer; - import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; @@ -51,6 +37,20 @@ import javax.ws.rs.core.UriInfo; import javax.ws.rs.core.Response.Status; = +import org.exoplatform.services.jcr.RepositoryService; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.RepositoryServiceConfiguration; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.core.ManageableRepository; +import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; +import org.exoplatform.services.jcr.impl.RepositoryServiceImpl; +import org.exoplatform.services.jcr.impl.core.RepositoryImpl; +import org.exoplatform.services.jcr.impl.core.SessionRegistry; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; +import org.exoplatform.services.rest.resource.ResourceContainer; + /** * Created by The eXo Platform SAS. * = @@ -370,7 +370,7 @@ * @return Response * return the Response */ - @POST + @GET @RolesAllowed("administrators") @Path("/remove-repository/{repositoryName}/{forseSessionClose}") public Response removeRepository(@Context UriInfo uriInfo, @PathParam("= repositoryName") String repositoryName, @@ -390,14 +390,16 @@ } } = - if (repositoryService.canRemoveRepository(repositoryName)) + if (repositoryService.getDefaultRepository().getConfiguration().g= etName().equals(repositoryName)) { + ((RepositoryServiceImpl) repositoryService).removeDefaultRepos= itory(); + } + else + { repositoryService.removeRepository(repositoryName); - repositoryService.getConfig().retain(); // save configuration = to persistence (file or persister) - return Response.noContent().build(); } - return Response.status(HTTPStatus.CONFLICT).entity("Can't remove = repository " + repositoryName).cacheControl( - NO_CACHE).build(); + repositoryService.getConfig().retain(); // save configuration to = persistence (file or persister) = + return Response.ok().build(); } catch (RepositoryException e) { Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/ma= in/docbook/en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-20 08:10:23 UTC (re= v 3304) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-20 13:24:47 UTC (re= v 3305) @@ -938,33 +938,33 @@ Help info: <url> <cmd> = <url> : http(s)//login:password(a)host:port/<context> = - <cmd> : start <repo/ws> <backup_dir> [<incr>] = + <cmd> : start <repo[/ws]> <backup_dir> [<incr>= ] = stop <backup_id> = status <backup_id> = - restores <repo/ws> = - restore <repo/ws> <backup_id> <pathToConfigFile= > = + restores <repo[/ws]> = + restore <repo[/ws]> <backup_id> <pathToConfigFi= le> list [completed] = info = - drop [force-close-session] <repo/ws> = + drop [force-close-session] <repo[/ws]> = help = = - start - start backup = + start - start backup of repository or workspace stop - stop backup = status - information about the current or completed backup by 'ba= ckup_id' = - restores - information about the last restore on specific workspace = - restore - restore the workspace from specific backup = + restores - information about the last restore on specific repositor= y or workspace = + restore - restore the repository or workspace from specific backup = list - information about the current backups (in progress) = list completed - information about the completed (ready to restore) backu= ps = info - information about the service backup = - drop - delete the workspace = + drop - delete the repository or workspace = help - print help information about backup console = = - <repo/ws> - /<reponsitory-name>/<workspace-name&= gt; the workspace = + <repo[/ws]> - /<reponsitory-name>[/<workspace-name= >] the repository or workspace <backup_dir> - path to folder for backup on remote server = <backup_id> - the identifier for backup = <incr> - incemental job period = - <pathToConfigFile> - path (local) to workspace configuration = - force-close-session - close opened sessions on workspace. + <pathToConfigFile> - path (local) to repository or workspace conf= iguration = + force-close-session - close opened sessions on repositpry or workspace =

    @@ -991,7 +991,8 @@ = - ${JCR-SRC-HOME} the path = where eXo JCR sources located + ${JCR-SRC-HOME} the path = where + eXo JCR sources located
    = @@ -1323,4 +1324,244 @@ finished time : Fri, 17 Apr 2009 16:38:00 EEST + +
    + Full example about creating backup and restoring it for reposit= ory + 'repository' + +
    + Creating backup + + jcrbackup http://root:exo(a)127.0.0.1:8080 start /re= pository ../temp/backup 10000 + + Return : + + Successful : = + status code =3D 200 +
    + +
    + Getting information about current backups + + jcrbackup http://root:exo(a)127.0.0.1:8080 list + + Return : + + The current backups information : = + 1) Repository backup with id 9a4d40fb7f0000012ec8f0a4ec70b3da : + repository name : repository + backup type : full + incremetal + full backups state : finished + incremental backups state : working + started time : Mon, 11 Oct 2010 10:59:35 EEST +
    + +
    + Stopping backup by id + + Stop backup with id 9a4d40fb7f0000012ec8f0a4ec70b3da : + + jcrbackup http://root:exo(a)127.0.0.1:8080 stop 9a4d= 40fb7f0000012ec8f0a4ec70b3da + + Return : + + Successful : = + status code =3D 200 +
    + +
    + Deleting the repository "repository" and close all opened + sessions + + jcrbackup http://root:exo(a)127.0.0.1:8080 drop forc= e-close-session /repository + + Return : + + Successful : = + status code =3D 200 +
    + +
    + Restoring the workspace "backup" + + + + Delete/clean the database for workspace "repository" : When we use "single-db",= then + we will run the SQL queries for clean database := drop table JCR_SREF; + drop table JCR_SVALUE; + drop table JCR_SITEM; + + + + Delete the value storage for repository "repository"; + + + + Delete the index data for repository "repository"; + + + + Restore:jcrbackup http://root:exo(a)127.0.= 0.1:8080 restore /repository/backup 9a6dba327f000001325dfb228a181b07 /home/= rainf0x/exo-jcr-config_backup.xmlReturn + :Successful : = + status code =3D 200The + /home/rainf0x/exo-jcr-config_backup.xml content the configuration + for restored repository "repository" :<repos= itory-service default-repository=3D"repository"> + <repositories> + <repository name=3D"repository" system-workspace=3D"production" d= efault-workspace=3D"production"> + <security-domain>exo-domain</security-domain> + <access-control>optional</access-control> + <authentication-policy>org.exoplatform.services.jcr.impl.co= re.access.JAASAuthenticator</authentication-policy> + <workspaces> + <workspace name=3D"production"> + <!-- for system storage --> + <container class=3D"org.exoplatform.services.jcr.impl.st= orage.jdbc.optimisation.CQJDBCWorkspaceDataContainer"> + <properties> + <property name=3D"source-name" value=3D"jdbcjcr" /= > + <property name=3D"multi-db" value=3D"false" /> + <property name=3D"update-storage" value=3D"false" = /> + <property name=3D"max-buffer-size" value=3D"200k" = /> + <property name=3D"swap-directory" value=3D"../temp= /swap/production" /> + </properties> + <value-storages> + <value-storage id=3D"system" class=3D"org.exoplatf= orm.services.jcr.impl.storage.value.fs.TreeFileValueStorage"> + <properties> + <property name=3D"path" value=3D"../temp/val= ues/production" /> + </properties> + <filters> + <filter property-type=3D"Binary" /> + </filters> + </value-storage> + </value-storages> + </container> + <initializer class=3D"org.exoplatform.services.jcr.impl.= core.ScratchWorkspaceInitializer"> + <properties> + <property name=3D"root-nodetype" value=3D"nt:unstr= uctured" /> + </properties> + </initializer> + <cache enabled=3D"true" class=3D"org.exoplatform.service= s.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl"> + <properties> + <property name=3D"max-size" value=3D"10k" /> + <property name=3D"live-time" value=3D"1h" /> + </properties> + </cache> + <query-handler class=3D"org.exoplatform.services.jcr.imp= l.core.query.lucene.SearchIndex"> + <properties> + <property name=3D"index-dir" value=3D"../temp/jcrl= ucenedb/production" /> + </properties> + </query-handler> + <lock-manager> + <time-out>15m</time-out> + <persister class=3D"org.exoplatform.services.jcr.impl= .core.lock.FileSystemLockPersister"> + <properties> + <property name=3D"path" value=3D"../temp/lock/s= ystem" /> + </properties> + </persister> + </lock-manager> + </workspace> + + <workspace name=3D"backup"> + <container class=3D"org.exoplatform.services.jcr.impl.st= orage.jdbc.optimisation.CQJDBCWorkspaceDataContainer"> + <properties> + <property name=3D"source-name" value=3D"jdbcjcr" /= > + <property name=3D"multi-db" value=3D"false" /> + <property name=3D"update-storage" value=3D"false" = /> + <property name=3D"max-buffer-size" value=3D"200k" = /> + <property name=3D"swap-directory" value=3D"../temp= /swap/backup" /> + </properties> + <value-storages> + <value-storage id=3D"draft" class=3D"org.exoplatfo= rm.services.jcr.impl.storage.value.fs.TreeFileValueStorage"> + <properties> + <property name=3D"path" value=3D"../temp/val= ues/backup" /> + </properties> + <filters> + <filter property-type=3D"Binary" /> + </filters> + </value-storage> + </value-storages> + </container> + <initializer class=3D"org.exoplatform.services.jcr.impl.= core.ScratchWorkspaceInitializer"> + <properties> + <property name=3D"root-nodetype" value=3D"nt:unstr= uctured" /> + </properties> + </initializer> + <cache enabled=3D"true" class=3D"org.exoplatform.service= s.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl"> + <properties> + <property name=3D"max-size" value=3D"10k" /> + <property name=3D"live-time" value=3D"1h" /> + </properties> + </cache> + <query-handler class=3D"org.exoplatform.services.jcr.imp= l.core.query.lucene.SearchIndex"> + <properties> + <property name=3D"index-dir" value=3D"../temp/jcrl= ucenedb/backup" /> + </properties> + </query-handler> + </workspace> + + <workspace name=3D"digital-assets"> + <container class=3D"org.exoplatform.services.jcr.impl.st= orage.jdbc.optimisation.CQJDBCWorkspaceDataContainer"> + <properties> + <property name=3D"source-name" value=3D"jdbcjcr" /= > + <property name=3D"multi-db" value=3D"false" /> + <property name=3D"update-storage" value=3D"false" = /> + <property name=3D"max-buffer-size" value=3D"200k" = /> + <property name=3D"swap-directory" value=3D"../temp= /swap/digital-assets" /> + </properties> + <value-storages> + <value-storage id=3D"digital-assets" class=3D"org.= exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage"> + <properties> + <property name=3D"path" value=3D"../temp/val= ues/digital-assets" /> + </properties> + <filters> + <filter property-type=3D"Binary" /> + </filters> + </value-storage> + </value-storages> + </container> + <initializer class=3D"org.exoplatform.services.jcr.impl.= core.ScratchWorkspaceInitializer"> + <properties> + <property name=3D"root-nodetype" value=3D"nt:folde= r" /> + </properties> + </initializer> + <cache enabled=3D"true" class=3D"org.exoplatform.service= s.jcr.impl.dataflow.persistent.LinkedWorkspaceStorageCacheImpl"> + <properties> + <property name=3D"max-size" value=3D"5k" /> + <property name=3D"live-time" value=3D"15m" /> + </properties> + </cache> + <query-handler class=3D"org.exoplatform.services.jcr.imp= l.core.query.lucene.SearchIndex"> + <properties> + <property name=3D"index-dir" value=3D"../temp/jcrl= ucenedb/digital-assets" /> + </properties> + </query-handler> + </workspace> + </workspaces> + </repository> + </repositories> +</repository-service> + + + +
    + +
    + Getting information about restore for repository + 'repository' + + jcrbackup http://root:exo(a)127.0.0.1:8080 restores = /repository + + Return: + + Repository restore with id 9a6dba327f000001325dfb2= 28a181b07: + backup folder : /home/rainf0x/java/exo-working/JCR-1459/exo-= tomcat/bin/../temp/backup/repository_repository_backup_1286786103858 + repository name : repository + backup type : full + incremetal + restore state : successful + started time : Mon, 11 Oct 2010 11:51:15 EEST + finished time : Mon, 11 Oct 2010 11:51:17 EEST +
    +
    --===============8951124319683975858==-- From do-not-reply at jboss.org Thu Oct 21 03:09:29 2010 Content-Type: multipart/mixed; boundary="===============7641044789028445974==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3306 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/storage/value and 2 other directories. Date: Thu, 21 Oct 2010 03:09:28 -0400 Message-ID: <201010210709.o9L79SRC003930@svn01.web.mwc.hst.phx2.redhat.com> --===============7641044789028445974== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-21 03:09:28 -0400 (Thu, 21 Oct 2010) New Revision: 3306 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/RepositoryContainer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/StandaloneStoragePluginProvider.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/FileValueStorage.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/SimpleFileValueStorage.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/TreeFileValueStorage.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/storage/JDBCWDCTest.java Log: EXOJCR-999: Make FileValueStorage use common per-repository FileCleaner Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-20 13:24:47 UTC (rev 3305) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-21 07:09:28 UTC (rev 3306) @@ -513,7 +513,9 @@ { = registerComponentInstance(config); - + // WorkspaceFileCleanerHolder - is a common holder for all workspace= s. = + // It is used to initialize FileValueStorage + registerComponentImplementation(WorkspaceFileCleanerHolder.class); registerWorkspacesComponents(); registerRepositoryComponents(); } @@ -524,7 +526,6 @@ = registerComponentImplementation(RepositoryIndexSearcherHolder.class); = - registerComponentImplementation(WorkspaceFileCleanerHolder.class); registerComponentImplementation(LocationFactory.class); registerComponentImplementation(ValueFactoryImpl.class); = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/StandaloneStoragePluginProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/StandaloneStoragePluginProvider.java 2010-10-20 13:= 24:47 UTC (rev 3305) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2010-10-21 07:= 09:28 UTC (rev 3306) @@ -24,6 +24,8 @@ import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.PropertyData; +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueIOChannel; import org.exoplatform.services.jcr.storage.value.ValuePluginFilter; @@ -60,7 +62,8 @@ */ private final ValueDataResourceHolder resorcesHolder; = - public StandaloneStoragePluginProvider(WorkspaceEntry wsConfig) throws = RepositoryConfigurationException, IOException + public StandaloneStoragePluginProvider(WorkspaceEntry wsConfig, Workspa= ceFileCleanerHolder holder) + throws RepositoryConfigurationException, IOException { = this.resorcesHolder =3D new ValueDataResourceHolder(); @@ -82,7 +85,10 @@ Object o =3D null; try { - o =3D Class.forName(storageEntry.getType()).newInstance(); + o =3D + Class.forName(storageEntry.getType()).getConstructor(Fil= eCleaner.class).newInstance( + holder.getFileCleaner()); + } catch (Exception e) { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/CASableSimpleFileValueStorage.java 2010-10-20 13= :24:47 UTC (rev 3305) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/CASableSimpleFileValueStorage.java 2010-10-21 07= :09:28 UTC (rev 3306) @@ -21,6 +21,7 @@ import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAdd= ressStorage; +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.value.ValueIOChannel; = import java.io.IOException; @@ -40,6 +41,11 @@ = private String digestAlgo; = + public CASableSimpleFileValueStorage(FileCleaner cleaner) + { + super(cleaner); + } + @Override public void init(Properties props, ValueDataResourceHolder resources) t= hrows IOException, RepositoryConfigurationException Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/CASableTreeFileValueStorage.java 2010-10-20 13:2= 4:47 UTC (rev 3305) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/CASableTreeFileValueStorage.java 2010-10-21 07:0= 9:28 UTC (rev 3306) @@ -21,6 +21,7 @@ import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAdd= ressStorage; +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; = import java.io.IOException; import java.util.Properties; @@ -38,6 +39,11 @@ = private String digestAlgo; = + public CASableTreeFileValueStorage(FileCleaner cleaner) + { + super(cleaner); + } + /** * {@inheritDoc} */ Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/FileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/FileValueStorage.java 2010-10-20 13:24:47 UTC (r= ev 3305) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/FileValueStorage.java 2010-10-21 07:09:28 UTC (r= ev 3306) @@ -46,7 +46,7 @@ public final static String PATH =3D "path"; = /** - * Temporarory directopry name under stoprage root dir. + * Temporary directory name under storage root dir. */ public static final String TEMP_DIR_NAME =3D "temp"; = @@ -58,11 +58,10 @@ = /** * FileValueStorage constructor. - * = */ - public FileValueStorage() + public FileValueStorage(FileCleaner cleaner) { - this.cleaner =3D new FileCleaner(); // TODO use container cleaner + this.cleaner =3D cleaner; } = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/SimpleFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/SimpleFileValueStorage.java 2010-10-20 13:24:47 = UTC (rev 3305) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/SimpleFileValueStorage.java 2010-10-21 07:09:28 = UTC (rev 3306) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs; = +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.value.ValueIOChannel; = import java.io.IOException; @@ -32,6 +33,11 @@ public class SimpleFileValueStorage extends FileValueStorage { = + public SimpleFileValueStorage(FileCleaner cleaner) + { + super(cleaner); + } + /** * @see org.exoplatform.services.jcr.storage.value.ValueStoragePlugin#o= penIOChannel() */ Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/TreeFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/TreeFileValueStorage.java 2010-10-20 13:24:47 UT= C (rev 3305) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/TreeFileValueStorage.java 2010-10-21 07:09:28 UT= C (rev 3306) @@ -43,8 +43,9 @@ } } = - public TreeFileValueStorage() + public TreeFileValueStorage(FileCleaner cleaner) { + super(cleaner); this.cleaner =3D new TreeFileCleaner(); // TODO use container cleaner } = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWDCTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/JDBCWDCTest.java 2010-10-20 13:24:47 UTC (rev 3305) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/JDBCWDCTest.java 2010-10-21 07:09:28 UTC (rev 3306) @@ -18,6 +18,17 @@ */ package org.exoplatform.services.jcr.impl.storage; = +import java.sql.Connection; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import javax.jcr.PropertyType; +import javax.naming.InitialContext; +import javax.naming.Reference; +import javax.naming.StringRefAddr; +import javax.sql.DataSource; + import junit.framework.TestCase; = import org.exoplatform.services.jcr.access.AccessControlList; @@ -35,22 +46,12 @@ 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.impl.util.io.WorkspaceFileCleanerHolde= r; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.log.LogConfigurationInitializer; = -import java.sql.Connection; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import javax.jcr.PropertyType; -import javax.naming.InitialContext; -import javax.naming.Reference; -import javax.naming.StringRefAddr; -import javax.sql.DataSource; - /** * Created by The eXo Platform SAS. * = @@ -105,7 +106,7 @@ // SimpleJNDIContextInitializer.initialize(sourceName, ref); = container =3D - new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config)); + new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config, new WorkspaceFileCleanerHolder())); = Properties logProps =3D new Properties(); logProps.put("org.apache.commons.logging.simplelog.defaultlog", "deb= ug"); --===============7641044789028445974==-- From do-not-reply at jboss.org Thu Oct 21 03:37:14 2010 Content-Type: multipart/mixed; boundary="===============6404068534457678479==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3307 - jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository. Date: Thu, 21 Oct 2010 03:37:13 -0400 Message-ID: <201010210737.o9L7bDwu005142@svn01.web.mwc.hst.phx2.redhat.com> --===============6404068534457678479== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-21 03:37:13 -0400 (Thu, 21 Oct 2010) New Revision: 3307 Modified: jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform/= services/jcr/ext/repository/RestRepositoryService.java Log: JCR-1459 : Method RestRepositoryService.removeRepository was changed. Modified: jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exopl= atform/services/jcr/ext/repository/RestRepositoryService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform= /services/jcr/ext/repository/RestRepositoryService.java 2010-10-21 07:09:28= UTC (rev 3306) +++ jcr/branches/1.12.x/exo.jcr.component.ext/src/main/java/org/exoplatform= /services/jcr/ext/repository/RestRepositoryService.java 2010-10-21 07:37:13= UTC (rev 3307) @@ -390,14 +390,7 @@ } } = - if (repositoryService.getDefaultRepository().getConfiguration().g= etName().equals(repositoryName)) - { - ((RepositoryServiceImpl) repositoryService).removeDefaultRepos= itory(); - } - else - { - repositoryService.removeRepository(repositoryName); - } + repositoryService.removeRepository(repositoryName); repositoryService.getConfig().retain(); // save configuration to = persistence (file or persister) = return Response.ok().build(); } --===============6404068534457678479==-- From do-not-reply at jboss.org Thu Oct 21 05:33:24 2010 Content-Type: multipart/mixed; boundary="===============6086345528604917318==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3308 - kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform/container/definition and 2 other directories. Date: Thu, 21 Oct 2010 05:33:23 -0400 Message-ID: <201010210933.o9L9XNqp022140@svn01.web.mwc.hst.phx2.redhat.com> --===============6086345528604917318== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-21 05:33:22 -0400 (Thu, 21 Oct 2010) New Revision: 3308 Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docb= ook/en-US/modules/kernel/container-configuration.xml kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform= /container/definition/PortalContainerConfig.java kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform= /container/definition/PortalContainerDefinition.java kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform= /container/definition/PortalContainerDefinitionChangePlugin.java kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatform= /container/definition/PortalContainerDefinitionDisablePlugin.java kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatform= /container/definition/TestPortalContainerConfig.java kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopla= tform/container/definition/portal-container-config-with-default-values-and-= with-both-settings-with-default-portal-def.xml kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopla= tform/container/definition/portal-container-config-with-default-values-and-= with-default-portal-def.xml kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopla= tform/container/definition/portal-container-config-with-default-values-and-= with-empty-portal-def2.xml kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopla= tform/container/definition/portal-container-config-with-default-values-and-= with-portal-def-with-default-portal-def.xml kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopla= tform/container/definition/portal-container-config-with-default-values-and-= with-portal-def.xml kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopla= tform/container/definition/portal-container-config-with-no-default-values-b= ut-with-portal-defs.xml Log: KER-164: Now most of the parameters can be defined in the file loaded by th= e PropertyConfigurator which is configuration.properties in GateIn Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/ma= in/docbook/en-US/modules/kernel/container-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.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/kernel/container-configuration.xml 2010-10-21 07:37:13 U= TC (rev 3307) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/kernel/container-configuration.xml 2010-10-21 09:33:22 U= TC (rev 3308) @@ -454,28 +454,28 @@ - default.portal.container + default.portal.container (*) = The name of the default portal container. This fiel= d is optional. = - default.rest.context + default.rest.context (*) = The name of the default rest ServletContext. This field is optional. = - default.realm.name + default.realm.name (*) = The name of the default realm. This field is optional. = - ignore.unregistered.webapp + ignore.unregistered.webapp (*) = Indicates whether the unregistered webapps have to = be ignored. If a webapp has not been registered as a dependen= cy @@ -510,6 +510,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + A new PortalContainerDefinition can be define= d at the RootContainer level thanks to an external plugi= n, see an example below: <external-component-plug= ins> @@ -615,14 +624,14 @@ - name + name (*) = The name of the portal container. This field is mandatory . = - restContextName + restContextName (*) = The name of the context name of the rest web application. This field is optional. The default value wil= l be @@ -631,7 +640,7 @@ = - realmName + realmName (*) = The name of the realm. This field is optional. The default value will be defined at the @@ -757,7 +766,7 @@ - name + name (*) = The name of the portal container. This field is optional. The default portal name will be: @@ -783,7 +792,7 @@ = - restContextName + restContextName (*) = The name of the context name of the rest web application. This field is optional. The default value wil @@ -810,7 +819,7 @@ = - realmName + realmName (*) = The name of the realm. This field is optional. The default value wil be: @@ -891,6 +900,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + Internal and external settings are both optional, but if we = give a non empty value for both the application will merge the settings= . If the same setting name exists in both settings, we apply the follow= ing @@ -1102,7 +1120,7 @@ - apply.all + apply.all (*) = Indicates whether the changes have to be applied to= all the portal containers or not. The default value of this fi= eld @@ -1111,7 +1129,7 @@ = - apply.default + apply.default (*) = Indicates whether the changes have to be applied to= the default portal container or not. The default value of this @@ -1120,7 +1138,7 @@ = - apply.specific + apply.specific (*) = A set of specific portal container names to which we want to apply the changes. This field is a @@ -1143,6 +1161,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + To identify the portal containers to which the changes have = to be applied, we use the follwing algorithm: = @@ -1534,7 +1561,7 @@ - names + names (*) = The list of the name of the portal containers to disable. @@ -1543,6 +1570,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + To prevent any accesses to a web application corresponding to PortalContainer that has been disabled, you need to make sure that the following Http Filter (or a sub class of it) has Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exop= latform/container/definition/PortalContainerConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerConfig.java 2010-10-21 07:37:13 UTC (= rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerConfig.java 2010-10-21 09:33:22 UTC (= rev 3308) @@ -205,8 +205,10 @@ this.serverInfo =3D serverInfo; this.defaultDefinition =3D create(params); this.ignoreUnregisteredWebapp =3D - params !=3D null && params.getValueParam("ignore.unregistered.web= app") !=3D null - && Boolean.valueOf(params.getValueParam("ignore.unregistered.w= ebapp").getValue()); + params !=3D null + && params.getValueParam("ignore.unregistered.webapp") !=3D null + && Boolean.valueOf(Deserializer.resolveVariables(params.getVal= ueParam("ignore.unregistered.webapp") + .getValue())); } = /** @@ -266,7 +268,7 @@ if (vp !=3D null && vp.getValue().trim().length() > 0) { // A realm name has been defined in the value parameter, thus = we use it - def.setRealmName(vp.getValue().trim()); + def.setRealmName(Deserializer.resolveVariables(vp.getValue().t= rim())); } } else @@ -294,7 +296,7 @@ if (vp !=3D null && vp.getValue().trim().length() > 0) { // A rest context name has been defined in the value parameter= , thus we use it - def.setRestContextName(vp.getValue().trim()); + def.setRestContextName(Deserializer.resolveVariables(vp.getVal= ue().trim())); } } else @@ -322,7 +324,7 @@ if (vp !=3D null && vp.getValue().trim().length() > 0) { // A name has been defined in the value parameter, thus we use= it - def.setName(vp.getValue().trim()); + def.setName(Deserializer.resolveVariables(vp.getValue().trim()= )); } } else Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exop= latform/container/definition/PortalContainerDefinition.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerDefinition.java 2010-10-21 07:37:13 U= TC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerDefinition.java 2010-10-21 09:33:22 U= TC (rev 3308) @@ -19,9 +19,11 @@ package org.exoplatform.container.definition; = import org.exoplatform.container.PortalContainer; +import org.exoplatform.container.xml.Deserializer; = import java.util.List; import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; = import javax.servlet.ServletContext; = @@ -39,6 +41,11 @@ { = /** + * Indicates whether the current instance has been initialized + */ + private final AtomicBoolean initialized =3D new AtomicBoolean(); + = + /** * The name of the related {@link PortalContainer} */ private String name; @@ -72,6 +79,7 @@ = public String getName() { + init(); return name; } = @@ -92,6 +100,7 @@ = public String getRealmName() { + init(); return realmName; } = @@ -102,6 +111,7 @@ = public String getRestContextName() { + init(); return restContextName; } = @@ -129,4 +139,26 @@ { this.externalSettingsPath =3D externalSettingsPath; } + = + /** + * Ensure that all the parameter values have been resolved in order to = allow to + * use variables to define their values. It will be executed only if it= has the current + * instance has not been initialized + */ + private void init() + { + if (!initialized.get()) + { + synchronized (this) + { + if (!initialized.get()) + { + setName(Deserializer.resolveVariables(name)); + setRestContextName(Deserializer.resolveVariables(restContex= tName)); + setRealmName(Deserializer.resolveVariables(realmName)); + initialized.set(true); + } + } + } + } = } Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exop= latform/container/definition/PortalContainerDefinitionChangePlugin.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerDefinitionChangePlugin.java 2010-10-2= 1 07:37:13 UTC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerDefinitionChangePlugin.java 2010-10-2= 1 09:33:22 UTC (rev 3308) @@ -17,6 +17,7 @@ package org.exoplatform.container.definition; = import org.exoplatform.container.component.BaseComponentPlugin; +import org.exoplatform.container.xml.Deserializer; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.ValueParam; import org.exoplatform.container.xml.ValuesParam; @@ -62,17 +63,22 @@ ValueParam vp =3D params.getValueParam("apply.all"); if (vp !=3D null && vp.getValue().length() > 0) { - this.all =3D Boolean.valueOf(vp.getValue()); + this.all =3D Boolean.valueOf(Deserializer.resolveVariables(vp.get= Value())); } vp =3D params.getValueParam("apply.default"); if (vp !=3D null && vp.getValue().length() > 0) { - this.bDefault =3D Boolean.valueOf(vp.getValue()); + this.bDefault =3D Boolean.valueOf(Deserializer.resolveVariables(v= p.getValue())); } ValuesParam vsp =3D params.getValuesParam("apply.specific"); if (vsp !=3D null && !vsp.getValues().isEmpty()) { - this.names =3D new HashSet(vsp.getValues()); + this.names =3D new HashSet(vsp.getValues().size()); + List lnames =3D vsp.getValues(); + for (String name : lnames) + { + names.add(Deserializer.resolveVariables(name)); + } } this.changes =3D params.getObjectParamValues(PortalContainerDefiniti= onChange.class); } Modified: kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exop= latform/container/definition/PortalContainerDefinitionDisablePlugin.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerDefinitionDisablePlugin.java 2010-10-= 21 07:37:13 UTC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/main/java/org/exoplatfor= m/container/definition/PortalContainerDefinitionDisablePlugin.java 2010-10-= 21 09:33:22 UTC (rev 3308) @@ -17,10 +17,12 @@ package org.exoplatform.container.definition; = import org.exoplatform.container.component.BaseComponentPlugin; +import org.exoplatform.container.xml.Deserializer; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.ValuesParam; = import java.util.HashSet; +import java.util.List; import java.util.Set; = /** @@ -45,7 +47,12 @@ ValuesParam vsp =3D params.getValuesParam("names"); if (vsp !=3D null && !vsp.getValues().isEmpty()) { - this.names =3D new HashSet(vsp.getValues()); + this.names =3D new HashSet(vsp.getValues().size()); + List lnames =3D vsp.getValues(); + for (String name : lnames) + { + names.add(Deserializer.resolveVariables(name)); + } = } } = Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exop= latform/container/definition/TestPortalContainerConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/java/org/exoplatfor= m/container/definition/TestPortalContainerConfig.java 2010-10-21 07:37:13 U= TC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/java/org/exoplatfor= m/container/definition/TestPortalContainerConfig.java 2010-10-21 09:33:22 U= TC (rev 3308) @@ -16,6 +16,7 @@ */ package org.exoplatform.container.definition; = +import org.exoplatform.commons.utils.PropertyManager; import org.exoplatform.container.RootContainer; import org.exoplatform.container.jmx.AbstractTestContainer; import org.exoplatform.container.monitor.jvm.J2EEServerInfo; @@ -64,25 +65,49 @@ assertFalse(config.isPortalContainerName("myPortal-dpcdef")); assertFalse(config.hasDefinition()); = - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer()); - assertEquals("myRest-dpcdef", config.getDefaultRestContext()); - assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()); - assertFalse(config.isPortalContainerName("portal")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-dpcdef")); = - assertFalse(config.hasDefinition()); + assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer(= )); + assertEquals("myRest-dpcdef", config.getDefaultRestContext()); + assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()= ); + assertFalse(config.isPortalContainerName("portal")); + assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-dpcdef")); = + assertFalse(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + System.getProperties().remove("_rest.context"); + System.getProperties().remove("_realm.name"); + PropertyManager.refresh(); + } = - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("myPortal", config.getDefaultPortalContainer()); - assertEquals("myRest", config.getDefaultRestContext()); - assertEquals("my-exo-domain", config.getDefaultRealmName()); - assertTrue(config.hasDefinition()); + assertEquals("myPortal", config.getDefaultPortalContainer()); + assertEquals("myRest", config.getDefaultRestContext()); + assertEquals("my-exo-domain", config.getDefaultRealmName()); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-defs.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -92,14 +117,23 @@ assertEquals("my-exo-domain", config.getDefaultRealmName()); assertTrue(config.hasDefinition()); = - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-portal-def-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-portal-def-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer()); - assertEquals("myRest-dpcdef", config.getDefaultRestContext()); - assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()); - assertTrue(config.hasDefinition()); + assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer(= )); + assertEquals("myRest-dpcdef", config.getDefaultRestContext()); + assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()= ); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = rootContainer =3D createRootContainer("portal-container-config-with-= no-default-values-but-with-portal-def.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -109,13 +143,22 @@ assertEquals("my-exo-domain-pcdef", config.getDefaultRealmName()); assertTrue(config.hasDefinition()); = - rootContainer =3D createRootContainer("portal-container-config-with-= no-default-values-but-with-portal-defs.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D createRootContainer("portal-container-config-wi= th-no-default-values-but-with-portal-defs.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("portal", config.getDefaultPortalContainer()); - assertEquals("myRest", config.getDefaultRestContext()); - assertEquals("my-exo-domain", config.getDefaultRealmName()); - assertTrue(config.hasDefinition()); + assertEquals("portal", config.getDefaultPortalContainer()); + assertEquals("myRest", config.getDefaultRestContext()); + assertEquals("my-exo-domain", config.getDefaultRealmName()); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_value.true"); + PropertyManager.refresh(); + } = rootContainer =3D createRootContainer("portal-container-config-with-= no-default-values-but-with-portal-defs2.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -165,6 +208,9 @@ finally { TestPortalContainerDefinitionChange.NAMES.clear(); + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_value.true"); + PropertyManager.refresh(); = } = try @@ -178,6 +224,9 @@ finally { TestPortalContainerDefinitionChange.NAMES.clear(); + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_value.true"); + PropertyManager.refresh(); = } } = @@ -292,123 +341,153 @@ String[] ignoreWebappProfiles =3D {"ignore.unregistered.webapp-defau= lt", "ignore.unregistered.webapp-false", "ignore.unregistered.webapp-true"}; for (int i =3D 0; i < ignoreWebappProfiles.length; i++) { - rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml", ignoreWebappProfiles[i]); - config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); - assertNull(config.getDependencies("foo")); - assertNull(config.getDependencies("myPortal")); - assertNull(config.getDependencies("myPortal-pcdef")); - names =3D config.getPortalContainerNames("foo"); - if (i < ignoreWebappProfiles.length - 1) + try { - // Default behavior + rootContainer =3D createRootContainer("portal-container-config= -with-default-values-and-with-portal-def.xml", ignoreWebappProfiles[i]); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + assertNull(config.getDependencies("foo")); + assertNull(config.getDependencies("myPortal")); + assertNull(config.getDependencies("myPortal-pcdef")); + names =3D config.getPortalContainerNames("foo"); + if (i < ignoreWebappProfiles.length - 1) + { + // Default behavior + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal")); + assertTrue(names.contains("myPortal-pcdef")); + assertEquals("myPortal", config.getPortalContainerName("foo= ")); = + } + else + { + // Ignore webapp needed for EXOJCR-795 + assertTrue(names !=3D null && names.isEmpty()); + assertNull(config.getPortalContainerName("foo")); + } + names =3D config.getPortalContainerNames("myPortal"); assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal")); - assertTrue(names.contains("myPortal-pcdef")); - assertEquals("myPortal", config.getPortalContainerName("foo"))= ; = + assertEquals("myPortal", names.get(0)); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal-pcdef", names.get(0)); + assertEquals("myPortal", config.getPortalContainerName("myPort= al")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal-pcdef")); + assertEquals("myRest", config.getRestContextName("foo")); + assertEquals("myRest", config.getRestContextName("myPortal")); + assertEquals("myRest-pcdef", config.getRestContextName("myPort= al-pcdef")); + assertEquals("my-exo-domain", config.getRealmName("foo")); + assertEquals("my-exo-domain", config.getRealmName("myPortal")); + assertEquals("my-exo-domain-pcdef", config.getRealmName("myPor= tal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertTrue(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + // Needed for backward compatibility + assertFalse(config.isScopeValid("foo", "foo")); + if (i < ignoreWebappProfiles.length - 1) + { + // Default behavior + assertTrue(config.isScopeValid("myPortal", "foo")); + assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); = = + } + else + { + // Ignore webapp needed for EXOJCR-795 + assertFalse(config.isScopeValid("myPortal", "foo")); + assertFalse(config.isScopeValid("myPortal-pcdef", "foo")); = = + } + assertTrue(config.isScopeValid("myPortal", "myPortal")); + assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcd= ef")); + assertTrue(config.hasDefinition()); } - else + finally { - // Ignore webapp needed for EXOJCR-795 - assertTrue(names !=3D null && names.isEmpty()); - assertNull(config.getPortalContainerName("foo")); - } + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_ignore.unregistered.webapp.tru= e"); + System.getProperties().remove("_ignore.unregistered.webapp.fal= se"); + PropertyManager.refresh(); + } = + } + + try + { + // Unregister the portal container + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml", "disable-pc"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertEquals("myPortal", config.getPortalContainerName("myPortal"= )); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertTrue(config.isPortalContainerName("myPortal")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertTrue(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); names =3D config.getPortalContainerNames("myPortal"); assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal", names.get(0)); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal", config.getPortalContainerName("myPortal"= )); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = + try + { + // Unregister the default portal container + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml", "disable-pc2"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal-pcdef")); - assertEquals("myRest", config.getRestContextName("foo")); - assertEquals("myRest", config.getRestContextName("myPortal")); - assertEquals("myRest-pcdef", config.getRestContextName("myPortal-= pcdef")); - assertEquals("my-exo-domain", config.getRealmName("foo")); - assertEquals("my-exo-domain", config.getRealmName("myPortal")); - assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal= -pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertTrue(config.isPortalContainerName("myPortal")); + assertNull(config.getPortalContainerName("myPortal")); assertTrue(config.isPortalContainerName("myPortal-pcdef")); - // Needed for backward compatibility - assertFalse(config.isScopeValid("foo", "foo")); - if (i < ignoreWebappProfiles.length - 1) - { - // Default behavior - assertTrue(config.isScopeValid("myPortal", "foo")); - assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); = = - } - else - { - // Ignore webapp needed for EXOJCR-795 - assertFalse(config.isScopeValid("myPortal", "foo")); - assertFalse(config.isScopeValid("myPortal-pcdef", "foo")); = = - } - assertTrue(config.isScopeValid("myPortal", "myPortal")); + assertFalse(config.isPortalContainerName("myPortal")); assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef"= )); - assertTrue(config.hasDefinition()); = + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); = + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && names.isEmpty()); + config.disablePortalContainer("myPortal-pcdef"); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertNull(config.getPortalContainerName("myPortal")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("myPortal")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && names.isEmpty()); + config.registerPortalContainerName("myPortal-pcdef"); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertNull(config.getPortalContainerName("myPortal")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("myPortal")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && names.isEmpty()); } - - // Unregister the portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml", "disable-pc"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertEquals("myPortal", config.getPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertTrue(config.isPortalContainerName("myPortal")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertTrue(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal")); = - // Unregister the default portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml", "disable-pc2"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertNull(config.getPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); = - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && names.isEmpty()); - config.disablePortalContainer("myPortal-pcdef"); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertNull(config.getPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && names.isEmpty()); - config.registerPortalContainerName("myPortal-pcdef"); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertNull(config.getPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && names.isEmpty()); + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = // Without dependencies and with no portal container name rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-empty-portal-def.xml"); @@ -447,181 +526,87 @@ assertTrue(names !=3D null && !names.isEmpty()); assertEquals("myPortal", names.get(0)); = - // Without dependencies and with no rest context name an realm name - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-empty-portal-def2.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getDependencies("foo")); - assertNull(config.getDependencies("myPortal")); - assertNull(config.getDependencies("myPortal-pcdef")); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal", names.get(0)); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal", config.getPortalContainerName("foo")); - assertEquals("myPortal", config.getPortalContainerName("myPortal")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertEquals("myRest", config.getRestContextName("foo")); - assertEquals("myRest", config.getRestContextName("myPortal")); - assertEquals("myRest", config.getRestContextName("myPortal-pcdef")); - assertEquals("my-exo-domain", config.getRealmName("foo")); - assertEquals("my-exo-domain", config.getRealmName("myPortal")); - assertEquals("my-exo-domain", config.getRealmName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertTrue(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - // Needed for backward compatibility - assertFalse(config.isScopeValid("foo", "foo")); - assertTrue(config.isScopeValid("myPortal", "foo")); - assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); - assertTrue(config.isScopeValid("myPortal", "myPortal")); - assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertTrue(config.hasDefinition()); - // Unregister the portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-empty-portal-def2.xml", "disable-pc"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); = + try + { + // Without dependencies and with no rest context name an realm na= me + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-empty-portal-def2.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getDependencies("foo")); + assertNull(config.getDependencies("myPortal")); + assertNull(config.getDependencies("myPortal-pcdef")); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal", names.get(0)); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal-pcdef", names.get(0)); + assertEquals("myPortal", config.getPortalContainerName("foo")); + assertEquals("myPortal", config.getPortalContainerName("myPortal"= )); + assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal-pcdef")); + assertEquals("myRest", config.getRestContextName("foo")); + assertEquals("myRest", config.getRestContextName("myPortal")); + assertEquals("myRest", config.getRestContextName("myPortal-pcdef"= )); + assertEquals("my-exo-domain", config.getRealmName("foo")); + assertEquals("my-exo-domain", config.getRealmName("myPortal")); + assertEquals("my-exo-domain", config.getRealmName("myPortal-pcdef= ")); + assertFalse(config.isPortalContainerName("foo")); + assertTrue(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + // Needed for backward compatibility + assertFalse(config.isScopeValid("foo", "foo")); + assertTrue(config.isScopeValid("myPortal", "foo")); + assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); + assertTrue(config.isScopeValid("myPortal", "myPortal")); + assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef"= )); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { + // Unregister the portal container + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-empty-portal-def2.xml", "disable-pc"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = = - // Without dependencies and with default portal container definition - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-portal-def-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - deps =3D config.getDependencies("foo"); - assertNull(deps); - deps =3D config.getDependencies("myPortal"); - assertNull(deps); - deps =3D config.getDependencies("myPortal-pcdef"); - assertTrue(deps !=3D null && deps.size() =3D=3D 1 && deps.contains("= fooX")); - names =3D config.getPortalContainerNames("fooX"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("foo")= ); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("myPor= tal")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertEquals("myRest-dpcdef", config.getRestContextName("foo")); - assertEquals("myRest-dpcdef", config.getRestContextName("myPortal")); - assertEquals("myRest-pcdef", config.getRestContextName("myPortal-pcd= ef")); - assertEquals("my-exo-domain-dpcdef", config.getRealmName("foo")); - assertEquals("my-exo-domain-dpcdef", config.getRealmName("myPortal")= ); - assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal-pc= def")); - assertFalse(config.isPortalContainerName("foo")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-dpcdef")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("foo", "fooX")); - assertFalse(config.isScopeValid("myPortal", "fooX")); - assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); - assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); - assertTrue(config.hasDefinition()); - // Unregister the portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def-with-default-portal-def.xml", "disable-p= c"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("foo")= ); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("myPor= tal")); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("myPor= tal-dpcdef")); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-dpcdef")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("foo", "fooX")); - assertFalse(config.isScopeValid("myPortal", "fooX")); - assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); - assertFalse(config.isScopeValid("myPortal-pcdef", "fooX")); - assertTrue(config.isScopeValid("myPortal-dpcdef", "myPortal-dpcdef")= ); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); = - names =3D config.getPortalContainerNames("myPortal-dpcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - names =3D config.getPortalContainerNames("fooX"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - // Unregister the default portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def-with-default-portal-def.xml", "disable-p= c2"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertEquals("myPortal-pcdef", config.getPortalContainerName("foo")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al")); - assertNull(config.getPortalContainerName("myPortal-dpcdef")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertFalse(config.isPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-dpcdef")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("foo", "fooX")); - assertFalse(config.isScopeValid("myPortal", "fooX")); - assertFalse(config.isScopeValid("myPortal-dpcdef", "fooX")); - assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); - assertFalse(config.isScopeValid("myPortal-dpcdef", "myPortal-dpcdef"= )); - assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-dpcdef"); - assertTrue(names !=3D null && names.isEmpty()); = - names =3D config.getPortalContainerNames("fooX"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); - = - profiles =3D - new String[]{"AddDependencies", "AddDependenciesBefore-No-Target"= , "AddDependenciesBefore-With-Fake-Target", - "AddDependenciesBefore-With-Target", "AddDependenciesAfter-No-= Target", - "AddDependenciesAfter-With-Fake-Target", "AddDependenciesAfter= -With-Target"}; - - for (String profile : profiles) + try { + // Without dependencies and with default portal container definit= ion rootContainer =3D - createRootContainer( - "portal-container-config-with-default-values-and-with-porta= l-def-with-default-portal-def.xml", - "with-profiles", profile); + createRootContainer("portal-container-config-with-default-valu= es-and-with-portal-def-with-default-portal-def.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); deps =3D config.getDependencies("foo"); assertNull(deps); deps =3D config.getDependencies("myPortal"); assertNull(deps); deps =3D config.getDependencies("myPortal-pcdef"); - assertTrue(deps !=3D null && deps.size() =3D=3D 2 && deps.contain= s("fooX") && deps.contains("foo")); - int index =3D deps.indexOf("foo"); - if (profile.equals("AddDependenciesBefore-No-Target") - || profile.equals("AddDependenciesBefore-With-Fake-Target") - || profile.equals("AddDependenciesBefore-With-Target")) - { - assertEquals(0, index); - } - else - { - assertEquals(1, index); - } + assertTrue(deps !=3D null && deps.size() =3D=3D 1 && deps.contain= s("fooX")); names =3D config.getPortalContainerNames("fooX"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals(2, names.size()); @@ -640,7 +625,7 @@ names =3D config.getPortalContainerNames("myPortal-pcdef"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal-pcdef", config.getPortalContainerName("foo= ")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName("fo= o")); assertEquals("myPortal-dpcdef", config.getPortalContainerName("my= Portal")); assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal-pcdef")); assertEquals("myRest-dpcdef", config.getRestContextName("foo")); @@ -651,15 +636,24 @@ assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal= -pcdef")); assertFalse(config.isPortalContainerName("foo")); assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-dpcdef")); assertTrue(config.isPortalContainerName("myPortal-pcdef")); assertFalse(config.isScopeValid("foo", "fooX")); assertFalse(config.isScopeValid("myPortal", "fooX")); + assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { // Unregister the portal container - rootContainer =3D createRootContainer( - "portal-container-config-with-default-values-and-with-portal-d= ef-with-default-portal-def.xml", - "with-profiles", profile, "disable-pc"); + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def-with-default-portal-def.xml", "disabl= e-pc"); config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); assertEquals("myPortal-dpcdef", config.getPortalContainerName("fo= o")); assertEquals("myPortal-dpcdef", config.getPortalContainerName("my= Portal")); @@ -681,18 +675,21 @@ assertTrue(names !=3D null && !names.isEmpty()); assertEquals(1, names.size()); assertTrue(names.contains("myPortal-dpcdef")); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); names =3D config.getPortalContainerNames("fooX"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals(1, names.size()); assertTrue(names.contains("myPortal-dpcdef")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { // Unregister the default portal container - rootContainer =3D createRootContainer( - "portal-container-config-with-default-values-and-with-portal-d= ef-with-default-portal-def.xml", - "with-profiles", profile, "disable-pc2"); + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def-with-default-portal-def.xml", "disabl= e-pc2"); config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); assertEquals("myPortal-pcdef", config.getPortalContainerName("foo= ")); assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal")); @@ -713,17 +710,177 @@ assertEquals(1, names.size()); assertTrue(names.contains("myPortal-pcdef")); names =3D config.getPortalContainerNames("myPortal-dpcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); = + assertTrue(names !=3D null && names.isEmpty()); = names =3D config.getPortalContainerNames("fooX"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); = + assertTrue(names.contains("myPortal-pcdef")); } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + = + profiles =3D + new String[]{"AddDependencies", "AddDependenciesBefore-No-Target"= , "AddDependenciesBefore-With-Fake-Target", + "AddDependenciesBefore-With-Target", "AddDependenciesAfter-No-= Target", + "AddDependenciesAfter-With-Fake-Target", "AddDependenciesAfter= -With-Target"}; = + for (String profile : profiles) + { + try + { + rootContainer =3D + createRootContainer( + "portal-container-config-with-default-values-and-with-po= rtal-def-with-default-portal-def.xml", + "with-profiles", profile); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + deps =3D config.getDependencies("foo"); + assertNull(deps); + deps =3D config.getDependencies("myPortal"); + assertNull(deps); + deps =3D config.getDependencies("myPortal-pcdef"); + assertTrue(deps !=3D null && deps.size() =3D=3D 2 && deps.cont= ains("fooX") && deps.contains("foo")); + int index =3D deps.indexOf("foo"); + if (profile.equals("AddDependenciesBefore-No-Target") + || profile.equals("AddDependenciesBefore-With-Fake-Target") + || profile.equals("AddDependenciesBefore-With-Target")) + { + assertEquals(0, index); + } + else + { + assertEquals(1, index); + } + names =3D config.getPortalContainerNames("fooX"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal-pcdef", names.get(0)); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= foo")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "myPortal")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal-pcdef")); + assertEquals("myRest-dpcdef", config.getRestContextName("foo")= ); + assertEquals("myRest-dpcdef", config.getRestContextName("myPor= tal")); + assertEquals("myRest-pcdef", config.getRestContextName("myPort= al-pcdef")); + assertEquals("my-exo-domain-dpcdef", config.getRealmName("foo"= )); + assertEquals("my-exo-domain-dpcdef", config.getRealmName("myPo= rtal")); + assertEquals("my-exo-domain-pcdef", config.getRealmName("myPor= tal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("foo", "fooX")); + assertFalse(config.isScopeValid("myPortal", "fooX")); + assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { + // Unregister the portal container + rootContainer =3D createRootContainer( + "portal-container-config-with-default-values-and-with-porta= l-def-with-default-portal-def.xml", + "with-profiles", profile, "disable-pc"); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "foo")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "myPortal")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "myPortal-dpcdef")); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-dpcdef")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("foo", "fooX")); + assertFalse(config.isScopeValid("myPortal", "fooX")); + assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); + assertFalse(config.isScopeValid("myPortal-pcdef", "fooX")); + assertTrue(config.isScopeValid("myPortal-dpcdef", "myPortal-dp= cdef")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pc= def")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); = + names =3D config.getPortalContainerNames("myPortal-dpcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + names =3D config.getPortalContainerNames("fooX"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { + // Unregister the default portal container + rootContainer =3D createRootContainer( + "portal-container-config-with-default-values-and-with-porta= l-def-with-default-portal-def.xml", + "with-profiles", profile, "disable-pc2"); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= foo")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal")); + assertNull(config.getPortalContainerName("myPortal-dpcdef")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertFalse(config.isPortalContainerName("myPortal")); + assertFalse(config.isPortalContainerName("myPortal-dpcdef")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("foo", "fooX")); + assertFalse(config.isScopeValid("myPortal", "fooX")); + assertFalse(config.isScopeValid("myPortal-dpcdef", "fooX")); + assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); + assertFalse(config.isScopeValid("myPortal-dpcdef", "myPortal-d= pcdef")); + assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcd= ef")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal-dpcdef"); + assertTrue(names !=3D null && names.isEmpty()); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); = + names =3D config.getPortalContainerNames("fooX"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = + } + // With dependencies rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def2.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -1025,76 +1182,109 @@ assertEquals("my-exo-domain", config.getSetting("myPortal-pcdef", Po= rtalContainerConfig.REALM_SETTING_NAME)); = // Without settings, without portal definition and with default port= al container definition - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getSetting("foo", "foo")); - assertNull(config.getSetting("myPortal", "foo")); - assertNull(config.getSetting("myPortal-pcdef", "foo")); - assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalConta= inerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal-dpcdef", config - .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SE= TTING_NAME)); - assertEquals("myPortal-dpcdef", config.getSetting("myPortal-pcdef", - PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("foo", PortalContain= erConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("myPortal", PortalCo= ntainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-dpcdef", config - .getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_= SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Portal= ContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal", P= ortalContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config - .getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING= _NAME)); - assertEquals("value0", config.getSetting("foo", "string")); - assertEquals(new Integer(100), config.getSetting("foo", "int")); - assertEquals(new Long(100), config.getSetting("foo", "long")); - assertEquals(new Double(100), config.getSetting("foo", "double")); - assertEquals(new Boolean(false), config.getSetting("foo", "boolean")= ); - assertEquals("value0", config.getSetting("myPortal", "string")); - assertEquals(new Integer(100), config.getSetting("myPortal", "int")); - assertEquals(new Long(100), config.getSetting("myPortal", "long")); - assertEquals(new Double(100), config.getSetting("myPortal", "double"= )); - assertEquals(new Boolean(false), config.getSetting("myPortal", "bool= ean")); - assertEquals("value0", config.getSetting("myPortal-pcdef", "string")= ); - assertEquals(new Integer(100), config.getSetting("myPortal-pcdef", "= int")); - assertEquals(new Long(100), config.getSetting("myPortal-pcdef", "lon= g")); - assertEquals(new Double(100), config.getSetting("myPortal-pcdef", "d= ouble")); - assertEquals(new Boolean(false), config.getSetting("myPortal-pcdef",= "boolean")); + try + { + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getSetting("foo", "foo")); + assertNull(config.getSetting("myPortal", "foo")); + assertNull(config.getSetting("myPortal-pcdef", "foo")); + assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalCo= ntainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal-dpcdef", config + .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER= _SETTING_NAME)); + assertEquals("myPortal-dpcdef", config.getSetting("myPortal-pcdef= ", + PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("foo", PortalCont= ainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("myPortal", Porta= lContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-dpcdef", config + .getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTE= XT_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Por= talContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal"= , PortalContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config + .getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETT= ING_NAME)); + assertEquals("value0", config.getSetting("foo", "string")); + assertEquals(new Integer(100), config.getSetting("foo", "int")); + assertEquals(new Long(100), config.getSetting("foo", "long")); + assertEquals(new Double(100), config.getSetting("foo", "double")); + assertEquals(new Boolean(false), config.getSetting("foo", "boolea= n")); + assertEquals("value0", config.getSetting("myPortal", "string")); + assertEquals(new Integer(100), config.getSetting("myPortal", "int= ")); + assertEquals(new Long(100), config.getSetting("myPortal", "long")= ); + assertEquals(new Double(100), config.getSetting("myPortal", "doub= le")); + assertEquals(new Boolean(false), config.getSetting("myPortal", "b= oolean")); + assertEquals("value0", config.getSetting("myPortal-pcdef", "strin= g")); + assertEquals(new Integer(100), config.getSetting("myPortal-pcdef"= , "int")); + assertEquals(new Long(100), config.getSetting("myPortal-pcdef", "= long")); + assertEquals(new Double(100), config.getSetting("myPortal-pcdef",= "double")); + assertEquals(new Boolean(false), config.getSetting("myPortal-pcde= f", "boolean")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + System.getProperties().remove("_rest.context"); + System.getProperties().remove("_realm.name"); + PropertyManager.refresh(); + } = - // Without settings and with portal definition - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getSetting("foo", "foo")); - assertNull(config.getSetting("myPortal", "foo")); - assertNull(config.getSetting("myPortal-pcdef", "foo")); - assertEquals("myPortal", config.getSetting("foo", PortalContainerCon= fig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal", config.getSetting("myPortal", PortalContain= erConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", - PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myRest", config.getSetting("foo", PortalContainerConfi= g.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest", config.getSetting("myPortal", PortalContainer= Config.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", Por= talContainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("my-exo-domain", config.getSetting("foo", PortalContain= erConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain", config.getSetting("myPortal", PortalCo= ntainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcde= f", PortalContainerConfig.REALM_SETTING_NAME)); + try + { + // Without settings and with portal definition + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getSetting("foo", "foo")); + assertNull(config.getSetting("myPortal", "foo")); + assertNull(config.getSetting("myPortal-pcdef", "foo")); + assertEquals("myPortal", config.getSetting("foo", PortalContainer= Config.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal", config.getSetting("myPortal", PortalCont= ainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", + PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myRest", config.getSetting("foo", PortalContainerCo= nfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest", config.getSetting("myPortal", PortalContai= nerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", = PortalContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("my-exo-domain", config.getSetting("foo", PortalCont= ainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain", config.getSetting("myPortal", Porta= lContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-p= cdef", PortalContainerConfig.REALM_SETTING_NAME)); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = - // Without settings, with portal definition and with default portal = definition - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-portal-def-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getSetting("foo", "foo")); - assertNull(config.getSetting("myPortal", "foo")); - assertNull(config.getSetting("myPortal-pcdef", "foo")); - assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalConta= inerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal-dpcdef", config - .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SE= TTING_NAME)); - assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", - PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("foo", PortalContain= erConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("myPortal", PortalCo= ntainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", Por= talContainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Portal= ContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal", P= ortalContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcde= f", PortalContainerConfig.REALM_SETTING_NAME)); + try + { + // Without settings, with portal definition and with default port= al definition + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-portal-def-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getSetting("foo", "foo")); + assertNull(config.getSetting("myPortal", "foo")); + assertNull(config.getSetting("myPortal-pcdef", "foo")); + assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalCo= ntainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal-dpcdef", config + .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER= _SETTING_NAME)); + assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", + PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("foo", PortalCont= ainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("myPortal", Porta= lContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", = PortalContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Por= talContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal"= , PortalContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-p= cdef", PortalContainerConfig.REALM_SETTING_NAME)); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = // With internal settings rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-settings.xml"); @@ -1480,6 +1670,14 @@ { System.getProperties().remove("TestPortalContainerConfig-string"); System.getProperties().remove("TestPortalContainerConfig-int"); + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + System.getProperties().remove("_rest.context"); + System.getProperties().remove("_realm.name"); + PropertyManager.refresh(); } = // With both settings internal and external, and with invalid values = Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org= /exoplatform/container/definition/portal-container-config-with-default-valu= es-and-with-both-settings-with-default-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-both-settings-with-default-portal-def.xml 2010-10-21 07:37:13 UTC (re= v 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-both-settings-with-default-portal-def.xml 2010-10-21 09:33:22 UTC (re= v 3308) @@ -16,17 +16,17 @@ default.portal.container - myPortal + ${_default.portal.container} default.rest.context - myRest + ${_default.rest.context} default.realm.name - my-exo-domain + ${_default.realm.name} @@ -142,6 +142,12 @@ properties + + + + + + @@ -161,15 +167,15 @@ - myPortal-pcdef + ${_portal.container} - myRest-pcdef + ${_rest.context} - my-exo-domain-pcdef + ${_realm.name} Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org= /exoplatform/container/definition/portal-container-config-with-default-valu= es-and-with-default-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-default-portal-def.xml 2010-10-21 07:37:13 UTC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-default-portal-def.xml 2010-10-21 09:33:22 UTC (rev 3308) @@ -16,17 +16,17 @@ default.portal.container - myPortal + ${_default.portal.container} default.rest.context - myRest + ${_default.rest.context} default.realm.name - my-exo-domain + ${_default.realm.name} @@ -37,19 +37,19 @@ - myPortal-dpcdef + ${_portal.container} - myRest-dpcdef + ${_rest.context} - my-exo-domain-dpcdef + ${_realm.name} @@ -100,4 +100,19 @@ + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + + + + + + = \ No newline at end of file Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org= /exoplatform/container/definition/portal-container-config-with-default-valu= es-and-with-empty-portal-def2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-empty-portal-def2.xml 2010-10-21 07:37:13 UTC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-empty-portal-def2.xml 2010-10-21 09:33:22 UTC (rev 3308) @@ -16,20 +16,33 @@ default.portal.container - myPortal + ${_default.portal.container} default.rest.context - myRest + ${_default.rest.context} default.realm.name - my-exo-domain + ${_default.realm.name} + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig @@ -46,7 +59,7 @@ - myPortal-pcdef + ${_portal.container} @@ -67,7 +80,7 @@ names - myPortal-pcdef + ${_portal.container} Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org= /exoplatform/container/definition/portal-container-config-with-default-valu= es-and-with-portal-def-with-default-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-portal-def-with-default-portal-def.xml 2010-10-21 07:37:13 UTC (rev 3= 307) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-portal-def-with-default-portal-def.xml 2010-10-21 09:33:22 UTC (rev 3= 308) @@ -62,6 +62,16 @@ + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig @@ -78,7 +88,7 @@ - myPortal-pcdef + ${_portal.container} @@ -107,7 +117,7 @@ apply.specific fake - myPortal-pcdef + ${_portal.container} change @@ -233,7 +243,7 @@ names - myPortal-pcdef + ${_portal.container} Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org= /exoplatform/container/definition/portal-container-config-with-default-valu= es-and-with-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-portal-def.xml 2010-10-21 07:37:13 UTC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-default-values-and= -with-portal-def.xml 2010-10-21 09:33:22 UTC (rev 3308) @@ -31,14 +31,25 @@ ignore.unregistered.webapp - false + ${_ignore.unregistered.webapp.false} ignore.unregistered.webapp - true + ${_ignore.unregistered.webapp.true} + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig Modified: kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org= /exoplatform/container/definition/portal-container-config-with-no-default-v= alues-but-with-portal-defs.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-no-default-values-= but-with-portal-defs.xml 2010-10-21 07:37:13 UTC (rev 3307) +++ kernel/branches/2.2.x/exo.kernel.container/src/test/resources/org/exopl= atform/container/definition/portal-container-config-with-no-default-values-= but-with-portal-defs.xml 2010-10-21 09:33:22 UTC (rev 3308) @@ -12,6 +12,16 @@ org.exoplatform.container.definition.PortalContainerConfig + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig @@ -69,7 +79,7 @@ apply.all - true + ${_value.true} change1 @@ -92,7 +102,7 @@ apply.default - true + ${_value.true} change2 @@ -139,7 +149,7 @@ apply.default - true + ${_value.true} = apply.specific --===============6086345528604917318==-- From do-not-reply at jboss.org Thu Oct 21 05:40:09 2010 Content-Type: multipart/mixed; boundary="===============8036728581934992938==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3309 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition and 2 other directories. Date: Thu, 21 Oct 2010 05:40:09 -0400 Message-ID: <201010210940.o9L9e9sh022854@svn01.web.mwc.hst.phx2.redhat.com> --===============8036728581934992938== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-21 05:40:08 -0400 (Thu, 21 Oct 2010) New Revision: 3309 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/container-configuration.xml kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/definition/PortalContainerConfig.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/definition/PortalContainerDefinition.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/definition/PortalContainerDefinitionChangePlugin.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/definition/PortalContainerDefinitionDisablePlugin.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/definition/TestPortalContainerConfig.java kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/con= tainer/definition/portal-container-config-with-default-values-and-with-both= -settings-with-default-portal-def.xml kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/con= tainer/definition/portal-container-config-with-default-values-and-with-defa= ult-portal-def.xml kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/con= tainer/definition/portal-container-config-with-default-values-and-with-empt= y-portal-def2.xml kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/con= tainer/definition/portal-container-config-with-default-values-and-with-port= al-def-with-default-portal-def.xml kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/con= tainer/definition/portal-container-config-with-default-values-and-with-port= al-def.xml kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/con= tainer/definition/portal-container-config-with-no-default-values-but-with-p= ortal-defs.xml Log: EXOJCR-1011: Now most of the value of the parameters can be set thanks to v= ariables defined in the file loaded by the PropertyConfiguration which is b= y default configuration.properties in GateIn. Refer to the doc for more det= ails Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/container-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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/container-configuration.xml 2010-10-21 09:33:22 UTC (rev 33= 08) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/container-configuration.xml 2010-10-21 09:40:08 UTC (rev 33= 09) @@ -454,28 +454,28 @@ - default.portal.container + default.portal.container (*) = The name of the default portal container. This fiel= d is optional. = - default.rest.context + default.rest.context (*) = The name of the default rest ServletContext. This field is optional. = - default.realm.name + default.realm.name (*) = The name of the default realm. This field is optional. = - ignore.unregistered.webapp + ignore.unregistered.webapp (*) = Indicates whether the unregistered webapps have to = be ignored. If a webapp has not been registered as a dependen= cy @@ -510,6 +510,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + A new PortalContainerDefinition can be define= d at the RootContainer level thanks to an external plugi= n, see an example below: <external-component-plug= ins> @@ -615,14 +624,14 @@ - name + name (*) = The name of the portal container. This field is mandatory . = - restContextName + restContextName (*) = The name of the context name of the rest web application. This field is optional. The default value wil= l be @@ -631,7 +640,7 @@ = - realmName + realmName (*) = The name of the realm. This field is optional. The default value will be defined at the @@ -757,7 +766,7 @@ - name + name (*) = The name of the portal container. This field is optional. The default portal name will be: @@ -783,7 +792,7 @@ = - restContextName + restContextName (*) = The name of the context name of the rest web application. This field is optional. The default value wil @@ -810,7 +819,7 @@ = - realmName + realmName (*) = The name of the realm. This field is optional. The default value wil be: @@ -891,6 +900,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + Internal and external settings are both optional, but if we = give a non empty value for both the application will merge the settings= . If the same setting name exists in both settings, we apply the follow= ing @@ -1102,7 +1120,7 @@ - apply.all + apply.all (*) = Indicates whether the changes have to be applied to= all the portal containers or not. The default value of this fi= eld @@ -1111,7 +1129,7 @@ = - apply.default + apply.default (*) = Indicates whether the changes have to be applied to= the default portal container or not. The default value of this @@ -1120,7 +1138,7 @@ = - apply.specific + apply.specific (*) = A set of specific portal container names to which we want to apply the changes. This field is a @@ -1143,6 +1161,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + To identify the portal containers to which the changes have = to be applied, we use the follwing algorithm: = @@ -1534,7 +1561,7 @@ - names + names (*) = The list of the name of the portal containers to disable. @@ -1543,6 +1570,15 @@ = + + All the value of the parameters marked with a (*) can be + defined thanks to System properties like any values in configura= tion + files but also thanks to variables loaded by the + PropertyConfigurator. For example in GateIn= by + default, it would be all the variables defined in the file + configuration.properties. + + To prevent any accesses to a web application corresponding to PortalContainer that has been disabled, you need to make sure that the following Http Filter (or a sub class of it) has Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/definition/PortalContainerConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/definition/PortalContainerConfig.java 2010-10-21 09:33:22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/definition/PortalContainerConfig.java 2010-10-21 09:40:08 UTC (rev 3309) @@ -205,8 +205,10 @@ this.serverInfo =3D serverInfo; this.defaultDefinition =3D create(params); this.ignoreUnregisteredWebapp =3D - params !=3D null && params.getValueParam("ignore.unregistered.web= app") !=3D null - && Boolean.valueOf(params.getValueParam("ignore.unregistered.w= ebapp").getValue()); + params !=3D null + && params.getValueParam("ignore.unregistered.webapp") !=3D null + && Boolean.valueOf(Deserializer.resolveVariables(params.getVal= ueParam("ignore.unregistered.webapp") + .getValue())); } = /** @@ -266,7 +268,7 @@ if (vp !=3D null && vp.getValue().trim().length() > 0) { // A realm name has been defined in the value parameter, thus = we use it - def.setRealmName(vp.getValue().trim()); + def.setRealmName(Deserializer.resolveVariables(vp.getValue().t= rim())); } } else @@ -294,7 +296,7 @@ if (vp !=3D null && vp.getValue().trim().length() > 0) { // A rest context name has been defined in the value parameter= , thus we use it - def.setRestContextName(vp.getValue().trim()); + def.setRestContextName(Deserializer.resolveVariables(vp.getVal= ue().trim())); } } else @@ -322,7 +324,7 @@ if (vp !=3D null && vp.getValue().trim().length() > 0) { // A name has been defined in the value parameter, thus we use= it - def.setName(vp.getValue().trim()); + def.setName(Deserializer.resolveVariables(vp.getValue().trim()= )); } } else Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/definition/PortalContainerDefinition.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/definition/PortalContainerDefinition.java 2010-10-21 09:33:22 UTC (rev 3= 308) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/definition/PortalContainerDefinition.java 2010-10-21 09:40:08 UTC (rev 3= 309) @@ -19,9 +19,11 @@ package org.exoplatform.container.definition; = import org.exoplatform.container.PortalContainer; +import org.exoplatform.container.xml.Deserializer; = import java.util.List; import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; = import javax.servlet.ServletContext; = @@ -39,6 +41,11 @@ { = /** + * Indicates whether the current instance has been initialized + */ + private final AtomicBoolean initialized =3D new AtomicBoolean(); + = + /** * The name of the related {@link PortalContainer} */ private String name; @@ -72,6 +79,7 @@ = public String getName() { + init(); return name; } = @@ -92,6 +100,7 @@ = public String getRealmName() { + init(); return realmName; } = @@ -102,6 +111,7 @@ = public String getRestContextName() { + init(); return restContextName; } = @@ -129,4 +139,26 @@ { this.externalSettingsPath =3D externalSettingsPath; } + = + /** + * Ensure that all the parameter values have been resolved in order to = allow to + * use variables to define their values. It will be executed only if it= has the current + * instance has not been initialized + */ + private void init() + { + if (!initialized.get()) + { + synchronized (this) + { + if (!initialized.get()) + { + setName(Deserializer.resolveVariables(name)); + setRestContextName(Deserializer.resolveVariables(restContex= tName)); + setRealmName(Deserializer.resolveVariables(realmName)); + initialized.set(true); + } + } + } + } = } Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/definition/PortalContainerDefinitionChangePlugin.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/definition/PortalContainerDefinitionChangePlugin.java 2010-10-21 09:33:2= 2 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/definition/PortalContainerDefinitionChangePlugin.java 2010-10-21 09:40:0= 8 UTC (rev 3309) @@ -17,6 +17,7 @@ package org.exoplatform.container.definition; = import org.exoplatform.container.component.BaseComponentPlugin; +import org.exoplatform.container.xml.Deserializer; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.ValueParam; import org.exoplatform.container.xml.ValuesParam; @@ -62,17 +63,22 @@ ValueParam vp =3D params.getValueParam("apply.all"); if (vp !=3D null && vp.getValue().length() > 0) { - this.all =3D Boolean.valueOf(vp.getValue()); + this.all =3D Boolean.valueOf(Deserializer.resolveVariables(vp.get= Value())); } vp =3D params.getValueParam("apply.default"); if (vp !=3D null && vp.getValue().length() > 0) { - this.bDefault =3D Boolean.valueOf(vp.getValue()); + this.bDefault =3D Boolean.valueOf(Deserializer.resolveVariables(v= p.getValue())); } ValuesParam vsp =3D params.getValuesParam("apply.specific"); if (vsp !=3D null && !vsp.getValues().isEmpty()) { - this.names =3D new HashSet(vsp.getValues()); + this.names =3D new HashSet(vsp.getValues().size()); + List lnames =3D vsp.getValues(); + for (String name : lnames) + { + names.add(Deserializer.resolveVariables(name)); + } } this.changes =3D params.getObjectParamValues(PortalContainerDefiniti= onChange.class); } Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/definition/PortalContainerDefinitionDisablePlugin.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/definition/PortalContainerDefinitionDisablePlugin.java 2010-10-21 09:33:= 22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/definition/PortalContainerDefinitionDisablePlugin.java 2010-10-21 09:40:= 08 UTC (rev 3309) @@ -17,10 +17,12 @@ package org.exoplatform.container.definition; = import org.exoplatform.container.component.BaseComponentPlugin; +import org.exoplatform.container.xml.Deserializer; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.ValuesParam; = import java.util.HashSet; +import java.util.List; import java.util.Set; = /** @@ -45,7 +47,12 @@ ValuesParam vsp =3D params.getValuesParam("names"); if (vsp !=3D null && !vsp.getValues().isEmpty()) { - this.names =3D new HashSet(vsp.getValues()); + this.names =3D new HashSet(vsp.getValues().size()); + List lnames =3D vsp.getValues(); + for (String name : lnames) + { + names.add(Deserializer.resolveVariables(name)); + } = } } = Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/definition/TestPortalContainerConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/definition/TestPortalContainerConfig.java 2010-10-21 09:33:22 UTC (rev 3= 308) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/definition/TestPortalContainerConfig.java 2010-10-21 09:40:08 UTC (rev 3= 309) @@ -16,6 +16,7 @@ */ package org.exoplatform.container.definition; = +import org.exoplatform.commons.utils.PropertyManager; import org.exoplatform.container.RootContainer; import org.exoplatform.container.jmx.AbstractTestContainer; import org.exoplatform.container.monitor.jvm.J2EEServerInfo; @@ -64,25 +65,49 @@ assertFalse(config.isPortalContainerName("myPortal-dpcdef")); assertFalse(config.hasDefinition()); = - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer()); - assertEquals("myRest-dpcdef", config.getDefaultRestContext()); - assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()); - assertFalse(config.isPortalContainerName("portal")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-dpcdef")); = - assertFalse(config.hasDefinition()); + assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer(= )); + assertEquals("myRest-dpcdef", config.getDefaultRestContext()); + assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()= ); + assertFalse(config.isPortalContainerName("portal")); + assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-dpcdef")); = + assertFalse(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + System.getProperties().remove("_rest.context"); + System.getProperties().remove("_realm.name"); + PropertyManager.refresh(); + } = - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("myPortal", config.getDefaultPortalContainer()); - assertEquals("myRest", config.getDefaultRestContext()); - assertEquals("my-exo-domain", config.getDefaultRealmName()); - assertTrue(config.hasDefinition()); + assertEquals("myPortal", config.getDefaultPortalContainer()); + assertEquals("myRest", config.getDefaultRestContext()); + assertEquals("my-exo-domain", config.getDefaultRealmName()); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-defs.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -92,14 +117,23 @@ assertEquals("my-exo-domain", config.getDefaultRealmName()); assertTrue(config.hasDefinition()); = - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-portal-def-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-portal-def-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer()); - assertEquals("myRest-dpcdef", config.getDefaultRestContext()); - assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()); - assertTrue(config.hasDefinition()); + assertEquals("myPortal-dpcdef", config.getDefaultPortalContainer(= )); + assertEquals("myRest-dpcdef", config.getDefaultRestContext()); + assertEquals("my-exo-domain-dpcdef", config.getDefaultRealmName()= ); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = rootContainer =3D createRootContainer("portal-container-config-with-= no-default-values-but-with-portal-def.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -109,13 +143,22 @@ assertEquals("my-exo-domain-pcdef", config.getDefaultRealmName()); assertTrue(config.hasDefinition()); = - rootContainer =3D createRootContainer("portal-container-config-with-= no-default-values-but-with-portal-defs.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); + try + { + rootContainer =3D createRootContainer("portal-container-config-wi= th-no-default-values-but-with-portal-defs.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); = - assertEquals("portal", config.getDefaultPortalContainer()); - assertEquals("myRest", config.getDefaultRestContext()); - assertEquals("my-exo-domain", config.getDefaultRealmName()); - assertTrue(config.hasDefinition()); + assertEquals("portal", config.getDefaultPortalContainer()); + assertEquals("myRest", config.getDefaultRestContext()); + assertEquals("my-exo-domain", config.getDefaultRealmName()); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_value.true"); + PropertyManager.refresh(); + } = rootContainer =3D createRootContainer("portal-container-config-with-= no-default-values-but-with-portal-defs2.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -165,6 +208,9 @@ finally { TestPortalContainerDefinitionChange.NAMES.clear(); + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_value.true"); + PropertyManager.refresh(); = } = try @@ -178,6 +224,9 @@ finally { TestPortalContainerDefinitionChange.NAMES.clear(); + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_value.true"); + PropertyManager.refresh(); = } } = @@ -292,123 +341,153 @@ String[] ignoreWebappProfiles =3D {"ignore.unregistered.webapp-defau= lt", "ignore.unregistered.webapp-false", "ignore.unregistered.webapp-true"}; for (int i =3D 0; i < ignoreWebappProfiles.length; i++) { - rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml", ignoreWebappProfiles[i]); - config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); - assertNull(config.getDependencies("foo")); - assertNull(config.getDependencies("myPortal")); - assertNull(config.getDependencies("myPortal-pcdef")); - names =3D config.getPortalContainerNames("foo"); - if (i < ignoreWebappProfiles.length - 1) + try { - // Default behavior + rootContainer =3D createRootContainer("portal-container-config= -with-default-values-and-with-portal-def.xml", ignoreWebappProfiles[i]); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + assertNull(config.getDependencies("foo")); + assertNull(config.getDependencies("myPortal")); + assertNull(config.getDependencies("myPortal-pcdef")); + names =3D config.getPortalContainerNames("foo"); + if (i < ignoreWebappProfiles.length - 1) + { + // Default behavior + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal")); + assertTrue(names.contains("myPortal-pcdef")); + assertEquals("myPortal", config.getPortalContainerName("foo= ")); = + } + else + { + // Ignore webapp needed for EXOJCR-795 + assertTrue(names !=3D null && names.isEmpty()); + assertNull(config.getPortalContainerName("foo")); + } + names =3D config.getPortalContainerNames("myPortal"); assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal")); - assertTrue(names.contains("myPortal-pcdef")); - assertEquals("myPortal", config.getPortalContainerName("foo"))= ; = + assertEquals("myPortal", names.get(0)); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal-pcdef", names.get(0)); + assertEquals("myPortal", config.getPortalContainerName("myPort= al")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal-pcdef")); + assertEquals("myRest", config.getRestContextName("foo")); + assertEquals("myRest", config.getRestContextName("myPortal")); + assertEquals("myRest-pcdef", config.getRestContextName("myPort= al-pcdef")); + assertEquals("my-exo-domain", config.getRealmName("foo")); + assertEquals("my-exo-domain", config.getRealmName("myPortal")); + assertEquals("my-exo-domain-pcdef", config.getRealmName("myPor= tal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertTrue(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + // Needed for backward compatibility + assertFalse(config.isScopeValid("foo", "foo")); + if (i < ignoreWebappProfiles.length - 1) + { + // Default behavior + assertTrue(config.isScopeValid("myPortal", "foo")); + assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); = = + } + else + { + // Ignore webapp needed for EXOJCR-795 + assertFalse(config.isScopeValid("myPortal", "foo")); + assertFalse(config.isScopeValid("myPortal-pcdef", "foo")); = = + } + assertTrue(config.isScopeValid("myPortal", "myPortal")); + assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcd= ef")); + assertTrue(config.hasDefinition()); } - else + finally { - // Ignore webapp needed for EXOJCR-795 - assertTrue(names !=3D null && names.isEmpty()); - assertNull(config.getPortalContainerName("foo")); - } + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_ignore.unregistered.webapp.tru= e"); + System.getProperties().remove("_ignore.unregistered.webapp.fal= se"); + PropertyManager.refresh(); + } = + } + + try + { + // Unregister the portal container + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml", "disable-pc"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertEquals("myPortal", config.getPortalContainerName("myPortal"= )); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertTrue(config.isPortalContainerName("myPortal")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertTrue(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); names =3D config.getPortalContainerNames("myPortal"); assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal", names.get(0)); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal", config.getPortalContainerName("myPortal"= )); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = + try + { + // Unregister the default portal container + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml", "disable-pc2"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal-pcdef")); - assertEquals("myRest", config.getRestContextName("foo")); - assertEquals("myRest", config.getRestContextName("myPortal")); - assertEquals("myRest-pcdef", config.getRestContextName("myPortal-= pcdef")); - assertEquals("my-exo-domain", config.getRealmName("foo")); - assertEquals("my-exo-domain", config.getRealmName("myPortal")); - assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal= -pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertTrue(config.isPortalContainerName("myPortal")); + assertNull(config.getPortalContainerName("myPortal")); assertTrue(config.isPortalContainerName("myPortal-pcdef")); - // Needed for backward compatibility - assertFalse(config.isScopeValid("foo", "foo")); - if (i < ignoreWebappProfiles.length - 1) - { - // Default behavior - assertTrue(config.isScopeValid("myPortal", "foo")); - assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); = = - } - else - { - // Ignore webapp needed for EXOJCR-795 - assertFalse(config.isScopeValid("myPortal", "foo")); - assertFalse(config.isScopeValid("myPortal-pcdef", "foo")); = = - } - assertTrue(config.isScopeValid("myPortal", "myPortal")); + assertFalse(config.isPortalContainerName("myPortal")); assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef"= )); - assertTrue(config.hasDefinition()); = + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); = + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && names.isEmpty()); + config.disablePortalContainer("myPortal-pcdef"); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertNull(config.getPortalContainerName("myPortal")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("myPortal")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && names.isEmpty()); + config.registerPortalContainerName("myPortal-pcdef"); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertNull(config.getPortalContainerName("myPortal")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("myPortal")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); + assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal", "myPortal")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && names.isEmpty()); } - - // Unregister the portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml", "disable-pc"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertEquals("myPortal", config.getPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertTrue(config.isPortalContainerName("myPortal")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertTrue(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal")); = - // Unregister the default portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml", "disable-pc2"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertNull(config.getPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); = - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && names.isEmpty()); - config.disablePortalContainer("myPortal-pcdef"); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertNull(config.getPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && names.isEmpty()); - config.registerPortalContainerName("myPortal-pcdef"); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertNull(config.getPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal")); - assertFalse(config.isScopeValid("myPortal", "myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal", "myPortal")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && names.isEmpty()); + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = // Without dependencies and with no portal container name rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-empty-portal-def.xml"); @@ -447,181 +526,87 @@ assertTrue(names !=3D null && !names.isEmpty()); assertEquals("myPortal", names.get(0)); = - // Without dependencies and with no rest context name an realm name - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-empty-portal-def2.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getDependencies("foo")); - assertNull(config.getDependencies("myPortal")); - assertNull(config.getDependencies("myPortal-pcdef")); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal", names.get(0)); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal", config.getPortalContainerName("foo")); - assertEquals("myPortal", config.getPortalContainerName("myPortal")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertEquals("myRest", config.getRestContextName("foo")); - assertEquals("myRest", config.getRestContextName("myPortal")); - assertEquals("myRest", config.getRestContextName("myPortal-pcdef")); - assertEquals("my-exo-domain", config.getRealmName("foo")); - assertEquals("my-exo-domain", config.getRealmName("myPortal")); - assertEquals("my-exo-domain", config.getRealmName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertTrue(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - // Needed for backward compatibility - assertFalse(config.isScopeValid("foo", "foo")); - assertTrue(config.isScopeValid("myPortal", "foo")); - assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); - assertTrue(config.isScopeValid("myPortal", "myPortal")); - assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - assertTrue(config.hasDefinition()); - // Unregister the portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-empty-portal-def2.xml", "disable-pc"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); = + try + { + // Without dependencies and with no rest context name an realm na= me + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-empty-portal-def2.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getDependencies("foo")); + assertNull(config.getDependencies("myPortal")); + assertNull(config.getDependencies("myPortal-pcdef")); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal", names.get(0)); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal-pcdef", names.get(0)); + assertEquals("myPortal", config.getPortalContainerName("foo")); + assertEquals("myPortal", config.getPortalContainerName("myPortal"= )); + assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal-pcdef")); + assertEquals("myRest", config.getRestContextName("foo")); + assertEquals("myRest", config.getRestContextName("myPortal")); + assertEquals("myRest", config.getRestContextName("myPortal-pcdef"= )); + assertEquals("my-exo-domain", config.getRealmName("foo")); + assertEquals("my-exo-domain", config.getRealmName("myPortal")); + assertEquals("my-exo-domain", config.getRealmName("myPortal-pcdef= ")); + assertFalse(config.isPortalContainerName("foo")); + assertTrue(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + // Needed for backward compatibility + assertFalse(config.isScopeValid("foo", "foo")); + assertTrue(config.isScopeValid("myPortal", "foo")); + assertTrue(config.isScopeValid("myPortal-pcdef", "foo")); + assertTrue(config.isScopeValid("myPortal", "myPortal")); + assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef"= )); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { + // Unregister the portal container + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-empty-portal-def2.xml", "disable-pc"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef= ")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = = - // Without dependencies and with default portal container definition - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-portal-def-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - deps =3D config.getDependencies("foo"); - assertNull(deps); - deps =3D config.getDependencies("myPortal"); - assertNull(deps); - deps =3D config.getDependencies("myPortal-pcdef"); - assertTrue(deps !=3D null && deps.size() =3D=3D 1 && deps.contains("= fooX")); - names =3D config.getPortalContainerNames("fooX"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(2, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("foo")= ); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("myPor= tal")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertEquals("myRest-dpcdef", config.getRestContextName("foo")); - assertEquals("myRest-dpcdef", config.getRestContextName("myPortal")); - assertEquals("myRest-pcdef", config.getRestContextName("myPortal-pcd= ef")); - assertEquals("my-exo-domain-dpcdef", config.getRealmName("foo")); - assertEquals("my-exo-domain-dpcdef", config.getRealmName("myPortal")= ); - assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal-pc= def")); - assertFalse(config.isPortalContainerName("foo")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-dpcdef")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("foo", "fooX")); - assertFalse(config.isScopeValid("myPortal", "fooX")); - assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); - assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); - assertTrue(config.hasDefinition()); - // Unregister the portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def-with-default-portal-def.xml", "disable-p= c"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("foo")= ); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("myPor= tal")); - assertEquals("myPortal-dpcdef", config.getPortalContainerName("myPor= tal-dpcdef")); - assertNull(config.getPortalContainerName("myPortal-pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertFalse(config.isPortalContainerName("myPortal")); - assertTrue(config.isPortalContainerName("myPortal-dpcdef")); - assertFalse(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("foo", "fooX")); - assertFalse(config.isScopeValid("myPortal", "fooX")); - assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); - assertFalse(config.isScopeValid("myPortal-pcdef", "fooX")); - assertTrue(config.isScopeValid("myPortal-dpcdef", "myPortal-dpcdef")= ); - assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && names.isEmpty()); = - names =3D config.getPortalContainerNames("myPortal-dpcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - names =3D config.getPortalContainerNames("fooX"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); - // Unregister the default portal container - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def-with-default-portal-def.xml", "disable-p= c2"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertEquals("myPortal-pcdef", config.getPortalContainerName("foo")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al")); - assertNull(config.getPortalContainerName("myPortal-dpcdef")); - assertEquals("myPortal-pcdef", config.getPortalContainerName("myPort= al-pcdef")); - assertFalse(config.isPortalContainerName("foo")); - assertFalse(config.isPortalContainerName("myPortal")); - assertFalse(config.isPortalContainerName("myPortal-dpcdef")); - assertTrue(config.isPortalContainerName("myPortal-pcdef")); - assertFalse(config.isScopeValid("foo", "fooX")); - assertFalse(config.isScopeValid("myPortal", "fooX")); - assertFalse(config.isScopeValid("myPortal-dpcdef", "fooX")); - assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); - assertFalse(config.isScopeValid("myPortal-dpcdef", "myPortal-dpcdef"= )); - assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-pcdef"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); - names =3D config.getPortalContainerNames("myPortal-dpcdef"); - assertTrue(names !=3D null && names.isEmpty()); = - names =3D config.getPortalContainerNames("fooX"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); - = - profiles =3D - new String[]{"AddDependencies", "AddDependenciesBefore-No-Target"= , "AddDependenciesBefore-With-Fake-Target", - "AddDependenciesBefore-With-Target", "AddDependenciesAfter-No-= Target", - "AddDependenciesAfter-With-Fake-Target", "AddDependenciesAfter= -With-Target"}; - - for (String profile : profiles) + try { + // Without dependencies and with default portal container definit= ion rootContainer =3D - createRootContainer( - "portal-container-config-with-default-values-and-with-porta= l-def-with-default-portal-def.xml", - "with-profiles", profile); + createRootContainer("portal-container-config-with-default-valu= es-and-with-portal-def-with-default-portal-def.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); deps =3D config.getDependencies("foo"); assertNull(deps); deps =3D config.getDependencies("myPortal"); assertNull(deps); deps =3D config.getDependencies("myPortal-pcdef"); - assertTrue(deps !=3D null && deps.size() =3D=3D 2 && deps.contain= s("fooX") && deps.contains("foo")); - int index =3D deps.indexOf("foo"); - if (profile.equals("AddDependenciesBefore-No-Target") - || profile.equals("AddDependenciesBefore-With-Fake-Target") - || profile.equals("AddDependenciesBefore-With-Target")) - { - assertEquals(0, index); - } - else - { - assertEquals(1, index); - } + assertTrue(deps !=3D null && deps.size() =3D=3D 1 && deps.contain= s("fooX")); names =3D config.getPortalContainerNames("fooX"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals(2, names.size()); @@ -640,7 +625,7 @@ names =3D config.getPortalContainerNames("myPortal-pcdef"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals("myPortal-pcdef", names.get(0)); - assertEquals("myPortal-pcdef", config.getPortalContainerName("foo= ")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName("fo= o")); assertEquals("myPortal-dpcdef", config.getPortalContainerName("my= Portal")); assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal-pcdef")); assertEquals("myRest-dpcdef", config.getRestContextName("foo")); @@ -651,15 +636,24 @@ assertEquals("my-exo-domain-pcdef", config.getRealmName("myPortal= -pcdef")); assertFalse(config.isPortalContainerName("foo")); assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-dpcdef")); assertTrue(config.isPortalContainerName("myPortal-pcdef")); assertFalse(config.isScopeValid("foo", "fooX")); assertFalse(config.isScopeValid("myPortal", "fooX")); + assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { // Unregister the portal container - rootContainer =3D createRootContainer( - "portal-container-config-with-default-values-and-with-portal-d= ef-with-default-portal-def.xml", - "with-profiles", profile, "disable-pc"); + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def-with-default-portal-def.xml", "disabl= e-pc"); config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); assertEquals("myPortal-dpcdef", config.getPortalContainerName("fo= o")); assertEquals("myPortal-dpcdef", config.getPortalContainerName("my= Portal")); @@ -681,18 +675,21 @@ assertTrue(names !=3D null && !names.isEmpty()); assertEquals(1, names.size()); assertTrue(names.contains("myPortal-dpcdef")); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-dpcdef")); names =3D config.getPortalContainerNames("fooX"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals(1, names.size()); assertTrue(names.contains("myPortal-dpcdef")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { // Unregister the default portal container - rootContainer =3D createRootContainer( - "portal-container-config-with-default-values-and-with-portal-d= ef-with-default-portal-def.xml", - "with-profiles", profile, "disable-pc2"); + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def-with-default-portal-def.xml", "disabl= e-pc2"); config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); assertEquals("myPortal-pcdef", config.getPortalContainerName("foo= ")); assertEquals("myPortal-pcdef", config.getPortalContainerName("myP= ortal")); @@ -713,17 +710,177 @@ assertEquals(1, names.size()); assertTrue(names.contains("myPortal-pcdef")); names =3D config.getPortalContainerNames("myPortal-dpcdef"); - assertTrue(names !=3D null && names.isEmpty()); - names =3D config.getPortalContainerNames("foo"); - assertTrue(names !=3D null && !names.isEmpty()); - assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); = + assertTrue(names !=3D null && names.isEmpty()); = names =3D config.getPortalContainerNames("fooX"); assertTrue(names !=3D null && !names.isEmpty()); assertEquals(1, names.size()); - assertTrue(names.contains("myPortal-pcdef")); = + assertTrue(names.contains("myPortal-pcdef")); } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + = + profiles =3D + new String[]{"AddDependencies", "AddDependenciesBefore-No-Target"= , "AddDependenciesBefore-With-Fake-Target", + "AddDependenciesBefore-With-Target", "AddDependenciesAfter-No-= Target", + "AddDependenciesAfter-With-Fake-Target", "AddDependenciesAfter= -With-Target"}; = + for (String profile : profiles) + { + try + { + rootContainer =3D + createRootContainer( + "portal-container-config-with-default-values-and-with-po= rtal-def-with-default-portal-def.xml", + "with-profiles", profile); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + deps =3D config.getDependencies("foo"); + assertNull(deps); + deps =3D config.getDependencies("myPortal"); + assertNull(deps); + deps =3D config.getDependencies("myPortal-pcdef"); + assertTrue(deps !=3D null && deps.size() =3D=3D 2 && deps.cont= ains("fooX") && deps.contains("foo")); + int index =3D deps.indexOf("foo"); + if (profile.equals("AddDependenciesBefore-No-Target") + || profile.equals("AddDependenciesBefore-With-Fake-Target") + || profile.equals("AddDependenciesBefore-With-Target")) + { + assertEquals(0, index); + } + else + { + assertEquals(1, index); + } + names =3D config.getPortalContainerNames("fooX"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(2, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals("myPortal-pcdef", names.get(0)); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= foo")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "myPortal")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal-pcdef")); + assertEquals("myRest-dpcdef", config.getRestContextName("foo")= ); + assertEquals("myRest-dpcdef", config.getRestContextName("myPor= tal")); + assertEquals("myRest-pcdef", config.getRestContextName("myPort= al-pcdef")); + assertEquals("my-exo-domain-dpcdef", config.getRealmName("foo"= )); + assertEquals("my-exo-domain-dpcdef", config.getRealmName("myPo= rtal")); + assertEquals("my-exo-domain-pcdef", config.getRealmName("myPor= tal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("foo", "fooX")); + assertFalse(config.isScopeValid("myPortal", "fooX")); + assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); + assertTrue(config.hasDefinition()); + } + finally + { + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { + // Unregister the portal container + rootContainer =3D createRootContainer( + "portal-container-config-with-default-values-and-with-porta= l-def-with-default-portal-def.xml", + "with-profiles", profile, "disable-pc"); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "foo")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "myPortal")); + assertEquals("myPortal-dpcdef", config.getPortalContainerName(= "myPortal-dpcdef")); + assertNull(config.getPortalContainerName("myPortal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertFalse(config.isPortalContainerName("myPortal")); + assertTrue(config.isPortalContainerName("myPortal-dpcdef")); + assertFalse(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("foo", "fooX")); + assertFalse(config.isScopeValid("myPortal", "fooX")); + assertTrue(config.isScopeValid("myPortal-dpcdef", "fooX")); + assertFalse(config.isScopeValid("myPortal-pcdef", "fooX")); + assertTrue(config.isScopeValid("myPortal-dpcdef", "myPortal-dp= cdef")); + assertFalse(config.isScopeValid("myPortal-pcdef", "myPortal-pc= def")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && names.isEmpty()); = + names =3D config.getPortalContainerNames("myPortal-dpcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + names =3D config.getPortalContainerNames("fooX"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-dpcdef")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } + try + { + // Unregister the default portal container + rootContainer =3D createRootContainer( + "portal-container-config-with-default-values-and-with-porta= l-def-with-default-portal-def.xml", + "with-profiles", profile, "disable-pc2"); + config =3D (PortalContainerConfig)rootContainer.getComponentIn= stanceOfType(PortalContainerConfig.class); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= foo")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal")); + assertNull(config.getPortalContainerName("myPortal-dpcdef")); + assertEquals("myPortal-pcdef", config.getPortalContainerName("= myPortal-pcdef")); + assertFalse(config.isPortalContainerName("foo")); + assertFalse(config.isPortalContainerName("myPortal")); + assertFalse(config.isPortalContainerName("myPortal-dpcdef")); + assertTrue(config.isPortalContainerName("myPortal-pcdef")); + assertFalse(config.isScopeValid("foo", "fooX")); + assertFalse(config.isScopeValid("myPortal", "fooX")); + assertFalse(config.isScopeValid("myPortal-dpcdef", "fooX")); + assertTrue(config.isScopeValid("myPortal-pcdef", "fooX")); + assertFalse(config.isScopeValid("myPortal-dpcdef", "myPortal-d= pcdef")); + assertTrue(config.isScopeValid("myPortal-pcdef", "myPortal-pcd= ef")); + names =3D config.getPortalContainerNames("myPortal-pcdef"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); + names =3D config.getPortalContainerNames("myPortal-dpcdef"); + assertTrue(names !=3D null && names.isEmpty()); + names =3D config.getPortalContainerNames("foo"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); = + names =3D config.getPortalContainerNames("fooX"); + assertTrue(names !=3D null && !names.isEmpty()); + assertEquals(1, names.size()); + assertTrue(names.contains("myPortal-pcdef")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurat= or + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = + } + // With dependencies rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def2.xml"); config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); @@ -1025,76 +1182,109 @@ assertEquals("my-exo-domain", config.getSetting("myPortal-pcdef", Po= rtalContainerConfig.REALM_SETTING_NAME)); = // Without settings, without portal definition and with default port= al container definition - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getSetting("foo", "foo")); - assertNull(config.getSetting("myPortal", "foo")); - assertNull(config.getSetting("myPortal-pcdef", "foo")); - assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalConta= inerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal-dpcdef", config - .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SE= TTING_NAME)); - assertEquals("myPortal-dpcdef", config.getSetting("myPortal-pcdef", - PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("foo", PortalContain= erConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("myPortal", PortalCo= ntainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-dpcdef", config - .getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTEXT_= SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Portal= ContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal", P= ortalContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config - .getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETTING= _NAME)); - assertEquals("value0", config.getSetting("foo", "string")); - assertEquals(new Integer(100), config.getSetting("foo", "int")); - assertEquals(new Long(100), config.getSetting("foo", "long")); - assertEquals(new Double(100), config.getSetting("foo", "double")); - assertEquals(new Boolean(false), config.getSetting("foo", "boolean")= ); - assertEquals("value0", config.getSetting("myPortal", "string")); - assertEquals(new Integer(100), config.getSetting("myPortal", "int")); - assertEquals(new Long(100), config.getSetting("myPortal", "long")); - assertEquals(new Double(100), config.getSetting("myPortal", "double"= )); - assertEquals(new Boolean(false), config.getSetting("myPortal", "bool= ean")); - assertEquals("value0", config.getSetting("myPortal-pcdef", "string")= ); - assertEquals(new Integer(100), config.getSetting("myPortal-pcdef", "= int")); - assertEquals(new Long(100), config.getSetting("myPortal-pcdef", "lon= g")); - assertEquals(new Double(100), config.getSetting("myPortal-pcdef", "d= ouble")); - assertEquals(new Boolean(false), config.getSetting("myPortal-pcdef",= "boolean")); + try + { + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getSetting("foo", "foo")); + assertNull(config.getSetting("myPortal", "foo")); + assertNull(config.getSetting("myPortal-pcdef", "foo")); + assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalCo= ntainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal-dpcdef", config + .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER= _SETTING_NAME)); + assertEquals("myPortal-dpcdef", config.getSetting("myPortal-pcdef= ", + PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("foo", PortalCont= ainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("myPortal", Porta= lContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-dpcdef", config + .getSetting("myPortal-pcdef", PortalContainerConfig.REST_CONTE= XT_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Por= talContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal"= , PortalContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config + .getSetting("myPortal-pcdef", PortalContainerConfig.REALM_SETT= ING_NAME)); + assertEquals("value0", config.getSetting("foo", "string")); + assertEquals(new Integer(100), config.getSetting("foo", "int")); + assertEquals(new Long(100), config.getSetting("foo", "long")); + assertEquals(new Double(100), config.getSetting("foo", "double")); + assertEquals(new Boolean(false), config.getSetting("foo", "boolea= n")); + assertEquals("value0", config.getSetting("myPortal", "string")); + assertEquals(new Integer(100), config.getSetting("myPortal", "int= ")); + assertEquals(new Long(100), config.getSetting("myPortal", "long")= ); + assertEquals(new Double(100), config.getSetting("myPortal", "doub= le")); + assertEquals(new Boolean(false), config.getSetting("myPortal", "b= oolean")); + assertEquals("value0", config.getSetting("myPortal-pcdef", "strin= g")); + assertEquals(new Integer(100), config.getSetting("myPortal-pcdef"= , "int")); + assertEquals(new Long(100), config.getSetting("myPortal-pcdef", "= long")); + assertEquals(new Double(100), config.getSetting("myPortal-pcdef",= "double")); + assertEquals(new Boolean(false), config.getSetting("myPortal-pcde= f", "boolean")); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + System.getProperties().remove("_rest.context"); + System.getProperties().remove("_realm.name"); + PropertyManager.refresh(); + } = - // Without settings and with portal definition - rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getSetting("foo", "foo")); - assertNull(config.getSetting("myPortal", "foo")); - assertNull(config.getSetting("myPortal-pcdef", "foo")); - assertEquals("myPortal", config.getSetting("foo", PortalContainerCon= fig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal", config.getSetting("myPortal", PortalContain= erConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", - PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myRest", config.getSetting("foo", PortalContainerConfi= g.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest", config.getSetting("myPortal", PortalContainer= Config.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", Por= talContainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("my-exo-domain", config.getSetting("foo", PortalContain= erConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain", config.getSetting("myPortal", PortalCo= ntainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcde= f", PortalContainerConfig.REALM_SETTING_NAME)); + try + { + // Without settings and with portal definition + rootContainer =3D createRootContainer("portal-container-config-wi= th-default-values-and-with-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getSetting("foo", "foo")); + assertNull(config.getSetting("myPortal", "foo")); + assertNull(config.getSetting("myPortal-pcdef", "foo")); + assertEquals("myPortal", config.getSetting("foo", PortalContainer= Config.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal", config.getSetting("myPortal", PortalCont= ainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", + PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myRest", config.getSetting("foo", PortalContainerCo= nfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest", config.getSetting("myPortal", PortalContai= nerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", = PortalContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("my-exo-domain", config.getSetting("foo", PortalCont= ainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain", config.getSetting("myPortal", Porta= lContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-p= cdef", PortalContainerConfig.REALM_SETTING_NAME)); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_ignore.unregistered.webapp.true"); + System.getProperties().remove("_ignore.unregistered.webapp.false"= ); + PropertyManager.refresh(); + } = - // Without settings, with portal definition and with default portal = definition - rootContainer =3D - createRootContainer("portal-container-config-with-default-values-= and-with-portal-def-with-default-portal-def.xml"); - config =3D (PortalContainerConfig)rootContainer.getComponentInstance= OfType(PortalContainerConfig.class); - assertNull(config.getSetting("foo", "foo")); - assertNull(config.getSetting("myPortal", "foo")); - assertNull(config.getSetting("myPortal-pcdef", "foo")); - assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalConta= inerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myPortal-dpcdef", config - .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER_SE= TTING_NAME)); - assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", - PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("foo", PortalContain= erConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-dpcdef", config.getSetting("myPortal", PortalCo= ntainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", Por= talContainerConfig.REST_CONTEXT_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Portal= ContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal", P= ortalContainerConfig.REALM_SETTING_NAME)); - assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-pcde= f", PortalContainerConfig.REALM_SETTING_NAME)); + try + { + // Without settings, with portal definition and with default port= al definition + rootContainer =3D + createRootContainer("portal-container-config-with-default-valu= es-and-with-portal-def-with-default-portal-def.xml"); + config =3D (PortalContainerConfig)rootContainer.getComponentInsta= nceOfType(PortalContainerConfig.class); + assertNull(config.getSetting("foo", "foo")); + assertNull(config.getSetting("myPortal", "foo")); + assertNull(config.getSetting("myPortal-pcdef", "foo")); + assertEquals("myPortal-dpcdef", config.getSetting("foo", PortalCo= ntainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myPortal-dpcdef", config + .getSetting("myPortal", PortalContainerConfig.PORTAL_CONTAINER= _SETTING_NAME)); + assertEquals("myPortal-pcdef", config.getSetting("myPortal-pcdef", + PortalContainerConfig.PORTAL_CONTAINER_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("foo", PortalCont= ainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-dpcdef", config.getSetting("myPortal", Porta= lContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("myRest-pcdef", config.getSetting("myPortal-pcdef", = PortalContainerConfig.REST_CONTEXT_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("foo", Por= talContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-dpcdef", config.getSetting("myPortal"= , PortalContainerConfig.REALM_SETTING_NAME)); + assertEquals("my-exo-domain-pcdef", config.getSetting("myPortal-p= cdef", PortalContainerConfig.REALM_SETTING_NAME)); + } + finally + { + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_portal.container"); + PropertyManager.refresh(); + } = // With internal settings rootContainer =3D createRootContainer("portal-container-config-with-= default-values-and-with-settings.xml"); @@ -1480,6 +1670,14 @@ { System.getProperties().remove("TestPortalContainerConfig-string"); System.getProperties().remove("TestPortalContainerConfig-int"); + // Clear the System Properties added by the PropertyConfigurator + System.getProperties().remove("_default.portal.container"); + System.getProperties().remove("_default.rest.context"); + System.getProperties().remove("_default.realm.name"); + System.getProperties().remove("_portal.container"); + System.getProperties().remove("_rest.context"); + System.getProperties().remove("_realm.name"); + PropertyManager.refresh(); } = // With both settings internal and external, and with invalid values = Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatf= orm/container/definition/portal-container-config-with-default-values-and-wi= th-both-settings-with-default-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-bot= h-settings-with-default-portal-def.xml 2010-10-21 09:33:22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-bot= h-settings-with-default-portal-def.xml 2010-10-21 09:40:08 UTC (rev 3309) @@ -16,17 +16,17 @@ default.portal.container - myPortal + ${_default.portal.container} default.rest.context - myRest + ${_default.rest.context} default.realm.name - my-exo-domain + ${_default.realm.name} @@ -142,6 +142,12 @@ properties + + + + + + @@ -161,15 +167,15 @@ - myPortal-pcdef + ${_portal.container} - myRest-pcdef + ${_rest.context} - my-exo-domain-pcdef + ${_realm.name} Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatf= orm/container/definition/portal-container-config-with-default-values-and-wi= th-default-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-def= ault-portal-def.xml 2010-10-21 09:33:22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-def= ault-portal-def.xml 2010-10-21 09:40:08 UTC (rev 3309) @@ -16,17 +16,17 @@ default.portal.container - myPortal + ${_default.portal.container} default.rest.context - myRest + ${_default.rest.context} default.realm.name - my-exo-domain + ${_default.realm.name} @@ -37,19 +37,19 @@ - myPortal-dpcdef + ${_portal.container} - myRest-dpcdef + ${_rest.context} - my-exo-domain-dpcdef + ${_realm.name} @@ -100,4 +100,19 @@ + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + + + + + + = \ No newline at end of file Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatf= orm/container/definition/portal-container-config-with-default-values-and-wi= th-empty-portal-def2.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-emp= ty-portal-def2.xml 2010-10-21 09:33:22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-emp= ty-portal-def2.xml 2010-10-21 09:40:08 UTC (rev 3309) @@ -16,20 +16,33 @@ default.portal.container - myPortal + ${_default.portal.container} default.rest.context - myRest + ${_default.rest.context} default.realm.name - my-exo-domain + ${_default.realm.name} + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig @@ -46,7 +59,7 @@ - myPortal-pcdef + ${_portal.container} @@ -67,7 +80,7 @@ names - myPortal-pcdef + ${_portal.container} Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatf= orm/container/definition/portal-container-config-with-default-values-and-wi= th-portal-def-with-default-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-por= tal-def-with-default-portal-def.xml 2010-10-21 09:33:22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-por= tal-def-with-default-portal-def.xml 2010-10-21 09:40:08 UTC (rev 3309) @@ -62,6 +62,16 @@ + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig @@ -78,7 +88,7 @@ - myPortal-pcdef + ${_portal.container} @@ -107,7 +117,7 @@ apply.specific fake - myPortal-pcdef + ${_portal.container} change @@ -233,7 +243,7 @@ names - myPortal-pcdef + ${_portal.container} Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatf= orm/container/definition/portal-container-config-with-default-values-and-wi= th-portal-def.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-por= tal-def.xml 2010-10-21 09:33:22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-default-values-and-with-por= tal-def.xml 2010-10-21 09:40:08 UTC (rev 3309) @@ -31,14 +31,25 @@ ignore.unregistered.webapp - false + ${_ignore.unregistered.webapp.false} ignore.unregistered.webapp - true + ${_ignore.unregistered.webapp.true} + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig Modified: kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatf= orm/container/definition/portal-container-config-with-no-default-values-but= -with-portal-defs.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-no-default-values-but-with-= portal-defs.xml 2010-10-21 09:33:22 UTC (rev 3308) +++ kernel/trunk/exo.kernel.container/src/test/resources/org/exoplatform/co= ntainer/definition/portal-container-config-with-no-default-values-but-with-= portal-defs.xml 2010-10-21 09:40:08 UTC (rev 3309) @@ -12,6 +12,16 @@ org.exoplatform.container.definition.PortalContainerConfig + + PropertyManagerConfigurator + org.exoplatform.container.PropertyConfigurator + + + properties + + + + = org.exoplatform.container.definition.PortalContainerCo= nfig @@ -69,7 +79,7 @@ apply.all - true + ${_value.true} change1 @@ -92,7 +102,7 @@ apply.default - true + ${_value.true} change2 @@ -139,7 +149,7 @@ apply.default - true + ${_value.true} = apply.specific --===============8036728581934992938==-- From do-not-reply at jboss.org Thu Oct 21 08:19:27 2010 Content-Type: multipart/mixed; boundary="===============0125295382124095707==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3310 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core and 5 other directories. Date: Thu, 21 Oct 2010 08:19:26 -0400 Message-ID: <201010211219.o9LCJQ97015250@svn01.web.mwc.hst.phx2.redhat.com> --===============0125295382124095707== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-21 08:19:25 -0400 (Thu, 21 Oct 2010) New Revision: 3310 Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/FileCleanerHolder.java Removed: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/WorkspaceFileCleanerHolder.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/RepositoryContainer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/value/ValueFactoryImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/StandaloneStoragePluginProvider.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/impl/storage/JDBCWDCTest.java Log: EXOJCR-999: WorkspaceFileCleanerHolder renamed to FileCleanerHolder Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-21 09:40:08 UTC (rev 3309) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-21 12:19:25 UTC (rev 3310) @@ -58,7 +58,7 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; import org.exoplatform.services.jcr.impl.storage.value.StandaloneStoragePl= uginProvider; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; @@ -515,7 +515,7 @@ registerComponentInstance(config); // WorkspaceFileCleanerHolder - is a common holder for all workspace= s. = // It is used to initialize FileValueStorage - registerComponentImplementation(WorkspaceFileCleanerHolder.class); + registerComponentImplementation(FileCleanerHolder.class); registerWorkspacesComponents(); registerRepositoryComponents(); } 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 2010-10-21 09:40:08 UTC (rev 3309) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionImpl.java 2010-10-21 12:19:25 UTC (rev 3310) @@ -43,7 +43,7 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspac= eDataManagerStub; import org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog; import org.exoplatform.services.jcr.impl.ext.action.SessionActionIntercept= or; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.impl.xml.ExportImportFactory; import org.exoplatform.services.jcr.impl.xml.ItemDataKeeperAdapter; import org.exoplatform.services.jcr.impl.xml.XmlMapping; @@ -170,8 +170,8 @@ this.lazyReadThreshold =3D wsConfig.getLazyReadThreshold() > 0 ? wsConfig.getLazyReadThresho= ld() : DEFAULT_LAZY_READ_THRESHOLD; = - WorkspaceFileCleanerHolder cleanerHolder =3D - (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(= WorkspaceFileCleanerHolder.class); + FileCleanerHolder cleanerHolder =3D + (FileCleanerHolder)container.getComponentInstanceOfType(FileClean= erHolder.class); = this.locationFactory =3D new LocationFactory(this); this.valueFactory =3D new ValueFactoryImpl(locationFactory, wsConfig= , cleanerHolder); @@ -253,8 +253,8 @@ = WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentIn= stanceOfType(WorkspaceEntry.class); = - WorkspaceFileCleanerHolder cleanerHolder =3D - (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(= WorkspaceFileCleanerHolder.class); + FileCleanerHolder cleanerHolder =3D + (FileCleanerHolder)container.getComponentInstanceOfType(FileClean= erHolder.class); = ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory, = wsConfig, cleanerHolder); = @@ -294,8 +294,8 @@ = WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentIn= stanceOfType(WorkspaceEntry.class); = - WorkspaceFileCleanerHolder cleanerHolder =3D - (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(= WorkspaceFileCleanerHolder.class); + FileCleanerHolder cleanerHolder =3D + (FileCleanerHolder)container.getComponentInstanceOfType(FileClean= erHolder.class); = ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory, = wsConfig, cleanerHolder); = @@ -338,8 +338,8 @@ = WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentIn= stanceOfType(WorkspaceEntry.class); = - WorkspaceFileCleanerHolder cleanerHolder =3D - (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(= WorkspaceFileCleanerHolder.class); + FileCleanerHolder cleanerHolder =3D + (FileCleanerHolder)container.getComponentInstanceOfType(FileClean= erHolder.class); = ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory, = wsConfig, cleanerHolder); = @@ -380,8 +380,8 @@ = WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentIn= stanceOfType(WorkspaceEntry.class); = - WorkspaceFileCleanerHolder cleanerHolder =3D - (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(= WorkspaceFileCleanerHolder.class); + FileCleanerHolder cleanerHolder =3D + (FileCleanerHolder)container.getComponentInstanceOfType(FileClean= erHolder.class); = ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory, = wsConfig, cleanerHolder); try @@ -418,8 +418,8 @@ = WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentIn= stanceOfType(WorkspaceEntry.class); = - WorkspaceFileCleanerHolder cleanerHolder =3D - (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType(= WorkspaceFileCleanerHolder.class); + FileCleanerHolder cleanerHolder =3D + (FileCleanerHolder)container.getComponentInstanceOfType(FileClean= erHolder.class); = ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory, = wsConfig, cleanerHolder); try Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/value/ValueFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/ValueFactoryImpl.java 2010-10-21 09:40:08 UTC (rev 330= 9) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/value/ValueFactoryImpl.java 2010-10-21 12:19:25 UTC (rev 331= 0) @@ -31,7 +31,7 @@ import org.exoplatform.services.jcr.impl.util.JCRDateFormat; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -72,7 +72,7 @@ private int maxBufferSize; = public ValueFactoryImpl(LocationFactory locationFactory, WorkspaceEntry= workspaceConfig, - WorkspaceFileCleanerHolder cleanerHolder) + FileCleanerHolder cleanerHolder) { = this.locationFactory =3D locationFactory; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/StandaloneStoragePluginProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/StandaloneStoragePluginProvider.java 2010-10-21 09:= 40:08 UTC (rev 3309) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2010-10-21 12:= 19:25 UTC (rev 3310) @@ -25,7 +25,7 @@ import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueIOChannel; import org.exoplatform.services.jcr.storage.value.ValuePluginFilter; @@ -62,7 +62,7 @@ */ private final ValueDataResourceHolder resorcesHolder; = - public StandaloneStoragePluginProvider(WorkspaceEntry wsConfig, Workspa= ceFileCleanerHolder holder) + public StandaloneStoragePluginProvider(WorkspaceEntry wsConfig, FileCle= anerHolder holder) throws RepositoryConfigurationException, IOException { = Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/util/io/FileCleanerHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/FileCleanerHolder.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/FileCleanerHolder.java 2010-10-21 12:19:25 UTC (rev 3310) @@ -0,0 +1,43 @@ +/* + * 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.util.io; + +/** + * Created by The eXo Platform SAS.
    per workspace container file cle= aner holder object + * = + * @author Gennady Azarenkov + * @version $Id: WorkspaceFileCleanerHolder.java 11907 2008-03-13 15:36:21= Z ksm $ + */ + +public class FileCleanerHolder +{ + + private final FileCleaner fileCleaner; + + public FileCleanerHolder() + { + this.fileCleaner =3D new FileCleaner(); + } + + public FileCleaner getFileCleaner() + { + return fileCleaner; + } + +} Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser= vices/jcr/impl/util/io/WorkspaceFileCleanerHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/WorkspaceFileCleanerHolder.java 2010-10-21 09:40:08 UTC (= rev 3309) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/WorkspaceFileCleanerHolder.java 2010-10-21 12:19:25 UTC (= rev 3310) @@ -1,43 +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.util.io; - -/** - * Created by The eXo Platform SAS.
    per workspace container file cle= aner holder object - * = - * @author Gennady Azarenkov - * @version $Id: WorkspaceFileCleanerHolder.java 11907 2008-03-13 15:36:21= Z ksm $ - */ - -public class WorkspaceFileCleanerHolder -{ - - private final FileCleaner fileCleaner; - - public WorkspaceFileCleanerHolder() - { - this.fileCleaner =3D new FileCleaner(); - } - - public FileCleaner getFileCleaner() - { - return fileCleaner; - } - -} 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 2010-10-21 09:40:08 UTC (rev 3309) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/BaseStandaloneTest.java 2010-10-21 12:19:25 UTC (rev 3310) @@ -30,7 +30,7 @@ import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpoo= lFileHolder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -153,8 +153,8 @@ wconf.getContainer().getParameterInteger(WorkspaceDataContainer.M= AXBUFFERSIZE_PROP, WorkspaceDataContainer.DEF_MAXBUFFERSIZE); = - WorkspaceFileCleanerHolder wfcleaner =3D - (WorkspaceFileCleanerHolder)wsc.getComponent(WorkspaceFileCleaner= Holder.class); + FileCleanerHolder wfcleaner =3D + (FileCleanerHolder)wsc.getComponent(FileCleanerHolder.class); fileCleaner =3D wfcleaner.getFileCleaner(); holder =3D new ReaderSpoolFileHolder(); } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWDCTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/JDBCWDCTest.java 2010-10-21 09:40:08 UTC (rev 3309) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/JDBCWDCTest.java 2010-10-21 12:19:25 UTC (rev 3310) @@ -46,7 +46,7 @@ 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.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -106,7 +106,7 @@ // SimpleJNDIContextInitializer.initialize(sourceName, ref); = container =3D - new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config, new WorkspaceFileCleanerHolder())); + new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config, new FileCleanerHolder())); = Properties logProps =3D new Properties(); logProps.put("org.apache.commons.logging.simplelog.defaultlog", "deb= ug"); --===============0125295382124095707==-- From do-not-reply at jboss.org Thu Oct 21 08:27:21 2010 Content-Type: multipart/mixed; boundary="===============6488074620157729292==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3311 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Thu, 21 Oct 2010 08:27:21 -0400 Message-ID: <201010211227.o9LCRL7S015509@svn01.web.mwc.hst.phx2.redhat.com> --===============6488074620157729292== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-21 08:27:21 -0400 (Thu, 21 Oct 2010) New Revision: 3311 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java Log: EXOJCR-965: fixed feature in case cache is disabled at the beginning and en= abled later 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 2010-10-21= 12:19:25 UTC (rev 3310) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2010-10-21= 12:27:21 UTC (rev 3311) @@ -27,6 +27,7 @@ import javax.transaction.TransactionManager; = import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; +import org.exoplatform.services.jcr.dataflow.persistent.MandatoryItemsPers= istenceListener; import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCa= che; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.ItemType; @@ -275,6 +276,32 @@ } = /** + * This class is a decorator on the top of the {@link WorkspaceStorageCa= che} to manage the case + * where the cache is disabled at the beginning then potentially enabled= later + */ + private class CacheItemsPersistenceListener implements MandatoryItemsPe= rsistenceListener + { + /** + * {@inheritDoc} + */ + public boolean isTXAware() + { + return cache.isTXAware(); + } + + /** + * {@inheritDoc} + */ + public void onSaveItems(ItemStateChangesLog itemStates) + { + if (cache.isEnabled()) + { + cache.onSaveItems(itemStates); + } + } + } + + /** * CacheableWorkspaceDataManager constructor. * = * @param dataContainer @@ -292,7 +319,7 @@ this.cache =3D cache; = this.requestCache =3D new ConcurrentHashMap(); - addItemPersistenceListener(cache); + addItemPersistenceListener(new CacheItemsPersistenceListener()); = transactionManager =3D transactionService.getTransactionManager(); } @@ -314,7 +341,7 @@ this.cache =3D cache; = this.requestCache =3D new ConcurrentHashMap(); - addItemPersistenceListener(cache); + addItemPersistenceListener(new CacheItemsPersistenceListener()); = if (cache instanceof JBossCacheWorkspaceStorageCache) { @@ -542,7 +569,7 @@ protected ItemData getCachedItemData(NodeData parentData, QPathEntry na= me, ItemType itemType) throws RepositoryException { - return cache.get(parentData.getIdentifier(), name, itemType); + return cache.isEnabled() ? cache.get(parentData.getIdentifier(), nam= e, itemType) : null; } = /** @@ -556,7 +583,7 @@ */ protected ItemData getCachedItemData(String identifier) throws Reposito= ryException { - return cache.get(identifier); + return cache.isEnabled() ? cache.get(identifier) : null; } = /** --===============6488074620157729292==-- From do-not-reply at jboss.org Thu Oct 21 09:20:34 2010 Content-Type: multipart/mixed; boundary="===============9054962704618684480==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3312 - in jcr/trunk/exo.jcr.component.ext/src: test/java/org/exoplatform/services/jcr/ext and 1 other directory. Date: Thu, 21 Oct 2010 09:20:34 -0400 Message-ID: <201010211320.o9LDKYoZ024168@svn01.web.mwc.hst.phx2.redhat.com> --===============9054962704618684480== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-21 09:20:34 -0400 (Thu, 21 Oct 2010) New Revision: 3312 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/replication/ReplicationService.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/BaseStandaloneTest.java Log: EXOJCR-999: WorkspaceFileCleanerHolder renamed to FileCleanerHolder Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/replication/ReplicationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/replication/ReplicationService.java 2010-10-21 12:27:21 UTC (rev 33= 11) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/replication/ReplicationService.java 2010-10-21 13:20:34 UTC (rev 33= 12) @@ -43,7 +43,7 @@ import org.exoplatform.services.jcr.impl.core.RepositoryImpl; import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpoo= lFileHolder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; @@ -398,8 +398,8 @@ wconf.getContainer().getParameterInteger(Workspace= DataContainer.MAXBUFFERSIZE_PROP, WorkspaceDataContainer.DEF_MAXBUFFERSIZE); = - WorkspaceFileCleanerHolder wfcleaner =3D - (WorkspaceFileCleanerHolder)wsFacade.getComponent(= WorkspaceFileCleanerHolder.class); + FileCleanerHolder wfcleaner =3D + (FileCleanerHolder)wsFacade.getComponent(FileClean= erHolder.class); FileCleaner fileCleaner =3D wfcleaner.getFileCleaner(= ); = // create the RecoveryManager 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 2010-10-21 12:27:21 UTC (rev 3311) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/BaseStandaloneTest.java 2010-10-21 13:20:34 UTC (rev 3312) @@ -36,7 +36,7 @@ import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpoo= lFileHolder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHolde= r; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -139,8 +139,8 @@ wconf.getContainer().getParameterInteger(WorkspaceDataContainer.M= AXBUFFERSIZE_PROP, WorkspaceDataContainer.DEF_MAXBUFFERSIZE); = - WorkspaceFileCleanerHolder wfcleaner =3D - (WorkspaceFileCleanerHolder)wsc.getComponent(WorkspaceFileCleaner= Holder.class); + FileCleanerHolder wfcleaner =3D + (FileCleanerHolder)wsc.getComponent(FileCleanerHolder.class); fileCleaner =3D wfcleaner.getFileCleaner(); holder =3D new ReaderSpoolFileHolder(); = --===============9054962704618684480==-- From do-not-reply at jboss.org Thu Oct 21 09:42:29 2010 Content-Type: multipart/mixed; boundary="===============1398351287223512077==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3313 - in kernel/branches/2.2.5-GA_REL: exo.kernel.commons and 12 other directories. Date: Thu, 21 Oct 2010 09:42:28 -0400 Message-ID: <201010211342.o9LDgSES024853@svn01.web.mwc.hst.phx2.redhat.com> --===============1398351287223512077== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 09:42:27 -0400 (Thu, 21 Oct 2010) New Revision: 3313 Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.commons/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.cache/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.command/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.common/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.jboss.v= 3/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.remote/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.container/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-int= -demo/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-int= -tests/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-int= /pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-ker= nel-extras/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml kernel/branches/2.2.5-GA_REL/packaging/module/pom.xml kernel/branches/2.2.5-GA_REL/pom.xml Log: [maven-release-plugin] [EXOJCR-XXX]prepare release 2.2.5-GA Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.commons/pom.xml 2010-10-21 13:2= 0:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.commons/pom.xml 2010-10-21 13:4= 2:27 UTC (rev 3313) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.commons Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.cache/pom.xml 2010-10= -21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.cache/pom.xml 2010-10= -21 13:42:27 UTC (rev 3313) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.component.cache Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.command/pom.xml 2010-= 10-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.command/pom.xml 2010-= 10-21 13:42:27 UTC (rev 3313) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.component.command Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.common/pom.xml 2010-1= 0-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.common/pom.xml 2010-1= 0-21 13:42:27 UTC (rev 3313) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.component.common Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.= jboss.v3/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.jboss.= v3/pom.xml 2010-10-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.jboss.= v3/pom.xml 2010-10-21 13:42:27 UTC (rev 3313) @@ -23,7 +23,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA exo.kernel.component.ext.cache.impl.jboss.v3 eXo Kernel :: Cache Extension :: JBoss Cache Implementation Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.remote/pom.xml 2010-1= 0-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.remote/pom.xml 2010-1= 0-21 13:42:27 UTC (rev 3313) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.component.remote Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.container/pom.xml 2010-10-21 13= :20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.container/pom.xml 2010-10-21 13= :42:27 UTC (rev 3313) @@ -12,7 +12,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA exo.kernel.container eXo Kernel :: Container Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t/pom.xml 2010-10-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t/pom.xml 2010-10-21 13:42:27 UTC (rev 3313) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.mc-int Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel= .mc-int-demo/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-demo/pom.xml 2010-10-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-demo/pom.xml 2010-10-21 13:42:27 UTC (rev 3313) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.mc-int-demo Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel= .mc-int-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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-tests/pom.xml 2010-10-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-tests/pom.xml 2010-10-21 13:42:27 UTC (rev 3313) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.mc-int-tests Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-ke= rnel-extras/pom.xml 2010-10-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-ke= rnel-extras/pom.xml 2010-10-21 13:42:27 UTC (rev 3313) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = exo.kernel.mc-kernel-extras Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml 2010-10-= 21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml 2010-10-= 21 13:42:27 UTC (rev 3313) @@ -6,7 +6,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = mc-integration-parent Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/packaging/module/pom.xml 2010-10-21 13:20:= 34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/packaging/module/pom.xml 2010-10-21 13:42:= 27 UTC (rev 3313) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = 4.0.0 Modified: kernel/branches/2.2.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/pom.xml 2010-10-21 13:20:34 UTC (rev 3312) +++ kernel/branches/2.2.5-GA_REL/pom.xml 2010-10-21 13:42:27 UTC (rev 3313) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.5-GA-SNAPSHOT + 2.2.5-GA pom = eXo Kernel @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/br= anches/2.2.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/branches/2.2.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/kernel/branches/2.2.5-G= A_REL + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.5-GA + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.5-GA + http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.5-GA = --===============1398351287223512077==-- From do-not-reply at jboss.org Thu Oct 21 09:42:55 2010 Content-Type: multipart/mixed; boundary="===============8573489491315499057==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3314 - kernel/tags. Date: Thu, 21 Oct 2010 09:42:54 -0400 Message-ID: <201010211342.o9LDgsd4024863@svn01.web.mwc.hst.phx2.redhat.com> --===============8573489491315499057== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 09:42:54 -0400 (Thu, 21 Oct 2010) New Revision: 3314 Added: kernel/tags/2.2.5-GA/ Log: [maven-release-plugin] [EXOJCR-XXX] copy for tag 2.2.5-GA Copied: kernel/tags/2.2.5-GA (from rev 3313, kernel/branches/2.2.5-GA_REL) --===============8573489491315499057==-- From do-not-reply at jboss.org Thu Oct 21 09:43:25 2010 Content-Type: multipart/mixed; boundary="===============8479016691661307758==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3315 - in kernel/branches/2.2.5-GA_REL: exo.kernel.commons and 12 other directories. Date: Thu, 21 Oct 2010 09:43:25 -0400 Message-ID: <201010211343.o9LDhPs1024877@svn01.web.mwc.hst.phx2.redhat.com> --===============8479016691661307758== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 09:43:24 -0400 (Thu, 21 Oct 2010) New Revision: 3315 Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.commons/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.cache/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.command/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.common/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.jboss.v= 3/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.component.remote/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.container/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-int= -demo/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-int= -tests/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-int= /pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-ker= nel-extras/pom.xml kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml kernel/branches/2.2.5-GA_REL/packaging/module/pom.xml kernel/branches/2.2.5-GA_REL/pom.xml Log: [maven-release-plugin] [EXOJCR-XXX]prepare for next development iteration Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.commons/pom.xml 2010-10-21 13:4= 2:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.commons/pom.xml 2010-10-21 13:4= 3:24 UTC (rev 3315) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.commons Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.cache/pom.xml 2010-10= -21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.cache/pom.xml 2010-10= -21 13:43:24 UTC (rev 3315) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.component.cache Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.command/pom.xml 2010-= 10-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.command/pom.xml 2010-= 10-21 13:43:24 UTC (rev 3315) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.component.command Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.common/pom.xml 2010-1= 0-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.common/pom.xml 2010-1= 0-21 13:43:24 UTC (rev 3315) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.component.common Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.= jboss.v3/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.jboss.= v3/pom.xml 2010-10-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.ext.cache.impl.jboss.= v3/pom.xml 2010-10-21 13:43:24 UTC (rev 3315) @@ -23,7 +23,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT exo.kernel.component.ext.cache.impl.jboss.v3 eXo Kernel :: Cache Extension :: JBoss Cache Implementation Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.component.remote/pom.xml 2010-1= 0-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.component.remote/pom.xml 2010-1= 0-21 13:43:24 UTC (rev 3315) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.component.remote Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/exo.kernel.container/pom.xml 2010-10-21 13= :42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.container/pom.xml 2010-10-21 13= :43:24 UTC (rev 3315) @@ -12,7 +12,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT exo.kernel.container eXo Kernel :: Container Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t/pom.xml 2010-10-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t/pom.xml 2010-10-21 13:43:24 UTC (rev 3315) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-int Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel= .mc-int-demo/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-demo/pom.xml 2010-10-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-demo/pom.xml 2010-10-21 13:43:24 UTC (rev 3315) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-int-demo Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel= .mc-int-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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-tests/pom.xml 2010-10-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-in= t-tests/pom.xml 2010-10-21 13:43:24 UTC (rev 3315) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-int-tests Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/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/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-ke= rnel-extras/pom.xml 2010-10-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/exo.kernel.mc-ke= rnel-extras/pom.xml 2010-10-21 13:43:24 UTC (rev 3315) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = exo.kernel.mc-kernel-extras Modified: kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml 2010-10-= 21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/exo.kernel.mc-integration/pom.xml 2010-10-= 21 13:43:24 UTC (rev 3315) @@ -6,7 +6,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = mc-integration-parent Modified: kernel/branches/2.2.5-GA_REL/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/2.2.5-GA_REL/packaging/module/pom.xml 2010-10-21 13:42:= 54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/packaging/module/pom.xml 2010-10-21 13:43:= 24 UTC (rev 3315) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = 4.0.0 Modified: kernel/branches/2.2.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA_REL/pom.xml 2010-10-21 13:42:54 UTC (rev 3314) +++ kernel/branches/2.2.5-GA_REL/pom.xml 2010-10-21 13:43:24 UTC (rev 3315) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-SNAPSHOT pom = eXo Kernel @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.2.5-GA - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.2.5-GA - http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.2.5-GA + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/br= anches/2.2.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/branches/2.2.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/kernel/branches/2.2.5-G= A_REL = --===============8479016691661307758==-- From do-not-reply at jboss.org Thu Oct 21 10:00:01 2010 Content-Type: multipart/mixed; boundary="===============1298775270869927747==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3316 - core/branches/2.3.5-GA_REL. Date: Thu, 21 Oct 2010 10:00:01 -0400 Message-ID: <201010211400.o9LE01J7025946@svn01.web.mwc.hst.phx2.redhat.com> --===============1298775270869927747== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 10:00:01 -0400 (Thu, 21 Oct 2010) New Revision: 3316 Modified: core/branches/2.3.5-GA_REL/pom.xml Log: [EXOJCR-XXX] Upgrade dependencies to latest releases Modified: core/branches/2.3.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/pom.xml 2010-10-21 13:43:24 UTC (rev 3315) +++ core/branches/2.3.5-GA_REL/pom.xml 2010-10-21 14:00:01 UTC (rev 3316) @@ -39,7 +39,7 @@ 2.3 = 1.2.1-GA - 2.2.5-GA-SNAPSHOT + 2.2.5-GA = --===============1298775270869927747==-- From do-not-reply at jboss.org Thu Oct 21 10:01:40 2010 Content-Type: multipart/mixed; boundary="===============6628533081474831170==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3317 - in core/branches/2.3.5-GA_REL: exo.core.component.database and 10 other directories. Date: Thu, 21 Oct 2010 10:01:40 -0400 Message-ID: <201010211401.o9LE1eto026210@svn01.web.mwc.hst.phx2.redhat.com> --===============6628533081474831170== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 10:01:39 -0400 (Thu, 21 Oct 2010) New Revision: 3317 Modified: core/branches/2.3.5-GA_REL/exo.core.component.database/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.document/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.ldap/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.organization.api/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.security.core/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.web.css/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.xml-processing/pom.xml core/branches/2.3.5-GA_REL/packaging/module/pom.xml core/branches/2.3.5-GA_REL/pom.xml Log: [maven-release-plugin] [EXOJCR-XXX]prepare release 2.3.5-GA Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.database/pom.xml 2010-10-= 21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.database/pom.xml 2010-10-= 21 14:01:39 UTC (rev 3317) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = exo.core.component.database Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.document/pom.xml 2010-10-= 21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.document/pom.xml 2010-10-= 21 14:01:39 UTC (rev 3317) @@ -14,7 +14,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA exo.core.component.document eXo Core :: Component :: Demo Service Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.ldap/pom.xml 2010-10-21 1= 4:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.ldap/pom.xml 2010-10-21 1= 4:01:39 UTC (rev 3317) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = exo.core.component.ldap Modified: core/branches/2.3.5-GA_REL/exo.core.component.organization.api/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 --- core/branches/2.3.5-GA_REL/exo.core.component.organization.api/pom.xml = 2010-10-21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.organization.api/pom.xml = 2010-10-21 14:01:39 UTC (rev 3317) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA exo.core.component.organization.api eXo Core :: Component :: Organization Service API Modified: core/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/pom.xml= 2010-10-21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/pom.xml= 2010-10-21 14:01:39 UTC (rev 3317) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = exo.core.component.organization.jdbc Modified: core/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/pom.xml= 2010-10-21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/pom.xml= 2010-10-21 14:01:39 UTC (rev 3317) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = exo.core.component.organization.ldap Modified: core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/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 --- core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/pom.xml 201= 0-10-21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/pom.xml 201= 0-10-21 14:01:39 UTC (rev 3317) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = exo.core.component.script.groovy Modified: core/branches/2.3.5-GA_REL/exo.core.component.security.core/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 --- core/branches/2.3.5-GA_REL/exo.core.component.security.core/pom.xml 201= 0-10-21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.security.core/pom.xml 201= 0-10-21 14:01:39 UTC (rev 3317) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = exo.core.component.security.core Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.web.css/pom.xml 2010-10-2= 1 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.web.css/pom.xml 2010-10-2= 1 14:01:39 UTC (rev 3317) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = exo.core.component.web.css Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.xml-processing/pom.xml 20= 10-10-21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/exo.core.component.xml-processing/pom.xml 20= 10-10-21 14:01:39 UTC (rev 3317) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA exo.core.component.xml-processing eXo Core :: Component :: XML Processing Service Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/packaging/module/pom.xml 2010-10-21 14:00:01= UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/packaging/module/pom.xml 2010-10-21 14:01:39= UTC (rev 3317) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA = 4.0.0 @@ -18,13 +18,13 @@ = - org.exoplatform.coreexo= .core.component.database2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.ldap2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.security.core2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.3.5-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.3.5-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.database2.3.5-GA + org.exoplatform.coreexo= .core.component.document2.3.5-GA + org.exoplatform.coreexo= .core.component.organization.api2.3.5-GA + org.exoplatform.coreexo= .core.component.organization.ldap2.3.5-GA + org.exoplatform.coreexo= .core.component.security.core2.3.5-GA + org.exoplatform.coreexo= .core.component.xml-processing2.3.5-GA + org.exoplatform.coreexo= .core.component.script.groovy2.3.5-GA = Modified: core/branches/2.3.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/pom.xml 2010-10-21 14:00:01 UTC (rev 3316) +++ core/branches/2.3.5-GA_REL/pom.xml 2010-10-21 14:01:39 UTC (rev 3317) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.3.5-GA-SNAPSHOT + 2.3.5-GA pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/bran= ches/2.3.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/branches/2.3.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/core/branches/2.3.5-GA_= REL + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.5-GA + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.5-GA + http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.5-GA = --===============6628533081474831170==-- From do-not-reply at jboss.org Thu Oct 21 10:02:05 2010 Content-Type: multipart/mixed; boundary="===============1123827975959245803==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3318 - core/tags. Date: Thu, 21 Oct 2010 10:02:04 -0400 Message-ID: <201010211402.o9LE24cw026253@svn01.web.mwc.hst.phx2.redhat.com> --===============1123827975959245803== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 10:02:04 -0400 (Thu, 21 Oct 2010) New Revision: 3318 Added: core/tags/2.3.5-GA/ Log: [maven-release-plugin] [EXOJCR-XXX] copy for tag 2.3.5-GA Copied: core/tags/2.3.5-GA (from rev 3317, core/branches/2.3.5-GA_REL) --===============1123827975959245803==-- From do-not-reply at jboss.org Thu Oct 21 10:02:31 2010 Content-Type: multipart/mixed; boundary="===============6228723064723671200==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3319 - in core/branches/2.3.5-GA_REL: exo.core.component.database and 10 other directories. Date: Thu, 21 Oct 2010 10:02:31 -0400 Message-ID: <201010211402.o9LE2VP2026294@svn01.web.mwc.hst.phx2.redhat.com> --===============6228723064723671200== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 10:02:30 -0400 (Thu, 21 Oct 2010) New Revision: 3319 Modified: core/branches/2.3.5-GA_REL/exo.core.component.database/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.document/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.ldap/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.organization.api/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.security.core/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.web.css/pom.xml core/branches/2.3.5-GA_REL/exo.core.component.xml-processing/pom.xml core/branches/2.3.5-GA_REL/packaging/module/pom.xml core/branches/2.3.5-GA_REL/pom.xml Log: [maven-release-plugin] [EXOJCR-XXX]prepare for next development iteration Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.database/pom.xml 2010-10-= 21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.database/pom.xml 2010-10-= 21 14:02:30 UTC (rev 3319) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = exo.core.component.database Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.document/pom.xml 2010-10-= 21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.document/pom.xml 2010-10-= 21 14:02:30 UTC (rev 3319) @@ -14,7 +14,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT exo.core.component.document eXo Core :: Component :: Demo Service Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.ldap/pom.xml 2010-10-21 1= 4:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.ldap/pom.xml 2010-10-21 1= 4:02:30 UTC (rev 3319) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = exo.core.component.ldap Modified: core/branches/2.3.5-GA_REL/exo.core.component.organization.api/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 --- core/branches/2.3.5-GA_REL/exo.core.component.organization.api/pom.xml = 2010-10-21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.organization.api/pom.xml = 2010-10-21 14:02:30 UTC (rev 3319) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT exo.core.component.organization.api eXo Core :: Component :: Organization Service API Modified: core/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/pom.xml= 2010-10-21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.organization.jdbc/pom.xml= 2010-10-21 14:02:30 UTC (rev 3319) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = exo.core.component.organization.jdbc Modified: core/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/pom.xml= 2010-10-21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.organization.ldap/pom.xml= 2010-10-21 14:02:30 UTC (rev 3319) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = exo.core.component.organization.ldap Modified: core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/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 --- core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/pom.xml 201= 0-10-21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.script.groovy/pom.xml 201= 0-10-21 14:02:30 UTC (rev 3319) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = exo.core.component.script.groovy Modified: core/branches/2.3.5-GA_REL/exo.core.component.security.core/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 --- core/branches/2.3.5-GA_REL/exo.core.component.security.core/pom.xml 201= 0-10-21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.security.core/pom.xml 201= 0-10-21 14:02:30 UTC (rev 3319) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = exo.core.component.security.core Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.web.css/pom.xml 2010-10-2= 1 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.web.css/pom.xml 2010-10-2= 1 14:02:30 UTC (rev 3319) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = exo.core.component.web.css Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/exo.core.component.xml-processing/pom.xml 20= 10-10-21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/exo.core.component.xml-processing/pom.xml 20= 10-10-21 14:02:30 UTC (rev 3319) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT exo.core.component.xml-processing eXo Core :: Component :: XML Processing Service Modified: core/branches/2.3.5-GA_REL/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/branches/2.3.5-GA_REL/packaging/module/pom.xml 2010-10-21 14:02:04= UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/packaging/module/pom.xml 2010-10-21 14:02:30= UTC (rev 3319) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT = 4.0.0 @@ -18,13 +18,13 @@ = - org.exoplatform.coreexo= .core.component.database2.3.5-GA - org.exoplatform.coreexo= .core.component.document2.3.5-GA - org.exoplatform.coreexo= .core.component.organization.api2.3.5-GA - org.exoplatform.coreexo= .core.component.organization.ldap2.3.5-GA - org.exoplatform.coreexo= .core.component.security.core2.3.5-GA - org.exoplatform.coreexo= .core.component.xml-processing2.3.5-GA - org.exoplatform.coreexo= .core.component.script.groovy2.3.5-GA + org.exoplatform.coreexo= .core.component.database2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.ldap2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.security.core2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.6-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.3.6-GA-SNAPSHOT = Modified: core/branches/2.3.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/pom.xml 2010-10-21 14:02:04 UTC (rev 3318) +++ core/branches/2.3.5-GA_REL/pom.xml 2010-10-21 14:02:30 UTC (rev 3319) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-SNAPSHOT pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/tags= /2.3.5-GA - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.3.5-GA - http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.3.5-GA + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/core/bran= ches/2.3.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/branches/2.3.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/core/branches/2.3.5-GA_= REL = --===============6228723064723671200==-- From do-not-reply at jboss.org Thu Oct 21 10:08:06 2010 Content-Type: multipart/mixed; boundary="===============6448519765422535781==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3320 - core/branches/2.3.5-GA_REL. Date: Thu, 21 Oct 2010 10:08:06 -0400 Message-ID: <201010211408.o9LE86M0032211@svn01.web.mwc.hst.phx2.redhat.com> --===============6448519765422535781== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 10:08:06 -0400 (Thu, 21 Oct 2010) New Revision: 3320 Modified: core/branches/2.3.5-GA_REL/pom.xml Log: [EXOJCR-XXX] Upgrade dependencies to next snapshots Modified: core/branches/2.3.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA_REL/pom.xml 2010-10-21 14:02:30 UTC (rev 3319) +++ core/branches/2.3.5-GA_REL/pom.xml 2010-10-21 14:08:06 UTC (rev 3320) @@ -39,7 +39,7 @@ 2.3 = 1.2.1-GA - 2.2.5-GA + 2.2.6-GA-SNAPSHOT = --===============6448519765422535781==-- From do-not-reply at jboss.org Thu Oct 21 10:46:13 2010 Content-Type: multipart/mixed; boundary="===============3110669325337696555==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3321 - in jcr/trunk: applications/exo.jcr.applications.backupconsole/src/main/assemblies and 2 other directories. Date: Thu, 21 Oct 2010 10:46:13 -0400 Message-ID: <201010211446.o9LEkDqQ001446@svn01.web.mwc.hst.phx2.redhat.com> --===============3110669325337696555== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-21 10:46:12 -0400 (Thu, 21 Oct 2010) New Revision: 3321 Added: jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/test_form.= sh jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/FormAuthentication.java Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/assem= blies/binary-assembly.xml jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/BackupClientImpl.java jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/BackupConsole.java jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java/= org/exoplatform/jcr/backupconsole/ClientTransportImpl.java jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/backup-client.xml Log: JCR-1481 : Form authentication was added in backup console. Added: jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/test_f= orm.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/exo.jcr.applications.backupconsole/bin/test_form= .sh (rev 0) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/bin/test_form= .sh 2010-10-21 14:46:12 UTC (rev 3321) @@ -0,0 +1,3 @@ +#!/bin/sh + +./jcrbackup.sh http://127.0.0.1:8080/portal/rest form POST "/portal/login?= username=3Droot&password=3Dgtn" info \ No newline at end of file Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/assemblies/binary-assembly.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/asse= mblies/binary-assembly.xml 2010-10-21 14:08:06 UTC (rev 3320) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/asse= mblies/binary-assembly.xml 2010-10-21 14:46:12 UTC (rev 3321) @@ -46,7 +46,6 @@ javax.portlet:portlet-api javax.faces:jsf-api javax.servlet:servlet-api - picocontainer:picocontainer jmock:jmock xstream:xstream commons-beanutils:commons-beanutils Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-21 14:08:0= 6 UTC (rev 3320) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-21 14:46:1= 2 UTC (rev 3321) @@ -81,27 +81,37 @@ private final String path; = /** - * User login. + * Form authentication parameters. */ - private final String userName; + private FormAuthentication formAuthentication;; = /** - * User password. + * Constructor. + * = + * @param transport ClientTransport implementation. + * @param urlPath url path. */ - private final String pass; + public BackupClientImpl(ClientTransport transport, String urlPath) + { + this.transport =3D transport; = + if (urlPath =3D=3D null) + path =3D "/rest"; + else + path =3D urlPath; + } + /** * Constructor. * = * @param transport ClientTransport implementation. * @param login user login. * @param pass user password. + * @param urlPath url path. */ public BackupClientImpl(ClientTransport transport, String login, String= pass, String urlPath) { this.transport =3D transport; - this.userName =3D login; - this.pass =3D pass; = if (urlPath =3D=3D null) path =3D "/rest"; @@ -110,6 +120,19 @@ } = /** + * Constructor. + * = + * @param transport ClientTransport implementation. + * @param formAuthentication form authentication. + * @param urlPath url path. + */ + public BackupClientImpl(ClientTransport transport, FormAuthentication f= ormAuthentication, String urlPath) + { + this(transport, urlPath); + this.formAuthentication =3D formAuthentication; + } + + /** * {@inheritDoc} */ public String startBackUp(String repositoryName, String workspaceName, = String backupDir) throws IOException, @@ -327,8 +350,9 @@ + info.getWorkspaceName() + "\n") + "\t\tbackup type : " + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" - : "full only") + "\n" + "\t\tfull b= ackup state : " + getState(info - .getState())) + : "full only") + "\n" + "\t\tfull b= ackup state : " + (info + .getWorkspaceName().equals("") ? getReposito= ryBackupToFullState(info.getState()) + : getState(info.g= etState()))) + "\n" + (info.getBackupType() =3D=3D BackupManager= .FULL_BACKUP_ONLY ? "" : "\t\tincremental backup state : "= + "working" + "\n") Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/java/org/exoplatform/jcr/backupconsole/BackupConsole.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-21 14:08:06 U= TC (rev 3320) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-21 14:46:12 U= TC (rev 3321) @@ -23,6 +23,7 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.util.HashMap; = /** * Created by The eXo Platform SAS.
    Date: @@ -57,7 +58,15 @@ * Help string. */ private static final String HELP_INFO =3D - "Help info:\n" + " \n" + " : http(s)//login:pas= sword(a)host:port/ \n" + "Help info:\n" + + " | \n" + + " : http(s)//login:pa= ssword(a)host:port/ \n\n" + + " : http(s)//host:por= t/ \"
    \" \n" + + " : form \n" + + " : POST or GET\n" + + " : /path/path?=3D&=3D...\n" + + " Example to : http:/= /127.0.0.1:8080/portal/rest form POST /portal/login?username=3Droot&passwor= d=3Dgtn\n\n" + + " : start [] \n" = + " stop \n" + " status \n" = @@ -65,7 +74,7 @@ + " restore = \n" = + " list [completed] \n" + " info \n" = - + " drop [force-close-session] \n" = + + " drop [force-close-session] = \n" + " help \n\n" = + " start - start backup of repositpry or workspace \n" = @@ -79,7 +88,7 @@ + " drop - delete the repository or workspace \n" + " help - print help information about backup console = \n\n" = - + " - /[/= ] the repository or workspace \n" + + " - /[/] = the repository or workspace \n" + " - path to folder for backup on remote ser= ver \n" + " - the identifier for backup \n" = + " - incemental job period \n" @@ -128,25 +137,116 @@ if (!("".equals(url.getPath()))) urlPath =3D url.getPath(); = + // try form + String form =3D null; + if (curArg < args.length) + { + if (args[curArg].equals("form")) + { + form =3D args[curArg++]; + + if (url.getUserInfo() !=3D null) + { = + System.out.println(INCORRECT_PARAM + "Parameters Login:Pass= word should not be specified in url parameter to form authentication - " + = sUrl); + return; + } + } + } + // login:password String login =3D url.getUserInfo(); - if (login =3D=3D null) + = + FormAuthentication formAuthentication =3D null; + if (form !=3D null && form.equals("form")) { - System.out.println(INCORRECT_PARAM + "There is no specific Login:= Password in url parameter - " + sUrl); - return; + //check POST or GET + if (curArg =3D=3D args.length) + { + System.out.println(INCORRECT_PARAM + "No specified POST or GE= T parameter to form parameter."); + return; + } + String method =3D args[curArg++]; + + if (!method.equalsIgnoreCase("GET") && !method.equalsIgnoreCase("= POST")) + { + System.out.println(INCORRECT_PARAM + "Method to form authentic= ation shulde be GET or POST to form parameter - " + method); + return; + } + = + //url to form authentication + if (curArg =3D=3D args.length) + { + System.out.println(INCORRECT_PARAM + "No specified url and fo= rm properties to form parameter."); + return; + } + String[] params =3D args[curArg++].split("[?]"); + = + if (params.length !=3D 2) + { + System.out.println(INCORRECT_PARAM + "From parameters is not s= pacified to form parameter - " + args[curArg]); + return; + } + String formUrl =3D params[0]; + + // parameters to form + String[] formParams =3D params[1].split("&"); + + if (formParams.length < 2) + { + System.out.println(INCORRECT_PARAM + + "From parameters shoulde be conatains at least two = (for login and for pasword) parameters - " + + params[1]); + return; + } + = + HashMap mapFormParams =3D new HashMap(); + + for (String fParam : formParams) + { + String[] para =3D fParam.split("=3D"); + = + if (para.length !=3D 2) + { + System.out.println(INCORRECT_PARAM + "From parameters is in= corect, shoulde be as \"name=3Dvalue\" - " + fParam); + return; + } + = + mapFormParams.put(para[0], para[1]); + } + = + formAuthentication =3D new FormAuthentication(method, formUrl, ma= pFormParams); } - else if (!login.matches("[^:]+:[^:]+")) + else { - System.out.println(INCORRECT_PARAM + "There is incorrect Login:Pa= ssword parameter - " + login); - return; + if (login =3D=3D null) + { + System.out.println(INCORRECT_PARAM + "There is no specific Log= in:Password in url parameter - " + sUrl); + return; + } + else if (!login.matches("[^:]+:[^:]+")) + { + System.out.println(INCORRECT_PARAM + "There is incorrect Login= :Password parameter - " + login); + return; + } } = String host =3D url.getHost() + ":" + url.getPort(); = // initialize transport and backup client - String[] lp =3D login.split(LOGIN_PASS_SPLITTER); - ClientTransport transport =3D new ClientTransportImpl(lp[0], lp[1], = host, url.getProtocol()); - BackupClient client =3D new BackupClientImpl(transport, lp[0], lp[1]= , urlPath); + ClientTransport transport; + BackupClient client; + = + if (formAuthentication !=3D null) + { + transport =3D new ClientTransportImpl(formAuthentication, host, u= rl.getProtocol()); + client =3D new BackupClientImpl(transport, formAuthentication, ur= lPath); + } + else + { + String[] lp =3D login.split(LOGIN_PASS_SPLITTER); + transport =3D new ClientTransportImpl(lp[0], lp[1], host, url.get= Protocol()); + client =3D new BackupClientImpl(transport, urlPath); + } = // commands if (curArg =3D=3D args.length) @@ -155,7 +255,6 @@ return; } String command =3D args[curArg++]; - try { if (command.equalsIgnoreCase("start")) @@ -376,6 +475,8 @@ System.out.println("ERROR: " + e.getMessage()); e.printStackTrace(); } + + System.exit(0); } = /** Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/mai= n/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-10-21 14:0= 8:06 UTC (rev 3320) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-10-21 14:4= 6:12 UTC (rev 3321) @@ -18,6 +18,11 @@ */ package org.exoplatform.jcr.backupconsole; = +import java.io.IOException; +import java.net.URL; + +import javax.ws.rs.core.Response; + import org.exoplatform.common.http.client.AuthorizationHandler; import org.exoplatform.common.http.client.AuthorizationInfo; import org.exoplatform.common.http.client.CookieModule; @@ -26,9 +31,6 @@ import org.exoplatform.common.http.client.ModuleException; import org.exoplatform.common.http.client.NVPair; = -import java.io.IOException; -import java.net.URL; - /** * Created by The eXo Platform SAS.
    Date: * = @@ -67,6 +69,11 @@ * Realm to connection */ private String realm; + = + /** + * Form authentication parameters. + */ + private FormAuthentication formAuthentication; = /** * Constructor. @@ -74,7 +81,6 @@ * @param login Login string. * @param password Password string. * @param host host string. - * @param isSSL isSSL flag. */ public ClientTransportImpl(String login, String password, String host, = String protocol) { @@ -85,6 +91,20 @@ } = /** + * Constructor. + + * @param formAuthentication form authentication parameters. + * @param login Login string. + * @param password Password string. + * @param host host string. + */ + public ClientTransportImpl(FormAuthentication formAuthentication, Strin= g host, String protocol) + { + this(null, null, host, protocol); + this.formAuthentication =3D formAuthentication; + } + + /** * Get realm by URL. * = * @param sUrl URL string. @@ -132,16 +152,53 @@ = URL url =3D new URL(complURL); HTTPConnection connection =3D new HTTPConnection(url); - connection.removeModule(CookieModule.class); + connection.setAllowUserInteraction(false); = - if (!isRealmGet) + //authentication + if (formAuthentication !=3D null) { - realm =3D getRealm(complURL); - isRealmGet =3D true; + //form authentication = + HTTPResponse respLogin; + + URL urlLogin =3D new URL(protocol + "://" + host + formAuthent= ication.getFormPath()); + + HTTPConnection connectionLogin =3D new HTTPConnection(urlLogin= ); + connectionLogin.setAllowUserInteraction(false); + + NVPair[] formParams =3D new NVPair[formAuthentication.getFormP= arams().size()]; + int pairCount =3D 0; + for (String key : formAuthentication.getFormParams().keySet()) + { + formParams[pairCount++] =3D new NVPair(key, formAuthenticat= ion.getFormParams().get(key)); + } + + if ("POST".equalsIgnoreCase(formAuthentication.getMethod())) + { + respLogin =3D connectionLogin.Post(urlLogin.getFile(), form= Params); + } + else + { + respLogin =3D connectionLogin.Get(urlLogin.getFile(), formP= arams); + } + + if (Response.Status.OK.getStatusCode() !=3D respLogin.getStatu= sCode()) + { + System.out.println("Form authentication is fail, status cod= e : " + respLogin.getStatusCode()); + System.exit(0); + } } - = - connection.addBasicAuthorization(realm, login, password); + else + { + // basic authorization + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } = + connection.addBasicAuthorization(realm, login, password); + } + HTTPResponse resp; if (postData =3D=3D null) { @@ -173,21 +230,58 @@ { try { - // execute the POST + // execute the GET String complURL =3D protocol + "://" + host + sURL; = URL url =3D new URL(complURL); HTTPConnection connection =3D new HTTPConnection(url); - connection.removeModule(CookieModule.class); + connection.setAllowUserInteraction(false); = - if (!isRealmGet) + //authentication + if (formAuthentication !=3D null) { - realm =3D getRealm(complURL); - isRealmGet =3D true; + //form authentication = + HTTPResponse respLogin; + + URL urlLogin =3D new URL(protocol + "://" + host + formAuthent= ication.getFormPath()); + + HTTPConnection connectionLogin =3D new HTTPConnection(urlLogin= ); + connectionLogin.setAllowUserInteraction(false); + + NVPair[] formParams =3D new NVPair[formAuthentication.getFormP= arams().size()]; + int pairCount =3D 0; + for (String key : formAuthentication.getFormParams().keySet()) + { + formParams[pairCount++] =3D new NVPair(key, formAuthenticat= ion.getFormParams().get(key)); + } + + if ("POST".equalsIgnoreCase(formAuthentication.getMethod())) + { + respLogin =3D connectionLogin.Post(urlLogin.getFile(), form= Params); + } + else + { + respLogin =3D connectionLogin.Get(urlLogin.getFile(), formP= arams); + } + + if (Response.Status.OK.getStatusCode() !=3D respLogin.getStatu= sCode()) + { + System.out.println("Form authentication is fail, status cod= e : " + respLogin.getStatusCode()); + System.exit(0); + } } - = - connection.addBasicAuthorization(realm, login, password); + else + { + // basic authorization + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } = + connection.addBasicAuthorization(realm, login, password); + } + HTTPResponse resp =3D connection.Get(url.getFile()); = BackupAgentResponse responce =3D new BackupAgentResponse(resp.get= Data(), resp.getStatusCode()); Added: jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/j= ava/org/exoplatform/jcr/backupconsole/FormAuthentication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/FormAuthentication.java = (rev 0) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/src/main/java= /org/exoplatform/jcr/backupconsole/FormAuthentication.java 2010-10-21 14:46= :12 UTC (rev 3321) @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2003-2010 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.jcr.backupconsole; + +import java.util.HashMap; + +/** + * Created by The eXo Platform SAS. + * = + *
    Date: 2010 + * + * @author Alex Re= shetnyak = + * @version $Id: FormAuthntication.java 111 2010-11-11 11:11:11Z rainf0x $ + */ +public class FormAuthentication +{ + private String method; + + private String formPath; + + private HashMap formParams; + + public FormAuthentication(String method, String formPath, HashMap formParams) + { + this.method =3D method; + this.formPath =3D formPath; + this.formParams =3D formParams; + } + + public String getMethod() + { + return method; + } + + public String getFormPath() + { + return formPath; + } + + public HashMap getFormParams() + { + return formParams; + } + +} Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-21 14:08:06 UTC (rev 3320) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-21 14:46:12 UTC (rev 3321) @@ -16,6 +16,17 @@ configuration' . = + + For GateIn should use context "/portal/rest". So to all url will= be + changed from "http://host:port/rest/..." to + "http://host:port/portal/rest/..." + + GetIn is use form authentication, so you first need login over "= form + authentication" ( url to form authentication is + http://host:port/portal/login). And secont make request to + HTTPBackupAgent. + +
    Introduction = @@ -911,6 +922,10 @@ </component> = <component> + <type>org.exoplatform.services.jcr.ext.repository.RestRepositorySe= rvice</type> +</component> + +<component> <key>org.exoplatform.services.jcr.ext.backup.BackupManager</key= > <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerIm= pl</type> <init-params> @@ -923,12 +938,56 @@ </properties-param> </init-params> </component> + + In case, if you will restore backup in same workspace (so you = will + drop previous workspace), you need configure + RepositoryServiceConfiguration in order to save the changes of the + repository configuration. For example + + <component> + <key>org.exoplatform.services.jcr.config.RepositoryServiceConfigur= ation</key> + <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceCo= nfigurationImpl</type> + <init-params> + <value-param> + <name>conf-path</name> + <description>JCR repositories configuration file</descripti= on> + <value>jar:/conf/portal/exo-jcr-config.xml</value> + </value-param> + <properties-param> + <name>working-conf</name> + <description>working-conf</description> + <property name=3D"source-name" value=3D"jdbcjcr" /> + <property name=3D"dialect" value=3D"hsqldb" /> + <property name=3D"persister-class-name" value=3D"org.exoplatform.= services.jcr.impl.config.JDBCConfigurationPersister" /> + </properties-param> + </init-params> +</component> + + See the eXo + JCR Configuration article at chapter '2 Portal and Standalone + configuration' for details.
    =
    Backup Client = + + For GateIn should use context "/portal/rest". GetIn is use form + authentication, so you first need login over "form authentication" (= url + to form authentication is http://host:port/portal/login). And secont + make request to HTTPBackupAgent. + + + + Backup client is support form authenication. For example call + command "info" wirh form authentication to GateIn : + + ./jcrbackup.sh http://127.0.0.1:8080/portal/rest form POST + "/portal/login?username=3Droot&password=3Dgtn" info + + Backup client is console application. = The backup client is http client for HTTPBackupAgent. @@ -936,19 +995,26 @@ Command signature: = Help info: - <url> <cmd> = - <url> : http(s)//login:password(a)host:port/<context> = + <url_basic_authentication>|<url form authentication> <cmd= > = + <url_basic_authentication> : http(s)//login:password(a)host:port= /<context> = + + <url form authentication> : http(s)//host:port/<context> = "<form auth parm>" = + <form auth parm> : form <method> <form path&g= t; + <method> : POST or GET + <form path> : /path/path?<paramName1>=3D<= ;paramValue1>&<paramName2>=3D<paramValue2>... + Example to <url form authentication> : http://127.0.0.1:8080/po= rtal/rest form POST /portal/login?username=3Droot&password=3Dgtn + <cmd> : start <repo[/ws]> <backup_dir> [<incr>= ] = stop <backup_id> = status <backup_id> = restores <repo[/ws]> = - restore <repo[/ws]> <backup_id> <pathToConfigFi= le> + restore <repo[/ws]> <backup_id> <pathToConfigFi= le> = list [completed] = info = - drop [force-close-session] <repo[/ws]> = + drop [force-close-session] <repo[/ws]> = help = = - start - start backup of repository or workspace + start - start backup of repositpry or workspace = stop - stop backup = status - information about the current or completed backup by 'ba= ckup_id' = restores - information about the last restore on specific repositor= y or workspace = @@ -959,12 +1025,12 @@ drop - delete the repository or workspace = help - print help information about backup console = = - <repo[/ws]> - /<reponsitory-name>[/<workspace-name= >] the repository or workspace + <repo[/ws]> - /<reponsitory-name>[/<workspace-name= >] the repository or workspace = <backup_dir> - path to folder for backup on remote server = <backup_id> - the identifier for backup = <incr> - incemental job period = <pathToConfigFile> - path (local) to repository or workspace conf= iguration = - force-close-session - close opened sessions on repositpry or workspace + force-close-session - close opened sessions on repositpry or workspace.
    =
    @@ -977,10 +1043,7 @@ Go to folder of "backup client" ${JCR-SRC-HOME}/applications/exo.jcr.applications.= backupconsole - . - build the application : - mvn clean install -P deploy - = - + . - build the application :mvn clean install -P = deploy = @@ -1001,8 +1064,8 @@ = - Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command> -or use jcrbackup.cmd (or .sh); + Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command>or + use jcrbackup.cmd (or .sh);
    @@ -1233,12 +1296,9 @@ Delete/clean the database for workspace "backup" : When we use "single-db", the= n we - will run the SQL queries for clean database : - delete from JCR_SREF where NODE_ID in (select ID from JCR_SITEM whe= re CONTAINER_NAME =3D 'backup') - delete from JCR_SVALUE where PROPERTY_ID in (select ID from JCR_SIT= EM where CONTAINER_NAME =3D 'backup') - delete from JCR_SITEM where CONTAINER_NAME=3D'backup' = - = - + will run the SQL queries for clean database :del= ete from JCR_SREF where NODE_ID in (select ID from JCR_SITEM where CONTAINE= R_NAME =3D 'backup') +delete from JCR_SVALUE where PROPERTY_ID in (select ID from JCR_SITEM wher= e CONTAINER_NAME =3D 'backup') +delete from JCR_SITEM where CONTAINER_NAME=3D'backup' = @@ -1250,8 +1310,7 @@ status code =3D 200The /home/rainf0x/java/exo-working/JCR-839/exo-jcr-config_backup.xml content the configuration for restored workspace "backup" : -<repository-service default-repository=3D"repository"> + role=3D"bold">"backup" :<repositor= y-service default-repository=3D"repository"> <repositories> <repository name=3D"repository" system-workspace=3D"production" def= ault-workspace=3D"production"> <security-domain>exo-domain</security-domain> @@ -1329,6 +1388,16 @@ Full example about creating backup and restoring it for reposit= ory 'repository' = + + If delete default repository that should be restored repository + with name as default repository. + + + This usecase needs RestRepositoryService enabled. (Deleting the + repository needs it)<component> + <type>org.exoplatform.services.jcr.ext.repository.RestRepositoryS= ervice</type> +</component> +
    Creating backup = @@ -1382,7 +1451,7 @@
    =
    - Restoring the workspace "backup" + Restoring the repository "repository" = @@ -1404,7 +1473,7 @@ = - Restore:jcrbackup http://root:exo(a)127.0.= 0.1:8080 restore /repository/backup 9a6dba327f000001325dfb228a181b07 /home/= rainf0x/exo-jcr-config_backup.xmlReturn + Restore:jcrbackup http://root:exo(a)127.0.= 0.1:8080 restore /repository 9a6dba327f000001325dfb228a181b07 /home/rainf0x= /exo-jcr-config_backup.xmlReturn :Successful : = status code =3D 200The /home/rainf0x/exo-jcr-config_backup.xml content the configuration --===============3110669325337696555==-- From do-not-reply at jboss.org Thu Oct 21 11:11:23 2010 Content-Type: multipart/mixed; boundary="===============6714629919034988929==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3322 - ws/branches/2.1.5-GA_REL. Date: Thu, 21 Oct 2010 11:11:23 -0400 Message-ID: <201010211511.o9LFBNNl008711@svn01.web.mwc.hst.phx2.redhat.com> --===============6714629919034988929== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:11:22 -0400 (Thu, 21 Oct 2010) New Revision: 3322 Modified: ws/branches/2.1.5-GA_REL/pom.xml Log: [SWF-580] Upgrade dependencies to latest releases Modified: ws/branches/2.1.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.5-GA_REL/pom.xml 2010-10-21 14:46:12 UTC (rev 3321) +++ ws/branches/2.1.5-GA_REL/pom.xml 2010-10-21 15:11:22 UTC (rev 3322) @@ -44,8 +44,8 @@ exo-ws 2.1 = - 2.2.5-GA-SNAPSHOT - 2.3.5-GA-SNAPSHOT + 2.2.5-GA + 2.3.5-GA = --===============6714629919034988929==-- From do-not-reply at jboss.org Thu Oct 21 11:12:37 2010 Content-Type: multipart/mixed; boundary="===============3701226394668788961==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3323 - in ws/branches/2.1.5-GA_REL: exo.ws.commons and 6 other directories. Date: Thu, 21 Oct 2010 11:12:37 -0400 Message-ID: <201010211512.o9LFCbeq008730@svn01.web.mwc.hst.phx2.redhat.com> --===============3701226394668788961== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:12:37 -0400 (Thu, 21 Oct 2010) New Revision: 3323 Modified: ws/branches/2.1.5-GA_REL/exo.ws.commons/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.frameworks.json/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.frameworks.servlet/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.rest.core/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.rest.ext/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.testframework/pom.xml ws/branches/2.1.5-GA_REL/packaging/module/pom.xml ws/branches/2.1.5-GA_REL/pom.xml Log: [maven-release-plugin] [SWF-580]prepare release 2.1.5-GA Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.commons/pom.xml 2010-10-21 15:11:22 UTC= (rev 3322) +++ ws/branches/2.1.5-GA_REL/exo.ws.commons/pom.xml 2010-10-21 15:12:37 UTC= (rev 3323) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA = exo.ws.commons Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.frameworks.json/pom.xml 2010-10-21 15:1= 1:22 UTC (rev 3322) +++ ws/branches/2.1.5-GA_REL/exo.ws.frameworks.json/pom.xml 2010-10-21 15:1= 2:37 UTC (rev 3323) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA = exo.ws.frameworks.json Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.frameworks.servlet/pom.xml 2010-10-21 1= 5:11:22 UTC (rev 3322) +++ ws/branches/2.1.5-GA_REL/exo.ws.frameworks.servlet/pom.xml 2010-10-21 1= 5:12:37 UTC (rev 3323) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA = exo.ws.frameworks.servlet Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.rest.core/pom.xml 2010-10-21 15:11:22 U= TC (rev 3322) +++ ws/branches/2.1.5-GA_REL/exo.ws.rest.core/pom.xml 2010-10-21 15:12:37 U= TC (rev 3323) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA = exo.ws.rest.core Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.rest.ext/pom.xml 2010-10-21 15:11:22 UT= C (rev 3322) +++ ws/branches/2.1.5-GA_REL/exo.ws.rest.ext/pom.xml 2010-10-21 15:12:37 UT= C (rev 3323) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA = exo.ws.rest.ext Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.testframework/pom.xml 2010-10-21 15:11:= 22 UTC (rev 3322) +++ ws/branches/2.1.5-GA_REL/exo.ws.testframework/pom.xml 2010-10-21 15:12:= 37 UTC (rev 3323) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA = exo.ws.testframework Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:11:22 U= TC (rev 3322) +++ ws/branches/2.1.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:12:37 U= TC (rev 3323) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA = 4.0.0 Modified: ws/branches/2.1.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.5-GA_REL/pom.xml 2010-10-21 15:11:22 UTC (rev 3322) +++ ws/branches/2.1.5-GA_REL/pom.xml 2010-10-21 15:12:37 UTC (rev 3323) @@ -30,14 +30,14 @@ = org.exoplatform.ws ws-parent - 2.1.5-GA-SNAPSHOT + 2.1.5-GA pom eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branch= es/2.1.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= branches/2.1.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.1.5-GA_RE= L + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.5-GA + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.5-GA + http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.5-GA = --===============3701226394668788961==-- From do-not-reply at jboss.org Thu Oct 21 11:13:02 2010 Content-Type: multipart/mixed; boundary="===============1555877232969777010==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3324 - ws/tags. Date: Thu, 21 Oct 2010 11:13:02 -0400 Message-ID: <201010211513.o9LFD2HB008741@svn01.web.mwc.hst.phx2.redhat.com> --===============1555877232969777010== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:13:02 -0400 (Thu, 21 Oct 2010) New Revision: 3324 Added: ws/tags/2.1.5-GA/ Log: [maven-release-plugin] [SWF-580] copy for tag 2.1.5-GA Copied: ws/tags/2.1.5-GA (from rev 3323, ws/branches/2.1.5-GA_REL) --===============1555877232969777010==-- From do-not-reply at jboss.org Thu Oct 21 11:13:23 2010 Content-Type: multipart/mixed; boundary="===============7858474849595921045==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3325 - in ws/branches/2.1.5-GA_REL: exo.ws.commons and 6 other directories. Date: Thu, 21 Oct 2010 11:13:22 -0400 Message-ID: <201010211513.o9LFDMlr008751@svn01.web.mwc.hst.phx2.redhat.com> --===============7858474849595921045== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:13:22 -0400 (Thu, 21 Oct 2010) New Revision: 3325 Modified: ws/branches/2.1.5-GA_REL/exo.ws.commons/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.frameworks.json/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.frameworks.servlet/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.rest.core/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.rest.ext/pom.xml ws/branches/2.1.5-GA_REL/exo.ws.testframework/pom.xml ws/branches/2.1.5-GA_REL/packaging/module/pom.xml ws/branches/2.1.5-GA_REL/pom.xml Log: [maven-release-plugin] [SWF-580]prepare for next development iteration Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.commons/pom.xml 2010-10-21 15:13:02 UTC= (rev 3324) +++ ws/branches/2.1.5-GA_REL/exo.ws.commons/pom.xml 2010-10-21 15:13:22 UTC= (rev 3325) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT = exo.ws.commons Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.frameworks.json/pom.xml 2010-10-21 15:1= 3:02 UTC (rev 3324) +++ ws/branches/2.1.5-GA_REL/exo.ws.frameworks.json/pom.xml 2010-10-21 15:1= 3:22 UTC (rev 3325) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT = exo.ws.frameworks.json Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.frameworks.servlet/pom.xml 2010-10-21 1= 5:13:02 UTC (rev 3324) +++ ws/branches/2.1.5-GA_REL/exo.ws.frameworks.servlet/pom.xml 2010-10-21 1= 5:13:22 UTC (rev 3325) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.rest.core/pom.xml 2010-10-21 15:13:02 U= TC (rev 3324) +++ ws/branches/2.1.5-GA_REL/exo.ws.rest.core/pom.xml 2010-10-21 15:13:22 U= TC (rev 3325) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT = exo.ws.rest.core Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.rest.ext/pom.xml 2010-10-21 15:13:02 UT= C (rev 3324) +++ ws/branches/2.1.5-GA_REL/exo.ws.rest.ext/pom.xml 2010-10-21 15:13:22 UT= C (rev 3325) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT = exo.ws.rest.ext Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/exo.ws.testframework/pom.xml 2010-10-21 15:13:= 02 UTC (rev 3324) +++ ws/branches/2.1.5-GA_REL/exo.ws.testframework/pom.xml 2010-10-21 15:13:= 22 UTC (rev 3325) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT = exo.ws.testframework Modified: ws/branches/2.1.5-GA_REL/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/branches/2.1.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:13:02 U= TC (rev 3324) +++ ws/branches/2.1.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:13:22 U= TC (rev 3325) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT = 4.0.0 Modified: ws/branches/2.1.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.5-GA_REL/pom.xml 2010-10-21 15:13:02 UTC (rev 3324) +++ ws/branches/2.1.5-GA_REL/pom.xml 2010-10-21 15:13:22 UTC (rev 3325) @@ -30,14 +30,14 @@ = org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-SNAPSHOT pom eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .1.5-GA - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.1.5-GA - http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.1.5-GA + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branch= es/2.1.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= branches/2.1.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.1.5-GA_RE= L = --===============7858474849595921045==-- From do-not-reply at jboss.org Thu Oct 21 11:17:17 2010 Content-Type: multipart/mixed; boundary="===============6673099731752299921==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3326 - ws/branches/2.1.5-GA_REL. Date: Thu, 21 Oct 2010 11:17:17 -0400 Message-ID: <201010211517.o9LFHHGY008910@svn01.web.mwc.hst.phx2.redhat.com> --===============6673099731752299921== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:17:17 -0400 (Thu, 21 Oct 2010) New Revision: 3326 Modified: ws/branches/2.1.5-GA_REL/pom.xml Log: [SWF-580] Upgrade dependencies to next snapshots Modified: ws/branches/2.1.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.5-GA_REL/pom.xml 2010-10-21 15:13:22 UTC (rev 3325) +++ ws/branches/2.1.5-GA_REL/pom.xml 2010-10-21 15:17:17 UTC (rev 3326) @@ -44,8 +44,8 @@ exo-ws 2.1 = - 2.2.5-GA - 2.3.5-GA + 2.2.6-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT = --===============6673099731752299921==-- From do-not-reply at jboss.org Thu Oct 21 11:17:53 2010 Content-Type: multipart/mixed; boundary="===============8208345478057565911==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3327 - jcr/branches/1.12.5-GA_REL. Date: Thu, 21 Oct 2010 11:17:52 -0400 Message-ID: <201010211517.o9LFHqdp008920@svn01.web.mwc.hst.phx2.redhat.com> --===============8208345478057565911== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:17:52 -0400 (Thu, 21 Oct 2010) New Revision: 3327 Modified: jcr/branches/1.12.5-GA_REL/pom.xml Log: [SWF-580] Upgrade dependencies to latest releases Modified: jcr/branches/1.12.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:17:17 UTC (rev 3326) +++ jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:17:52 UTC (rev 3327) @@ -42,9 +42,9 @@ exo-jcr 1.12 - 2.2.5-GA-SNAPSHOT - 2.3.5-GA-SNAPSHOT - 2.1.5-GA-SNAPSHOT + 2.2.5-GA + 2.3.5-GA + 2.1.5-GA 1 = --===============8208345478057565911==-- From do-not-reply at jboss.org Thu Oct 21 11:22:01 2010 Content-Type: multipart/mixed; boundary="===============8809815269659121300==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3328 - in jcr/branches/1.12.5-GA_REL: applications and 23 other directories. Date: Thu, 21 Oct 2010 11:22:01 -0400 Message-ID: <201010211522.o9LFM1gO009617@svn01.web.mwc.hst.phx2.redhat.com> --===============8809815269659121300== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:22:00 -0400 (Thu, 21 Oct 2010) New Revision: 3328 Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.backupconso= le/pom.xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.browser/pom= .xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.config/pom.= xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fckeditor/p= om.xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jboss/pom.x= ml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jonas/pom.x= ml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.rest/pom.xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomcat/pom.= xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclient/pom.x= ml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.ear/pom.xml jcr/branches/1.12.5-GA_REL/applications/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.core/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.ext/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.ftp/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.webdav/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.connectors.localadapter/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.framework.command/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.framework.ftpclient/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.framework.web/pom.xml jcr/branches/1.12.5-GA_REL/packaging/module/pom.xml jcr/branches/1.12.5-GA_REL/pom.xml Log: [maven-release-plugin] [SWF-580]prepare release 1.12.5-GA Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.back= upconsole/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.backupcons= ole/pom.xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.backupcons= ole/pom.xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.applications.backupconsole eXo JCR :: Applications :: Backup Console Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.brow= ser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.browser/po= m.xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.browser/po= m.xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.applications.browser war Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.conf= ig/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.config/pom= .xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.config/pom= .xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.applications.config pom Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fcke= ditor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fckeditor/= pom.xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fckeditor/= pom.xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.applications.fckeditor war Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jbos= s/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jboss/pom.= xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jboss/pom.= xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA-SNAPSHOT + 1.12.5-GA = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA-SNAPSHOT + 1.12.5-GA ear runtime Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jona= s/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jonas/pom.= xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jonas/pom.= xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA-SNAPSHOT + 1.12.5-GA = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA-SNAPSHOT + 1.12.5-GA ear runtime Modified: jcr/branches/1.12.5-GA_REL/applications/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/branches/1.12.5-GA_REL/applications/exo.jcr.applications.rest/pom.x= ml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.rest/pom.x= ml 2010-10-21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.applications.rest war Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomc= at/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomcat/pom= .xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomcat/pom= .xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.applications.config = Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclien= t/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclient/pom.= xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclient/pom.= xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.cluster.testclient eXo JCR :: Cluster :: Test Client Modified: jcr/branches/1.12.5-GA_REL/applications/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.5-GA_REL/applications/exo.jcr.ear/pom.xml 2010-10-21 = 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.ear/pom.xml 2010-10-21 = 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.ear ear Modified: jcr/branches/1.12.5-GA_REL/applications/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/pom.xml 2010-10-21 15:17:52 UTC= (rev 3327) +++ jcr/branches/1.12.5-GA_REL/applications/pom.xml 2010-10-21 15:22:00 UTC= (rev 3328) @@ -22,12 +22,12 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA = 4.0.0 jcr-applications-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA = eXo JCR :: Applications :: Reactor pom Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.core/pom.xml 2010-10-21 15= :17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.core/pom.xml 2010-10-21 15= :22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.component.core eXo JCR :: Component :: Core Service Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.ext/pom.xml 2010-10-21 15:= 17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.ext/pom.xml 2010-10-21 15:= 22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.component.ext eXo JCR :: Component :: Extension Service Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.ftp/pom.xml 2010-10-21 15:= 17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.ftp/pom.xml 2010-10-21 15:= 22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.component.ftp eXo JCR :: Component :: FTP Service Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml 2010-10= -21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml 2010-10= -21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.component.statistics eXo JCR :: Component :: Statistics Provider Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.webdav/pom.xml 2010-10-21 = 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.webdav/pom.xml 2010-10-21 = 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.component.webdav eXo JCR :: Component :: Webdav Service Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.connectors.localadapter/pom.xml 2010= -10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.connectors.localadapter/pom.xml 2010= -10-21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.connectors.localadapter rar Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en= /pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en/pom.x= ml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en/pom.x= ml 2010-10-21 15:22:00 UTC (rev 3328) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs.developer - 1.12.5-GA-SNAPSHOT + 1.12.5-GA = 4.0.0 Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/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/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/pom.xml = 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/pom.xml = 2010-10-21 15:22:00 UTC (rev 3328) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs - 1.12.5-GA-SNAPSHOT + 1.12.5-GA = 4.0.0 Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml 2010-10-21 15:17:52 UTC= (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml 2010-10-21 15:22:00 UTC= (rev 3328) @@ -22,7 +22,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA = 4.0.0 Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.framework.command/pom.xml 2010-10-21= 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.framework.command/pom.xml 2010-10-21= 15:22:00 UTC (rev 3328) @@ -12,7 +12,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.framework.command eXo JCR :: Framework :: Command Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.framework.ftpclient/pom.xml 2010-10-= 21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.framework.ftpclient/pom.xml 2010-10-= 21 15:22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.framework.ftpclient eXo JCR :: Framework :: FTP Client Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.framework.web/pom.xml 2010-10-21 15:= 17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.framework.web/pom.xml 2010-10-21 15:= 22:00 UTC (rev 3328) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA exo.jcr.framework.web eXo JCR :: Framework :: Web Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:17:52= UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:22:00= UTC (rev 3328) @@ -4,7 +4,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA jcr.packaging.module pom Modified: jcr/branches/1.12.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:17:52 UTC (rev 3327) +++ jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:22:00 UTC (rev 3328) @@ -29,14 +29,14 @@ = org.exoplatform.jcr jcr-parent - 1.12.5-GA-SNAPSHOT + 1.12.5-GA pom eXo JCR = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.12.5-GA_REL - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.12.5-GA_REL - http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.12.5-GA_RE= L + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/1.= 12.5-GA + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= ags/1.12.5-GA + http://fisheye.jboss.org/browse/exo-jcr/jcr/tags/1.12.5-GA = --===============8809815269659121300==-- From do-not-reply at jboss.org Thu Oct 21 11:22:28 2010 Content-Type: multipart/mixed; boundary="===============8391763677308352602==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3329 - jcr/tags. Date: Thu, 21 Oct 2010 11:22:27 -0400 Message-ID: <201010211522.o9LFMROR009643@svn01.web.mwc.hst.phx2.redhat.com> --===============8391763677308352602== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:22:27 -0400 (Thu, 21 Oct 2010) New Revision: 3329 Added: jcr/tags/1.12.5-GA/ Log: [maven-release-plugin] [SWF-580] copy for tag 1.12.5-GA Copied: jcr/tags/1.12.5-GA (from rev 3328, jcr/branches/1.12.5-GA_REL) --===============8391763677308352602==-- From do-not-reply at jboss.org Thu Oct 21 11:23:15 2010 Content-Type: multipart/mixed; boundary="===============2372084820545061357==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3330 - in jcr/branches/1.12.5-GA_REL: applications and 23 other directories. Date: Thu, 21 Oct 2010 11:23:15 -0400 Message-ID: <201010211523.o9LFNFYk009669@svn01.web.mwc.hst.phx2.redhat.com> --===============2372084820545061357== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:23:14 -0400 (Thu, 21 Oct 2010) New Revision: 3330 Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.backupconso= le/pom.xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.browser/pom= .xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.config/pom.= xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fckeditor/p= om.xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jboss/pom.x= ml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jonas/pom.x= ml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.rest/pom.xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomcat/pom.= xml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclient/pom.x= ml jcr/branches/1.12.5-GA_REL/applications/exo.jcr.ear/pom.xml jcr/branches/1.12.5-GA_REL/applications/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.core/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.ext/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.ftp/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.component.webdav/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.connectors.localadapter/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.framework.command/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.framework.ftpclient/pom.xml jcr/branches/1.12.5-GA_REL/exo.jcr.framework.web/pom.xml jcr/branches/1.12.5-GA_REL/packaging/module/pom.xml jcr/branches/1.12.5-GA_REL/pom.xml Log: [maven-release-plugin] [SWF-580]prepare for next development iteration Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.back= upconsole/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.backupcons= ole/pom.xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.backupcons= ole/pom.xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.applications.backupconsole eXo JCR :: Applications :: Backup Console Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.brow= ser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.browser/po= m.xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.browser/po= m.xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.applications.browser war Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.conf= ig/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.config/pom= .xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.config/pom= .xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.applications.config pom Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fcke= ditor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fckeditor/= pom.xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.fckeditor/= pom.xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.applications.fckeditor war Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jbos= s/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jboss/pom.= xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jboss/pom.= xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA + 1.12.6-GA-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA + 1.12.6-GA-SNAPSHOT ear runtime Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jona= s/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jonas/pom.= xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.jonas/pom.= xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA + 1.12.6-GA-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA + 1.12.6-GA-SNAPSHOT ear runtime Modified: jcr/branches/1.12.5-GA_REL/applications/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/branches/1.12.5-GA_REL/applications/exo.jcr.applications.rest/pom.x= ml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.rest/pom.x= ml 2010-10-21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.applications.rest war Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomc= at/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomcat/pom= .xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.applications.tomcat/pom= .xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.applications.config = Modified: jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclien= t/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclient/pom.= xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.cluster.testclient/pom.= xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.cluster.testclient eXo JCR :: Cluster :: Test Client Modified: jcr/branches/1.12.5-GA_REL/applications/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.5-GA_REL/applications/exo.jcr.ear/pom.xml 2010-10-21 = 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/exo.jcr.ear/pom.xml 2010-10-21 = 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.ear ear Modified: jcr/branches/1.12.5-GA_REL/applications/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/applications/pom.xml 2010-10-21 15:22:27 UTC= (rev 3329) +++ jcr/branches/1.12.5-GA_REL/applications/pom.xml 2010-10-21 15:23:14 UTC= (rev 3330) @@ -22,12 +22,12 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT = 4.0.0 jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT = eXo JCR :: Applications :: Reactor pom Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.core/pom.xml 2010-10-21 15= :22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.core/pom.xml 2010-10-21 15= :23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.component.core eXo JCR :: Component :: Core Service Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.ext/pom.xml 2010-10-21 15:= 22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.ext/pom.xml 2010-10-21 15:= 23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.component.ext eXo JCR :: Component :: Extension Service Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.ftp/pom.xml 2010-10-21 15:= 22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.ftp/pom.xml 2010-10-21 15:= 23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.component.ftp eXo JCR :: Component :: FTP Service Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml 2010-10= -21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.statistics/pom.xml 2010-10= -21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.component.statistics eXo JCR :: Component :: Statistics Provider Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.component.webdav/pom.xml 2010-10-21 = 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.component.webdav/pom.xml 2010-10-21 = 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.component.webdav eXo JCR :: Component :: Webdav Service Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.connectors.localadapter/pom.xml 2010= -10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.connectors.localadapter/pom.xml 2010= -10-21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.connectors.localadapter rar Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en= /pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en/pom.x= ml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/en/pom.x= ml 2010-10-21 15:23:14 UTC (rev 3330) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs.developer - 1.12.5-GA + 1.12.6-GA-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/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/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/pom.xml = 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.docs/exo.jcr.docs.developer/pom.xml = 2010-10-21 15:23:14 UTC (rev 3330) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs - 1.12.5-GA + 1.12.6-GA-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml 2010-10-21 15:22:27 UTC= (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.docs/pom.xml 2010-10-21 15:23:14 UTC= (rev 3330) @@ -22,7 +22,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.framework.command/pom.xml 2010-10-21= 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.framework.command/pom.xml 2010-10-21= 15:23:14 UTC (rev 3330) @@ -12,7 +12,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.framework.command eXo JCR :: Framework :: Command Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.framework.ftpclient/pom.xml 2010-10-= 21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.framework.ftpclient/pom.xml 2010-10-= 21 15:23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.framework.ftpclient eXo JCR :: Framework :: FTP Client Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/exo.jcr.framework.web/pom.xml 2010-10-21 15:= 22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/exo.jcr.framework.web/pom.xml 2010-10-21 15:= 23:14 UTC (rev 3330) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT exo.jcr.framework.web eXo JCR :: Framework :: Web Modified: jcr/branches/1.12.5-GA_REL/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.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:22:27= UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/packaging/module/pom.xml 2010-10-21 15:23:14= UTC (rev 3330) @@ -4,7 +4,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT jcr.packaging.module pom Modified: jcr/branches/1.12.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:22:27 UTC (rev 3329) +++ jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:23:14 UTC (rev 3330) @@ -29,14 +29,14 @@ = org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-SNAPSHOT pom eXo JCR = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/1.= 12.5-GA - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= ags/1.12.5-GA - http://fisheye.jboss.org/browse/exo-jcr/jcr/tags/1.12.5-GA + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/branche= s/1.12.5-GA_REL + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/b= ranches/1.12.5-GA_REL + http://fisheye.jboss.org/browse/exo-jcr/jcr/branches/1.12.5-GA_RE= L = --===============2372084820545061357==-- From do-not-reply at jboss.org Thu Oct 21 11:40:16 2010 Content-Type: multipart/mixed; boundary="===============1119944333203159103==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3331 - jcr/branches/1.12.5-GA_REL. Date: Thu, 21 Oct 2010 11:40:16 -0400 Message-ID: <201010211540.o9LFeGX9010190@svn01.web.mwc.hst.phx2.redhat.com> --===============1119944333203159103== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-21 11:40:16 -0400 (Thu, 21 Oct 2010) New Revision: 3331 Modified: jcr/branches/1.12.5-GA_REL/pom.xml Log: [SWF-580] Upgrade dependencies to next snapshots Modified: jcr/branches/1.12.5-GA_REL/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:23:14 UTC (rev 3330) +++ jcr/branches/1.12.5-GA_REL/pom.xml 2010-10-21 15:40:16 UTC (rev 3331) @@ -42,9 +42,9 @@ exo-jcr 1.12 - 2.2.5-GA - 2.3.5-GA - 2.1.5-GA + 2.2.6-GA-SNAPSHOT + 2.3.6-GA-SNAPSHOT + 2.1.6-GA-SNAPSHOT 1 = --===============1119944333203159103==-- From do-not-reply at jboss.org Fri Oct 22 03:17:47 2010 Content-Type: multipart/mixed; boundary="===============2518147025679139001==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3332 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/backup. Date: Fri, 22 Oct 2010 03:17:47 -0400 Message-ID: <201010220717.o9M7HlrO018063@svn01.web.mwc.hst.phx2.redhat.com> --===============2518147025679139001== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-22 03:17:46 -0400 (Fri, 22 Oct 2010) New Revision: 3332 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/backup/backup-client.xml Log: JCR-1481 : Update documentation. Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-21 15:40:16 UTC (rev 3331) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/backup/backup-client.xml 2010-10-22 07:17:46 UTC (rev 3332) @@ -17,14 +17,12 @@ = - For GateIn should use context "/portal/rest". So to all url will= be - changed from "http://host:port/rest/..." to - "http://host:port/portal/rest/..." + GateIn uses context /portal/rest, therefore you need to use + http://host:port/portal/rest/ instread of http://host:port/rest/ = - GetIn is use form authentication, so you first need login over "= form - authentication" ( url to form authentication is - http://host:port/portal/login). And secont make request to - HTTPBackupAgent. + GateIn uses form authentication, so first you need to login (url= to + form authentication is http://host:port/portal/login) and then perform + requests. =
    @@ -974,15 +972,14 @@ Backup Client = - For GateIn should use context "/portal/rest". GetIn is use form - authentication, so you first need login over "form authentication" (= url - to form authentication is http://host:port/portal/login). And secont - make request to HTTPBackupAgent. + For GateIn should use context "/portal/rest". GateIn uses form + authentication, so first you need to login (url to form authenticati= on + is http://host:port/portal/login) and then perform requests. = = - Backup client is support form authenication. For example call - command "info" wirh form authentication to GateIn : + Backup client is support form authentication. For example call + command "info" with form authentication to GateIn : = ./jcrbackup.sh http://127.0.0.1:8080/portal/rest form POST "/portal/login?username=3Droot&password=3Dgtn" info --===============2518147025679139001==-- From do-not-reply at jboss.org Fri Oct 22 04:11:27 2010 Content-Type: multipart/mixed; boundary="===============7374693779356966620==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3333 - jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command. Date: Fri, 22 Oct 2010 04:11:26 -0400 Message-ID: <201010220811.o9M8BQC0026726@svn01.web.mwc.hst.phx2.redhat.com> --===============7374693779356966620== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2010-10-22 04:11:26 -0400 (Fri, 22 Oct 2010) New Revision: 3333 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/command/DeleteCommand.java Log: EXOJCR-1003 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 2010-10-22 07:17:46 UTC (rev 3332) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/DeleteCommand.java 2010-10-22 08:11:26 UTC (rev 3333) @@ -25,12 +25,13 @@ import javax.jcr.PathNotFoundException; import javax.jcr.RepositoryException; import javax.jcr.Session; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; = /** * Created by The eXo Platform SAS Author : Vitaly Guly. - * = + * * @version $Id: $ */ = @@ -39,7 +40,7 @@ = /** * Webdav Delete method implementation. - * = + * * @param session current session * @param path file path * @param lockTokenHeader lock tokens @@ -65,7 +66,8 @@ = if ((nodeLockToken =3D=3D null) || (!nodeLockToken.equals(l= ockTokenHeader))) { - return Response.status(HTTPStatus.LOCKED).build(); + return Response.status(HTTPStatus.LOCKED).entity("The " = + path + " item is locked. ").type( + MediaType.TEXT_PLAIN).build(); } } } --===============7374693779356966620==-- From do-not-reply at jboss.org Fri Oct 22 05:08:28 2010 Content-Type: multipart/mixed; boundary="===============4911026719130522860==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3334 - in jcr/trunk/exo.jcr.component.core/src/main: java/org/exoplatform/services/jcr/impl and 5 other directories. Date: Fri, 22 Oct 2010 05:08:28 -0400 Message-ID: <201010220908.o9M98SwE002290@svn01.web.mwc.hst.phx2.redhat.com> --===============4911026719130522860== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-22 05:08:28 -0400 (Fri, 22 Oct 2010) New Revision: 3334 Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/LockRemoverHolder.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/proccess/WorkerService.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/config/RepositoryInfo.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/RepositoryContainer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/LockManagerImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/LockRemover.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml Log: EXOJCR-999: WorkerService added, LockRemover made as single per-repository = thread Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/config/RepositoryInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/config/RepositoryInfo.java 2010-10-22 08:11:26 UTC (rev 3333) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/config/RepositoryInfo.java 2010-10-22 09:08:28 UTC (rev 3334) @@ -46,6 +46,8 @@ = protected long sessionTimeOut; = + protected int lockRemoverMaxThreadCount; + public RepositoryInfo() { = @@ -190,17 +192,43 @@ } = /** + * Returns LockRemovers per-repository max threads count. + * @return LockRemovers per-repository max threads count + */ + public int getLockRemoverThreadsCount() + { + return lockRemoverMaxThreadCount; + } + + /** + * Sets LockRemovers per-repository max threads count. + * @param lockRemoverMaxThreadCount + */ + public void setLockRemoverThreadsCount(int lockRemoverMaxThreadCount) + { + this.lockRemoverMaxThreadCount =3D lockRemoverMaxThreadCount; + } + + /** * Merges the current {@link RepositoryInfo} with the given one. The cu= rrent {@link RepositoryInfo} * has the highest priority thus only absent data will be overrode * @param entry the entry to merge with the current {@link RepositoryIn= fo} */ void merge(RepositoryInfo entry) { - if (systemWorkspaceName =3D=3D null) setSystemWorkspaceName(entry.sy= stemWorkspaceName); - if (defaultWorkspaceName =3D=3D null) setDefaultWorkspaceName(entry.= defaultWorkspaceName); - if (accessControl =3D=3D null) setAccessControl(entry.accessControl); - if (securityDomain =3D=3D null) setSecurityDomain(entry.securityDoma= in); - if (authenticationPolicy =3D=3D null) setAuthenticationPolicy(entry.= authenticationPolicy); - if (sessionTimeOut =3D=3D 0) setSessionTimeOut(entry.sessionTimeOut); - } = + if (systemWorkspaceName =3D=3D null) + setSystemWorkspaceName(entry.systemWorkspaceName); + if (defaultWorkspaceName =3D=3D null) + setDefaultWorkspaceName(entry.defaultWorkspaceName); + if (accessControl =3D=3D null) + setAccessControl(entry.accessControl); + if (securityDomain =3D=3D null) + setSecurityDomain(entry.securityDomain); + if (authenticationPolicy =3D=3D null) + setAuthenticationPolicy(entry.authenticationPolicy); + if (sessionTimeOut =3D=3D 0) + setSessionTimeOut(entry.sessionTimeOut); + if (lockRemoverMaxThreadCount =3D=3D 0) + setLockRemoverThreadsCount(entry.lockRemoverMaxThreadCount); + } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-22 08:11:26 UTC (rev 3333) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2010-10-22 09:08:28 UTC (rev 3334) @@ -43,6 +43,7 @@ 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.lock.LockRemoverHolder; 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; @@ -516,6 +517,7 @@ // WorkspaceFileCleanerHolder - is a common holder for all workspace= s. = // It is used to initialize FileValueStorage registerComponentImplementation(FileCleanerHolder.class); + registerComponentImplementation(LockRemoverHolder.class); registerWorkspacesComponents(); registerRepositoryComponents(); } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockManagerImpl.java 2010-10-22 08:11:26 UTC (rev 3333) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockManagerImpl.java 2010-10-22 09:08:28 UTC (rev 3334) @@ -22,7 +22,6 @@ 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.dataflow.ChangesLogIterator; @@ -52,6 +51,7 @@ import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; +import org.exoplatform.services.security.IdentityConstants; import org.picocontainer.Startable; = import java.io.IOException; @@ -146,12 +146,14 @@ * @param dataManager * @param config */ - public LockManagerImpl(WorkspacePersistentDataManager dataManager, Work= spaceEntry config) + public LockManagerImpl(WorkspacePersistentDataManager dataManager, Work= spaceEntry config, + LockRemoverHolder lockRemoverHolder) { - this(dataManager, config, null); + this(dataManager, config, null, lockRemoverHolder); } = - public LockManagerImpl(WorkspacePersistentDataManager dataManager, Work= spaceEntry config, LockPersister persister) + public LockManagerImpl(WorkspacePersistentDataManager dataManager, Work= spaceEntry config, LockPersister persister, + LockRemoverHolder lockRemoverHolder) { = this.dataManager =3D dataManager; @@ -169,6 +171,7 @@ tokensMap =3D new HashMap(); = dataManager.addItemPersistenceListener(this); + lockRemover =3D lockRemoverHolder.getLockRemover(this); } = public synchronized void addLockToken(String sessionId, String lt) @@ -468,7 +471,7 @@ */ public void start() { - lockRemover =3D new LockRemover(this); + lockRemover.start(); } = // Quick method. We need to reconstruct @@ -503,8 +506,8 @@ */ public void stop() { - lockRemover.halt(); - lockRemover.interrupt(); + lockRemover.stop(); + locks.clear(); pendingLocks.clear(); tokensMap.clear(); @@ -701,7 +704,7 @@ { NodeData nData =3D (NodeData)dataManager.getItemData(nodeIdentifi= er); PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), SystemIden= tity.SYSTEM, ExtendedEvent.UNLOCK); + new PlainChangesLogImpl(new ArrayList(), IdentityCo= nstants.SYSTEM, ExtendedEvent.UNLOCK); = ItemData lockOwner =3D copyItemData((PropertyData)dataManager.getItemData(nData, new = QPathEntry(Constants.JCR_LOCKOWNER, 1), Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockRemover.java 2010-10-22 08:11:26 UTC (rev 3333) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockRemover.java 2010-10-22 09:08:28 UTC (rev 3334) @@ -18,47 +18,68 @@ */ 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; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; = +import java.util.concurrent.ScheduledFuture; + /** * Created by The eXo Platform SAS. * = * @author Sergey Kabashn= yuk * @version $Id: LockRemover.java 11987 2008-03-17 09:06:06Z ksm $ */ -public class LockRemover extends WorkerThread +public class LockRemover { + public static final long DEFAULT_THREAD_TIMEOUT =3D 30000; // 30 sec = - private final Log log =3D ExoLogger.getLogger("exo.jcr.component.core.L= ockRemover"); + private final WorkerService workerService; = - public static final long DEFAULT_THREAD_TIMEOUT =3D 30000; // 30 + private final WorkspaceLockManager lockManager; = - // sec + private final long timeout; = - private final WorkspaceLockManager lockManagerImpl; + private ScheduledFuture lockRemoverTask =3D null; = - public LockRemover(WorkspaceLockManager lockManagerImpl) + class LockRemoverTask implements Runnable { - this(lockManagerImpl, DEFAULT_THREAD_TIMEOUT); + private final WorkspaceLockManager lockManager; + + LockRemoverTask(WorkspaceLockManager lockManager) + { + this.lockManager =3D lockManager; + } + + public void run() + { + lockManager.removeExpired(); + } } = - private LockRemover(WorkspaceLockManager lockManagerImpl, long timeout) + protected LockRemover(WorkerService workerService, WorkspaceLockManager= lockManager) { - 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); + this(workerService, lockManager, DEFAULT_THREAD_TIMEOUT); } = - @Override - protected void callPeriodically() throws Exception + protected LockRemover(WorkerService workerService, WorkspaceLockManager= lockManager, long timeout) { - lockManagerImpl.removeExpired(); + this.workerService =3D workerService; + this.lockManager =3D lockManager; + this.timeout =3D timeout; } + + public void start() + { + if (lockRemoverTask !=3D null) + { + stop(); + } + lockRemoverTask =3D workerService.executePeriodically(new LockRemove= rTask(lockManager), timeout); + } + + public void stop() + { + lockRemoverTask.cancel(false); + lockRemoverTask =3D null; + } + } Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/core/lock/LockRemoverHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/LockRemoverHolder.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockRemoverHolder.java 2010-10-22 09:08:28 UTC (rev 333= 4) @@ -0,0 +1,65 @@ +package org.exoplatform.services.jcr.impl.core.lock; + +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; + +/** + * LockRemoverHolder holds is a single per-repository LockRemover containe= r. + * @author Foo Bar + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ah= eritier $ + * + */ +public class LockRemoverHolder +{ + + /** + * Default amount of thread that may be used by WorkerService to serve = LockRemovers. + */ + public final int DEFAULT_THREAD_COUNT =3D 1; + + /** + * WorkerService that executed LockRemover. + */ + private final WorkerService workerService; + + /** + * Constructor. + * @param entry - RepositoryEntry that may contain lock-remover-max-thr= eads parameter. + */ + public LockRemoverHolder(RepositoryEntry entry) + { + int threadCount =3D DEFAULT_THREAD_COUNT; + if (entry !=3D null) + { + if (entry.getLockRemoverThreadsCount() > 0) + { + threadCount =3D entry.getLockRemoverThreadsCount(); + } + } + workerService =3D new WorkerService(threadCount, "lock-remover"); + } + + /** + * Returns LockRemover object that removes expired locks from LockManag= er. Default timeout used. + * = + * @param lockManager - LockManager that going to be cleaned with retur= ned LockRemover. + * @return LockRemover + */ + public LockRemover getLockRemover(WorkspaceLockManager lockManager) + { + return new LockRemover(workerService, lockManager); + } + + /** + * Returns LockRemover object that removes expired locks from LockManag= er. + * = + * @param lockManager - LockManager that going to be cleaned with retur= ned LockRemover. + * @param timeout - LockRemover will check LockManager with delay sette= d in timeout parameter + * @return LockRemover + */ + public LockRemover getLockRemover(WorkspaceLockManager lockManager, lon= g timeout) + { + return new LockRemover(workerService, lockManager, timeout); + } + +} Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-22 08:= 11:26 UTC (rev 3333) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-22 09:= 08:28 UTC (rev 3334) @@ -21,7 +21,6 @@ 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.MappedParametrizedObjectEntry; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.SimpleParameterEntry; @@ -43,6 +42,7 @@ import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.core.lock.LockRemover; +import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder; import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager; import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; @@ -57,6 +57,7 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.naming.InitialContextInitializer; +import org.exoplatform.services.security.IdentityConstants; import org.exoplatform.services.transaction.TransactionService; import org.jboss.cache.Cache; import org.jboss.cache.CacheSPI; @@ -173,7 +174,7 @@ private Cache cache; = private final Fqn lockRoot; - = + private final boolean shareable; = /** @@ -192,10 +193,10 @@ * @throws RepositoryConfigurationException */ public CacheableLockManagerImpl(WorkspacePersistentDataManager dataMana= ger, WorkspaceEntry config, - InitialContextInitializer context, TransactionService transactionSer= vice, ConfigurationManager cfm) - throws RepositoryConfigurationException, RepositoryException + InitialContextInitializer context, TransactionService transactionSer= vice, ConfigurationManager cfm, + LockRemoverHolder lockRemoverHolder) throws RepositoryConfigurationE= xception, RepositoryException { - this(dataManager, config, context, transactionService.getTransaction= Manager(), cfm); + this(dataManager, config, context, transactionService.getTransaction= Manager(), cfm, lockRemoverHolder); } = /** @@ -207,10 +208,10 @@ * @throws RepositoryConfigurationException */ public CacheableLockManagerImpl(WorkspacePersistentDataManager dataMana= ger, WorkspaceEntry config, - InitialContextInitializer context, ConfigurationManager cfm) throws = RepositoryConfigurationException, - RepositoryException + InitialContextInitializer context, ConfigurationManager cfm, LockRem= overHolder lockRemoverHolder) + throws RepositoryConfigurationException, RepositoryException { - this(dataManager, config, context, (TransactionManager)null, cfm); + this(dataManager, config, context, (TransactionManager)null, cfm, lo= ckRemoverHolder); = } = @@ -225,8 +226,8 @@ * @throws RepositoryConfigurationException */ public CacheableLockManagerImpl(WorkspacePersistentDataManager dataMana= ger, WorkspaceEntry config, - InitialContextInitializer context, TransactionManager transactionMan= ager, ConfigurationManager cfm) - throws RepositoryConfigurationException, RepositoryException + InitialContextInitializer context, TransactionManager transactionMan= ager, ConfigurationManager cfm, + LockRemoverHolder lockRemoverHolder) throws RepositoryConfigurationE= xception, RepositoryException { lockRoot =3D Fqn.fromElements(config.getUniqueName(), LOCKS); = @@ -270,7 +271,7 @@ cache =3D factory.createCache(config.getLockManager()); = Fqn rootFqn =3D Fqn.fromElements(config.getUniqueName()); - = + shareable =3D config.getLockManager().getParameterBoolean(JBOSSCACHE_SHAREAB= LE, JBOSSCACHE_SHAREABLE_DEFAULT) .booleanValue(); @@ -292,6 +293,8 @@ { throw new RepositoryConfigurationException("Cache configuration n= ot found"); } + + lockRemover =3D lockRemoverHolder.getLockRemover(this); } = /** @@ -819,7 +822,7 @@ */ public void start() { - lockRemover =3D new LockRemover(this); + lockRemover.start(); } = /* @@ -828,17 +831,17 @@ */ public void stop() { - lockRemover.halt(); - lockRemover.interrupt(); + lockRemover.stop(); + sessionLockManagers.clear(); if (shareable) { // The cache cannot be stopped since it can be shared so we evict= the root node instead - cache.evict(lockRoot); = + cache.evict(lockRoot); } else { - PrivilegedCacheHelper.stop(cache); = + PrivilegedCacheHelper.stop(cache); } } = @@ -1112,7 +1115,7 @@ } = PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), SystemIden= tity.SYSTEM, ExtendedEvent.UNLOCK); + new PlainChangesLogImpl(new ArrayList(), IdentityCo= nstants.SYSTEM, ExtendedEvent.UNLOCK); = ItemData lockOwner =3D copyItemData((PropertyData)dataManager.getItemData(nData, new = QPathEntry(Constants.JCR_LOCKOWNER, 1), Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java 2010-= 10-22 08:11:26 UTC (rev 3333) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java 2010-= 10-22 09:08:28 UTC (rev 3334) @@ -21,7 +21,6 @@ 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.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.SimpleParameterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; @@ -42,6 +41,7 @@ import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.core.lock.LockRemover; +import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder; import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager; import org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLoc= kManager; import org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSes= sionLockManager; @@ -55,6 +55,7 @@ import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.naming.InitialContextInitializer; +import org.exoplatform.services.security.IdentityConstants; import org.exoplatform.services.transaction.TransactionService; import org.jboss.cache.Cache; import org.jboss.cache.Fqn; @@ -161,10 +162,10 @@ * @throws RepositoryConfigurationException */ public CacheableJDBCLockManagerImpl(WorkspacePersistentDataManager data= Manager, WorkspaceEntry config, - InitialContextInitializer context, TransactionService transactionSer= vice, ConfigurationManager cfm) - throws RepositoryConfigurationException, RepositoryException + InitialContextInitializer context, TransactionService transactionSer= vice, ConfigurationManager cfm, + LockRemoverHolder lockRemoverHolder) throws RepositoryConfigurationE= xception, RepositoryException { - this(dataManager, config, context, transactionService.getTransaction= Manager(), cfm); + this(dataManager, config, context, transactionService.getTransaction= Manager(), cfm, lockRemoverHolder); } = /** @@ -176,10 +177,10 @@ * @throws RepositoryConfigurationException */ public CacheableJDBCLockManagerImpl(WorkspacePersistentDataManager data= Manager, WorkspaceEntry config, - InitialContextInitializer context, ConfigurationManager cfm) throws = RepositoryConfigurationException, - RepositoryException + InitialContextInitializer context, ConfigurationManager cfm, LockRem= overHolder lockRemoverHolder) + throws RepositoryConfigurationException, RepositoryException { - this(dataManager, config, context, (TransactionManager)null, cfm); + this(dataManager, config, context, (TransactionManager)null, cfm, lo= ckRemoverHolder); } = /** @@ -194,8 +195,8 @@ * @throws RepositoryException = */ public CacheableJDBCLockManagerImpl(WorkspacePersistentDataManager data= Manager, WorkspaceEntry config, - InitialContextInitializer context, TransactionManager transactionMan= ager, ConfigurationManager cfm) - throws RepositoryConfigurationException, RepositoryException + InitialContextInitializer context, TransactionManager transactionMan= ager, ConfigurationManager cfm, + LockRemoverHolder lockRemoverHolder) throws RepositoryConfigurationE= xception, RepositoryException { lockRoot =3D Fqn.fromElements(LOCKS); = @@ -250,6 +251,8 @@ { throw new RepositoryConfigurationException("Cache configuration n= ot found"); } + + lockRemover =3D lockRemoverHolder.getLockRemover(this); } = @Managed @@ -598,7 +601,7 @@ */ public void start() { - lockRemover =3D new LockRemover(this); + lockRemover.start(); } = /** @@ -606,8 +609,8 @@ */ public void stop() { - lockRemover.halt(); - lockRemover.interrupt(); + lockRemover.stop(); + sessionLockManagers.clear(); cache.stop(); } @@ -947,7 +950,7 @@ } = PlainChangesLog changesLog =3D - new PlainChangesLogImpl(new ArrayList(), SystemIden= tity.SYSTEM, ExtendedEvent.UNLOCK); + new PlainChangesLogImpl(new ArrayList(), IdentityCo= nstants.SYSTEM, ExtendedEvent.UNLOCK); = ItemData lockOwner =3D copyItemData((PropertyData)dataManager.getItemData(nData, new = QPathEntry(Constants.JCR_LOCKOWNER, 1), Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/proccess/WorkerService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/proccess/WorkerService.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/proccess/WorkerService.java 2010-10-22 09:08:28 UTC (rev 3334) @@ -0,0 +1,84 @@ +package org.exoplatform.services.jcr.impl.proccess; + +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +public class WorkerService +{ + /** + * Executor that process assigned command periodically. + */ + private final ScheduledThreadPoolExecutor executor; + + class WorkerThreadFactory implements ThreadFactory + { + final AtomicInteger poolNumber =3D new AtomicInteger(1); + + final ThreadGroup group; + + final AtomicInteger threadNumber =3D new AtomicInteger(1); + + final String namePrefix; + + WorkerThreadFactory(String namePrefix) + { + SecurityManager s =3D System.getSecurityManager(); + group =3D (s !=3D null) ? s.getThreadGroup() : Thread.currentThre= ad().getThreadGroup(); + this.namePrefix =3D namePrefix + poolNumber.getAndIncrement() + "= -thread-"; + } + + public Thread newThread(Runnable r) + { + Thread t =3D new Thread(group, r, namePrefix + threadNumber.getAn= dIncrement(), 0); + if (t.isDaemon()) + t.setDaemon(false); + if (t.getPriority() !=3D Thread.NORM_PRIORITY) + t.setPriority(Thread.NORM_PRIORITY); + return t; + } + } + + /** + * Constructor. + * = + * @param threadCount - max thread count that executor may use + */ + public WorkerService(int threadCount) + { + executor =3D new ScheduledThreadPoolExecutor(threadCount); + } + + /** + * Constructor. + * = + * @param threadCount - max thread count that executor may use + * @param threadNamePrefix - thread name prefix + */ + public WorkerService(int threadCount, String threadNamePrefix) + { + executor =3D new ScheduledThreadPoolExecutor(threadCount, new Worker= ThreadFactory(threadNamePrefix)); + } + + /** + * Execute specified command periodically with delay= . + * = + * @param command - command that must be executed + * @param delay - delay between each command execution = + * @return + */ + public ScheduledFuture executePeriodically(Runnable command, long delay) + { + return executor.scheduleWithFixedDelay(command, 0, delay, TimeUnit.M= ILLISECONDS); + } + + /** + * Initiates an orderly shutdown in which previously submitted tasks ar= e executed, but no new tasks will be accepted. = + */ + public void stop() + { + executor.shutdown(); + } +} Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resources/binding.xml 2010-10= -22 08:11:26 UTC (rev 3333) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml 2010-10= -22 09:08:28 UTC (rev 3334) @@ -17,6 +17,8 @@ + --===============4911026719130522860==-- From do-not-reply at jboss.org Fri Oct 22 06:13:47 2010 Content-Type: multipart/mixed; boundary="===============8441409602286843392==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3335 - ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/method/filter. Date: Fri, 22 Oct 2010 06:13:47 -0400 Message-ID: <201010221013.o9MADl5F011497@svn01.web.mwc.hst.phx2.redhat.com> --===============8441409602286843392== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2010-10-22 06:13:46 -0400 (Fri, 22 Oct 2010) New Revision: 3335 Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext= /method/filter/MethodAccessFilter.java Log: EXOJCR-1002 Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/r= est/ext/method/filter/MethodAccessFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/services/rest/ex= t/method/filter/MethodAccessFilter.java 2010-10-22 09:08:28 UTC (rev 3334) +++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ex= t/method/filter/MethodAccessFilter.java 2010-10-22 10:13:46 UTC (rev 3335) @@ -28,13 +28,15 @@ import javax.annotation.security.PermitAll; import javax.annotation.security.RolesAllowed; import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.SecurityContext; = /** * Contract of this class thats constrains access to the resource method t= hat - * use JSR-250 security common annotations. See also https://jsr250.dev.ja= va.net . - * = + * use JSR-250 security common annotations. See also https://jsr250.dev.ja= va.net + * . + * * @author Andrey Parfonov * @version $Id: $ */ @@ -44,7 +46,7 @@ /** * Check does method contains one on of security annotations * PermitAll, DenyAll, RolesAllowed. - * = + * * @see PermitAll * @see DenyAll * @see RolesAllowed {@inheritDoc} @@ -66,7 +68,9 @@ { = // nobody allowed to call method - throw new WebApplicationException(Response.status(Response.Sta= tus.FORBIDDEN).build()); + throw new WebApplicationException(Response.status(Response.Sta= tus.FORBIDDEN).entity( + "You do not have access rights to this resource, please con= tact your administrator. ").type( + MediaType.TEXT_PLAIN).build()); = } if (ac =3D=3D RolesAllowed.class) @@ -78,14 +82,16 @@ return; = // user is not in allowed roles - throw new WebApplicationException(Response.status(Response.Sta= tus.FORBIDDEN).build()); + throw new WebApplicationException(Response.status(Response.Sta= tus.FORBIDDEN).entity( + "You do not have access rights to this resource, please con= tact your administrator. ").type( + MediaType.TEXT_PLAIN).build()); } } } = /** * Extract roles from {@link RolesAllowed} annotation. - * = + * * @param roles See {@link RolesAllowed} * @return roles */ --===============8441409602286843392==-- From do-not-reply at jboss.org Fri Oct 22 06:32:02 2010 Content-Type: multipart/mixed; boundary="===============4313717510474076774==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3336 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation and 1 other directories. Date: Fri, 22 Oct 2010 06:32:02 -0400 Message-ID: <201010221032.o9MAW2Zi012152@svn01.web.mwc.hst.phx2.redhat.com> --===============4313717510474076774== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-22 06:32:02 -0400 (Fri, 22 Oct 2010) New Revision: 3336 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/storage/JDBCWDCTest.java Log: EXOJCR-999: FileCleanerHolder now used in JDBCWorkspaceDataContainer Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-10-22 10:13:46 = UTC (rev 3335) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-10-22 10:32:02 = UTC (rev 3336) @@ -34,6 +34,7 @@ import org.exoplatform.services.jcr.impl.storage.jdbc.statistics.Statistic= sJDBCStorageConnection; import org.exoplatform.services.jcr.impl.storage.jdbc.update.StorageUpdate= Manager; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException; @@ -205,8 +206,9 @@ * if JNDI exception (on DataSource lookup) */ public JDBCWorkspaceDataContainer(WorkspaceEntry wsConfig, RepositoryEn= try repConfig, - InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider) - throws RepositoryConfigurationException, NamingException, Repository= Exception, IOException + InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider, + FileCleanerHolder fileCleanerHolder) throws RepositoryConfigurationE= xception, NamingException, + RepositoryException, IOException { = // This recall is workaround for tenants creation. There is a troubl= e in visibility datasource @@ -397,7 +399,7 @@ PrivilegedFileHelper.mkdirs(swapDirectory); } = - this.swapCleaner =3D new FileCleaner(false); + this.swapCleaner =3D fileCleanerHolder.getFileCleaner(); = initDatabase(); = @@ -866,7 +868,6 @@ */ public void start() { - this.swapCleaner.start(); } = /** @@ -874,8 +875,6 @@ */ public void stop() { - this.swapCleaner.halt(); - this.swapCleaner.interrupt(); = // TODO HSQLDB Stop (debug) // if (dbDialect.equals(DB_DIALECT_GENERIC) || Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/optimisation/CQJDBCWorkspaceDataContainer.java 2010-= 10-22 10:13:46 UTC (rev 3335) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java 2010-= 10-22 10:32:02 UTC (rev 3336) @@ -33,6 +33,7 @@ import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.HSQL= DBConnectionFactory; import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.MySQ= LConnectionFactory; import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.Orac= leConnectionFactory; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.naming.InitialContextInitializer; @@ -67,10 +68,11 @@ * if JNDI exception (on DataSource lookup) */ public CQJDBCWorkspaceDataContainer(WorkspaceEntry wsConfig, Repository= Entry repConfig, - InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider) - throws RepositoryConfigurationException, NamingException, Repository= Exception, IOException + InitialContextInitializer contextInit, ValueStoragePluginProvider va= lueStorageProvider, + FileCleanerHolder fileCleanerHolder) throws RepositoryConfigurationE= xception, NamingException, + RepositoryException, IOException { - super(wsConfig, repConfig, contextInit, valueStorageProvider); + super(wsConfig, repConfig, contextInit, valueStorageProvider, fileCl= eanerHolder); } = /** Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWDCTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/JDBCWDCTest.java 2010-10-22 10:13:46 UTC (rev 3335) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/JDBCWDCTest.java 2010-10-22 10:32:02 UTC (rev 3336) @@ -18,17 +18,6 @@ */ package org.exoplatform.services.jcr.impl.storage; = -import java.sql.Connection; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; - -import javax.jcr.PropertyType; -import javax.naming.InitialContext; -import javax.naming.Reference; -import javax.naming.StringRefAddr; -import javax.sql.DataSource; - import junit.framework.TestCase; = import org.exoplatform.services.jcr.access.AccessControlList; @@ -52,6 +41,17 @@ import org.exoplatform.services.log.Log; import org.exoplatform.services.log.LogConfigurationInitializer; = +import java.sql.Connection; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import javax.jcr.PropertyType; +import javax.naming.InitialContext; +import javax.naming.Reference; +import javax.naming.StringRefAddr; +import javax.sql.DataSource; + /** * Created by The eXo Platform SAS. * = @@ -104,9 +104,11 @@ // ref.add(new StringRefAddr("database", "jdbc:hsqldb:file:data/test= ")); = // SimpleJNDIContextInitializer.initialize(sourceName, ref); + FileCleanerHolder holder =3D new FileCleanerHolder(); = container =3D - new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config, new FileCleanerHolder())); + new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config, + holder), holder); = Properties logProps =3D new Properties(); logProps.put("org.apache.commons.logging.simplelog.defaultlog", "deb= ug"); --===============4313717510474076774==-- From do-not-reply at jboss.org Fri Oct 22 07:24:13 2010 Content-Type: multipart/mixed; boundary="===============3770507825795844720==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3337 - in jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr: impl/storage/value/fs and 1 other directories. Date: Fri, 22 Oct 2010 07:24:12 -0400 Message-ID: <201010221124.o9MBOCMx020510@svn01.web.mwc.hst.phx2.redhat.com> --===============3770507825795844720== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-22 07:24:11 -0400 (Fri, 22 Oct 2010) New Revision: 3337 Modified: 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/impl/storage/value/fs/CASableFileIOChannelTestBase.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/storage/value/fs/TestFileIOChannel.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestPersistedValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestTransientValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestValueImpl.java Log: EXOJCR-999: tests updated - now unused FileCleaners will be stopped 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 2010-10-22 10:32:02 UTC (rev 3336) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/BaseStandaloneTest.java 2010-10-22 11:24:11 UTC (rev 3337) @@ -153,8 +153,7 @@ wconf.getContainer().getParameterInteger(WorkspaceDataContainer.M= AXBUFFERSIZE_PROP, WorkspaceDataContainer.DEF_MAXBUFFERSIZE); = - FileCleanerHolder wfcleaner =3D - (FileCleanerHolder)wsc.getComponent(FileCleanerHolder.class); + FileCleanerHolder wfcleaner =3D (FileCleanerHolder)wsc.getComponent(= FileCleanerHolder.class); fileCleaner =3D wfcleaner.getFileCleaner(); holder =3D new ReaderSpoolFileHolder(); } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/value/fs/CASableFileIOChannelTestBase.java 2010-10-22 10:= 32:02 UTC (rev 3336) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2010-10-22 11:= 24:11 UTC (rev 3337) @@ -24,7 +24,6 @@ import org.exoplatform.services.jcr.impl.storage.value.cas.RecordAlreadyEx= istsException; import org.exoplatform.services.jcr.impl.storage.value.cas.RecordNotFoundE= xception; import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAdd= ressStorage; -import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -48,8 +47,6 @@ = protected ValueContentAddressStorage vcas; = - protected FileCleaner fileCleaner; - protected File rootDir; = protected String storageId; @@ -61,9 +58,6 @@ { super.setUp(); = - if (fileCleaner =3D=3D null) - fileCleaner =3D new FileCleaner(); - if (vcas =3D=3D null) initVCAS(); = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/TestFileIOChannel.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/value/fs/TestFileIOChannel.java 2010-10-22 10:32:02 UTC (= rev 3336) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/value/fs/TestFileIOChannel.java 2010-10-22 11:24:11 UTC (= rev 3337) @@ -43,7 +43,7 @@ = private File rootDir; = - private FileCleaner cleaner =3D new FileCleaner(2000); + private FileCleaner cleaner; = private ValueDataResourceHolder resources =3D new ValueDataResourceHold= er(); = @@ -57,6 +57,8 @@ { super.setUp(); = + cleaner =3D new FileCleaner(2000); + rootDir =3D new File(new File("target"), "vs1"); rootDir.mkdirs(); = @@ -67,6 +69,15 @@ = } = + /** + * {@inheritDoc} + */ + @Override + protected void tearDown() throws Exception + { + cleaner.halt(); + } + public void testRead() throws Exception { = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestPersistedValueData.java 2010-10-22 10:32:02 UTC (rev 33= 36) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestPersistedValueData.java 2010-10-22 11:24:11 UTC (rev 33= 37) @@ -81,27 +81,34 @@ = public void testIfFinalizeRemovesTempFileStreamValueData() throws Excep= tion { + FileCleaner testFileCleaner =3D new FileCleaner(1000, true); + try + { + byte[] buf =3D "0123456789".getBytes(); + SwapFile file =3D SwapFile.get(new File("target"), "testIfFinaliz= eRemovesTempFileStreamValueData"); + //File file =3D new File("target/testIfFinalizeRemovesTempFileStr= eamValueData"); + //if (file.exists()) + // file.delete(); + FileOutputStream out =3D new FileOutputStream(file); + out.write(buf); + out.close(); = - byte[] buf =3D "0123456789".getBytes(); - SwapFile file =3D SwapFile.get(new File("target"), "testIfFinalizeRe= movesTempFileStreamValueData"); - //File file =3D new File("target/testIfFinalizeRemovesTempFileStream= ValueData"); - //if (file.exists()) - // file.delete(); - FileOutputStream out =3D new FileOutputStream(file); - out.write(buf); - out.close(); + CleanableFilePersistedValueData vd =3D new CleanableFilePersisted= ValueData(0, file, testFileCleaner); + assertTrue(file.exists()); = - CleanableFilePersistedValueData vd =3D new CleanableFilePersistedVal= ueData(0, file, new FileCleaner(1000, true)); - assertTrue(file.exists()); + vd =3D null; + System.gc(); = - vd =3D null; - System.gc(); + // allows GC to call finalize on vd + Thread.sleep(2500); + System.gc(); = - // allows GC to call finalize on vd - Thread.sleep(2500); - System.gc(); - - assertFalse(file.exists()); + assertFalse(file.exists()); + } + finally + { + testFileCleaner.halt(); + } } = public void testConcurrentFileStreamValueDataReading() throws Exception Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestTransientValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestTransientValueData.java 2010-10-22 10:32:02 UTC (rev 33= 36) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestTransientValueData.java 2010-10-22 11:24:11 UTC (rev 33= 37) @@ -66,37 +66,46 @@ = public void testCreateFileStreamTransientValueData() throws Exception { + FileCleaner testFileCleaner =3D new FileCleaner(); + try + { + byte[] buf =3D "0123456789".getBytes(); + File file =3D new File("target/testCreateFileStreamTransientValue= Data"); + if (file.exists()) + file.delete(); + FileOutputStream out =3D new FileOutputStream(file); + out.write(buf); + out.close(); = - byte[] buf =3D "0123456789".getBytes(); - File file =3D new File("target/testCreateFileStreamTransientValueDat= a"); - if (file.exists()) - file.delete(); - FileOutputStream out =3D new FileOutputStream(file); - out.write(buf); - out.close(); + FileInputStream fs1 =3D new FileInputStream(file); + TransientValueData vd =3D + new TransientValueData(0, null, fs1, null, testFileCleaner, 5,= new File("target"), true); = - FileInputStream fs1 =3D new FileInputStream(file); - TransientValueData vd =3D new TransientValueData(0, null, fs1, null,= new FileCleaner(), 5, new File("target"), true); + // spool to file + InputStream fs2 =3D vd.getAsStream(); + assertEquals(10, vd.getLength()); + assertTrue(fs2 instanceof FileInputStream); = - // spool to file - InputStream fs2 =3D vd.getAsStream(); - assertEquals(10, vd.getLength()); - assertTrue(fs2 instanceof FileInputStream); + // not the same object as new is is from spool file + assertNotSame(fs1, fs2); + // spooled to file so not a byte array + assertFalse(vd.isByteArray()); = - // not the same object as new is is from spool file - assertNotSame(fs1, fs2); - // spooled to file so not a byte array - assertFalse(vd.isByteArray()); + // next call return not the same object as well + // (new stream every time) + assertNotSame(vd.getAsStream(), fs2); + assertEquals(10, vd.getLength()); = - // next call return not the same object as well - // (new stream every time) - assertNotSame(vd.getAsStream(), fs2); - assertEquals(10, vd.getLength()); + // gets as byte array + assertEquals(10, vd.getAsByteArray().length); + // but still spooled to file + assertFalse(vd.isByteArray()); = - // gets as byte array - assertEquals(10, vd.getAsByteArray().length); - // but still spooled to file - assertFalse(vd.isByteArray()); + } + finally + { + testFileCleaner.halt(); + } = } = @@ -118,7 +127,7 @@ // TODO not influenced here as will be spooled to byte array anyway //vd.setMaxBufferSize(5); //vd.setFileCleaner(new FileCleaner()); - = + // InputStream fs2 =3D vd.getAsStream(); assertEquals(10, vd.getLength()); Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestValueImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestValueImpl.java 2010-10-22 10:32:02 UTC (rev 3336) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestValueImpl.java 2010-10-22 11:24:11 UTC (rev 3337) @@ -50,43 +50,51 @@ = public void testNewBinaryValue() throws Exception { + FileCleaner testFileCleaner =3D new FileCleaner(); = - byte[] buf =3D "012345678901234567890123456789".getBytes(); - File file =3D new File("target/testNewBinaryValue"); - if (file.exists()) - file.delete(); - FileOutputStream out =3D new FileOutputStream(file); - out.write(buf); - out.close(); + try + { + byte[] buf =3D "012345678901234567890123456789".getBytes(); + File file =3D new File("target/testNewBinaryValue"); + if (file.exists()) + file.delete(); + FileOutputStream out =3D new FileOutputStream(file); + out.write(buf); + out.close(); = - FileInputStream fs1 =3D new FileInputStream(file); - BinaryValue val =3D new BinaryValue(fs1, new FileCleaner(), tempDire= ctory, maxFufferSize); - InputStream str1 =3D val.getStream(); - assertNotNull(str1); + FileInputStream fs1 =3D new FileInputStream(file); + BinaryValue val =3D new BinaryValue(fs1, testFileCleaner, tempDir= ectory, maxFufferSize); + InputStream str1 =3D val.getStream(); + assertNotNull(str1); = - // obj returned by getStream() is not the same as incoming stream - assertNotSame(str1, fs1); + // obj returned by getStream() is not the same as incoming stream + assertNotSame(str1, fs1); = - // streams returned by subsequent call of val.getStream() are equals - assertEquals(str1, val.getStream()); + // streams returned by subsequent call of val.getStream() are equ= als + assertEquals(str1, val.getStream()); = - // another one value using the same string - BinaryValue val2 =3D new BinaryValue(fs1, new FileCleaner(), tempDir= ectory, maxFufferSize); - InputStream str2 =3D val2.getStream(); + // another one value using the same string + BinaryValue val2 =3D new BinaryValue(fs1, testFileCleaner, tempDi= rectory, maxFufferSize); + InputStream str2 =3D val2.getStream(); = - // are not the same although created from same Stream - assertNotSame(str1, str2); + // are not the same although created from same Stream + assertNotSame(str1, str2); = - // stream already consumed - try - { - val.getString(); - fail("IllegalStateException should have been thrown"); + // stream already consumed + try + { + val.getString(); + fail("IllegalStateException should have been thrown"); + } + catch (IllegalStateException e) + { + } + // System.out.println(" >>>>>>>>STRING >>> "+); } - catch (IllegalStateException e) + finally { + testFileCleaner.halt(); } - // System.out.println(" >>>>>>>>STRING >>> "+); } = public void testNewBinaryValueFromString() throws Exception --===============3770507825795844720==-- From do-not-reply at jboss.org Fri Oct 22 10:47:58 2010 Content-Type: multipart/mixed; boundary="===============6072071049487683404==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3338 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs. Date: Fri, 22 Oct 2010 10:47:57 -0400 Message-ID: <201010221447.o9MElvRD014957@svn01.web.mwc.hst.phx2.redhat.com> --===============6072071049487683404== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-22 10:47:57 -0400 (Fri, 22 Oct 2010) New Revision: 3338 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/TreeFileValueStorage.java Log: EXOJCR-999: TreeFileCleaner removed from TreeFileValueStorage as redundant Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/TreeFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/TreeFileValueStorage.java 2010-10-22 11:24:11 UT= C (rev 3337) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/TreeFileValueStorage.java 2010-10-22 14:47:57 UT= C (rev 3338) @@ -19,10 +19,8 @@ package org.exoplatform.services.jcr.impl.storage.value.fs; = import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.storage.value.ValueIOChannel; = -import java.io.File; import java.io.IOException; = /** @@ -34,19 +32,9 @@ public class TreeFileValueStorage extends FileValueStorage { = - protected class TreeFileCleaner extends FileCleaner - { - @Override - public synchronized void addFile(File file) - { - super.addFile(new TreeFile(PrivilegedFileHelper.getAbsolutePath(f= ile), cleaner, rootDir)); - } - } - public TreeFileValueStorage(FileCleaner cleaner) { super(cleaner); - this.cleaner =3D new TreeFileCleaner(); // TODO use container cleaner } = @Override --===============6072071049487683404==-- From do-not-reply at jboss.org Fri Oct 22 10:48:36 2010 Content-Type: multipart/mixed; boundary="===============2914888678416276739==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3339 - in jcr/trunk/exo.jcr.component.webdav/src: test/java/org/exoplatform/services/jcr/webdav/command and 1 other directory. Date: Fri, 22 Oct 2010 10:48:36 -0400 Message-ID: <201010221448.o9MEma0n014975@svn01.web.mwc.hst.phx2.redhat.com> --===============2914888678416276739== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-22 10:48:36 -0400 (Fri, 22 Oct 2010) New Revision: 3339 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/resource/FileResource.java jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/service= s/jcr/webdav/command/TestPropFind.java Log: EXOJCR-1012: fixed PROPFIND method with 'allprop', now wrong data output av= oided Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/resource/FileResource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resource/FileResource.java 2010-10-22 14:47:57 UTC (rev 3338) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/resource/FileResource.java 2010-10-22 14:48:36 UTC (rev 3339) @@ -64,6 +64,8 @@ // FILE_SKIP.add("jcr:primaryType"); FILE_SKIP.add("jcr:mixinTypes"); FILE_SKIP.add("jcr:created"); + FILE_SKIP.add("jcr:lockOwner"); + FILE_SKIP.add("jcr:lockIsDeep"); }; = /** @@ -76,6 +78,8 @@ CONTENT_SKIP.add("jcr:lastModified"); CONTENT_SKIP.add("jcr:mimeType"); CONTENT_SKIP.add("jcr:uuid"); + CONTENT_SKIP.add("jcr:lockOwner"); + CONTENT_SKIP.add("jcr:lockIsDeep"); = CONTENT_SKIP.add("dc:date"); CONTENT_SKIP.add("exo:internalUse"); Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/= services/jcr/webdav/command/TestPropFind.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestPropFind.java 2010-10-22 14:47:57 UTC (rev 3338) +++ jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestPropFind.java 2010-10-22 14:48:36 UTC (rev 3339) @@ -30,8 +30,6 @@ = import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.net.URLDecoder; -import java.net.URLEncoder; = import javax.jcr.Node; import javax.ws.rs.core.HttpHeaders; @@ -158,7 +156,36 @@ } = = + public void testPropfindWrongDataFormat() throws Exception + { + + String path =3D testPropFind.getPath() + "/testPropfindComplexConten= t"; = + // prepare data + Node node =3D + TestUtils.addContent(session, path, new ByteArrayInputStream("fil= e content".getBytes()), "nt:file", + "exo:testResource", "text/plain"); + + node.addMixin("mix:lockable"); + node.save(); + node.lock(false, false); + node.getNode("jcr:content").addMixin("mix:lockable"); + node.save(); + node.getNode("jcr:content").lock(true, false); + node.getNode("jcr:content").addNode("node", "nt:unstructured").setPr= operty("node-prop", "prop"); + node.getNode("jcr:content").setProperty("exo:prop", "prop"); + node.save(); + + // test + HierarchicalProperty body =3D new HierarchicalProperty("D:propfind",= null, "DAV:"); + body.addChild(new HierarchicalProperty("D:allprop", null, "DAV:")); + Response resp =3D new PropFindCommand().propfind(session, path, body= , Depth.INFINITY_VALUE, "http://localhost"); + ByteArrayOutputStream bas =3D new ByteArrayOutputStream(); + ((PropFindResponseEntity)resp.getEntity()).write(bas); + String find =3D new String(bas.toByteArray()); + assertTrue(!find.contains("jcr:lockOnwer")); + assertTrue(!find.contains("D:lockdiscovery")); + } = = public void testPropWithPercent() throws Exception --===============2914888678416276739==-- From do-not-reply at jboss.org Fri Oct 22 11:03:51 2010 Content-Type: multipart/mixed; boundary="===============1370902830779439016==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3340 - in jcr/trunk/exo.jcr.component.webdav/src: main/java/org/exoplatform/services/jcr/webdav/command/propfind and 3 other directories. Date: Fri, 22 Oct 2010 11:03:51 -0400 Message-ID: <201010221503.o9MF3pd9021887@svn01.web.mwc.hst.phx2.redhat.com> --===============1370902830779439016== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-22 11:03:50 -0400 (Fri, 22 Oct 2010) New Revision: 3340 Modified: 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/propfind/PropFindRequestEntity.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/util/PropertyConstants.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/xml/PropertyWriteUtil.java jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/xml/PropstatGroupedRepresentation.java jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/service= s/jcr/webdav/command/TestPropFind.java Log: EXOJCR-1013: fixed PROPFIND with allprop and include elements, now response= contains properties from include element 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 2010-10-22 14:48:36 UTC (rev 333= 9) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/PropFindCommand.java 2010-10-22 15:03:50 UTC (rev 334= 0) @@ -28,6 +28,7 @@ import org.exoplatform.services.jcr.webdav.resource.ResourceUtil; import org.exoplatform.services.jcr.webdav.resource.VersionedCollectionRes= ource; import org.exoplatform.services.jcr.webdav.resource.VersionedFileResource; +import org.exoplatform.services.jcr.webdav.util.PropertyConstants; import org.exoplatform.services.jcr.webdav.util.TextUtil; import org.exoplatform.services.jcr.webdav.xml.WebDavNamespaceContext; import org.exoplatform.services.log.ExoLogger; @@ -144,6 +145,10 @@ { response =3D new PropFindResponseEntity(depth, resource, null, fa= lse); } + else if (request.getType().equalsIgnoreCase("include")) + { + response =3D new PropFindResponseEntity(depth, resource, property= Names(body), false); + } else if (request.getType().equalsIgnoreCase("propname")) { response =3D new PropFindResponseEntity(depth, resource, null, tr= ue); @@ -171,8 +176,17 @@ { HashSet names =3D new HashSet(); = - HierarchicalProperty propBody =3D body.getChild(0); + HierarchicalProperty propBody =3D body.getChild(PropertyConstants.DA= V_ALLPROP_INCLUDE); = + if (propBody !=3D null) + { + names.add(PropertyConstants.DAV_ALLPROP_INCLUDE); + } + else + { + propBody =3D body.getChild(0); + } + List properties =3D propBody.getChildren(); Iterator propIter =3D properties.iterator(); while (propIter.hasNext()) Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/command/propfind/PropFindRequestEntity.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/propfind/PropFindRequestEntity.java 2010-10-22 14:48:= 36 UTC (rev 3339) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/command/propfind/PropFindRequestEntity.java 2010-10-22 15:03:= 50 UTC (rev 3340) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.webdav.command.propfind; = import org.exoplatform.common.util.HierarchicalProperty; +import org.exoplatform.services.jcr.webdav.util.PropertyConstants; = import javax.xml.namespace.QName; = @@ -60,6 +61,11 @@ return "allprop"; } = + if (input.getChild(PropertyConstants.DAV_ALLPROP_INCLUDE) !=3D null) + { + return "include"; + } + QName name =3D input.getChild(0).getName(); if (name.getNamespaceURI().equals("DAV:")) return name.getLocalPart(); Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/util/PropertyConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/PropertyConstants.java 2010-10-22 14:48:36 UTC (rev 3339) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/util/PropertyConstants.java 2010-10-22 15:03:50 UTC (rev 3340) @@ -207,6 +207,20 @@ QName IS_READ_ONLY =3D new QName("DAV:", "isreadonly"); = /** + * dav:include element for dav:allprop of PROPFIND method + * See HTTP Extensions for Web Distributed Authoring = + * and Versioning (WebDAV) for more information.. + */ + QName DAV_ALLPROP_INCLUDE =3D new QName("DAV:", "include"); + + /** + * dav:allprop element for dav:allprop of PROPFIND method + * See HTTP Extensions for Web Distributed Authoring = + * and Versioning (WebDAV) for more information.. + */ + QName DAV_ALLPROP =3D new QName("DAV:", "allprop"); + + /** * Creation date pattern. */ String CREATION_PATTERN =3D "yyyy-MM-dd'T'HH:mm:ss'Z'"; Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/xml/PropertyWriteUtil.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/PropertyWriteUtil.java 2010-10-22 14:48:36 UTC (rev 3339) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/xml/PropertyWriteUtil.java 2010-10-22 15:03:50 UTC (rev 3340) @@ -41,6 +41,7 @@ = public class PropertyWriteUtil { + private final static Pattern ESCAPE_PATTERN =3D Pattern.compile("%[0-9a= -fA-F]{2}"); = /** * Writes the statuses of properties into XML. @@ -180,8 +181,7 @@ * @return true if string contains encoded characters, oth= erwise returns false = */ private static boolean containsEncodedChar(String str){ - Pattern p =3D Pattern.compile("%[0-9a-fA-F]{2}"); - Matcher matcher =3D p.matcher(str); + Matcher matcher =3D ESCAPE_PATTERN.matcher(str); return matcher.find(); = } Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/= services/jcr/webdav/xml/PropstatGroupedRepresentation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/PropstatGroupedRepresentation.java 2010-10-22 14:48:36 UT= C (rev 3339) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/xml/PropstatGroupedRepresentation.java 2010-10-22 15:03:50 UT= C (rev 3340) @@ -131,7 +131,11 @@ } else { - + if (propNames.contains(PropertyConstants.DAV_ALLPROP_INCLUDE)) + { + propStats.put(statname, resource.getProperties(namesOnly)); + propNames.remove(PropertyConstants.DAV_ALLPROP_INCLUDE); + } for (QName propName : propNames) { HierarchicalProperty prop =3D new HierarchicalProperty(propNam= e); Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/= services/jcr/webdav/command/TestPropFind.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestPropFind.java 2010-10-22 14:48:36 UTC (rev 3339) +++ jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestPropFind.java 2010-10-22 15:03:50 UTC (rev 3340) @@ -62,6 +62,9 @@ private String allPropsXML =3D ""; = + private String allPropsWithInclusionXML =3D "" + + ""; + public void setUp() throws Exception { super.setUp(); @@ -155,6 +158,34 @@ assertTrue(find.contains(author)); } = + public void testAllPropsWithInclusion() throws Exception + { + + String content =3D TestUtils.getFileContent(); + String file =3D TestUtils.getFileName(); + Node node =3D + TestUtils.addContent(session, file, new ByteArrayInputStream(cont= ent.getBytes()), nt_webdave_file, ""); + + node.addMixin("mix:lockable"); + node.save(); + node.lock(true, false); + node.getPath(); + node.getName(); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + headers.add(HttpHeaders.CONTENT_TYPE, "text/xml"); + ContainerResponse responseFind =3D + service(WebDAVMethods.PROPFIND, getPathWS() + file, "", null, all= PropsWithInclusionXML.getBytes()); + assertEquals(HTTPStatus.MULTISTATUS, responseFind.getStatus()); + ByteArrayOutputStream outputStream =3D new ByteArrayOutputStream(); + PropFindResponseEntity entity =3D (PropFindResponseEntity)responseFi= nd.getEntity(); + entity.write(outputStream); + String find =3D outputStream.toString(); + System.out.println("\n" + find); + assertTrue(find.contains("D:lockdiscovery")); + assertTrue(find.contains("D:supported-method-set")); + + } = public void testPropfindWrongDataFormat() throws Exception { --===============1370902830779439016==-- From do-not-reply at jboss.org Fri Oct 22 11:59:34 2010 Content-Type: multipart/mixed; boundary="===============3400697289697686851==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3341 - in jcr/branches/1.12.x/patch: EXOJCR-999 and 1 other directory. Date: Fri, 22 Oct 2010 11:59:33 -0400 Message-ID: <201010221559.o9MFxXET024575@svn01.web.mwc.hst.phx2.redhat.com> --===============3400697289697686851== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-22 11:59:33 -0400 (Fri, 22 Oct 2010) New Revision: 3341 Added: jcr/branches/1.12.x/patch/EXOJCR-999/ jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch Log: EXOJCR-999: patch for 1.12.x commited Added: jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch = (rev 0) +++ jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch 2010-10-22 15:59:= 33 UTC (rev 3341) @@ -0,0 +1,2451 @@ +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/c= onfig/RepositoryInfo.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/conf= ig/RepositoryInfo.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/conf= ig/RepositoryInfo.java (working copy) +@@ -46,6 +46,8 @@ + = + protected long sessionTimeOut; + = ++ protected int lockRemoverMaxThreadCount; ++ + public RepositoryInfo() + { + = +@@ -190,17 +192,43 @@ + } + = + /** ++ * Returns LockRemovers per-repository max threads count. ++ * @return LockRemovers per-repository max threads count ++ */ ++ public int getLockRemoverThreadsCount() ++ { ++ return lockRemoverMaxThreadCount; ++ } ++ ++ /** ++ * Sets LockRemovers per-repository max threads count. ++ * @param lockRemoverMaxThreadCount ++ */ ++ public void setLockRemoverThreadsCount(int lockRemoverMaxThreadCount) ++ { ++ this.lockRemoverMaxThreadCount =3D lockRemoverMaxThreadCount; ++ } ++ ++ /** + * Merges the current {@link RepositoryInfo} with the given one. The c= urrent {@link RepositoryInfo} + * has the highest priority thus only absent data will be overrode + * @param entry the entry to merge with the current {@link RepositoryI= nfo} + */ + void merge(RepositoryInfo entry) + { +- if (systemWorkspaceName =3D=3D null) setSystemWorkspaceName(entry.s= ystemWorkspaceName); +- if (defaultWorkspaceName =3D=3D null) setDefaultWorkspaceName(entry= .defaultWorkspaceName); +- if (accessControl =3D=3D null) setAccessControl(entry.accessControl= ); +- if (securityDomain =3D=3D null) setSecurityDomain(entry.securityDom= ain); +- if (authenticationPolicy =3D=3D null) setAuthenticationPolicy(entry= .authenticationPolicy); +- if (sessionTimeOut =3D=3D 0) setSessionTimeOut(entry.sessionTimeOut= ); +- } = ++ if (systemWorkspaceName =3D=3D null) ++ setSystemWorkspaceName(entry.systemWorkspaceName); ++ if (defaultWorkspaceName =3D=3D null) ++ setDefaultWorkspaceName(entry.defaultWorkspaceName); ++ if (accessControl =3D=3D null) ++ setAccessControl(entry.accessControl); ++ if (securityDomain =3D=3D null) ++ setSecurityDomain(entry.securityDomain); ++ if (authenticationPolicy =3D=3D null) ++ setAuthenticationPolicy(entry.authenticationPolicy); ++ if (sessionTimeOut =3D=3D 0) ++ setSessionTimeOut(entry.sessionTimeOut); ++ if (lockRemoverMaxThreadCount =3D=3D 0) ++ setLockRemoverThreadsCount(entry.lockRemoverMaxThreadCount); ++ } + } +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/BackupWorkspaceInitializer.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/BackupWorkspaceInitializer.java (working copy) +@@ -91,7 +91,7 @@ + super(config, repConfig, dataManager, namespaceRegistry, locationFa= ctory, nodeTypeManager, valueFactory, + accessManager); + = +- this.fileCleaner =3D new FileCleaner(); ++ this.fileCleaner =3D valueFactory.getFileCleaner(); + = + restoreDir =3D restorePath; + = +@@ -366,8 +366,6 @@ + = + restoreChangesLog.restore(); + = +- TransactionChangesLog log =3D restoreChangesLog.getItemDataChang= esLog(); +- + } + else if (changesLogType =3D=3D RestoreChangesLog.Type.ItemDataChang= esLog_without_Streams) + { +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/lock/jbosscache/CacheableLockManagerImpl.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/CacheableLockManagerImpl.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/CacheableLockManagerImpl.java (working copy) +@@ -43,6 +43,7 @@ + import org.exoplatform.services.jcr.impl.Constants; + import org.exoplatform.services.jcr.impl.core.SessionDataManager; + import org.exoplatform.services.jcr.impl.core.lock.LockRemover; ++import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder; + import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager; + import org.exoplatform.services.jcr.impl.dataflow.TransientItemData; + import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; +@@ -178,10 +179,10 @@ + * @throws RepositoryConfigurationException + */ + public CacheableLockManagerImpl(WorkspacePersistentDataManager dataMan= ager, WorkspaceEntry config, +- InitialContextInitializer context, TransactionService transactionSe= rvice, ConfigurationManager cfm) +- throws RepositoryConfigurationException, RepositoryException ++ InitialContextInitializer context, TransactionService transactionSe= rvice, ConfigurationManager cfm, ++ LockRemoverHolder lockRemoverHolder) throws RepositoryConfiguration= Exception, RepositoryException + { +- this(dataManager, config, context, transactionService.getTransactio= nManager(), cfm); ++ this(dataManager, config, context, transactionService.getTransactio= nManager(), cfm, lockRemoverHolder); + } + = + /** +@@ -193,10 +194,10 @@ + * @throws RepositoryConfigurationException + */ + public CacheableLockManagerImpl(WorkspacePersistentDataManager dataMan= ager, WorkspaceEntry config, +- InitialContextInitializer context, ConfigurationManager cfm) throws= RepositoryConfigurationException, +- RepositoryException ++ InitialContextInitializer context, ConfigurationManager cfm, LockRe= moverHolder lockRemoverHolder) ++ throws RepositoryConfigurationException, RepositoryException + { +- this(dataManager, config, context, (TransactionManager)null, cfm); ++ this(dataManager, config, context, (TransactionManager)null, cfm, l= ockRemoverHolder); + = + } + = +@@ -211,8 +212,8 @@ + * @throws RepositoryConfigurationException + */ + public CacheableLockManagerImpl(WorkspacePersistentDataManager dataMan= ager, WorkspaceEntry config, +- InitialContextInitializer context, TransactionManager transactionMa= nager, ConfigurationManager cfm) +- throws RepositoryConfigurationException, RepositoryException ++ InitialContextInitializer context, TransactionManager transactionMa= nager, ConfigurationManager cfm, ++ LockRemoverHolder lockRemoverHolder) throws RepositoryConfiguration= Exception, RepositoryException + { + lockRoot =3D Fqn.fromElements(LOCKS); + = +@@ -269,6 +270,9 @@ + { + throw new RepositoryConfigurationException("Cache configuration = not found"); + } ++ ++ lockRemover =3D lockRemoverHolder.getLockRemover(this); ++ + } + = + /** +@@ -490,7 +494,7 @@ + } + return true; + } +- = ++ + /** + * Return new instance of session lock manager. + */ +@@ -769,7 +773,7 @@ + */ + public void start() + { +- lockRemover =3D new LockRemover(this); ++ lockRemover.start(); + } + = + /* +@@ -778,8 +782,8 @@ + */ + public void stop() + { +- lockRemover.halt(); +- lockRemover.interrupt(); ++ lockRemover.stop(); ++ + sessionLockManagers.clear(); + cache.stop(); + } +@@ -913,7 +917,7 @@ + { + return getExactNodeOrCloseParentLock(node, true); + } +- = ++ + private LockData getExactNodeOrCloseParentLock(NodeData node, boolean = checkHasLocks) throws RepositoryException + { + = +@@ -954,7 +958,7 @@ + { + return getClosedChild(node, true); + } +- = ++ + private LockData getClosedChild(NodeData node, boolean checkHasLocks) = throws RepositoryException + { + = +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java (working copy) +@@ -42,6 +42,7 @@ + import org.exoplatform.services.jcr.impl.Constants; + import org.exoplatform.services.jcr.impl.core.SessionDataManager; + import org.exoplatform.services.jcr.impl.core.lock.LockRemover; ++import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder; + import org.exoplatform.services.jcr.impl.core.lock.SessionLockManager; + import org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableLo= ckManager; + import org.exoplatform.services.jcr.impl.core.lock.jbosscache.CacheableSe= ssionLockManager; +@@ -161,10 +162,10 @@ + * @throws RepositoryConfigurationException + */ + public CacheableJDBCLockManagerImpl(WorkspacePersistentDataManager dat= aManager, WorkspaceEntry config, +- InitialContextInitializer context, TransactionService transactionSe= rvice, ConfigurationManager cfm) +- throws RepositoryConfigurationException, RepositoryException ++ InitialContextInitializer context, TransactionService transactionSe= rvice, ConfigurationManager cfm, ++ LockRemoverHolder lockRemoverHolder) throws RepositoryConfiguration= Exception, RepositoryException + { +- this(dataManager, config, context, transactionService.getTransactio= nManager(), cfm); ++ this(dataManager, config, context, transactionService.getTransactio= nManager(), cfm, lockRemoverHolder); + } + = + /** +@@ -176,10 +177,10 @@ + * @throws RepositoryConfigurationException + */ + public CacheableJDBCLockManagerImpl(WorkspacePersistentDataManager dat= aManager, WorkspaceEntry config, +- InitialContextInitializer context, ConfigurationManager cfm) throws= RepositoryConfigurationException, +- RepositoryException ++ InitialContextInitializer context, ConfigurationManager cfm, LockRe= moverHolder lockRemoverHolder) ++ throws RepositoryConfigurationException, RepositoryException + { +- this(dataManager, config, context, (TransactionManager)null, cfm); ++ this(dataManager, config, context, (TransactionManager)null, cfm, l= ockRemoverHolder); + } + = + /** +@@ -194,8 +195,8 @@ + * @throws RepositoryException = + */ + public CacheableJDBCLockManagerImpl(WorkspacePersistentDataManager dat= aManager, WorkspaceEntry config, +- InitialContextInitializer context, TransactionManager transactionMa= nager, ConfigurationManager cfm) +- throws RepositoryConfigurationException, RepositoryException ++ InitialContextInitializer context, TransactionManager transactionMa= nager, ConfigurationManager cfm, ++ LockRemoverHolder lockRemoverHolder) throws RepositoryConfiguration= Exception, RepositoryException + { + lockRoot =3D Fqn.fromElements(LOCKS); + = +@@ -250,6 +251,8 @@ + { + throw new RepositoryConfigurationException("Cache configuration = not found"); + } ++ ++ lockRemover =3D lockRemoverHolder.getLockRemover(this); + } + = + @Managed +@@ -598,7 +601,7 @@ + */ + public void start() + { +- lockRemover =3D new LockRemover(this); ++ lockRemover.start(); + } + = + /** +@@ -606,8 +609,8 @@ + */ + public void stop() + { +- lockRemover.halt(); +- lockRemover.interrupt(); ++ lockRemover.stop(); ++ + sessionLockManagers.clear(); + cache.stop(); + } +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockManagerImpl.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockManagerImpl.java (working copy) +@@ -146,12 +146,14 @@ + * @param dataManager + * @param config + */ +- public LockManagerImpl(WorkspacePersistentDataManager dataManager, Wor= kspaceEntry config) ++ public LockManagerImpl(WorkspacePersistentDataManager dataManager, Wor= kspaceEntry config, ++ LockRemoverHolder lockRemoverHolder) + { +- this(dataManager, config, null); ++ this(dataManager, config, null, lockRemoverHolder); + } + = +- public LockManagerImpl(WorkspacePersistentDataManager dataManager, Wor= kspaceEntry config, LockPersister persister) ++ public LockManagerImpl(WorkspacePersistentDataManager dataManager, Wor= kspaceEntry config, LockPersister persister, ++ LockRemoverHolder lockRemoverHolder) + { + = + this.dataManager =3D dataManager; +@@ -169,6 +171,7 @@ + tokensMap =3D new HashMap(); + = + dataManager.addItemPersistenceListener(this); ++ lockRemover =3D lockRemoverHolder.getLockRemover(this); + } + = + public synchronized void addLockToken(String sessionId, String lt) +@@ -468,7 +471,7 @@ + */ + public void start() + { +- lockRemover =3D new LockRemover(this); ++ lockRemover.start(); + } + = + // Quick method. We need to reconstruct +@@ -503,8 +506,8 @@ + */ + public void stop() + { +- lockRemover.halt(); +- lockRemover.interrupt(); ++ lockRemover.stop(); ++ + locks.clear(); + pendingLocks.clear(); + tokensMap.clear(); +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemover.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemover.java (working copy) +@@ -18,47 +18,68 @@ + */ + 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; ++import org.exoplatform.services.jcr.impl.proccess.WorkerService; + = ++import java.util.concurrent.ScheduledFuture; ++ + /** + * Created by The eXo Platform SAS. + * = + * @author Sergey Kabash= nyuk + * @version $Id: LockRemover.java 11987 2008-03-17 09:06:06Z ksm $ + */ +-public class LockRemover extends WorkerThread ++public class LockRemover + { ++ public static final long DEFAULT_THREAD_TIMEOUT =3D 30000; // 30 sec + = +- private final Log log =3D ExoLogger.getLogger("exo.jcr.component.core.= LockRemover"); ++ private final WorkerService workerService; + = +- public static final long DEFAULT_THREAD_TIMEOUT =3D 30000; // 30 ++ private final WorkspaceLockManager lockManager; + = +- // sec ++ private final long timeout; + = +- private final WorkspaceLockManager lockManagerImpl; ++ private ScheduledFuture lockRemoverTask =3D null; + = +- public LockRemover(WorkspaceLockManager lockManagerImpl) ++ class LockRemoverTask implements Runnable + { +- this(lockManagerImpl, DEFAULT_THREAD_TIMEOUT); ++ private final WorkspaceLockManager lockManager; ++ ++ LockRemoverTask(WorkspaceLockManager lockManager) ++ { ++ this.lockManager =3D lockManager; ++ } ++ ++ public void run() ++ { ++ lockManager.removeExpired(); ++ } + } + = +- private LockRemover(WorkspaceLockManager lockManagerImpl, long timeout) ++ protected LockRemover(WorkerService workerService, WorkspaceLockManage= r lockManager) + { +- 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() + " ti= meout=3D " + timeout); ++ this(workerService, lockManager, DEFAULT_THREAD_TIMEOUT); + } + = +- @Override +- protected void callPeriodically() throws Exception ++ protected LockRemover(WorkerService workerService, WorkspaceLockManage= r lockManager, long timeout) + { +- lockManagerImpl.removeExpired(); ++ this.workerService =3D workerService; ++ this.lockManager =3D lockManager; ++ this.timeout =3D timeout; + } ++ ++ public void start() ++ { ++ if (lockRemoverTask !=3D null) ++ { ++ stop(); ++ } ++ lockRemoverTask =3D workerService.executePeriodically(new LockRemov= erTask(lockManager), timeout); ++ } ++ ++ public void stop() ++ { ++ lockRemoverTask.cancel(false); ++ lockRemoverTask =3D null; ++ } ++ + } +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/lock/LockRemoverHolder.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemoverHolder.java (revision 0) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemoverHolder.java (revision 0) +@@ -0,0 +1,65 @@ ++package org.exoplatform.services.jcr.impl.core.lock; ++ ++import org.exoplatform.services.jcr.config.RepositoryEntry; ++import org.exoplatform.services.jcr.impl.proccess.WorkerService; ++ ++/** ++ * LockRemoverHolder holds is a single per-repository LockRemover contain= er. ++ * @author Foo Bar ++ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z a= heritier $ ++ * ++ */ ++public class LockRemoverHolder ++{ ++ ++ /** ++ * Default amount of thread that may be used by WorkerService to serve= LockRemovers. ++ */ ++ public final int DEFAULT_THREAD_COUNT =3D 1; ++ ++ /** ++ * WorkerService that executed LockRemover. ++ */ ++ private final WorkerService workerService; ++ ++ /** ++ * Constructor. ++ * @param entry - RepositoryEntry that may contain lock-remover-max-th= reads parameter. ++ */ ++ public LockRemoverHolder(RepositoryEntry entry) ++ { ++ int threadCount =3D DEFAULT_THREAD_COUNT; ++ if (entry !=3D null) ++ { ++ if (entry.getLockRemoverThreadsCount() > 0) ++ { ++ threadCount =3D entry.getLockRemoverThreadsCount(); ++ } ++ } ++ workerService =3D new WorkerService(threadCount, "lock-remover"); ++ } ++ ++ /** ++ * Returns LockRemover object that removes expired locks from LockMana= ger. Default timeout used. ++ * = ++ * @param lockManager - LockManager that going to be cleaned with retu= rned LockRemover. ++ * @return LockRemover ++ */ ++ public LockRemover getLockRemover(WorkspaceLockManager lockManager) ++ { ++ return new LockRemover(workerService, lockManager); ++ } ++ ++ /** ++ * Returns LockRemover object that removes expired locks from LockMana= ger. ++ * = ++ * @param lockManager - LockManager that going to be cleaned with retu= rned LockRemover. ++ * @param timeout - LockRemover will check LockManager with delay sett= ed in timeout parameter ++ * @return LockRemover ++ */ ++ public LockRemover getLockRemover(WorkspaceLockManager lockManager, lo= ng timeout) ++ { ++ return new LockRemover(workerService, lockManager, timeout); ++ } ++ ++} +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SessionImpl.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SessionImpl.java (working copy) +@@ -42,7 +42,7 @@ + import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspa= ceDataManagerStub; + import org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog; + import org.exoplatform.services.jcr.impl.ext.action.SessionActionIntercep= tor; +-import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHold= er; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.impl.xml.ExportImportFactory; + import org.exoplatform.services.jcr.impl.xml.ItemDataKeeperAdapter; + import org.exoplatform.services.jcr.impl.xml.XmlMapping; +@@ -162,8 +162,8 @@ + this.lazyReadThreshold =3D + wsConfig.getLazyReadThreshold() > 0 ? wsConfig.getLazyReadThresh= old() : DEFAULT_LAZY_READ_THRESHOLD; + = +- WorkspaceFileCleanerHolder cleanerHolder =3D +- (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType= (WorkspaceFileCleanerHolder.class); ++ FileCleanerHolder cleanerHolder =3D ++ (FileCleanerHolder)container.getComponentInstanceOfType(FileClea= nerHolder.class); + = + this.locationFactory =3D new LocationFactory(this); + this.valueFactory =3D new ValueFactoryImpl(locationFactory, wsConfi= g, cleanerHolder); +@@ -242,8 +242,8 @@ + = + WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentI= nstanceOfType(WorkspaceEntry.class); + = +- WorkspaceFileCleanerHolder cleanerHolder =3D +- (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType= (WorkspaceFileCleanerHolder.class); ++ FileCleanerHolder cleanerHolder =3D ++ (FileCleanerHolder)container.getComponentInstanceOfType(FileClea= nerHolder.class); + = + ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory,= wsConfig, cleanerHolder); + = +@@ -281,8 +281,8 @@ + = + WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentI= nstanceOfType(WorkspaceEntry.class); + = +- WorkspaceFileCleanerHolder cleanerHolder =3D +- (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType= (WorkspaceFileCleanerHolder.class); ++ FileCleanerHolder cleanerHolder =3D ++ (FileCleanerHolder)container.getComponentInstanceOfType(FileClea= nerHolder.class); + = + ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory,= wsConfig, cleanerHolder); + = +@@ -322,8 +322,8 @@ + = + WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentI= nstanceOfType(WorkspaceEntry.class); + = +- WorkspaceFileCleanerHolder cleanerHolder =3D +- (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType= (WorkspaceFileCleanerHolder.class); ++ FileCleanerHolder cleanerHolder =3D ++ (FileCleanerHolder)container.getComponentInstanceOfType(FileClea= nerHolder.class); + = + ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory,= wsConfig, cleanerHolder); + = +@@ -361,8 +361,8 @@ + = + WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentI= nstanceOfType(WorkspaceEntry.class); + = +- WorkspaceFileCleanerHolder cleanerHolder =3D +- (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType= (WorkspaceFileCleanerHolder.class); ++ FileCleanerHolder cleanerHolder =3D ++ (FileCleanerHolder)container.getComponentInstanceOfType(FileClea= nerHolder.class); + = + ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory,= wsConfig, cleanerHolder); + try +@@ -397,8 +397,8 @@ + = + WorkspaceEntry wsConfig =3D (WorkspaceEntry)container.getComponentI= nstanceOfType(WorkspaceEntry.class); + = +- WorkspaceFileCleanerHolder cleanerHolder =3D +- (WorkspaceFileCleanerHolder)container.getComponentInstanceOfType= (WorkspaceFileCleanerHolder.class); ++ FileCleanerHolder cleanerHolder =3D ++ (FileCleanerHolder)container.getComponentInstanceOfType(FileClea= nerHolder.class); + = + ValueFactoryImpl valueFactoryImpl =3D new ValueFactoryImpl(factory,= wsConfig, cleanerHolder); + try +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SysViewWorkspaceInitializer.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SysViewWorkspaceInitializer.java (working copy) +@@ -265,7 +265,8 @@ + else if (tmpFile =3D=3D null && (((TempOutputStream)buff).getSiz= e() + buffer.length) > maxBufferSize) + { + // spool to file +- FileOutputStream fout =3D new FileOutputStream(tmpFile =3D Sp= oolFile.createTempFile("jcrrestorewi", ".tmp", tempDir)); ++ FileOutputStream fout =3D ++ new FileOutputStream(tmpFile =3D SpoolFile.createTempFile(= "jcrrestorewi", ".tmp", tempDir)); + fout.write(((TempOutputStream)buff).getBuffer()); + buff.close(); + buff =3D fout; // use file +@@ -398,7 +399,7 @@ + this.namespaceRegistry =3D namespaceRegistry; + this.locationFactory =3D locationFactory; + = +- this.fileCleaner =3D new FileCleaner(false); // cleaner should be s= tarted! ++ this.fileCleaner =3D valueFactory.getFileCleaner(); + this.maxBufferSize =3D + config.getContainer().getParameterInteger(WorkspaceDataContainer= .MAXBUFFERSIZE_PROP, + WorkspaceDataContainer.DEF_MAXBUFFERSIZE); +@@ -409,7 +410,7 @@ + throw new RepositoryConfigurationException("Workspace (" + works= paceName + + ") RestoreIntializer should have mandatory parameter " + + SysViewWorkspaceInitializer.RESTORE_PATH_PARAMETER); +- = ++ + this.tempDir =3D new File(System.getProperty("java.io.tmpdir")); + } + = +@@ -450,12 +451,12 @@ + this.namespaceRegistry =3D namespaceRegistry; + this.locationFactory =3D locationFactory; + = +- this.fileCleaner =3D new FileCleaner(false); // cleaner should be s= tarted! ++ this.fileCleaner =3D valueFactory.getFileCleaner(); + this.maxBufferSize =3D + config.getContainer().getParameterInteger(WorkspaceDataContainer= .MAXBUFFERSIZE_PROP, + WorkspaceDataContainer.DEF_MAXBUFFERSIZE); + this.restorePath =3D restorePath; +- = ++ + this.tempDir =3D new File(System.getProperty("java.io.tmpdir")); + } + = +@@ -771,7 +772,7 @@ + } + else + { +- = ++ + File pfile =3D propertyValue.getFile(); + if (pfile !=3D null) + { +@@ -811,7 +812,6 @@ + = + public void start() + { +- fileCleaner.start(); + } + = + public void stop() +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/value/ValueFactoryImpl.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/value/ValueFactoryImpl.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/value/ValueFactoryImpl.java (working copy) +@@ -30,7 +30,7 @@ + import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; + import org.exoplatform.services.jcr.impl.util.JCRDateFormat; + import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +-import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHold= er; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; + import org.exoplatform.services.log.ExoLogger; + import org.exoplatform.services.log.Log; +@@ -71,7 +71,7 @@ + private int maxBufferSize; + = + public ValueFactoryImpl(LocationFactory locationFactory, WorkspaceEntr= y workspaceConfig, +- WorkspaceFileCleanerHolder cleanerHolder) ++ FileCleanerHolder cleanerHolder) + { + = + this.locationFactory =3D locationFactory; +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/proccess/WorkerService.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /proccess/WorkerService.java (revision 0) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /proccess/WorkerService.java (revision 0) +@@ -0,0 +1,84 @@ ++package org.exoplatform.services.jcr.impl.proccess; ++ ++import java.util.concurrent.ScheduledFuture; ++import java.util.concurrent.ScheduledThreadPoolExecutor; ++import java.util.concurrent.ThreadFactory; ++import java.util.concurrent.TimeUnit; ++import java.util.concurrent.atomic.AtomicInteger; ++ ++public class WorkerService ++{ ++ /** ++ * Executor that process assigned command periodically. ++ */ ++ private final ScheduledThreadPoolExecutor executor; ++ ++ class WorkerThreadFactory implements ThreadFactory ++ { ++ final AtomicInteger poolNumber =3D new AtomicInteger(1); ++ ++ final ThreadGroup group; ++ ++ final AtomicInteger threadNumber =3D new AtomicInteger(1); ++ ++ final String namePrefix; ++ ++ WorkerThreadFactory(String namePrefix) ++ { ++ SecurityManager s =3D System.getSecurityManager(); ++ group =3D (s !=3D null) ? s.getThreadGroup() : Thread.currentThr= ead().getThreadGroup(); ++ this.namePrefix =3D namePrefix + poolNumber.getAndIncrement() + = "-thread-"; ++ } ++ ++ public Thread newThread(Runnable r) ++ { ++ Thread t =3D new Thread(group, r, namePrefix + threadNumber.getA= ndIncrement(), 0); ++ if (t.isDaemon()) ++ t.setDaemon(false); ++ if (t.getPriority() !=3D Thread.NORM_PRIORITY) ++ t.setPriority(Thread.NORM_PRIORITY); ++ return t; ++ } ++ } ++ ++ /** ++ * Constructor. ++ * = ++ * @param threadCount - max thread count that executor may use ++ */ ++ public WorkerService(int threadCount) ++ { ++ executor =3D new ScheduledThreadPoolExecutor(threadCount); ++ } ++ ++ /** ++ * Constructor. ++ * = ++ * @param threadCount - max thread count that executor may use ++ * @param threadNamePrefix - thread name prefix ++ */ ++ public WorkerService(int threadCount, String threadNamePrefix) ++ { ++ executor =3D new ScheduledThreadPoolExecutor(threadCount, new Worke= rThreadFactory(threadNamePrefix)); ++ } ++ ++ /** ++ * Execute specified command periodically with dela= y. ++ * = ++ * @param command - command that must be executed ++ * @param delay - delay between each command execution = ++ * @return ++ */ ++ public ScheduledFuture executePeriodically(Runnable command, long dela= y) ++ { ++ return executor.scheduleWithFixedDelay(command, 0, delay, TimeUnit.= MILLISECONDS); ++ } ++ ++ /** ++ * Initiates an orderly shutdown in which previously submitted tasks a= re executed, but no new tasks will be accepted. = ++ */ ++ public void stop() ++ { ++ executor.shutdown(); ++ } ++} +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /RepositoryContainer.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /RepositoryContainer.java (working copy) +@@ -41,6 +41,7 @@ + import org.exoplatform.services.jcr.impl.core.WorkspaceInitializer; + import org.exoplatform.services.jcr.impl.core.access.DefaultAccessManager= Impl; + import org.exoplatform.services.jcr.impl.core.lock.LockManagerImpl; ++import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder; + import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManage= rImpl; + import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerImp= l; + import org.exoplatform.services.jcr.impl.core.nodetype.registration.JCRNo= deTypeDataPersister; +@@ -56,15 +57,12 @@ + import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspa= ceDataManagerStub; + import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolde= r; + import org.exoplatform.services.jcr.impl.storage.value.StandaloneStorageP= luginProvider; +-import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHold= er; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + 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 java.util.ArrayList; +-import java.util.Collections; +-import java.util.Comparator; + import java.util.List; + = + import javax.jcr.NamespaceRegistry; +@@ -335,7 +333,6 @@ + } + workspaceContainer.registerComponentImplementation(initilizerTyp= e); + workspaceContainer.registerComponentImplementation(SessionFactor= y.class); +- workspaceContainer.registerComponentImplementation(WorkspaceFile= CleanerHolder.class); + = + LocalWorkspaceDataManagerStub wsDataManager =3D + (LocalWorkspaceDataManagerStub)workspaceContainer +@@ -480,7 +477,10 @@ + { + = + registerComponentInstance(config); +- ++ // WorkspaceFileCleanerHolder - is a common holder for all workspac= es. = ++ // It is used to initialize FileValueStorage ++ registerComponentImplementation(FileCleanerHolder.class); ++ registerComponentImplementation(LockRemoverHolder.class); + registerWorkspacesComponents(); + registerRepositoryComponents(); + } +@@ -492,7 +492,6 @@ + = + registerComponentImplementation(RepositoryIndexSearcherHolder.class= ); + = +- registerComponentImplementation(WorkspaceFileCleanerHolder.class); + registerComponentImplementation(LocationFactory.class); + registerComponentImplementation(ValueFactoryImpl.class); + = +@@ -583,5 +582,5 @@ + ntManager.start(); + = + } +- = ++ + } +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/JDBCWorkspaceDataContainer.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/JDBCWorkspaceDataContainer.java (working copy) +@@ -34,6 +34,7 @@ + import org.exoplatform.services.jcr.impl.storage.jdbc.statistics.Statisti= csJDBCStorageConnection; + import org.exoplatform.services.jcr.impl.storage.jdbc.update.StorageUpdat= eManager; + import org.exoplatform.services.jcr.impl.util.io.FileCleaner; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException; + import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; + import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; +@@ -202,8 +203,9 @@ + * if JNDI exception (on DataSource lookup) + */ + public JDBCWorkspaceDataContainer(WorkspaceEntry wsConfig, RepositoryE= ntry repConfig, +- InitialContextInitializer contextInit, ValueStoragePluginProvider v= alueStorageProvider) +- throws RepositoryConfigurationException, NamingException, Repositor= yException, IOException ++ InitialContextInitializer contextInit, ValueStoragePluginProvider v= alueStorageProvider, ++ FileCleanerHolder fileCleanerHolder) throws RepositoryConfiguration= Exception, NamingException, ++ RepositoryException, IOException + { + = + // This recall is workaround for tenants creation. There is a troub= le in visibility datasource +@@ -393,7 +395,7 @@ + if (!swapDirectory.exists()) + swapDirectory.mkdirs(); + = +- this.swapCleaner =3D new FileCleaner(false); ++ this.swapCleaner =3D fileCleanerHolder.getFileCleaner(); + = + initDatabase(); + = +@@ -834,7 +836,6 @@ + */ + public void start() + { +- this.swapCleaner.start(); + } + = + /** +@@ -842,8 +843,6 @@ + */ + public void stop() + { +- this.swapCleaner.halt(); +- this.swapCleaner.interrupt(); + = + // TODO HSQLDB Stop (debug) + // if (dbDialect.equals(DB_DIALECT_GENERIC) || +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java (working copy) +@@ -33,6 +33,7 @@ + import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.HSQ= LDBConnectionFactory; + import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.MyS= QLConnectionFactory; + import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.Ora= cleConnectionFactory; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException; + import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvi= der; + import org.exoplatform.services.naming.InitialContextInitializer; +@@ -67,10 +68,11 @@ + * if JNDI exception (on DataSource lookup) + */ + public CQJDBCWorkspaceDataContainer(WorkspaceEntry wsConfig, Repositor= yEntry repConfig, +- InitialContextInitializer contextInit, ValueStoragePluginProvider v= alueStorageProvider) +- throws RepositoryConfigurationException, NamingException, Repositor= yException, IOException ++ InitialContextInitializer contextInit, ValueStoragePluginProvider v= alueStorageProvider, ++ FileCleanerHolder fileCleanerHolder) throws RepositoryConfiguration= Exception, NamingException, ++ RepositoryException, IOException + { +- super(wsConfig, repConfig, contextInit, valueStorageProvider); ++ super(wsConfig, repConfig, contextInit, valueStorageProvider, fileC= leanerHolder); + } + = + /** +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/CASableSimpleFileValueStorage.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableSimpleFileValueStorage.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableSimpleFileValueStorage.java (working copy) +@@ -21,6 +21,7 @@ + import org.exoplatform.services.jcr.config.RepositoryConfigurationExcepti= on; + import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceH= older; + import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAd= dressStorage; ++import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + import org.exoplatform.services.jcr.storage.value.ValueIOChannel; + = + import java.io.IOException; +@@ -40,6 +41,11 @@ + = + private String digestAlgo; + = ++ public CASableSimpleFileValueStorage(FileCleaner cleaner) ++ { ++ super(cleaner); ++ } ++ + @Override + public void init(Properties props, ValueDataResourceHolder resources) = throws IOException, + RepositoryConfigurationException +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/CASableTreeFileValueStorage.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableTreeFileValueStorage.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableTreeFileValueStorage.java (working copy) +@@ -21,6 +21,7 @@ + import org.exoplatform.services.jcr.config.RepositoryConfigurationExcepti= on; + import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceH= older; + import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAd= dressStorage; ++import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + = + import java.io.IOException; + import java.util.Properties; +@@ -38,6 +39,11 @@ + = + private String digestAlgo; + = ++ public CASableTreeFileValueStorage(FileCleaner cleaner) ++ { ++ super(cleaner); ++ } ++ + /** + * {@inheritDoc} + */ +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/FileValueStorage.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/FileValueStorage.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/FileValueStorage.java (working copy) +@@ -59,9 +59,9 @@ + * FileValueStorage constructor. + * = + */ +- public FileValueStorage() ++ public FileValueStorage(FileCleaner cleaner) + { +- this.cleaner =3D new FileCleaner(); // TODO use container cleaner ++ this.cleaner =3D cleaner; + } + = + /** +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/SimpleFileValueStorage.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/SimpleFileValueStorage.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/SimpleFileValueStorage.java (working copy) +@@ -18,6 +18,7 @@ + */ + package org.exoplatform.services.jcr.impl.storage.value.fs; + = ++import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + import org.exoplatform.services.jcr.storage.value.ValueIOChannel; + = + import java.io.IOException; +@@ -32,6 +33,11 @@ + public class SimpleFileValueStorage extends FileValueStorage + { + = ++ public SimpleFileValueStorage(FileCleaner cleaner) ++ { ++ super(cleaner); ++ } ++ + /** + * @see org.exoplatform.services.jcr.storage.value.ValueStoragePlugin#= openIOChannel() + */ +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/TreeFileValueStorage.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TreeFileValueStorage.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TreeFileValueStorage.java (working copy) +@@ -21,7 +21,6 @@ + import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + import org.exoplatform.services.jcr.storage.value.ValueIOChannel; + = +-import java.io.File; + import java.io.IOException; + = + /** +@@ -33,20 +32,11 @@ + public class TreeFileValueStorage extends FileValueStorage + { + = +- protected class TreeFileCleaner extends FileCleaner ++ public TreeFileValueStorage(FileCleaner cleaner) + { +- @Override +- public synchronized void addFile(File file) +- { +- super.addFile(new TreeFile(file.getAbsolutePath(), cleaner, root= Dir)); +- } ++ super(cleaner); + } + = +- public TreeFileValueStorage() +- { +- this.cleaner =3D new TreeFileCleaner(); // TODO use container clean= er +- } +- + @Override + public ValueIOChannel openIOChannel() throws IOException + { +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/StandaloneStoragePluginProvider.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/StandaloneStoragePluginProvider.java (revision 3339) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/StandaloneStoragePluginProvider.java (working copy) +@@ -24,6 +24,8 @@ + import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; + import org.exoplatform.services.jcr.config.WorkspaceEntry; + import org.exoplatform.services.jcr.datamodel.PropertyData; ++import org.exoplatform.services.jcr.impl.util.io.FileCleaner; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; + import org.exoplatform.services.jcr.storage.value.ValueIOChannel; + import org.exoplatform.services.jcr.storage.value.ValuePluginFilter; +@@ -60,7 +62,8 @@ + */ + private final ValueDataResourceHolder resorcesHolder; + = +- public StandaloneStoragePluginProvider(WorkspaceEntry wsConfig) throws= RepositoryConfigurationException, IOException ++ public StandaloneStoragePluginProvider(WorkspaceEntry wsConfig, FileCl= eanerHolder holder) ++ throws RepositoryConfigurationException, IOException + { + = + this.resorcesHolder =3D new ValueDataResourceHolder(); +@@ -82,7 +85,10 @@ + Object o =3D null; + try + { +- o =3D Class.forName(storageEntry.getType()).newInstance(); ++ o =3D ++ Class.forName(storageEntry.getType()).getConstructor(Fi= leCleaner.class).newInstance( ++ holder.getFileCleaner()); ++ + } + catch (Exception e) + { +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/util/io/FileCleanerHolder.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /util/io/FileCleanerHolder.java (revision 0) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /util/io/FileCleanerHolder.java (revision 0) +@@ -0,0 +1,43 @@ ++/* ++ * 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.util.io; ++ ++/** ++ * Created by The eXo Platform SAS.
    per workspace container file cl= eaner holder object ++ * = ++ * @author Gennady Azarenkov ++ * @version $Id: WorkspaceFileCleanerHolder.java 11907 2008-03-13 15:36:2= 1Z ksm $ ++ */ ++ ++public class FileCleanerHolder ++{ ++ ++ private final FileCleaner fileCleaner; ++ ++ public FileCleanerHolder() ++ { ++ this.fileCleaner =3D new FileCleaner(); ++ } ++ ++ public FileCleaner getFileCleaner() ++ { ++ return fileCleaner; ++ } ++ ++} +Index: exo.jcr.component.core/src/main/resources/binding.xml +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/resources/binding.xml (revision 3339) ++++ exo.jcr.component.core/src/main/resources/binding.xml (working copy) +@@ -17,6 +17,8 @@ + + ++ + + + +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/B= aseStandaloneTest.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/Base= StandaloneTest.java (revision 3339) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/Base= StandaloneTest.java (working copy) +@@ -30,7 +30,7 @@ + import org.exoplatform.services.jcr.impl.core.SessionImpl; + import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpo= olFileHolder; + import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +-import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHold= er; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; + import org.exoplatform.services.log.ExoLogger; + import org.exoplatform.services.log.Log; +@@ -153,8 +153,7 @@ + wconf.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, + WorkspaceDataContainer.DEF_MAXBUFFERSIZE); + = +- WorkspaceFileCleanerHolder wfcleaner =3D +- (WorkspaceFileCleanerHolder)wsc.getComponent(WorkspaceFileCleane= rHolder.class); ++ FileCleanerHolder wfcleaner =3D (FileCleanerHolder)wsc.getComponent= (FileCleanerHolder.class); + fileCleaner =3D wfcleaner.getFileCleaner(); + holder =3D new ReaderSpoolFileHolder(); + } +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/storage/JDBCWDCTest.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/JDBCWDCTest.java (revision 3339) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/JDBCWDCTest.java (working copy) +@@ -35,6 +35,7 @@ + import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; + import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCo= ntainer; + import org.exoplatform.services.jcr.impl.storage.value.StandaloneStorageP= luginProvider; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; + import org.exoplatform.services.log.ExoLogger; + import org.exoplatform.services.log.Log; +@@ -103,9 +104,11 @@ + // ref.add(new StringRefAddr("database", "jdbc:hsqldb:file:data/tes= t")); + = + // SimpleJNDIContextInitializer.initialize(sourceName, ref); ++ FileCleanerHolder holder =3D new FileCleanerHolder(); + = + container =3D +- new JDBCWorkspaceDataContainer(config, repositoryEntry, null, ne= w StandaloneStoragePluginProvider(config)); ++ new JDBCWorkspaceDataContainer(config, repositoryEntry, null, ne= w StandaloneStoragePluginProvider(config, ++ holder), holder); + = + Properties logProps =3D new Properties(); + logProps.put("org.apache.commons.logging.simplelog.defaultlog", "de= bug"); +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/CASableFileIOChannelTestBase.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableFileIOChannelTestBase.java (revision 3339) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableFileIOChannelTestBase.java (working copy) +@@ -24,7 +24,6 @@ + import org.exoplatform.services.jcr.impl.storage.value.cas.RecordAlreadyE= xistsException; + import org.exoplatform.services.jcr.impl.storage.value.cas.RecordNotFound= Exception; + import org.exoplatform.services.jcr.impl.storage.value.cas.ValueContentAd= dressStorage; +-import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + import org.exoplatform.services.jcr.util.IdGenerator; + import org.exoplatform.services.log.ExoLogger; + import org.exoplatform.services.log.Log; +@@ -48,8 +47,6 @@ + = + protected ValueContentAddressStorage vcas; + = +- protected FileCleaner fileCleaner; +- + protected File rootDir; + = + protected String storageId; +@@ -61,9 +58,6 @@ + { + super.setUp(); + = +- if (fileCleaner =3D=3D null) +- fileCleaner =3D new FileCleaner(); +- + if (vcas =3D=3D null) + initVCAS(); + = +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/TestFileIOChannel.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TestFileIOChannel.java (revision 3339) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TestFileIOChannel.java (working copy) +@@ -43,7 +43,7 @@ + = + private File rootDir; + = +- private FileCleaner cleaner =3D new FileCleaner(2000); ++ private FileCleaner cleaner; + = + private ValueDataResourceHolder resources =3D new ValueDataResourceHol= der(); + = +@@ -57,6 +57,8 @@ + { + super.setUp(); + = ++ cleaner =3D new FileCleaner(2000); ++ + rootDir =3D new File(new File("target"), "vs1"); + rootDir.mkdirs(); + = +@@ -67,6 +69,15 @@ + = + } + = ++ /** ++ * {@inheritDoc} ++ */ ++ @Override ++ protected void tearDown() throws Exception ++ { ++ cleaner.halt(); ++ } ++ + public void testRead() throws Exception + { + = +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/value/TestPersistedValueData.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestPersistedValueData.java (revision 3339) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestPersistedValueData.java (working copy) +@@ -81,27 +81,34 @@ + = + public void testIfFinalizeRemovesTempFileStreamValueData() throws Exce= ption + { ++ FileCleaner testFileCleaner =3D new FileCleaner(1000, true); ++ try ++ { ++ byte[] buf =3D "0123456789".getBytes(); ++ SwapFile file =3D SwapFile.get(new File("target"), "testIfFinali= zeRemovesTempFileStreamValueData"); ++ //File file =3D new File("target/testIfFinalizeRemovesTempFileSt= reamValueData"); ++ //if (file.exists()) ++ // file.delete(); ++ FileOutputStream out =3D new FileOutputStream(file); ++ out.write(buf); ++ out.close(); + = +- byte[] buf =3D "0123456789".getBytes(); +- SwapFile file =3D SwapFile.get(new File("target"), "testIfFinalizeR= emovesTempFileStreamValueData"); +- //File file =3D new File("target/testIfFinalizeRemovesTempFileStrea= mValueData"); +- //if (file.exists()) +- // file.delete(); +- FileOutputStream out =3D new FileOutputStream(file); +- out.write(buf); +- out.close(); ++ CleanableFilePersistedValueData vd =3D new CleanableFilePersiste= dValueData(0, file, testFileCleaner); ++ assertTrue(file.exists()); + = +- CleanableFilePersistedValueData vd =3D new CleanableFilePersistedVa= lueData(0, file, new FileCleaner(1000, true)); +- assertTrue(file.exists()); ++ vd =3D null; ++ System.gc(); + = +- vd =3D null; +- System.gc(); ++ // allows GC to call finalize on vd ++ Thread.sleep(2500); ++ System.gc(); + = +- // allows GC to call finalize on vd +- Thread.sleep(2500); +- System.gc(); +- +- assertFalse(file.exists()); ++ assertFalse(file.exists()); ++ } ++ finally ++ { ++ testFileCleaner.halt(); ++ } + } + = + public void testConcurrentFileStreamValueDataReading() throws Exception +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/value/TestTransientValueData.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestTransientValueData.java (revision 3339) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestTransientValueData.java (working copy) +@@ -66,37 +66,46 @@ + = + public void testCreateFileStreamTransientValueData() throws Exception + { ++ FileCleaner testFileCleaner =3D new FileCleaner(); ++ try ++ { ++ byte[] buf =3D "0123456789".getBytes(); ++ File file =3D new File("target/testCreateFileStreamTransientValu= eData"); ++ if (file.exists()) ++ file.delete(); ++ FileOutputStream out =3D new FileOutputStream(file); ++ out.write(buf); ++ out.close(); + = +- byte[] buf =3D "0123456789".getBytes(); +- File file =3D new File("target/testCreateFileStreamTransientValueDa= ta"); +- if (file.exists()) +- file.delete(); +- FileOutputStream out =3D new FileOutputStream(file); +- out.write(buf); +- out.close(); ++ FileInputStream fs1 =3D new FileInputStream(file); ++ TransientValueData vd =3D ++ new TransientValueData(0, null, fs1, null, testFileCleaner, 5= , new File("target"), true); + = +- FileInputStream fs1 =3D new FileInputStream(file); +- TransientValueData vd =3D new TransientValueData(0, null, fs1, null= , new FileCleaner(), 5, new File("target"), true); ++ // spool to file ++ InputStream fs2 =3D vd.getAsStream(); ++ assertEquals(10, vd.getLength()); ++ assertTrue(fs2 instanceof FileInputStream); + = +- // spool to file +- InputStream fs2 =3D vd.getAsStream(); +- assertEquals(10, vd.getLength()); +- assertTrue(fs2 instanceof FileInputStream); ++ // not the same object as new is is from spool file ++ assertNotSame(fs1, fs2); ++ // spooled to file so not a byte array ++ assertFalse(vd.isByteArray()); + = +- // not the same object as new is is from spool file +- assertNotSame(fs1, fs2); +- // spooled to file so not a byte array +- assertFalse(vd.isByteArray()); ++ // next call return not the same object as well ++ // (new stream every time) ++ assertNotSame(vd.getAsStream(), fs2); ++ assertEquals(10, vd.getLength()); + = +- // next call return not the same object as well +- // (new stream every time) +- assertNotSame(vd.getAsStream(), fs2); +- assertEquals(10, vd.getLength()); ++ // gets as byte array ++ assertEquals(10, vd.getAsByteArray().length); ++ // but still spooled to file ++ assertFalse(vd.isByteArray()); + = +- // gets as byte array +- assertEquals(10, vd.getAsByteArray().length); +- // but still spooled to file +- assertFalse(vd.isByteArray()); ++ } ++ finally ++ { ++ testFileCleaner.halt(); ++ } + = + } + = +@@ -118,7 +127,7 @@ + // TODO not influenced here as will be spooled to byte array anyway + //vd.setMaxBufferSize(5); + //vd.setFileCleaner(new FileCleaner()); +- = ++ + // + InputStream fs2 =3D vd.getAsStream(); + assertEquals(10, vd.getLength()); +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/value/TestValueImpl.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestValueImpl.java (revision 3339) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestValueImpl.java (working copy) +@@ -50,43 +50,51 @@ + = + public void testNewBinaryValue() throws Exception + { ++ FileCleaner testFileCleaner =3D new FileCleaner(); + = +- byte[] buf =3D "012345678901234567890123456789".getBytes(); +- File file =3D new File("target/testNewBinaryValue"); +- if (file.exists()) +- file.delete(); +- FileOutputStream out =3D new FileOutputStream(file); +- out.write(buf); +- out.close(); ++ try ++ { ++ byte[] buf =3D "012345678901234567890123456789".getBytes(); ++ File file =3D new File("target/testNewBinaryValue"); ++ if (file.exists()) ++ file.delete(); ++ FileOutputStream out =3D new FileOutputStream(file); ++ out.write(buf); ++ out.close(); + = +- FileInputStream fs1 =3D new FileInputStream(file); +- BinaryValue val =3D new BinaryValue(fs1, new FileCleaner(), tempDir= ectory, maxFufferSize); +- InputStream str1 =3D val.getStream(); +- assertNotNull(str1); ++ FileInputStream fs1 =3D new FileInputStream(file); ++ BinaryValue val =3D new BinaryValue(fs1, testFileCleaner, tempDi= rectory, maxFufferSize); ++ InputStream str1 =3D val.getStream(); ++ assertNotNull(str1); + = +- // obj returned by getStream() is not the same as incoming stream +- assertNotSame(str1, fs1); ++ // obj returned by getStream() is not the same as incoming stream ++ assertNotSame(str1, fs1); + = +- // streams returned by subsequent call of val.getStream() are equals +- assertEquals(str1, val.getStream()); ++ // streams returned by subsequent call of val.getStream() are eq= uals ++ assertEquals(str1, val.getStream()); + = +- // another one value using the same string +- BinaryValue val2 =3D new BinaryValue(fs1, new FileCleaner(), tempDi= rectory, maxFufferSize); +- InputStream str2 =3D val2.getStream(); ++ // another one value using the same string ++ BinaryValue val2 =3D new BinaryValue(fs1, testFileCleaner, tempD= irectory, maxFufferSize); ++ InputStream str2 =3D val2.getStream(); + = +- // are not the same although created from same Stream +- assertNotSame(str1, str2); ++ // are not the same although created from same Stream ++ assertNotSame(str1, str2); + = +- // stream already consumed +- try +- { +- val.getString(); +- fail("IllegalStateException should have been thrown"); ++ // stream already consumed ++ try ++ { ++ val.getString(); ++ fail("IllegalStateException should have been thrown"); ++ } ++ catch (IllegalStateException e) ++ { ++ } ++ // System.out.println(" >>>>>>>>STRING >>> "+); + } +- catch (IllegalStateException e) ++ finally + { ++ testFileCleaner.halt(); + } +- // System.out.println(" >>>>>>>>STRING >>> "+); + } + = + public void testNewBinaryValueFromString() throws Exception +Index: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ex= t/replication/ReplicationService.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/r= eplication/ReplicationService.java (revision 3339) ++++ exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/r= eplication/ReplicationService.java (working copy) +@@ -43,7 +43,7 @@ + import org.exoplatform.services.jcr.impl.core.RepositoryImpl; + import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpo= olFileHolder; + import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +-import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHold= er; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; + import org.exoplatform.services.jcr.util.IdGenerator; + import org.exoplatform.services.log.ExoLogger; +@@ -398,8 +398,8 @@ + wconf.getContainer().getParameterInteger(Workspac= eDataContainer.MAXBUFFERSIZE_PROP, + WorkspaceDataContainer.DEF_MAXBUFFERSIZE); + = +- WorkspaceFileCleanerHolder wfcleaner =3D +- (WorkspaceFileCleanerHolder)wsFacade.getComponent= (WorkspaceFileCleanerHolder.class); ++ FileCleanerHolder wfcleaner =3D ++ (FileCleanerHolder)wsFacade.getComponent(FileClea= nerHolder.class); + FileCleaner fileCleaner =3D wfcleaner.getFileCleaner= (); + = + // create the RecoveryManager +Index: exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ex= t/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 +--- exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/B= aseStandaloneTest.java (revision 3339) ++++ exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/B= aseStandaloneTest.java (working copy) +@@ -1,489 +1,489 @@ +-/* +- * 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.ext; +- +-import junit.framework.TestCase; +- +-import org.exoplatform.container.StandaloneContainer; +-import org.exoplatform.services.jcr.RepositoryService; +-import org.exoplatform.services.jcr.config.WorkspaceEntry; +-import org.exoplatform.services.jcr.core.CredentialsImpl; +-import org.exoplatform.services.jcr.core.ManageableRepository; +-import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; +-import org.exoplatform.services.jcr.dataflow.ItemState; +-import org.exoplatform.services.jcr.dataflow.PersistentDataManager; +-import org.exoplatform.services.jcr.datamodel.ItemData; +-import org.exoplatform.services.jcr.datamodel.PropertyData; +-import org.exoplatform.services.jcr.datamodel.ValueData; +-import org.exoplatform.services.jcr.impl.core.NodeImpl; +-import org.exoplatform.services.jcr.impl.core.RepositoryImpl; +-import org.exoplatform.services.jcr.impl.core.SessionImpl; +-import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpo= olFileHolder; +-import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +-import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHold= er; +-import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; +-import org.exoplatform.services.log.ExoLogger; +-import org.exoplatform.services.log.Log; +- +-import java.io.File; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.util.Iterator; +-import java.util.List; +-import java.util.Random; +- +-import javax.jcr.Node; +-import javax.jcr.NodeIterator; +-import javax.jcr.PathNotFoundException; +-import javax.jcr.RepositoryException; +-import javax.jcr.ValueFactory; +-import javax.jcr.Workspace; +- +-/** +- * Created by The eXo Platform SAS . +- * = +- * @author Gennady Azaren= kov +- * @version $Id: BaseStandaloneTest.java 12004 2007-01-17 12:03:57Z geaz $ +- */ +-public abstract class BaseStandaloneTest extends TestCase +-{ +- +- private static final Log log =3D ExoLogger.getLogger("exo.jcr.componen= t.ext.BaseStandaloneTest"); +- +- public static final String WS_NAME =3D "ws"; +- +- protected SessionImpl session; +- +- protected RepositoryImpl repository; +- +- protected CredentialsImpl credentials; +- +- protected Workspace workspace; +- +- protected RepositoryService repositoryService; +- +- protected Node root; +- +- protected PersistentDataManager dataManager; +- +- protected ValueFactory valueFactory; +- +- protected StandaloneContainer container; +- +- public int maxBufferSize =3D 200 * 1024; +- +- public FileCleaner fileCleaner; +- +- public ReaderSpoolFileHolder holder; +- +- protected class CompareStreamException extends Exception +- { +- +- CompareStreamException(String message) +- { +- super(message); +- } +- +- CompareStreamException(String message, Throwable e) +- { +- super(message, e); +- } +- } +- +- public void setUp() throws Exception +- { +- String containerConf =3D BaseStandaloneTest.class.getResource("/con= f/standalone/test-configuration.xml").toString(); +- +- StandaloneContainer.addConfigurationURL(containerConf); +- +- container =3D StandaloneContainer.getInstance(); +- +- if (System.getProperty("java.security.auth.login.config") =3D=3D nu= ll) +- System.setProperty("java.security.auth.login.config", Thread.cur= rentThread().getContextClassLoader() +- .getResource("login.conf").toString()); +- +- credentials =3D new CredentialsImpl("root", "exo".toCharArray()); +- +- repositoryService =3D (RepositoryService)container.getComponentInst= anceOfType(RepositoryService.class); +- +- repository =3D (RepositoryImpl)repositoryService.getDefaultReposito= ry(); +- +- session =3D (SessionImpl)repository.login(credentials, WS_NAME); +- workspace =3D session.getWorkspace(); +- root =3D session.getRootNode(); +- valueFactory =3D session.getValueFactory(); +- +- ManageableRepository repository =3D repositoryService.getDefaultRep= ository(); +- WorkspaceContainerFacade wsc =3D repository.getWorkspaceContainer(W= S_NAME); +- +- WorkspaceEntry wconf =3D (WorkspaceEntry)wsc.getComponent(Workspace= Entry.class); +- +- maxBufferSize =3D +- wconf.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, +- WorkspaceDataContainer.DEF_MAXBUFFERSIZE); +- +- WorkspaceFileCleanerHolder wfcleaner =3D +- (WorkspaceFileCleanerHolder)wsc.getComponent(WorkspaceFileCleane= rHolder.class); +- fileCleaner =3D wfcleaner.getFileCleaner(); +- holder =3D new ReaderSpoolFileHolder(); +- +- wsc =3D repository.getWorkspaceContainer("ws4"); +- dataManager =3D (PersistentDataManager)wsc.getComponent(PersistentD= ataManager.class); +- } +- +- protected void tearDown() throws Exception +- { +- +- log.info("tearDown() BEGIN " + getClass().getName() + "." + getName= ()); +- if (session !=3D null) +- { +- try +- { +- session.refresh(false); +- Node rootNode =3D session.getRootNode(); +- if (rootNode.hasNodes()) +- { +- // clean test root +- for (NodeIterator children =3D rootNode.getNodes(); childr= en.hasNext();) +- { +- Node node =3D children.nextNode(); +- if (!node.getPath().startsWith("/jcr:system") && !node.= getPath().startsWith("/exo:audit") +- && !node.getPath().startsWith("/exo:organization")) +- { +- // log.info("DELETing ------------- "+node.getPath()= ); +- node.remove(); +- } +- } +- session.save(); +- } +- } +- catch (Exception e) +- { +- e.printStackTrace(); +- log.error("=3D=3D=3D=3D=3D Exception in tearDown() " + e.toSt= ring()); +- } +- finally +- { +- session.logout(); +- } +- } +- +- super.tearDown(); +- // log.info("tearDown() END " + getClass().getName() + "." + getNam= e()); +- } +- +- // protected abstract String getConfPath(); +- // +- // public void initRepository() throws RepositoryException { +- // } +- +- // =3D=3D=3D=3D=3D=3D utils =3D=3D=3D=3D=3D=3D=3D +- +- protected void checkItemsExisted(String[] exists, String[] notExists) = throws RepositoryException +- { +- String path =3D null; +- if (exists !=3D null) +- { +- try +- { +- for (String nodePath : exists) +- { +- path =3D nodePath; +- session.getItem(path); +- } +- } +- catch (PathNotFoundException e) +- { +- fail("Item must exists " + path + ". " + e.getMessage()); +- } +- } +- if (notExists !=3D null) +- { +- try +- { +- for (String nodePath : notExists) +- { +- session.getItem(nodePath); +- fail("Item must not exists " + nodePath); +- } +- } +- catch (PathNotFoundException e) +- { +- // ok +- } +- } +- } +- +- protected void checkNodesExistedByUUID(String[] exists, String[] notEx= ists) throws RepositoryException +- { +- String uuid =3D null; +- if (exists !=3D null) +- { +- try +- { +- for (String nodePath : exists) +- { +- uuid =3D nodePath; +- session.getNodeByUUID(uuid); +- } +- } +- catch (PathNotFoundException e) +- { +- fail("Node must exists, UUID " + uuid + ". " + e.getMessage()= ); +- } +- } +- if (notExists !=3D null) +- { +- try +- { +- for (String nodeUUID : notExists) +- { +- session.getNodeByUUID(nodeUUID); +- fail("Node must not exists, UUID " + nodeUUID); +- } +- } +- catch (PathNotFoundException e) +- { +- // ok +- } +- } +- } +- +- protected void compareStream(InputStream etalon, InputStream data) thr= ows IOException +- { +- try +- { +- compareStream(etalon, data, 0, 0, -1); +- } +- catch (CompareStreamException e) +- { +- fail(e.getMessage()); +- } +- } +- +- /** +- * Compare etalon stream with data stream begining from the offset in = etalon and position in data. +- * Length bytes will be readed and compared. if length is lower 0 then= compare streams till one of +- * them will be read. +- * = +- * @param etalon +- * @param data +- * @param etalonPos +- * @param length +- * @param dataPos +- * @throws IOException +- */ +- protected void compareStream(InputStream etalon, InputStream data, lon= g etalonPos, long dataPos, long length) +- throws IOException, CompareStreamException +- { +- +- int dindex =3D 0; +- +- skipStream(etalon, etalonPos); +- skipStream(data, dataPos); +- +- byte[] ebuff =3D new byte[1024]; +- int eread =3D 0; +- +- while ((eread =3D etalon.read(ebuff)) > 0) +- { +- +- byte[] dbuff =3D new byte[eread]; +- int erindex =3D 0; +- while (erindex < eread) +- { +- int dread =3D -1; +- try +- { +- dread =3D data.read(dbuff); +- } +- catch (IOException e) +- { +- throw new CompareStreamException("Streams is not equals by= length or data stream is unreadable. Cause: " +- + e.getMessage()); +- } +- +- if (dread =3D=3D -1) +- throw new CompareStreamException( +- "Streams is not equals by length. Data end-of-stream re= ached at position " + dindex); +- +- for (int i =3D 0; i < dread; i++) +- { +- byte eb =3D ebuff[i]; +- byte db =3D dbuff[i]; +- if (eb !=3D db) +- throw new CompareStreamException("Streams is not equals= . Wrong byte stored at position " + dindex +- + " of data stream. Expected 0x" + Integer.toHexStri= ng(eb) + " '" + new String(new byte[]{eb}) +- + "' but found 0x" + Integer.toHexString(db) + " '" = + new String(new byte[]{db}) + "'"); +- +- erindex++; +- dindex++; +- if (length > 0 && dindex >=3D length) +- return; // tested length reached +- } +- +- if (dread < eread) +- dbuff =3D new byte[eread - dread]; +- } +- } +- +- if (data.available() > 0) +- throw new CompareStreamException("Streams is not equals by lengt= h. Data stream contains more data. Were read " +- + dindex); +- } +- +- protected void skipStream(InputStream stream, long pos) throws IOExcep= tion +- { +- long curPos =3D pos; +- long sk =3D 0; +- while ((sk =3D stream.skip(curPos)) > 0) +- { +- curPos -=3D sk; +- }; +- if (sk < 0) +- fail("Can not read the stream (skip bytes)"); +- if (curPos !=3D 0) +- fail("Can not skip bytes from the stream (" + pos + " bytes)"); +- } +- +- protected File createBLOBTempFile(int sizeInKb) throws IOException +- { +- return createBLOBTempFile("exo_jcr_test_temp_file_", sizeInKb); +- } +- +- protected File createBLOBTempFile(String prefix, int sizeInKb) throws = IOException +- { +- // create test file +- byte[] data =3D new byte[1024]; // 1Kb +- +- File testFile =3D File.createTempFile(prefix, ".tmp"); +- FileOutputStream tempOut =3D new FileOutputStream(testFile); +- Random random =3D new Random(); +- +- for (int i =3D 0; i < sizeInKb; i++) +- { +- random.nextBytes(data); +- tempOut.write(data); +- } +- tempOut.close(); +- testFile.deleteOnExit(); // delete on test exit +- log.info("Temp file created: " + testFile.getAbsolutePath() + " siz= e: " + testFile.length()); +- return testFile; +- } +- +- protected void checkMixins(String[] mixins, NodeImpl node) throws Repo= sitoryException +- { +- try +- { +- String[] nodeMixins =3D node.getMixinTypeNames(); +- assertEquals("Mixins count is different", mixins.length, nodeMix= ins.length); +- +- compareMixins(mixins, nodeMixins); +- } +- catch (RepositoryException e) +- { +- fail("Mixins isn't accessible on the node " + node.getPath()); +- } +- } +- +- protected void compareMixins(String[] mixins, String[] nodeMixins) +- { +- nextMixin : for (String mixin : mixins) +- { +- for (String nodeMixin : nodeMixins) +- { +- if (mixin.equals(nodeMixin)) +- continue nextMixin; +- } +- +- fail("Mixin '" + mixin + "' isn't accessible"); +- } +- } +- +- protected String memoryInfo() +- { +- String info =3D ""; +- info =3D +- "free: " + mb(Runtime.getRuntime().freeMemory()) + "M of " + mb(= Runtime.getRuntime().totalMemory()) +- + "M (max: " + mb(Runtime.getRuntime().maxMemory()) + "M)"; +- return info; +- } +- +- // bytes to Mbytes +- protected String mb(long mem) +- { +- return String.valueOf(Math.round(mem * 100d / (1024d * 1024d)) / 10= 0d); +- } +- +- protected String execTime(long from) +- { +- return Math.round(((System.currentTimeMillis() - from) * 100.00d / = 60000.00d)) / 100.00d + "min"; +- } +- +- public void checkItemStatesIterator(Iterator expected, Iter= ator changes, boolean checklast, +- boolean isRepValDat) throws Exception +- { +- +- while (expected.hasNext()) +- { +- +- assertTrue(changes.hasNext()); +- ItemState expect =3D expected.next(); +- ItemState elem =3D changes.next(); +- +- assertEquals(expect.getState(), elem.getState()); +- // assertEquals(expect.getAncestorToSave(), elem.getAncestorToSa= ve()); +- ItemData expData =3D expect.getData(); +- ItemData elemData =3D elem.getData(); +- assertEquals(expData.getQPath(), elemData.getQPath()); +- assertEquals(expData.isNode(), elemData.isNode()); +- assertEquals(expData.getIdentifier(), elemData.getIdentifier()); +- assertEquals(expData.getParentIdentifier(), elemData.getParentId= entifier()); +- +- if (!expData.isNode()) +- { +- PropertyData expProp =3D (PropertyData)expData; +- PropertyData elemProp =3D (PropertyData)elemData; +- assertEquals(expProp.getType(), elemProp.getType()); +- assertEquals(expProp.isMultiValued(), elemProp.isMultiValued(= )); +- +- List expValDat =3D expProp.getValues(); +- List elemValDat =3D elemProp.getValues(); +- assertEquals(expValDat.size(), elemValDat.size()); +- for (int j =3D 0; j < expValDat.size(); j++) +- { +- assertTrue(java.util.Arrays +- .equals(expValDat.get(j).getAsByteArray(), elemValDat.g= et(j).getAsByteArray())); +- +- /*if (isRepValDat) { +- // check is received property values ReplicableValueData +- assertTrue(elemValDat.get(j) instanceof ReplicableValueD= ata); +- }*/ +- } +- } +- } +- +- if (checklast) +- { +- assertFalse(changes.hasNext()); +- } +- +- } +-} ++/* ++ * 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.ext; ++ ++import junit.framework.TestCase; ++ ++import org.exoplatform.container.StandaloneContainer; ++import org.exoplatform.services.jcr.RepositoryService; ++import org.exoplatform.services.jcr.config.WorkspaceEntry; ++import org.exoplatform.services.jcr.core.CredentialsImpl; ++import org.exoplatform.services.jcr.core.ManageableRepository; ++import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; ++import org.exoplatform.services.jcr.dataflow.ItemState; ++import org.exoplatform.services.jcr.dataflow.PersistentDataManager; ++import org.exoplatform.services.jcr.datamodel.ItemData; ++import org.exoplatform.services.jcr.datamodel.PropertyData; ++import org.exoplatform.services.jcr.datamodel.ValueData; ++import org.exoplatform.services.jcr.impl.core.NodeImpl; ++import org.exoplatform.services.jcr.impl.core.RepositoryImpl; ++import org.exoplatform.services.jcr.impl.core.SessionImpl; ++import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpo= olFileHolder; ++import org.exoplatform.services.jcr.impl.util.io.FileCleaner; ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; ++import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; ++import org.exoplatform.services.log.ExoLogger; ++import org.exoplatform.services.log.Log; ++ ++import java.io.File; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.io.InputStream; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Random; ++ ++import javax.jcr.Node; ++import javax.jcr.NodeIterator; ++import javax.jcr.PathNotFoundException; ++import javax.jcr.RepositoryException; ++import javax.jcr.ValueFactory; ++import javax.jcr.Workspace; ++ ++/** ++ * Created by The eXo Platform SAS . ++ * = ++ * @author Gennady Azaren= kov ++ * @version $Id: BaseStandaloneTest.java 12004 2007-01-17 12:03:57Z geaz $ ++ */ ++public abstract class BaseStandaloneTest extends TestCase ++{ ++ ++ private static final Log log =3D ExoLogger.getLogger("exo.jcr.componen= t.ext.BaseStandaloneTest"); ++ ++ public static final String WS_NAME =3D "ws"; ++ ++ protected SessionImpl session; ++ ++ protected RepositoryImpl repository; ++ ++ protected CredentialsImpl credentials; ++ ++ protected Workspace workspace; ++ ++ protected RepositoryService repositoryService; ++ ++ protected Node root; ++ ++ protected PersistentDataManager dataManager; ++ ++ protected ValueFactory valueFactory; ++ ++ protected StandaloneContainer container; ++ ++ public int maxBufferSize =3D 200 * 1024; ++ ++ public FileCleaner fileCleaner; ++ ++ public ReaderSpoolFileHolder holder; ++ ++ protected class CompareStreamException extends Exception ++ { ++ ++ CompareStreamException(String message) ++ { ++ super(message); ++ } ++ ++ CompareStreamException(String message, Throwable e) ++ { ++ super(message, e); ++ } ++ } ++ ++ public void setUp() throws Exception ++ { ++ String containerConf =3D BaseStandaloneTest.class.getResource("/con= f/standalone/test-configuration.xml").toString(); ++ ++ StandaloneContainer.addConfigurationURL(containerConf); ++ ++ container =3D StandaloneContainer.getInstance(); ++ ++ if (System.getProperty("java.security.auth.login.config") =3D=3D nu= ll) ++ System.setProperty("java.security.auth.login.config", Thread.cur= rentThread().getContextClassLoader() ++ .getResource("login.conf").toString()); ++ ++ credentials =3D new CredentialsImpl("root", "exo".toCharArray()); ++ ++ repositoryService =3D (RepositoryService)container.getComponentInst= anceOfType(RepositoryService.class); ++ ++ repository =3D (RepositoryImpl)repositoryService.getDefaultReposito= ry(); ++ ++ session =3D (SessionImpl)repository.login(credentials, WS_NAME); ++ workspace =3D session.getWorkspace(); ++ root =3D session.getRootNode(); ++ valueFactory =3D session.getValueFactory(); ++ ++ ManageableRepository repository =3D repositoryService.getDefaultRep= ository(); ++ WorkspaceContainerFacade wsc =3D repository.getWorkspaceContainer(W= S_NAME); ++ ++ WorkspaceEntry wconf =3D (WorkspaceEntry)wsc.getComponent(Workspace= Entry.class); ++ ++ maxBufferSize =3D ++ wconf.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, ++ WorkspaceDataContainer.DEF_MAXBUFFERSIZE); ++ ++ FileCleanerHolder wfcleaner =3D ++ (FileCleanerHolder)wsc.getComponent(FileCleanerHolder.class); ++ fileCleaner =3D wfcleaner.getFileCleaner(); ++ holder =3D new ReaderSpoolFileHolder(); ++ ++ wsc =3D repository.getWorkspaceContainer("ws4"); ++ dataManager =3D (PersistentDataManager)wsc.getComponent(PersistentD= ataManager.class); ++ } ++ ++ protected void tearDown() throws Exception ++ { ++ ++ log.info("tearDown() BEGIN " + getClass().getName() + "." + getName= ()); ++ if (session !=3D null) ++ { ++ try ++ { ++ session.refresh(false); ++ Node rootNode =3D session.getRootNode(); ++ if (rootNode.hasNodes()) ++ { ++ // clean test root ++ for (NodeIterator children =3D rootNode.getNodes(); childr= en.hasNext();) ++ { ++ Node node =3D children.nextNode(); ++ if (!node.getPath().startsWith("/jcr:system") && !node.= getPath().startsWith("/exo:audit") ++ && !node.getPath().startsWith("/exo:organization")) ++ { ++ // log.info("DELETing ------------- "+node.getPath()= ); ++ node.remove(); ++ } ++ } ++ session.save(); ++ } ++ } ++ catch (Exception e) ++ { ++ e.printStackTrace(); ++ log.error("=3D=3D=3D=3D=3D Exception in tearDown() " + e.toSt= ring()); ++ } ++ finally ++ { ++ session.logout(); ++ } ++ } ++ ++ super.tearDown(); ++ // log.info("tearDown() END " + getClass().getName() + "." + getNam= e()); ++ } ++ ++ // protected abstract String getConfPath(); ++ // ++ // public void initRepository() throws RepositoryException { ++ // } ++ ++ // =3D=3D=3D=3D=3D=3D utils =3D=3D=3D=3D=3D=3D=3D ++ ++ protected void checkItemsExisted(String[] exists, String[] notExists) = throws RepositoryException ++ { ++ String path =3D null; ++ if (exists !=3D null) ++ { ++ try ++ { ++ for (String nodePath : exists) ++ { ++ path =3D nodePath; ++ session.getItem(path); ++ } ++ } ++ catch (PathNotFoundException e) ++ { ++ fail("Item must exists " + path + ". " + e.getMessage()); ++ } ++ } ++ if (notExists !=3D null) ++ { ++ try ++ { ++ for (String nodePath : notExists) ++ { ++ session.getItem(nodePath); ++ fail("Item must not exists " + nodePath); ++ } ++ } ++ catch (PathNotFoundException e) ++ { ++ // ok ++ } ++ } ++ } ++ ++ protected void checkNodesExistedByUUID(String[] exists, String[] notEx= ists) throws RepositoryException ++ { ++ String uuid =3D null; ++ if (exists !=3D null) ++ { ++ try ++ { ++ for (String nodePath : exists) ++ { ++ uuid =3D nodePath; ++ session.getNodeByUUID(uuid); ++ } ++ } ++ catch (PathNotFoundException e) ++ { ++ fail("Node must exists, UUID " + uuid + ". " + e.getMessage()= ); ++ } ++ } ++ if (notExists !=3D null) ++ { ++ try ++ { ++ for (String nodeUUID : notExists) ++ { ++ session.getNodeByUUID(nodeUUID); ++ fail("Node must not exists, UUID " + nodeUUID); ++ } ++ } ++ catch (PathNotFoundException e) ++ { ++ // ok ++ } ++ } ++ } ++ ++ protected void compareStream(InputStream etalon, InputStream data) thr= ows IOException ++ { ++ try ++ { ++ compareStream(etalon, data, 0, 0, -1); ++ } ++ catch (CompareStreamException e) ++ { ++ fail(e.getMessage()); ++ } ++ } ++ ++ /** ++ * Compare etalon stream with data stream begining from the offset in = etalon and position in data. ++ * Length bytes will be readed and compared. if length is lower 0 then= compare streams till one of ++ * them will be read. ++ * = ++ * @param etalon ++ * @param data ++ * @param etalonPos ++ * @param length ++ * @param dataPos ++ * @throws IOException ++ */ ++ protected void compareStream(InputStream etalon, InputStream data, lon= g etalonPos, long dataPos, long length) ++ throws IOException, CompareStreamException ++ { ++ ++ int dindex =3D 0; ++ ++ skipStream(etalon, etalonPos); ++ skipStream(data, dataPos); ++ ++ byte[] ebuff =3D new byte[1024]; ++ int eread =3D 0; ++ ++ while ((eread =3D etalon.read(ebuff)) > 0) ++ { ++ ++ byte[] dbuff =3D new byte[eread]; ++ int erindex =3D 0; ++ while (erindex < eread) ++ { ++ int dread =3D -1; ++ try ++ { ++ dread =3D data.read(dbuff); ++ } ++ catch (IOException e) ++ { ++ throw new CompareStreamException("Streams is not equals by= length or data stream is unreadable. Cause: " ++ + e.getMessage()); ++ } ++ ++ if (dread =3D=3D -1) ++ throw new CompareStreamException( ++ "Streams is not equals by length. Data end-of-stream re= ached at position " + dindex); ++ ++ for (int i =3D 0; i < dread; i++) ++ { ++ byte eb =3D ebuff[i]; ++ byte db =3D dbuff[i]; ++ if (eb !=3D db) ++ throw new CompareStreamException("Streams is not equals= . Wrong byte stored at position " + dindex ++ + " of data stream. Expected 0x" + Integer.toHexStri= ng(eb) + " '" + new String(new byte[]{eb}) ++ + "' but found 0x" + Integer.toHexString(db) + " '" = + new String(new byte[]{db}) + "'"); ++ ++ erindex++; ++ dindex++; ++ if (length > 0 && dindex >=3D length) ++ return; // tested length reached ++ } ++ ++ if (dread < eread) ++ dbuff =3D new byte[eread - dread]; ++ } ++ } ++ ++ if (data.available() > 0) ++ throw new CompareStreamException("Streams is not equals by lengt= h. Data stream contains more data. Were read " ++ + dindex); ++ } ++ ++ protected void skipStream(InputStream stream, long pos) throws IOExcep= tion ++ { ++ long curPos =3D pos; ++ long sk =3D 0; ++ while ((sk =3D stream.skip(curPos)) > 0) ++ { ++ curPos -=3D sk; ++ }; ++ if (sk < 0) ++ fail("Can not read the stream (skip bytes)"); ++ if (curPos !=3D 0) ++ fail("Can not skip bytes from the stream (" + pos + " bytes)"); ++ } ++ ++ protected File createBLOBTempFile(int sizeInKb) throws IOException ++ { ++ return createBLOBTempFile("exo_jcr_test_temp_file_", sizeInKb); ++ } ++ ++ protected File createBLOBTempFile(String prefix, int sizeInKb) throws = IOException ++ { ++ // create test file ++ byte[] data =3D new byte[1024]; // 1Kb ++ ++ File testFile =3D File.createTempFile(prefix, ".tmp"); ++ FileOutputStream tempOut =3D new FileOutputStream(testFile); ++ Random random =3D new Random(); ++ ++ for (int i =3D 0; i < sizeInKb; i++) ++ { ++ random.nextBytes(data); ++ tempOut.write(data); ++ } ++ tempOut.close(); ++ testFile.deleteOnExit(); // delete on test exit ++ log.info("Temp file created: " + testFile.getAbsolutePath() + " siz= e: " + testFile.length()); ++ return testFile; ++ } ++ ++ protected void checkMixins(String[] mixins, NodeImpl node) throws Repo= sitoryException ++ { ++ try ++ { ++ String[] nodeMixins =3D node.getMixinTypeNames(); ++ assertEquals("Mixins count is different", mixins.length, nodeMix= ins.length); ++ ++ compareMixins(mixins, nodeMixins); ++ } ++ catch (RepositoryException e) ++ { ++ fail("Mixins isn't accessible on the node " + node.getPath()); ++ } ++ } ++ ++ protected void compareMixins(String[] mixins, String[] nodeMixins) ++ { ++ nextMixin : for (String mixin : mixins) ++ { ++ for (String nodeMixin : nodeMixins) ++ { ++ if (mixin.equals(nodeMixin)) ++ continue nextMixin; ++ } ++ ++ fail("Mixin '" + mixin + "' isn't accessible"); ++ } ++ } ++ ++ protected String memoryInfo() ++ { ++ String info =3D ""; ++ info =3D ++ "free: " + mb(Runtime.getRuntime().freeMemory()) + "M of " + mb(= Runtime.getRuntime().totalMemory()) ++ + "M (max: " + mb(Runtime.getRuntime().maxMemory()) + "M)"; ++ return info; ++ } ++ ++ // bytes to Mbytes ++ protected String mb(long mem) ++ { ++ return String.valueOf(Math.round(mem * 100d / (1024d * 1024d)) / 10= 0d); ++ } ++ ++ protected String execTime(long from) ++ { ++ return Math.round(((System.currentTimeMillis() - from) * 100.00d / = 60000.00d)) / 100.00d + "min"; ++ } ++ ++ public void checkItemStatesIterator(Iterator expected, Iter= ator changes, boolean checklast, ++ boolean isRepValDat) throws Exception ++ { ++ ++ while (expected.hasNext()) ++ { ++ ++ assertTrue(changes.hasNext()); ++ ItemState expect =3D expected.next(); ++ ItemState elem =3D changes.next(); ++ ++ assertEquals(expect.getState(), elem.getState()); ++ // assertEquals(expect.getAncestorToSave(), elem.getAncestorToSa= ve()); ++ ItemData expData =3D expect.getData(); ++ ItemData elemData =3D elem.getData(); ++ assertEquals(expData.getQPath(), elemData.getQPath()); ++ assertEquals(expData.isNode(), elemData.isNode()); ++ assertEquals(expData.getIdentifier(), elemData.getIdentifier()); ++ assertEquals(expData.getParentIdentifier(), elemData.getParentId= entifier()); ++ ++ if (!expData.isNode()) ++ { ++ PropertyData expProp =3D (PropertyData)expData; ++ PropertyData elemProp =3D (PropertyData)elemData; ++ assertEquals(expProp.getType(), elemProp.getType()); ++ assertEquals(expProp.isMultiValued(), elemProp.isMultiValued(= )); ++ ++ List expValDat =3D expProp.getValues(); ++ List elemValDat =3D elemProp.getValues(); ++ assertEquals(expValDat.size(), elemValDat.size()); ++ for (int j =3D 0; j < expValDat.size(); j++) ++ { ++ assertTrue(java.util.Arrays ++ .equals(expValDat.get(j).getAsByteArray(), elemValDat.g= et(j).getAsByteArray())); ++ ++ /*if (isRepValDat) { ++ // check is received property values ReplicableValueData ++ assertTrue(elemValDat.get(j) instanceof ReplicableValueD= ata); ++ }*/ ++ } ++ } ++ } ++ ++ if (checklast) ++ { ++ assertFalse(changes.hasNext()); ++ } ++ ++ } ++} --===============3400697289697686851==-- From do-not-reply at jboss.org Mon Oct 25 02:31:30 2010 Content-Type: multipart/mixed; boundary="===============2859203001735417632==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3342 - jcr/tags/1.12.5-GA. Date: Mon, 25 Oct 2010 02:31:29 -0400 Message-ID: <201010250631.o9P6VTlB011026@svn01.web.mwc.hst.phx2.redhat.com> --===============2859203001735417632== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-25 02:31:29 -0400 (Mon, 25 Oct 2010) New Revision: 3342 Added: jcr/tags/1.12.5-GA/readme.txt Log: EXOJCR-1016: release notes Added: jcr/tags/1.12.5-GA/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.5-GA/readme.txt (rev 0) +++ jcr/tags/1.12.5-GA/readme.txt 2010-10-25 06:31:29 UTC (rev 3342) @@ -0,0 +1,388 @@ +JCR 1.12.5-GA release notes +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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 with clustering support. + +Features of this version: +- JobSchedulerServiceImpl support multi portal containers +- Performance improvements + +Changes of 1.12.5-GA +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [KER-162] - Simple skin from examples folder doesn't appear at list + * [KER-163] - CachingContainer returns unregistered components + * [COR-213] - User logged-out and cannot login after some inactivity + * [WS-254] - Add org.exoplatform.services.rest.ext.method.filter.Metho= dAccessFilter in container configuration by default + * [JCR-1438] - Problem with JCR versionning + * [JCR-1449] - Can't get property of a node if it has a child node wit= h the same name with the property + * [JCR-1450] - JCROrganizationService contains nodetype with same name= as in CS + * [JCR-1453] - Missed nodetypes in cluster testing configuration + * [JCR-1462] - Problems during testing of backup on jcr 1.12.5-GA-SNAP= SHOT + * [JCR-1466] - RepositoryException: URI is not hierarchical on remove = workspace via backup console + * [JCR-1474] - NPE when try to import data via WorkspaceContentImporter + +Improvement + * [KER-160] - Prevent the JobSchedulerServiceImpl to launch jobs that = rely on non started services in JBoss AS + * [KER-161] - Make the JobSchedulerServiceImpl support multi portal co= ntainers + +Task + * [JCR-1455] - Doc's title should be rename from eXoJCR Reference Manu= al to eXo JCR Developer Guide + * [JCR-1461] - Remove timestamp from names of jar-files in application= bundles + * [JCR-1467] - Cannot use webdav service with a version of jcr:content + * [JCR-1471] - Updating eXo JCR version in ra.xml automatically + * [JCR-1472] - Adopt Backup client article + * [JCR-1473] - merge performance improvements + +Changes of 1.12.4-GA +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-688] - Some entries in the eXo JCR cache are not evicted pro= perly + * [EXOJCR-843] - Exceptions after importing file with version history + * [EXOJCR-849] - "Permission denied" on client side, when trying to mo= ve file(s) to another workspace through FTP + * [EXOJCR-856] - Problems while recopying same files via webdav + * [EXOJCR-865] - Data corrupt after restore a node which has been impo= rted with version history + * [EXOJCR-878] - WebDAV doesn't work with nt:file + * [EXOJCR-879] - TestCaching.testNotModifiedSince failed in same cases + * [EXOJCR-888] - The problems with restore version node + * [EXOJCR-890] - JSON framework don't work with beans created in groovy + * [EXOJCR-891] - Snaphosts IDs make the applications build improperly + * [EXOJCR-908] - Used wrong delimiter during parsing permission value + * [EXOJCR-909] - In LDAPService, InitialContext is not safely closed i= n authenticate method + * [EXOJCR-912] - Unable to convert the JCR documentation to pdf + * [EXOJCR-916] - Duplicate instantiation of some services + * [EXOJCR-921] - Workspace.copy(srcWS, srcAbsPath, destAbsPath) can no= t copy root child to another workspace root child + * [EXOJCR-924] - Unable to coerce 'Event' into a LONG: java.lang.Numbe= rFormatException: For input string: "Event" + * [EXOJCR-933] - Determine property type from nodetype definition in D= ocumentViewImport for version history. + * [EXOJCR-936] - Avoid converting binary value to String in tests + +Feature Request + * [EXOJCR-842] - Allow to disable a given PortalContainer + * [EXOJCR-880] - Determine property is multi or single value from node= type definition in import. + * [EXOJCR-886] - Update the document handler to manage MS Office 2007 = meta data extraction (docx, ...) + * [EXOJCR-934] - Decouple event name from listener name in ListenerSer= vice. + * [EXOJCR-935] - Add "dav:isreadonly" property management + +Task + * [EXOJCR-896] - Port Manageability article into docbook + * [EXOJCR-905] - Merge the reference guide and the user guide in one s= ingle guide + * [EXOJCR-913] - Abuse of INFO level logging for DocNumberCache.get() + * [EXOJCR-914] - excessive INFO logging by IndexMerger.run() + * [EXOJCR-915] - excessive INFO logging by IndexMerger.run() + * [EXOJCR-917] - core.packaging.module.js error when in deploy phase + * [EXOJCR-919] - maxVolatileTime should be checked on checkFlush() + * [EXOJCR-927] - Add "application/x-groovy+html" to HTMLDocumentReader= and "application/x-jaxrs+groovy" to TextPlainDocumentReader + * [EXOJCR-892] - Remove Fake Chapters + +Changes of 1.12.3-GA +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + = +Bug + * [EXOJCR-754] - JDBC Statements left open : Use of Datasources instea= d of DBCP and C3P0 pools + * [EXOJCR-763] - Reordering samename sibling nodes does not update pat= h of child nodes + * [EXOJCR-766] - QPath isDescendantOf returns wrong result on samename= siblings + * [EXOJCR-774] - If-Modified-Since doesn't seem to be well managed in = the Wevdav + * [EXOJCR-781] - LockManagerImpl should call InitialContextInitializer= .recall + * [EXOJCR-784] - DOC : wrong examples in profiles section + * [EXOJCR-785] - Parameter maxVolatileTime is not working correctly + * [EXOJCR-788] - Inconsistency issue cans occur on default portal cont= ainer parameters + * [EXOJCR-795] - Unexpected behavior of the method PortalContainer.isS= copeValid() + * [EXOJCR-796] - Data corruption + * [EXOJCR-804] - "No such file or directory" exception for value stora= ge when using MySQL or Postgres DB in WCM demo 2.0 + * [EXOJCR-806] - Problems while copying "ftp-ftp" + * [EXOJCR-810] - TestRemoveFromValueStorage failed in configuration wi= thout ValueStorage + * [EXOJCR-813] - ItemImpl.getParent method must return session pooled = parent + * [EXOJCR-817] - max-buffer-size from configuration should be use to T= ransientValueData in import (docview and sysview) + * [EXOJCR-835] - TestMultiDbJDBCConnection and TestSingleDbJDBCConnect= ion must drop also JCR_xCONTAINER table on tearDown + * [EXOJCR-857] - Exception during PROPFIND request if some property co= ntent "%" and after not hex chracters + * [EXOJCR-865] - Data corrupt after restore a node which has been impo= rted with version history + * [EXOJCR-882] - TestCaching fails on Windows XP SP 2 with Russian loc= ale + = +Feature Request + * [EXOJCR-230] - Refactore and move in main part of exo.ws.rest.core p= roject class AbstractResourceTest + * [EXOJCR-782] - No longer force extension developers to redefine the = whole dependencies list + * [EXOJCR-783] - Use cached table for HSLQLDB tables + * [EXOJCR-797] - Unable see error message from ProxyService if remote = server does not provide Content-Type header. + = +Task + * [EXOJCR-392] - Siblings reordering may update not all the child-item= s in cache + * [EXOJCR-751] - Prepare maintenance branch for jcr 1.12 + * [EXOJCR-808] - For Sybase DB "check-sns-new-connection" should be se= t to false by default + * [EXOJCR-809] - OrganizationService's tests should not be excluded + * [EXOJCR-815] - Document how to use AS Managed DataSource + * [EXOJCR-867] - Port documentation for Kernel from wiki to docbook + * [EXOJCR-868] - Port documentation for Core from wiki to docbook + * [EXOJCR-869] - Port documentation for JCR from wiki to docbook + * [EXOJCR-870] - Cleanup WS documentation + * [EXOJCR-871] - Document RestServicesList service + * [EXOJCR-881] - Port functionality of EXOJCR-482 in jcr-1.12.x + * [EXOJCR-884] - Rename JCR documentation artifacts to exo.jcr.* form + +Changes of 1.12.2-GA +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-497] - JCR serialization test wrong logic with CASable stora= ge + * [EXOJCR-730] - Restored repository not accessible after restart Tomc= at + * [EXOJCR-731] - Deploy error (500 - Unexpected error. null) of REST S= ervice with annotation inheritance. + * [EXOJCR-735] - JCR repositories created in runtime is not available = after eXo Social restart + * [EXOJCR-736] - Problems with anonymous entrance on FTP and NPE + * [EXOJCR-743] - InitialContextBinder bind twice same datasource in so= me case + * [EXOJCR-762] - Check whether the repository with the given name does= n't exists before starting restore from backup + +Feature Request + * [EXOJCR-640] - Migrate to newer version of Apache PDFBox ( and FontB= ox ) if possible; + +Task + * [EXOJCR-596] - Upload eXoJCR documentation on jboss.org + * [EXOJCR-668] - Validate format of the default values of the property= definition during the nodetype registration + * [EXOJCR-738] - Search does not work with source in CDATA tag in XML = document + * [EXOJCR-740] - Constrains ranges are not used in NodeTypeImpl.canSet= Property() validation + * [EXOJCR-741] - Backupconsole build improvements + * [EXOJCR-765] - Use StringBuilder instead of String concatenation in = MSExcelDocumentReader.getContentAsText + * [EXOJCR-681] - Decreasing perfomance while running WebdavReadWriteTe= st tests several times in row + + + +Changes of 1.12.2-CR1 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-175] - Problems with HTTPBackupAgent - Cyrillic symbols aren= 't showing after restore + * [EXOJCR-683] - java.io.IOException: Socket read failed on heavy load= ed WebdavAddBLOBTest benchmark test + * [EXOJCR-697] - SQL search by date doesn't work + * [EXOJCR-698] - URL encoding in SEARCH and PROPFIND responces differs. + * [EXOJCR-700] - Problem in user search with MySql and PostgresDB + * [EXOJCR-704] - JCR testuite hangs on sybase + * [EXOJCR-708] - Problem with full text searching in text files with n= on-latin content. + * [EXOJCR-712] - Concurrent service creation leads to duplicate servic= e instantiation + * [EXOJCR-724] - Bad URL in the error message when a component cannot = be instantiated + * [EXOJCR-726] - Improper conversion of jboss.server.config.url system= property value into File (spaces in filename problem) + * [EXOJCR-729] - The FileNotFoundException in restore workspace over B= ackupWorkspaceinitializer + * [EXOJCR-734] - The binary values was not stored in incremental backu= p. + +Feature Request + * [EXOJCR-705] - Expose listeners in OrganizationService + * [EXOJCR-707] - Check repository management operations on thread safe= ty + * [EXOJCR-718] - Allow to get the complete configuration at runtime + * [EXOJCR-719] - Better debugging of components loaded + * [EXOJCR-721] - Add possibility to use customized GroovyClassLoader i= n org.exoplatform.services.script.groovy.GroovyScriptInstantiator + * [EXOJCR-722] - Make it possible to use other then org.exoplatform.se= rvices.rest.impl.method.DefaultMethodInvoker + +Task + * [EXOJCR-354] - Invoke post read after permissions check + * [EXOJCR-663] - Make possibility extends classes RequestDispatcher an= d ResourceBinder. + * [EXOJCR-691] - Fix your missing dependencies + * [EXOJCR-692] - Find the reason why the method of type Node.hasNodes = is much slower since beta5 + * [EXOJCR-694] - Change JBC dependencies to use 3.2.4.GA + * [EXOJCR-696] - Reduce the concurrency Level in the JBoss Cache Config + * [EXOJCR-711] - Misleading error message appears when the external se= ttings cannot be found + * [EXOJCR-714] - Improve the usability of the ContainerLifecyclePlugin + * [EXOJCR-715] - Ensure that the ExoContainer is fully ThreadSafe + * [EXOJCR-716] - Prevent the JobSchedulerServiceImpl to launch jobs th= at rely on non started services + * [EXOJCR-717] - Add to RestRegistryService method without repositoryN= ame in PathParam, insted use current repository. Methods with repositoryNam= e in PathParam marks as Deprecated. + * [EXOJCR-720] - Make possibility extends classe GroovyScript2RestLoad= er + * [EXOJCR-723] - JCR Statistics: Describe the arguments of the methods= exposed through JMX + * [EXOJCR-728] - implementing RequestLifecycle for REST services + + +Changes of 1.12.1-GA +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-612] - JBoss Cache Implementation for the Cache Service test= TestAbstractExoCache fails + * [EXOJCR-638] - get mixin types through the NodeTypeUtil class + * [EXOJCR-661] - Cannot access to the MBeans through the JConsole in S= tandalone mode + * [EXOJCR-662] - Processing SQLException may cause infinite loop. + * [EXOJCR-664] - org.exoplatform.services.jcr.impl.storage.value.fs.Te= stFileIOChannel.testConcurrentRead fail with MSSQL and DB2 + * [EXOJCR-667] - Temporary spooled file can be not found on save + * [EXOJCR-671] - ConcurrentModificationException in FileCleaner with h= eavy load + * [EXOJCR-672] - An eXoCache clear should be local + * [EXOJCR-687] - Some JCR parameters that are time parameter are retri= eved as number instead of time + +Feature Request + * [EXOJCR-498] - Provide more details when a JCR query is invalid + * [EXOJCR-634] - Upload of a file with special characters like " ' " i= n filename is not supported by the FTPservice + * [EXOJCR-645] - Add ExtHttpHeaders.JAXRS_BODY_PROVIDED header for unh= andled exception in REST services and set error message to body responce + +Task + * [EXOJCR-578] - Use Fisheye in SCM urls used in maven + * [EXOJCR-611] - Provide a way to collect statistics around the JCR AP= I accesses + * [EXOJCR-639] - Find the reason why the methods of type Property.setV= alue are much slower since beta5 + * [EXOJCR-685] - Change JBC dependencies to use 3.2.3.GA + * [EXOJCR-689] - Standartize eXo JCR docnmentation projects descriptio= n. + * [EXOJCR-690] - Apply changes in the eXo JCR project in order to be a= ble to publish artifacts in the nexus of JBoss + * [EXOJCR-545] - Checking performance on SearchNodesByPropertyTest + * [EXOJCR-643] - Improve the performances of the lucene indexing in a = cluster by removing contention for read operations + + +Changes of 1.12.1-CR1 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-256] - There are server errors "500 Internal Server Error:" = during creation repository or workspace by RestRepositoryService + * [EXOJCR-348] - Test problem: TestCleanableFileStreamValueData failed + * [EXOJCR-519] - DAILY TESTS are going too long (avg time=3D5hours) + * [EXOJCR-531] - Problems with Lock operations + * [EXOJCR-546] - TESTING: Performance testing problems. LockUnlockOwnN= odeTest - TPS fell down + * [EXOJCR-548] - problem with import & export node + * [EXOJCR-555] - NPE with cache eviction at startup + * [EXOJCR-557] - Problem while uploading *.pdf to WebDAV server using = Mac OS Finder + * [EXOJCR-558] - Files uploaded by Mac OS finder are displayed with si= ze "0" + * [EXOJCR-559] - Problems with daily performance testing - on PostgreS= QL 8.2.9 + * [EXOJCR-567] - The REST servlet dump errors when the client cut the = socket too early should be only a debug log + * [EXOJCR-572] - Can not create workspace with default configuration o= f lock manager + * [EXOJCR-581] - Listing the directory in TreeFile may return null dur= ing race condition, causing NPE. + * [EXOJCR-584] - User's research is case sensitive + * [EXOJCR-586] - Missed slf4j dependency for jcr applications on tomca= t AS + * [EXOJCR-587] - session.save() throws NPE after node reordering + * [EXOJCR-588] - Tests errors in eXo XML Processing Services on MACOS + * [EXOJCR-591] - Problem with ObservationManager + * [EXOJCR-599] - deadlock during dashboard editing + * [EXOJCR-600] - Concurrency problem (java.util.HashMap.put called fro= m CacheableLockManagerImpl.getSessionLockManager(CacheableLockManagerImpl.j= ava:473)) + * [EXOJCR-601] - gatein sample extension should not be required + * [EXOJCR-602] - StackOverflow on JsonGeneratorImpl + * [EXOJCR-603] - impossible to change user password + * [EXOJCR-607] - Sybase Issue with GateIn + * [EXOJCR-608] - XaSessionImpl as XA resource should be unique per use= r, workspace and repository + * [EXOJCR-614] - Node.getReferences fail in some cases + * [EXOJCR-615] - Need check nodedata to avoid exception in method Node= Impl.isNodeType(String). + * [EXOJCR-619] - Log record forging (Security Issue) + * [EXOJCR-621] - Conflict between symlink feature and Jbosscache + * [EXOJCR-623] - Unable to get a version of document using WebDAV (HTT= P Response 404 returned). + * [EXOJCR-633] - Problems with manual testing - tomcat-server on ftp -= .IndexOutOfBoundsException + +Feature Request + * [EXOJCR-549] - Backup and Restore of a whole Repository + * [EXOJCR-571] - Change PersitedValueDataReader/Writer + * [EXOJCR-573] - Create database and bind DataSource in runtime + * [EXOJCR-582] - DB script modification for oracle11 compatibility + * [EXOJCR-585] - Allow to get statistics on Database Access without us= ing a Profiler + * [EXOJCR-616] - Remove repository container from repositoryContainers= map when repository container start fail. + * [EXOJCR-617] - Map environment parameters for all String fields in R= epository configuration + +Task + * [EXOJCR-150] - Ftp client tests failute + * [EXOJCR-250] - Add human readable message in case Workspace creation= error via HTTPBackupAgent + * [EXOJCR-393] - Create indexer load test + * [EXOJCR-523] - Upgrade to JBoss Cache 3.2.3.GA + * [EXOJCR-550] - Bind slf4j-log4j and log4j dependencies onto the test= phase of the various modules of JCR + * [EXOJCR-552] - Allow to Test eXo JCR 1.12 on EC2 + * [EXOJCR-575] - Remove unused PairChangesLog class + * [EXOJCR-589] - Limit network traffic and thread blocking for the Luc= ene Indexer in a cluster + * [EXOJCR-590] - DO NOT exclude tests from a parent pom + * [EXOJCR-598] - Allow to disable the hints used for the Complex Queri= es on oracle + * [EXOJCR-605] - Normalize logging categories + * [EXOJCR-631] - Find a reason, why functional tests fails under Torna= do.MySQL with "Cannot create PoolableConnectionFactory (Too many connection= s)" message. + * [EXOJCR-632] - svn: File 'jcr.packaging.module/1.12.0-CP01/jcr.packa= ging.module-1.12.0-CP01.js' has inconsistent newlines + + +Features of eXoJCR 1.12 comparing to 1.11 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +- Repository clustering based on JBossCache and JBoss Transactions. = +- Lazy-load option for child nodes and properties read, improved items dat= aflow for read/write operations +- Alternative data container optimized for read operations (consuming less= database queries) +- Database dialect can be autodetected (if not pointed in the configuratio= n) +- Support for Values large of 2GiB +- Portal container configuration improvements (default definitions, link a= nd externaly loaded parameters) = +- Concurrency improvements for Session registry and Values stroage +- Concurrency improvements for XA transactions support (Repository login a= nd logout faster now) +- Improved serach based on Lucene 2.4 +- Support of MySQL/InnoDB database for multi-language content +- Standalone container can use configuration stored in JBossAS server conf= iguration directory by default = +- WebDAV server update-policy can be configured to different versioning be= haviour +- Lot of WebDAV server bugfixes +- HTTP (RESTful) Backup agent with concole client +- HTTP (RESTful) Repository management service +- Support of Java6 and Java5 runtime and development environment + +Since version of 1.12 eXoJCR available under LGPL license (version 2.1). + +eXoJCR 1.12 tested in on the databases: + MySQL 5.1 MYSQL Connector/J 5.1.8 + Oracle DB 10g (10.2.0.1) Oracle 10g (10.2.0.1) + PostgresSQL 8.3.7 JDBC4 Driver, Version 8.3-605 + DB2 9,7 IBM Data Server Driver for JDBC and SQLJ (JCC Driver) Version: 9= .1 (fixpack 3a) + MS SQL Server 2005 SP3 JDBC Driver 2.0 + MS SQL Server 2008 SP1 JDBC Driver 2.0 = + Sybase 15.0.2 JConnect v6.0.5 (Build 26564 / 11 Jun 2009) = + + +Release includes: +* eXo Kernel 2.2.5-GA +* eXo Core 2.3.5-GA +* eXo WS 2.1.5-GA +* eXo JCR 1.12.5-GA + +1.12.5-GA tasks: +* http://jira.exoplatform.org/browse/KER/fixforversion/12103 +* http://jira.exoplatform.org/browse/COR/fixforversion/12102 +* http://jira.exoplatform.org/browse/WS/fixforversion/12104 +* http://jira.exoplatform.org/browse/JCR/fixforversion/12052 + +JCR Samples +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +1. Start Up (Tomcat) + Tomcat 6 bundled can be started by executing the following commands: + + $CATALINA_HOME\bin\eXo.bat run (Windows) + + $CATALINA_HOME/bin/eXo.sh run (Unix) + +2. After startup, the sample applications will be available by visiting: + + http://localhost:8080/browser - Simple JCR browser + Browse the JCR repository that was started with Tomcat + http://localhost:8080/fckeditor - FCK editor sample + Edits the sample node using FCKEditor and browse it JCR browser + http://localhost:8080/rest/jcr/repository/production - WebDAV service, + Open in Microsoft Explorer, File-Open-OpenAsWebFolder with url htt= p://localhost:8080/rest/jcr/repository/production + Add/read/remove files there and browse it in the JCR browser or FT= P. + User name/password: root/exo + ftp://localhost:2121 - FTP server + Open the repository in FTP client and browse the JCR repository st= arted with Tomcat as FTP content, + add/read/remove files there and browse it in the JCR browser or We= bDAV. + +EAR deploy +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +eXo JCR was tested under JBoss-5.1.0.GA application server + +JBoss-5.1.0.GA + + 1. Configuration + + * Copy jcr.ear into $jboss_home/server/default/deploy + * Create $jboss_home/server/default/conf/exo-conf folder if it doesn't= exist. + * Put exo-configuration.xml into $jboss_home/server/default/conf/exo-c= onf/exo-configuration.xml + * Configure JAAS by inserting XML fragment shown below into $jboss_hom= e/server/default/conf/login-config.xml + +--------- + + + + + +--------- + + 2. Start Up + + Execute + * bin/run.bat on Windows + or + * bin/run.sh on Unix + +Resources +=3D=3D=3D=3D=3D=3D=3D=3D=3D + + Company site http://www.exoplatform.com + Documentation wiki http://wiki.exoplatform.org + Community JIRA https://jira.jboss.org/jira/browse/EXOJCR, http://ji= ra.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 --===============2859203001735417632==-- From do-not-reply at jboss.org Mon Oct 25 08:35:04 2010 Content-Type: multipart/mixed; boundary="===============5179920103043962659==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3343 - jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command. Date: Mon, 25 Oct 2010 08:35:03 -0400 Message-ID: <201010251235.o9PCZ316030275@svn01.web.mwc.hst.phx2.redhat.com> --===============5179920103043962659== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-25 08:35:03 -0400 (Mon, 25 Oct 2010) New Revision: 3343 Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/service= s/jcr/webdav/command/TestPropFind.java Log: EXOJCR-1012: added checking for PROPFIND 'propname' correct properties' nam= es output Modified: jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/= services/jcr/webdav/command/TestPropFind.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestPropFind.java 2010-10-25 06:31:29 UTC (rev 3342) +++ jcr/trunk/exo.jcr.component.webdav/src/test/java/org/exoplatform/servic= es/jcr/webdav/command/TestPropFind.java 2010-10-25 12:35:03 UTC (rev 3343) @@ -138,6 +138,8 @@ String find =3D outputStream.toString(); assertTrue(find.contains(authorProp)); assertTrue(find.contains("D:getlastmodified")); + assertFalse(find.contains("jcr:lockOwner")); + assertFalse(find.contains("D:lockdiscovery")); } = public void testAllProps() throws Exception @@ -214,11 +216,10 @@ ByteArrayOutputStream bas =3D new ByteArrayOutputStream(); ((PropFindResponseEntity)resp.getEntity()).write(bas); String find =3D new String(bas.toByteArray()); - assertTrue(!find.contains("jcr:lockOnwer")); - assertTrue(!find.contains("D:lockdiscovery")); + assertFalse(find.contains("jcr:lockOnwer")); + assertFalse(find.contains("D:lockdiscovery")); } = - = public void testPropWithPercent() throws Exception { String content =3D TestUtils.getFileContent(); --===============5179920103043962659==-- From do-not-reply at jboss.org Mon Oct 25 10:13:34 2010 Content-Type: multipart/mixed; boundary="===============2897204945785143180==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3344 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: proccess and 1 other directory. Date: Mon, 25 Oct 2010 10:13:33 -0400 Message-ID: <201010251413.o9PEDX0k014257@svn01.web.mwc.hst.phx2.redhat.com> --===============2897204945785143180== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-25 10:13:33 -0400 (Mon, 25 Oct 2010) New Revision: 3344 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/LockRemover.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/LockRemoverHolder.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/proccess/WorkerService.java Log: EXOJCR-999: WorkerThreadFactory updated Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockRemover.java 2010-10-25 12:35:03 UTC (rev 3343) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockRemover.java 2010-10-25 14:13:33 UTC (rev 3344) @@ -38,7 +38,7 @@ = private final long timeout; = - private ScheduledFuture lockRemoverTask =3D null; + private ScheduledFuture lockRemoverTask =3D null; = class LockRemoverTask implements Runnable { @@ -69,11 +69,10 @@ = public void start() { - if (lockRemoverTask !=3D null) + if (lockRemoverTask =3D=3D null) { - stop(); + lockRemoverTask =3D workerService.executePeriodically(new LockRem= overTask(lockManager), timeout); } - lockRemoverTask =3D workerService.executePeriodically(new LockRemove= rTask(lockManager), timeout); } = public void stop() @@ -81,5 +80,4 @@ lockRemoverTask.cancel(false); lockRemoverTask =3D null; } - } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockRemoverHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/LockRemoverHolder.java 2010-10-25 12:35:03 UTC (rev 334= 3) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockRemoverHolder.java 2010-10-25 14:13:33 UTC (rev 334= 4) @@ -36,7 +36,7 @@ threadCount =3D entry.getLockRemoverThreadsCount(); } } - workerService =3D new WorkerService(threadCount, "lock-remover"); + workerService =3D new WorkerService(threadCount, "lock-remover-" + e= ntry.getName()); } = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/proccess/WorkerService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/proccess/WorkerService.java 2010-10-25 12:35:03 UTC (rev 3343) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/proccess/WorkerService.java 2010-10-25 14:13:33 UTC (rev 3344) @@ -13,9 +13,9 @@ */ private final ScheduledThreadPoolExecutor executor; = - class WorkerThreadFactory implements ThreadFactory + static class WorkerThreadFactory implements ThreadFactory { - final AtomicInteger poolNumber =3D new AtomicInteger(1); + static final AtomicInteger poolNumber =3D new AtomicInteger(1); = final ThreadGroup group; = @@ -23,18 +23,25 @@ = final String namePrefix; = + final boolean isDaemon; + WorkerThreadFactory(String namePrefix) { + this(namePrefix, false); + } + + WorkerThreadFactory(String namePrefix, boolean isDaemon) + { + this.isDaemon =3D isDaemon; SecurityManager s =3D System.getSecurityManager(); group =3D (s !=3D null) ? s.getThreadGroup() : Thread.currentThre= ad().getThreadGroup(); - this.namePrefix =3D namePrefix + poolNumber.getAndIncrement() + "= -thread-"; + this.namePrefix =3D namePrefix + "-" + poolNumber.getAndIncrement= () + "-thread-"; } = public Thread newThread(Runnable r) { Thread t =3D new Thread(group, r, namePrefix + threadNumber.getAn= dIncrement(), 0); - if (t.isDaemon()) - t.setDaemon(false); + t.setDaemon(isDaemon); if (t.getPriority() !=3D Thread.NORM_PRIORITY) t.setPriority(Thread.NORM_PRIORITY); return t; @@ -63,13 +70,26 @@ } = /** + * Constructor. + * = + * @param threadCount - max thread count that executor may use + * @param threadNamePrefix - thread name prefix + * @param makeThreadsDaemon - does thread created by Service must be da= emon + */ + public WorkerService(int threadCount, String threadNamePrefix, boolean = makeThreadsDaemon) + { + executor =3D + new ScheduledThreadPoolExecutor(threadCount, new WorkerThreadFact= ory(threadNamePrefix, makeThreadsDaemon)); + } + + /** * Execute specified command periodically with delay= . * = * @param command - command that must be executed * @param delay - delay between each command execution = * @return */ - public ScheduledFuture executePeriodically(Runnable command, long delay) + public ScheduledFuture executePeriodically(Runnable command, long de= lay) { return executor.scheduleWithFixedDelay(command, 0, delay, TimeUnit.M= ILLISECONDS); } --===============2897204945785143180==-- From do-not-reply at jboss.org Tue Oct 26 04:40:45 2010 Content-Type: multipart/mixed; boundary="===============8737756478627719455==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3345 - jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav. Date: Tue, 26 Oct 2010 04:39:50 -0400 Message-ID: <201010260839.o9Q8dofK010807@svn01.web.mwc.hst.phx2.redhat.com> --===============8737756478627719455== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2010-10-26 04:39:49 -0400 (Tue, 26 Oct 2010) New Revision: 3345 Modified: jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/service= s/jcr/webdav/WebDavServiceImpl.java Log: EXOJCR-1010: created two more constructors for WebDavServiceImpl 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 2010-10-25 14:13:33 UTC (rev 3344) +++ jcr/trunk/exo.jcr.component.webdav/src/main/java/org/exoplatform/servic= es/jcr/webdav/WebDavServiceImpl.java 2010-10-26 08:39:49 UTC (rev 3345) @@ -75,6 +75,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; = import javax.jcr.NoSuchWorkspaceException; import javax.jcr.PathNotFoundException; @@ -286,6 +287,94 @@ } = /** + * Constructor. + * = + * @param params Initialization params + * @param repositoryService repository service + * @param sessionProviderService session provider service + */ + protected WebDavServiceImpl(Map params, RepositoryServi= ce repositoryService, + ThreadLocalSessionProviderService sessionProviderService) throws Exc= eption + { + this.sessionProviderService =3D sessionProviderService; + this.repositoryService =3D repositoryService; + this.nullResourceLocks =3D new NullResourceLocksHolder(); + + String paramValue =3D params.get(INIT_PARAM_DEF_FOLDER_NODE_TYPE); + if (paramValue !=3D null) + { + defaultFolderNodeType =3D paramValue; + log.info(INIT_PARAM_DEF_FOLDER_NODE_TYPE + " =3D " + defaultFolde= rNodeType); + } + + paramValue =3D params.get(INIT_PARAM_DEF_FILE_NODE_TYPE); + if (paramValue !=3D null) + { + defaultFileNodeType =3D paramValue; + log.info(INIT_PARAM_DEF_FILE_NODE_TYPE + " =3D " + defaultFileNod= eType); + } + + paramValue =3D params.get(INIT_PARAM_DEF_FILE_MIME_TYPE); + if (paramValue !=3D null) + { + defaultFileMimeType =3D paramValue; + log.info(INIT_PARAM_DEF_FILE_MIME_TYPE + " =3D " + defaultFileMim= eType); + } + + paramValue =3D params.get(INIT_PARAM_UPDATE_POLICY); + if (paramValue !=3D null) + { + updatePolicyType =3D paramValue; + log.info(INIT_PARAM_UPDATE_POLICY + " =3D " + updatePolicyType); + } + + paramValue =3D params.get(INIT_PARAM_AUTO_VERSION); + if (paramValue !=3D null) + { + autoVersionType =3D paramValue; + log.info(INIT_PARAM_AUTO_VERSION + " =3D " + autoVersionType); + } + + paramValue =3D params.get(INIT_PARAM_CACHE_CONTROL); + if (paramValue !=3D null) + { + try + { + String[] elements =3D paramValue.split(";"); + for (String element : elements) + { + String cacheValue =3D element.split(":")[1]; + String keys =3D element.split(":")[0]; + for (String key : keys.split(",")) + { + MediaType mediaType =3D new MediaType(key.split("/")[0],= key.split("/")[1]); + cacheControlMap.put(mediaType, cacheValue); + } + } + } + catch (Exception e) + { + log.warn("Invalid " + INIT_PARAM_CACHE_CONTROL + " parameter"); + } + + } + } + + /** + * Constructor. + * = + * @param repositoryService repository service + * @param sessionProviderService session provider service + */ + protected WebDavServiceImpl(RepositoryService repositoryService, + ThreadLocalSessionProviderService sessionProviderService) + { + this.sessionProviderService =3D sessionProviderService; + this.repositoryService =3D repositoryService; + this.nullResourceLocks =3D new NullResourceLocksHolder(); + } + = + /** * {@inheritDoc} */ @CHECKIN --===============8737756478627719455==-- From do-not-reply at jboss.org Tue Oct 26 08:14:03 2010 Content-Type: multipart/mixed; boundary="===============6333559150116142726==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3346 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/proccess and 6 other directories. Date: Tue, 26 Oct 2010 08:14:02 -0400 Message-ID: <201010261214.o9QCE2Av012024@svn01.web.mwc.hst.phx2.redhat.com> --===============6333559150116142726== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-26 08:14:01 -0400 (Tue, 26 Oct 2010) New Revision: 3346 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/config/RepositoryInfo.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/proccess/WorkerService.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/FileCleaner.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/FileCleanerHolder.java jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/storage/JDBCWDCTest.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/storage/value/fs/TestFileIOChannel.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestPersistedValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestTransientValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestValueImpl.java Log: EXOJCR-999: FileCleaner based on WorkerService implemented Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/config/RepositoryInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/config/RepositoryInfo.java 2010-10-26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/config/RepositoryInfo.java 2010-10-26 12:14:01 UTC (rev 3346) @@ -48,6 +48,8 @@ = protected int lockRemoverMaxThreadCount; = + protected int fileCleanerMaxThreadsCount; + public RepositoryInfo() { = @@ -201,6 +203,15 @@ } = /** + * Returns FileCleaner per-repository max threads count. + * @return LockRemovers per-repository max threads count + */ + public int getFileCleanerThreadsCount() + { + return fileCleanerMaxThreadsCount; + } + + /** * Sets LockRemovers per-repository max threads count. * @param lockRemoverMaxThreadCount */ @@ -210,6 +221,15 @@ } = /** + * Sets FileCleaner per-repository max threads count. + * @param fileCleanerMaxThreadsCount + */ + public void setFileCleanerThreadsCount(int fileCleanerMaxThreadsCount) + { + this.fileCleanerMaxThreadsCount =3D fileCleanerMaxThreadsCount; + } + + /** * Merges the current {@link RepositoryInfo} with the given one. The cu= rrent {@link RepositoryInfo} * has the highest priority thus only absent data will be overrode * @param entry the entry to merge with the current {@link RepositoryIn= fo} @@ -230,5 +250,7 @@ setSessionTimeOut(entry.sessionTimeOut); if (lockRemoverMaxThreadCount =3D=3D 0) setLockRemoverThreadsCount(entry.lockRemoverMaxThreadCount); + if (fileCleanerMaxThreadsCount =3D=3D 0) + setFileCleanerThreadsCount(entry.fileCleanerMaxThreadsCount); } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/proccess/WorkerService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/proccess/WorkerService.java 2010-10-26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/proccess/WorkerService.java 2010-10-26 12:14:01 UTC (rev 3346) @@ -95,10 +95,22 @@ } = /** - * Initiates an orderly shutdown in which previously submitted tasks ar= e executed, but no new tasks will be accepted. = + * Initiates an orderly shutdown in which previously submitted tasks ar= e executed, but no new tasks = + * will be accepted. = */ public void stop() { executor.shutdown(); } + + /** + * Creates and executes a one-shot action that becomes enabled after th= e given delay. + * = + * @param command + * @param delay + */ + public void executeDelay(Runnable command, long delay) + { + executor.schedule(command, delay, TimeUnit.MILLISECONDS); + } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/FileCleaner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/FileCleaner.java 2010-10-26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/FileCleaner.java 2010-10-26 12:14:01 UTC (rev 3346) @@ -18,16 +18,11 @@ */ package org.exoplatform.services.jcr.impl.util.io; = -import org.exoplatform.services.jcr.impl.proccess.WorkerThread; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = import java.io.File; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.ConcurrentLinkedQueue; = /** * Created by The eXo Platform SAS. @@ -35,104 +30,43 @@ * @author Gennady Azarenkov * @version $Id: FileCleaner.java 11907 2008-03-13 15:36:21Z ksm $ */ - -public class FileCleaner extends WorkerThread +public class FileCleaner { = protected static final long DEFAULT_TIMEOUT =3D 30000; = protected static Log log =3D ExoLogger.getLogger("exo.jcr.component.cor= e.FileCleaner"); = - protected final ConcurrentLinkedQueue files =3D new ConcurrentLin= kedQueue(); - - public FileCleaner() - { - this(DEFAULT_TIMEOUT); - } - - public FileCleaner(long timeout) - { - this(timeout, true); - } - - public FileCleaner(boolean start) - { - this(DEFAULT_TIMEOUT, start); - } - - public FileCleaner(long timeout, boolean start) - { - super(timeout); - setName("FileCleaner " + getId()); - setDaemon(true); - setPriority(Thread.MIN_PRIORITY); - - if (start) - start(); - - PrivilegedAction action =3D new PrivilegedAction() - { - public Object run() - { - registerShutdownHook(); - return null; - } - }; - AccessController.doPrivileged(action); - - if (log.isDebugEnabled()) - { - log.debug("FileCleaner instantiated name=3D " + getName() + " tim= eout=3D " + timeout); - } - } - /** - * @param file + * FileCleanerTask is a task that might be executed with WorkerService.= This task = + * tries to remove single file. If remove is failed it register itself = to execute again. = */ - public void addFile(File file) + class FileCleanerTask implements Runnable { - if (PrivilegedFileHelper.exists(file)) - { - files.offer(file); - } - } + protected final File file; = - @Override - public void halt() - { - try + private final WorkerService executor; + + FileCleanerTask(WorkerService workerService, File file) { - callPeriodically(); + this.file =3D file; + this.executor =3D workerService; } - catch (Exception e) - { - } = - if (files !=3D null && files.size() > 0) - log.warn("There are uncleared files: " + files.size()); - - super.halt(); - } - - /** - * @see org.exoplatform.services.jcr.impl.proccess.WorkerThread#callPer= iodically() - */ - @Override - protected void callPeriodically() throws Exception - { - File file =3D null; - Set notRemovedFiles =3D new HashSet(); - while ((file =3D files.poll()) !=3D null) + /** + * {@inheritDoc} = + */ + public void run() { if (PrivilegedFileHelper.exists(file)) { if (!PrivilegedFileHelper.delete(file)) { - notRemovedFiles.add(file); - if (log.isDebugEnabled()) log.debug("Could not delete " + (file.isDirectory() ? "d= irectory" : "file") + ". Will try next time: " + PrivilegedFileHelper.get= AbsolutePath(file)); + // delete is failed, so execute this task again = + executor.executeDelay(this, timeout); } else if (log.isDebugEnabled()) { @@ -141,37 +75,44 @@ } } } + } = - //add do lists tail all not removed files - if (!notRemovedFiles.isEmpty()) - { - files.addAll(notRemovedFiles); - } + final long timeout; + + final WorkerService workerService; + + /** + * TODO this constructor used only in ext project. Clean it. + * = + * @param timeout + */ + public FileCleaner(long timeout) + { + this(new WorkerService(1), DEFAULT_TIMEOUT); } = - private void registerShutdownHook() + public FileCleaner(WorkerService workerService) { - // register shutdown hook for final cleaning up - try + this(workerService, DEFAULT_TIMEOUT); + } + + public FileCleaner(WorkerService workerService, long timeout) + { + this.timeout =3D timeout; + this.workerService =3D workerService; + } + + /** + * Add file to special removing queue. = + * = + * @param file - file that must be removed + */ + public void addFile(File file) + { + if (PrivilegedFileHelper.exists(file)) { - Runtime.getRuntime().addShutdownHook(new Thread() - { - @Override - public void run() - { - File file =3D null; - while ((file =3D files.poll()) !=3D null) - { - PrivilegedFileHelper.delete(file); - } - } - }); + workerService.executePeriodically(new FileCleanerTask(workerServi= ce, file), timeout); } - catch (IllegalStateException e) - { - // can't register shutdownhook because - // jvm shutdown sequence has already begun, - // silently ignore... - } } + } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/FileCleanerHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/FileCleanerHolder.java 2010-10-26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/FileCleanerHolder.java 2010-10-26 12:14:01 UTC (rev 3346) @@ -18,26 +18,67 @@ */ package org.exoplatform.services.jcr.impl.util.io; = +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; + /** * Created by The eXo Platform SAS.
    per workspace container file cle= aner holder object * = * @author Gennady Azarenkov * @version $Id: WorkspaceFileCleanerHolder.java 11907 2008-03-13 15:36:21= Z ksm $ */ - public class FileCleanerHolder { + /** + * Default amount of thread that may be used by WorkerService to serve = LockRemovers. + */ + public final int DEFAULT_THREAD_COUNT =3D 1; = - private final FileCleaner fileCleaner; + /** + * WorkerService that executed LockRemover. + */ + private final WorkerService workerService; = - public FileCleanerHolder() + /** + * Constructor. Used in tests. + * = + * @param threadCount - how mane threads can serve FileCleaner tasks + */ + public FileCleanerHolder(int threadCount) { - this.fileCleaner =3D new FileCleaner(); + workerService =3D new WorkerService(threadCount, "file-cleaner-"); } = + /** + * Constructor. + * @param entry - RepositoryEntry that may contain lock-remover-max-thr= eads parameter. + */ + public FileCleanerHolder(RepositoryEntry entry) + { + int threadCount =3D DEFAULT_THREAD_COUNT; + if (entry !=3D null) + { + if (entry.getLockRemoverThreadsCount() > 0) + { + threadCount =3D entry.getLockRemoverThreadsCount(); + } + } + workerService =3D new WorkerService(threadCount, "file-cleaner-" + e= ntry.getName()); + } + public FileCleaner getFileCleaner() { - return fileCleaner; + return new FileCleaner(workerService); } = + public FileCleaner getFileCleaner(long timeout) + { + return new FileCleaner(workerService, timeout); + } + + public void stop() + { + this.workerService.stop(); + } + } Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resources/binding.xml 2010-10= -26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml 2010-10= -26 12:14:01 UTC (rev 3346) @@ -19,6 +19,9 @@ deserializer=3D"org.exoplatform.services.jcr.util.ConfigurationFormat.= parseTime" usage=3D"optional" /> + + = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/dataflow/persistent/TestCleanableFileStreamValueData.java 2010-10= -26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java 2010-10= -26 12:14:01 UTC (rev 3346) @@ -20,6 +20,7 @@ = import org.exoplatform.services.jcr.JcrImplBaseTest; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.impl.util.io.SwapFile; = @@ -49,6 +50,7 @@ = private File testFile =3D new File(parentDir, FILE_NAME); = + private WorkerService workerService; private FileCleaner testCleaner; = private CleanableFilePersistedValueData cleanableValueData; @@ -82,9 +84,9 @@ public void setUp() throws Exception { super.setUp(); + WorkerService workerService =3D new WorkerService(1); + testCleaner =3D new FileCleaner(workerService, CLEANER_TIMEOUT); = - testCleaner =3D new FileCleaner(CLEANER_TIMEOUT); - SwapFile sf =3D SwapFile.get(parentDir, FILE_NAME); FileOutputStream fout =3D new FileOutputStream(sf); fout.write("testFileCleaned".getBytes()); @@ -99,9 +101,9 @@ { cleanableValueData =3D null; = - testCleaner.halt(); testCleaner =3D null; - + workerService.stop(); + = if (testFile.exists()) { testFile.delete(); Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWDCTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/JDBCWDCTest.java 2010-10-26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/JDBCWDCTest.java 2010-10-26 12:14:01 UTC (rev 3346) @@ -104,7 +104,7 @@ // ref.add(new StringRefAddr("database", "jdbc:hsqldb:file:data/test= ")); = // SimpleJNDIContextInitializer.initialize(sourceName, ref); - FileCleanerHolder holder =3D new FileCleanerHolder(); + FileCleanerHolder holder =3D new FileCleanerHolder(1); = container =3D new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config, Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/TestFileIOChannel.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/value/fs/TestFileIOChannel.java 2010-10-26 08:39:49 UTC (= rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/value/fs/TestFileIOChannel.java 2010-10-26 12:14:01 UTC (= rev 3346) @@ -22,6 +22,7 @@ = import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.dataflow.TesterTransientValueData; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; = @@ -43,6 +44,8 @@ = private File rootDir; = + WorkerService workerService; + private FileCleaner cleaner; = private ValueDataResourceHolder resources =3D new ValueDataResourceHold= er(); @@ -56,9 +59,9 @@ protected void setUp() throws Exception { super.setUp(); + workerService =3D new WorkerService(1, "TestFileIOChannel-file-clean= er"); + cleaner =3D new FileCleaner(workerService, 2000); = - cleaner =3D new FileCleaner(2000); - rootDir =3D new File(new File("target"), "vs1"); rootDir.mkdirs(); = @@ -75,7 +78,7 @@ @Override protected void tearDown() throws Exception { - cleaner.halt(); + cleaner =3D null; } = public void testRead() throws Exception Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestPersistedValueData.java 2010-10-26 08:39:49 UTC (rev 33= 45) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestPersistedValueData.java 2010-10-26 12:14:01 UTC (rev 33= 46) @@ -23,6 +23,7 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPers= istedValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.CleanableFile= PersistedValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.FilePersisted= ValueData; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.storage.value.fs.Probe; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.impl.util.io.SwapFile; @@ -81,7 +82,8 @@ = public void testIfFinalizeRemovesTempFileStreamValueData() throws Excep= tion { - FileCleaner testFileCleaner =3D new FileCleaner(1000, true); + WorkerService workerService =3D new WorkerService(1, "TestPersistedV= alueData-file-cleaner"); + FileCleaner testFileCleaner =3D new FileCleaner(workerService, 1000); try { byte[] buf =3D "0123456789".getBytes(); @@ -107,7 +109,7 @@ } finally { - testFileCleaner.halt(); + testFileCleaner =3D null; } } = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestTransientValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestTransientValueData.java 2010-10-26 08:39:49 UTC (rev 33= 45) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestTransientValueData.java 2010-10-26 12:14:01 UTC (rev 33= 46) @@ -24,6 +24,7 @@ import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.util.JCRDateFormat; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; = @@ -66,7 +67,8 @@ = public void testCreateFileStreamTransientValueData() throws Exception { - FileCleaner testFileCleaner =3D new FileCleaner(); + WorkerService workerService =3D new WorkerService(1, "TestTransientV= alueData-file-cleaner"); + FileCleaner testFileCleaner =3D new FileCleaner(workerService); try { byte[] buf =3D "0123456789".getBytes(); @@ -104,7 +106,7 @@ } finally { - testFileCleaner.halt(); + testFileCleaner =3D null; } = } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestValueImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestValueImpl.java 2010-10-26 08:39:49 UTC (rev 3345) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestValueImpl.java 2010-10-26 12:14:01 UTC (rev 3346) @@ -27,6 +27,7 @@ import org.exoplatform.services.jcr.impl.core.value.LongValue; import org.exoplatform.services.jcr.impl.core.value.StringValue; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; +import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; = import java.io.File; @@ -50,7 +51,8 @@ = public void testNewBinaryValue() throws Exception { - FileCleaner testFileCleaner =3D new FileCleaner(); + WorkerService workerService =3D new WorkerService(1, "TestValueImpl-= file-cleaner"); + FileCleaner testFileCleaner =3D new FileCleaner(workerService); = try { @@ -93,7 +95,7 @@ } finally { - testFileCleaner.halt(); + testFileCleaner =3D null; } } = --===============6333559150116142726==-- From do-not-reply at jboss.org Tue Oct 26 09:38:12 2010 Content-Type: multipart/mixed; boundary="===============5062447191747653753==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3347 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io. Date: Tue, 26 Oct 2010 09:38:12 -0400 Message-ID: <201010261338.o9QDcCJq021342@svn01.web.mwc.hst.phx2.redhat.com> --===============5062447191747653753== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-26 09:38:12 -0400 (Tue, 26 Oct 2010) New Revision: 3347 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/FileCleaner.java Log: EXOJCR-999: FileCleaner fixed Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/FileCleaner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/FileCleaner.java 2010-10-26 12:14:01 UTC (rev 3346) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/FileCleaner.java 2010-10-26 13:38:12 UTC (rev 3347) @@ -111,7 +111,7 @@ { if (PrivilegedFileHelper.exists(file)) { - workerService.executePeriodically(new FileCleanerTask(workerServi= ce, file), timeout); + workerService.executeDelay(new FileCleanerTask(workerService, fil= e), timeout); } } = --===============5062447191747653753==-- From do-not-reply at jboss.org Tue Oct 26 11:08:23 2010 Content-Type: multipart/mixed; boundary="===============8930566040487864576==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3348 - in jcr/trunk/exo.jcr.component.ext/src: test/java/org/exoplatform/services/jcr/ext/script/groovy and 1 other directory. Date: Tue, 26 Oct 2010 11:08:23 -0400 Message-ID: <201010261508.o9QF8NV9005038@svn01.web.mwc.hst.phx2.redhat.com> --===============8930566040487864576== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aparfonov Date: 2010-10-26 11:08:22 -0400 (Tue, 26 Oct 2010) New Revision: 3348 Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/script/groovy/JcrGroovyCompiler.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/script/groovy/JcrGroovyResourceLoader.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/script/groovy/GroovyCompilerTest.java Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/script/groovy/GroovyScript2RestLoader.java Log: EXOJCR-1020 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/script/groovy/GroovyScript2RestLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/script/groovy/GroovyScript2RestLoader.java 2010-10-26 13:38:12 UTC = (rev 3347) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/script/groovy/GroovyScript2RestLoader.java 2010-10-26 15:08:22 UTC = (rev 3348) @@ -32,10 +32,8 @@ import org.exoplatform.services.jcr.ext.common.SessionProvider; import org.exoplatform.services.jcr.ext.registry.RegistryEntry; import org.exoplatform.services.jcr.ext.registry.RegistryService; -import org.exoplatform.services.jcr.ext.resource.JcrURLConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; -import org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoade= r; import org.exoplatform.services.rest.ext.groovy.GroovyJaxrsPublisher; import org.exoplatform.services.rest.ext.groovy.ResourceId; import org.exoplatform.services.rest.impl.ResourceBinder; @@ -53,7 +51,6 @@ import java.net.MalformedURLException; import java.net.URI; import java.net.URL; -import java.net.URLConnection; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -98,7 +95,7 @@ { = /** Logger. */ - private static final Log LOG =3D ExoLogger.getLogger("exo.jcr.component= .ext.GroovyScript2RestLoader"); + static final Log LOG =3D ExoLogger.getLogger("exo.jcr.component.ext.Gro= ovyScript2RestLoader"); = /** Default node types for Groovy scripts. */ private static final String DEFAULT_NODETYPE =3D "exo:groovyResourceCon= tainer"; @@ -1275,7 +1272,6 @@ public Response list(@PathParam("repository") String repository, @PathP= aram("workspace") String workspace, @QueryParam("name") String name) { - Session ses =3D null; try { @@ -1335,7 +1331,6 @@ Collections.sort(scriptList); return Response.status(Response.Status.OK).entity(new ScriptList(= scriptList)).type(MediaType.APPLICATION_JSON) .build(); - } catch (Exception e) { @@ -1377,131 +1372,21 @@ } = /** - * JCR groovy resource resolver. - */ - protected class JcrGroovyResourceLoader extends DefaultGroovyResourceLo= ader - { - - public JcrGroovyResourceLoader(URL[] roots) throws MalformedURLExcep= tion - { - super(normalizeJcrURL(roots)); - } - - @Override - protected URL getResource(String filename) throws MalformedURLExcept= ion - { - filename =3D filename.intern(); - URL resource =3D null; - synchronized (filename) - { - resource =3D resources.get(filename); - boolean inCache =3D resource !=3D null; - for (URL root : roots) - { - if (resource =3D=3D null) - { - if ("jcr".equals(root.getProtocol())) - { - // In JCR URL path represented by fragment - // jcr://repository/workspace#/path - String ref =3D root.getRef(); - resource =3D new URL(root, "#" + ref + filename); - } - else - { - resource =3D new URL(root, filename); - } - } - URLConnection connection =3D null; - try - { - if (LOG.isDebugEnabled()) - LOG.debug("Try to load resource from URL : " + resour= ce); - - connection =3D resource.openConnection(); - connection.getInputStream().close(); - - break; - } - catch (IOException e) - { - if (LOG.isDebugEnabled()) - LOG.debug("Can't open URL : " + resource); - - resource =3D null; - } - finally - { - if (connection !=3D null && resource !=3D null && "jcr".= equals(resource.getProtocol())) - { - ((JcrURLConnection)connection).disconnect(); - } - } - } - if (resource !=3D null) - { - resources.put(filename, resource); - } - else if (inCache) - { - // Remove from map if resource is unreachable - resources.remove(filename); - } - } - return resource; - } - } - - private static URL[] normalizeJcrURL(URL[] src) throws MalformedURLExce= ption - { - URL[] res =3D new URL[src.length]; - for (int i =3D 0; i < src.length; i++) - { - if ("jcr".equals(src[i].getProtocol())) - { - String ref =3D src[i].getRef(); - if (ref =3D=3D null) - { - ref =3D "/"; - } - else if (ref.charAt(ref.length() - 1) !=3D '/') - { - ref =3D ref + "/"; - } - res[i] =3D new URL(src[i], "#" + ref); - } - else - { - res[i] =3D src[i]; - } - } - return res; - } - - /** * Script meta-data, used for pass script meta-data as JSON. */ public static class ScriptMetadata { = - /** - * Is script autoload. - */ + /** Is script autoload. */ private final boolean autoload; = - /** - * Is script loaded. - */ + /** Is script loaded. */ private final boolean load; = - /** - * Script media type (script/groovy). - */ + /** Script media type (script/groovy). */ private final String mediaType; = - /** - * Last modified date. - */ + /** Last modified date. */ private final long lastModified; = public ScriptMetadata(boolean autoload, boolean load, String mediaTy= pe, long lastModified) @@ -1551,9 +1436,7 @@ public static class ScriptList { = - /** - * The list of scripts. - */ + /** The list of scripts. */ private List list; = /** Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/servic= es/jcr/ext/script/groovy/JcrGroovyCompiler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/script/groovy/JcrGroovyCompiler.java (rev 0) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/script/groovy/JcrGroovyCompiler.java 2010-10-26 15:08:22 UTC (rev 3= 348) @@ -0,0 +1,111 @@ +/** + * Copyright (C) 2010 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.ext.script.groovy; + +import groovy.lang.GroovyClassLoader; +import groovy.lang.GroovyCodeSource; + +import org.exoplatform.services.jcr.ext.resource.JcrURLConnection; +import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; + +/** + * JcrGroovyCompiler can load source code of groovy script from JCR and pa= rse it + * via GroovyClassLoader. + * + * @author Andrey Parfonov + * @version $Id$ + */ +public class JcrGroovyCompiler +{ + protected GroovyClassLoader gcl; + + public JcrGroovyCompiler() + { + ClassLoader cl =3D getClass().getClassLoader(); + this.gcl =3D new GroovyClassLoader(cl); + } + + /** + * @return get underling groovy class loader + */ + public GroovyClassLoader getGroovyClassLoader() + { + return gcl; + } + + /** + * Set groovy class loader. + * + * @param gcl groovy class loader + * @throws NullPointerException if gcl =3D=3D null + */ + public void setGroovyClassLoader(GroovyClassLoader gcl) + { + if (gcl =3D=3D null) + throw new NullPointerException("GroovyClassLoader may not be null= ."); + this.gcl =3D gcl; + } + + public Class[] compile(UnifiedNodeReference... sourceReferences) thr= ows IOException + { + GroovyClassLoader cl =3D gcl; + Class[] classes =3D new Class[sourceReferences.length]; + for (int i =3D 0; i < sourceReferences.length; i++) + { + JcrURLConnection conn =3D null; + try + { + URL url =3D sourceReferences[i].getURL(); + conn =3D (JcrURLConnection)url.openConnection(); + Class clazz =3D cl.parseClass(createCodeSource(conn.getInpu= tStream(), url.toString())); + classes[i] =3D clazz; + } + finally + { + if (conn !=3D null) + { + conn.disconnect(); + } + } + } + return classes; + } + + /** + * Create {@link GroovyCodeSource} from given stream and name. Code base + * 'file:/groovy/script' (default code base used for all Groovy classes= ) will + * be used. + * + * @param in groovy source code stream + * @param name code source name + * @return GroovyCodeSource + */ + // Override this method if need other behavior. + protected GroovyCodeSource createCodeSource(InputStream in, String name) + { + GroovyCodeSource gcs =3D new GroovyCodeSource(in, name, "/groovy/scr= ipt"); + gcs.setCachable(false); + return gcs; + } +} Property changes on: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exop= latform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/servic= es/jcr/ext/script/groovy/JcrGroovyResourceLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/script/groovy/JcrGroovyResourceLoader.java = (rev 0) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/script/groovy/JcrGroovyResourceLoader.java 2010-10-26 15:08:22 UTC = (rev 3348) @@ -0,0 +1,129 @@ +/* + * 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.ext.script.groovy; + +import org.exoplatform.services.jcr.ext.resource.JcrURLConnection; +import org.exoplatform.services.rest.ext.groovy.DefaultGroovyResourceLoade= r; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +/** + * JCR groovy resource resolver. + */ +public class JcrGroovyResourceLoader extends DefaultGroovyResourceLoader +{ + + private static URL[] normalizeJcrURL(URL[] src) throws MalformedURLExce= ption + { + URL[] res =3D new URL[src.length]; + for (int i =3D 0; i < src.length; i++) + { + if ("jcr".equals(src[i].getProtocol())) + { + String ref =3D src[i].getRef(); + if (ref =3D=3D null) + { + ref =3D "/"; + } + else if (ref.charAt(ref.length() - 1) !=3D '/') + { + ref =3D ref + "/"; + } + res[i] =3D new URL(src[i], "#" + ref); + } + else + { + res[i] =3D src[i]; + } + } + return res; + } + + public JcrGroovyResourceLoader(URL[] roots) throws MalformedURLException + { + super(normalizeJcrURL(roots)); + } + + @Override + protected URL getResource(String filename) throws MalformedURLException + { + filename =3D filename.intern(); + URL resource =3D null; + synchronized (filename) + { + resource =3D resources.get(filename); + boolean inCache =3D resource !=3D null; + for (URL root : roots) + { + if (resource =3D=3D null) + { + if ("jcr".equals(root.getProtocol())) + { + // In JCR URL path represented by fragment + // jcr://repository/workspace#/path + String ref =3D root.getRef(); + resource =3D new URL(root, "#" + ref + filename); + } + else + { + resource =3D new URL(root, filename); + } + } + URLConnection connection =3D null; + try + { + if (GroovyScript2RestLoader.LOG.isDebugEnabled()) + GroovyScript2RestLoader.LOG.debug("Try to load resource = from URL : " + resource); + + connection =3D resource.openConnection(); + connection.getInputStream().close(); + + break; + } + catch (IOException e) + { + if (GroovyScript2RestLoader.LOG.isDebugEnabled()) + GroovyScript2RestLoader.LOG.debug("Can't open URL : " + = resource); + + resource =3D null; + } + finally + { + if (connection !=3D null && resource !=3D null && "jcr".equ= als(resource.getProtocol())) + { + ((JcrURLConnection)connection).disconnect(); + } + } + } + if (resource !=3D null) + { + resources.put(filename, resource); + } + else if (inCache) + { + // Remove from map if resource is unreachable + resources.remove(filename); + } + } + return resource; + } +} \ No newline at end of file Property changes on: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exop= latform/services/jcr/ext/script/groovy/JcrGroovyResourceLoader.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/servic= es/jcr/ext/script/groovy/GroovyCompilerTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/script/groovy/GroovyCompilerTest.java (rev = 0) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/script/groovy/GroovyCompilerTest.java 2010-10-26 15:08:22 UTC (rev = 3348) @@ -0,0 +1,76 @@ +/** + * Copyright (C) 2010 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.ext.script.groovy; + +import groovy.lang.GroovyObject; + +import org.exoplatform.services.jcr.ext.BaseStandaloneTest; +import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference; + +import java.util.Calendar; + +import javax.jcr.Node; + +/** + * @author Andrey Parfonov + * @version $Id$ + */ +public class GroovyCompilerTest extends BaseStandaloneTest +{ + + public void setUp() throws Exception + { + super.setUp(); + Node groovyRepo =3D root.addNode("groovyRepo", "nt:folder"); + Node org =3D groovyRepo.addNode("org", "nt:folder"); + Node exo =3D org.addNode("exoplatform", "nt:folder"); + Node a =3D exo.addNode("A.groovy", "nt:file"); + a =3D a.addNode("jcr:content", "nt:resource"); + a.setProperty("jcr:mimeType", "script/groovy"); + a.setProperty("jcr:lastModified", Calendar.getInstance()); + a.setProperty("jcr:data", // + "package org.exoplatform\n" + // + " class A { String message =3D 'groovy compiler test' }"); + + Node test =3D exo.addNode("test", "nt:folder"); + Node b =3D test.addNode("B.groovy", "nt:file"); + b =3D b.addNode("jcr:content", "nt:resource"); + b.setProperty("jcr:mimeType", "script/groovy"); + b.setProperty("jcr:lastModified", Calendar.getInstance()); + b.setProperty("jcr:data", // + "package org.exoplatform.test\n" + // + " import org.exoplatform.A\n" + // + " class B extends A {}"); + session.save(); + } + + public void testGroovyDependency() throws Exception + { + JcrGroovyCompiler compiler =3D new JcrGroovyCompiler(); + compiler.getGroovyClassLoader().setResourceLoader( + new JcrGroovyResourceLoader(new java.net.URL[]{new java.net.URL("= jcr://db1/ws#/groovyRepo")})); + Class[] classes =3D + compiler.compile(new UnifiedNodeReference("db1", "ws", "/groovyRe= po/org/exoplatform/test/B.groovy")); + assertEquals(1, classes.length); + GroovyObject go =3D (GroovyObject)classes[0].newInstance(); + assertEquals("groovy compiler test", go.invokeMethod("getMessage", n= ew Object[0])); + } + +} Property changes on: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exop= latform/services/jcr/ext/script/groovy/GroovyCompilerTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native --===============8930566040487864576==-- From do-not-reply at jboss.org Tue Oct 26 11:33:04 2010 Content-Type: multipart/mixed; boundary="===============7769746469271125689==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3349 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/lock and 7 other directories. Date: Tue, 26 Oct 2010 11:33:04 -0400 Message-ID: <201010261533.o9QFX4gQ006366@svn01.web.mwc.hst.phx2.redhat.com> --===============7769746469271125689== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-26 11:33:02 -0400 (Tue, 26 Oct 2010) New Revision: 3349 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/config/RepositoryInfo.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/LockRemoverHolder.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/proccess/WorkerService.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/FileCleaner.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/FileCleanerHolder.java jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/storage/JDBCWDCTest.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/storage/value/fs/TestFileIOChannel.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestPersistedValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestTransientValueData.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/value/TestValueImpl.java Log: EXOJCR-999: FileCleaner reverted to rev.3344 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/config/RepositoryInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/config/RepositoryInfo.java 2010-10-26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/config/RepositoryInfo.java 2010-10-26 15:33:02 UTC (rev 3349) @@ -48,8 +48,6 @@ = protected int lockRemoverMaxThreadCount; = - protected int fileCleanerMaxThreadsCount; - public RepositoryInfo() { = @@ -203,15 +201,6 @@ } = /** - * Returns FileCleaner per-repository max threads count. - * @return LockRemovers per-repository max threads count - */ - public int getFileCleanerThreadsCount() - { - return fileCleanerMaxThreadsCount; - } - - /** * Sets LockRemovers per-repository max threads count. * @param lockRemoverMaxThreadCount */ @@ -221,15 +210,6 @@ } = /** - * Sets FileCleaner per-repository max threads count. - * @param fileCleanerMaxThreadsCount - */ - public void setFileCleanerThreadsCount(int fileCleanerMaxThreadsCount) - { - this.fileCleanerMaxThreadsCount =3D fileCleanerMaxThreadsCount; - } - - /** * Merges the current {@link RepositoryInfo} with the given one. The cu= rrent {@link RepositoryInfo} * has the highest priority thus only absent data will be overrode * @param entry the entry to merge with the current {@link RepositoryIn= fo} @@ -250,7 +230,5 @@ setSessionTimeOut(entry.sessionTimeOut); if (lockRemoverMaxThreadCount =3D=3D 0) setLockRemoverThreadsCount(entry.lockRemoverMaxThreadCount); - if (fileCleanerMaxThreadsCount =3D=3D 0) - setFileCleanerThreadsCount(entry.fileCleanerMaxThreadsCount); } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/LockRemoverHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/LockRemoverHolder.java 2010-10-26 15:08:22 UTC (rev 334= 8) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/LockRemoverHolder.java 2010-10-26 15:33:02 UTC (rev 334= 9) @@ -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.core.lock; = import org.exoplatform.services.jcr.config.RepositoryEntry; @@ -5,13 +23,12 @@ = /** * LockRemoverHolder holds is a single per-repository LockRemover containe= r. - * @author Foo Bar + * = + * @author Karpenko Sergiy<= /a> * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ah= eritier $ - * */ public class LockRemoverHolder { - /** * Default amount of thread that may be used by WorkerService to serve = LockRemovers. */ Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/proccess/WorkerService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/proccess/WorkerService.java 2010-10-26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/proccess/WorkerService.java 2010-10-26 15:33:02 UTC (rev 3349) @@ -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.proccess; = import java.util.concurrent.ScheduledFuture; @@ -6,6 +24,12 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; = +/** + * WorkerService. + * = + * @author Karpenko Sergiy<= /a> + * @version $Id: WorkerService.java 34361 2010-08-24 23:58:59Z aheritier $ + */ public class WorkerService { /** @@ -95,22 +119,10 @@ } = /** - * Initiates an orderly shutdown in which previously submitted tasks ar= e executed, but no new tasks = - * will be accepted. = + * Initiates an orderly shutdown in which previously submitted tasks ar= e executed, but no new tasks will be accepted. = */ public void stop() { executor.shutdown(); } - - /** - * Creates and executes a one-shot action that becomes enabled after th= e given delay. - * = - * @param command - * @param delay - */ - public void executeDelay(Runnable command, long delay) - { - executor.schedule(command, delay, TimeUnit.MILLISECONDS); - } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/FileCleaner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/FileCleaner.java 2010-10-26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/FileCleaner.java 2010-10-26 15:33:02 UTC (rev 3349) @@ -18,11 +18,16 @@ */ package org.exoplatform.services.jcr.impl.util.io; = -import org.exoplatform.services.jcr.impl.proccess.WorkerService; +import org.exoplatform.services.jcr.impl.proccess.WorkerThread; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = import java.io.File; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.ConcurrentLinkedQueue; = /** * Created by The eXo Platform SAS. @@ -30,43 +35,103 @@ * @author Gennady Azarenkov * @version $Id: FileCleaner.java 11907 2008-03-13 15:36:21Z ksm $ */ -public class FileCleaner +public class FileCleaner extends WorkerThread { = protected static final long DEFAULT_TIMEOUT =3D 30000; = protected static Log log =3D ExoLogger.getLogger("exo.jcr.component.cor= e.FileCleaner"); = + protected final ConcurrentLinkedQueue files =3D new ConcurrentLin= kedQueue(); + + public FileCleaner() + { + this(DEFAULT_TIMEOUT); + } + + public FileCleaner(long timeout) + { + this(timeout, true); + } + + public FileCleaner(boolean start) + { + this(DEFAULT_TIMEOUT, start); + } + + public FileCleaner(long timeout, boolean start) + { + super(timeout); + setName("FileCleaner " + getId()); + setDaemon(true); + setPriority(Thread.MIN_PRIORITY); + + if (start) + start(); + + PrivilegedAction action =3D new PrivilegedAction() + { + public Object run() + { + registerShutdownHook(); + return null; + } + }; + AccessController.doPrivileged(action); + + if (log.isDebugEnabled()) + { + log.debug("FileCleaner instantiated name=3D " + getName() + " tim= eout=3D " + timeout); + } + } + /** - * FileCleanerTask is a task that might be executed with WorkerService.= This task = - * tries to remove single file. If remove is failed it register itself = to execute again. = + * @param file */ - class FileCleanerTask implements Runnable + public void addFile(File file) { - protected final File file; + if (PrivilegedFileHelper.exists(file)) + { + files.offer(file); + } + } = - private final WorkerService executor; - - FileCleanerTask(WorkerService workerService, File file) + @Override + public void halt() + { + try { - this.file =3D file; - this.executor =3D workerService; + callPeriodically(); } + catch (Exception e) + { + } = - /** - * {@inheritDoc} = - */ - public void run() + if (files !=3D null && files.size() > 0) + log.warn("There are uncleared files: " + files.size()); + + super.halt(); + } + + /** + * @see org.exoplatform.services.jcr.impl.proccess.WorkerThread#callPer= iodically() + */ + @Override + protected void callPeriodically() throws Exception + { + File file =3D null; + Set notRemovedFiles =3D new HashSet(); + while ((file =3D files.poll()) !=3D null) { if (PrivilegedFileHelper.exists(file)) { if (!PrivilegedFileHelper.delete(file)) { + notRemovedFiles.add(file); + if (log.isDebugEnabled()) log.debug("Could not delete " + (file.isDirectory() ? "d= irectory" : "file") + ". Will try next time: " + PrivilegedFileHelper.get= AbsolutePath(file)); - // delete is failed, so execute this task again = - executor.executeDelay(this, timeout); } else if (log.isDebugEnabled()) { @@ -75,44 +140,37 @@ } } } - } = - final long timeout; - - final WorkerService workerService; - - /** - * TODO this constructor used only in ext project. Clean it. - * = - * @param timeout - */ - public FileCleaner(long timeout) - { - this(new WorkerService(1), DEFAULT_TIMEOUT); + //add do lists tail all not removed files + if (!notRemovedFiles.isEmpty()) + { + files.addAll(notRemovedFiles); + } } = - public FileCleaner(WorkerService workerService) + private void registerShutdownHook() { - this(workerService, DEFAULT_TIMEOUT); - } - - public FileCleaner(WorkerService workerService, long timeout) - { - this.timeout =3D timeout; - this.workerService =3D workerService; - } - - /** - * Add file to special removing queue. = - * = - * @param file - file that must be removed - */ - public void addFile(File file) - { - if (PrivilegedFileHelper.exists(file)) + // register shutdown hook for final cleaning up + try { - workerService.executeDelay(new FileCleanerTask(workerService, fil= e), timeout); + Runtime.getRuntime().addShutdownHook(new Thread() + { + @Override + public void run() + { + File file =3D null; + while ((file =3D files.poll()) !=3D null) + { + PrivilegedFileHelper.delete(file); + } + } + }); } + catch (IllegalStateException e) + { + // can't register shutdownhook because + // jvm shutdown sequence has already begun, + // silently ignore... + } } - } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/FileCleanerHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/FileCleanerHolder.java 2010-10-26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/FileCleanerHolder.java 2010-10-26 15:33:02 UTC (rev 3349) @@ -18,9 +18,6 @@ */ package org.exoplatform.services.jcr.impl.util.io; = -import org.exoplatform.services.jcr.config.RepositoryEntry; -import org.exoplatform.services.jcr.impl.proccess.WorkerService; - /** * Created by The eXo Platform SAS.
    per workspace container file cle= aner holder object * = @@ -29,56 +26,17 @@ */ public class FileCleanerHolder { - /** - * Default amount of thread that may be used by WorkerService to serve = LockRemovers. - */ - public final int DEFAULT_THREAD_COUNT =3D 1; = - /** - * WorkerService that executed LockRemover. - */ - private final WorkerService workerService; + private final FileCleaner fileCleaner; = - /** - * Constructor. Used in tests. - * = - * @param threadCount - how mane threads can serve FileCleaner tasks - */ - public FileCleanerHolder(int threadCount) + public FileCleanerHolder() { - workerService =3D new WorkerService(threadCount, "file-cleaner-"); + this.fileCleaner =3D new FileCleaner(); } = - /** - * Constructor. - * @param entry - RepositoryEntry that may contain lock-remover-max-thr= eads parameter. - */ - public FileCleanerHolder(RepositoryEntry entry) - { - int threadCount =3D DEFAULT_THREAD_COUNT; - if (entry !=3D null) - { - if (entry.getLockRemoverThreadsCount() > 0) - { - threadCount =3D entry.getLockRemoverThreadsCount(); - } - } - workerService =3D new WorkerService(threadCount, "file-cleaner-" + e= ntry.getName()); - } - public FileCleaner getFileCleaner() { - return new FileCleaner(workerService); + return fileCleaner; } = - public FileCleaner getFileCleaner(long timeout) - { - return new FileCleaner(workerService, timeout); - } - - public void stop() - { - this.workerService.stop(); - } - } Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resources/binding.xml 2010-10= -26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/binding.xml 2010-10= -26 15:33:02 UTC (rev 3349) @@ -19,9 +19,6 @@ deserializer=3D"org.exoplatform.services.jcr.util.ConfigurationFormat.= parseTime" usage=3D"optional" /> - - = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/dataflow/persistent/TestCleanableFileStreamValueData.java 2010-10= -26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/TestCleanableFileStreamValueData.java 2010-10= -26 15:33:02 UTC (rev 3349) @@ -20,7 +20,6 @@ = import org.exoplatform.services.jcr.JcrImplBaseTest; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.impl.util.io.SwapFile; = @@ -50,7 +49,6 @@ = private File testFile =3D new File(parentDir, FILE_NAME); = - private WorkerService workerService; private FileCleaner testCleaner; = private CleanableFilePersistedValueData cleanableValueData; @@ -84,9 +82,9 @@ public void setUp() throws Exception { super.setUp(); - WorkerService workerService =3D new WorkerService(1); - testCleaner =3D new FileCleaner(workerService, CLEANER_TIMEOUT); = + testCleaner =3D new FileCleaner(CLEANER_TIMEOUT); + SwapFile sf =3D SwapFile.get(parentDir, FILE_NAME); FileOutputStream fout =3D new FileOutputStream(sf); fout.write("testFileCleaned".getBytes()); @@ -101,9 +99,9 @@ { cleanableValueData =3D null; = + testCleaner.halt(); testCleaner =3D null; - workerService.stop(); - = + if (testFile.exists()) { testFile.delete(); Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/JDBCWDCTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/JDBCWDCTest.java 2010-10-26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/JDBCWDCTest.java 2010-10-26 15:33:02 UTC (rev 3349) @@ -104,7 +104,7 @@ // ref.add(new StringRefAddr("database", "jdbc:hsqldb:file:data/test= ")); = // SimpleJNDIContextInitializer.initialize(sourceName, ref); - FileCleanerHolder holder =3D new FileCleanerHolder(1); + FileCleanerHolder holder =3D new FileCleanerHolder(); = container =3D new JDBCWorkspaceDataContainer(config, repositoryEntry, null, new= StandaloneStoragePluginProvider(config, Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/TestFileIOChannel.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/value/fs/TestFileIOChannel.java 2010-10-26 15:08:22 UTC (= rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/storage/value/fs/TestFileIOChannel.java 2010-10-26 15:33:02 UTC (= rev 3349) @@ -22,7 +22,6 @@ = import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.dataflow.TesterTransientValueData; -import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; = @@ -44,8 +43,6 @@ = private File rootDir; = - WorkerService workerService; - private FileCleaner cleaner; = private ValueDataResourceHolder resources =3D new ValueDataResourceHold= er(); @@ -59,9 +56,9 @@ protected void setUp() throws Exception { super.setUp(); - workerService =3D new WorkerService(1, "TestFileIOChannel-file-clean= er"); - cleaner =3D new FileCleaner(workerService, 2000); = + cleaner =3D new FileCleaner(2000); + rootDir =3D new File(new File("target"), "vs1"); rootDir.mkdirs(); = @@ -78,7 +75,7 @@ @Override protected void tearDown() throws Exception { - cleaner =3D null; + cleaner.halt(); } = public void testRead() throws Exception Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestPersistedValueData.java 2010-10-26 15:08:22 UTC (rev 33= 48) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestPersistedValueData.java 2010-10-26 15:33:02 UTC (rev 33= 49) @@ -23,7 +23,6 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPers= istedValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.CleanableFile= PersistedValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.FilePersisted= ValueData; -import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.storage.value.fs.Probe; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.impl.util.io.SwapFile; @@ -82,8 +81,7 @@ = public void testIfFinalizeRemovesTempFileStreamValueData() throws Excep= tion { - WorkerService workerService =3D new WorkerService(1, "TestPersistedV= alueData-file-cleaner"); - FileCleaner testFileCleaner =3D new FileCleaner(workerService, 1000); + FileCleaner testFileCleaner =3D new FileCleaner(1000, true); try { byte[] buf =3D "0123456789".getBytes(); @@ -109,7 +107,7 @@ } finally { - testFileCleaner =3D null; + testFileCleaner.halt(); } } = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestTransientValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestTransientValueData.java 2010-10-26 15:08:22 UTC (rev 33= 48) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestTransientValueData.java 2010-10-26 15:33:02 UTC (rev 33= 49) @@ -24,7 +24,6 @@ import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.QPath; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.util.JCRDateFormat; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; = @@ -67,8 +66,7 @@ = public void testCreateFileStreamTransientValueData() throws Exception { - WorkerService workerService =3D new WorkerService(1, "TestTransientV= alueData-file-cleaner"); - FileCleaner testFileCleaner =3D new FileCleaner(workerService); + FileCleaner testFileCleaner =3D new FileCleaner(); try { byte[] buf =3D "0123456789".getBytes(); @@ -106,7 +104,7 @@ } finally { - testFileCleaner =3D null; + testFileCleaner.halt(); } = } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/value/TestValueImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/TestValueImpl.java 2010-10-26 15:08:22 UTC (rev 3348) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/value/TestValueImpl.java 2010-10-26 15:33:02 UTC (rev 3349) @@ -27,7 +27,6 @@ import org.exoplatform.services.jcr.impl.core.value.LongValue; import org.exoplatform.services.jcr.impl.core.value.StringValue; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.proccess.WorkerService; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; = import java.io.File; @@ -51,8 +50,7 @@ = public void testNewBinaryValue() throws Exception { - WorkerService workerService =3D new WorkerService(1, "TestValueImpl-= file-cleaner"); - FileCleaner testFileCleaner =3D new FileCleaner(workerService); + FileCleaner testFileCleaner =3D new FileCleaner(); = try { @@ -95,7 +93,7 @@ } finally { - testFileCleaner =3D null; + testFileCleaner.halt(); } } = --===============7769746469271125689==-- From do-not-reply at jboss.org Wed Oct 27 03:52:38 2010 Content-Type: multipart/mixed; boundary="===============7394665038409767097==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3350 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration. Date: Wed, 27 Oct 2010 03:52:38 -0400 Message-ID: <201010270752.o9R7qcG4015052@svn01.web.mwc.hst.phx2.redhat.com> --===============7394665038409767097== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-27 03:52:37 -0400 (Wed, 27 Oct 2010) New Revision: 3350 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/configuration/exo-jcr-configuration.xml Log: EXOJCR-999: lock-remover-max-threads parameter description added Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/configuration/exo-jcr-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.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/configuration/exo-jcr-configuration.xml 2010-10-26 15:33:02 UT= C (rev 3349) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/configuration/exo-jcr-configuration.xml 2010-10-27 07:52:37 UT= C (rev 3350) @@ -197,6 +197,16 @@ session-max-age: The time aft= er which an idle session will be removed (called logout). If session-max-= age is not set up, idle session will never be removed. + + lock-remover-max-threads: Number of threads t= hat + can serve LockRemover tasks. Default value is 1. Repository may have m= any + workspaces, each workspace have own LockManager. JCR supports Locks wi= th + defined lifetime. Such a lock must be removed is it become expired. Th= at + is what LockRemovers does. But LockRemovers is not an independent + timer-threads, its a task that executed each 30 seconds. Such a task is + served by ThreadPoolExecutor which may use different number of + threads. =
    @@ -376,6 +386,13 @@ path: A lock folder. Each wor= kspace has its own one. = + + Also see lock-remover-max-threads repository + configuration parameter. + + <!ELEMENT repository-service (repositories)> <!ATTLIST repository-service default-repository NMTOKEN #REQUIRED> <!ELEMENT repositories (repository)> --===============7394665038409767097==-- From do-not-reply at jboss.org Wed Oct 27 04:03:31 2010 Content-Type: multipart/mixed; boundary="===============3345429908413988999==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3351 - kernel/branches. Date: Wed, 27 Oct 2010 04:03:31 -0400 Message-ID: <201010270803.o9R83VjX015601@svn01.web.mwc.hst.phx2.redhat.com> --===============3345429908413988999== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 04:03:30 -0400 (Wed, 27 Oct 2010) New Revision: 3351 Added: kernel/branches/2.2.5-GA-perf/ Log: [SWF-578] Create perf branch from 3.0.1 Copied: kernel/branches/2.2.5-GA-perf (from rev 3350, kernel/tags/2.2.5-GA) --===============3345429908413988999==-- From do-not-reply at jboss.org Wed Oct 27 04:03:52 2010 Content-Type: multipart/mixed; boundary="===============9102527531068487089==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3352 - core/branches. Date: Wed, 27 Oct 2010 04:03:52 -0400 Message-ID: <201010270803.o9R83q08015638@svn01.web.mwc.hst.phx2.redhat.com> --===============9102527531068487089== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 04:03:51 -0400 (Wed, 27 Oct 2010) New Revision: 3352 Added: core/branches/2.3.5-GA-perf/ Log: [SWF-578] Create perf branch from 3.0.1 Copied: core/branches/2.3.5-GA-perf (from rev 3351, core/tags/2.3.5-GA) --===============9102527531068487089==-- From do-not-reply at jboss.org Wed Oct 27 04:04:14 2010 Content-Type: multipart/mixed; boundary="===============6990319557610931454==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3353 - ws/branches. Date: Wed, 27 Oct 2010 04:04:14 -0400 Message-ID: <201010270804.o9R84ERY019772@svn01.web.mwc.hst.phx2.redhat.com> --===============6990319557610931454== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 04:04:13 -0400 (Wed, 27 Oct 2010) New Revision: 3353 Added: ws/branches/2.1.5-GA-perf/ Log: [SWF-578] Create perf branch from 3.0.1 Copied: ws/branches/2.1.5-GA-perf (from rev 3352, ws/tags/2.1.5-GA) --===============6990319557610931454==-- From do-not-reply at jboss.org Wed Oct 27 04:04:36 2010 Content-Type: multipart/mixed; boundary="===============3957653480626755759==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3354 - jcr/branches. Date: Wed, 27 Oct 2010 04:04:36 -0400 Message-ID: <201010270804.o9R84a9f021495@svn01.web.mwc.hst.phx2.redhat.com> --===============3957653480626755759== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 04:04:35 -0400 (Wed, 27 Oct 2010) New Revision: 3354 Added: jcr/branches/1.12.5-GA-perf/ Log: [SWF-578] Create perf branch from 3.0.1 Copied: jcr/branches/1.12.5-GA-perf (from rev 3353, jcr/tags/1.12.5-GA) --===============3957653480626755759==-- From do-not-reply at jboss.org Wed Oct 27 05:03:06 2010 Content-Type: multipart/mixed; boundary="===============8656854430242570940==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3355 - in kernel/branches/2.2.5-GA-perf: exo.kernel.commons and 12 other directories. Date: Wed, 27 Oct 2010 05:03:05 -0400 Message-ID: <201010270903.o9R935p0024497@svn01.web.mwc.hst.phx2.redhat.com> --===============8656854430242570940== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 05:03:02 -0400 (Wed, 27 Oct 2010) New Revision: 3355 Modified: kernel/branches/2.2.5-GA-perf/exo.kernel.commons/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.component.cache/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.component.command/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.component.common/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.component.ext.cache.impl.jboss.= v3/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.component.remote/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.container/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-in= t-demo/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-in= t-tests/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-in= t/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-ke= rnel-extras/pom.xml kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/pom.xml kernel/branches/2.2.5-GA-perf/packaging/module/pom.xml kernel/branches/2.2.5-GA-perf/pom.xml Log: [SWF-578] Create perf branch from 3.0.1 Modified: kernel/branches/2.2.5-GA-perf/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/2.2.5-GA-perf/exo.kernel.commons/pom.xml 2010-10-27 08:= 04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.commons/pom.xml 2010-10-27 09:= 03:02 UTC (rev 3355) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.commons Modified: kernel/branches/2.2.5-GA-perf/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/2.2.5-GA-perf/exo.kernel.component.cache/pom.xml 2010-1= 0-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.component.cache/pom.xml 2010-1= 0-27 09:03:02 UTC (rev 3355) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.component.cache @@ -51,4 +51,4 @@ slf4j-log4j12 = - \ No newline at end of file + Modified: kernel/branches/2.2.5-GA-perf/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/2.2.5-GA-perf/exo.kernel.component.command/pom.xml 2010= -10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.component.command/pom.xml 2010= -10-27 09:03:02 UTC (rev 3355) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.component.command Modified: kernel/branches/2.2.5-GA-perf/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/2.2.5-GA-perf/exo.kernel.component.common/pom.xml 2010-= 10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.component.common/pom.xml 2010-= 10-27 09:03:02 UTC (rev 3355) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.component.common Modified: kernel/branches/2.2.5-GA-perf/exo.kernel.component.ext.cache.impl= .jboss.v3/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA-perf/exo.kernel.component.ext.cache.impl.jboss= .v3/pom.xml 2010-10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.component.ext.cache.impl.jboss= .v3/pom.xml 2010-10-27 09:03:02 UTC (rev 3355) @@ -23,7 +23,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT exo.kernel.component.ext.cache.impl.jboss.v3 eXo Kernel :: Cache Extension :: JBoss Cache Implementation @@ -81,4 +81,4 @@ - \ No newline at end of file + Modified: kernel/branches/2.2.5-GA-perf/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/2.2.5-GA-perf/exo.kernel.component.remote/pom.xml 2010-= 10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.component.remote/pom.xml 2010-= 10-27 09:03:02 UTC (rev 3355) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.component.remote Modified: kernel/branches/2.2.5-GA-perf/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/2.2.5-GA-perf/exo.kernel.container/pom.xml 2010-10-27 0= 8:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.container/pom.xml 2010-10-27 0= 9:03:02 UTC (rev 3355) @@ -12,7 +12,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT exo.kernel.container eXo Kernel :: Container @@ -97,4 +97,4 @@ --> - \ No newline at end of file + Modified: kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kerne= l.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/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-i= nt/pom.xml 2010-10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-i= nt/pom.xml 2010-10-27 09:03:02 UTC (rev 3355) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.mc-int Modified: kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kerne= l.mc-int-demo/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-i= nt-demo/pom.xml 2010-10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-i= nt-demo/pom.xml 2010-10-27 09:03:02 UTC (rev 3355) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.mc-int-demo Modified: kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kerne= l.mc-int-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/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-i= nt-tests/pom.xml 2010-10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-i= nt-tests/pom.xml 2010-10-27 09:03:02 UTC (rev 3355) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.mc-int-tests Modified: kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kerne= l.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/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-k= ernel-extras/pom.xml 2010-10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/exo.kernel.mc-k= ernel-extras/pom.xml 2010-10-27 09:03:02 UTC (rev 3355) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = exo.kernel.mc-kernel-extras Modified: kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA-perf/exo.kernel.mc-integration/pom.xml 2010-10= -27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/exo.kernel.mc-integration/pom.xml 2010-10= -27 09:03:02 UTC (rev 3355) @@ -6,7 +6,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = mc-integration-parent Modified: kernel/branches/2.2.5-GA-perf/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/2.2.5-GA-perf/packaging/module/pom.xml 2010-10-27 08:04= :35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/packaging/module/pom.xml 2010-10-27 09:03= :02 UTC (rev 3355) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = 4.0.0 Modified: kernel/branches/2.2.5-GA-perf/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/2.2.5-GA-perf/pom.xml 2010-10-27 08:04:35 UTC (rev 3354) +++ kernel/branches/2.2.5-GA-perf/pom.xml 2010-10-27 09:03:02 UTC (rev 3355) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT pom = eXo Kernel --===============8656854430242570940==-- From do-not-reply at jboss.org Wed Oct 27 05:03:42 2010 Content-Type: multipart/mixed; boundary="===============1966283158003472675==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3356 - in core/branches/2.3.5-GA-perf: exo.core.component.database and 10 other directories. Date: Wed, 27 Oct 2010 05:03:41 -0400 Message-ID: <201010270903.o9R93fu6024538@svn01.web.mwc.hst.phx2.redhat.com> --===============1966283158003472675== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 05:03:39 -0400 (Wed, 27 Oct 2010) New Revision: 3356 Modified: core/branches/2.3.5-GA-perf/exo.core.component.database/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.document/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.ldap/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.organization.api/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.organization.jdbc/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.organization.ldap/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.script.groovy/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.security.core/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.web.css/pom.xml core/branches/2.3.5-GA-perf/exo.core.component.xml-processing/pom.xml core/branches/2.3.5-GA-perf/packaging/module/pom.xml core/branches/2.3.5-GA-perf/pom.xml Log: [SWF-578] Create perf branch from 3.0.1 Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.database/pom.xml 2010-10= -27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.database/pom.xml 2010-10= -27 09:03:39 UTC (rev 3356) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = exo.core.component.database Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.document/pom.xml 2010-10= -27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.document/pom.xml 2010-10= -27 09:03:39 UTC (rev 3356) @@ -14,7 +14,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT exo.core.component.document eXo Core :: Component :: Demo Service Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.ldap/pom.xml 2010-10-27 = 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.ldap/pom.xml 2010-10-27 = 09:03:39 UTC (rev 3356) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = exo.core.component.ldap Modified: core/branches/2.3.5-GA-perf/exo.core.component.organization.api/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA-perf/exo.core.component.organization.api/pom.xml= 2010-10-27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.organization.api/pom.xml= 2010-10-27 09:03:39 UTC (rev 3356) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT exo.core.component.organization.api eXo Core :: Component :: Organization Service API @@ -118,4 +118,4 @@ - \ No newline at end of file + Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.organization.jdbc/pom.xm= l 2010-10-27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.organization.jdbc/pom.xm= l 2010-10-27 09:03:39 UTC (rev 3356) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = exo.core.component.organization.jdbc @@ -117,4 +117,4 @@ = = - \ No newline at end of file + Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.organization.ldap/pom.xm= l 2010-10-27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.organization.ldap/pom.xm= l 2010-10-27 09:03:39 UTC (rev 3356) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = exo.core.component.organization.ldap @@ -80,4 +80,4 @@ = - \ No newline at end of file + Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.script.groovy/pom.xml 20= 10-10-27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.script.groovy/pom.xml 20= 10-10-27 09:03:39 UTC (rev 3356) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = exo.core.component.script.groovy @@ -47,4 +47,4 @@ groovy-all - \ No newline at end of file + Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.security.core/pom.xml 20= 10-10-27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.security.core/pom.xml 20= 10-10-27 09:03:39 UTC (rev 3356) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = exo.core.component.security.core @@ -79,4 +79,4 @@ - \ No newline at end of file + Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.web.css/pom.xml 2010-10-= 27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.web.css/pom.xml 2010-10-= 27 09:03:39 UTC (rev 3356) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = exo.core.component.web.css Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/exo.core.component.xml-processing/pom.xml 2= 010-10-27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/exo.core.component.xml-processing/pom.xml 2= 010-10-27 09:03:39 UTC (rev 3356) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT exo.core.component.xml-processing eXo Core :: Component :: XML Processing Service @@ -98,4 +98,4 @@ - \ No newline at end of file + Modified: core/branches/2.3.5-GA-perf/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/branches/2.3.5-GA-perf/packaging/module/pom.xml 2010-10-27 09:03:0= 2 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/packaging/module/pom.xml 2010-10-27 09:03:3= 9 UTC (rev 3356) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT = 4.0.0 @@ -18,13 +18,13 @@ = - org.exoplatform.coreexo= .core.component.database2.3.5-GA - org.exoplatform.coreexo= .core.component.document2.3.5-GA - org.exoplatform.coreexo= .core.component.organization.api2.3.5-GA - org.exoplatform.coreexo= .core.component.organization.ldap2.3.5-GA - org.exoplatform.coreexo= .core.component.security.core2.3.5-GA - org.exoplatform.coreexo= .core.component.xml-processing2.3.5-GA - org.exoplatform.coreexo= .core.component.script.groovy2.3.5-GA + org.exoplatform.coreexo= .core.component.database2.3.6-GA-PERF-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.3.6-GA-PERF-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.3.6-GA-PERF-SNAPSHO= T + org.exoplatform.coreexo= .core.component.organization.ldap2.3.6-GA-PERF-SNAPSH= OT + org.exoplatform.coreexo= .core.component.security.core2.3.6-GA-PERF-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.3.6-GA-PERF-SNAPSHOT<= /version> + org.exoplatform.coreexo= .core.component.script.groovy2.3.6-GA-PERF-SNAPSHOT = Modified: core/branches/2.3.5-GA-perf/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/branches/2.3.5-GA-perf/pom.xml 2010-10-27 09:03:02 UTC (rev 3355) +++ core/branches/2.3.5-GA-perf/pom.xml 2010-10-27 09:03:39 UTC (rev 3356) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.3.5-GA + 2.3.6-GA-PERF-SNAPSHOT pom = eXo Core @@ -39,7 +39,7 @@ 2.3 = 1.2.1-GA - 2.2.5-GA + 2.2.6-GA-PERF-SNAPSHOT = --===============1966283158003472675==-- From do-not-reply at jboss.org Wed Oct 27 05:04:10 2010 Content-Type: multipart/mixed; boundary="===============8643379076186022483==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3357 - in ws/branches/2.1.5-GA-perf: exo.ws.commons and 6 other directories. Date: Wed, 27 Oct 2010 05:04:09 -0400 Message-ID: <201010270904.o9R949X9024569@svn01.web.mwc.hst.phx2.redhat.com> --===============8643379076186022483== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 05:04:08 -0400 (Wed, 27 Oct 2010) New Revision: 3357 Modified: ws/branches/2.1.5-GA-perf/exo.ws.commons/pom.xml ws/branches/2.1.5-GA-perf/exo.ws.frameworks.json/pom.xml ws/branches/2.1.5-GA-perf/exo.ws.frameworks.servlet/pom.xml ws/branches/2.1.5-GA-perf/exo.ws.rest.core/pom.xml ws/branches/2.1.5-GA-perf/exo.ws.rest.ext/pom.xml ws/branches/2.1.5-GA-perf/exo.ws.testframework/pom.xml ws/branches/2.1.5-GA-perf/packaging/module/pom.xml ws/branches/2.1.5-GA-perf/pom.xml Log: [SWF-578] Create perf branch from 3.0.1 Modified: ws/branches/2.1.5-GA-perf/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/branches/2.1.5-GA-perf/exo.ws.commons/pom.xml 2010-10-27 09:03:39 UT= C (rev 3356) +++ ws/branches/2.1.5-GA-perf/exo.ws.commons/pom.xml 2010-10-27 09:04:08 UT= C (rev 3357) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT = exo.ws.commons Modified: ws/branches/2.1.5-GA-perf/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/branches/2.1.5-GA-perf/exo.ws.frameworks.json/pom.xml 2010-10-27 09:= 03:39 UTC (rev 3356) +++ ws/branches/2.1.5-GA-perf/exo.ws.frameworks.json/pom.xml 2010-10-27 09:= 04:08 UTC (rev 3357) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT = exo.ws.frameworks.json Modified: ws/branches/2.1.5-GA-perf/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/branches/2.1.5-GA-perf/exo.ws.frameworks.servlet/pom.xml 2010-10-27 = 09:03:39 UTC (rev 3356) +++ ws/branches/2.1.5-GA-perf/exo.ws.frameworks.servlet/pom.xml 2010-10-27 = 09:04:08 UTC (rev 3357) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/branches/2.1.5-GA-perf/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/branches/2.1.5-GA-perf/exo.ws.rest.core/pom.xml 2010-10-27 09:03:39 = UTC (rev 3356) +++ ws/branches/2.1.5-GA-perf/exo.ws.rest.core/pom.xml 2010-10-27 09:04:08 = UTC (rev 3357) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT = exo.ws.rest.core Modified: ws/branches/2.1.5-GA-perf/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/branches/2.1.5-GA-perf/exo.ws.rest.ext/pom.xml 2010-10-27 09:03:39 U= TC (rev 3356) +++ ws/branches/2.1.5-GA-perf/exo.ws.rest.ext/pom.xml 2010-10-27 09:04:08 U= TC (rev 3357) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT = exo.ws.rest.ext Modified: ws/branches/2.1.5-GA-perf/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/branches/2.1.5-GA-perf/exo.ws.testframework/pom.xml 2010-10-27 09:03= :39 UTC (rev 3356) +++ ws/branches/2.1.5-GA-perf/exo.ws.testframework/pom.xml 2010-10-27 09:04= :08 UTC (rev 3357) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT = exo.ws.testframework @@ -38,4 +38,4 @@ servlet-api - \ No newline at end of file + Modified: ws/branches/2.1.5-GA-perf/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/branches/2.1.5-GA-perf/packaging/module/pom.xml 2010-10-27 09:03:39 = UTC (rev 3356) +++ ws/branches/2.1.5-GA-perf/packaging/module/pom.xml 2010-10-27 09:04:08 = UTC (rev 3357) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT = 4.0.0 Modified: ws/branches/2.1.5-GA-perf/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.5-GA-perf/pom.xml 2010-10-27 09:03:39 UTC (rev 3356) +++ ws/branches/2.1.5-GA-perf/pom.xml 2010-10-27 09:04:08 UTC (rev 3357) @@ -30,7 +30,7 @@ = org.exoplatform.ws ws-parent - 2.1.5-GA + 2.1.6-GA-PERF-SNAPSHOT pom eXo WS = @@ -44,8 +44,8 @@ exo-ws 2.1 = - 2.2.5-GA - 2.3.5-GA + 2.2.6-GA-PERF-SNAPSHOT + 2.3.6-GA-PERF-SNAPSHOT = --===============8643379076186022483==-- From do-not-reply at jboss.org Wed Oct 27 05:05:09 2010 Content-Type: multipart/mixed; boundary="===============2070259483634975377==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3358 - in jcr/branches/1.12.5-GA-perf: applications and 23 other directories. Date: Wed, 27 Oct 2010 05:05:08 -0400 Message-ID: <201010270905.o9R958C6030344@svn01.web.mwc.hst.phx2.redhat.com> --===============2070259483634975377== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: aheritier Date: 2010-10-27 05:05:06 -0400 (Wed, 27 Oct 2010) New Revision: 3358 Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.backupcons= ole/pom.xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.browser/po= m.xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.config/pom= .xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.fckeditor/= pom.xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jboss/pom.= xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jonas/pom.= xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.rest/pom.x= ml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.tomcat/pom= .xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.cluster.testclient/pom.= xml jcr/branches/1.12.5-GA-perf/applications/exo.jcr.ear/pom.xml jcr/branches/1.12.5-GA-perf/applications/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.component.core/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.component.ext/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.component.ftp/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.component.statistics/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.component.webdav/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.connectors.localadapter/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/en/pom.x= ml jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.docs/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.framework.command/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.framework.ftpclient/pom.xml jcr/branches/1.12.5-GA-perf/exo.jcr.framework.web/pom.xml jcr/branches/1.12.5-GA-perf/packaging/module/pom.xml jcr/branches/1.12.5-GA-perf/pom.xml Log: [SWF-578] Create perf branch from 3.0.1 Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.bac= kupconsole/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.backupcon= sole/pom.xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.backupcon= sole/pom.xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.applications.backupconsole eXo JCR :: Applications :: Backup Console Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.bro= wser/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.browser/p= om.xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.browser/p= om.xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.applications.browser war Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.con= fig/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.config/po= m.xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.config/po= m.xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.applications.config pom Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.fck= editor/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.fckeditor= /pom.xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.fckeditor= /pom.xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.applications.fckeditor war Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jbo= ss/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jboss/pom= .xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jboss/pom= .xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT ear runtime Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jon= as/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jonas/pom= .xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.jonas/pom= .xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT ear runtime Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.res= t/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.rest/pom.= xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.rest/pom.= xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.applications.rest war Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.tom= cat/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.tomcat/po= m.xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.applications.tomcat/po= m.xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.applications.config = Modified: jcr/branches/1.12.5-GA-perf/applications/exo.jcr.cluster.testclie= nt/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/exo.jcr.cluster.testclient/pom= .xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.cluster.testclient/pom= .xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.cluster.testclient eXo JCR :: Cluster :: Test Client Modified: jcr/branches/1.12.5-GA-perf/applications/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.5-GA-perf/applications/exo.jcr.ear/pom.xml 2010-10-27= 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/exo.jcr.ear/pom.xml 2010-10-27= 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.ear ear Modified: jcr/branches/1.12.5-GA-perf/applications/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/applications/pom.xml 2010-10-27 09:04:08 UT= C (rev 3357) +++ jcr/branches/1.12.5-GA-perf/applications/pom.xml 2010-10-27 09:05:06 UT= C (rev 3358) @@ -22,12 +22,12 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT = 4.0.0 jcr-applications-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT = eXo JCR :: Applications :: Reactor pom Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/exo.jcr.component.core/pom.xml 2010-10-27 0= 9:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.component.core/pom.xml 2010-10-27 0= 9:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.component.core eXo JCR :: Component :: Core Service Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/exo.jcr.component.ext/pom.xml 2010-10-27 09= :04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.component.ext/pom.xml 2010-10-27 09= :05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.component.ext eXo JCR :: Component :: Extension Service Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/exo.jcr.component.ftp/pom.xml 2010-10-27 09= :04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.component.ftp/pom.xml 2010-10-27 09= :05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.component.ftp eXo JCR :: Component :: FTP Service Modified: jcr/branches/1.12.5-GA-perf/exo.jcr.component.statistics/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/exo.jcr.component.statistics/pom.xml 2010-1= 0-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.component.statistics/pom.xml 2010-1= 0-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.component.statistics eXo JCR :: Component :: Statistics Provider Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/exo.jcr.component.webdav/pom.xml 2010-10-27= 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.component.webdav/pom.xml 2010-10-27= 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.component.webdav eXo JCR :: Component :: Webdav Service Modified: jcr/branches/1.12.5-GA-perf/exo.jcr.connectors.localadapter/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 --- jcr/branches/1.12.5-GA-perf/exo.jcr.connectors.localadapter/pom.xml 201= 0-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.connectors.localadapter/pom.xml 201= 0-10-27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.connectors.localadapter rar Modified: jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/e= n/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/en/pom.= xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/en/pom.= xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs.developer - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/p= om.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/pom.xml= 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.docs/exo.jcr.docs.developer/pom.xml= 2010-10-27 09:05:06 UTC (rev 3358) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.5-GA-perf/exo.jcr.docs/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/exo.jcr.docs/pom.xml 2010-10-27 09:04:08 UT= C (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.docs/pom.xml 2010-10-27 09:05:06 UT= C (rev 3358) @@ -22,7 +22,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT = 4.0.0 Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/exo.jcr.framework.command/pom.xml 2010-10-2= 7 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.framework.command/pom.xml 2010-10-2= 7 09:05:06 UTC (rev 3358) @@ -12,7 +12,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.framework.command eXo JCR :: Framework :: Command Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/exo.jcr.framework.ftpclient/pom.xml 2010-10= -27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.framework.ftpclient/pom.xml 2010-10= -27 09:05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.framework.ftpclient eXo JCR :: Framework :: FTP Client Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/exo.jcr.framework.web/pom.xml 2010-10-27 09= :04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/exo.jcr.framework.web/pom.xml 2010-10-27 09= :05:06 UTC (rev 3358) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT exo.jcr.framework.web eXo JCR :: Framework :: Web Modified: jcr/branches/1.12.5-GA-perf/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.5-GA-perf/packaging/module/pom.xml 2010-10-27 09:04:0= 8 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/packaging/module/pom.xml 2010-10-27 09:05:0= 6 UTC (rev 3358) @@ -4,7 +4,7 @@ org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT jcr.packaging.module pom Modified: jcr/branches/1.12.5-GA-perf/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.5-GA-perf/pom.xml 2010-10-27 09:04:08 UTC (rev 3357) +++ jcr/branches/1.12.5-GA-perf/pom.xml 2010-10-27 09:05:06 UTC (rev 3358) @@ -29,7 +29,7 @@ = org.exoplatform.jcr jcr-parent - 1.12.5-GA + 1.12.6-GA-PERF-SNAPSHOT pom eXo JCR = @@ -42,9 +42,9 @@ exo-jcr 1.12 - 2.2.5-GA - 2.3.5-GA - 2.1.5-GA + 2.2.6-GA-PERF-SNAPSHOT + 2.3.6-GA-PERF-SNAPSHOT + 2.1.6-GA-PERF-SNAPSHOT 1 = --===============2070259483634975377==-- From do-not-reply at jboss.org Wed Oct 27 05:05:22 2010 Content-Type: multipart/mixed; boundary="===============1028275597195253326==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3359 - jcr/branches/1.12.x/patch/EXOJCR-999. Date: Wed, 27 Oct 2010 05:05:21 -0400 Message-ID: <201010270905.o9R95LuG030369@svn01.web.mwc.hst.phx2.redhat.com> --===============1028275597195253326== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2010-10-27 05:05:21 -0400 (Wed, 27 Oct 2010) New Revision: 3359 Modified: jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch Log: EXOJCR-999: patch for 1.12.x updated Modified: jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch 2010-10-27 09:05:= 06 UTC (rev 3358) +++ jcr/branches/1.12.x/patch/EXOJCR-999/EXOJCR-999.patch 2010-10-27 09:05:= 21 UTC (rev 3359) @@ -1,6 +1,6 @@ Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/c= onfig/RepositoryInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/conf= ig/RepositoryInfo.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/conf= ig/RepositoryInfo.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/conf= ig/RepositoryInfo.java (working copy) @@ -46,6 +46,8 @@ = @@ -64,7 +64,7 @@ } Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/BackupWorkspaceInitializer.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/BackupWorkspaceInitializer.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/BackupWorkspaceInitializer.java (working copy) @@ -91,7 +91,7 @@ super(config, repConfig, dataManager, namespaceRegistry, locationFa= ctory, nodeTypeManager, valueFactory, @@ -86,7 +86,7 @@ { Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/lock/jbosscache/CacheableLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/CacheableLockManagerImpl.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/CacheableLockManagerImpl.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/CacheableLockManagerImpl.java (working copy) @@ -43,6 +43,7 @@ import org.exoplatform.services.jcr.impl.Constants; @@ -194,7 +194,7 @@ = Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/jbosscache/jdbc/CacheableJDBCLockManagerImpl.java (working copy) @@ -42,6 +42,7 @@ import org.exoplatform.services.jcr.impl.Constants; @@ -274,7 +274,7 @@ } Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockManagerImpl.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockManagerImpl.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockManagerImpl.java (working copy) @@ -146,12 +146,14 @@ * @param dataManager @@ -324,9 +324,9 @@ tokensMap.clear(); Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemover.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemover.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemover.java (working copy) -@@ -18,47 +18,68 @@ +@@ -18,47 +18,66 @@ */ package org.exoplatform.services.jcr.impl.core.lock; = @@ -358,7 +358,7 @@ + private final long timeout; = - private final WorkspaceLockManager lockManagerImpl; -+ private ScheduledFuture lockRemoverTask =3D null; ++ private ScheduledFuture lockRemoverTask =3D null; = - public LockRemover(WorkspaceLockManager lockManagerImpl) + class LockRemoverTask implements Runnable @@ -403,11 +403,10 @@ + + public void start() + { -+ if (lockRemoverTask !=3D null) ++ if (lockRemoverTask =3D=3D null) + { -+ stop(); ++ lockRemoverTask =3D workerService.executePeriodically(new LockRe= moverTask(lockManager), timeout); + } -+ lockRemoverTask =3D workerService.executePeriodically(new LockRemov= erTask(lockManager), timeout); + } + + public void stop() @@ -415,13 +414,30 @@ + lockRemoverTask.cancel(false); + lockRemoverTask =3D null; + } -+ } Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/lock/LockRemoverHolder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemoverHolder.java (revision 0) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/lock/LockRemoverHolder.java (revision 0) -@@ -0,0 +1,65 @@ +@@ -0,0 +1,83 @@ ++/* ++ * 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.config.RepositoryEntry; @@ -429,9 +445,9 @@ + +/** + * LockRemoverHolder holds is a single per-repository LockRemover contain= er. -+ * @author Foo Bar ++ * = ++ * @author Karpenko Sergiy= + * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z a= heritier $ -+ * + */ +public class LockRemoverHolder +{ @@ -489,7 +505,7 @@ +} Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SessionImpl.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SessionImpl.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SessionImpl.java (working copy) @@ -42,7 +42,7 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspa= ceDataManagerStub; @@ -568,7 +584,7 @@ try Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SysViewWorkspaceInitializer.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SysViewWorkspaceInitializer.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/SysViewWorkspaceInitializer.java (working copy) @@ -265,7 +265,8 @@ else if (tmpFile =3D=3D null && (((TempOutputStream)buff).getSiz= e() + buffer.length) > maxBufferSize) @@ -632,7 +648,7 @@ public void stop() Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/value/ValueFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/value/ValueFactoryImpl.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/value/ValueFactoryImpl.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/value/ValueFactoryImpl.java (working copy) @@ -30,7 +30,7 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; @@ -656,7 +672,25 @@ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /proccess/WorkerService.java (revision 0) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /proccess/WorkerService.java (revision 0) -@@ -0,0 +1,84 @@ +@@ -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.jcr.impl.proccess; + +import java.util.concurrent.ScheduledFuture; @@ -665,6 +699,12 @@ +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + ++/** ++ * WorkerService. ++ * = ++ * @author Karpenko Sergiy= ++ * @version $Id: WorkerService.java 34361 2010-08-24 23:58:59Z aheritier $ ++ */ +public class WorkerService +{ + /** @@ -672,9 +712,9 @@ + */ + private final ScheduledThreadPoolExecutor executor; + -+ class WorkerThreadFactory implements ThreadFactory ++ static class WorkerThreadFactory implements ThreadFactory + { -+ final AtomicInteger poolNumber =3D new AtomicInteger(1); ++ static final AtomicInteger poolNumber =3D new AtomicInteger(1); + + final ThreadGroup group; + @@ -682,18 +722,25 @@ + + final String namePrefix; + ++ final boolean isDaemon; ++ + WorkerThreadFactory(String namePrefix) + { ++ this(namePrefix, false); ++ } ++ ++ WorkerThreadFactory(String namePrefix, boolean isDaemon) ++ { ++ this.isDaemon =3D isDaemon; + SecurityManager s =3D System.getSecurityManager(); + group =3D (s !=3D null) ? s.getThreadGroup() : Thread.currentThr= ead().getThreadGroup(); -+ this.namePrefix =3D namePrefix + poolNumber.getAndIncrement() + = "-thread-"; ++ this.namePrefix =3D namePrefix + "-" + poolNumber.getAndIncremen= t() + "-thread-"; + } + + public Thread newThread(Runnable r) + { + Thread t =3D new Thread(group, r, namePrefix + threadNumber.getA= ndIncrement(), 0); -+ if (t.isDaemon()) -+ t.setDaemon(false); ++ t.setDaemon(isDaemon); + if (t.getPriority() !=3D Thread.NORM_PRIORITY) + t.setPriority(Thread.NORM_PRIORITY); + return t; @@ -722,13 +769,26 @@ + } + + /** ++ * Constructor. ++ * = ++ * @param threadCount - max thread count that executor may use ++ * @param threadNamePrefix - thread name prefix ++ * @param makeThreadsDaemon - does thread created by Service must be d= aemon ++ */ ++ public WorkerService(int threadCount, String threadNamePrefix, boolean= makeThreadsDaemon) ++ { ++ executor =3D ++ new ScheduledThreadPoolExecutor(threadCount, new WorkerThreadFac= tory(threadNamePrefix, makeThreadsDaemon)); ++ } ++ ++ /** + * Execute specified command periodically with dela= y. + * = + * @param command - command that must be executed + * @param delay - delay between each command execution = + * @return + */ -+ public ScheduledFuture executePeriodically(Runnable command, long dela= y) ++ public ScheduledFuture executePeriodically(Runnable command, long d= elay) + { + return executor.scheduleWithFixedDelay(command, 0, delay, TimeUnit.= MILLISECONDS); + } @@ -743,7 +803,7 @@ +} Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /RepositoryContainer.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /RepositoryContainer.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /RepositoryContainer.java (working copy) @@ -41,6 +41,7 @@ import org.exoplatform.services.jcr.impl.core.WorkspaceInitializer; @@ -807,7 +867,7 @@ } Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/JDBCWorkspaceDataContainer.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/JDBCWorkspaceDataContainer.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/JDBCWorkspaceDataContainer.java (working copy) @@ -34,6 +34,7 @@ import org.exoplatform.services.jcr.impl.storage.jdbc.statistics.Statisti= csJDBCStorageConnection; @@ -857,7 +917,7 @@ // if (dbDialect.equals(DB_DIALECT_GENERIC) || Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/jdbc/optimisation/CQJDBCWorkspaceDataContainer.java (working copy) @@ -33,6 +33,7 @@ import org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db.HSQ= LDBConnectionFactory; @@ -884,7 +944,7 @@ /** Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/CASableSimpleFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableSimpleFileValueStorage.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableSimpleFileValueStorage.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableSimpleFileValueStorage.java (working copy) @@ -21,6 +21,7 @@ import org.exoplatform.services.jcr.config.RepositoryConfigurationExcepti= on; @@ -908,7 +968,7 @@ RepositoryConfigurationException Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/CASableTreeFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableTreeFileValueStorage.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableTreeFileValueStorage.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableTreeFileValueStorage.java (working copy) @@ -21,6 +21,7 @@ import org.exoplatform.services.jcr.config.RepositoryConfigurationExcepti= on; @@ -932,7 +992,7 @@ */ Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/FileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/FileValueStorage.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/FileValueStorage.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/FileValueStorage.java (working copy) @@ -59,9 +59,9 @@ * FileValueStorage constructor. @@ -948,7 +1008,7 @@ /** Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/SimpleFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/SimpleFileValueStorage.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/SimpleFileValueStorage.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/SimpleFileValueStorage.java (working copy) @@ -18,6 +18,7 @@ */ @@ -972,7 +1032,7 @@ */ Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/TreeFileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TreeFileValueStorage.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TreeFileValueStorage.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TreeFileValueStorage.java (working copy) @@ -21,7 +21,6 @@ import org.exoplatform.services.jcr.impl.util.io.FileCleaner; @@ -1007,7 +1067,7 @@ { Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/storage/value/StandaloneStoragePluginProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/StandaloneStoragePluginProvider.java (revision 3339) +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/StandaloneStoragePluginProvider.java (revision 3354) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /storage/value/StandaloneStoragePluginProvider.java (working copy) @@ -24,6 +24,8 @@ import org.exoplatform.services.jcr.config.ValueStorageFilterEntry; @@ -1045,52 +1105,52 @@ --- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /util/io/FileCleanerHolder.java (revision 0) +++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /util/io/FileCleanerHolder.java (revision 0) @@ -0,0 +1,43 @@ -+/* -+ * 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.util.io; -+ -+/** -+ * Created by The eXo Platform SAS.
    per workspace container file cl= eaner holder object -+ * = -+ * @author Gennady Azarenkov -+ * @version $Id: WorkspaceFileCleanerHolder.java 11907 2008-03-13 15:36:2= 1Z ksm $ -+ */ -+ -+public class FileCleanerHolder -+{ -+ -+ private final FileCleaner fileCleaner; -+ -+ public FileCleanerHolder() -+ { -+ this.fileCleaner =3D new FileCleaner(); -+ } -+ -+ public FileCleaner getFileCleaner() -+ { -+ return fileCleaner; -+ } -+ -+} ++/* ++ * 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.util.io; ++ ++/** ++ * Created by The eXo Platform SAS.
    per workspace container file cl= eaner holder object ++ * = ++ * @author Gennady Azarenkov ++ * @version $Id: WorkspaceFileCleanerHolder.java 11907 2008-03-13 15:36:2= 1Z ksm $ ++ */ ++ ++public class FileCleanerHolder ++{ ++ ++ private final FileCleaner fileCleaner; ++ ++ public FileCleanerHolder() ++ { ++ this.fileCleaner =3D new FileCleaner(); ++ } ++ ++ public FileCleaner getFileCleaner() ++ { ++ return fileCleaner; ++ } ++ ++} Index: exo.jcr.component.core/src/main/resources/binding.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/main/resources/binding.xml (revision 3339) +--- exo.jcr.component.core/src/main/resources/binding.xml (revision 3354) +++ exo.jcr.component.core/src/main/resources/binding.xml (working copy) @@ -17,6 +17,8 @@ @@ -1103,7 +1163,7 @@ Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/B= aseStandaloneTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/Base= StandaloneTest.java (revision 3339) +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/Base= StandaloneTest.java (revision 3354) +++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/Base= StandaloneTest.java (working copy) @@ -30,7 +30,7 @@ import org.exoplatform.services.jcr.impl.core.SessionImpl; @@ -1126,7 +1186,7 @@ } Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/storage/JDBCWDCTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/JDBCWDCTest.java (revision 3339) +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/JDBCWDCTest.java (revision 3354) +++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/JDBCWDCTest.java (working copy) @@ -35,6 +35,7 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; @@ -1151,7 +1211,7 @@ logProps.put("org.apache.commons.logging.simplelog.defaultlog", "de= bug"); Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/CASableFileIOChannelTestBase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableFileIOChannelTestBase.java (revision 3339) +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableFileIOChannelTestBase.java (revision 3354) +++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/CASableFileIOChannelTestBase.java (working copy) @@ -24,7 +24,6 @@ import org.exoplatform.services.jcr.impl.storage.value.cas.RecordAlreadyE= xistsException; @@ -1182,7 +1242,7 @@ = Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/storage/value/fs/TestFileIOChannel.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TestFileIOChannel.java (revision 3339) +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TestFileIOChannel.java (revision 3354) +++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /storage/value/fs/TestFileIOChannel.java (working copy) @@ -43,7 +43,7 @@ = @@ -1220,7 +1280,7 @@ = Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/value/TestPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestPersistedValueData.java (revision 3339) +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestPersistedValueData.java (revision 3354) +++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestPersistedValueData.java (working copy) @@ -81,27 +81,34 @@ = @@ -1276,7 +1336,7 @@ public void testConcurrentFileStreamValueDataReading() throws Exception Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/value/TestTransientValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestTransientValueData.java (revision 3339) +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestTransientValueData.java (revision 3354) +++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestTransientValueData.java (working copy) @@ -66,37 +66,46 @@ = @@ -1361,7 +1421,7 @@ assertEquals(10, vd.getLength()); Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/value/TestValueImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestValueImpl.java (revision 3339) +--- exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestValueImpl.java (revision 3354) +++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /value/TestValueImpl.java (working copy) @@ -50,43 +50,51 @@ = @@ -1444,7 +1504,7 @@ public void testNewBinaryValueFromString() throws Exception Index: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ex= t/replication/ReplicationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ---- exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/r= eplication/ReplicationService.java (revision 3339) +--- exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/r= eplication/ReplicationService.java (revision 3354) +++ exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/r= eplication/ReplicationService.java (working copy) @@ -43,7 +43,7 @@ import org.exoplatform.services.jcr.impl.core.RepositoryImpl; @@ -1468,984 +1528,60 @@ // create the RecoveryManager Index: exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ex= t/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 ---- exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/B= aseStandaloneTest.java (revision 3339) +--- exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/B= aseStandaloneTest.java (revision 3354) +++ exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/B= aseStandaloneTest.java (working copy) -@@ -1,489 +1,489 @@ --/* -- * 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.ext; -- --import junit.framework.TestCase; -- --import org.exoplatform.container.StandaloneContainer; --import org.exoplatform.services.jcr.RepositoryService; --import org.exoplatform.services.jcr.config.WorkspaceEntry; --import org.exoplatform.services.jcr.core.CredentialsImpl; --import org.exoplatform.services.jcr.core.ManageableRepository; --import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; --import org.exoplatform.services.jcr.dataflow.ItemState; --import org.exoplatform.services.jcr.dataflow.PersistentDataManager; --import org.exoplatform.services.jcr.datamodel.ItemData; --import org.exoplatform.services.jcr.datamodel.PropertyData; --import org.exoplatform.services.jcr.datamodel.ValueData; --import org.exoplatform.services.jcr.impl.core.NodeImpl; --import org.exoplatform.services.jcr.impl.core.RepositoryImpl; --import org.exoplatform.services.jcr.impl.core.SessionImpl; --import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpo= olFileHolder; --import org.exoplatform.services.jcr.impl.util.io.FileCleaner; +@@ -36,7 +36,7 @@ + import org.exoplatform.services.jcr.impl.core.SessionImpl; + import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpo= olFileHolder; + import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.WorkspaceFileCleanerHold= er; --import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; --import org.exoplatform.services.log.ExoLogger; --import org.exoplatform.services.log.Log; -- --import java.io.File; --import java.io.FileOutputStream; --import java.io.IOException; --import java.io.InputStream; --import java.util.Iterator; --import java.util.List; --import java.util.Random; -- --import javax.jcr.Node; --import javax.jcr.NodeIterator; --import javax.jcr.PathNotFoundException; --import javax.jcr.RepositoryException; --import javax.jcr.ValueFactory; --import javax.jcr.Workspace; -- --/** -- * Created by The eXo Platform SAS . -- * = -- * @author Gennady Azaren= kov -- * @version $Id: BaseStandaloneTest.java 12004 2007-01-17 12:03:57Z geaz $ -- */ --public abstract class BaseStandaloneTest extends TestCase --{ -- -- private static final Log log =3D ExoLogger.getLogger("exo.jcr.componen= t.ext.BaseStandaloneTest"); -- -- public static final String WS_NAME =3D "ws"; -- -- protected SessionImpl session; -- -- protected RepositoryImpl repository; -- -- protected CredentialsImpl credentials; -- -- protected Workspace workspace; -- -- protected RepositoryService repositoryService; -- -- protected Node root; -- -- protected PersistentDataManager dataManager; -- -- protected ValueFactory valueFactory; -- -- protected StandaloneContainer container; -- -- public int maxBufferSize =3D 200 * 1024; -- -- public FileCleaner fileCleaner; -- -- public ReaderSpoolFileHolder holder; -- -- protected class CompareStreamException extends Exception -- { -- -- CompareStreamException(String message) -- { -- super(message); -- } -- -- CompareStreamException(String message, Throwable e) -- { -- super(message, e); -- } -- } -- -- public void setUp() throws Exception -- { -- String containerConf =3D BaseStandaloneTest.class.getResource("/con= f/standalone/test-configuration.xml").toString(); -- -- StandaloneContainer.addConfigurationURL(containerConf); -- -- container =3D StandaloneContainer.getInstance(); -- -- if (System.getProperty("java.security.auth.login.config") =3D=3D nu= ll) -- System.setProperty("java.security.auth.login.config", Thread.cur= rentThread().getContextClassLoader() -- .getResource("login.conf").toString()); -- -- credentials =3D new CredentialsImpl("root", "exo".toCharArray()); -- -- repositoryService =3D (RepositoryService)container.getComponentInst= anceOfType(RepositoryService.class); -- -- repository =3D (RepositoryImpl)repositoryService.getDefaultReposito= ry(); -- -- session =3D (SessionImpl)repository.login(credentials, WS_NAME); -- workspace =3D session.getWorkspace(); -- root =3D session.getRootNode(); -- valueFactory =3D session.getValueFactory(); -- -- ManageableRepository repository =3D repositoryService.getDefaultRep= ository(); -- WorkspaceContainerFacade wsc =3D repository.getWorkspaceContainer(W= S_NAME); -- -- WorkspaceEntry wconf =3D (WorkspaceEntry)wsc.getComponent(Workspace= Entry.class); -- -- maxBufferSize =3D -- wconf.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, -- WorkspaceDataContainer.DEF_MAXBUFFERSIZE); -- ++import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; + import org.exoplatform.services.log.ExoLogger; + import org.exoplatform.services.log.Log; +@@ -139,8 +139,8 @@ + wconf.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, + WorkspaceDataContainer.DEF_MAXBUFFERSIZE); + = - WorkspaceFileCleanerHolder wfcleaner =3D - (WorkspaceFileCleanerHolder)wsc.getComponent(WorkspaceFileCleane= rHolder.class); -- fileCleaner =3D wfcleaner.getFileCleaner(); -- holder =3D new ReaderSpoolFileHolder(); -- -- wsc =3D repository.getWorkspaceContainer("ws4"); -- dataManager =3D (PersistentDataManager)wsc.getComponent(PersistentD= ataManager.class); -- } -- -- protected void tearDown() throws Exception -- { -- -- log.info("tearDown() BEGIN " + getClass().getName() + "." + getName= ()); -- if (session !=3D null) -- { -- try -- { -- session.refresh(false); -- Node rootNode =3D session.getRootNode(); -- if (rootNode.hasNodes()) -- { -- // clean test root -- for (NodeIterator children =3D rootNode.getNodes(); childr= en.hasNext();) -- { -- Node node =3D children.nextNode(); -- if (!node.getPath().startsWith("/jcr:system") && !node.= getPath().startsWith("/exo:audit") -- && !node.getPath().startsWith("/exo:organization")) -- { -- // log.info("DELETing ------------- "+node.getPath()= ); -- node.remove(); -- } -- } -- session.save(); -- } -- } -- catch (Exception e) -- { -- e.printStackTrace(); -- log.error("=3D=3D=3D=3D=3D Exception in tearDown() " + e.toSt= ring()); -- } -- finally -- { -- session.logout(); -- } -- } -- -- super.tearDown(); -- // log.info("tearDown() END " + getClass().getName() + "." + getNam= e()); -- } -- -- // protected abstract String getConfPath(); -- // -- // public void initRepository() throws RepositoryException { -- // } -- -- // =3D=3D=3D=3D=3D=3D utils =3D=3D=3D=3D=3D=3D=3D -- -- protected void checkItemsExisted(String[] exists, String[] notExists) = throws RepositoryException -- { -- String path =3D null; -- if (exists !=3D null) -- { -- try -- { -- for (String nodePath : exists) -- { -- path =3D nodePath; -- session.getItem(path); -- } -- } -- catch (PathNotFoundException e) -- { -- fail("Item must exists " + path + ". " + e.getMessage()); -- } -- } -- if (notExists !=3D null) -- { -- try -- { -- for (String nodePath : notExists) -- { -- session.getItem(nodePath); -- fail("Item must not exists " + nodePath); -- } -- } -- catch (PathNotFoundException e) -- { -- // ok -- } -- } -- } -- -- protected void checkNodesExistedByUUID(String[] exists, String[] notEx= ists) throws RepositoryException -- { -- String uuid =3D null; -- if (exists !=3D null) -- { -- try -- { -- for (String nodePath : exists) -- { -- uuid =3D nodePath; -- session.getNodeByUUID(uuid); -- } -- } -- catch (PathNotFoundException e) -- { -- fail("Node must exists, UUID " + uuid + ". " + e.getMessage()= ); -- } -- } -- if (notExists !=3D null) -- { -- try -- { -- for (String nodeUUID : notExists) -- { -- session.getNodeByUUID(nodeUUID); -- fail("Node must not exists, UUID " + nodeUUID); -- } -- } -- catch (PathNotFoundException e) -- { -- // ok -- } -- } -- } -- -- protected void compareStream(InputStream etalon, InputStream data) thr= ows IOException -- { -- try -- { -- compareStream(etalon, data, 0, 0, -1); -- } -- catch (CompareStreamException e) -- { -- fail(e.getMessage()); -- } -- } -- -- /** -- * Compare etalon stream with data stream begining from the offset in = etalon and position in data. -- * Length bytes will be readed and compared. if length is lower 0 then= compare streams till one of -- * them will be read. -- * = -- * @param etalon -- * @param data -- * @param etalonPos -- * @param length -- * @param dataPos -- * @throws IOException -- */ -- protected void compareStream(InputStream etalon, InputStream data, lon= g etalonPos, long dataPos, long length) -- throws IOException, CompareStreamException -- { -- -- int dindex =3D 0; -- -- skipStream(etalon, etalonPos); -- skipStream(data, dataPos); -- -- byte[] ebuff =3D new byte[1024]; -- int eread =3D 0; -- -- while ((eread =3D etalon.read(ebuff)) > 0) -- { -- -- byte[] dbuff =3D new byte[eread]; -- int erindex =3D 0; -- while (erindex < eread) -- { -- int dread =3D -1; -- try -- { -- dread =3D data.read(dbuff); -- } -- catch (IOException e) -- { -- throw new CompareStreamException("Streams is not equals by= length or data stream is unreadable. Cause: " -- + e.getMessage()); -- } -- -- if (dread =3D=3D -1) -- throw new CompareStreamException( -- "Streams is not equals by length. Data end-of-stream re= ached at position " + dindex); -- -- for (int i =3D 0; i < dread; i++) -- { -- byte eb =3D ebuff[i]; -- byte db =3D dbuff[i]; -- if (eb !=3D db) -- throw new CompareStreamException("Streams is not equals= . Wrong byte stored at position " + dindex -- + " of data stream. Expected 0x" + Integer.toHexStri= ng(eb) + " '" + new String(new byte[]{eb}) -- + "' but found 0x" + Integer.toHexString(db) + " '" = + new String(new byte[]{db}) + "'"); -- -- erindex++; -- dindex++; -- if (length > 0 && dindex >=3D length) -- return; // tested length reached -- } -- -- if (dread < eread) -- dbuff =3D new byte[eread - dread]; -- } -- } -- -- if (data.available() > 0) -- throw new CompareStreamException("Streams is not equals by lengt= h. Data stream contains more data. Were read " -- + dindex); -- } -- -- protected void skipStream(InputStream stream, long pos) throws IOExcep= tion -- { -- long curPos =3D pos; -- long sk =3D 0; -- while ((sk =3D stream.skip(curPos)) > 0) -- { -- curPos -=3D sk; -- }; -- if (sk < 0) -- fail("Can not read the stream (skip bytes)"); -- if (curPos !=3D 0) -- fail("Can not skip bytes from the stream (" + pos + " bytes)"); -- } -- -- protected File createBLOBTempFile(int sizeInKb) throws IOException -- { -- return createBLOBTempFile("exo_jcr_test_temp_file_", sizeInKb); -- } -- -- protected File createBLOBTempFile(String prefix, int sizeInKb) throws = IOException -- { -- // create test file -- byte[] data =3D new byte[1024]; // 1Kb -- -- File testFile =3D File.createTempFile(prefix, ".tmp"); -- FileOutputStream tempOut =3D new FileOutputStream(testFile); -- Random random =3D new Random(); -- -- for (int i =3D 0; i < sizeInKb; i++) -- { -- random.nextBytes(data); -- tempOut.write(data); -- } -- tempOut.close(); -- testFile.deleteOnExit(); // delete on test exit -- log.info("Temp file created: " + testFile.getAbsolutePath() + " siz= e: " + testFile.length()); -- return testFile; -- } -- -- protected void checkMixins(String[] mixins, NodeImpl node) throws Repo= sitoryException -- { -- try -- { -- String[] nodeMixins =3D node.getMixinTypeNames(); -- assertEquals("Mixins count is different", mixins.length, nodeMix= ins.length); -- -- compareMixins(mixins, nodeMixins); -- } -- catch (RepositoryException e) -- { -- fail("Mixins isn't accessible on the node " + node.getPath()); -- } -- } -- -- protected void compareMixins(String[] mixins, String[] nodeMixins) -- { -- nextMixin : for (String mixin : mixins) -- { -- for (String nodeMixin : nodeMixins) -- { -- if (mixin.equals(nodeMixin)) -- continue nextMixin; -- } -- -- fail("Mixin '" + mixin + "' isn't accessible"); -- } -- } -- -- protected String memoryInfo() -- { -- String info =3D ""; -- info =3D -- "free: " + mb(Runtime.getRuntime().freeMemory()) + "M of " + mb(= Runtime.getRuntime().totalMemory()) -- + "M (max: " + mb(Runtime.getRuntime().maxMemory()) + "M)"; -- return info; -- } -- -- // bytes to Mbytes -- protected String mb(long mem) -- { -- return String.valueOf(Math.round(mem * 100d / (1024d * 1024d)) / 10= 0d); -- } -- -- protected String execTime(long from) -- { -- return Math.round(((System.currentTimeMillis() - from) * 100.00d / = 60000.00d)) / 100.00d + "min"; -- } -- -- public void checkItemStatesIterator(Iterator expected, Iter= ator changes, boolean checklast, -- boolean isRepValDat) throws Exception -- { -- -- while (expected.hasNext()) -- { -- -- assertTrue(changes.hasNext()); -- ItemState expect =3D expected.next(); -- ItemState elem =3D changes.next(); -- -- assertEquals(expect.getState(), elem.getState()); -- // assertEquals(expect.getAncestorToSave(), elem.getAncestorToSa= ve()); -- ItemData expData =3D expect.getData(); -- ItemData elemData =3D elem.getData(); -- assertEquals(expData.getQPath(), elemData.getQPath()); -- assertEquals(expData.isNode(), elemData.isNode()); -- assertEquals(expData.getIdentifier(), elemData.getIdentifier()); -- assertEquals(expData.getParentIdentifier(), elemData.getParentId= entifier()); -- -- if (!expData.isNode()) -- { -- PropertyData expProp =3D (PropertyData)expData; -- PropertyData elemProp =3D (PropertyData)elemData; -- assertEquals(expProp.getType(), elemProp.getType()); -- assertEquals(expProp.isMultiValued(), elemProp.isMultiValued(= )); -- -- List expValDat =3D expProp.getValues(); -- List elemValDat =3D elemProp.getValues(); -- assertEquals(expValDat.size(), elemValDat.size()); -- for (int j =3D 0; j < expValDat.size(); j++) -- { -- assertTrue(java.util.Arrays -- .equals(expValDat.get(j).getAsByteArray(), elemValDat.g= et(j).getAsByteArray())); -- -- /*if (isRepValDat) { -- // check is received property values ReplicableValueData -- assertTrue(elemValDat.get(j) instanceof ReplicableValueD= ata); -- }*/ -- } -- } -- } -- -- if (checklast) -- { -- assertFalse(changes.hasNext()); -- } -- -- } --} -+/* -+ * 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.ext; -+ -+import junit.framework.TestCase; -+ -+import org.exoplatform.container.StandaloneContainer; -+import org.exoplatform.services.jcr.RepositoryService; -+import org.exoplatform.services.jcr.config.WorkspaceEntry; -+import org.exoplatform.services.jcr.core.CredentialsImpl; -+import org.exoplatform.services.jcr.core.ManageableRepository; -+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; -+import org.exoplatform.services.jcr.dataflow.ItemState; -+import org.exoplatform.services.jcr.dataflow.PersistentDataManager; -+import org.exoplatform.services.jcr.datamodel.ItemData; -+import org.exoplatform.services.jcr.datamodel.PropertyData; -+import org.exoplatform.services.jcr.datamodel.ValueData; -+import org.exoplatform.services.jcr.impl.core.NodeImpl; -+import org.exoplatform.services.jcr.impl.core.RepositoryImpl; -+import org.exoplatform.services.jcr.impl.core.SessionImpl; -+import org.exoplatform.services.jcr.impl.dataflow.serialization.ReaderSpo= olFileHolder; -+import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -+import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; -+import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; -+import org.exoplatform.services.log.ExoLogger; -+import org.exoplatform.services.log.Log; -+ -+import java.io.File; -+import java.io.FileOutputStream; -+import java.io.IOException; -+import java.io.InputStream; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Random; -+ -+import javax.jcr.Node; -+import javax.jcr.NodeIterator; -+import javax.jcr.PathNotFoundException; -+import javax.jcr.RepositoryException; -+import javax.jcr.ValueFactory; -+import javax.jcr.Workspace; -+ -+/** -+ * Created by The eXo Platform SAS . -+ * = -+ * @author Gennady Azaren= kov -+ * @version $Id: BaseStandaloneTest.java 12004 2007-01-17 12:03:57Z geaz $ -+ */ -+public abstract class BaseStandaloneTest extends TestCase -+{ -+ -+ private static final Log log =3D ExoLogger.getLogger("exo.jcr.componen= t.ext.BaseStandaloneTest"); -+ -+ public static final String WS_NAME =3D "ws"; -+ -+ protected SessionImpl session; -+ -+ protected RepositoryImpl repository; -+ -+ protected CredentialsImpl credentials; -+ -+ protected Workspace workspace; -+ -+ protected RepositoryService repositoryService; -+ -+ protected Node root; -+ -+ protected PersistentDataManager dataManager; -+ -+ protected ValueFactory valueFactory; -+ -+ protected StandaloneContainer container; -+ -+ public int maxBufferSize =3D 200 * 1024; -+ -+ public FileCleaner fileCleaner; -+ -+ public ReaderSpoolFileHolder holder; -+ -+ protected class CompareStreamException extends Exception -+ { -+ -+ CompareStreamException(String message) -+ { -+ super(message); -+ } -+ -+ CompareStreamException(String message, Throwable e) -+ { -+ super(message, e); -+ } -+ } -+ -+ public void setUp() throws Exception -+ { -+ String containerConf =3D BaseStandaloneTest.class.getResource("/con= f/standalone/test-configuration.xml").toString(); -+ -+ StandaloneContainer.addConfigurationURL(containerConf); -+ -+ container =3D StandaloneContainer.getInstance(); -+ -+ if (System.getProperty("java.security.auth.login.config") =3D=3D nu= ll) -+ System.setProperty("java.security.auth.login.config", Thread.cur= rentThread().getContextClassLoader() -+ .getResource("login.conf").toString()); -+ -+ credentials =3D new CredentialsImpl("root", "exo".toCharArray()); -+ -+ repositoryService =3D (RepositoryService)container.getComponentInst= anceOfType(RepositoryService.class); -+ -+ repository =3D (RepositoryImpl)repositoryService.getDefaultReposito= ry(); -+ -+ session =3D (SessionImpl)repository.login(credentials, WS_NAME); -+ workspace =3D session.getWorkspace(); -+ root =3D session.getRootNode(); -+ valueFactory =3D session.getValueFactory(); -+ -+ ManageableRepository repository =3D repositoryService.getDefaultRep= ository(); -+ WorkspaceContainerFacade wsc =3D repository.getWorkspaceContainer(W= S_NAME); -+ -+ WorkspaceEntry wconf =3D (WorkspaceEntry)wsc.getComponent(Workspace= Entry.class); -+ -+ maxBufferSize =3D -+ wconf.getContainer().getParameterInteger(WorkspaceDataContainer.= MAXBUFFERSIZE_PROP, -+ WorkspaceDataContainer.DEF_MAXBUFFERSIZE); -+ -+ FileCleanerHolder wfcleaner =3D -+ (FileCleanerHolder)wsc.getComponent(FileCleanerHolder.class); -+ fileCleaner =3D wfcleaner.getFileCleaner(); -+ holder =3D new ReaderSpoolFileHolder(); -+ -+ wsc =3D repository.getWorkspaceContainer("ws4"); -+ dataManager =3D (PersistentDataManager)wsc.getComponent(PersistentD= ataManager.class); -+ } -+ -+ protected void tearDown() throws Exception -+ { -+ -+ log.info("tearDown() BEGIN " + getClass().getName() + "." + getName= ()); -+ if (session !=3D null) -+ { -+ try -+ { -+ session.refresh(false); -+ Node rootNode =3D session.getRootNode(); -+ if (rootNode.hasNodes()) -+ { -+ // clean test root -+ for (NodeIterator children =3D rootNode.getNodes(); childr= en.hasNext();) -+ { -+ Node node =3D children.nextNode(); -+ if (!node.getPath().startsWith("/jcr:system") && !node.= getPath().startsWith("/exo:audit") -+ && !node.getPath().startsWith("/exo:organization")) -+ { -+ // log.info("DELETing ------------- "+node.getPath()= ); -+ node.remove(); -+ } -+ } -+ session.save(); -+ } -+ } -+ catch (Exception e) -+ { -+ e.printStackTrace(); -+ log.error("=3D=3D=3D=3D=3D Exception in tearDown() " + e.toSt= ring()); -+ } -+ finally -+ { -+ session.logout(); -+ } -+ } -+ -+ super.tearDown(); -+ // log.info("tearDown() END " + getClass().getName() + "." + getNam= e()); -+ } -+ -+ // protected abstract String getConfPath(); -+ // -+ // public void initRepository() throws RepositoryException { -+ // } -+ -+ // =3D=3D=3D=3D=3D=3D utils =3D=3D=3D=3D=3D=3D=3D -+ -+ protected void checkItemsExisted(String[] exists, String[] notExists) = throws RepositoryException -+ { -+ String path =3D null; -+ if (exists !=3D null) -+ { -+ try -+ { -+ for (String nodePath : exists) -+ { -+ path =3D nodePath; -+ session.getItem(path); -+ } -+ } -+ catch (PathNotFoundException e) -+ { -+ fail("Item must exists " + path + ". " + e.getMessage()); -+ } -+ } -+ if (notExists !=3D null) -+ { -+ try -+ { -+ for (String nodePath : notExists) -+ { -+ session.getItem(nodePath); -+ fail("Item must not exists " + nodePath); -+ } -+ } -+ catch (PathNotFoundException e) -+ { -+ // ok -+ } -+ } -+ } -+ -+ protected void checkNodesExistedByUUID(String[] exists, String[] notEx= ists) throws RepositoryException -+ { -+ String uuid =3D null; -+ if (exists !=3D null) -+ { -+ try -+ { -+ for (String nodePath : exists) -+ { -+ uuid =3D nodePath; -+ session.getNodeByUUID(uuid); -+ } -+ } -+ catch (PathNotFoundException e) -+ { -+ fail("Node must exists, UUID " + uuid + ". " + e.getMessage()= ); -+ } -+ } -+ if (notExists !=3D null) -+ { -+ try -+ { -+ for (String nodeUUID : notExists) -+ { -+ session.getNodeByUUID(nodeUUID); -+ fail("Node must not exists, UUID " + nodeUUID); -+ } -+ } -+ catch (PathNotFoundException e) -+ { -+ // ok -+ } -+ } -+ } -+ -+ protected void compareStream(InputStream etalon, InputStream data) thr= ows IOException -+ { -+ try -+ { -+ compareStream(etalon, data, 0, 0, -1); -+ } -+ catch (CompareStreamException e) -+ { -+ fail(e.getMessage()); -+ } -+ } -+ -+ /** -+ * Compare etalon stream with data stream begining from the offset in = etalon and position in data. -+ * Length bytes will be readed and compared. if length is lower 0 then= compare streams till one of -+ * them will be read. -+ * = -+ * @param etalon -+ * @param data -+ * @param etalonPos -+ * @param length -+ * @param dataPos -+ * @throws IOException -+ */ -+ protected void compareStream(InputStream etalon, InputStream data, lon= g etalonPos, long dataPos, long length) -+ throws IOException, CompareStreamException -+ { -+ -+ int dindex =3D 0; -+ -+ skipStream(etalon, etalonPos); -+ skipStream(data, dataPos); -+ -+ byte[] ebuff =3D new byte[1024]; -+ int eread =3D 0; -+ -+ while ((eread =3D etalon.read(ebuff)) > 0) -+ { -+ -+ byte[] dbuff =3D new byte[eread]; -+ int erindex =3D 0; -+ while (erindex < eread) -+ { -+ int dread =3D -1; -+ try -+ { -+ dread =3D data.read(dbuff); -+ } -+ catch (IOException e) -+ { -+ throw new CompareStreamException("Streams is not equals by= length or data stream is unreadable. Cause: " -+ + e.getMessage()); -+ } -+ -+ if (dread =3D=3D -1) -+ throw new CompareStreamException( -+ "Streams is not equals by length. Data end-of-stream re= ached at position " + dindex); -+ -+ for (int i =3D 0; i < dread; i++) -+ { -+ byte eb =3D ebuff[i]; -+ byte db =3D dbuff[i]; -+ if (eb !=3D db) -+ throw new CompareStreamException("Streams is not equals= . Wrong byte stored at position " + dindex -+ + " of data stream. Expected 0x" + Integer.toHexStri= ng(eb) + " '" + new String(new byte[]{eb}) -+ + "' but found 0x" + Integer.toHexString(db) + " '" = + new String(new byte[]{db}) + "'"); -+ -+ erindex++; -+ dindex++; -+ if (length > 0 && dindex >=3D length) -+ return; // tested length reached -+ } -+ -+ if (dread < eread) -+ dbuff =3D new byte[eread - dread]; -+ } -+ } -+ -+ if (data.available() > 0) -+ throw new CompareStreamException("Streams is not equals by lengt= h. Data stream contains more data. Were read " -+ + dindex); -+ } -+ -+ protected void skipStream(InputStream stream, long pos) throws IOExcep= tion -+ { -+ long curPos =3D pos; -+ long sk =3D 0; -+ while ((sk =3D stream.skip(curPos)) > 0) -+ { -+ curPos -=3D sk; -+ }; -+ if (sk < 0) -+ fail("Can not read the stream (skip bytes)"); -+ if (curPos !=3D 0) -+ fail("Can not skip bytes from the stream (" + pos + " bytes)"); -+ } -+ -+ protected File createBLOBTempFile(int sizeInKb) throws IOException -+ { -+ return createBLOBTempFile("exo_jcr_test_temp_file_", sizeInKb); -+ } -+ -+ protected File createBLOBTempFile(String prefix, int sizeInKb) throws = IOException -+ { -+ // create test file -+ byte[] data =3D new byte[1024]; // 1Kb -+ -+ File testFile =3D File.createTempFile(prefix, ".tmp"); -+ FileOutputStream tempOut =3D new FileOutputStream(testFile); -+ Random random =3D new Random(); -+ -+ for (int i =3D 0; i < sizeInKb; i++) -+ { -+ random.nextBytes(data); -+ tempOut.write(data); -+ } -+ tempOut.close(); -+ testFile.deleteOnExit(); // delete on test exit -+ log.info("Temp file created: " + testFile.getAbsolutePath() + " siz= e: " + testFile.length()); -+ return testFile; -+ } -+ -+ protected void checkMixins(String[] mixins, NodeImpl node) throws Repo= sitoryException -+ { -+ try -+ { -+ String[] nodeMixins =3D node.getMixinTypeNames(); -+ assertEquals("Mixins count is different", mixins.length, nodeMix= ins.length); -+ -+ compareMixins(mixins, nodeMixins); -+ } -+ catch (RepositoryException e) -+ { -+ fail("Mixins isn't accessible on the node " + node.getPath()); -+ } -+ } -+ -+ protected void compareMixins(String[] mixins, String[] nodeMixins) -+ { -+ nextMixin : for (String mixin : mixins) -+ { -+ for (String nodeMixin : nodeMixins) -+ { -+ if (mixin.equals(nodeMixin)) -+ continue nextMixin; -+ } -+ -+ fail("Mixin '" + mixin + "' isn't accessible"); -+ } -+ } -+ -+ protected String memoryInfo() -+ { -+ String info =3D ""; -+ info =3D -+ "free: " + mb(Runtime.getRuntime().freeMemory()) + "M of " + mb(= Runtime.getRuntime().totalMemory()) -+ + "M (max: " + mb(Runtime.getRuntime().maxMemory()) + "M)"; -+ return info; -+ } -+ -+ // bytes to Mbytes -+ protected String mb(long mem) -+ { -+ return String.valueOf(Math.round(mem * 100d / (1024d * 1024d)) / 10= 0d); -+ } -+ -+ protected String execTime(long from) -+ { -+ return Math.round(((System.currentTimeMillis() - from) * 100.00d / = 60000.00d)) / 100.00d + "min"; -+ } -+ -+ public void checkItemStatesIterator(Iterator expected, Iter= ator changes, boolean checklast, -+ boolean isRepValDat) throws Exception -+ { -+ -+ while (expected.hasNext()) -+ { -+ -+ assertTrue(changes.hasNext()); -+ ItemState expect =3D expected.next(); -+ ItemState elem =3D changes.next(); -+ -+ assertEquals(expect.getState(), elem.getState()); -+ // assertEquals(expect.getAncestorToSave(), elem.getAncestorToSa= ve()); -+ ItemData expData =3D expect.getData(); -+ ItemData elemData =3D elem.getData(); -+ assertEquals(expData.getQPath(), elemData.getQPath()); -+ assertEquals(expData.isNode(), elemData.isNode()); -+ assertEquals(expData.getIdentifier(), elemData.getIdentifier()); -+ assertEquals(expData.getParentIdentifier(), elemData.getParentId= entifier()); -+ -+ if (!expData.isNode()) -+ { -+ PropertyData expProp =3D (PropertyData)expData; -+ PropertyData elemProp =3D (PropertyData)elemData; -+ assertEquals(expProp.getType(), elemProp.getType()); -+ assertEquals(expProp.isMultiValued(), elemProp.isMultiValued(= )); -+ -+ List expValDat =3D expProp.getValues(); -+ List elemValDat =3D elemProp.getValues(); -+ assertEquals(expValDat.size(), elemValDat.size()); -+ for (int j =3D 0; j < expValDat.size(); j++) -+ { -+ assertTrue(java.util.Arrays -+ .equals(expValDat.get(j).getAsByteArray(), elemValDat.g= et(j).getAsByteArray())); -+ -+ /*if (isRepValDat) { -+ // check is received property values ReplicableValueData -+ assertTrue(elemValDat.get(j) instanceof ReplicableValueD= ata); -+ }*/ -+ } -+ } -+ } -+ -+ if (checklast) -+ { -+ assertFalse(changes.hasNext()); -+ } -+ -+ } -+} ++ FileCleanerHolder wfcleaner =3D ++ (FileCleanerHolder)wsc.getComponent(FileCleanerHolder.class); + fileCleaner =3D wfcleaner.getFileCleaner(); + holder =3D new ReaderSpoolFileHolder(); + = +Index: exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modul= es/jcr/configuration/exo-jcr-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 +--- exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/= jcr/configuration/exo-jcr-configuration.xml (revision 3354) ++++ exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/= jcr/configuration/exo-jcr-configuration.xml (working copy) +@@ -197,6 +197,16 @@ + session-max-age: The time af= ter + which an idle session will be removed (called logout). If session-max= -age + is not set up, idle session will never be removed. ++ ++ lock-remover-max-threads: Number of threads = that ++ can serve LockRemover tasks. Default value is 1. Repository may have = many ++ workspaces, each workspace have own LockManager. JCR supports Locks w= ith ++ defined lifetime. Such a lock must be removed is it become expired. T= hat ++ is what LockRemovers does. But LockRemovers is not an independent ++ timer-threads, its a task that executed each 30 seconds. Such a task = is ++ served by ThreadPoolExecutor which may use different number of ++ threads. +
    + = +
    +@@ -376,6 +386,13 @@ + path: A lock folder. Each wo= rkspace + has its own one. + = ++ ++ Also see lock-remover-max-threads repository ++ configuration parameter. ++ ++ + <!ELEMENT repository-service (repositories)> + <!ATTLIST repository-service default-repository NMTOKEN #REQUIRED> + <!ELEMENT repositories (repository)> --===============1028275597195253326==-- From do-not-reply at jboss.org Thu Oct 28 08:56:48 2010 Content-Type: multipart/mixed; boundary="===============5963006275504477966==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3360 - in kernel/trunk: exo.kernel.commons/src/main/java/org/exoplatform/commons and 40 other directories. Date: Thu, 28 Oct 2010 08:56:48 -0400 Message-ID: <201010281256.o9SCumCs006347@svn01.web.mwc.hst.phx2.redhat.com> --===============5963006275504477966== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-28 08:56:43 -0400 (Thu, 28 Oct 2010) New Revision: 3360 Added: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/PrivilegedFileHelper.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/PrivilegedSystemHelper.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/SecurityHelper.java kernel/trunk/exo.kernel.component.cache/src/test/resources/test.policy kernel/trunk/exo.kernel.component.command/src/test/resources/ kernel/trunk/exo.kernel.component.command/src/test/resources/test.policy kernel/trunk/exo.kernel.component.common/src/test/resources/test.policy kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/= org/exoplatform/services/cache/impl/jboss/util/ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/= org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper.java kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/resou= rces/test.policy kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/jmx/AbstractExoMBeanTest.java kernel/trunk/exo.kernel.container/src/test/resources/test.policy kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/test/= resources/ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/test/= resources/test.policy Removed: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/jmx/AbstractTestExoMBean.java Modified: kernel/trunk/exo.kernel.commons.test/pom.xml kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/commo= ns/test/TestSecurityManager.java kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/En= vironment.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/re= flect/AnnotationIntrospector.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/ExceptionUtil.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/PropertyManager.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/l= og/impl/Log4JConfigurator.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/l= og/impl/SLF4JExoLogFactory.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/l= og/impl/SimpleExoLogConfigurator.java kernel/trunk/exo.kernel.commons/src/test/resources/test.policy 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.common/src/main/java/org/exoplatform/s= ervices/compress/CompressData.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/mail/impl/MailServiceImpl.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextBinder.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextInitializer.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/net/impl/NetServiceImpl.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/rpc/impl/RPCServiceImpl.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/scheduler/impl/QuartzSheduler.java kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/transaction/impl/jotm/TransactionServiceJotmImpl.java kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/= org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/= org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/PortalContainer.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/RootContainer.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/StandaloneContainer.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/UnifiedClassLoader.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/configuration/ConfigurationManager.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/configuration/ConfigurationUnmarshaller.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/configuration/EntityResolverImpl.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/configuration/MockConfigurationManagerImpl.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/definition/PortalContainerConfig.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/monitor/jvm/J2EEServerInfo.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/monitor/jvm/JVMRuntimeInfoImpl.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/util/ContainerUtil.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/xml/Deserializer.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/manageme= nt/jmx/impl/JMXManagementProvider.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/xml/obje= ct/XMLCollection.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/xml/obje= ct/XMLObject.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/TestUnifiedClassLoader.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/jmx/TestExoMBean.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/jmx/TestExoMBeanAttribute.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/jmx/TestExoMBeanOperation.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/support/ContainerBuilder.java kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/pom.xml Log: EXOJCR-986: Enable SecurityManager by default 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 2010-10-27 09:05:21 UTC (rev 33= 59) +++ kernel/trunk/exo.kernel.commons/pom.xml 2010-10-28 12:56:43 UTC (rev 33= 60) @@ -47,18 +47,14 @@ log4j compile + + org.exoplatform.kernel + exo.kernel.commons.test + test + = - - - org.apache.maven.plugins - maven-surefire-plugin - - -Djava.security.manager -Djava.security.policy=3D$= {project.build.directory}/test-classes/test.policy - - - src/test/resources @@ -68,6 +64,51 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.ex= oplatform.commons.test.TestSecurityManager -Djava.security.policy=3D${proje= ct.build.directory}/test-classes/test.policy + + + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + + - Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/Environment.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/E= nvironment.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/E= nvironment.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,6 +18,8 @@ */ package org.exoplatform.commons; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; + public class Environment { = @@ -41,12 +43,12 @@ = private Environment() { - String catalinaHome =3D System.getProperty("catalina.home"); - String jbossHome =3D System.getProperty("jboss.home.dir"); - String jettyHome =3D System.getProperty("jetty.home"); - String websphereHome =3D System.getProperty("was.install.root"); - String weblogicHome =3D System.getProperty("weblogic.Name"); - String standAlone =3D System.getProperty("maven.exoplatform.dir"); + String catalinaHome =3D PrivilegedSystemHelper.getProperty("catalina= .home"); + String jbossHome =3D PrivilegedSystemHelper.getProperty("jboss.home.= dir"); + String jettyHome =3D PrivilegedSystemHelper.getProperty("jetty.home"= ); + String websphereHome =3D PrivilegedSystemHelper.getProperty("was.ins= tall.root"); + String weblogicHome =3D PrivilegedSystemHelper.getProperty("weblogic= .Name"); + String standAlone =3D PrivilegedSystemHelper.getProperty("maven.exop= latform.dir"); if (jbossHome !=3D null) { platform_ =3D JBOSS_PLATFORM; Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/reflect/AnnotationIntrospector.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/r= eflect/AnnotationIntrospector.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/r= eflect/AnnotationIntrospector.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,8 +18,11 @@ */ package org.exoplatform.commons.reflect; = +import org.exoplatform.commons.utils.SecurityHelper; + import java.lang.annotation.Annotation; import java.lang.reflect.Method; +import java.security.PrivilegedAction; import java.util.HashMap; import java.util.Map; = @@ -84,7 +87,7 @@ return tpl; } = - public static Map resolveMethodAnnota= tions(Class clazz, + public static Map resolveMethodAnnota= tions(final Class clazz, Class methodAnnotation) { if (clazz =3D=3D null) @@ -100,8 +103,16 @@ Map methods =3D new HashMap(); = // - for (Method method : clazz.getDeclaredMethods()) + PrivilegedAction action =3D new PrivilegedAction= () { + public Method[] run() + { + return clazz.getDeclaredMethods(); + } + }; + + for (Method method : SecurityHelper.doPriviledgedAction(action)) + { A annotation =3D method.getAnnotation(methodAnnotation); if (annotation !=3D null) { Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/utils/ExceptionUtil.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/ExceptionUtil.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/ExceptionUtil.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -27,7 +27,7 @@ */ public class ExceptionUtil { - private static String LINE_SEPARATOR =3D System.getProperty("line.separ= ator"); + private static String LINE_SEPARATOR =3D PrivilegedSystemHelper.getProp= erty("line.separator"); = static public String getExoStackTrace(Throwable t) { Added: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/common= s/utils/PrivilegedFileHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/PrivilegedFileHelper.java (rev 0) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/PrivilegedFileHelper.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,591 @@ +/* + * Copyright (C) 2010 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.commons.utils; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +/** + * @author Anatoliy Bazko + * @version $Id: SecurityFileHelper.java 111 2010-11-11 11:11:11Z tolusha $ + * + * Class helper need for perform privileged file operations. + */ +public class PrivilegedFileHelper +{ + + /** + * Create FileOutputStream in privileged mode. + * = + * @param file + * @return + * @throws FileNotFoundException + */ + public static FileOutputStream fileOutputStream(final File file) throws= FileNotFoundException + { + PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() + { + public FileOutputStream run() throws Exception + { + return new FileOutputStream(file); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof FileNotFoundException) + { + throw (FileNotFoundException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create FileOutputStream in privileged mode. + * = + * @param name + * @return + * @throws FileNotFoundException + */ + public static FileOutputStream fileOutputStream(final String name) thro= ws FileNotFoundException + { + PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() + { + public FileOutputStream run() throws Exception + { + return new FileOutputStream(name); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof FileNotFoundException) + { + throw (FileNotFoundException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create FileOutputStream in privileged mode. + * = + * @param file + * @param append + * @return + * @throws FileNotFoundException + */ + public static FileOutputStream fileOutputStream(final File file, final = boolean append) throws FileNotFoundException + { + PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() + { + public FileOutputStream run() throws Exception + { + return new FileOutputStream(file, append); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof FileNotFoundException) + { + throw (FileNotFoundException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create FileInputStream in privileged mode. + * = + * @param file + * @return + * @throws FileNotFoundException + */ + public static FileInputStream fileInputStream(final File file) throws F= ileNotFoundException + { + PrivilegedExceptionAction action =3D new Privileged= ExceptionAction() + { + public FileInputStream run() throws Exception + { + return new FileInputStream(file); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof FileNotFoundException) + { + throw (FileNotFoundException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create FileInputStream in privileged mode. + * = + * @param name + * @return + * @throws FileNotFoundException + */ + public static FileInputStream fileInputStream(final String name) throws= FileNotFoundException + { + PrivilegedExceptionAction action =3D new Privileged= ExceptionAction() + { + public FileInputStream run() throws Exception + { + return new FileInputStream(name); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof FileNotFoundException) + { + throw (FileNotFoundException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create temporary file in privileged mode. + * = + * @param prefix + * @param suffix + * @param directory + * @return + * @throws IllegalArgumentException + * @throws IOException + */ + public static File createTempFile(final String prefix, final String suf= fix, final File directory) + throws IllegalArgumentException, IOException + { + PrivilegedExceptionAction action =3D new PrivilegedExceptionAc= tion() + { + public File run() throws Exception + { + return File.createTempFile(prefix, suffix, directory); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof IllegalArgumentException) + { + throw (IllegalArgumentException)cause; + } + else if (cause instanceof IOException) + { + throw (IOException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create teamporary file in privileged mode. + * = + * = + * @param prefix + * @param suffix + * @return + * @throws IllegalArgumentException + * @throws IOException + */ + public static File createTempFile(final String prefix, final String suf= fix) throws IllegalArgumentException, + IOException + { + PrivilegedExceptionAction action =3D new PrivilegedExceptionAc= tion() + { + public File run() throws Exception + { + return File.createTempFile(prefix, suffix); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof IllegalArgumentException) + { + throw (IllegalArgumentException)cause; + } + else if (cause instanceof IOException) + { + throw (IOException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create RandomAccessFile in privileged mode. + * = + * @param file + * @param mode + * @return + * @throws IllegalArgumentException + * @throws IOException + */ + public static RandomAccessFile randomAccessFile(final File file, final = String mode) throws IllegalArgumentException, + IOException + { + PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() + { + public RandomAccessFile run() throws Exception + { + return new RandomAccessFile(file, mode); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof IllegalArgumentException) + { + throw (IllegalArgumentException)cause; + } + else if (cause instanceof FileNotFoundException) + { + throw (FileNotFoundException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Get file length in privileged mode. + * = + * @param file + * @return + */ + public static long length(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Long run() + { + return new Long(file.length()); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Requests in privileged mode that the file or directory denoted by th= is abstract = + * pathname be deleted when the virtual machine terminates. + * = + * @param file + */ + public static void deleteOnExit(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Object run() + { + file.deleteOnExit(); + return null; + } + }; + AccessController.doPrivileged(action); + } + + /** + * Get file absolute path in privileged mode. + * = + * @param file + * @return + */ + public static String getAbsolutePath(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public String run() + { + return file.getAbsolutePath(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Delete file in privileged mode. + * = + * @param file + * @return + */ + public static boolean delete(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Boolean run() + { + return file.delete(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Tests in privileged mode whether the file denoted by this abstract p= athname is a + * directory. + * = + * @param file + * @return + */ + public static boolean isDirectory(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Boolean run() + { + return file.isDirectory(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Tests in privileged mode whether the file or directory denoted by th= is abstract pathname + * exists. + * = + * @param file + * @return + */ + public static boolean exists(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Boolean run() + { + return file.exists(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Creates the directory in privileged mode. + * = + * @param file + * @return + */ + public static boolean mkdirs(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Boolean run() + { + return file.mkdirs(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Rename File in privileged mode. + * = + * @param srcFile + * @param dstfile + * @return + */ + public static boolean renameTo(final File srcFile, final File dstfile) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Boolean run() + { + return new Boolean(srcFile.renameTo(dstfile)); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Get file's list in privileged mode. + * = + * @param file + * @return + */ + public static String[] list(final File file) + { + PrivilegedAction action =3D new PrivilegedAction= () + { + public String[] run() + { + return file.list(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Get file's list in privileged mode. + * = + * @param file + * @return + */ + public static String[] list(final File file, final FilenameFilter filte= r) + { + PrivilegedAction action =3D new PrivilegedAction= () + { + public String[] run() + { + return file.list(filter); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Get file's list in privileged mode. + * = + * @param file + * @return + */ + public static File[] listFiles(final File file) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public File[] run() + { + return file.listFiles(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Get file's list in privileged mode. + * = + * @param file + * @return + */ + public static File[] listFiles(final File file, final FileFilter filter) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public File[] run() + { + return file.listFiles(filter); + } + }; + return AccessController.doPrivileged(action); + } + +} Added: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/common= s/utils/PrivilegedSystemHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/PrivilegedSystemHelper.java (rev 0) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/PrivilegedSystemHelper.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2010 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.commons.utils; + +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Properties; + +/** + * @author Anatoliy Bazko + * @version $Id: PrivilegedSystemHelper.java 111 2010-11-11 11:11:11Z tolu= sha $ + * + */ +public class PrivilegedSystemHelper +{ + + /** + * Gets system property in privileged mode. + * = + * @param key + * @return + */ + public static String getProperty(final String key) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public String run() + { + return System.getProperty(key); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Gets system properties in privileged mode. + * = + * @param key + * @return + */ + public static Properties getProperties() + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Properties run() + { + return System.getProperties(); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Gets system property in privileged mode. + * = + * @param key + * @return + */ + public static void setProperty(final String key, final String value) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public String run() + { + System.setProperty(key, value); + return null; + } + }; + AccessController.doPrivileged(action); + } + + /** + * Gets system property in privileged mode. + * = + * @param key + * @param def + * @return + */ + public static String getProperty(final String key, final String def) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public String run() + { + return System.getProperty(key, def); + } + }; + return AccessController.doPrivileged(action); + } +} Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/utils/PropertyManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/PropertyManager.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/PropertyManager.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -76,7 +76,7 @@ String propertyValue =3D cache.get(propertyName); if (propertyValue =3D=3D null) { - propertyValue =3D System.getProperty(propertyName); + propertyValue =3D PrivilegedSystemHelper.getProperty(proper= tyName); if (propertyValue !=3D null) { cache.put(propertyName, propertyValue); @@ -87,7 +87,7 @@ } else { - return System.getProperty(propertyName); + return PrivilegedSystemHelper.getProperty(propertyName); } } = @@ -110,7 +110,7 @@ = private static boolean internalIsDevelopping() { - return "true".equals(System.getProperty(DEVELOPING, "false")); + return "true".equals(PrivilegedSystemHelper.getProperty(DEVELOPING, = "false")); } = /** @@ -121,7 +121,7 @@ */ public synchronized static void setProperty(String propertyName, String= propertyValue) { - System.setProperty(propertyName, propertyValue); + PrivilegedSystemHelper.setProperty(propertyName, propertyValue); = // Remove instead of put to avoid concurrent race cache.remove(propertyName); Added: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/common= s/utils/SecurityHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/SecurityHelper.java (rev 0) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/SecurityHelper.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2010 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.commons.utils; + +import java.io.IOException; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.sql.SQLException; + +/** + * Helps running code in privileged = + * = + * @author Nikolay Zamosenchuk + * @version $Id: SecurityHelper.java 34360 2009-07-22 23:58:59Z nzamosench= uk $ + * + */ +public class SecurityHelper +{ + + /** + * Launches action in privileged mode. Can throw only IO exception. + * = + * @param + * @param action + * @return + * @throws IOException + */ + public static E doPriviledgedIOExceptionAction(PrivilegedExceptionA= ction action) throws IOException + { + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof IOException) + { + throw (IOException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Launches action in privileged mode. Can throw only IO exception. + * = + * @param + * @param action + * @return + * @throws IOException + */ + public static E doPriviledgedSQLExceptionAction(PrivilegedException= Action action) throws SQLException + { + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof SQLException) + { + throw (SQLException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Launches action in privileged mode. Can throw only runtime exception= s. + * = + * @param + * @param action + * @return + */ + public static E doPriviledgedAction(PrivilegedAction action) + { + return AccessController.doPrivileged(action); + } + = + /** + * Launches action in privileged mode. = + * = + * @param + * @param action + * @return + */ + public static E doPriviledgedExceptionAction(PrivilegedExceptionAct= ion action) + throws PrivilegedActionException + { + return AccessController.doPrivileged(action); + } + = +} Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/ser= vices/log/impl/Log4JConfigurator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/services/= log/impl/Log4JConfigurator.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/= log/impl/Log4JConfigurator.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -19,8 +19,10 @@ package org.exoplatform.services.log.impl; = import org.apache.log4j.PropertyConfigurator; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.log.AbstractLogConfigurator; = +import java.security.PrivilegedAction; import java.util.Properties; = /** @@ -33,11 +35,16 @@ */ public class Log4JConfigurator extends AbstractLogConfigurator { - - public void configure(Properties properties) + public void configure(final Properties properties) { - PropertyConfigurator.configure(properties); + SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public Object run() + { + PropertyConfigurator.configure(properties); + return null; + } + }); this.properties =3D properties; } - } Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/ser= vices/log/impl/SLF4JExoLogFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/services/= log/impl/SLF4JExoLogFactory.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/= log/impl/SLF4JExoLogFactory.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,11 +18,14 @@ */ package org.exoplatform.services.log.impl; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.log.Log; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.spi.LocationAwareLogger; = +import java.security.PrivilegedAction; + /** * A factory for {@link org.exoplatform.services.log.impl.LocationAwareSLF= 4JExoLog} and * {@link org.exoplatform.services.log.impl.SLF4JExoLog} based on the type= of the logger @@ -37,9 +40,17 @@ /** * {@inheritDoc} */ - protected Log getLogger(String name) + @Override + protected Log getLogger(final String name) { - Logger slf4jlogger =3D LoggerFactory.getLogger(name); + Logger slf4jlogger =3D SecurityHelper.doPriviledgedAction(new Privil= egedAction() + { + public Logger run() + { + return LoggerFactory.getLogger(name); + } + }); + if (slf4jlogger instanceof LocationAwareLogger) { return new LocationAwareSLF4JExoLog((LocationAwareLogger)slf4jlog= ger); Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/ser= vices/log/impl/SimpleExoLogConfigurator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/services/= log/impl/SimpleExoLogConfigurator.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/services/= log/impl/SimpleExoLogConfigurator.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.log.impl; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.services.log.AbstractLogConfigurator; = import java.util.Iterator; @@ -44,7 +45,7 @@ for (Iterator it =3D properties.entrySet().iterator(); it.hasNext();) { Map.Entry entry =3D (Map.Entry)it.next(); - System.setProperty((String)entry.getKey(), (String)entry.getValue= ()); + PrivilegedSystemHelper.setProperty((String)entry.getKey(), (Strin= g)entry.getValue()); } = this.properties =3D properties; Modified: kernel/trunk/exo.kernel.commons/src/test/resources/test.policy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/test/resources/test.policy 2010-10-= 27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons/src/test/resources/test.policy 2010-10-= 28 12:56:43 UTC (rev 3360) @@ -1,5 +1,15 @@ -// configure static permissions here -grant { +grant codeBase "@MAVEN_REPO(a)-"{ permission java.security.AllPermission; }; - = \ No newline at end of file + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ + permission java.lang.RuntimePermission "modifyPermisssion"; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons.test/-"{ + permission java.security.AllPermission; +}; Modified: kernel/trunk/exo.kernel.commons.test/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.test/pom.xml 2010-10-27 09:05:21 UTC (r= ev 3359) +++ kernel/trunk/exo.kernel.commons.test/pom.xml 2010-10-28 12:56:43 UTC (r= ev 3360) @@ -24,20 +24,4 @@ eXo Kernel :: Commons :: Test Util eXo Commons Test Util = - - - org.exoplatform.kernel - exo.kernel.commons - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - Modified: kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatfor= m/commons/test/TestSecurityManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.test/src/main/java/org/exoplatform/comm= ons/test/TestSecurityManager.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/comm= ons/test/TestSecurityManager.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,9 +18,6 @@ */ package org.exoplatform.commons.test; = -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; - import java.security.Permission; = /** @@ -32,11 +29,6 @@ { = /** - * The logger = - */ - private static final Log LOG =3D ExoLogger.getLogger("org.exoplatform.c= ommons.test.TestSecurityManager"); - - /** * {@inheritDoc} */ @Override @@ -75,9 +67,11 @@ return; } = + // known tests classes if (fileName.startsWith("Test") || fileName.endsWith("Te= st.java") - || fileName.endsWith("TestBase.java") || fileName.equ= als("Probe.java") - || fileName.equals("ExportBase.java")) + || fileName.endsWith("TestBase.java") || fileName.end= sWith("TestCase.java") + || fileName.equals("Probe.java") || fileName.equals("= ExportBase.java") + || fileName.equals("AbstractTestContainer.java") || f= ileName.equals("ContainerBuilder.java")) { testCode =3D true; } @@ -99,11 +93,6 @@ testCode =3D true; } } - else if (className.startsWith("org.slf4j.impl.Log4jLoggerFa= ctory") - || className.startsWith("com.arjuna.ats.jta.logging.jtaL= ogger")) - { - return; - } } = e =3D e.getCause(); @@ -116,7 +105,7 @@ } = // Only for test purpose - // LOG.error("Check permission failed", se); + // se.printStackTrace(); throw se; } } 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 2010-10-27 09:05:21 UTC= (rev 3359) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2010-10-28 12:56:43 UTC= (rev 3360) @@ -47,8 +47,62 @@ exo.kernel.commons + org.exoplatform.kernel + exo.kernel.commons.test + test + + org.slf4j slf4j-log4j12 = + + + + org.apache.maven.plugins + maven-surefire-plugin + + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.ex= oplatform.commons.test.TestSecurityManager -Djava.security.policy=3D${proje= ct.build.directory}/test-classes/test.policy + + + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + = + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + + + + \ No newline at end of file Added: kernel/trunk/exo.kernel.component.cache/src/test/resources/test.poli= cy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/test.policy = (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/test/resources/test.policy = 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,22 @@ +grant codeBase "@MAVEN_REPO(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons.test/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.container/-"{ + permission java.security.AllPermission; +}; 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 2010-10-27 09:05:21 U= TC (rev 3359) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2010-10-28 12:56:43 U= TC (rev 3360) @@ -43,6 +43,11 @@ exo.kernel.container + org.exoplatform.kernel + exo.kernel.commons.test + test + + commons-chain commons-chain @@ -67,12 +72,50 @@ org.apache.maven.plugins maven-surefire-plugin + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.ex= oplatform.commons.test.TestSecurityManager -Djava.security.policy=3D${proje= ct.build.directory}/test-classes/test.policy **/CommandServiceTest.java **/MultiConfigServiceTest.java + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + = + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + Added: kernel/trunk/exo.kernel.component.command/src/test/resources/test.po= licy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/test.polic= y (rev 0) +++ kernel/trunk/exo.kernel.component.command/src/test/resources/test.polic= y 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,26 @@ +grant codeBase "@MAVEN_REPO(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons.test/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.container/-"{ + permission java.security.AllPermission; +}; + + + + 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 2010-10-27 09:05:21 UT= C (rev 3359) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2010-10-28 12:56:43 UT= C (rev 3360) @@ -47,6 +47,11 @@ exo.kernel.commons + org.exoplatform.kernel + exo.kernel.commons.test + test + + javax.activation activation @@ -104,9 +109,10 @@ org.apache.maven.plugins maven-surefire-plugin + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.ex= oplatform.commons.test.TestSecurityManager -Djava.security.policy=3D${proje= ct.build.directory}/test-classes/test.policy + some JVM of Linux distributions such as Ubuntu and Fedor= a--> java.net.preferIPv4Stack true @@ -126,6 +132,43 @@ + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + = + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/compress/CompressData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/compress/CompressData.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/compress/CompressData.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,6 +18,8 @@ */ package org.exoplatform.services.compress; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -68,7 +70,7 @@ { try { - InputStream is =3D new FileInputStream(file); + InputStream is =3D PrivilegedFileHelper.fileInputStream(file); datas_.add(new InputStreamDataInstance(entryName, is)); } catch (FileNotFoundException e) @@ -98,7 +100,7 @@ public void createZipFile(String fileName) throws Exception { File fileZip =3D new File(fileName + ".zip"); - FileOutputStream out =3D new FileOutputStream(fileZip); + FileOutputStream out =3D PrivilegedFileHelper.fileOutputStream(fileZ= ip); ZipOutputStream zos =3D new ZipOutputStream(out); int size =3D datas_.size(); byte InputData[] =3D new byte[BUFFER]; @@ -170,7 +172,7 @@ public void createJarFile(String fileName) throws Exception { File fileZip =3D new File(fileName + ".jar"); - FileOutputStream out =3D new FileOutputStream(fileZip); + FileOutputStream out =3D PrivilegedFileHelper.fileOutputStream(fileZ= ip); JarOutputStream jos =3D new JarOutputStream(out); int size =3D datas_.size(); if (size < 0) @@ -289,6 +291,7 @@ file_ =3D file; } = + @Override public InputStream getInputStream() { ByteArrayOutputStream baos =3D new ByteArrayOutputStream(); @@ -332,6 +335,7 @@ return is; } = + @Override public void getJarOut(boolean containParent, JarOutputStream jos) th= rows Exception { String path =3D file_.getAbsolutePath(); @@ -355,7 +359,7 @@ } if (f.isFile()) { - bufInput =3D new FileInputStream(f); + bufInput =3D PrivilegedFileHelper.fileInputStream(f); } else filePath +=3D "/"; @@ -417,6 +421,7 @@ return jarOutput; } = + @Override public void getZipOut(boolean containParent, ZipOutputStream zos) th= rows Exception { String path =3D file_.getAbsolutePath(); @@ -460,16 +465,19 @@ is_ =3D is; } = + @Override public InputStream getInputStream() { return is_; } = + @Override public void getJarOut(boolean containParent, JarOutputStream jos) th= rows Exception { = } = + @Override public void getZipOut(boolean containParent, ZipOutputStream zos) th= rows Exception { = Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/mail/impl/MailServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/mail/impl/MailServiceImpl.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/mail/impl/MailServiceImpl.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,12 +18,15 @@ */ package org.exoplatform.services.mail.impl; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.xml.InitParams; import org.exoplatform.services.mail.Attachment; import org.exoplatform.services.mail.MailService; import org.exoplatform.services.mail.Message; = import java.io.InputStream; +import java.security.PrivilegedAction; import java.util.Date; import java.util.List; import java.util.Properties; @@ -52,18 +55,30 @@ = public MailServiceImpl(InitParams params) throws Exception { - props_ =3D new Properties(System.getProperties()); + props_ =3D new Properties(PrivilegedSystemHelper.getProperties()); props_.putAll(params.getPropertiesParam("config").getProperties()); if ("true".equals(props_.getProperty("mail.smtp.auth"))) { String username =3D props_.getProperty("mail.smtp.auth.username"); String password =3D props_.getProperty("mail.smtp.auth.password"); - ExoAuthenticator auth =3D new ExoAuthenticator(username, password= ); - mailSession_ =3D Session.getInstance(props_, auth); + final ExoAuthenticator auth =3D new ExoAuthenticator(username, pa= ssword); + mailSession_ =3D SecurityHelper.doPriviledgedAction(new Privilege= dAction() + { + public Session run() + { + return Session.getInstance(props_, auth); + } + }); } else { - mailSession_ =3D Session.getInstance(props_, null); + mailSession_ =3D SecurityHelper.doPriviledgedAction(new Privilege= dAction() + { + public Session run() + { + return Session.getInstance(props_, null); + } + }); } } = Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/naming/InitialContextBinder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/naming/InitialContextBinder.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextBinder.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.naming; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; + import java.io.File; -import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -102,7 +102,7 @@ this.bindings =3D new ConcurrentHashMap(); this.bindingsStorePath =3D bindingsStorePath; = - if (new File(bindingsStorePath).exists()) + if (PrivilegedFileHelper.exists(new File(bindingsStorePath))) { Map importedRefs =3D readBindings(); for (Entry entry : importedRefs.entrySet()) @@ -179,7 +179,8 @@ protected synchronized void saveBindings() throws FileNotFoundException= , XMLStreamException { XMLOutputFactory outputFactory =3D XMLOutputFactory.newInstance(); - XMLStreamWriter writer =3D outputFactory.createXMLStreamWriter(new F= ileOutputStream(bindingsStorePath), "UTF-8"); + XMLStreamWriter writer =3D + outputFactory.createXMLStreamWriter(PrivilegedFileHelper.fileOutp= utStream(bindingsStorePath), "UTF-8"); = writer.writeStartDocument("UTF-8", "1.0"); writer.writeStartElement(BIND_REFERENCES_ELEMENT); @@ -236,7 +237,8 @@ Map importedRefs =3D new HashMap(); = XMLInputFactory factory =3D XMLInputFactory.newInstance(); - XMLEventReader reader =3D factory.createXMLEventReader(new FileInput= Stream(bindingsStorePath), "UTF-8"); + XMLEventReader reader =3D + factory.createXMLEventReader(PrivilegedFileHelper.fileInputStream= (bindingsStorePath), "UTF-8"); = while (reader.hasNext()) { Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/naming/InitialContextInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/naming/InitialContextInitializer.java 2010-10-27 09:05:21 UTC (rev= 3359) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextInitializer.java 2010-10-28 12:56:43 UTC (rev= 3360) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.naming; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.container.component.ComponentPlugin; import org.exoplatform.container.configuration.ConfigurationException; import org.exoplatform.container.xml.InitParams; @@ -59,8 +60,8 @@ = final public static String BINDINGS_STORE_PATH =3D "bindings-store-path= "; = - final public static String DEFAULT_BINDING_STORE_PATH =3D System.getPro= perty("java.io.tmpdir") + File.separator - + "bind-references.xml"; + final public static String DEFAULT_BINDING_STORE_PATH =3D PrivilegedSys= temHelper.getProperty("java.io.tmpdir") + + File.separator + "bind-references.xml"; = private static Log LOG =3D ExoLogger.getLogger("exo.kernel.component.co= mmon.InitialContextInitializer"); = @@ -93,7 +94,7 @@ Property prop =3D (Property)props.next(); String propName =3D prop.getName(); String propValue =3D prop.getValue(); - String existedProp =3D System.getProperty(propName); + String existedProp =3D PrivilegedSystemHelper.getProperty(prop= Name); if (isMandatory) { setSystemProperty(propName, propValue, propParam.getName()); @@ -130,21 +131,21 @@ = private void setSystemProperty(String propName, String propValue, Strin= g propParamName) { - System.setProperty(propName, propValue); + PrivilegedSystemHelper.setProperty(propName, propValue); if (propName.equals(Context.INITIAL_CONTEXT_FACTORY)) { defaultContextFactory =3D propValue; } - LOG.info("Using mandatory system property: " + propName + " =3D " + = System.getProperty(propName)); + LOG.info("Using mandatory system property: " + propName + " =3D " + = PrivilegedSystemHelper.getProperty(propName)); } = // for out-of-container testing private InitialContextInitializer(String name, Reference reference) thr= ows NamingException, FileNotFoundException, XMLStreamException { - if (System.getProperty(Context.INITIAL_CONTEXT_FACTORY) =3D=3D null) + if (PrivilegedSystemHelper.getProperty(Context.INITIAL_CONTEXT_FACTO= RY) =3D=3D null) { - System.setProperty(Context.INITIAL_CONTEXT_FACTORY, defaultContex= tFactory); + PrivilegedSystemHelper.setProperty(Context.INITIAL_CONTEXT_FACTOR= Y, defaultContextFactory); } initialContext =3D new InitialContext(); initialContext.rebind(name, reference); Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/net/impl/NetServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/net/impl/NetServiceImpl.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/net/impl/NetServiceImpl.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,9 +18,11 @@ */ package org.exoplatform.services.net.impl; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.net.NetService; = import java.net.Socket; +import java.security.PrivilegedExceptionAction; = /** * Created by The eXo Platform SAS Author : HoaPham phamvuxuanhoa(a)yahoo.= com Jan @@ -29,14 +31,20 @@ public class NetServiceImpl implements NetService { = - public long ping(String host, int port) throws Exception + public long ping(final String host, final int port) throws Exception { long startTime =3D 0; long endTime =3D 0; try { startTime =3D System.currentTimeMillis(); - Socket socket =3D new Socket(host, port); + Socket socket =3D SecurityHelper.doPriviledgedExceptionAction(new= PrivilegedExceptionAction() + { + public Socket run() throws Exception + { + return new Socket(host, port); + } + }); endTime =3D System.currentTimeMillis(); } catch (Exception e) Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/rpc/impl/RPCServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/rpc/impl/RPCServiceImpl.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/rpc/impl/RPCServiceImpl.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -19,6 +19,7 @@ package org.exoplatform.services.rpc.impl; = import org.exoplatform.commons.utils.PropertyManager; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.ExoContainer; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.container.configuration.ConfigurationManager; @@ -215,19 +216,39 @@ { throw new IllegalArgumentException("The RPCServiceImpl requires s= ome parameters"); } - URL properties =3D getProperties(params, configManager); + final URL properties =3D getProperties(params, configManager); if (LOG.isInfoEnabled()) { LOG.info("The JGroups configuration used for the RPCServiceImpl w= ill be loaded from " + properties); } + try { - this.configurator =3D ConfiguratorFactory.getStackConfigurator(pr= operties); + this.configurator =3D AccessController.doPrivileged(new Privilege= dExceptionAction() + { + public ProtocolStackConfigurator run() throws Exception + { + return ConfiguratorFactory.getStackConfigurator(properties); + } + }); } - catch (ChannelException e) + catch (PrivilegedActionException pae) { - throw new RuntimeException("Cannot load the JGroups configuration= from " + properties, e); + Throwable cause =3D pae.getCause(); + if (cause instanceof ChannelException) + { + throw new RuntimeException("Cannot load the JGroups configurat= ion from " + properties, cause); + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } } + this.clusterName =3D getClusterName(ctx, params); if (LOG.isDebugEnabled()) { @@ -670,23 +691,36 @@ { security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); } + try { - this.channel =3D new JChannel(configurator); - channel.setOpt(Channel.AUTO_RECONNECT, true); - this.dispatcher =3D new MessageDispatcher(channel, null, this, th= is); - doPriviledgedExceptionAction(new PrivilegedExceptionAction() + AccessController.doPrivileged(new PrivilegedExceptionAction= () { public Void run() throws Exception { + channel =3D new JChannel(configurator); + channel.setOpt(Channel.AUTO_RECONNECT, true); + dispatcher =3D new MessageDispatcher(channel, null, RPCServ= iceImpl.this, RPCServiceImpl.this); channel.connect(clusterName); return null; } }); } - catch (ChannelException e) + catch (PrivilegedActionException pae) { - throw new RuntimeException("Cannot initialize the Channel needed = for the RPCServiceImpl", e); + Throwable cause =3D pae.getCause(); + if (cause instanceof ChannelException) + { + throw new RuntimeException("Cannot initialize the Channel need= ed for the RPCServiceImpl", cause); + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } } finally { @@ -705,6 +739,7 @@ { security.checkPermission(RPCService.ACCESS_RPC_SERVICE_PERMISSION= ); } + this.state =3D State.STOPPED; this.isCoordinator =3D false; if (channel !=3D null && channel.isOpen()) @@ -719,7 +754,15 @@ return null; } }); - channel.close(); + + SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public Void run() + { + channel.close(); + return null; + } + }); channel =3D null; } if (dispatcher !=3D null) @@ -835,33 +878,6 @@ } = /** - * Execute a privilege action - */ - private static E doPriviledgedExceptionAction(PrivilegedExceptionAc= tion action) throws ChannelException - { - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof ChannelException) - { - throw (ChannelException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** * This intern class will be used to = */ public static class MessageBody implements Externalizable Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/scheduler/impl/QuartzSheduler.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/QuartzSheduler.java 2010-10-27 09:05:21 UTC (rev 33= 59) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/scheduler/impl/QuartzSheduler.java 2010-10-28 12:56:43 UTC (rev 33= 60) @@ -25,9 +25,14 @@ import org.exoplatform.services.log.Log; import org.picocontainer.Startable; import org.quartz.Scheduler; +import org.quartz.SchedulerException; import org.quartz.SchedulerFactory; import org.quartz.impl.StdSchedulerFactory; = +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + /** * Created by The eXo Platform SAS Author : Tuan Nguyen * tuan08(a)users.sourceforge.net Dec 13, 2005 @@ -42,8 +47,35 @@ = public QuartzSheduler(ExoContainerContext ctx) throws Exception { - SchedulerFactory sf =3D new StdSchedulerFactory(); - scheduler_ =3D sf.getScheduler(); + final SchedulerFactory sf =3D new StdSchedulerFactory(); + + try + { + scheduler_ =3D AccessController.doPrivileged(new PrivilegedExcept= ionAction() + { + public Scheduler run() throws Exception + { + return sf.getScheduler(); + } + }); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof SchedulerException) + { + throw (SchedulerException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + = // If the scheduler has already been started, it is necessary to put= the scheduler // in standby mode to ensure that the jobs of the ExoContainer won't= launched too early scheduler_.standby(); Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/transaction/impl/jotm/TransactionServiceJotmImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/transaction/impl/jotm/TransactionServiceJotmImpl.java 2010-10-27 0= 9:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/transaction/impl/jotm/TransactionServiceJotmImpl.java 2010-10-28 1= 2:56:43 UTC (rev 3360) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.transaction.impl.jotm; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.xml.InitParams; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -30,6 +31,8 @@ import org.objectweb.jotm.XidImpl; = import java.rmi.RemoteException; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.List; = import javax.transaction.RollbackException; @@ -64,9 +67,36 @@ current =3D Current.getCurrent(); if (current =3D=3D null) { - TransactionFactory tm =3D new TransactionFactoryImpl(); - current =3D new Current(tm); + try + { + SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExce= ptionAction() + { + public Void run() throws Exception + { + TransactionFactory tm =3D new TransactionFactoryImpl(); + current =3D new Current(tm); + return null; + } + }); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof RemoteException) + { + throw (RemoteException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } = + // Change the timeout only if JOTM is not initialized yet if (params !=3D null) { Added: kernel/trunk/exo.kernel.component.common/src/test/resources/test.pol= icy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/test.policy= (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/test/resources/test.policy= 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,27 @@ +grant codeBase "@MAVEN_REPO(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ + permission java.lang.RuntimePermission "accessRPCService"; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons.test/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.container/-"{ + permission java.security.AllPermission; +}; + + + + Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.impl.jboss.v3/pom.xml 2010-= 10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2010-= 10-28 12:56:43 UTC (rev 3360) @@ -39,6 +39,11 @@ org.exoplatform.kernel + exo.kernel.commons.test + test + + + org.exoplatform.kernel exo.kernel.container @@ -54,15 +59,18 @@ slf4j-log4j12 = + + org.apache.maven.plugins maven-surefire-plugin + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.ex= oplatform.commons.test.TestSecurityManager -Djava.security.policy=3D${proje= ct.build.directory}/test-classes/test.policy + some JVM of Linux distributions such as Ubuntu and Fedor= a--> java.net.preferIPv4Stack true @@ -83,6 +91,43 @@ + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + = + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/mai= n/java/org/exoplatform/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.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2010-10-27= 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/AbstractExoCache.java 2010-10-28= 12:56:43 UTC (rev 3360) @@ -25,6 +25,7 @@ import org.exoplatform.services.cache.ExoCache; import org.exoplatform.services.cache.ExoCacheConfig; import org.exoplatform.services.cache.ObjectCacheInfo; +import org.exoplatform.services.cache.impl.jboss.util.PrivilegedCacheHelpe= r; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; @@ -248,7 +249,7 @@ */ protected V putOnly(K key, V value) { - return cache.put(getFqn(key), key, value); + return PrivilegedCacheHelper.put(cache, getFqn(key), key, value); } = /** @@ -280,7 +281,7 @@ total++; } } - cache.endBatch(true); + PrivilegedCacheHelper.endBatch(cache, true); // End transaction for (Map.Entry entry : objs.entrySet()) { @@ -312,7 +313,7 @@ if (node !=3D null) { result =3D node.getDirect((K)name); - if (cache.removeNode(fqn)) + if (PrivilegedCacheHelper.removeNode(cache, fqn)) { onRemove((K)name, result); } Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/mai= n/java/org/exoplatform/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.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2010-10= -27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java 2010-10= -28 12:56:43 UTC (rev 3360) @@ -26,15 +26,15 @@ 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.cache.impl.jboss.util.PrivilegedCacheHelpe= r; 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; import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.Configuration.CacheMode; import org.jboss.cache.config.EvictionConfig; import org.jboss.cache.config.EvictionRegionConfig; -import org.jboss.cache.config.Configuration.CacheMode; = import java.io.Serializable; import java.net.URL; @@ -143,7 +143,8 @@ final String region =3D config.getName(); final String customConfig =3D mappingCacheNameConfig.get(region); Cache cache; - final CacheFactory factory =3D new DefaultCach= eFactory(); + + final CacheFactory factory =3D PrivilegedCache= Helper.createCacheFactory(); final ExoCache eXoCache; try { @@ -152,14 +153,16 @@ // 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); + cache =3D PrivilegedCacheHelper.createCache(factory, configMan= ager.getInputStream(customConfig), 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); + + cache =3D + PrivilegedCacheHelper.createCache(factory, configManager.ge= tInputStream(cacheConfigTemplate), false); if (!config.isDistributed()) { // The cache is local @@ -174,9 +177,9 @@ // Create the cache eXoCache =3D creator.create(config, cache); // Create the cache - cache.create(); + PrivilegedCacheHelper.create(cache); // Start the cache - cache.start(); + PrivilegedCacheHelper.start(cache); } catch (Exception e) { Added: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/j= ava/org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper.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 --- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper.java = (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper.java = 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,275 @@ +/* + * Copyright (C) 2010 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.util; + +import org.jboss.cache.Cache; +import org.jboss.cache.CacheException; +import org.jboss.cache.CacheFactory; +import org.jboss.cache.DefaultCacheFactory; +import org.jboss.cache.Fqn; +import org.jboss.cache.config.ConfigurationException; + +import java.io.InputStream; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +/** + * @author Anatoliy Bazko + * @version $Id: PrivilegedCacheHelper.java 111 2010-11-11 11:11:11Z tolus= ha $ + * + */ +public class PrivilegedCacheHelper +{ + /** + * Start cache in privileged mode. + * = + * @param cache + */ + public static void start(final Cache cache) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Object run() + { + cache.start(); + return null; + } + }; + AccessController.doPrivileged(action); + } + + /** + * Stop cache in privileged mode. + * = + * @param cache + */ + public static void stop(final Cache cache) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Object run() + { + cache.stop(); + return null; + } + }; + AccessController.doPrivileged(action); + } + + /** + * Create cache in privileged mode. + * = + * @param cache + */ + public static void create(final Cache cache) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Object run() + { + cache.create(); + return null; + } + }; + AccessController.doPrivileged(action); + } + + /** + * End batch in privileged mode. + * = + * @param cache + */ + public static void endBatch(final Cache cache, final boole= an successful) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public Object run() + { + cache.endBatch(successful); + return null; + } + }; + AccessController.doPrivileged(action); + } + + /** + * Create cache in privileged mode. + * = + * @param cache + */ + public static Cache createCache(final CacheFactory f= actory, final InputStream is, + final boolean start) + { + PrivilegedExceptionAction> action =3D new PrivilegedExce= ptionAction>() + { + public Cache run() throws Exception + { + return factory.createCache(is, start); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof ConfigurationException) + { + throw (ConfigurationException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Put in cache in privileged mode. + * = + * @param cache + */ + public static V put(final Cache cache, final String fqn, f= inal K key, final V value) + throws CacheException + { + PrivilegedExceptionAction action =3D new PrivilegedExceptionActio= n() + { + public V run() throws Exception + { + return cache.put(fqn, key, value); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof IllegalStateException) + { + throw (IllegalStateException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Remove fomr cache in privileged mode. + * = + * @param cache + */ + public static boolean removeNode(final Cache cache, final = Fqn fqn) throws CacheException + { + PrivilegedExceptionAction action =3D new PrivilegedExceptio= nAction() + { + public Boolean run() throws Exception + { + return cache.removeNode(fqn); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof IllegalStateException) + { + throw (IllegalStateException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Put in cache in privileged mode. + * = + * @param cache + */ + public static V put(final Cache cache, final Fqn fqn, fina= l K key, final V value) throws CacheException + { + PrivilegedExceptionAction action =3D new PrivilegedExceptionActio= n() + { + public V run() throws Exception + { + return cache.put(fqn, key, value); + } + }; + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof IllegalStateException) + { + throw (IllegalStateException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Create cache factory in privileged mode. + * = + * @param cache + */ + public static DefaultCacheFactory createCacheFactory() thr= ows CacheException + { + PrivilegedAction> action =3D new Privilege= dAction>() + { + public DefaultCacheFactory run() + { + return new DefaultCacheFactory(); + } + }; + return AccessController.doPrivileged(action); + } +} Added: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/r= esources/test.policy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.impl.jboss.v3/src/test/reso= urces/test.policy (rev 0) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/reso= urces/test.policy 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,26 @@ +grant codeBase "@MAVEN_REPO(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons.test/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.container/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.component.cache/-"{ + permission java.security.AllPermission; +}; 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 2010-10-27 09:05:21 UTC (rev = 3359) +++ kernel/trunk/exo.kernel.container/pom.xml 2010-10-28 12:56:43 UTC (rev = 3360) @@ -23,6 +23,11 @@ exo.kernel.commons + org.exoplatform.kernel + exo.kernel.commons.test + test + + org.exoplatform.tool exo.tool.framework.junit @@ -75,6 +80,13 @@ + org.apache.maven.plugins + maven-surefire-plugin + + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.ex= oplatform.commons.test.TestSecurityManager -Djava.security.policy=3D${proje= ct.build.directory}/test-classes/test.policy + + + org.jibx maven-jibx-plugin @@ -91,10 +103,43 @@ - + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + = + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + - \ No newline at end of file + 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 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/PortalContainer.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -19,6 +19,7 @@ package org.exoplatform.container; = import org.exoplatform.commons.utils.PropertyManager; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.RootContainer.PortalContainerInitTask; import org.exoplatform.container.definition.PortalContainerConfig; import org.exoplatform.container.jmx.MX4JComponentAdapterFactory; @@ -31,6 +32,7 @@ import org.exoplatform.management.jmx.annotations.Property; import org.exoplatform.management.rest.annotations.RESTEndpoint; = +import java.security.PrivilegedAction; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; @@ -161,7 +163,13 @@ this.webAppContexts =3D Collections.singleton(new WebAppInitContext(= portalContext)); this.portalContext =3D portalContext; this.portalMergedContext =3D new PortalContainerContext(this); - this.portalMergedClassLoader =3D new PortalContainerClassLoader(this= ); + this.portalMergedClassLoader =3D SecurityHelper.doPriviledgedAction(= new PrivilegedAction() + { + public ClassLoader run() + { + return new PortalContainerClassLoader(PortalContainer.this); + } + }); this.webAppClassLoaders =3D Collections.unmodifiableMap(Collections.= singletonMap(name, portalMergedClassLoader)); } = @@ -195,8 +203,8 @@ if (cl =3D=3D null) { cl =3D - new UnifiedClassLoader(new ClassLoader[]{Thread.currentT= hread().getContextClassLoader(), - portalMergedClassLoader}); + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedM= ode(new ClassLoader[]{ + Thread.currentThread().getContextClassLoader(), porta= lMergedClassLoader}); Map cls =3D new HashMap(webAppClassLoaders); cls.put(contextName, cl); this.webAppClassLoaders =3D Collections.unmodifiableMap(cls= ); @@ -615,12 +623,14 @@ return started_; } = + @Override public void start() { super.start(); started_ =3D true; } = + @Override public void stop() { super.stop(); 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 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/RootContainer.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,7 +18,10 @@ */ package org.exoplatform.container; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.commons.utils.PropertyManager; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.container.configuration.ConfigurationManagerImpl; import org.exoplatform.container.configuration.MockConfigurationManagerImp= l; @@ -38,6 +41,7 @@ import org.exoplatform.test.mocks.servlet.MockServletContext; = import java.io.File; +import java.security.PrivilegedAction; import java.util.Collection; import java.util.Comparator; import java.util.HashSet; @@ -110,7 +114,14 @@ log.info("Active profiles " + profiles); = // - Runtime.getRuntime().addShutdownHook(new ShutdownThread(this)); + SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public Void run() + { + Runtime.getRuntime().addShutdownHook(new ShutdownThread(RootCo= ntainer.this)); + return null; + } + }); this.profiles =3D profiles; this.registerComponentInstance(J2EEServerInfo.class, serverenv_); } @@ -409,14 +420,14 @@ RootContainer rootContainer =3D new RootContainer(); ConfigurationManagerImpl service =3D new ConfigurationManagerImpl= (rootContainer.profiles); service.addConfiguration(ContainerUtil.getConfigurationURL("conf/= configuration.xml")); - if (System.getProperty("maven.exoplatform.dir") !=3D null) + if (PrivilegedSystemHelper.getProperty("maven.exoplatform.dir") != =3D null) { service.addConfiguration(ContainerUtil.getConfigurationURL("co= nf/test-configuration.xml")); } String confDir =3D rootContainer.getServerEnvironment().getExoCon= figurationDirectory(); String overrideConf =3D confDir + "/configuration.xml"; File file =3D new File(overrideConf); - if (file.exists()) + if (PrivilegedFileHelper.exists(file)) { service.addConfiguration("file:" + overrideConf); } @@ -644,12 +655,14 @@ container_ =3D container; } = + @Override public void run() { container_.stop(); } } = + @Override public void stop() { super.stop(); Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/StandaloneContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/StandaloneContainer.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/StandaloneContainer.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,6 +18,7 @@ */ package org.exoplatform.container; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.container.configuration.ConfigurationException; import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.container.configuration.ConfigurationManagerImpl; @@ -143,7 +144,7 @@ if (components !=3D null) container.registerArray(components); container.start(); - System.setProperty("exo.standalone-container", StandaloneContaine= r.class.getName()); + PrivilegedSystemHelper.setProperty("exo.standalone-container", St= andaloneContainer.class.getName()); System.out.println("StandaloneContainer initialized using: " + c= onfigurationURL); } return container; @@ -285,6 +286,7 @@ /** * {@inheritDoc} */ + @Override public void stop() { super.stop(); Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/UnifiedClassLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/UnifiedClassLoader.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/UnifiedClassLoader.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,8 +18,11 @@ */ package org.exoplatform.container; = +import org.exoplatform.commons.utils.SecurityHelper; + import java.io.IOException; import java.net.URL; +import java.security.PrivilegedAction; import java.util.Collections; import java.util.Enumeration; import java.util.LinkedHashSet; @@ -55,6 +58,7 @@ UnifiedClassLoader(ClassLoader... cls) { super(Thread.currentThread().getContextClassLoader()); + if (cls =3D=3D null || cls.length =3D=3D 0) { throw new IllegalArgumentException("The array of ClassLoader cann= ot be empty"); @@ -109,4 +113,15 @@ } return Collections.enumeration(urls); } + + static protected UnifiedClassLoader createUnifiedClassLoaderInPrivilege= dMode(final ClassLoader... cls) + { + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public UnifiedClassLoader run() + { + return new UnifiedClassLoader(cls); + } + }); + } } Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/configuration/ConfigurationManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ConfigurationManager.java 2010-10-27 09:05:21 UTC (rev 335= 9) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/configuration/ConfigurationManager.java 2010-10-28 12:56:43 UTC (rev 336= 0) @@ -18,6 +18,7 @@ */ package org.exoplatform.container.configuration; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.container.xml.Component; import org.exoplatform.container.xml.Configuration; = @@ -44,7 +45,7 @@ * Constant that indicates whether the logger of the configuration * must be in debug more or not. */ - public static final boolean LOG_DEBUG =3D System.getProperty(LOG_DEBUG_= PROPERTY) !=3D null; + public static final boolean LOG_DEBUG =3D PrivilegedSystemHelper.getPro= perty(LOG_DEBUG_PROPERTY) !=3D null; = public Configuration getConfiguration(); = 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 2010-10-27 09:05:21 UTC (re= v 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/configuration/ConfigurationUnmarshaller.java 2010-10-28 12:56:43 UTC (re= v 3360) @@ -19,23 +19,29 @@ package org.exoplatform.container.configuration; = import org.exoplatform.commons.utils.PropertyManager; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.xml.Configuration; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jibx.runtime.BindingDirectory; import org.jibx.runtime.IBindingFactory; import org.jibx.runtime.IUnmarshallingContext; +import org.jibx.runtime.JiBXException; import org.w3c.dom.Document; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; = import java.io.IOException; +import java.io.InputStream; import java.io.StringReader; import java.io.StringWriter; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.Collections; import java.util.Set; = @@ -45,6 +51,9 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactoryConfigurationError; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXResult; import javax.xml.transform.sax.SAXTransformerFactory; @@ -66,7 +75,7 @@ * A private copy of the list of kernel namespaces */ private static final String[] KERNEL_NAMESPACES =3D Namespaces.getKerne= lNamespaces(); - = + private class Reporter implements ErrorHandler { = @@ -89,15 +98,14 @@ { if (exception.getMessage().equals("cvc-elt.1: Cannot find the dec= laration of element 'configuration'.")) { - log - .info("The document " - + url - + " does not contain a schema declaration, it should hav= e an " - + "XML declaration similar to\n" - + ""); + log.info("The document " + + url + + " does not contain a schema declaration, it should have a= n " + + "XML declaration similar to\n" + + ""); } else { @@ -137,9 +145,9 @@ * @throws IOException any IOException thrown by using the provided URL * @throws NullPointerException if the provided URL is null */ - public boolean isValid(URL url) throws NullPointerException, IOException + public boolean isValid(final URL url) throws NullPointerException, IOEx= ception { - DocumentBuilderFactory factory =3D DocumentBuilderFactory.newInstanc= e(); + final DocumentBuilderFactory factory =3D DocumentBuilderFactory.newI= nstance(); factory .setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLang= uage", "http://www.w3.org/2001/XMLSchema"); factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schema= Source", KERNEL_NAMESPACES); @@ -148,11 +156,44 @@ = try { - DocumentBuilder builder =3D factory.newDocumentBuilder(); + DocumentBuilder builder =3D null; + try + { + builder =3D AccessController.doPrivileged(new PrivilegedExcept= ionAction() + { + public DocumentBuilder run() throws Exception + { + return factory.newDocumentBuilder(); + } + }); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof ParserConfigurationException) + { + throw (ParserConfigurationException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + = Reporter reporter =3D new Reporter(url); builder.setErrorHandler(reporter); builder.setEntityResolver(Namespaces.resolver); - builder.parse(url.openStream()); + builder.parse(SecurityHelper.doPriviledgedIOExceptionAction(new P= rivilegedExceptionAction() + { + public InputStream run() throws Exception + { + return url.openStream(); + } + })); return reporter.valid; } catch (ParserConfigurationException e) @@ -167,7 +208,7 @@ } } = - public Configuration unmarshall(URL url) throws Exception + public Configuration unmarshall(final URL url) throws Exception { if (PropertyManager.isDevelopping()) { @@ -218,39 +259,95 @@ = // factory.setNamespaceAware(true); - DocumentBuilder builder =3D factory.newDocumentBuilder(); - Document doc =3D builder.parse(url.openStream()); = - // Filter DOM - ProfileDOMFilter filter =3D new ProfileDOMFilter(profiles); - filter.process(doc.getDocumentElement()); + final DocumentBuilderFactory builderFactory =3D factory; + try + { + return AccessController.doPrivileged(new PrivilegedExceptionActio= n() + { + public Configuration run() throws Exception + { + DocumentBuilder builder =3D builderFactory.newDocumentBuild= er(); + Document doc =3D builder.parse(url.openStream()); = - // SAX event stream -> String - StringWriter buffer =3D new StringWriter(); - SAXTransformerFactory tf =3D (SAXTransformerFactory)SAXTransformerFa= ctory.newInstance(); - TransformerHandler hd =3D tf.newTransformerHandler(); - StreamResult result =3D new StreamResult(buffer); - hd.setResult(result); - Transformer serializer =3D tf.newTransformer(); - serializer.setOutputProperty(OutputKeys.ENCODING, "UTF8"); - serializer.setOutputProperty(OutputKeys.INDENT, "yes"); + // Filter DOM + ProfileDOMFilter filter =3D new ProfileDOMFilter(profiles); + filter.process(doc.getDocumentElement()); = - // Transform -> SAX event stream - SAXResult saxResult =3D new SAXResult(new NoKernelNamespaceSAXFilter= (hd)); + // SAX event stream -> String + StringWriter buffer =3D new StringWriter(); + SAXTransformerFactory tf =3D (SAXTransformerFactory)SAXTran= sformerFactory.newInstance(); + TransformerHandler hd =3D tf.newTransformerHandler(); + StreamResult result =3D new StreamResult(buffer); + hd.setResult(result); + Transformer serializer =3D tf.newTransformer(); + serializer.setOutputProperty(OutputKeys.ENCODING, "UTF8"); + serializer.setOutputProperty(OutputKeys.INDENT, "yes"); = - // DOM -> Transform - serializer.transform(new DOMSource(doc), saxResult); + // Transform -> SAX event stream + SAXResult saxResult =3D new SAXResult(new NoKernelNamespace= SAXFilter(hd)); = - // Reuse the parsed document - String document =3D buffer.toString(); + // DOM -> Transform + serializer.transform(new DOMSource(doc), saxResult); = - // Debug - if (log.isTraceEnabled()) - log.trace("About to parse configuration file " + document); + // Reuse the parsed document + String document =3D buffer.toString(); = - // - IBindingFactory bfact =3D BindingDirectory.getFactory(Configuration.= class); - IUnmarshallingContext uctx =3D bfact.createUnmarshallingContext(); - return (Configuration)uctx.unmarshalDocument(new StringReader(docume= nt), null); + // Debug + if (log.isTraceEnabled()) + log.trace("About to parse configuration file " + documen= t); + + // + IBindingFactory bfact =3D BindingDirectory.getFactory(Confi= guration.class); + IUnmarshallingContext uctx =3D bfact.createUnmarshallingCon= text(); + + return (Configuration)uctx.unmarshalDocument(new StringRead= er(document), null); + } + }); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof JiBXException) + { + throw (JiBXException)cause; + } + else if (cause instanceof ParserConfigurationException) + { + throw (ParserConfigurationException)cause; + } + else if (cause instanceof IOException) + { + throw (IOException)cause; + } + else if (cause instanceof SAXException) + { + throw (SAXException)cause; + } + else if (cause instanceof IllegalArgumentException) + { + throw (IllegalArgumentException)cause; + } + else if (cause instanceof TransformerException) + { + throw (TransformerException)cause; + } + else if (cause instanceof TransformerConfigurationException) + { + throw (TransformerConfigurationException)cause; + } + else if (cause instanceof TransformerFactoryConfigurationError) + { + throw (TransformerFactoryConfigurationError)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } } } Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/configuration/EntityResolverImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/EntityResolverImpl.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/configuration/EntityResolverImpl.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -19,6 +19,7 @@ package org.exoplatform.container.configuration; = import org.exoplatform.commons.utils.IOUtil; +import org.exoplatform.commons.utils.SecurityHelper; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -26,6 +27,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.security.PrivilegedAction; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -64,10 +66,17 @@ // if (data =3D=3D null) { - String path =3D systemIdToResourcePath.get(systemId); + final String path =3D systemIdToResourcePath.get(systemId); if (path !=3D null) { - InputStream in =3D loader.getResourceAsStream(path); + InputStream in =3D SecurityHelper.doPriviledgedAction(new P= rivilegedAction() + { + public InputStream run() + { + return loader.getResourceAsStream(path); + } + }); + if (in !=3D null) { data =3D IOUtil.getStreamContentAsBytes(in); Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/configuration/MockConfigurationManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/MockConfigurationManagerImpl.java 2010-10-27 09:05:21 UTC = (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/configuration/MockConfigurationManagerImpl.java 2010-10-28 12:56:43 UTC = (rev 3360) @@ -18,6 +18,7 @@ */ package org.exoplatform.container.configuration; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.container.ExoContainer; = import java.net.URL; @@ -39,9 +40,10 @@ public MockConfigurationManagerImpl(ServletContext context) throws Exce= ption { super(context, ExoContainer.getProfiles()); - confDir_ =3D System.getProperty("mock.portal.dir") + "/WEB-INF"; + confDir_ =3D PrivilegedSystemHelper.getProperty("mock.portal.dir") += "/WEB-INF"; } = + @Override public URL getURL(String uri) throws Exception { if (uri.startsWith("jar:")) Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/definition/PortalContainerConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/definition/PortalContainerConfig.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/definition/PortalContainerConfig.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,6 +18,7 @@ */ package org.exoplatform.container.definition; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.commons.utils.PropertyManager; import org.exoplatform.container.PortalContainer; import org.exoplatform.container.PropertyConfigurator; @@ -977,7 +978,7 @@ serverInfo.getExoConfigurationDirectory() + "/portal/" + (i= sPath4DefaultPCD ? "" : def.getName() + "/") + path; File file =3D new File(fullPath); - if (file.exists()) + if (PrivilegedFileHelper.exists(file)) { // The file exists so we will use it url =3D file.toURI().toURL(); Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/monitor/jvm/J2EEServerInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/monitor/jvm/J2EEServerInfo.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/monitor/jvm/J2EEServerInfo.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,6 +18,8 @@ */ package org.exoplatform.container.monitor.jvm; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = @@ -25,6 +27,8 @@ import java.lang.management.ManagementFactory; import java.lang.reflect.Method; import java.net.URI; +import java.security.PrivilegedAction; +import java.security.PrivilegedExceptionAction; = import javax.management.MBeanServer; = @@ -67,16 +71,16 @@ public J2EEServerInfo() { = - String jonasHome =3D System.getProperty("jonas.base"); - String jbossHome =3D System.getProperty("jboss.home.dir"); - String jettyHome =3D System.getProperty("jetty.home"); - String websphereHome =3D System.getProperty("was.install.root"); - String weblogicHome =3D System.getProperty("wls.home"); - String catalinaHome =3D System.getProperty("catalina.home"); - String testHome =3D System.getProperty("maven.exoplatform.dir"); + String jonasHome =3D PrivilegedSystemHelper.getProperty("jonas.base"= ); + String jbossHome =3D PrivilegedSystemHelper.getProperty("jboss.home.= dir"); + String jettyHome =3D PrivilegedSystemHelper.getProperty("jetty.home"= ); + String websphereHome =3D PrivilegedSystemHelper.getProperty("was.ins= tall.root"); + String weblogicHome =3D PrivilegedSystemHelper.getProperty("wls.home= "); + String catalinaHome =3D PrivilegedSystemHelper.getProperty("catalina= .home"); + String testHome =3D PrivilegedSystemHelper.getProperty("maven.exopla= tform.dir"); = // The name of the configuration directory - final String confDirName =3D System.getProperty(EXO_CONF_DIR_NAME_PA= RAM, "exo-conf"); + final String confDirName =3D PrivilegedSystemHelper.getProperty(EXO_= CONF_DIR_NAME_PARAM, "exo-conf"); if (jonasHome !=3D null) { serverName_ =3D "jonas"; @@ -90,7 +94,7 @@ = // try find and use jboss.server.config.url // based on http://www.jboss.org/community/docs/DOC-10730 - String jbossConfigUrl =3D System.getProperty("jboss.server.config= .url"); + String jbossConfigUrl =3D PrivilegedSystemHelper.getProperty("jbo= ss.server.config.url"); if (jbossConfigUrl !=3D null) { try @@ -109,8 +113,15 @@ // try { - Class clazz =3D - Thread.currentThread().getContextClassLoader().loadClass("o= rg.jboss.mx.util.MBeanServerLocator"); + Class clazz =3D SecurityHelper.doPriviledgedExceptionAction(ne= w PrivilegedExceptionAction() + { + public Class run() throws Exception + { + return Thread.currentThread().getContextClassLoader() + .loadClass("org.jboss.mx.util.MBeanServerLocator"); + } + }); + Method m =3D clazz.getMethod("locateJBoss"); mbeanServer =3D (MBeanServer)m.invoke(null); } @@ -154,15 +165,21 @@ { // throw new UnsupportedOperationException("unknown server platfo= rm") ; serverName_ =3D "standalone"; - serverHome_ =3D System.getProperty("user.dir"); + serverHome_ =3D PrivilegedSystemHelper.getProperty("user.dir"); exoConfDir_ =3D serverHome_ + "/" + confDirName; } if (mbeanServer =3D=3D null) { - mbeanServer =3D ManagementFactory.getPlatformMBeanServer(); + mbeanServer =3D SecurityHelper.doPriviledgedAction(new Privileged= Action() + { + public MBeanServer run() + { + return ManagementFactory.getPlatformMBeanServer(); + } + }); } = - String exoConfHome =3D System.getProperty(EXO_CONF_PARAM); + String exoConfHome =3D PrivilegedSystemHelper.getProperty(EXO_CONF_P= ARAM); if (exoConfHome !=3D null && exoConfHome.length() > 0) { log.info("Override exo-conf directory '" + exoConfDir_ + "' with = location '" + exoConfHome Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/monitor/jvm/JVMRuntimeInfoImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/monitor/jvm/JVMRuntimeInfoImpl.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/monitor/jvm/JVMRuntimeInfoImpl.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -19,12 +19,15 @@ package org.exoplatform.container.monitor.jvm; = import org.exoplatform.commons.utils.ExoProperties; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.PropertiesParam; import org.picocontainer.Startable; = import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; +import java.security.PrivilegedAction; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -51,89 +54,185 @@ while (i.hasNext()) { Map.Entry entry =3D (Map.Entry)i.next(); - System.setProperty((String)entry.getKey(), (String)entry.getVa= lue()); + PrivilegedSystemHelper.setProperty((String)entry.getKey(), (St= ring)entry.getValue()); } } } = public String getName() { - return mxbean_.getName(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getName(); + } + }); } = public String getSpecName() { - return mxbean_.getSpecName(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getSpecName(); + } + }); } = public String getSpecVendor() { - return mxbean_.getSpecVendor(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getSpecVendor(); + } + }); } = public String getSpecVersion() { - return mxbean_.getSpecVersion(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getSpecVersion(); + } + }); } = public String getManagementSpecVersion() { - return mxbean_.getManagementSpecVersion(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getManagementSpecVersion(); + } + }); } = public String getVmName() { - return mxbean_.getVmName(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getVmName(); + } + }); } = public String getVmVendor() { - return mxbean_.getVmVendor(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getVmVendor(); + } + }); } = public String getVmVersion() { - return mxbean_.getVmVersion(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getVmVersion(); + } + }); } = public List getInputArguments() { - return mxbean_.getInputArguments(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction= () + { + public List run() + { + return mxbean_.getInputArguments(); + } + }); } = public Map getSystemProperties() { - return mxbean_.getSystemProperties(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public Map run() + { + return mxbean_.getSystemProperties(); + } + }); } = public boolean getBootClassPathSupported() { - return mxbean_.isBootClassPathSupported(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public Boolean run() + { + return mxbean_.isBootClassPathSupported(); + } + }); } = public String getBootClassPath() { - return mxbean_.getBootClassPath(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getBootClassPath(); + } + }); } = public String getClassPath() { - return mxbean_.getClassPath(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getClassPath(); + } + }); } = public String getLibraryPath() { - return mxbean_.getLibraryPath(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public String run() + { + return mxbean_.getLibraryPath(); + } + }); } = public long getStartTime() { - return mxbean_.getStartTime(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction= () + { + public Long run() + { + return mxbean_.getStartTime(); + } + }); } = public long getUptime() { - return mxbean_.getUptime(); + return SecurityHelper.doPriviledgedAction(new PrivilegedAction= () + { + public Long run() + { + return mxbean_.getUptime(); + } + }); } = public boolean isManagementSupported() @@ -144,7 +243,7 @@ public String getSystemPropertiesAsText() { StringBuffer b =3D new StringBuffer(); - Iterator i =3D System.getProperties().entrySet().iterator(); + Iterator i =3D PrivilegedSystemHelper.getProperties().entrySet().ite= rator(); while (i.hasNext()) { Map.Entry entry =3D (Map.Entry)i.next(); @@ -161,6 +260,7 @@ { } = + @Override public String toString() { StringBuilder b =3D new StringBuilder(); Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/util/ContainerUtil.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/ContainerUtil.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/util/ContainerUtil.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -19,6 +19,7 @@ package org.exoplatform.container.util; = import org.exoplatform.commons.utils.PropertiesLoader; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.commons.utils.Tools; import org.exoplatform.container.ExoContainer; import org.exoplatform.container.configuration.ConfigurationManager; @@ -34,6 +35,7 @@ import java.io.InputStream; import java.lang.reflect.Constructor; import java.net.URL; +import java.security.PrivilegedExceptionAction; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -70,10 +72,18 @@ return constructors; } = - static public Collection getConfigurationURL(String configuration)= throws Exception + static public Collection getConfigurationURL(final String configur= ation) throws Exception { - ClassLoader cl =3D Thread.currentThread().getContextClassLoader(); - Collection c =3D Collections.list(cl.getResources(configuration)); + final ClassLoader cl =3D Thread.currentThread().getContextClassLoade= r(); + + Collection c =3D SecurityHelper.doPriviledgedIOExceptionAction(new P= rivilegedExceptionAction() + { + public Collection run() throws IOException + { + return Collections.list(cl.getResources(configuration)); + } + }); + Map map =3D new HashMap(); Iterator i =3D c.iterator(); while (i.hasNext()) Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/xml/Deserializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/Deserializer.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/xml/Deserializer.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,6 +18,7 @@ */ package org.exoplatform.container.xml; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.container.ExoContainer; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.container.PortalContainer; @@ -265,7 +266,7 @@ { // No value could be found so far, thus we try to get= it from the = // system properties - value =3D System.getProperty(key); = = + value =3D PrivilegedSystemHelper.getProperty(key); } } if (value !=3D null) Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/m= anagement/jmx/impl/JMXManagementProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/managem= ent/jmx/impl/JMXManagementProvider.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/managem= ent/jmx/impl/JMXManagementProvider.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,12 +18,16 @@ */ package org.exoplatform.management.jmx.impl; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.management.jmx.annotations.NameTemplate; import org.exoplatform.management.spi.ManagedResource; import org.exoplatform.management.spi.ManagementProvider; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.Hashtable; import java.util.List; import java.util.Map; @@ -139,7 +143,7 @@ return null; = } = - private void attemptToRegister(ObjectName name, Object mbean) + private void attemptToRegister(final ObjectName name, final Object mbea= n) { synchronized (server) { @@ -151,7 +155,14 @@ } try { - server.unregisterMBean(name); = + SecurityHelper.doPriviledgedExceptionAction(new PrivilegedE= xceptionAction() + { + public Void run() throws Exception + { + server.unregisterMBean(name); + return null; + } + }); } catch (Exception e) { @@ -160,7 +171,14 @@ } try { - server.registerMBean(mbean, name); + AccessController.doPrivileged(new PrivilegedExceptionAction() + { + public Void run() throws Exception + { + server.registerMBean(mbean, name); + return null; + } + }); } catch (Exception e) { @@ -171,10 +189,40 @@ = public void unmanage(Object key) { - ObjectName name =3D (ObjectName)key; + final ObjectName name =3D (ObjectName)key; try { - server.unregisterMBean(name); + try + { + AccessController.doPrivileged(new PrivilegedExceptionAction() + { + public Void run() throws Exception + { + server.unregisterMBean(name); + return null; + } + }); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof InstanceNotFoundException) + { + throw (InstanceNotFoundException)cause; + } + else if (cause instanceof MBeanRegistrationException) + { + throw (MBeanRegistrationException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } } catch (InstanceNotFoundException e) { Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/x= ml/object/XMLCollection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/obj= ect/XMLCollection.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/xml/obj= ect/XMLCollection.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,7 +18,6 @@ */ package org.exoplatform.xml.object; = -import org.jibx.runtime.BindingDirectory; import org.jibx.runtime.IBindingFactory; import org.jibx.runtime.IMarshallingContext; import org.jibx.runtime.IUnmarshallingContext; @@ -93,7 +92,7 @@ = public byte[] toByteArray(String encoding) throws Exception { - IBindingFactory bfact =3D BindingDirectory.getFactory(XMLObject.clas= s); + IBindingFactory bfact =3D XMLObject.getBindingFactoryInPriviledgedMo= de(XMLObject.class); IMarshallingContext mctx =3D bfact.createMarshallingContext(); mctx.setIndent(2); ByteArrayOutputStream os =3D new ByteArrayOutputStream(); @@ -103,7 +102,7 @@ = static public XMLCollection getXMLCollection(InputStream is) throws Exc= eption { - IBindingFactory bfact =3D BindingDirectory.getFactory(XMLObject.clas= s); + IBindingFactory bfact =3D XMLObject.getBindingFactoryInPriviledgedMo= de(XMLObject.class); IUnmarshallingContext uctx =3D bfact.createUnmarshallingContext(); return (XMLCollection)uctx.unmarshalDocument(is, null); } Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/x= ml/object/XMLObject.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/obj= ect/XMLObject.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/xml/obj= ect/XMLObject.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -18,15 +18,21 @@ */ package org.exoplatform.xml.object; = +import org.exoplatform.commons.utils.SecurityHelper; import org.jibx.runtime.BindingDirectory; import org.jibx.runtime.IBindingFactory; import org.jibx.runtime.IMarshallingContext; import org.jibx.runtime.IUnmarshallingContext; +import org.jibx.runtime.JiBXException; = import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -143,6 +149,7 @@ addField(new XMLField(name, fieldType, obj)); } = + @Override public String toString() { StringBuffer b =3D new StringBuffer(); @@ -197,7 +204,7 @@ = public byte[] toByteArray(String encoding) throws Exception { - IBindingFactory bfact =3D BindingDirectory.getFactory(XMLObject.clas= s); + IBindingFactory bfact =3D getBindingFactoryInPriviledgedMode(XMLObje= ct.class); IMarshallingContext mctx =3D bfact.createMarshallingContext(); mctx.setIndent(2); ByteArrayOutputStream os =3D new ByteArrayOutputStream(); @@ -207,7 +214,7 @@ = static public XMLObject getXMLObject(InputStream is) throws Exception { - IBindingFactory bfact =3D BindingDirectory.getFactory(XMLObject.clas= s); + IBindingFactory bfact =3D getBindingFactoryInPriviledgedMode(XMLObje= ct.class); IUnmarshallingContext uctx =3D bfact.createUnmarshallingContext(); XMLObject xmlobject =3D (XMLObject)uctx.unmarshalDocument(is, "UTF-8= "); return xmlobject; @@ -243,8 +250,49 @@ int modifier =3D field[i].getModifiers(); if (Modifier.isStatic(modifier) || Modifier.isTransient(modifier)) continue; - field[i].setAccessible(true); + = + final Field fld =3D field[i]; + + SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public Void run() + { + fld.setAccessible(true); + return null; + } + }); + fields.put(field[i].getName(), field[i]); } } + + static protected IBindingFactory getBindingFactoryInPriviledgedMode(fin= al Class clazz) throws JiBXException + { + try + { + return AccessController.doPrivileged(new PrivilegedExceptionActio= n() + { + public IBindingFactory run() throws Exception + { + return BindingDirectory.getFactory(clazz); + } + }); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof JiBXException) + { + throw (JiBXException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } } Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/TestUnifiedClassLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/TestUnifiedClassLoader.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/TestUnifiedClassLoader.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -39,7 +39,7 @@ { try { - new UnifiedClassLoader(); + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(); fail("An IllegalArgumentException is expected"); } catch (IllegalArgumentException e) @@ -47,7 +47,7 @@ } try { - new UnifiedClassLoader(new ClassLoader[0]); + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[0]); fail("An IllegalArgumentException is expected"); } catch (IllegalArgumentException e) @@ -57,61 +57,95 @@ = public void testGetResource() throws Exception { - UnifiedClassLoader mcl =3D new UnifiedClassLoader(new ClassLoader[]{= new MockClassLoader(null, null), new MockClassLoader(null, null)}); + UnifiedClassLoader mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{new MockClassLoader(null, null), + new MockClassLoader(null, null)}); assertNull(mcl.getResource(null)); URL result =3D new URL("file:///foo"); - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, null), new MockClassLoader(result, null)}); - assertEquals(result, mcl.getResource(null)); = - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (result, null), new MockClassLoader(null, null)}); - assertEquals(result, mcl.getResource(null)); = - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (new URL("file:///foo2"), null), new MockClassLoader(result, null)}); - assertEquals(result, mcl.getResource(null)); = + = + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{new MockClassLoader(null, null), + new MockClassLoader(result, null)}); + assertEquals(result, mcl.getResource(null)); + + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{new MockClassLoader(result, null), + new MockClassLoader(null, null)}); + assertEquals(result, mcl.getResource(null)); + + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{ + new MockClassLoader(new URL("file:///foo2"), null), new MockCl= assLoader(result, null)}); + assertEquals(result, mcl.getResource(null)); } = public void testGetResources() throws Exception { - UnifiedClassLoader mcl =3D new UnifiedClassLoader(new ClassLoader[]{= new MockClassLoader(null, Collections.enumeration(new ArrayList())), n= ew MockClassLoader(null, Collections.enumeration(new ArrayList()))}); + UnifiedClassLoader mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{ + new MockClassLoader(null, Collections.enumeration(new ArrayLis= t())), + new MockClassLoader(null, Collections.enumeration(new ArrayLis= t()))}); Enumeration eResult =3D mcl.getResources(null); assertNotNull(eResult); assertFalse(eResult.hasMoreElements()); - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, null), new MockClassLoader(null, null)}); + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{new MockClassLoader(null, null), + new MockClassLoader(null, null)}); eResult =3D mcl.getResources(null); assertNotNull(eResult); assertFalse(eResult.hasMoreElements()); - URL result =3D new URL("file:///foo"); - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, Collections.enumeration(Arrays.asList(result))), new MockClassLoader= (null, Collections.enumeration(new ArrayList()))}); + final URL result =3D new URL("file:///foo"); + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{ + new MockClassLoader(null, Collections.enumeration(Arrays.asLis= t(result))), + new MockClassLoader(null, Collections.enumeration(new ArrayLis= t()))}); eResult =3D mcl.getResources(null); assertNotNull(eResult); assertTrue(eResult.hasMoreElements()); assertEquals(result, eResult.nextElement()); assertFalse(eResult.hasMoreElements()); - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, Collections.enumeration(Arrays.asList(result))), new MockClassLoader= (null, null)}); + mcl =3D + UnifiedClassLoader + .createUnifiedClassLoaderInPrivilegedMode(new ClassLoader[]{ + new MockClassLoader(null, Collections.enumeration(Arrays.as= List(result))), + new MockClassLoader(null, null)}); eResult =3D mcl.getResources(null); assertNotNull(eResult); assertTrue(eResult.hasMoreElements()); assertEquals(result, eResult.nextElement()); assertFalse(eResult.hasMoreElements()); - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, Collections.enumeration(new ArrayList())), new MockClassLoader(= null, Collections.enumeration(Arrays.asList(result)))}); + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{ + new MockClassLoader(null, Collections.enumeration(new ArrayLis= t())), + new MockClassLoader(null, Collections.enumeration(Arrays.asLis= t(result)))}); eResult =3D mcl.getResources(null); assertNotNull(eResult); assertTrue(eResult.hasMoreElements()); assertEquals(result, eResult.nextElement()); assertFalse(eResult.hasMoreElements()); - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, null), new MockClassLoader(null, Collections.enumeration(Arrays.asLi= st(result)))}); + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{new MockClassLoader(null, null), + new MockClassLoader(null, Collections.enumeration(Arrays.asLis= t(result)))}); eResult =3D mcl.getResources(null); assertNotNull(eResult); assertTrue(eResult.hasMoreElements()); assertEquals(result, eResult.nextElement()); assertFalse(eResult.hasMoreElements()); - URL result1 =3D new URL("file:///foo"); = - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, Collections.enumeration(Arrays.asList(result))), new MockClassLoader= (null, Collections.enumeration(Arrays.asList(result1)))}); + final URL result1 =3D new URL("file:///foo"); + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{ + new MockClassLoader(null, Collections.enumeration(Arrays.asLis= t(result))), + new MockClassLoader(null, Collections.enumeration(Arrays.asLis= t(result1)))}); eResult =3D mcl.getResources(null); assertNotNull(eResult); assertTrue(eResult.hasMoreElements()); assertEquals(result, eResult.nextElement()); assertFalse(eResult.hasMoreElements()); - URL result2 =3D new URL("file:///foo2"); - mcl =3D new UnifiedClassLoader(new ClassLoader[]{new MockClassLoader= (null, Collections.enumeration(Arrays.asList(result))), new MockClassLoader= (null, Collections.enumeration(Arrays.asList(result2)))}); + final URL result2 =3D new URL("file:///foo2"); + mcl =3D + UnifiedClassLoader.createUnifiedClassLoaderInPrivilegedMode(new C= lassLoader[]{ + new MockClassLoader(null, Collections.enumeration(Arrays.asLis= t(result))), + new MockClassLoader(null, Collections.enumeration(Arrays.asLis= t(result2)))}); eResult =3D mcl.getResources(null); assertNotNull(eResult); assertTrue(eResult.hasMoreElements()); @@ -134,11 +168,13 @@ this.getResourcesResult =3D getResourcesResult; } = + @Override public URL getResource(String name) { return getResourceResult; } = + @Override public Enumeration getResources(String name) { return getResourcesResult; Copied: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/con= tainer/jmx/AbstractExoMBeanTest.java (from rev 3344, kernel/trunk/exo.kerne= l.container/src/test/java/org/exoplatform/container/jmx/AbstractTestExoMBea= n.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/jmx/AbstractExoMBeanTest.java (rev 0) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/jmx/AbstractExoMBeanTest.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,93 @@ +/* + * 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.container.jmx; + +import junit.framework.TestCase; +import org.exoplatform.management.jmx.impl.ExoMBeanInfoBuilder; + +import javax.management.MBeanServer; +import javax.management.MBeanServerFactory; +import javax.management.ObjectName; +import javax.management.modelmbean.ModelMBeanInfo; +import javax.management.modelmbean.RequiredModelMBean; + +/** + * @author Julien Viet + * @version $Revision$ + */ +public abstract class AbstractExoMBeanTest extends TestCase +{ + + protected MBeanServer server; + + @Override + protected void setUp() throws Exception + { + server =3D MBeanServerFactory.createMBeanServer(); + } + + @Override + protected void tearDown() throws Exception + { + MBeanServerFactory.releaseMBeanServer(server); + } + + protected void assertNotBuildable(Class clazz) + { + try + { + new ExoMBeanInfoBuilder(clazz).build(); + fail(); + } + catch (Exception ignore) + { + } + } + + protected Bean register(String name, Class clazz) + { + try + { + ObjectName objectName =3D ObjectName.getInstance(name); + ModelMBeanInfo info =3D new ExoMBeanInfoBuilder(clazz).build(); + RequiredModelMBean mbean =3D new RequiredModelMBean(info); + mbean.setManagedResource(clazz.newInstance(), "ObjectReference"); + server.registerMBean(mbean, objectName); + return new Bean(objectName, (ModelMBeanInfo)server.getMBeanInfo(o= bjectName)); + } + catch (Exception e) + { + throw new AssertionError(e); + } + } + + public static class Bean + { + + final ObjectName name; + + final ModelMBeanInfo info; + + public Bean(ObjectName name, ModelMBeanInfo info) + { + this.name =3D name; + this.info =3D info; + } + } +} \ No newline at end of file Deleted: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/co= ntainer/jmx/AbstractTestExoMBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/jmx/AbstractTestExoMBean.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/jmx/AbstractTestExoMBean.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -1,93 +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.container.jmx; - -import junit.framework.TestCase; -import org.exoplatform.management.jmx.impl.ExoMBeanInfoBuilder; - -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; -import javax.management.ObjectName; -import javax.management.modelmbean.ModelMBeanInfo; -import javax.management.modelmbean.RequiredModelMBean; - -/** - * @author Julien Viet - * @version $Revision$ - */ -public abstract class AbstractTestExoMBean extends TestCase -{ - - protected MBeanServer server; - - @Override - protected void setUp() throws Exception - { - server =3D MBeanServerFactory.createMBeanServer(); - } - - @Override - protected void tearDown() throws Exception - { - MBeanServerFactory.releaseMBeanServer(server); - } - - protected void assertNotBuildable(Class clazz) - { - try - { - new ExoMBeanInfoBuilder(clazz).build(); - fail(); - } - catch (Exception ignore) - { - } - } - - protected Bean register(String name, Class clazz) - { - try - { - ObjectName objectName =3D ObjectName.getInstance(name); - ModelMBeanInfo info =3D new ExoMBeanInfoBuilder(clazz).build(); - RequiredModelMBean mbean =3D new RequiredModelMBean(info); - mbean.setManagedResource(clazz.newInstance(), "ObjectReference"); - server.registerMBean(mbean, objectName); - return new Bean(objectName, (ModelMBeanInfo)server.getMBeanInfo(o= bjectName)); - } - catch (Exception e) - { - throw new AssertionError(e); - } - } - - public static class Bean - { - - final ObjectName name; - - final ModelMBeanInfo info; - - public Bean(ObjectName name, ModelMBeanInfo info) - { - this.name =3D name; - this.info =3D info; - } - } -} \ No newline at end of file Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/jmx/TestExoMBean.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/jmx/TestExoMBean.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/jmx/TestExoMBean.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -28,7 +28,7 @@ * @author Julien Viet * @version $Revision$ */ -public class TestExoMBean extends AbstractTestExoMBean +public class TestExoMBean extends AbstractExoMBeanTest { = public void test1() throws Exception Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/jmx/TestExoMBeanAttribute.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/jmx/TestExoMBeanAttribute.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/jmx/TestExoMBeanAttribute.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -31,7 +31,7 @@ * @author Julien Viet * @version $Revision$ */ -public class TestExoMBeanAttribute extends AbstractTestExoMBean +public class TestExoMBeanAttribute extends AbstractExoMBeanTest { = public void test1() throws Exception Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/jmx/TestExoMBeanOperation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/jmx/TestExoMBeanOperation.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/jmx/TestExoMBeanOperation.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -32,7 +32,7 @@ * @author Julien Viet * @version $Revision$ */ -public class TestExoMBeanOperation extends AbstractTestExoMBean +public class TestExoMBeanOperation extends AbstractExoMBeanTest { = public void test1() throws Exception Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/support/ContainerBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/java/org/exoplatform/contain= er/support/ContainerBuilder.java 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/support/ContainerBuilder.java 2010-10-28 12:56:43 UTC (rev 3360) @@ -19,6 +19,7 @@ package org.exoplatform.container.support; = import junit.framework.AssertionFailedError; + import org.exoplatform.commons.utils.PropertyManager; import org.exoplatform.commons.utils.Tools; import org.exoplatform.container.ExoContainerContext; @@ -30,11 +31,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; -import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import java.util.Set; = /** @@ -120,7 +119,7 @@ return this; } = - public ContainerBuilder profiledBy(String ... profiles) + public ContainerBuilder profiledBy(String... profiles) { this.profiles =3D Tools.set(profiles); return this; Added: kernel/trunk/exo.kernel.container/src/test/resources/test.policy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/resources/test.policy = (rev 0) +++ kernel/trunk/exo.kernel.container/src/test/resources/test.policy 2010-1= 0-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,21 @@ +grant codeBase "@MAVEN_REPO(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons.test/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.commons/-"{ + permission java.security.AllPermission; +}; + + + Modified: kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/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 --- kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/pom.xml = 2010-10-27 09:05:21 UTC (rev 3359) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/pom.xml = 2010-10-28 12:56:43 UTC (rev 3360) @@ -26,6 +26,11 @@ org.exoplatform.kernel + exo.kernel.commons.test + test + + + org.exoplatform.kernel exo.kernel.mc-int-demo @@ -51,9 +56,47 @@ org.apache.maven.plugins maven-surefire-plugin + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.ex= oplatform.commons.test.TestSecurityManager -Djava.security.policy=3D${proje= ct.build.directory}/test-classes/test.policy true + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + = + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + = @@ -68,6 +111,7 @@ org.apache.maven.plugins maven-surefire-plugin + ${env.MAVEN_OPTS} -Djava.security.manager=3D= org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=3D$= {project.build.directory}/test-classes/test.policy **/it/Test*.java @@ -196,6 +240,7 @@ org.apache.maven.plugins maven-surefire-plugin + ${env.MAVEN_OPTS} -Djava.security.manager=3D= org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=3D$= {project.build.directory}/test-classes/test.policy **/it/Test*.java @@ -319,6 +364,7 @@ org.apache.maven.plugins maven-surefire-plugin + ${env.MAVEN_OPTS} -Djava.security.manager=3D= org.exoplatform.commons.test.TestSecurityManager -Djava.security.policy=3D$= {project.build.directory}/test-classes/test.policy **/it/Test*.java Added: kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/t= est/resources/test.policy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.mc-integration/exo.kernel.mc-int-tests/src/test= /resources/test.policy (rev 0) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/src/test= /resources/test.policy 2010-10-28 12:56:43 UTC (rev 3360) @@ -0,0 +1,23 @@ +grant codeBase "@MAVEN_REPO(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ +}; + +grant codeBase "@MAIN_CLASSES(a)../../../../exo.kernel.commons.test/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../../exo.kernel.container/-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)../../../exo.kernel.mc-int-demo/-"{ + permission java.security.AllPermission; +}; + --===============5963006275504477966==-- From do-not-reply at jboss.org Thu Oct 28 09:02:05 2010 Content-Type: multipart/mixed; boundary="===============4301671480175360893==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3361 - in jcr/trunk: exo.jcr.component.core and 27 other directories. Date: Thu, 28 Oct 2010 09:02:04 -0400 Message-ID: <201010281302.o9SD24Ho006618@svn01.web.mwc.hst.phx2.redhat.com> --===============4301671480175360893== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-28 09:02:02 -0400 (Thu, 28 Oct 2010) New Revision: 3361 Removed: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/SecurityHelper.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/PrivilegedCacheHelper.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/PrivilegedFileHelper.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/PrivilegedSystemHelper.java Modified: jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/config/TemplateConfigurationHelper.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/dataflow/serialization/SerializationConstants.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/config/RepositoryServiceConfigurationImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/BackupWorkspaceInitializer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionFactory.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SysViewWorkspaceInitializer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/FileSystemLockPersister.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/ErrorLog.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/AbstractIndex.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/ConsistencyCheck.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/IndexInfos.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/IndexingQueue.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/IndexingQueueStore.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/JcrIndexSearcher.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/MultiIndex.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/NodeIndexer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/PersistentIndex.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/RedoLog.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/SearchIndex.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/TextExtractorJob.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/Util.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/directory/FSDirectoryManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/value/ValueFactoryImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/EditableValueData.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/TransientValueData.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/FilePersistedValueData.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/StreamPersistedValueData.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/FileObjectReaderImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/PersistedValueDataReader.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/PersistedValueDataWriter.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/JDBCWorkspaceDataContainer.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/optimisation/db/HSQLDBMultiDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/FileDigestOutputStream.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/FileValueStorage.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/SimpleFileIOChannel.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/TreeFile.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/TreeFileIOChannel.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/operations/CASableWriteValue.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/operations/DeleteValues.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/operations/ValueFileOperation.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/value/fs/operations/WriteValue.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/FileCleaner.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/SpoolFile.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/io/SwapFile.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/jdbc/DBInitializer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/jdbc/cleaner/DBCleanHelper.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/xml/BufferedDecoder.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/statistics/JCRStatisticsManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/storage/WorkspaceDataContainer.java jcr/trunk/pom.xml Log: EXOJCR-986: Enable SecurityManager by default 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 2010-10-28 12:56:43 UTC (rev 3= 360) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2010-10-28 13:02:02 UTC (rev 3= 361) @@ -64,6 +64,10 @@ exo.kernel.component.cache + org.exoplatform.kernel + exo.kernel.component.ext.cache.impl.jboss.v3 + + org.exoplatform.core exo.core.component.organization.api Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/config/TemplateConfigurationHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/config/TemplateConfigurationHelper.java 2010-10-28 12:56:43 UTC (rev 3= 360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/config/TemplateConfigurationHelper.java 2010-10-28 13:02:02 UTC (rev 3= 361) @@ -18,8 +18,8 @@ */ package org.exoplatform.services.jcr.config; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.container.configuration.ConfigurationManager; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.ByteArrayInputStream; import java.io.FileInputStream; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/serialization/SerializationConstants.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/serialization/SerializationConstants.java 2010-10-28 12:56:43= UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/serialization/SerializationConstants.java 2010-10-28 13:02:02= UTC (rev 3361) @@ -18,7 +18,7 @@ */ package org.exoplatform.services.jcr.dataflow.serialization; = -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; = import java.io.File; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/config/RepositoryServiceConfigurationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/config/RepositoryServiceConfigurationImpl.java 2010-10-28 12:56:4= 3 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/config/RepositoryServiceConfigurationImpl.java 2010-10-28 13:02:0= 2 UTC (rev 3361) @@ -18,13 +18,13 @@ */ package org.exoplatform.services.jcr.impl.config; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.ValueParam; import org.exoplatform.services.jcr.config.ConfigurationPersister; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryServiceConfiguration; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.naming.InitialContextInitializer; import org.jibx.runtime.BindingDirectory; import org.jibx.runtime.IBindingFactory; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/BackupWorkspaceInitializer.java 2010-10-28 12:56:43 UTC (rev= 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/BackupWorkspaceInitializer.java 2010-10-28 13:02:02 UTC (rev= 3361) @@ -18,6 +18,8 @@ */ package org.exoplatform.services.jcr.impl.core; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; @@ -40,8 +42,6 @@ import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateExcept= ion; import org.exoplatform.services.jcr.impl.storage.JCRItemExistsException; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.exoplatform.services.jcr.impl.util.io.SpoolFile; import org.exoplatform.services.jcr.observation.ExtendedEvent; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/SessionFactory.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionFactory.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,12 +18,12 @@ */ package org.exoplatform.services.jcr.impl.core; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.container.ExoContainer; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions; import org.exoplatform.services.jcr.impl.dataflow.session.TransactionableR= esourceManager; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.security.ConversationState; 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 2010-10-28 12:56:43 UTC (re= v 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SysViewWorkspaceInitializer.java 2010-10-28 13:02:02 UTC (re= v 3361) @@ -19,6 +19,8 @@ package org.exoplatform.services.jcr.impl.core; = import org.apache.ws.commons.util.Base64; +import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; @@ -43,8 +45,6 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; import org.exoplatform.services.jcr.impl.util.JCRDateFormat; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.exoplatform.services.jcr.impl.util.io.SpoolFile; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.log.ExoLogger; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/FileSystemLockPersister.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/FileSystemLockPersister.java 2010-10-28 12:56:43 UTC (r= ev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/FileSystemLockPersister.java 2010-10-28 13:02:02 UTC (r= ev 3361) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.core.lock; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.access.SystemIdentity; import org.exoplatform.services.jcr.config.LockPersisterEntry; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; @@ -35,7 +36,6 @@ import org.exoplatform.services.jcr.impl.core.query.SearchManager; import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData; import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePers= istentDataManager; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.observation.ExtendedEvent; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-28 12:= 56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2010-10-28 13:= 02:02 UTC (rev 3361) @@ -21,6 +21,7 @@ import org.exoplatform.management.annotations.ManagedDescription; import org.exoplatform.management.jmx.annotations.NameTemplate; import org.exoplatform.management.jmx.annotations.Property; +import org.exoplatform.services.cache.impl.jboss.util.PrivilegedCacheHelpe= r; import org.exoplatform.services.jcr.config.MappedParametrizedObjectEntry; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.SimpleParameterEntry; @@ -50,7 +51,6 @@ import org.exoplatform.services.jcr.impl.storage.JCRInvalidItemStateExcept= ion; import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants; import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedCacheHelper; import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory; import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory.CacheT= ype; import org.exoplatform.services.jcr.observation.ExtendedEvent; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lock/jbosscache/ControllerCacheLoader.java 2010-10-28 12:56:= 43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java 2010-10-28 13:02:= 02 UTC (rev 3361) @@ -16,7 +16,7 @@ */ package org.exoplatform.services.jcr.impl.core.lock.jbosscache; = -import org.exoplatform.services.jcr.impl.util.SecurityHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.jboss.cache.CacheSPI; import org.jboss.cache.CacheStatus; import org.jboss.cache.Fqn; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/ErrorLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ErrorLog.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/ErrorLog.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -17,8 +17,8 @@ = package org.exoplatform.services.jcr.impl.core.query; = -import org.exoplatform.services.jcr.impl.util.SecurityHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; +import org.exoplatform.commons.utils.SecurityHelper; +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jbosscache/JBossCacheIndexChangesFilter.java 2010-10-2= 8 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2010-10-2= 8 13:02:02 UTC (rev 3361) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.core.query.jbosscache; = import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.services.cache.impl.jboss.util.PrivilegedCacheHelpe= r; import org.exoplatform.services.jcr.config.QueryHandlerEntry; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.impl.core.query.IndexerChangesFilter; @@ -27,7 +28,6 @@ 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.SearchManager; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedCacheHelper; import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory; import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory.CacheT= ype; import org.exoplatform.services.jcr.util.IdGenerator; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jbosscache/JBossCacheIndexInfos.java 2010-10-28 12:56:= 43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/jbosscache/JBossCacheIndexInfos.java 2010-10-28 13:02:= 02 UTC (rev 3361) @@ -18,12 +18,12 @@ */ package org.exoplatform.services.jcr.impl.core.query.jbosscache; = +import org.exoplatform.services.cache.impl.jboss.util.PrivilegedCacheHelpe= r; import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; import org.exoplatform.services.jcr.impl.core.query.lucene.MultiIndex; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedCacheHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jbosscache/JBossCacheIndexUpdateMonitor.java 2010-10-2= 8 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java 2010-10-2= 8 13:02:02 UTC (rev 3361) @@ -18,13 +18,13 @@ */ package org.exoplatform.services.jcr.impl.core.query.jbosscache; = +import org.exoplatform.services.cache.impl.jboss.util.PrivilegedCacheHelpe= r; import org.exoplatform.services.jcr.impl.core.query.IndexerIoMode; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeHandler; import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexInfos; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMoni= tor; import org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMoni= torListener; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedCacheHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/AbstractIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/AbstractIndex.java 2010-10-28 12:56:43 UTC (rev= 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/AbstractIndex.java 2010-10-28 13:02:02 UTC (rev= 3361) @@ -25,7 +25,7 @@ import org.apache.lucene.index.Term; import org.apache.lucene.search.Similarity; import org.apache.lucene.store.Directory; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/ConsistencyCheck.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/ConsistencyCheck.java 2010-10-28 12:56:43 UTC (= rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/ConsistencyCheck.java 2010-10-28 13:02:02 UTC (= rev 3361) @@ -17,9 +17,9 @@ package org.exoplatform.services.jcr.impl.core.query.lucene; = import org.apache.lucene.document.Document; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; import org.exoplatform.services.jcr.datamodel.NodeData; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/FileBasedNamespaceMappings.java 2010-10-28 12:5= 6:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java 2010-10-28 13:0= 2:02 UTC (rev 3361) @@ -16,8 +16,8 @@ */ package org.exoplatform.services.jcr.impl.core.query.lucene; = -import org.exoplatform.services.jcr.impl.util.SecurityHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; +import org.exoplatform.commons.utils.SecurityHelper; +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/IndexInfos.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/IndexInfos.java 2010-10-28 12:56:43 UTC (rev 33= 60) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/IndexInfos.java 2010-10-28 13:02:02 UTC (rev 33= 61) @@ -17,9 +17,9 @@ package org.exoplatform.services.jcr.impl.core.query.lucene; = import org.apache.lucene.store.Directory; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Index= InputStream; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Index= OutputStream; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; = import java.io.DataInputStream; import java.io.DataOutputStream; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/IndexingQueue.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/IndexingQueue.java 2010-10-28 12:56:43 UTC (rev= 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/IndexingQueue.java 2010-10-28 13:02:02 UTC (rev= 3361) @@ -19,7 +19,7 @@ import org.apache.lucene.document.Document; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermDocs; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/IndexingQueueStore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/IndexingQueueStore.java 2010-10-28 12:56:43 UTC= (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/IndexingQueueStore.java 2010-10-28 13:02:02 UTC= (rev 3361) @@ -17,8 +17,8 @@ package org.exoplatform.services.jcr.impl.core.query.lucene; = import org.apache.lucene.store.Directory; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Index= InputStream; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/JcrIndexSearcher.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/JcrIndexSearcher.java 2010-10-28 12:56:43 UTC (= rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/JcrIndexSearcher.java 2010-10-28 13:02:02 UTC (= rev 3361) @@ -20,11 +20,11 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.Sort; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.impl.core.SessionImpl; import org.exoplatform.services.jcr.impl.core.query.lucene.constraint.Eval= uationContext; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; = import java.io.IOException; import java.security.PrivilegedExceptionAction; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/MultiIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/MultiIndex.java 2010-10-28 12:56:43 UTC (rev 33= 60) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/MultiIndex.java 2010-10-28 13:02:02 UTC (rev 33= 61) @@ -20,6 +20,7 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; import org.apache.lucene.store.Directory; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.dataflow.ItemDataConsumer; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.datamodel.NodeData; @@ -29,7 +30,6 @@ import org.exoplatform.services.jcr.impl.core.query.IndexerIoModeListener; import org.exoplatform.services.jcr.impl.core.query.IndexingTree; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Direc= toryManager; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/NodeIndexer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/NodeIndexer.java 2010-10-28 12:56:43 UTC (rev 3= 360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/NodeIndexer.java 2010-10-28 13:02:02 UTC (rev 3= 361) @@ -36,7 +36,6 @@ import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.LocationFactory; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = @@ -44,6 +43,8 @@ import java.io.InputStream; import java.io.Reader; import java.io.StringReader; +import java.security.AccessController; +import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Calendar; @@ -228,15 +229,33 @@ addPropertyName(doc, prop.getQPath().getName()); } = - SecurityHelper.doPriviledgedRepositoryExceptionAction(new Privile= gedExceptionAction() + try { - public Object run() throws Exception + AccessController.doPrivileged((new PrivilegedExceptionAction() { - addValues(doc, prop); - return null; + public Object run() throws Exception + { + addValues(doc, prop); + return null; + } + })); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof RepositoryException) + { + throw (RepositoryException)cause; } - }); - + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } } = // now add fields that are not used in excerpt (must go at the end) Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/PersistentIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/PersistentIndex.java 2010-10-28 12:56:43 UTC (r= ev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/PersistentIndex.java 2010-10-28 13:02:02 UTC (r= ev 3361) @@ -23,8 +23,8 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexOutput; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Direc= toryManager; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; = import java.io.IOException; import java.security.PrivilegedExceptionAction; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/RedoLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/RedoLog.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/RedoLog.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -17,9 +17,9 @@ package org.exoplatform.services.jcr.impl.core.query.lucene; = import org.apache.lucene.store.Directory; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Index= InputStream; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Index= OutputStream; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/SearchIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/SearchIndex.java 2010-10-28 12:56:43 UTC (rev 3= 360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/SearchIndex.java 2010-10-28 13:02:02 UTC (rev 3= 361) @@ -35,6 +35,9 @@ import org.apache.lucene.search.Sort; import org.apache.lucene.search.SortComparatorSource; import org.apache.lucene.search.SortField; +import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.services.document.DocumentReaderService; import org.exoplatform.services.jcr.config.QueryHandlerEntry; @@ -59,9 +62,6 @@ import org.exoplatform.services.jcr.impl.core.query.SearchIndexConfigurati= onHelper; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.Direc= toryManager; import org.exoplatform.services.jcr.impl.core.query.lucene.directory.FSDir= ectoryManager; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Element; @@ -71,7 +71,9 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.security.AccessController; import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Arrays; @@ -502,20 +504,40 @@ if (path !=3D null) { indexDirectory =3D new File(path); - SecurityHelper.doPriviledgedRepositoryExceptionAction(new Privile= gedExceptionAction() + + try { - public Object run() throws Exception + AccessController.doPrivileged((new PrivilegedExceptionAction() { - if (!indexDirectory.exists()) + public Object run() throws Exception { - if (!indexDirectory.mkdirs()) + if (!indexDirectory.exists()) { - throw new RepositoryException("fail to create index d= ir " + path); + if (!indexDirectory.mkdirs()) + { + throw new RepositoryException("fail to create inde= x dir " + path); + } } + return null; } - return null; + })); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof RepositoryException) + { + throw (RepositoryException)cause; } - }); + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } } else { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/TextExtractorJob.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/TextExtractorJob.java 2010-10-28 12:56:43 UTC (= rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/TextExtractorJob.java 2010-10-28 13:02:02 UTC (= rev 3361) @@ -19,8 +19,8 @@ import EDU.oswego.cs.dl.util.concurrent.Callable; import EDU.oswego.cs.dl.util.concurrent.FutureResult; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.document.DocumentReader; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/Util.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/Util.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/Util.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -21,11 +21,11 @@ import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.Term; import org.apache.lucene.search.Query; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.datamodel.IllegalNameException; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.dataflow.ValueDataConvertor; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/directory/FSDirectoryManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/directory/FSDirectoryManager.java 2010-10-28 12= :56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/directory/FSDirectoryManager.java 2010-10-28 13= :02:02 UTC (rev 3361) @@ -19,9 +19,9 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.NativeFSLockFactory; +import org.exoplatform.commons.utils.SecurityHelper; +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.File; import java.io.FileFilter; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/lucene/spell/LuceneSpellChecker.java 2010-10-28 12:56:= 43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2010-10-28 13:02:= 02 UTC (rev 3361) @@ -26,13 +26,13 @@ import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.NativeFSLockFactory; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.impl.core.query.QueryHandler; import org.exoplatform.services.jcr.impl.core.query.QueryRootNode; import org.exoplatform.services.jcr.impl.core.query.RelationQueryNode; import org.exoplatform.services.jcr.impl.core.query.TraversingQueryNodeVis= itor; import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames; import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/value/ValueFactoryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/ValueFactoryImpl.java 2010-10-28 12:56:43 UTC (rev 336= 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/value/ValueFactoryImpl.java 2010-10-28 13:02:02 UTC (rev 336= 1) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.core.value; = +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.ExtendedPropertyType; import org.exoplatform.services.jcr.datamodel.Identifier; @@ -30,7 +31,6 @@ import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; import org.exoplatform.services.jcr.impl.util.JCRDateFormat; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.log.ExoLogger; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/EditableValueData.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/EditableValueData.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,8 +18,8 @@ */ package org.exoplatform.services.jcr.impl.dataflow; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.SpoolFile; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/TransientValueData.java 2010-10-28 12:56:43 UTC (rev 336= 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/TransientValueData.java 2010-10-28 13:02:02 UTC (rev 336= 1) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.dataflow; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.access.AccessControlEntry; import org.exoplatform.services.jcr.datamodel.Identifier; import org.exoplatform.services.jcr.datamodel.InternalQName; @@ -27,7 +28,6 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.FilePersisted= ValueData; import org.exoplatform.services.jcr.impl.util.JCRDateFormat; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.SpoolFile; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/CleanableFilePersistedValueData.java 2010-10-= 28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java 2010-10-= 28 13:02:02 UTC (rev 3361) @@ -18,9 +18,9 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; 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.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.SwapFile; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/FilePersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/FilePersistedValueData.java 2010-10-28 12:56:= 43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/FilePersistedValueData.java 2010-10-28 13:02:= 02 UTC (rev 3361) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.dataflow.AbstractPersistedValueDa= ta; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.Externalizable; import java.io.File; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/StreamPersistedValueData.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/StreamPersistedValueData.java 2010-10-28 12:5= 6:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2010-10-28 13:0= 2:02 UTC (rev 3361) @@ -18,8 +18,8 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.dataflow.TransientValueData; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.SpoolFile; import org.exoplatform.services.jcr.impl.util.io.SwapFile; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/FileObjectReaderImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/serialization/FileObjectReaderImpl.java 2010-10-28 12:56= :43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/FileObjectReaderImpl.java 2010-10-28 13:02= :02 UTC (rev 3361) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.jcr.impl.dataflow.serialization; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.dataflow.serialization.ObjectReader; import org.exoplatform.services.jcr.dataflow.serialization.SerializationCo= nstants; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.EOFException; import java.io.File; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/PersistedValueDataReader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/serialization/PersistedValueDataReader.java 2010-10-28 1= 2:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/PersistedValueDataReader.java 2010-10-28 1= 3:02:02 UTC (rev 3361) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.dataflow.serialization; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.dataflow.serialization.ObjectReader; import org.exoplatform.services.jcr.dataflow.serialization.SerializationCo= nstants; import org.exoplatform.services.jcr.dataflow.serialization.UnknownClassIdE= xception; @@ -25,7 +26,6 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPers= istedValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersist= edValueData; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.SpoolFile; = import java.io.File; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/PersistedValueDataWriter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/serialization/PersistedValueDataWriter.java 2010-10-28 1= 2:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/PersistedValueDataWriter.java 2010-10-28 1= 3:02:02 UTC (rev 3361) @@ -18,12 +18,12 @@ */ package org.exoplatform.services.jcr.impl.dataflow.serialization; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.dataflow.serialization.ObjectWriter; import org.exoplatform.services.jcr.dataflow.serialization.SerializationCo= nstants; import org.exoplatform.services.jcr.impl.dataflow.AbstractPersistedValueDa= ta; import org.exoplatform.services.jcr.impl.dataflow.persistent.FilePersisted= ValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersist= edValueData; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.util.IdGenerator; = import java.io.FileInputStream; 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 2010-10-28 12:56:43 UTC (= rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCStorageConnection.java 2010-10-28 13:02:02 UTC (= rev 3361) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.storage.jdbc; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.access.AccessControlEntry; import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.dataflow.ItemState; @@ -41,7 +42,6 @@ import org.exoplatform.services.jcr.impl.storage.value.ValueStorageNotFoun= dException; import org.exoplatform.services.jcr.impl.storage.value.fs.operations.Value= FileIOHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.SwapFile; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueIOChannel; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-10-28 12:56:43 = UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-10-28 13:02:02 = UTC (rev 3361) @@ -18,6 +18,8 @@ */ package org.exoplatform.services.jcr.impl.storage.jdbc; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; @@ -35,8 +37,6 @@ import org.exoplatform.services.jcr.impl.storage.jdbc.update.StorageUpdate= Manager; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializerException; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; 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 2010-10-28 12:56= :43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2010-10-28 13:02= :02 UTC (rev 3361) @@ -16,9 +16,9 @@ */ package org.exoplatform.services.jcr.impl.storage.jdbc.db; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; = 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 2010-10-28 12:5= 6:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2010-10-28 13:0= 2:02 UTC (rev 3361) @@ -16,9 +16,9 @@ */ package org.exoplatform.services.jcr.impl.storage.jdbc.db; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 201= 0-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 201= 0-10-28 13:02:02 UTC (rev 3361) @@ -16,11 +16,11 @@ */ package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.datamodel.IllegalNameException; 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.util.SecurityHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 20= 10-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 20= 10-10-28 13:02:02 UTC (rev 3361) @@ -16,11 +16,11 @@ */ package org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.db; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.datamodel.IllegalNameException; 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.util.SecurityHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/FileDigestOutputStream.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/FileDigestOutputStream.java 2010-10-28 12:56:43 = UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/FileDigestOutputStream.java 2010-10-28 13:02:02 = UTC (rev 3361) @@ -18,7 +18,7 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs; = -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedFileHelper; = import java.io.File; import java.io.IOException; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/FileValueStorage.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/FileValueStorage.java 2010-10-28 12:56:43 UTC (r= ev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/FileValueStorage.java 2010-10-28 13:02:02 UTC (r= ev 3361) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePlugin; import org.exoplatform.services.log.ExoLogger; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/SimpleFileIOChannel.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/SimpleFileIOChannel.java 2010-10-28 12:56:43 UTC= (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/SimpleFileIOChannel.java 2010-10-28 13:02:02 UTC= (rev 3361) @@ -18,9 +18,9 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.File; import java.io.FileFilter; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/TreeFile.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/TreeFile.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/TreeFile.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,8 +18,8 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/TreeFileIOChannel.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/TreeFileIOChannel.java 2010-10-28 12:56:43 UTC (= rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/TreeFileIOChannel.java 2010-10-28 13:02:02 UTC (= rev 3361) @@ -18,9 +18,9 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.File; import java.io.IOException; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/operations/CASableWriteValue.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/operations/CASableWriteValue.java 2010-10-28 12:= 56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/operations/CASableWriteValue.java 2010-10-28 13:= 02:02 UTC (rev 3361) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs.operations; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersist= edValueData; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; @@ -27,7 +28,6 @@ import org.exoplatform.services.jcr.impl.storage.value.fs.CASableIOSupport; import org.exoplatform.services.jcr.impl.storage.value.fs.FileDigestOutput= Stream; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.jcr.util.IdGenerator; = import java.io.File; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/operations/DeleteValues.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/operations/DeleteValues.java 2010-10-28 12:56:43= UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/operations/DeleteValues.java 2010-10-28 13:02:02= UTC (rev 3361) @@ -18,9 +18,9 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs.operations; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.File; import java.io.IOException; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/operations/ValueFileIOHelper.java 2010-10-28 12:= 56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2010-10-28 13:= 02:02 UTC (rev 3361) @@ -18,11 +18,11 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs.operations; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.ByteArrayPers= istedValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.FilePersisted= ValueData; import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersist= edValueData; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/operations/ValueFileOperation.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/operations/ValueFileOperation.java 2010-10-28 12= :56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2010-10-28 13= :02:02 UTC (rev 3361) @@ -18,11 +18,11 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs.operations; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.storage.value.ValueOperation; import org.exoplatform.services.jcr.impl.storage.value.fs.FileLockExceptio= n; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/value/fs/operations/WriteValue.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/value/fs/operations/WriteValue.java 2010-10-28 12:56:43 U= TC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/value/fs/operations/WriteValue.java 2010-10-28 13:02:02 U= TC (rev 3361) @@ -18,10 +18,10 @@ */ package org.exoplatform.services.jcr.impl.storage.value.fs.operations; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.storage.value.ValueDataResourceHo= lder; import org.exoplatform.services.jcr.impl.util.io.FileCleaner; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; = import java.io.File; import java.io.IOException; Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser= vices/jcr/impl/util/SecurityHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/SecurityHelper.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/SecurityHelper.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2010 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.util; - -import java.io.IOException; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.sql.SQLException; - -import javax.jcr.RepositoryException; - -/** - * Helps running code in privileged = - * = - * @author Nikolay Zamosenchuk - * @version $Id: SecurityHelper.java 34360 2009-07-22 23:58:59Z nzamosench= uk $ - * - */ -public class SecurityHelper -{ - - /** - * Launches action in privileged mode. Can throw only IO exception. - * = - * @param - * @param action - * @return - * @throws IOException - */ - public static E doPriviledgedIOExceptionAction(PrivilegedExceptionA= ction action) throws IOException - { - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof IOException) - { - throw (IOException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Launches action in privileged mode. Can throw only IO exception. - * = - * @param - * @param action - * @return - * @throws IOException - */ - public static E doPriviledgedSQLExceptionAction(PrivilegedException= Action action) throws SQLException - { - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof SQLException) - { - throw (SQLException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Launches action in privileged mode. Can throw only repository except= ion. - * = - * @param - * @param action - * @return - * @throws RepositoryException - */ - public static E doPriviledgedRepositoryExceptionAction(PrivilegedEx= ceptionAction action) - throws RepositoryException - { - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof RepositoryException) - { - throw (RepositoryException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Launches action in privileged mode. Can throw only runtime exception= s. - * = - * @param - * @param action - * @return - * @throws IOException - */ - public static E doPriviledgedAction(PrivilegedAction action) - { - return AccessController.doPrivileged(action); - } - -} Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/FileCleaner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/FileCleaner.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/FileCleaner.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.util.io; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.jcr.impl.proccess.WorkerThread; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser= vices/jcr/impl/util/io/PrivilegedCacheHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/PrivilegedCacheHelper.java 2010-10-28 12:56:43 UTC (rev 3= 360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/PrivilegedCacheHelper.java 2010-10-28 13:02:02 UTC (rev 3= 361) @@ -1,166 +0,0 @@ -/* - * Copyright (C) 2010 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.util.io; - -import org.jboss.cache.Cache; -import org.jboss.cache.CacheException; -import org.jboss.cache.Fqn; - -import java.io.Serializable; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - -/** - * @author Anatoliy Bazko - * @version $Id: PrivilegedCacheHelper.java 111 2010-11-11 11:11:11Z tolus= ha $ - * - */ -public class PrivilegedCacheHelper -{ - /** - * Start cache in privileged mode. - * = - * @param cache - */ - public static void start(final Cache cache) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Object run() - { - cache.start(); - return null; - } - }; - AccessController.doPrivileged(action); - } - - /** - * Stop cache in privileged mode. - * = - * @param cache - */ - public static void stop(final Cache cache) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Object run() - { - cache.stop(); - return null; - } - }; - AccessController.doPrivileged(action); - } - - /** - * Create cache in privileged mode. - * = - * @param cache - */ - public static void create(final Cache cache) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Object run() - { - cache.create(); - return null; - } - }; - AccessController.doPrivileged(action); - } - - /** - * Put in cache in privileged mode. - * = - * @param cache - */ - public static Object put(final Cache cache, final= String fqn, final Serializable key, - final Object value) throws CacheException - { - PrivilegedExceptionAction action =3D new PrivilegedException= Action() - { - public Object run() throws Exception - { - return cache.put(fqn, key, value); - - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof CacheException) - { - throw (CacheException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Put in cache in privileged mode. - * = - * @param cache - */ - public static Object put(final Cache cache, final= Fqn fqn, final Serializable key, - final Object value) throws CacheException - { - PrivilegedExceptionAction action =3D new PrivilegedException= Action() - { - public Object run() throws Exception - { - return cache.put(fqn, key, value); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof CacheException) - { - throw (CacheException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } -} Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser= vices/jcr/impl/util/io/PrivilegedFileHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/PrivilegedFileHelper.java 2010-10-28 12:56:43 UTC (rev 33= 60) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/PrivilegedFileHelper.java 2010-10-28 13:02:02 UTC (rev 33= 61) @@ -1,591 +0,0 @@ -/* - * Copyright (C) 2010 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.util.io; - -import java.io.File; -import java.io.FileFilter; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - -/** - * @author Anatoliy Bazko - * @version $Id: SecurityFileHelper.java 111 2010-11-11 11:11:11Z tolusha $ - * - * Class helper need for perform privileged file operations. - */ -public class PrivilegedFileHelper -{ - - /** - * Create FileOutputStream in privileged mode. - * = - * @param file - * @return - * @throws FileNotFoundException - */ - public static FileOutputStream fileOutputStream(final File file) throws= FileNotFoundException - { - PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() - { - public FileOutputStream run() throws Exception - { - return new FileOutputStream(file); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof FileNotFoundException) - { - throw (FileNotFoundException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Create FileOutputStream in privileged mode. - * = - * @param name - * @return - * @throws FileNotFoundException - */ - public static FileOutputStream fileOutputStream(final String name) thro= ws FileNotFoundException - { - PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() - { - public FileOutputStream run() throws Exception - { - return new FileOutputStream(name); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof FileNotFoundException) - { - throw (FileNotFoundException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Create FileOutputStream in privileged mode. - * = - * @param file - * @param append - * @return - * @throws FileNotFoundException - */ - public static FileOutputStream fileOutputStream(final File file, final = boolean append) throws FileNotFoundException - { - PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() - { - public FileOutputStream run() throws Exception - { - return new FileOutputStream(file, append); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof FileNotFoundException) - { - throw (FileNotFoundException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Create FileInputStream in privileged mode. - * = - * @param file - * @return - * @throws FileNotFoundException - */ - public static FileInputStream fileInputStream(final File file) throws F= ileNotFoundException - { - PrivilegedExceptionAction action =3D new Privileged= ExceptionAction() - { - public FileInputStream run() throws Exception - { - return new FileInputStream(file); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof FileNotFoundException) - { - throw (FileNotFoundException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Create FileInputStream in privileged mode. - * = - * @param name - * @return - * @throws FileNotFoundException - */ - public static FileInputStream fileInputStream(final String name) throws= FileNotFoundException - { - PrivilegedExceptionAction action =3D new Privileged= ExceptionAction() - { - public FileInputStream run() throws Exception - { - return new FileInputStream(name); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof FileNotFoundException) - { - throw (FileNotFoundException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Create temporary file in privileged mode. - * = - * @param prefix - * @param suffix - * @param directory - * @return - * @throws IllegalArgumentException - * @throws IOException - */ - public static File createTempFile(final String prefix, final String suf= fix, final File directory) - throws IllegalArgumentException, IOException - { - PrivilegedExceptionAction action =3D new PrivilegedExceptionAc= tion() - { - public File run() throws Exception - { - return File.createTempFile(prefix, suffix, directory); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof IllegalArgumentException) - { - throw (IllegalArgumentException)cause; - } - else if (cause instanceof IOException) - { - throw (IOException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Create teamporary file in privileged mode. - * = - * = - * @param prefix - * @param suffix - * @return - * @throws IllegalArgumentException - * @throws IOException - */ - public static File createTempFile(final String prefix, final String suf= fix) throws IllegalArgumentException, - IOException - { - PrivilegedExceptionAction action =3D new PrivilegedExceptionAc= tion() - { - public File run() throws Exception - { - return File.createTempFile(prefix, suffix); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof IllegalArgumentException) - { - throw (IllegalArgumentException)cause; - } - else if (cause instanceof IOException) - { - throw (IOException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Create RandomAccessFile in privileged mode. - * = - * @param file - * @param mode - * @return - * @throws IllegalArgumentException - * @throws IOException - */ - public static RandomAccessFile randomAccessFile(final File file, final = String mode) throws IllegalArgumentException, - IOException - { - PrivilegedExceptionAction action =3D new Privilege= dExceptionAction() - { - public RandomAccessFile run() throws Exception - { - return new RandomAccessFile(file, mode); - } - }; - try - { - return AccessController.doPrivileged(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - if (cause instanceof IllegalArgumentException) - { - throw (IllegalArgumentException)cause; - } - else if (cause instanceof FileNotFoundException) - { - throw (FileNotFoundException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } - } - - /** - * Get file length in privileged mode. - * = - * @param file - * @return - */ - public static long length(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Long run() - { - return new Long(file.length()); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Requests in privileged mode that the file or directory denoted by th= is abstract = - * pathname be deleted when the virtual machine terminates. - * = - * @param file - */ - public static void deleteOnExit(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Object run() - { - file.deleteOnExit(); - return null; - } - }; - AccessController.doPrivileged(action); - } - - /** - * Get file absolute path in privileged mode. - * = - * @param file - * @return - */ - public static String getAbsolutePath(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public String run() - { - return file.getAbsolutePath(); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Delete file in privileged mode. - * = - * @param file - * @return - */ - public static boolean delete(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Boolean run() - { - return file.delete(); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Tests in privileged mode whether the file denoted by this abstract p= athname is a - * directory. - * = - * @param file - * @return - */ - public static boolean isDirectory(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Boolean run() - { - return file.isDirectory(); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Tests in privileged mode whether the file or directory denoted by th= is abstract pathname - * exists. - * = - * @param file - * @return - */ - public static boolean exists(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Boolean run() - { - return file.exists(); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Creates the directory in privileged mode. - * = - * @param file - * @return - */ - public static boolean mkdirs(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Boolean run() - { - return file.mkdirs(); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Rename File in privileged mode. - * = - * @param srcFile - * @param dstfile - * @return - */ - public static boolean renameTo(final File srcFile, final File dstfile) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public Boolean run() - { - return new Boolean(srcFile.renameTo(dstfile)); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Get file's list in privileged mode. - * = - * @param file - * @return - */ - public static String[] list(final File file) - { - PrivilegedAction action =3D new PrivilegedAction= () - { - public String[] run() - { - return file.list(); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Get file's list in privileged mode. - * = - * @param file - * @return - */ - public static String[] list(final File file, final FilenameFilter filte= r) - { - PrivilegedAction action =3D new PrivilegedAction= () - { - public String[] run() - { - return file.list(filter); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Get file's list in privileged mode. - * = - * @param file - * @return - */ - public static File[] listFiles(final File file) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public File[] run() - { - return file.listFiles(); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Get file's list in privileged mode. - * = - * @param file - * @return - */ - public static File[] listFiles(final File file, final FileFilter filter) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public File[] run() - { - return file.listFiles(filter); - } - }; - return AccessController.doPrivileged(action); - } - -} Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser= vices/jcr/impl/util/io/PrivilegedSystemHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/PrivilegedSystemHelper.java 2010-10-28 12:56:43 UTC (rev = 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/PrivilegedSystemHelper.java 2010-10-28 13:02:02 UTC (rev = 3361) @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2010 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.util.io; - -import java.security.AccessController; -import java.security.PrivilegedAction; - -/** - * @author Anatoliy Bazko - * @version $Id: PrivilegedSystemHelper.java 111 2010-11-11 11:11:11Z tolu= sha $ - * - */ -public class PrivilegedSystemHelper -{ - - /** - * Gets system property in privileged mode. - * = - * @param key - * @return - */ - public static String getProperty(final String key) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public String run() - { - return System.getProperty(key); - } - }; - return AccessController.doPrivileged(action); - } - - /** - * Gets system property in privileged mode. - * = - * @param key - * @param def - * @return - */ - public static String getProperty(final String key, final String def) - { - PrivilegedAction action =3D new PrivilegedAction() - { - public String run() - { - return System.getProperty(key, def); - } - }; - return AccessController.doPrivileged(action); - } -} Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/SpoolFile.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/SpoolFile.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/SpoolFile.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.util.io; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/SwapFile.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/io/SwapFile.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/SwapFile.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,6 +18,8 @@ */ package org.exoplatform.services.jcr.impl.util.io; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; + import java.io.File; import java.io.IOException; import java.security.AccessController; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/jdbc/DBInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/jdbc/DBInitializer.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/jdbc/DBInitializer.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,7 +18,7 @@ */ package org.exoplatform.services.jcr.impl.util.jdbc; = -import org.exoplatform.services.jcr.impl.util.SecurityHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/jdbc/cleaner/DBCleanHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/jdbc/cleaner/DBCleanHelper.java 2010-10-28 12:56:43 UTC (rev= 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/jdbc/cleaner/DBCleanHelper.java 2010-10-28 13:02:02 UTC (rev= 3361) @@ -16,8 +16,8 @@ */ package org.exoplatform.services.jcr.impl.util.jdbc.cleaner; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.impl.Constants; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/jdbc/cleaner/WorkspaceDBCleaner.java 2010-10-28 12:56:43 UTC= (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java 2010-10-28 13:02:02 UTC= (rev 3361) @@ -16,8 +16,8 @@ */ package org.exoplatform.services.jcr.impl.util.jdbc.cleaner; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions; -import org.exoplatform.services.jcr.impl.util.SecurityHelper; import org.exoplatform.services.jcr.impl.util.jdbc.DBInitializer; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/xml/BufferedDecoder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/xml/BufferedDecoder.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/BufferedDecoder.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -19,7 +19,7 @@ package org.exoplatform.services.jcr.impl.xml; = import org.apache.ws.commons.util.Base64; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedFileHelper; = import java.io.BufferedInputStream; import java.io.BufferedOutputStream; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/statistics/JCRStatisticsManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/statistics/JCRStatisticsManager.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/statistics/JCRStatisticsManager.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -16,6 +16,8 @@ */ package org.exoplatform.services.jcr.statistics; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; import org.exoplatform.container.ExoContainer; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.management.ManagementContext; @@ -25,8 +27,6 @@ import org.exoplatform.management.jmx.annotations.NameTemplate; import org.exoplatform.management.jmx.annotations.Property; import org.exoplatform.management.rest.annotations.RESTEndpoint; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedFileHelper; -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/storage/WorkspaceDataContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/WorkspaceDataContainer.java 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/storage/WorkspaceDataContainer.java 2010-10-28 13:02:02 UTC (rev 3361) @@ -18,7 +18,7 @@ */ package org.exoplatform.services.jcr.storage; = -import org.exoplatform.services.jcr.impl.util.io.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; = import java.util.Calendar; = 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 2010-10-28 12:56:43 UTC (rev 3360) +++ jcr/trunk/pom.xml 2010-10-28 13:02:02 UTC (rev 3361) @@ -81,6 +81,11 @@ ${org.exoplatform.kernel.version} + org.exoplatform.kernel + exo.kernel.component.ext.cache.impl.jboss.v3 + ${org.exoplatform.kernel.version} + + org.exoplatform.core exo.core.component.document ${org.exoplatform.core.version} --===============4301671480175360893==-- From do-not-reply at jboss.org Fri Oct 29 03:04:18 2010 Content-Type: multipart/mixed; boundary="===============5514992803622888962==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3362 - in jcr/branches/1.12.x: applications/exo.jcr.applications.backupconsole/src/main/assemblies and 2 other directories. Date: Fri, 29 Oct 2010 03:04:18 -0400 Message-ID: <201010290704.o9T74II0005358@svn01.web.mwc.hst.phx2.redhat.com> --===============5514992803622888962== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-29 03:04:16 -0400 (Fri, 29 Oct 2010) New Revision: 3362 Added: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/bin/= test_form.sh jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/FormAuthentication.java Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/assemblies/binary-assembly.xml jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src/= main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docb= ook/en-US/modules/jcr/backup/backup-client.xml Log: JCR-1481 : Adding support form authentication in backup console Added: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/= bin/test_form.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.x/applications/exo.jcr.applications.backupconsole/bin= /test_form.sh (rev 0) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/bin= /test_form.sh 2010-10-29 07:04:16 UTC (rev 3362) @@ -0,0 +1,6 @@ +#!/bin/sh + +./jcrbackup.sh http://127.0.0.1:8080/portal/rest form POST "/portal/login?= username=3Droot&password=3Dgtn" info +#!/bin/sh + +./jcrbackup.sh http://127.0.0.1:8080/portal/rest form POST "/portal/login?= username=3Droot&password=3Dgtn" info \ No newline at end of file Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/assemblies/binary-assembly.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/assemblies/binary-assembly.xml 2010-10-28 13:02:02 UTC (rev 3361) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/assemblies/binary-assembly.xml 2010-10-29 07:04:16 UTC (rev 3362) @@ -46,7 +46,6 @@ javax.portlet:portlet-api javax.faces:jsf-api javax.servlet:servlet-api - picocontainer:picocontainer jmock:jmock xstream:xstream commons-beanutils:commons-beanutils Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-= 28 13:02:02 UTC (rev 3361) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupClientImpl.java 2010-10-= 29 07:04:16 UTC (rev 3362) @@ -81,27 +81,37 @@ private final String path; = /** - * User login. + * Form authentication parameters. */ - private final String userName; + private FormAuthentication formAuthentication;; = /** - * User password. + * Constructor. + * = + * @param transport ClientTransport implementation. + * @param urlPath url path. */ - private final String pass; + public BackupClientImpl(ClientTransport transport, String urlPath) + { + this.transport =3D transport; = + if (urlPath =3D=3D null) + path =3D "/rest"; + else + path =3D urlPath; + } + /** * Constructor. * = * @param transport ClientTransport implementation. * @param login user login. * @param pass user password. + * @param urlPath url path. */ public BackupClientImpl(ClientTransport transport, String login, String= pass, String urlPath) { this.transport =3D transport; - this.userName =3D login; - this.pass =3D pass; = if (urlPath =3D=3D null) path =3D "/rest"; @@ -110,6 +120,19 @@ } = /** + * Constructor. + * = + * @param transport ClientTransport implementation. + * @param formAuthentication form authentication. + * @param urlPath url path. + */ + public BackupClientImpl(ClientTransport transport, FormAuthentication f= ormAuthentication, String urlPath) + { + this(transport, urlPath); + this.formAuthentication =3D formAuthentication; + } + + /** * {@inheritDoc} */ public String startBackUp(String repositoryName, String workspaceName, = String backupDir) throws IOException, @@ -327,8 +350,9 @@ + info.getWorkspaceName() + "\n") + "\t\tbackup type : " + (configBean.getBackupType() =3D=3D BackupM= anager.FULL_AND_INCREMENTAL ? "full + incremetal" - : "full only") + "\n" + "\t\tfull b= ackup state : " + getState(info - .getState())) + : "full only") + "\n" + "\t\tfull b= ackup state : " + (info + .getWorkspaceName().equals("") ? getReposito= ryBackupToFullState(info.getState()) + : getState(info.g= etState()))) + "\n" + (info.getBackupType() =3D=3D BackupManager= .FULL_BACKUP_ONLY ? "" : "\t\tincremental backup state : "= + "working" + "\n") Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-28 = 13:02:02 UTC (rev 3361) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/BackupConsole.java 2010-10-29 = 07:04:16 UTC (rev 3362) @@ -23,6 +23,7 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.util.HashMap; = /** * Created by The eXo Platform SAS.
    Date: @@ -57,7 +58,15 @@ * Help string. */ private static final String HELP_INFO =3D - "Help info:\n" + " \n" + " : http(s)//login:pas= sword(a)host:port/ \n" + "Help info:\n" + + " | \n" + + " : http(s)//login:pa= ssword(a)host:port/ \n\n" + + " : http(s)//host:por= t/ \"\" \n" + + " : form \n" + + " : POST or GET\n" + + " : /path/path?=3D&=3D...\n" + + " Example to : http:/= /127.0.0.1:8080/portal/rest form POST /portal/login?username=3Droot&passwor= d=3Dgtn\n\n" + + " : start [] \n" = + " stop \n" + " status \n" = @@ -65,7 +74,7 @@ + " restore = \n" = + " list [completed] \n" + " info \n" = - + " drop [force-close-session] \n" = + + " drop [force-close-session] = \n" + " help \n\n" = + " start - start backup of repositpry or workspace \n" = @@ -79,7 +88,7 @@ + " drop - delete the repository or workspace \n" + " help - print help information about backup console = \n\n" = - + " - /[/= ] the repository or workspace \n" + + " - /[/] = the repository or workspace \n" + " - path to folder for backup on remote ser= ver \n" + " - the identifier for backup \n" = + " - incemental job period \n" @@ -128,25 +137,116 @@ if (!("".equals(url.getPath()))) urlPath =3D url.getPath(); = + // try form + String form =3D null; + if (curArg < args.length) + { + if (args[curArg].equals("form")) + { + form =3D args[curArg++]; + + if (url.getUserInfo() !=3D null) + { = + System.out.println(INCORRECT_PARAM + "Parameters Login:Pass= word should not be specified in url parameter to form authentication - " + = sUrl); + return; + } + } + } + // login:password String login =3D url.getUserInfo(); - if (login =3D=3D null) + = + FormAuthentication formAuthentication =3D null; + if (form !=3D null && form.equals("form")) { - System.out.println(INCORRECT_PARAM + "There is no specific Login:= Password in url parameter - " + sUrl); - return; + //check POST or GET + if (curArg =3D=3D args.length) + { + System.out.println(INCORRECT_PARAM + "No specified POST or GE= T parameter to form parameter."); + return; + } + String method =3D args[curArg++]; + + if (!method.equalsIgnoreCase("GET") && !method.equalsIgnoreCase("= POST")) + { + System.out.println(INCORRECT_PARAM + "Method to form authentic= ation shulde be GET or POST to form parameter - " + method); + return; + } + = + //url to form authentication + if (curArg =3D=3D args.length) + { + System.out.println(INCORRECT_PARAM + "No specified url and fo= rm properties to form parameter."); + return; + } + String[] params =3D args[curArg++].split("[?]"); + = + if (params.length !=3D 2) + { + System.out.println(INCORRECT_PARAM + "From parameters is not s= pacified to form parameter - " + args[curArg]); + return; + } + String formUrl =3D params[0]; + + // parameters to form + String[] formParams =3D params[1].split("&"); + + if (formParams.length < 2) + { + System.out.println(INCORRECT_PARAM + + "From parameters shoulde be conatains at least two = (for login and for pasword) parameters - " + + params[1]); + return; + } + = + HashMap mapFormParams =3D new HashMap(); + + for (String fParam : formParams) + { + String[] para =3D fParam.split("=3D"); + = + if (para.length !=3D 2) + { + System.out.println(INCORRECT_PARAM + "From parameters is in= corect, shoulde be as \"name=3Dvalue\" - " + fParam); + return; + } + = + mapFormParams.put(para[0], para[1]); + } + = + formAuthentication =3D new FormAuthentication(method, formUrl, ma= pFormParams); } - else if (!login.matches("[^:]+:[^:]+")) + else { - System.out.println(INCORRECT_PARAM + "There is incorrect Login:Pa= ssword parameter - " + login); - return; + if (login =3D=3D null) + { + System.out.println(INCORRECT_PARAM + "There is no specific Log= in:Password in url parameter - " + sUrl); + return; + } + else if (!login.matches("[^:]+:[^:]+")) + { + System.out.println(INCORRECT_PARAM + "There is incorrect Login= :Password parameter - " + login); + return; + } } = String host =3D url.getHost() + ":" + url.getPort(); = // initialize transport and backup client - String[] lp =3D login.split(LOGIN_PASS_SPLITTER); - ClientTransport transport =3D new ClientTransportImpl(lp[0], lp[1], = host, url.getProtocol()); - BackupClient client =3D new BackupClientImpl(transport, lp[0], lp[1]= , urlPath); + ClientTransport transport; + BackupClient client; + = + if (formAuthentication !=3D null) + { + transport =3D new ClientTransportImpl(formAuthentication, host, u= rl.getProtocol()); + client =3D new BackupClientImpl(transport, formAuthentication, ur= lPath); + } + else + { + String[] lp =3D login.split(LOGIN_PASS_SPLITTER); + transport =3D new ClientTransportImpl(lp[0], lp[1], host, url.get= Protocol()); + client =3D new BackupClientImpl(transport, urlPath); + } = // commands if (curArg =3D=3D args.length) @@ -155,7 +255,6 @@ return; } String command =3D args[curArg++]; - try { if (command.equalsIgnoreCase("start")) @@ -376,6 +475,8 @@ System.out.println("ERROR: " + e.getMessage()); e.printStackTrace(); } + + System.exit(0); } = /** Modified: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconso= le/src/main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-= 10-28 13:02:02 UTC (rev 3361) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/ClientTransportImpl.java 2010-= 10-29 07:04:16 UTC (rev 3362) @@ -18,6 +18,11 @@ */ package org.exoplatform.jcr.backupconsole; = +import java.io.IOException; +import java.net.URL; + +import javax.ws.rs.core.Response; + import org.exoplatform.common.http.client.AuthorizationHandler; import org.exoplatform.common.http.client.AuthorizationInfo; import org.exoplatform.common.http.client.CookieModule; @@ -26,9 +31,6 @@ import org.exoplatform.common.http.client.ModuleException; import org.exoplatform.common.http.client.NVPair; = -import java.io.IOException; -import java.net.URL; - /** * Created by The eXo Platform SAS.
    Date: * = @@ -67,6 +69,11 @@ * Realm to connection */ private String realm; + = + /** + * Form authentication parameters. + */ + private FormAuthentication formAuthentication; = /** * Constructor. @@ -74,7 +81,6 @@ * @param login Login string. * @param password Password string. * @param host host string. - * @param isSSL isSSL flag. */ public ClientTransportImpl(String login, String password, String host, = String protocol) { @@ -85,6 +91,20 @@ } = /** + * Constructor. + + * @param formAuthentication form authentication parameters. + * @param login Login string. + * @param password Password string. + * @param host host string. + */ + public ClientTransportImpl(FormAuthentication formAuthentication, Strin= g host, String protocol) + { + this(null, null, host, protocol); + this.formAuthentication =3D formAuthentication; + } + + /** * Get realm by URL. * = * @param sUrl URL string. @@ -132,16 +152,53 @@ = URL url =3D new URL(complURL); HTTPConnection connection =3D new HTTPConnection(url); - connection.removeModule(CookieModule.class); + connection.setAllowUserInteraction(false); = - if (!isRealmGet) + //authentication + if (formAuthentication !=3D null) { - realm =3D getRealm(complURL); - isRealmGet =3D true; + //form authentication = + HTTPResponse respLogin; + + URL urlLogin =3D new URL(protocol + "://" + host + formAuthent= ication.getFormPath()); + + HTTPConnection connectionLogin =3D new HTTPConnection(urlLogin= ); + connectionLogin.setAllowUserInteraction(false); + + NVPair[] formParams =3D new NVPair[formAuthentication.getFormP= arams().size()]; + int pairCount =3D 0; + for (String key : formAuthentication.getFormParams().keySet()) + { + formParams[pairCount++] =3D new NVPair(key, formAuthenticat= ion.getFormParams().get(key)); + } + + if ("POST".equalsIgnoreCase(formAuthentication.getMethod())) + { + respLogin =3D connectionLogin.Post(urlLogin.getFile(), form= Params); + } + else + { + respLogin =3D connectionLogin.Get(urlLogin.getFile(), formP= arams); + } + + if (Response.Status.OK.getStatusCode() !=3D respLogin.getStatu= sCode()) + { + System.out.println("Form authentication is fail, status cod= e : " + respLogin.getStatusCode()); + System.exit(0); + } } - = - connection.addBasicAuthorization(realm, login, password); + else + { + // basic authorization + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } = + connection.addBasicAuthorization(realm, login, password); + } + HTTPResponse resp; if (postData =3D=3D null) { @@ -173,21 +230,58 @@ { try { - // execute the POST + // execute the GET String complURL =3D protocol + "://" + host + sURL; = URL url =3D new URL(complURL); HTTPConnection connection =3D new HTTPConnection(url); - connection.removeModule(CookieModule.class); + connection.setAllowUserInteraction(false); = - if (!isRealmGet) + //authentication + if (formAuthentication !=3D null) { - realm =3D getRealm(complURL); - isRealmGet =3D true; + //form authentication = + HTTPResponse respLogin; + + URL urlLogin =3D new URL(protocol + "://" + host + formAuthent= ication.getFormPath()); + + HTTPConnection connectionLogin =3D new HTTPConnection(urlLogin= ); + connectionLogin.setAllowUserInteraction(false); + + NVPair[] formParams =3D new NVPair[formAuthentication.getFormP= arams().size()]; + int pairCount =3D 0; + for (String key : formAuthentication.getFormParams().keySet()) + { + formParams[pairCount++] =3D new NVPair(key, formAuthenticat= ion.getFormParams().get(key)); + } + + if ("POST".equalsIgnoreCase(formAuthentication.getMethod())) + { + respLogin =3D connectionLogin.Post(urlLogin.getFile(), form= Params); + } + else + { + respLogin =3D connectionLogin.Get(urlLogin.getFile(), formP= arams); + } + + if (Response.Status.OK.getStatusCode() !=3D respLogin.getStatu= sCode()) + { + System.out.println("Form authentication is fail, status cod= e : " + respLogin.getStatusCode()); + System.exit(0); + } } - = - connection.addBasicAuthorization(realm, login, password); + else + { + // basic authorization + if (!isRealmGet) + { + realm =3D getRealm(complURL); + isRealmGet =3D true; + } = + connection.addBasicAuthorization(realm, login, password); + } + HTTPResponse resp =3D connection.Get(url.getFile()); = BackupAgentResponse responce =3D new BackupAgentResponse(resp.get= Data(), resp.getStatusCode()); Added: jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/= src/main/java/org/exoplatform/jcr/backupconsole/FormAuthentication.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/FormAuthentication.java = (rev 0) +++ jcr/branches/1.12.x/applications/exo.jcr.applications.backupconsole/src= /main/java/org/exoplatform/jcr/backupconsole/FormAuthentication.java 2010-1= 0-29 07:04:16 UTC (rev 3362) @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2003-2010 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.jcr.backupconsole; + +import java.util.HashMap; + +/** + * Created by The eXo Platform SAS. + * = + *
    Date: 2010 + * + * @author Alex Re= shetnyak = + * @version $Id: FormAuthntication.java 111 2010-11-11 11:11:11Z rainf0x $ + */ +public class FormAuthentication +{ + private String method; + + private String formPath; + + private HashMap formParams; + + public FormAuthentication(String method, String formPath, HashMap formParams) + { + this.method =3D method; + this.formPath =3D formPath; + this.formParams =3D formParams; + } + + public String getMethod() + { + return method; + } + + public String getFormPath() + { + return formPath; + } + + public HashMap getFormParams() + { + return formParams; + } + +} Modified: jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/ma= in/docbook/en-US/modules/jcr/backup/backup-client.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-28 13:02:02 UTC (re= v 3361) +++ jcr/branches/1.12.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/doc= book/en-US/modules/jcr/backup/backup-client.xml 2010-10-29 07:04:16 UTC (re= v 3362) @@ -16,6 +16,15 @@ configuration' . = + + GateIn uses context /portal/rest, therefore you need to use + http://host:port/portal/rest/ instread of http://host:port/rest/ + + GateIn uses form authentication, so first you need to login (url= to + form authentication is http://host:port/portal/login) and then perform + requests. + +
    Introduction = @@ -911,6 +920,10 @@ </component> = <component> + <type>org.exoplatform.services.jcr.ext.repository.RestRepositorySe= rvice</type> +</component> + +<component> <key>org.exoplatform.services.jcr.ext.backup.BackupManager</key= > <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerIm= pl</type> <init-params> @@ -923,12 +936,55 @@ </properties-param> </init-params> </component> + + In case, if you will restore backup in same workspace (so you = will + drop previous workspace), you need configure + RepositoryServiceConfiguration in order to save the changes of the + repository configuration. For example + + <component> + <key>org.exoplatform.services.jcr.config.RepositoryServiceConfigur= ation</key> + <type>org.exoplatform.services.jcr.impl.config.RepositoryServiceCo= nfigurationImpl</type> + <init-params> + <value-param> + <name>conf-path</name> + <description>JCR repositories configuration file</descripti= on> + <value>jar:/conf/portal/exo-jcr-config.xml</value> + </value-param> + <properties-param> + <name>working-conf</name> + <description>working-conf</description> + <property name=3D"source-name" value=3D"jdbcjcr" /> + <property name=3D"dialect" value=3D"hsqldb" /> + <property name=3D"persister-class-name" value=3D"org.exoplatform.= services.jcr.impl.config.JDBCConfigurationPersister" /> + </properties-param> + </init-params> +</component> + + See the eXo + JCR Configuration article at chapter '2 Portal and Standalone + configuration' for details.
    =
    Backup Client = + + For GateIn should use context "/portal/rest". GateIn uses form + authentication, so first you need to login (url to form authenticati= on + is http://host:port/portal/login) and then perform requests. + + + + Backup client is support form authentication. For example call + command "info" with form authentication to GateIn : + + ./jcrbackup.sh http://127.0.0.1:8080/portal/rest form POST + "/portal/login?username=3Droot&password=3Dgtn" info + + Backup client is console application. = The backup client is http client for HTTPBackupAgent. @@ -936,19 +992,26 @@ Command signature: = Help info: - <url> <cmd> = - <url> : http(s)//login:password(a)host:port/<context> = + <url_basic_authentication>|<url form authentication> <cmd= > = + <url_basic_authentication> : http(s)//login:password(a)host:port= /<context> = + + <url form authentication> : http(s)//host:port/<context> = "<form auth parm>" = + <form auth parm> : form <method> <form path&g= t; + <method> : POST or GET + <form path> : /path/path?<paramName1>=3D<= ;paramValue1>&<paramName2>=3D<paramValue2>... + Example to <url form authentication> : http://127.0.0.1:8080/po= rtal/rest form POST /portal/login?username=3Droot&password=3Dgtn + <cmd> : start <repo[/ws]> <backup_dir> [<incr>= ] = stop <backup_id> = status <backup_id> = restores <repo[/ws]> = - restore <repo[/ws]> <backup_id> <pathToConfigFi= le> + restore <repo[/ws]> <backup_id> <pathToConfigFi= le> = list [completed] = info = - drop [force-close-session] <repo[/ws]> = + drop [force-close-session] <repo[/ws]> = help = = - start - start backup of repository or workspace + start - start backup of repositpry or workspace = stop - stop backup = status - information about the current or completed backup by 'ba= ckup_id' = restores - information about the last restore on specific repositor= y or workspace = @@ -959,12 +1022,12 @@ drop - delete the repository or workspace = help - print help information about backup console = = - <repo[/ws]> - /<reponsitory-name>[/<workspace-name= >] the repository or workspace + <repo[/ws]> - /<reponsitory-name>[/<workspace-name= >] the repository or workspace = <backup_dir> - path to folder for backup on remote server = <backup_id> - the identifier for backup = <incr> - incemental job period = <pathToConfigFile> - path (local) to repository or workspace conf= iguration = - force-close-session - close opened sessions on repositpry or workspace + force-close-session - close opened sessions on repositpry or workspace.
    =
    @@ -977,10 +1040,7 @@ Go to folder of "backup client" ${JCR-SRC-HOME}/applications/exo.jcr.applications.= backupconsole - . - build the application : - mvn clean install -P deploy - = - + . - build the application :mvn clean install -P = deploy = @@ -1001,8 +1061,8 @@ = - Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command> -or use jcrbackup.cmd (or .sh); + Run jarjava -jar exo.jcr.applications.back= upconsole-binary.jar <command>or + use jcrbackup.cmd (or .sh);
    @@ -1233,12 +1293,9 @@ Delete/clean the database for workspace "backup" : When we use "single-db", the= n we - will run the SQL queries for clean database : - delete from JCR_SREF where NODE_ID in (select ID from JCR_SITEM whe= re CONTAINER_NAME =3D 'backup') - delete from JCR_SVALUE where PROPERTY_ID in (select ID from JCR_SIT= EM where CONTAINER_NAME =3D 'backup') - delete from JCR_SITEM where CONTAINER_NAME=3D'backup' = - = - + will run the SQL queries for clean database :del= ete from JCR_SREF where NODE_ID in (select ID from JCR_SITEM where CONTAINE= R_NAME =3D 'backup') +delete from JCR_SVALUE where PROPERTY_ID in (select ID from JCR_SITEM wher= e CONTAINER_NAME =3D 'backup') +delete from JCR_SITEM where CONTAINER_NAME=3D'backup' = @@ -1250,8 +1307,7 @@ status code =3D 200The /home/rainf0x/java/exo-working/JCR-839/exo-jcr-config_backup.xml content the configuration for restored workspace "backup" : -<repository-service default-repository=3D"repository"> + role=3D"bold">"backup" :<repositor= y-service default-repository=3D"repository"> <repositories> <repository name=3D"repository" system-workspace=3D"production" def= ault-workspace=3D"production"> <security-domain>exo-domain</security-domain> @@ -1329,6 +1385,16 @@ Full example about creating backup and restoring it for reposit= ory 'repository' = + + If delete default repository that should be restored repository + with name as default repository. + + + This usecase needs RestRepositoryService enabled. (Deleting the + repository needs it)<component> + <type>org.exoplatform.services.jcr.ext.repository.RestRepositoryS= ervice</type> +</component> +
    Creating backup = @@ -1382,7 +1448,7 @@
    =
    - Restoring the workspace "backup" + Restoring the repository "repository" = @@ -1404,7 +1470,7 @@ = - Restore:jcrbackup http://root:exo(a)127.0.= 0.1:8080 restore /repository/backup 9a6dba327f000001325dfb228a181b07 /home/= rainf0x/exo-jcr-config_backup.xmlReturn + Restore:jcrbackup http://root:exo(a)127.0.= 0.1:8080 restore /repository 9a6dba327f000001325dfb228a181b07 /home/rainf0x= /exo-jcr-config_backup.xmlReturn :Successful : = status code =3D 200The /home/rainf0x/exo-jcr-config_backup.xml content the configuration --===============5514992803622888962==-- From do-not-reply at jboss.org Fri Oct 29 03:11:51 2010 Content-Type: multipart/mixed; boundary="===============8259808785322575465==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3363 - in ws/branches/2.1.x/exo.ws.rest.core/src: test/java/org/exoplatform/services/rest/impl/provider and 1 other directory. Date: Fri, 29 Oct 2010 03:11:50 -0400 Message-ID: <201010290711.o9T7BoYu005606@svn01.web.mwc.hst.phx2.redhat.com> --===============8259808785322575465== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2010-10-29 03:11:50 -0400 (Fri, 29 Oct 2010) New Revision: 3363 Modified: ws/branches/2.1.x/exo.ws.rest.core/src/main/java/org/exoplatform/service= s/rest/impl/provider/JsonEntityProvider.java ws/branches/2.1.x/exo.ws.rest.core/src/test/java/org/exoplatform/service= s/rest/impl/provider/JsonEntityTest.java Log: WS-256 : Applied patch. Allow to use a String as entity for a JSON response Modified: ws/branches/2.1.x/exo.ws.rest.core/src/main/java/org/exoplatform/= services/rest/impl/provider/JsonEntityProvider.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.1.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/impl/provider/JsonEntityProvider.java 2010-10-29 07:04:16 UTC (rev = 3362) +++ ws/branches/2.1.x/exo.ws.rest.core/src/main/java/org/exoplatform/servic= es/rest/impl/provider/JsonEntityProvider.java 2010-10-29 07:11:50 UTC (rev = 3363) @@ -30,17 +30,26 @@ import org.exoplatform.ws.frameworks.json.impl.JsonWriterImpl; import org.exoplatform.ws.frameworks.json.value.JsonValue; = +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; import java.lang.annotation.Annotation; import java.lang.reflect.Type; = +import javax.activation.DataSource; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.StreamingOutput; import javax.ws.rs.ext.Provider; +import javax.xml.bind.JAXBElement; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; = /** * @author Andrey Parfonov @@ -59,13 +68,31 @@ // Or probably enough check only content type 'application/json' // and if this content type set trust it and try parse/write = + /** Do not process via JSON "known" JAX-RS types and some more. */ + private static final Class[] IGNORED =3D + new Class[]{byte[].class, char[].class, DataSource.class, DOMSour= ce.class, File.class, InputStream.class, + OutputStream.class, JAXBElement.class, MultivaluedMap.class, Read= er.class, Writer.class, SAXSource.class, + StreamingOutput.class, StreamSource.class, String.class}; + + private static boolean isIgnored(Class type) + { + for (Class c : IGNORED) + { + if (c.isAssignableFrom(type)) + { + return true; + } + } + return false; + } + /** * {@inheritDoc} */ public boolean isReadable(Class type, Type genericType, Annotation[]= annotations, MediaType mediaType) { - // say as support all objects, see _TODO_ above - return Object.class.isAssignableFrom(type); + //return Object.class.isAssignableFrom(type); + return !isIgnored(type); } = /** @@ -104,8 +131,8 @@ */ public boolean isWriteable(Class type, Type genericType, Annotation[= ] annotations, MediaType mediaType) { - // say as support all objects, see _TODO_ above - return Object.class.isAssignableFrom(type); + //return Object.class.isAssignableFrom(type); + return !isIgnored(type); } = /** Modified: ws/branches/2.1.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.1.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/JsonEntityTest.java 2010-10-29 07:04:16 UTC (rev 3362) +++ ws/branches/2.1.x/exo.ws.rest.core/src/test/java/org/exoplatform/servic= es/rest/impl/provider/JsonEntityTest.java 2010-10-29 07:11:50 UTC (rev 3363) @@ -29,7 +29,9 @@ import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; = /** * @author Andrey Parfonov @@ -77,13 +79,42 @@ } } = + @Path("/") + public static class ResourceString + { + @POST + @Consumes("application/json") + public void m1(String b) + { + assertEquals(jsonBook, b); + } + } + + @Path("/") + public static class ResourceString2 + { + @GET + @Produces("application/json") + public String m1() + { + return jsonBook; + } + + @POST + public Response m2() + { + return Response.ok(jsonBook).type(MediaType.APPLICATION_JSON).bui= ld(); + } + } + + private static String jsonBook =3D "{\"title\":\"Hamlet\", \"author\":\= "William Shakespeare\", \"sendByPost\":true}"; + private byte[] jsonData; = public void setUp() throws Exception { super.setUp(); - jsonData =3D - ("{\"title\":\"Hamlet\"," + "\"author\":\"William Shakespeare\","= + "\"sendByPost\":true}").getBytes("UTF-8"); + jsonData =3D jsonBook.getBytes("UTF-8"); } = public void testJsonEntityParameter() throws Exception @@ -125,8 +156,44 @@ assertEquals("Hamlet\n", book.getTitle()); assertEquals("William Shakespeare\n", book.getAuthor()); assertFalse(book.isSendByPost()); -// writer =3D new ByteArrayContainerResponseWriter(); + // writer =3D new ByteArrayContainerResponseWriter(); unregistry(r2); } = + public void testJsonEntityString() throws Exception + { + ResourceString r1 =3D new ResourceString(); + registry(r1); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("content-type", "application/json"); + h.putSingle("content-length", "" + jsonData.length); + assertEquals(204, service("POST", "/", "", h, jsonData).getStatus()); + unregistry(r1); + } + + public void testJsonReturnString() throws Exception + { + ResourceString2 r2 =3D new ResourceString2(); + registry(r2); + MultivaluedMap h =3D new MultivaluedMapImpl(); + h.putSingle("accept", "application/json"); + ByteArrayContainerResponseWriter writer =3D new ByteArrayContainerRe= sponseWriter(); + + // ResourceString2#m1() + ContainerResponse response =3D service("GET", "/", "", h, null, writ= er); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + assertEquals(jsonBook, response.getEntity()); + //System.out.println("string: " + new String(writer.getBody())); + + // ResourceString2#m2() + writer.reset(); + response =3D service("POST", "/", "", h, null, writer); + assertEquals(200, response.getStatus()); + assertEquals("application/json", response.getContentType().toString(= )); + assertEquals(jsonBook, response.getEntity()); + //System.out.println("string: " + new String(writer.getBody())); + + unregistry(r2); + } } --===============8259808785322575465==-- From do-not-reply at jboss.org Fri Oct 29 05:00:34 2010 Content-Type: multipart/mixed; boundary="===============7161210341321918672==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3364 - in kernel/trunk: exo.kernel.commons/src/main/java/org/exoplatform/commons/utils and 4 other directories. Date: Fri, 29 Oct 2010 05:00:33 -0400 Message-ID: <201010290900.o9T90Xue016261@svn01.web.mwc.hst.phx2.redhat.com> --===============7161210341321918672== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-29 05:00:31 -0400 (Fri, 29 Oct 2010) New Revision: 3364 Modified: kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/PrivilegedFileHelper.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/PrivilegedSystemHelper.java kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/ut= ils/SecurityHelper.java kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/= org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/StandaloneContainer.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/configuration/MockConfigurationManagerImpl.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/jmx/MX4JComponentAdapter.java Log: EXOJCR-986: Enable SecurityManager by default 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 2010-10-29 07:11:50 UTC (rev 33= 63) +++ kernel/trunk/exo.kernel.commons/pom.xml 2010-10-29 09:00:31 UTC (rev 33= 64) @@ -60,7 +60,6 @@ src/test/resources **/*.properties - **/test.policy Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/utils/PrivilegedFileHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/PrivilegedFileHelper.java 2010-10-29 07:11:50 UTC (rev 3363) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/PrivilegedFileHelper.java 2010-10-29 09:00:31 UTC (rev 3364) @@ -394,9 +394,9 @@ */ public static void deleteOnExit(final File file) { - PrivilegedAction action =3D new PrivilegedAction() + PrivilegedAction action =3D new PrivilegedAction() { - public Object run() + public Void run() { file.deleteOnExit(); return null; Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/utils/PrivilegedSystemHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/PrivilegedSystemHelper.java 2010-10-29 07:11:50 UTC (rev 3363) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/PrivilegedSystemHelper.java 2010-10-29 09:00:31 UTC (rev 3364) @@ -18,6 +18,8 @@ */ package org.exoplatform.commons.utils; = +import java.io.InputStream; +import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Properties; @@ -74,9 +76,9 @@ */ public static void setProperty(final String key, final String value) { - PrivilegedAction action =3D new PrivilegedAction() + PrivilegedAction action =3D new PrivilegedAction() { - public String run() + public Void run() { System.setProperty(key, value); return null; @@ -103,4 +105,43 @@ }; return AccessController.doPrivileged(action); } + + /** + * Get resource in privileged mode. + * = + * @param key + * @param def + * @return + */ + public static URL getResource(final String name) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public URL run() + { + return Thread.currentThread().getContextClassLoader().getResou= rce(name); + } + }; + return AccessController.doPrivileged(action); + } + + /** + * Get resource as stream in privileged mode. + * = + * @param key + * @param def + * @return + */ + public static InputStream getResourceAsStream(final String name) + { + PrivilegedAction action =3D new PrivilegedAction() + { + public InputStream run() + { + return Thread.currentThread().getContextClassLoader().getResou= rceAsStream(name); + } + }; + return AccessController.doPrivileged(action); + } + } Modified: kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/com= mons/utils/SecurityHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/src/main/java/org/exoplatform/commons/u= tils/SecurityHelper.java 2010-10-29 07:11:50 UTC (rev 3363) +++ kernel/trunk/exo.kernel.commons/src/main/java/org/exoplatform/commons/u= tils/SecurityHelper.java 2010-10-29 09:00:31 UTC (rev 3364) @@ -18,13 +18,18 @@ */ package org.exoplatform.commons.utils; = +import org.xml.sax.SAXException; + import java.io.IOException; +import java.net.MalformedURLException; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.sql.SQLException; = +import javax.xml.parsers.ParserConfigurationException; + /** * Helps running code in privileged = * = @@ -100,6 +105,108 @@ } = /** + * Launches action in privileged mode. Can throw only ParserConfigurati= onException, SAXException. + * = + * @param + * @param action + * @return + * @throws IOException + */ + public static E doPriviledgedParserConfigurationOrSAXExceptionActio= n(PrivilegedExceptionAction action) + throws ParserConfigurationException, SAXException + { + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof ParserConfigurationException) + { + throw (ParserConfigurationException)cause; + } + else if (cause instanceof SAXException) + { + throw (SAXException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Launches action in privileged mode. Can throw only SAXException. + * = + * @param + * @param action + * @return + * @throws IOException + */ + public static E doPriviledgedSAXExceptionAction(PrivilegedException= Action action) throws SAXException + { + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof SAXException) + { + throw (SAXException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** + * Launches action in privileged mode. Can throw only SAXException. + * = + * @param + * @param action + * @return + * @throws IOException + */ + public static E doPriviledgedMalformedURLExceptionAction(Privileged= ExceptionAction action) + throws MalformedURLException + { + try + { + return AccessController.doPrivileged(action); + } + catch (PrivilegedActionException pae) + { + Throwable cause =3D pae.getCause(); + if (cause instanceof MalformedURLException) + { + throw (MalformedURLException)cause; + } + else if (cause instanceof RuntimeException) + { + throw (RuntimeException)cause; + } + else + { + throw new RuntimeException(cause); + } + } + } + + /** * Launches action in privileged mode. Can throw only runtime exception= s. * = * @param Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/mai= n/java/org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper= .java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper.java = 2010-10-29 07:11:50 UTC (rev 3363) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java= /org/exoplatform/services/cache/impl/jboss/util/PrivilegedCacheHelper.java = 2010-10-29 09:00:31 UTC (rev 3364) @@ -45,9 +45,9 @@ */ public static void start(final Cache cache) { - PrivilegedAction action =3D new PrivilegedAction() + PrivilegedAction action =3D new PrivilegedAction() { - public Object run() + public Void run() { cache.start(); return null; @@ -63,9 +63,9 @@ */ public static void stop(final Cache cache) { - PrivilegedAction action =3D new PrivilegedAction() + PrivilegedAction action =3D new PrivilegedAction() { - public Object run() + public Void run() { cache.stop(); return null; @@ -81,9 +81,9 @@ */ public static void create(final Cache cache) { - PrivilegedAction action =3D new PrivilegedAction() + PrivilegedAction action =3D new PrivilegedAction() { - public Object run() + public Void run() { cache.create(); return null; @@ -99,9 +99,9 @@ */ public static void endBatch(final Cache cache, final boole= an successful) { - PrivilegedAction action =3D new PrivilegedAction() + PrivilegedAction action =3D new PrivilegedAction() { - public Object run() + public Void run() { cache.endBatch(successful); return null; Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/StandaloneContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/StandaloneContainer.java 2010-10-29 07:11:50 UTC (rev 3363) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/StandaloneContainer.java 2010-10-29 09:00:31 UTC (rev 3364) @@ -19,6 +19,7 @@ package org.exoplatform.container; = import org.exoplatform.commons.utils.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.configuration.ConfigurationException; import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.container.configuration.ConfigurationManagerImpl; @@ -35,6 +36,7 @@ import java.io.File; import java.net.MalformedURLException; import java.net.URL; +import java.security.PrivilegedExceptionAction; import java.util.List; = /** @@ -199,11 +201,19 @@ * @param path, path to configuration file * @throws MalformedURLException if path is wrong */ - public static void addConfigurationPath(String path) throws MalformedUR= LException + public static void addConfigurationPath(final String path) throws Malfo= rmedURLException { if ((path =3D=3D null) || (path.length() =3D=3D 0)) return; - URL confURL =3D new File(path).toURI().toURL(); + + URL confURL =3D SecurityHelper.doPriviledgedMalformedURLExceptionAct= ion(new PrivilegedExceptionAction() + { + public URL run() throws Exception + { + return new File(path).toURI().toURL(); + } + }); + configurationURL =3D fileExists(confURL) ? confURL : null; } = @@ -305,11 +315,18 @@ return smanager_; } = - private static boolean fileExists(URL url) + private static boolean fileExists(final URL url) { try { - url.openStream().close(); + SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExcep= tionAction() + { + public Void run() throws Exception + { + url.openStream().close(); + return null; + } + }); return true; } catch (Exception e) @@ -331,16 +348,29 @@ // or if (configurationURL =3D=3D null) { - J2EEServerInfo env =3D new J2EEServerInfo(); + final J2EEServerInfo env =3D new J2EEServerInfo(); = // (2) exo-configuration.xml in AS (standalone) home directory - configurationURL =3D (new File(env.getServerHome() + "/exo-config= uration.xml")).toURI().toURL(); + configurationURL =3D + SecurityHelper.doPriviledgedMalformedURLExceptionAction(new Pr= ivilegedExceptionAction() + { + public URL run() throws Exception + { + return (new File(env.getServerHome() + "/exo-configurati= on.xml")).toURI().toURL(); + } + }); = // (3) AS_HOME/conf/exo-conf (JBossAS usecase) if (!fileExists(configurationURL)) { configurationURL =3D - (new File(env.getExoConfigurationDirectory() + "/exo-config= uration.xml")).toURI().toURL(); + SecurityHelper.doPriviledgedMalformedURLExceptionAction(new= PrivilegedExceptionAction() + { + public URL run() throws Exception + { + return (new File(env.getExoConfigurationDirectory() += "/exo-configuration.xml")).toURI().toURL(); + } + }); } = // (4) conf/exo-configuration.xml in war/ear(?) Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/configuration/MockConfigurationManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/MockConfigurationManagerImpl.java 2010-10-29 07:11:50 UTC = (rev 3363) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/configuration/MockConfigurationManagerImpl.java 2010-10-29 09:00:31 UTC = (rev 3364) @@ -55,8 +55,7 @@ else if (uri.startsWith("classpath:")) { String path =3D removePrefix("classpath:/", uri); - ClassLoader cl =3D Thread.currentThread().getContextClassLoader(); - return cl.getResource(path); + return PrivilegedSystemHelper.getResource(path); } else if (uri.startsWith("war:")) { Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/jmx/MX4JComponentAdapter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jmx/MX4JComponentAdapter.java 2010-10-29 07:11:50 UTC (rev 3363) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/jmx/MX4JComponentAdapter.java 2010-10-29 09:00:31 UTC (rev 3364) @@ -18,6 +18,7 @@ */ package org.exoplatform.container.jmx; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.ExoContainer; import org.exoplatform.container.component.ComponentLifecycle; import org.exoplatform.container.component.ComponentPlugin; @@ -31,6 +32,7 @@ import org.picocontainer.defaults.AbstractComponentAdapter; = import java.lang.reflect.Method; +import java.security.PrivilegedExceptionAction; import java.util.List; = /** @@ -134,7 +136,7 @@ return instance_; } = - private void addComponentPlugin(boolean debug, Object component, + private void addComponentPlugin(boolean debug, final Object component, List plugins, ExoCont= ainer container) throws Exception { if (plugins =3D=3D null) @@ -150,15 +152,24 @@ cplugin.setDescription(plugin.getDescription()); Class clazz =3D component.getClass(); = - Method m =3D getSetMethod(clazz, plugin.getSetMethod(), plugin= Class); + final Method m =3D getSetMethod(clazz, plugin.getSetMethod(), = pluginClass); if (m =3D=3D null) { log.error("Cannot find the method '" + plugin.getSetMethod(= ) + "' that has only one parameter of type '" + pluginClass.getName() + "' in the class '" + clazz.get= Name() + "'."); continue; } - Object[] params =3D {cplugin}; - m.invoke(component, params); + final Object[] params =3D {cplugin}; + + SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExce= ptionAction() + { + public Void run() throws Exception + { + m.invoke(component, params); + return null; + } + }); + if (debug) log.debug("=3D=3D> add component plugin: " + cplugin); = --===============7161210341321918672==-- From do-not-reply at jboss.org Fri Oct 29 05:30:43 2010 Content-Type: multipart/mixed; boundary="===============7810717553009993389==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3365 - in core/trunk: exo.core.component.database/src/main/java/org/exoplatform/services/database/creator and 33 other directories. Date: Fri, 29 Oct 2010 05:30:42 -0400 Message-ID: <201010290930.o9T9UgWt023556@svn01.web.mwc.hst.phx2.redhat.com> --===============7810717553009993389== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-29 05:30:37 -0400 (Fri, 29 Oct 2010) New Revision: 3365 Added: core/trunk/exo.core.component.database/src/test/resources/test.policy core/trunk/exo.core.component.ldap/src/test/resources/test.policy core/trunk/exo.core.component.organization.api/src/test/resources/test.p= olicy core/trunk/exo.core.component.organization.jdbc/src/test/resources/test.= policy core/trunk/exo.core.component.organization.ldap/src/test/resources/test.= policy core/trunk/exo.core.component.script.groovy/src/test/resources/TestSimpl= eXMLGenerator.groovy core/trunk/exo.core.component.script.groovy/src/test/resources/test.poli= cy core/trunk/exo.core.component.web.css/src/test/resources/ core/trunk/exo.core.component.web.css/src/test/resources/test.policy core/trunk/exo.core.component.xml-processing/src/test/resources/test.pol= icy Removed: core/trunk/exo.core.component.script.groovy/src/test/resources/SimpleXML= Generator.groovy Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.database/src/main/java/org/exoplatform/ser= vices/database/creator/DBCreator.java core/trunk/exo.core.component.database/src/main/java/org/exoplatform/ser= vices/database/impl/HibernateServiceImpl.java core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/MSExcelDocumentReader.java core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/MSWordDocumentReader.java core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/MSXExcelDocumentReader.java core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/MSXPPTDocumentReader.java core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/MSXWordDocumentReader.java core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/OpenOfficeDocumentReader.java core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/PDFDocumentReader.java core/trunk/exo.core.component.document/src/main/java/org/exoplatform/ser= vices/document/impl/XMLDocumentReader.java core/trunk/exo.core.component.document/src/test/resources/test.policy core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.ldap/src/main/java/org/exoplatform/service= s/ldap/impl/LDAPServiceImpl.java core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.api/src/main/java/org/exoplat= form/services/organization/impl/UserProfileData.java core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exopla= tform/services/organization/hibernate/SimpleHibernateUserListAccess.java core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exopla= tform/services/organization/hibernate/UserDAOImpl.java core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatfor= m/services/script/groovy/GroovyScriptInstantiator.java core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatfor= m/services/script/groovy/jarjar/JarJarClassLoader.java core/trunk/exo.core.component.script.groovy/src/test/java/org/exoplatfor= m/services/script/groovy/GroovyInstantiatorTest.java core/trunk/exo.core.component.script.groovy/src/test/java/org/exoplatfor= m/services/script/groovy/jarjar/Script.java core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.security.core/src/test/resources/test.poli= cy core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatfo= rm/services/xml/resolving/impl/XMLResolver.java core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatfo= rm/services/xml/transform/impl/TransformerBase.java core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatfo= rm/services/xml/transform/impl/html/TidyTransformerImpl.java core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatfo= rm/services/xml/transform/impl/trax/TRAXTemplatesServiceImpl.java core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatfo= rm/services/xml/transform/impl/trax/TRAXTransformerImpl.java Log: EXOJCR-986: Enable SecurityManager by default 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 2010-10-29 09:00:31 UTC = (rev 3364) +++ core/trunk/exo.core.component.database/pom.xml 2010-10-29 09:30:37 UTC = (rev 3365) @@ -61,6 +61,11 @@ exo.kernel.component.cache + org.exoplatform.kernel + exo.kernel.commons.test + test + + javax.resource connector-api test @@ -120,18 +125,54 @@ = - - = - - org.apache.maven.plugins - maven-surefire-plugin - - - **/DBCreatorTest.java - - - - = - + = + + org.apache.maven.plugins + maven-surefire-plugin + + ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.exo= platform.commons.test.TestSecurityManager -Djava.security.policy=3D${projec= t.build.directory}/test-classes/test.policy + + **/DBCreatorTest.java + + + + + maven-antrun-plugin + + + prepare-test-policy + process-test-resources + + + Creating Access Policy for tests + + + + + + + + + + + + + + = + + + run + + + + + + ant + ant-optional + 1.5.3-1 + + + + = Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatf= orm/services/database/creator/DBCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/se= rvices/database/creator/DBCreator.java 2010-10-29 09:00:31 UTC (rev 3364) +++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/se= rvices/database/creator/DBCreator.java 2010-10-29 09:30:37 UTC (rev 3365) @@ -18,14 +18,16 @@ */ package org.exoplatform.services.database.creator; = +import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.configuration.ConfigurationException; import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.PropertiesParam; = -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.security.PrivilegedExceptionAction; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; @@ -197,15 +199,13 @@ { Class.forName(driver); = - // Properties props =3D new java.util.Properties(); - // props.put("user", adminName); - // props.put("password", adminPwd); - // if (internal_logon !=3D null) - // { - // props.put("internal_logon", internal_logon); - // } - // conn =3D DriverManager.getConnection(serverUrl, props); - conn =3D DriverManager.getConnection(serverUrl, adminName, adminP= wd); + conn =3D SecurityHelper.doPriviledgedSQLExceptionAction(new Privi= legedExceptionAction() + { + public Connection run() throws Exception + { + return DriverManager.getConnection(serverUrl, adminName, ad= minPwd); + } + }); } catch (SQLException e) { @@ -219,7 +219,14 @@ String dbProductName; try { - dbProductName =3D conn.getMetaData().getDatabaseProductName(); + final Connection connection =3D conn; + dbProductName =3D SecurityHelper.doPriviledgedSQLExceptionAction(= new PrivilegedExceptionAction() + { + public String run() throws Exception + { + return connection.getMetaData().getDatabaseProductName(); + } + }); = if (dbProductName.startsWith("Microsoft SQL Server") || dbProduct= Name.startsWith("Adaptive Server Anywhere") || dbProductName.equals("Sybase SQL Server") || dbProductName.= equals("Adaptive Server Enterprise")) @@ -334,7 +341,7 @@ */ protected String readScriptResource(String path) throws IOException { - InputStream is =3D new FileInputStream(path); + InputStream is =3D PrivilegedFileHelper.fileInputStream(path); InputStreamReader isr =3D new InputStreamReader(is); try { Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatf= orm/services/database/impl/HibernateServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/se= rvices/database/impl/HibernateServiceImpl.java 2010-10-29 09:00:31 UTC (rev= 3364) +++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/se= rvices/database/impl/HibernateServiceImpl.java 2010-10-29 09:30:37 UTC (rev= 3365) @@ -19,6 +19,8 @@ package org.exoplatform.services.database.impl; = import org.exoplatform.commons.exception.ObjectNotFoundException; +import org.exoplatform.commons.utils.PrivilegedSystemHelper; +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.ExoContainer; import org.exoplatform.container.component.ComponentPlugin; import org.exoplatform.container.component.ComponentRequestLifecycle; @@ -39,6 +41,7 @@ = import java.io.Serializable; import java.net.URL; +import java.security.PrivilegedAction; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; @@ -79,8 +82,14 @@ { threadLocal_ =3D new ThreadLocal(); PropertiesParam param =3D initParams.getPropertiesParam("hibernate.p= roperties"); - HibernateSettingsFactory settingsFactory =3D new HibernateSettingsFa= ctory(new ExoCacheProvider(cacheService)); - conf_ =3D new HibernateConfigurationImpl(settingsFactory); + final HibernateSettingsFactory settingsFactory =3D new HibernateSett= ingsFactory(new ExoCacheProvider(cacheService)); + conf_ =3D SecurityHelper.doPriviledgedAction(new PrivilegedAction() + { + public HibernateConfigurationImpl run() + { + return new HibernateConfigurationImpl(settingsFactory); + } + }); Iterator properties =3D param.getPropertyIterator(); while (properties.hasNext()) { @@ -108,7 +117,8 @@ String connectionURL =3D conf_.getProperty("hibernate.connection.url= "); if (connectionURL !=3D null) { - connectionURL =3D connectionURL.replace("${java.io.tmpdir}", Syst= em.getProperty("java.io.tmpdir")); + connectionURL =3D + connectionURL.replace("${java.io.tmpdir}", PrivilegedSystemHel= per.getProperty("java.io.tmpdir")); conf_.setProperty("hibernate.connection.url", connectionURL); } = @@ -280,8 +290,15 @@ { if (sessionFactory_ =3D=3D null) { - sessionFactory_ =3D conf_.buildSessionFactory(); - new SchemaUpdate(conf_).execute(false, true); + sessionFactory_ =3D SecurityHelper.doPriviledgedAction(new Privil= egedAction() + { + public SessionFactory run() + { + SessionFactory factory =3D conf_.buildSessionFactory(); + new SchemaUpdate(conf_).execute(false, true); + return factory; + } + }); } return sessionFactory_; } Added: core/trunk/exo.core.component.database/src/test/resources/test.policy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test.policy = (rev 0) +++ core/trunk/exo.core.component.database/src/test/resources/test.policy 2= 010-10-29 09:30:37 UTC (rev 3365) @@ -0,0 +1,15 @@ +grant codeBase "@MAVEN_REPO(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@MAIN_CLASSES(a)-"{ + permission java.security.AllPermission; +}; + +grant codeBase "@TEST_CLASSES(a)-"{ +}; + + + + + 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 2010-10-29 09:00:31 UTC = (rev 3364) +++ core/trunk/exo.core.component.document/pom.xml 2010-10-29 09:30:37 UTC = (rev 3365) @@ -104,9 +104,6 @@ tika-parsers = - = - - @@ -140,7 +137,7 @@ org.apache.maven.plugins maven-surefire-plugin - + -Djava.security.manager=3Dorg.exoplatform.commons.= test.TestSecurityManager -Djava.security.policy=3D${project.build.directory= }/test-classes/test.policy + + 1h + org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + exo-domain 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 2010-10-29 11:35:39 UTC (rev 3367) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration.xml 2010-10-29 11:45:18 UTC (rev 3368) @@ -255,7 +255,7 @@ - + bind.datasource addPlugin org.exoplatform.services.naming.BindReferencePlugin @@ -336,7 +336,7 @@ - + bind.datasource addPlugin org.exoplatform.services.naming.BindReferencePlugin @@ -370,6 +370,60 @@ bind-name + jdbcjcrdb2 + + + 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 + jdbcjcr1db2 + + + 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 Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/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/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-jcr-config.xml 2010-10-29 11:35:39 UTC (rev 3367) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-jcr-config.xml 2010-10-29 11:45:18 UTC (rev 3368) @@ -207,94 +207,204 @@ = - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - = - - - - - - - - - - - - - - - - - - - - - - - - - - = - - = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + = + + = + + + = - + + exo-domain + + + 1h + org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + - + exo-domain Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/test.policy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test.policy 2010-10= -29 11:35:39 UTC (rev 3367) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/test.policy 2010-10= -29 11:45:18 UTC (rev 3368) @@ -9,4 +9,6 @@ grant codeBase "@TEST_CLASSES(a)-"{ permission java.lang.RuntimePermission "createSystemSession"; permission java.lang.RuntimePermission "manageRepository"; + permission java.lang.RuntimePermission "invokeInternalAPI"; }; + --===============6944084936587232735==-- From do-not-reply at jboss.org Fri Oct 29 08:05:07 2010 Content-Type: multipart/mixed; boundary="===============3758657579759982703==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3369 - jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone. Date: Fri, 29 Oct 2010 08:05:07 -0400 Message-ID: <201010291205.o9TC57WU016117@svn01.web.mwc.hst.phx2.redhat.com> --===============3758657579759982703== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2010-10-29 08:05:06 -0400 (Fri, 29 Oct 2010) New Revision: 3369 Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test= -configuration-sjdbc.xml jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test= -jcr-config-sjdbc.xml Log: JCR-1485: fix sjdbc configuration Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/test-configuration-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/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration-sjdbc.xml 2010-10-29 11:45:18 UTC (rev 3368) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration-sjdbc.xml 2010-10-29 12:05:06 UTC (rev 3369) @@ -289,6 +289,33 @@ bind-name + jdbcjcrdb2 + + + 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 Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/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/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-jcr-config-sjdbc.xml 2010-10-29 11:45:18 UTC (rev 3368) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-jcr-config-sjdbc.xml 2010-10-29 12:05:06 UTC (rev 3369) @@ -295,6 +295,126 @@ = + + exo-domain + + + 1h + org.exoplatform.services.jcr.impl.core.acc= ess.JAASAuthenticator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + + exo-domain --===============3758657579759982703==-- From do-not-reply at jboss.org Fri Oct 29 11:43:23 2010 Content-Type: multipart/mixed; boundary="===============9021597119925871063==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r3370 - jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster. Date: Fri, 29 Oct 2010 11:43:23 -0400 Message-ID: <201010291543.o9TFhNeA011664@svn01.web.mwc.hst.phx2.redhat.com> --===============9021597119925871063== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2010-10-29 11:43:22 -0400 (Fri, 29 Oct 2010) New Revision: 3370 Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/= jbosscache-data.xml jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/= jbosscache-indexer.xml jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/= jbosscache-lock.xml jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster/= udp-mux.xml Log: EXOJCR-1028: configs updated Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/c= luster/jbosscache-data.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resources/conf/portal/cluster= /jbosscache-data.xml 2010-10-29 12:05:06 UTC (rev 3369) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster= /jbosscache-data.xml 2010-10-29 15:43:22 UTC (rev 3370) @@ -6,22 +6,16 @@ = - = - - - - \ No newline at end of file Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/c= luster/jbosscache-indexer.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resources/conf/portal/cluster= /jbosscache-indexer.xml 2010-10-29 12:05:06 UTC (rev 3369) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster= /jbosscache-indexer.xml 2010-10-29 15:43:22 UTC (rev 3370) @@ -3,10 +3,11 @@ = + + = - Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/c= luster/jbosscache-lock.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/resources/conf/portal/cluster= /jbosscache-lock.xml 2010-10-29 12:05:06 UTC (rev 3369) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/portal/cluster= /jbosscache-lock.xml 2010-10-29 15:43:22 UTC (rev 3370) @@ -6,14 +6,14 @@ = - = - - - + + + + = - - - - - = + use_concurrent_stack=3D"true" = + + thread_pool.enabled=3D"true" = + thread_pool.min_threads=3D"2" + thread_pool.max_threads=3D"8" = + thread_pool.keep_alive_time=3D"5000" = + thread_pool.queue_enabled=3D"true" + thread_pool.queue_max_size=3D"1000" + thread_pool.rejection_policy=3D"discard" + + oob_thread_pool.enabled=3D"true" + oob_thread_pool.min_threads=3D"1" + oob_thread_pool.max_threads=3D"8" + oob_thread_pool.keep_alive_time=3D"5000" + oob_thread_pool.queue_enabled=3D"false" = + oob_thread_pool.queue_max_size=3D"100" = + oob_thread_pool.rejection_policy=3D"Run" /> + + + + + + + + + + + + + + + + + + --===============9021597119925871063==--