From do-not-reply at jboss.org Fri Jul 1 04:50:59 2011 Content-Type: multipart/mixed; boundary="===============3407206996448342476==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4570 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management. Date: Fri, 01 Jul 2011 04:50:59 -0400 Message-ID: <201107010850.p618ox9o006259@svn01.web.mwc.hst.phx2.redhat.com> --===============3407206996448342476== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-01 04:50:58 -0400 (Fri, 01 Jul 2011) New Revision: 4570 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/management/ManageableContainer.java kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/management/ManagementContextImpl.java Log: EXOJCR-1068 : Unregister all MBeans on container stop. Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/management/ManageableContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/management/ManageableContainer.java 2011-06-30 14:54:37 UTC (rev 4569) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/management/ManageableContainer.java 2011-07-01 08:50:58 UTC (rev 4570) @@ -52,8 +52,7 @@ * @author Julien Viet * @version $Revision$ */ -public class ManageableContainer - extends CachingContainer +public class ManageableContainer extends CachingContainer { = /** @@ -69,7 +68,7 @@ = /** . */ private static final ThreadLocal hac= k =3D - new ThreadLocal(); + new ThreadLocal(); = /** . */ final ManagementContextImpl managementContext; @@ -78,8 +77,9 @@ private MBeanServer server; = private volatile boolean objectNameSet; + private ObjectName objectName; - = + /** . */ private final Set providers; = @@ -88,7 +88,7 @@ = public ManageableContainer() { - this((PicoContainer) null); + this((PicoContainer)null); } = public ManageableContainer(PicoContainer parent) @@ -113,12 +113,12 @@ ManagementContextImpl parentCtx =3D null; if (parent instanceof ManageableContainer) { - ManageableContainer manageableParent =3D (ManageableContainer) pa= rent; + ManageableContainer manageableParent =3D (ManageableContainer)par= ent; parentCtx =3D manageableParent.managementContext; } = // - this.parent =3D parent instanceof ManageableContainer ? (ManageableC= ontainer) parent : null; + this.parent =3D parent instanceof ManageableContainer ? (ManageableC= ontainer)parent : null; = // if (parentCtx !=3D null) @@ -156,7 +156,7 @@ } = private static ManageableComponentAdapterFactory getComponentAdapterFac= tory( - ComponentAdapterFactory componentAdapterFactory) + ComponentAdapterFactory componentAdapterFactory) { ManageableComponentAdapterFactory factory =3D new ManageableComponen= tAdapterFactory(componentAdapterFactory); hack.set(factory); @@ -196,7 +196,7 @@ { MBeanScopingData scopingData =3D list.get(i - 1); props.putAll(scopingData); - } = + } try { this.objectName =3D JMX.createObjectName("exo", props= ); @@ -204,7 +204,7 @@ catch (Exception e) { LOG.error("Could not create the object name", e); - } = + } } this.objectNameSet =3D true; } @@ -212,9 +212,9 @@ } return objectName; } - = + public ComponentAdapter registerComponentInstance(Object componentKey, = Object componentInstance) - throws PicoRegistrationException + throws PicoRegistrationException { ComponentAdapter adapter =3D super.registerComponentInstance(compone= ntKey, componentInstance); if (managementContext !=3D null) @@ -224,13 +224,36 @@ // Register if it is a management provider if (componentInstance instanceof ManagementProvider) { - ManagementProvider provider =3D (ManagementProvider) component= Instance; + ManagementProvider provider =3D (ManagementProvider)componentI= nstance; addProvider(provider); } } return adapter; } = + @Override + public ComponentAdapter unregisterComponent(Object componentKey) + { + ComponentAdapter adapter =3D getComponentAdapter(componentKey); + + if (managementContext !=3D null && adapter !=3D null) + { + managementContext.unregister(adapter.getComponentInstance(this)); + } + return super.unregisterComponent(componentKey); + } + + @Override + public void stop() + { + if (managementContext !=3D null) + { + // un-manage all registered MBeans + managementContext.unregisterAll(); + } + super.stop(); + }; + /** * Returns the list of the providers which are relevant for this contai= ner. * Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/management/ManagementContextImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/management/ManagementContextImpl.java 2011-06-30 14:54:37 UTC (rev 4569) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/management/ManagementContextImpl.java 2011-07-01 08:50:58 UTC (rev 4570) @@ -33,8 +33,10 @@ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; = /** * @author Julien Viet @@ -237,6 +239,10 @@ } } = + /** + * = + * {@inheritDoc} + */ public void unregister(Object o) { ManagementContextImpl context =3D registrations.remove(o); @@ -247,6 +253,26 @@ } } } + = + /** + * Unmanages (unregisters) all early registered MBeans in ManagementPro= viders + */ + public void unregisterAll() + { + Iterator> iterator =3D registra= tions.entrySet().iterator(); + while (iterator.hasNext()) + { + Entry contextEntry =3D iterator.ne= xt(); + iterator.remove(); + if (contextEntry.getValue() !=3D null) + { + for (Map.Entry provider : contextE= ntry.getValue().managedSet.entrySet()) + { + provider.getKey().unmanage(provider.getValue()); + } + } + } + } = public List getScopingData(Class scopeType) { --===============3407206996448342476==-- From do-not-reply at jboss.org Fri Jul 1 04:57:53 2011 Content-Type: multipart/mixed; boundary="===============5805604079599429740==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4571 - in core/trunk/exo.core.component.database/src: test/java/org/exoplatform/services/database and 1 other directory. Date: Fri, 01 Jul 2011 04:57:52 -0400 Message-ID: <201107010857.p618vqiV006664@svn01.web.mwc.hst.phx2.redhat.com> --===============5805604079599429740== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 04:57:52 -0400 (Fri, 01 Jul 2011) New Revision: 4571 Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/ser= vices/database/creator/DBConnectionInfo.java core/trunk/exo.core.component.database/src/main/java/org/exoplatform/ser= vices/database/creator/DBCreator.java core/trunk/exo.core.component.database/src/test/java/org/exoplatform/ser= vices/database/TestDBCreator.java Log: EXOJCR-1398: Allow to initialize DBCreator with custome set of parameters Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatf= orm/services/database/creator/DBConnectionInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/DBConnectionInfo.java 2011-07-01 08:50:58 UTC (rev = 4570) +++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/se= rvices/database/creator/DBConnectionInfo.java 2011-07-01 08:57:52 UTC (rev = 4571) @@ -30,13 +30,16 @@ { private final Map connectionProperties; = + private final String dbName; + /** * DBConnectionInfo constructor. * @param connectionProperties * connection properties = */ - public DBConnectionInfo(Map connectionProperties) + public DBConnectionInfo(String dbName, Map connectionPr= operties) { + this.dbName =3D dbName; this.connectionProperties =3D connectionProperties; } = @@ -44,4 +47,9 @@ { return connectionProperties; } + + public String getDBName() + { + return dbName; + } } 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 2011-07-01 08:50:58 UTC (rev 4570) +++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/se= rvices/database/creator/DBCreator.java 2011-07-01 08:57:52 UTC (rev 4571) @@ -46,22 +46,24 @@ public class DBCreator { = - private final static String DB_CONNECTION =3D "db-connection"; + private final static String CONNECTION_PROPERTIES =3D "db-connection"; = - private final static String DB_DRIVER =3D "driverClassName"; + private final static String DRIVER_NAME =3D "driverClassName"; = - private final static String DB_URL =3D "url"; + private final static String SERVER_URL =3D "url"; = - private final static String DB_USERNAME =3D "username"; + private final static String USERNAME =3D "username"; = - private final static String DB_PASSWORD =3D "password"; + private final static String PASSWORD =3D "password"; = - private final static String DB_ORCL_INTERNAL_LOGON =3D "internal_logon"; + private final static String DB_CREATION_PROPERTIES =3D "db-creation"; = - private final static String DB_CREATION =3D "db-creation"; - private final static String DB_SCRIPT_PATH =3D "scriptPath"; = + private final static String DB_USERNAME =3D "username"; + + private final static String DB_PASSWORD =3D "password"; + /** * Database template. */ @@ -110,34 +112,52 @@ * @configurationManager = * configuration manager instance = */ - public DBCreator(InitParams params, ConfigurationManager configurationM= anager) throws ConfigurationException + public DBCreator(String serverUrl, Map connectionProper= ties, String scriptPath, String dbUserName, + String dbPassword, ConfigurationManager cm) throws ConfigurationExce= ption { + this.serverUrl =3D serverUrl; + this.connectionProperties =3D connectionProperties; + this.dbUserName =3D dbUserName; + this.dbPassword =3D dbPassword; + this.dbScript =3D findScriptResource(scriptPath, cm); + } + + /** + * DBCreator constructor. + * = + * @param params + * Initializations parameters + * @configurationManager = + * configuration manager instance = + */ + public DBCreator(InitParams params, ConfigurationManager cm) throws Con= figurationException + { if (params =3D=3D null) { throw new ConfigurationException("Initializations parameters expe= cted"); } = - PropertiesParam prop =3D params.getPropertiesParam(DB_CONNECTION); + PropertiesParam prop =3D params.getPropertiesParam(CONNECTION_PROPER= TIES); = if (prop !=3D null) { - if (prop.getProperty(DB_DRIVER) =3D=3D null) + if (prop.getProperty(DRIVER_NAME) =3D=3D null) { throw new ConfigurationException("driverClassName expected in = db-connection properties section"); } = - serverUrl =3D prop.getProperty(DB_URL); + serverUrl =3D prop.getProperty(SERVER_URL); if (serverUrl =3D=3D null) { throw new ConfigurationException("url expected in db-connectio= n properties section"); } = - if (prop.getProperty(DB_USERNAME) =3D=3D null) + if (prop.getProperty(USERNAME) =3D=3D null) { throw new ConfigurationException("username expected in db-conn= ection properties section"); } = - if (prop.getProperty(DB_PASSWORD) =3D=3D null) + if (prop.getProperty(PASSWORD) =3D=3D null) { throw new ConfigurationException("password expected in db-conn= ection properties section"); } @@ -148,7 +168,7 @@ while (pit.hasNext()) { Property p =3D pit.next(); - if (!p.getName().equalsIgnoreCase(DB_URL)) + if (!p.getName().equalsIgnoreCase(SERVER_URL)) { connectionProperties.put(p.getName(), p.getValue()); } @@ -159,29 +179,13 @@ throw new ConfigurationException("db-connection properties expect= ed in initializations parameters"); } = - prop =3D params.getPropertiesParam(DB_CREATION); + prop =3D params.getPropertiesParam(DB_CREATION_PROPERTIES); if (prop !=3D null) { String scriptPath =3D prop.getProperty(DB_SCRIPT_PATH); if (scriptPath !=3D null) { - String dbScript; - try - { - dbScript =3D readScriptResource(configurationManager.getInp= utStream(scriptPath)); - } - catch (Exception e) - { - try - { - dbScript =3D readScriptResource(PrivilegedFileHelper.fil= eInputStream(scriptPath)); - } - catch (IOException ioe) - { - throw new ConfigurationException("Can't read script reso= urce " + scriptPath, e); - } - } - this.dbScript =3D dbScript; + this.dbScript =3D findScriptResource(scriptPath, cm); } else { @@ -217,43 +221,13 @@ * @throws DBCreatorException * if any error occurs = */ - public DBConnectionInfo createDatabase(String dbName) throws DBCreatorE= xception + public DBConnectionInfo createDatabase(final String dbName) throws DBCr= eatorException { - Connection conn =3D null; + Connection conn =3D openConnection(); try { - Class.forName(connectionProperties.get(DB_DRIVER)); + String dbProductName =3D getDBProductName(conn); = - conn =3D SecurityHelper.doPrivilegedSQLExceptionAction(new Privil= egedExceptionAction() - { - public Connection run() throws Exception - { - return DriverManager.getConnection(serverUrl, connectionPro= perties.get(DB_USERNAME), - connectionProperties.get(DB_PASSWORD)); - } - }); - } - catch (SQLException e) - { - throw new DBCreatorException("Can't establish the JDBC connection= to database " + serverUrl, e); - } - catch (ClassNotFoundException e) - { - throw new DBCreatorException("Can't load the JDBC driver " + conn= ectionProperties.get(DB_DRIVER), e); - } - - String dbProductName; - try - { - final Connection connection =3D conn; - dbProductName =3D SecurityHelper.doPrivilegedSQLExceptionAction(n= ew 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")) { @@ -263,6 +237,8 @@ { executeBatchMode(conn, dbName); } + + return constructDBConnectionInfo(dbName, dbProductName); } catch (SQLException e) { @@ -286,8 +262,6 @@ throw new DBCreatorException("Can't close connection", e); } } - - return constructDBConnectionInfo(dbName, dbProductName); } = /** @@ -296,49 +270,15 @@ * @param dbName * new database name * @throws DBCreatorException - * if any error occurs = + * if any error occurs or database is not available */ public DBConnectionInfo getDBConnectionInfo(String dbName) throws DBCre= atorException { - Connection conn =3D null; + Connection conn =3D openConnection(); try { - Class.forName(connectionProperties.get(DB_DRIVER)); - - conn =3D SecurityHelper.doPrivilegedSQLExceptionAction(new Privil= egedExceptionAction() - { - public Connection run() throws Exception - { - return DriverManager.getConnection(serverUrl, connectionPro= perties.get(DB_USERNAME), - connectionProperties.get(DB_PASSWORD)); - } - }); + return constructDBConnectionInfo(dbName, getDBProductName(conn)); } - catch (SQLException e) - { - throw new DBCreatorException("Can't establish the JDBC connection= to database " + serverUrl, e); - } - catch (ClassNotFoundException e) - { - throw new DBCreatorException("Can't load the JDBC driver " + conn= ectionProperties.get(DB_DRIVER), e); - } - - String dbProductName; - try - { - final Connection connection =3D conn; - dbProductName =3D SecurityHelper.doPrivilegedSQLExceptionAction(n= ew PrivilegedExceptionAction() - { - public String run() throws Exception - { - return connection.getMetaData().getDatabaseProductName(); - } - }); - } - catch (SQLException e) - { - throw new DBCreatorException("Can't resolve database product name= ", e); - } finally { try @@ -350,8 +290,6 @@ throw new DBCreatorException("Can't close connection", e); } } - - return constructDBConnectionInfo(dbName, dbProductName); } = /** @@ -389,6 +327,10 @@ * database name * @param dbProductName * database product name + * @param serverUrl + * url to DB server + * @param connectionProperties + * connection properties = * @return DBConnectionInfo */ private DBConnectionInfo constructDBConnectionInfo(String dbName, Strin= g dbProductName) @@ -410,14 +352,15 @@ // clone connection properties Map connProperties =3D new HashMap(); = - for (Entry entry : this.connectionProperties.entrySe= t()) + for (Entry entry : connectionProperties.entrySet()) { connProperties.put(entry.getKey(), entry.getValue()); } = - connProperties.put(DB_URL, dbUrl); + // add url to database + connProperties.put(SERVER_URL, dbUrl); = - return new DBConnectionInfo(connProperties); + return new DBConnectionInfo(dbName, connProperties); } = /** @@ -452,7 +395,7 @@ /** * Read SQL script from {@link InputStream}. */ - protected String readScriptResource(InputStream is) throws IOException + private String readResource(InputStream is) throws IOException { InputStreamReader isr =3D new InputStreamReader(is); try @@ -474,6 +417,37 @@ } = /** + * Find script resource. + * = + * @param scriptPath + * path to the script + * @param cm + * the configuration manager will help to find script in jars = = + * @return + * script content + * @throws ConfigurationException = + * if script not found + */ + private String findScriptResource(String scriptPath, ConfigurationManag= er cm) throws ConfigurationException + { + try + { + return readResource(cm.getInputStream(scriptPath)); + } + catch (Exception e) + { + try + { + return readResource(PrivilegedFileHelper.fileInputStream(scrip= tPath)); + } + catch (IOException ioe) + { + throw new ConfigurationException("Can't read script resource "= + scriptPath, e); + } + } + } + + /** * Clean whitespace. */ private String cleanWhitespaces(String string) @@ -492,4 +466,68 @@ } return string; } + + /** + * Open connection to the DB. + * = + * @param connectionProperties + * connection properties + * @return connection + * @throws DBCreatorException + * if can't establish connection to DB + */ + private Connection openConnection() throws DBCreatorException + { + Connection conn =3D null; + try + { + Class.forName(connectionProperties.get(DRIVER_NAME)); + + conn =3D SecurityHelper.doPrivilegedSQLExceptionAction(new Privil= egedExceptionAction() + { + public Connection run() throws Exception + { + return DriverManager.getConnection(serverUrl, connectionPro= perties.get(USERNAME), + connectionProperties.get(PASSWORD)); + } + }); + + return conn; + } + catch (SQLException e) + { + throw new DBCreatorException("Can't establish the JDBC connection= to database " + serverUrl, e); + } + catch (ClassNotFoundException e) + { + throw new DBCreatorException("Can't load the JDBC driver " + conn= ectionProperties.get(DRIVER_NAME), e); + } + } + + /** + * Get database product name. + * = + * @param conn + * connection to database + * @return product name + * @throws DBCreatorException + * if can't resolve database product name + */ + private String getDBProductName(final Connection conn) throws DBCreator= Exception + { + try + { + return SecurityHelper.doPrivilegedSQLExceptionAction(new Privileg= edExceptionAction() + { + public String run() throws Exception + { + return conn.getMetaData().getDatabaseProductName(); + } + }); + } + catch (SQLException e) + { + throw new DBCreatorException("Can't resolve database product name= ", e); + } + } } Modified: core/trunk/exo.core.component.database/src/test/java/org/exoplatf= orm/services/database/TestDBCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/se= rvices/database/TestDBCreator.java 2011-07-01 08:50:58 UTC (rev 4570) +++ core/trunk/exo.core.component.database/src/test/java/org/exoplatform/se= rvices/database/TestDBCreator.java 2011-07-01 08:57:52 UTC (rev 4571) @@ -21,11 +21,13 @@ import junit.framework.TestCase; = import org.exoplatform.container.PortalContainer; +import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.services.database.creator.DBConnectionInfo; import org.exoplatform.services.database.creator.DBCreator; import org.exoplatform.services.naming.InitialContextInitializer; = import java.sql.Connection; +import java.util.HashMap; import java.util.Map; = import javax.sql.DataSource; @@ -41,11 +43,12 @@ = private InitialContextInitializer initContext; = + private PortalContainer container; + @Override public void setUp() throws Exception { - PortalContainer container =3D PortalContainer.getInstance(); - + container =3D PortalContainer.getInstance(); dbCreator =3D (DBCreator)container.getComponentInstanceOfType(DBCrea= tor.class); initContext =3D (InitialContextInitializer)container.getComponentIns= tanceOfType(InitialContextInitializer.class); } @@ -61,9 +64,9 @@ Map connProps1 =3D dbInfo1.getProperties(); = assertEquals(connProps.get("driverClassName"), connProps1.get("drive= rClassName")); + assertEquals(connProps.get("username"), connProps1.get("username")); + assertEquals(connProps.get("url"), connProps1.get("url")); assertEquals(connProps.get("password"), connProps1.get("password")); - assertEquals(connProps.get("url"), connProps1.get("url")); - assertEquals(connProps.get("username"), connProps1.get("username")); = Map refAddr =3D dbInfo.getProperties(); = @@ -77,6 +80,43 @@ assertNotNull(conn); } = + public void testDBCreateWithSpecificProperties() throws Exception + { + assertNotNull(dbCreator); + = + String serverUrl =3D "jdbc:hsqldb:file:target/temp/data/dbcreator_te= st"; + Map connectionProperties =3D new HashMap(); + connectionProperties.put("driverClassName", "org.hsqldb.jdbcDriver"); + connectionProperties.put("username", "sa"); + connectionProperties.put("password", ""); + + ConfigurationManager cm =3D (ConfigurationManager)container.getCompo= nentInstanceOfType(ConfigurationManager.class); + DBCreator dbCreator =3D + new DBCreator(serverUrl, connectionProperties, "classpath:/dbcrea= tor/test.sql", "sa", "", cm); + + DBConnectionInfo dbInfo =3D dbCreator.createDatabase("testdb"); + DBConnectionInfo dbInfo1 =3D dbCreator.getDBConnectionInfo("testdb"); + + Map connProps =3D dbInfo.getProperties(); + Map connProps1 =3D dbInfo1.getProperties(); + + assertEquals(connProps.get("driverClassName"), connProps1.get("drive= rClassName")); + assertEquals(connProps.get("username"), connProps1.get("username")); + assertEquals(connProps.get("url"), connProps1.get("url")); + assertEquals(connProps.get("password"), connProps1.get("password")); + + Map refAddr =3D dbInfo.getProperties(); + + initContext.bind("testjdbcjcr2", "javax.sql.DataSource", "org.apache= .commons.dbcp.BasicDataSourceFactory", null, + refAddr); + + DataSource ds =3D (DataSource)initContext.getInitialContext().lookup= ("testjdbcjcr2"); + assertNotNull(ds); + + Connection conn =3D ds.getConnection(); + assertNotNull(conn); + } + public void testDBCreateMultiThread() throws Exception { DBCreateThread[] queue =3D new DBCreateThread[100]; --===============5805604079599429740==-- From do-not-reply at jboss.org Fri Jul 1 05:49:43 2011 Content-Type: multipart/mixed; boundary="===============1978801374008330859==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4572 - in jcr/trunk: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation and 5 other directories. Date: Fri, 01 Jul 2011 05:49:42 -0400 Message-ID: <201107010949.p619ngUA016801@svn01.web.mwc.hst.phx2.redhat.com> --===============1978801374008330859== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 05:49:42 -0400 (Fri, 01 Jul 2011) New Revision: 4572 Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/DBCreationProperties.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/StorageCreationProperties.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/cluster/ jcr/trunk/exo.jcr.component.ext/src/test/resources/test-mysql.sql Modified: jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationService.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/BaseStandaloneTest.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/TestRepositoryCreationService.java jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-= configuration.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/repository-creation-service.xml Log: EXOJCR-1398: Allow to create repository with custome set of DB connection Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-01 08:57:52 UTC (rev 45= 71) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-01 09:49:42 UTC (rev 45= 72) @@ -139,7 +139,12 @@ 8.3-606.jdbc3 test - = + + mysql + mysql-connector-java + 5.1.14 + test + = @@ -199,6 +204,7 @@ **/replication/external/BaseTestCaseChecker.java **/access/*.java **/LocalStorageMultithreadTest.java + **/repository/creation/cluster.java Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/servic= es/jcr/ext/repository/creation/DBCreationProperties.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/DBCreationProperties.java = (rev 0) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/DBCreationProperties.java 2011-07-01 09:49:42 U= TC (rev 4572) @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2011 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.repository.creation; + +import org.exoplatform.services.jcr.impl.Constants; + +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +/** + * @author Anatoliy Bazko + * @version $Id: DBCreationProperties.java 34360 2009-07-22 23:58:59Z tolu= sha $ + */ +public class DBCreationProperties implements StorageCreationProperties +{ + private String serverUrl; + + private Map connProps; + + private String dbScriptPath; + + private String dbUserName; + + private String dbPassword; + + /** + * Constructor DBCreationProperties. = + */ + public DBCreationProperties(String serverUrl, Map connP= rops, String dbScriptPath, String dbUserName, + String dbPassword) + { + this.serverUrl =3D serverUrl; + this.connProps =3D connProps; + this.dbScriptPath =3D dbScriptPath; + this.dbUserName =3D dbUserName; + this.dbPassword =3D dbPassword; + } + + /** + * Constructor DBCreationProperties. = + */ + public DBCreationProperties() + { + } + + /** + * Returns script path. + */ + public String getDBScriptPath() + { + return dbScriptPath; + } + + /** + * Returns return username for new database. + */ + public String getDBUserName() + { + return dbUserName; + } + + /** + * Returns new user's password. + */ + public String getDBPassword() + { + return dbPassword; + } + + /** + * Returns url to db server. + */ + public String getServerUrl() + { + return serverUrl; + } + + /** + * Returns connection properties. + */ + public Map getConnProps() + { + return Collections.unmodifiableMap(connProps); + } + + /** + * {@inheritDoc} + */ + public void writeExternal(ObjectOutput out) throws IOException + { + byte[] buf =3D serverUrl.getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(buf.length); + out.write(buf); + + buf =3D dbScriptPath.getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(buf.length); + out.write(buf); + + buf =3D dbUserName.getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(buf.length); + out.write(buf); + + buf =3D dbPassword.getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(buf.length); + out.write(buf); + + out.writeInt(connProps.size()); + for (Entry entry : connProps.entrySet()) + { + buf =3D entry.getKey().getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(buf.length); + out.write(buf); + + buf =3D entry.getValue().getBytes(Constants.DEFAULT_ENCODING); + out.writeInt(buf.length); + out.write(buf); + } + } + + /** + * {@inheritDoc} + */ + public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException + { + byte[] buf =3D new byte[in.readInt()]; + in.readFully(buf); + serverUrl =3D new String(buf, Constants.DEFAULT_ENCODING); + + buf =3D new byte[in.readInt()]; + in.readFully(buf); + dbScriptPath =3D new String(buf, Constants.DEFAULT_ENCODING); + + buf =3D new byte[in.readInt()]; + in.readFully(buf); + dbUserName =3D new String(buf, Constants.DEFAULT_ENCODING); + + buf =3D new byte[in.readInt()]; + in.readFully(buf); + dbPassword =3D new String(buf, Constants.DEFAULT_ENCODING); + + int count =3D in.readInt(); + connProps =3D new HashMap(count); + + for (int i =3D 0; i < count; i++) + { + buf =3D new byte[in.readInt()]; + in.readFully(buf); + String key =3D new String(buf, Constants.DEFAULT_ENCODING); + + buf =3D new byte[in.readInt()]; + in.readFully(buf); + String value =3D new String(buf, Constants.DEFAULT_ENCODING); + + connProps.put(key, value); + } + } +} Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationService.java 2011-07-01 08:57= :52 UTC (rev 4571) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationService.java 2011-07-01 09:49= :42 UTC (rev 4572) @@ -30,6 +30,20 @@ public interface RepositoryCreationService { /** + * Reserves, validates and creates repository in a simplified form. + * = + * @param rEntry - repository Entry - note that datasource must not exi= st. + * @param backupId - backup id + * @param creationProps - storage creation properties = + * @throws RepositoryConfigurationException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + * @throws RepositoryCreationServiceException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + */ + void createRepository(String backupId, RepositoryEntry rEntry, StorageC= reationProperties creationProps) + throws RepositoryConfigurationException, RepositoryCreationException; + + /** * Reserves, validates and creates repository in a simplified form. = * = * @param rEntry - repository Entry - note that datasource must not exi= st. @@ -53,7 +67,23 @@ String reserveRepositoryName(String repositoryName) throws RepositoryCr= eationException; = /** - * Creates repository, using token of already reserved repository name= . Good for cases, = + * Creates repository, using token of already reserved repository name. = + * Good for cases, when repository creation should be delayed or made a= synchronously in dedicated thread. = + * = + * @param rEntry - repository entry - note, that datasource must not ex= ist + * @param backupId - backup id + * @param rToken - token + * @param creationProps - storage creation properties + * @throws RepositoryConfigurationException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + * @throws RepositoryCreationServiceException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + */ + void createRepository(String backupId, RepositoryEntry rEntry, String r= Token, StorageCreationProperties creationProps) + throws RepositoryConfigurationException, RepositoryCreationException; + + /** + * Creates repository, using token of already reserved repository name.= Good for cases, = * when repository creation should be delayed or made asynchronously in= dedicated thread. = * = * @param rEntry - repository entry - note, that datasource must not ex= ist Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-01 0= 8:57:52 UTC (rev 4571) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-01 0= 9:49:42 UTC (rev 4572) @@ -17,6 +17,9 @@ package org.exoplatform.services.jcr.ext.repository.creation; = import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.container.ExoContainerContext; +import org.exoplatform.container.configuration.ConfigurationException; +import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.services.database.creator.DBConnectionInfo; import org.exoplatform.services.database.creator.DBCreator; import org.exoplatform.services.database.creator.DBCreatorException; @@ -79,6 +82,9 @@ */ private static final Log LOG =3D ExoLogger.getLogger("exo.jcr.component= .core.RepositoryCreationService"); = + /** + * The Repository service. + */ private final RepositoryService repositoryService; = /** @@ -92,10 +98,11 @@ private final BackupManager backupManager; = /** - * DBCreator used to create database. Only database not tables, indexes= , etc. + * Exo container context; */ - private final DBCreator dbCreator; + private ExoContainerContext context; = + /** * InitalContextInitalizer used to bind new datasource. */ @@ -116,102 +123,104 @@ * Constructor RepositoryCreationServiceImpl. */ public RepositoryCreationServiceImpl(RepositoryService repositoryServic= e, BackupManager backupManager, - DBCreator dbCreator, InitialContextInitializer initialContextInitial= izer) + ExoContainerContext context, InitialContextInitializer initialContex= tInitializer) { - this.repositoryService =3D repositoryService; - this.backupManager =3D backupManager; - this.rpcService =3D null; - this.dbCreator =3D dbCreator; - this.initialContextInitializer =3D initialContextInitializer; - - LOG.warn("RepositoryCreationService initialized without RPCService, = so other cluser nodes will" - + " not be notified about new repositories."); + this(repositoryService, backupManager, context, initialContextInitia= lizer, null); } = /** * Constructor RepositoryCreationServiceImpl. */ public RepositoryCreationServiceImpl(RepositoryService repositoryServic= e, BackupManager backupManager, - DBCreator dbCreator, InitialContextInitializer initialContextInitial= izer, final RPCService rpcService) + ExoContainerContext context, InitialContextInitializer initialContex= tInitializer, final RPCService rpcService) { this.repositoryService =3D repositoryService; this.backupManager =3D backupManager; this.rpcService =3D rpcService; - this.dbCreator =3D dbCreator; + this.context =3D context; this.initialContextInitializer =3D initialContextInitializer; = - // register commands - reserveRepositoryName =3D rpcService.registerCommand(new RemoteComma= nd() + if (rpcService !=3D null) { - - public String getId() + // register commands + reserveRepositoryName =3D rpcService.registerCommand(new RemoteCo= mmand() { - return "org.exoplatform.services.jcr.ext.repository.creation.R= epositoryCreationServiceImpl-reserveRepositoryName"; - } = - public Serializable execute(Serializable[] args) throws Throwable - { - String repositoryName =3D (String)args[0]; - return reserveRepositoryNameLocally(repositoryName); - } - }); + public String getId() + { + return "org.exoplatform.services.jcr.ext.repository.creatio= n.RepositoryCreationServiceImpl-reserveRepositoryName"; + } = - createRepository =3D rpcService.registerCommand(new RemoteCommand() - { + public Serializable execute(Serializable[] args) throws Throwa= ble + { + String repositoryName =3D (String)args[0]; + return reserveRepositoryNameLocally(repositoryName); + } + }); = - public String getId() + createRepository =3D rpcService.registerCommand(new RemoteCommand= () { - return "org.exoplatform.services.jcr.ext.repository.creation.R= epositoryCreationServiceImpl-createRepository"; - } = - public Serializable execute(Serializable[] args) throws Throwable - { - //String backupId, RepositoryEntry rEntry, String rToken - String backupId =3D (String)args[0]; - String stringRepositoryEntry =3D (String)args[1]; - String rToken =3D (String)args[2]; + public String getId() + { + return "org.exoplatform.services.jcr.ext.repository.creatio= n.RepositoryCreationServiceImpl-createRepository"; + } = - try + public Serializable execute(Serializable[] args) throws Throwa= ble { - RepositoryEntry rEntry =3D - (RepositoryEntry)(getObject(RepositoryEntry.class, strin= gRepositoryEntry - .getBytes(Constants.DEFAULT_ENCODING))); + String backupId =3D (String)args[0]; + String stringRepositoryEntry =3D (String)args[1]; + String rToken =3D (String)args[2]; + DBCreationProperties creationProps =3D (DBCreationPropertie= s)args[3]; = - createRepositoryLocally(backupId, rEntry, rToken); - return null; + try + { + RepositoryEntry rEntry =3D + (RepositoryEntry)(getObject(RepositoryEntry.class, + stringRepositoryEntry.getBytes(Constants.DEFAULT_E= NCODING))); + + createRepositoryLocally(backupId, rEntry, rToken, creati= onProps); + return null; + } + finally + { + // release tokens + pendingRepositories.remove(rToken); + } } - finally + }); + + startRepository =3D rpcService.registerCommand(new RemoteCommand() + { + public String getId() { - // release tokens - pendingRepositories.remove(rToken); + return "org.exoplatform.services.jcr.ext.repository.creatio= n.RepositoryCreationServiceImpl-startRepository"; } - } - }); = - startRepository =3D rpcService.registerCommand(new RemoteCommand() - { - public String getId() - { - return "org.exoplatform.services.jcr.ext.repository.creation.R= epositoryCreationServiceImpl-startRepository"; - } - - public Serializable execute(Serializable[] args) throws Throwable - { - // must not be executed on coordinator node, since coordinator= node already created the repository - if (!rpcService.isCoordinator()) + public Serializable execute(Serializable[] args) throws Throwa= ble { - //RepositoryEntry (as String) rEntry - String stringRepositoryEntry =3D (String)args[0]; - RepositoryEntry rEntry =3D - (RepositoryEntry)(getObject(RepositoryEntry.class, strin= gRepositoryEntry - .getBytes(Constants.DEFAULT_ENCODING))); + // must not be executed on coordinator node, since coordina= tor node already created the repository + if (!rpcService.isCoordinator()) + { + //RepositoryEntry (as String) rEntry + String stringRepositoryEntry =3D (String)args[0]; + RepositoryEntry rEntry =3D + (RepositoryEntry)(getObject(RepositoryEntry.class, + stringRepositoryEntry.getBytes(Constants.DEFAULT_E= NCODING))); = - startRepository(rEntry); + DBCreationProperties creationProps =3D (DBCreationProper= ties)args[1]; + + startRepository(rEntry, creationProps); + } + return null; } - return null; - } - }); - + }); + } + else + { + LOG.warn("RepositoryCreationService initialized without RPCServic= e, so other cluser nodes will" + + " not be notified about new repositories."); + } } = /** @@ -221,15 +230,58 @@ RepositoryCreationException { String rToken =3D reserveRepositoryName(rEntry.getName()); - createRepository(backupId, rEntry, rToken); + createRepositoryInternally(backupId, rEntry, rToken, null); } = /** * {@inheritDoc} */ - public void createRepository(String backupId, RepositoryEntry rEntry, S= tring rToken) + public void createRepository(String backupId, RepositoryEntry rEntry, S= torageCreationProperties creationProps) throws RepositoryConfigurationException, RepositoryCreationException { + String rToken =3D reserveRepositoryName(rEntry.getName()); + + if (creationProps instanceof DBCreationProperties) + { + createRepositoryInternally(backupId, rEntry, rToken, (DBCreationP= roperties)creationProps); + } + else + { + throw new RepositoryCreationException("creationProps should be th= e instance of DBCreationProperties"); + } + } + + /** + * {@inheritDoc} + */ + public void createRepository(String backupId, RepositoryEntry rEntry, S= tring rToken) throws RepositoryConfigurationException, RepositoryCreationEx= ception + { + createRepositoryInternally(backupId, rEntry, rToken, null); + } + = + /** + * {@inheritDoc} + */ + public void createRepository(String backupId, RepositoryEntry rEntry, S= tring rToken, + StorageCreationProperties creationProps) throws RepositoryConfigurat= ionException, RepositoryCreationException + { + if (creationProps instanceof DBCreationProperties) + { + createRepositoryInternally(backupId, rEntry, rToken, (DBCreationP= roperties)creationProps); + } + else + { + throw new RepositoryCreationException("creationProps should be th= e instance of DBCreationProperties"); + } + + } + + /** + * Create repository internally. serverUrl and connProps contain specif= ic properties for db creation. + */ + protected void createRepositoryInternally(String backupId, RepositoryEn= try rEntry, String rToken, + DBCreationProperties creationProps) throws RepositoryConfigurationEx= ception, RepositoryCreationException + { if (rpcService !=3D null) { String stringRepositoryEntry =3D null; @@ -248,7 +300,8 @@ try { Object result =3D - rpcService.executeCommandOnCoordinator(createRepository, tr= ue, backupId, stringRepositoryEntry, rToken); + rpcService.executeCommandOnCoordinator(createRepository, tr= ue, backupId, stringRepositoryEntry, rToken, + creationProps); = if (result !=3D null) { @@ -275,7 +328,8 @@ // execute startRepository at all cluster nodes (coordinator will= ignore this command) try { - List results =3D rpcService.executeCommandOnAllNodes(s= tartRepository, true, stringRepositoryEntry); + List results =3D + rpcService.executeCommandOnAllNodes(startRepository, true, = stringRepositoryEntry, creationProps); = for (Object result : results) { @@ -307,7 +361,7 @@ { try { - createRepositoryLocally(backupId, rEntry, rToken); + createRepositoryLocally(backupId, rEntry, rToken, creationProp= s); } finally { @@ -408,8 +462,8 @@ } } = - protected void createRepositoryLocally(String backupId, RepositoryEntry= rEntry, String rToken) - throws RepositoryConfigurationException, RepositoryCreationException + protected void createRepositoryLocally(String backupId, RepositoryEntry= rEntry, String rToken, + DBCreationProperties creationProps) throws RepositoryConfigurationEx= ception, RepositoryCreationException { // check does token registered if (!this.pendingRepositories.containsKey(rToken)) @@ -427,9 +481,15 @@ Map refAddr =3D null; try { - DBConnectionInfo dbConnectionInfo =3D - dbCreator.createDatabase(rEntry.getName() + (dataSourceName= s.size() =3D=3D 1 ? "" : "_" + dataSource)); + // db name will be the same as repository name if only one dat= asource exists + String dbName =3D rEntry.getName() + (dataSourceNames.size() = =3D=3D 1 ? "" : "_" + dataSource); = + // get DBCreator + DBCreator dbCreator =3D getDBCreator(creationProps); + = + // create database + DBConnectionInfo dbConnectionInfo =3D dbCreator.createDatabase= (dbName); + refAddr =3D dbConnectionInfo.getProperties(); } catch (DBCreatorException e) @@ -437,6 +497,10 @@ throw new RepositoryCreationException("Can not create new data= base for " + rEntry.getName() + " repository.", e); } + catch (ConfigurationException e) + { + throw new RepositoryCreationException("Can not get instance of= DBCreator", e); + } = // bind data-source try @@ -502,7 +566,8 @@ } } = - protected void startRepository(RepositoryEntry repositoryEntry) throws = RepositoryCreationException + protected void startRepository(RepositoryEntry repositoryEntry, DBCreat= ionProperties creationProps) + throws RepositoryCreationException { try { @@ -515,8 +580,15 @@ Map refAddr =3D null; try { - DBConnectionInfo dbConnectionInfo =3D - dbCreator.getDBConnectionInfo(repositoryEntry.getName() = + "_" + dataSource); + // db name will be the same as repository name if only one = datasource exists + String dbName =3D repositoryEntry.getName() + (dataSourceNa= mes.size() =3D=3D 1 ? "" : "_" + dataSource); + + // get DBCreator + DBCreator dbCreator =3D getDBCreator(creationProps); + + // get connection info + DBConnectionInfo dbConnectionInfo =3D dbCreator.getDBConnec= tionInfo(dbName); + refAddr =3D dbConnectionInfo.getProperties(); } catch (DBCreatorException e) @@ -524,6 +596,11 @@ throw new RepositoryCreationException("Can not fetch databa= se information associated with " + repositoryEntry.getName() + " repository and " + dataS= ource + " datasource.", e); } + catch (ConfigurationException e) + { + throw new RepositoryCreationException("Can't get instance o= f DBCreator", e); + } + // bind data-source try { @@ -626,7 +703,6 @@ */ public void start() { - // do nothing } = /** @@ -641,4 +717,18 @@ this.rpcService.unregisterCommand(startRepository); } } + + private DBCreator getDBCreator(DBCreationProperties creationProps) thro= ws ConfigurationException + { + if (creationProps =3D=3D null) + { + return (DBCreator)context.getContainer().getComponentInstanceOfTy= pe(DBCreator.class); + } + + ConfigurationManager cm =3D + (ConfigurationManager)context.getContainer().getComponentInstance= OfType(ConfigurationManager.class); + + return new DBCreator(creationProps.getServerUrl(), creationProps.get= ConnProps(), creationProps.getDBScriptPath(), + creationProps.getDBUserName(), creationProps.getDBPassword(), cm); + } } Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/servic= es/jcr/ext/repository/creation/StorageCreationProperties.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/StorageCreationProperties.java = (rev 0) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/StorageCreationProperties.java 2011-07-01 09:49= :42 UTC (rev 4572) @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2011 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.repository.creation; + +import java.io.Externalizable; + +/** + * @author Anatoliy Bazko + * @version $Id: StorageCreationProperties.java 34360 2009-07-22 23:58:59Z= tolusha $ + */ +public interface StorageCreationProperties extends Externalizable +{ + +} 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 2011-07-01 08:57:52 UTC (rev 4571) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/BaseStandaloneTest.java 2011-07-01 09:49:42 UTC (rev 4572) @@ -67,7 +67,7 @@ public abstract class BaseStandaloneTest extends TestCase { = - private static final Log log =3D ExoLogger.getLogger("exo.jcr.component= .ext.BaseStandaloneTest"); + protected static final Log log =3D ExoLogger.getLogger("exo.jcr.compone= nt.ext.BaseStandaloneTest"); = public static final String WS_NAME =3D "ws"; = Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/TestRepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/TestRepositoryCreationService.java 2011-07-01 0= 8:57:52 UTC (rev 4571) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/TestRepositoryCreationService.java 2011-07-01 0= 9:49:42 UTC (rev 4572) @@ -29,6 +29,8 @@ import org.exoplatform.services.jcr.util.IdGenerator; = import java.io.File; +import java.util.HashMap; +import java.util.Map; = /** * Created by The eXo Platform SAS. @@ -147,6 +149,69 @@ assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); } = + public void testCreateRepositorySingleDBWithSpecificCreationProps() thr= ows Exception + { + Map connProps =3D new HashMap(); + connProps.put("driverClassName", "org.hsqldb.jdbcDriver"); + connProps.put("username", "sa"); + connProps.put("password", ""); + + DBCreationProperties creationProps =3D + new DBCreationProperties("jdbc:hsqldb:file:target/temp/data_2/", = connProps, "src/test/resources/test.sql", + "sa", ""); + + // prepare + String dsName =3D helper.createDatasource(); + ManageableRepository repository =3D helper.createRepository(containe= r, false, dsName); + WorkspaceEntry wsEntry =3D helper.createWorkspaceEntry(false, dsName= ); + helper.addWorkspace(repository, wsEntry); + addConent(repository, wsEntry.getName()); + + // backup + File backDir =3D new File("target/backup"); + backDir.mkdirs(); + + RepositoryBackupConfig config =3D new RepositoryBackupConfig(); + config.setRepository(repository.getConfiguration().getName()); + config.setBackupType(BackupManager.FULL_BACKUP_ONLY); + config.setBackupDir(backDir); + + RepositoryBackupChain bch =3D backup.startBackup(config); + waitEndOfBackup(bch); + backup.stopBackup(bch); + + // restore with RepositoryCreatorService + RepositoryCreationService creatorService =3D + (RepositoryCreationService)container.getComponentInstanceOfType(R= epositoryCreationService.class); + assertNotNull(creatorService); + + String tenantName =3D "new_repository_single-db-specific-props"; + String repoToken =3D creatorService.reserveRepositoryName(tenantName= ); + + // restore = + String newDSName =3D IdGenerator.generate(); + + RepositoryEntry newRE =3D + helper.createRepositoryEntry(false, repository.getConfiguration()= .getSystemWorkspaceName(), newDSName); + newRE.setName(tenantName); + + WorkspaceEntry newWSEntry =3D helper.createWorkspaceEntry(false, new= DSName); + newWSEntry.setName(wsEntry.getName()); + newRE.addWorkspace(newWSEntry); + + creatorService.createRepository(bch.getBackupId(), newRE, repoToken,= creationProps); + + // check + ManageableRepository restoredRepository =3D repositoryService.getRep= ository(tenantName); + assertNotNull(restoredRepository); + + checkConent(restoredRepository, wsEntry.getName()); + + //check repositoryConfiguration + RepositoryService repoService =3D (RepositoryService)this.container.= getComponentInstance(RepositoryService.class); + assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); + } + public void testReserveRepositoryNameException() throws Exception { RepositoryCreationService creatorService =3D Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalon= e/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.ext/src/test/resources/conf/standalone/test= -configuration.xml 2011-07-01 08:57:52 UTC (rev 4571) +++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test= -configuration.xml 2011-07-01 09:49:42 UTC (rev 4572) @@ -188,21 +188,6 @@ = - - - - org.exoplatform.services.security.Authenticator org.exoplatform.services.organization.auth.OrganizationAuthent= icatorImpl @@ -353,30 +338,6 @@ org.exoplatform.services.jcr.impl.ext.action.SessionActionCata= log = - - org.exoplatform.services.database.creator.DBCreator org.exoplatform.services.database.creator.DBCreator @@ -428,478 +389,6 @@ org.exoplatform.services.jcr.ext.distribution.impl.DataDistrib= utionManagerImpl = = - - - - - org.exoplatform.services.jcr.impl.ext.action.SessionActionCata= log Added: jcr/trunk/exo.jcr.component.ext/src/test/resources/test-mysql.sql =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/src/test/resources/test-mysql.sql = (rev 0) +++ jcr/trunk/exo.jcr.component.ext/src/test/resources/test-mysql.sql 2011-= 07-01 09:49:42 UTC (rev 4572) @@ -0,0 +1,4 @@ +CREATE DATABASE ${database}; +USE ${database}; +CREATE USER '${username}' IDENTIFIED BY '${password}'; +GRANT SELECT,INSERT,UPDATE,DELETE ON ${database}.* TO '${username}'; \ No newline at end of file Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/repository-creation-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/repository-creation-service.xml 2011-07-01 08:57:52 UTC (rev 4= 571) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/repository-creation-service.xml 2011-07-01 09:49:42 UTC (rev 4= 572) @@ -1,209 +1,239 @@ - - - - - - RepositoryCreationService - -
- Intro - - RepositoryCreationService is the service for creation repositori= es - in runtime. The service can be used in standalone or cluster - environment. -
- -
- Dependencies - - RepositoryConfigurationService depends to next components: - - - - DBCreator - - DBCreator used to create new database for each unbinded datasource. - - - - - BackupManager - - BackupManager used to created repository from backup. - - - - RPCService - RPCS= ervice - used for communication between cluster-nodes - - - RPCService may not be configured - in this case, - RepositoryService will work as standalone service. - - - -
- -
- How it works - - - - User executes reserveRepositoryName(String repositoryName) - - client-node calls coordinator-node to reserve repositoryName. If t= his - name is already reserved or repository with this name exist, - client-node will fetch RepositoryCreationException. If not Client = will - get token string. - - - - than user executes createRepository(String backupId, - RepositoryEntry rEntry, String token). Coordinator-node checks the - token, and creates Repository. - - - - whan repository become created - user-node broadcast messag= e to - all clusterNodes with RepositoryEntry, so each cluster node starts= new - Repository. - - - - There is two ways to create repositry: make it in single step - = just - call createRepository(String backupId, RepositoryEntry); or reserve - repositoryName at first (reserveRepositoryName(String repositoryName)), - than create reserved repository (createRepository(String backupId, - RepositoryEntry rEntry, String token)). -
- -
- Configuration - - RepositoryCreationService configuration - - <component> - <key>org.exoplatform.services.jcr.ext.backup.BackupManager</ke= y> - <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerI= mpl</type> - <init-params> - <properties-param> - <name>backup-properties</name> - <property name=3D"default-incremental-job-period" value=3D"360= 0" /><!-- set default incremental periond =3D 60 minutes --> - <property name=3D"full-backup-type" value=3D"org.exoplatform.s= ervices.jcr.ext.backup.impl.fs.FullBackupJob" /> - <property name=3D"incremental-backup-type" value=3D"org.exopla= tform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob" /> - <property name=3D"backup-dir" value=3D"target/backup" /> - </properties-param> - </init-params> -</component> - -<component> - <key>org.exoplatform.services.database.creator.DBCreator</key&= gt; - <type>org.exoplatform.services.database.creator.DBCreator</typ= e> - <init-params> - <properties-param> - <name>db-connection</name> - <description>database connection properties</description= > - <property name=3D"driverClassName" value=3D"org.hsqldb.jdbcDri= ver" /> - <property name=3D"url" value=3D"jdbc:hsqldb:file:target/temp/d= ata/" /> - <property name=3D"username" value=3D"sa" /> - <property name=3D"password" value=3D"" /> - </properties-param> - <properties-param> - <name>db-creation</name> - <description>database creation properties</description&g= t; - <property name=3D"scriptPath" value=3D"src/test/resources/test= .sql" /> - <property name=3D"username" value=3D"sa" /> - <property name=3D"password" value=3D"" /> - </properties-param> - </init-params> -</component> - -<component> - <key>org.exoplatform.services.rpc.RPCService</key> - <type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type&g= t; - <init-params> - <value-param> - <name>jgroups-configuration</name> - <value>jar:/conf/standalone/udp-mux.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> = - -<component> - <key>org.exoplatform.services.jcr.ext.repository.creation.Reposit= oryCreationService</key> - <type> - org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreat= ionServiceImpl - </type> -</component> -
- -
- Repsitory Interface - - public interface RepositoryCreationS= ervice -{ - /** - * Reserves, validates and creates repository in a simplified form. = - * = - * @param rEntry - repository Entry - note that datasource must not exi= st. - * @param backupId - backup id - * @throws RepositoryConfigurationException - * if some exception occurred during repository creation or re= pository name is absent in reserved list - * @throws RepositoryCreationServiceException - * if some exception occurred during repository creation or re= pository name is absent in reserved list - */ - void createRepository(String backupId, RepositoryEntry rEntry) throws R= epositoryConfigurationException, - RepositoryCreationException; - - /** - * Reserve repository name to prevent repository creation with same nam= e from other place in same time - * via this service. - * = - * @param repositoryName - repositoryName - * @return repository token. Anyone obtaining a token can later create = a repository of reserved name. - * @throws RepositoryCreationServiceException if can't reserve name - */ - String reserveRepositoryName(String repositoryName) throws RepositoryCr= eationException; - - /** - * Creates repository, using token of already reserved repository name= . Good for cases, when repository creation should be delayed or = - * made asynchronously in dedicated thread. = - * = - * @param rEntry - repository entry - note, that datasource must not ex= ist - * @param backupId - backup id - * @param rToken - token - * @throws RepositoryConfigurationException - * if some exception occurred during repository creation or re= pository name is absent in reserved list - * @throws RepositoryCreationServiceException - * if some exception occurred during repository creation or re= pository name is absent in reserved list - */ - void createRepository(String backupId, RepositoryEntry rEntry, String r= Token) - throws RepositoryConfigurationException, RepositoryCreationException; -} -
- -
- Conclusions and restrictions - - - - Each datasource in RepositoryEntry of new Repository must ha= ve - unbinded datasources. Thats mean, such datasource must have not - databases behind them. This restriction exists to avoid corruption= of - existing repositories data. - - - - RPCService is optional component, but without it, - RepositoryCreatorService can not communicate with other cluster-no= des - and works as standalone. - - -
-
+ + + + + + RepositoryCreationService + +
+ Intro + + RepositoryCreationService is the service for creation repositori= es + in runtime. The service can be used in standalone or cluster + environment. +
+ +
+ Dependencies + + RepositoryConfigurationService depends to next components: + + + + DBCreator - + DBCreator used to create new database for each unbinded + datasource. + + + + BackupManager - + BackupManager used to created repository from backup. + + + + RPCService - RPCS= ervice + used for communication between cluster-nodes + + + RPCService may not be configured - in this case, + RepositoryService will work as standalone service. + + + +
+ +
+ How it works + + + + User executes reserveRepositoryName(String repositoryName) - + client-node calls coordinator-node to reserve repositoryName. If t= his + name is already reserved or repository with this name exist, + client-node will fetch RepositoryCreationException. If not Client = will + get token string. + + + + than user executes createRepository(String backupId, + RepositoryEntry rEntry, String token). Coordinator-node checks the + token, and creates Repository. + + + + whan repository become created - user-node broadcast message= to + all clusterNodes with RepositoryEntry, so each cluster node starts= new + Repository. + + + + There is two ways to create repositry: make it in single step - = just + call createRepository(String backupId, RepositoryEntry); or reserve + repositoryName at first (reserveRepositoryName(String repositoryName)), + than create reserved repository (createRepository(String backupId, + RepositoryEntry rEntry, String token)). +
+ +
+ Configuration + + RepositoryCreationService configuration + + <component> + <key>org.exoplatform.services.jcr.ext.backup.BackupManager</ke= y> + <type>org.exoplatform.services.jcr.ext.backup.impl.BackupManagerI= mpl</type> + <init-params> + <properties-param> + <name>backup-properties</name> + <property name=3D"default-incremental-job-period" value=3D"360= 0" /><!-- set default incremental periond =3D 60 minutes --> + <property name=3D"full-backup-type" value=3D"org.exoplatform.s= ervices.jcr.ext.backup.impl.fs.FullBackupJob" /> + <property name=3D"incremental-backup-type" value=3D"org.exopla= tform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob" /> + <property name=3D"backup-dir" value=3D"target/backup" /> + </properties-param> + </init-params> +</component> + +<component> + <key>org.exoplatform.services.database.creator.DBCreator</key&= gt; + <type>org.exoplatform.services.database.creator.DBCreator</typ= e> + <init-params> + <properties-param> + <name>db-connection</name> + <description>database connection properties</description= > + <property name=3D"driverClassName" value=3D"org.hsqldb.jdbcDri= ver" /> + <property name=3D"url" value=3D"jdbc:hsqldb:file:target/temp/d= ata/" /> + <property name=3D"username" value=3D"sa" /> + <property name=3D"password" value=3D"" /> + </properties-param> + <properties-param> + <name>db-creation</name> + <description>database creation properties</description&g= t; + <property name=3D"scriptPath" value=3D"src/test/resources/test= .sql" /> + <property name=3D"username" value=3D"sa" /> + <property name=3D"password" value=3D"" /> + </properties-param> + </init-params> +</component> + +<component> + <key>org.exoplatform.services.rpc.RPCService</key> + <type>org.exoplatform.services.rpc.impl.RPCServiceImpl</type&g= t; + <init-params> + <value-param> + <name>jgroups-configuration</name> + <value>jar:/conf/standalone/udp-mux.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> = + +<component> + <key>org.exoplatform.services.jcr.ext.repository.creation.Reposit= oryCreationService</key> + <type> + org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreat= ionServiceImpl + </type> +</component> +
+ +
+ Repsitory Interface + + public interface RepositoryCreationS= ervice +{ + /** + * Reserves, validates and creates repository in a simplified form. + * = + * @param rEntry - repository Entry - note that datasource must not exi= st. + * @param backupId - backup id + * @param creationProps - storage creation properties = + * @throws RepositoryConfigurationException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + * @throws RepositoryCreationServiceException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + */ + void createRepository(String backupId, RepositoryEntry rEntry, StorageC= reationProperties creationProps) + throws RepositoryConfigurationException, RepositoryCreationException= ;n + + /** + * Reserves, validates and creates repository in a simplified form. = + * = + * @param rEntry - repository Entry - note that datasource must not exi= st. + * @param backupId - backup id + * @throws RepositoryConfigurationException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + * @throws RepositoryCreationServiceException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + */ + void createRepository(String backupId, RepositoryEntry rEntry) throws R= epositoryConfigurationException, + RepositoryCreationException; + + /** + * Reserve repository name to prevent repository creation with same nam= e from other place in same time + * via this service. + * = + * @param repositoryName - repositoryName + * @return repository token. Anyone obtaining a token can later create = a repository of reserved name. + * @throws RepositoryCreationServiceException if can't reserve name + */ + String reserveRepositoryName(String repositoryName) throws RepositoryCr= eationException; + + /** + * Creates repository, using token of already reserved repository name. = + * Good for cases, when repository creation should be delayed or made a= synchronously in dedicated thread. = + * = + * @param rEntry - repository entry - note, that datasource must not ex= ist + * @param backupId - backup id + * @param rToken - token + * @param creationProps - storage creation properties + * @throws RepositoryConfigurationException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + * @throws RepositoryCreationServiceException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + */ + void createRepository(String backupId, RepositoryEntry rEntry, String r= Token, StorageCreationProperties creationProps) + throws RepositoryConfigurationException, RepositoryCreationException; + + /** + * Creates repository, using token of already reserved repository name= . Good for cases, when repository creation should be delayed or = + * made asynchronously in dedicated thread. = + * = + * @param rEntry - repository entry - note, that datasource must not ex= ist + * @param backupId - backup id + * @param rToken - token + * @throws RepositoryConfigurationException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + * @throws RepositoryCreationServiceException + * if some exception occurred during repository creation or re= pository name is absent in reserved list + */ + void createRepository(String backupId, RepositoryEntry rEntry, String r= Token) + throws RepositoryConfigurationException, RepositoryCreationException; +} +
+ +
+ Conclusions and restrictions + + + + Each datasource in RepositoryEntry of new Repository must ha= ve + unbinded datasources. Thats mean, such datasource must have not + databases behind them. This restriction exists to avoid corruption= of + existing repositories data. + + + + RPCService is optional component, but without it, + RepositoryCreatorService can not communicate with other cluster-no= des + and works as standalone. + + +
+
--===============1978801374008330859==-- From do-not-reply at jboss.org Fri Jul 1 05:50:11 2011 Content-Type: multipart/mixed; boundary="===============2066325075711381932==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4573 - jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository/creation/cluster. Date: Fri, 01 Jul 2011 05:50:10 -0400 Message-ID: <201107010950.p619oAeq017039@svn01.web.mwc.hst.phx2.redhat.com> --===============2066325075711381932== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 05:50:10 -0400 (Fri, 01 Jul 2011) New Revision: 4573 Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterNo= de1.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterNo= de2.java Log: EXOJCR-1398: Add cluster tests Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/servic= es/jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClust= erNode1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java (rev 0) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java 2011-07-01 09:50:10 UTC (rev 4573) @@ -0,0 +1,117 @@ +/* + * 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.services.jcr.ext.repository.creation.cluster; + +import org.exoplatform.services.jcr.RepositoryService; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.core.ManageableRepository; +import org.exoplatform.services.jcr.ext.backup.AbstractBackupTestCase; +import org.exoplatform.services.jcr.ext.backup.BackupManager; +import org.exoplatform.services.jcr.ext.backup.ExtendedBackupManager; +import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain; +import org.exoplatform.services.jcr.ext.backup.RepositoryBackupConfig; +import org.exoplatform.services.jcr.ext.repository.creation.DBCreationProp= erties; +import org.exoplatform.services.jcr.ext.repository.creation.RepositoryCrea= tionService; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author Karpenko Sergiy = + * @version $Id: TestRepositoryCreationService.java 111 2008-11-11 11:11:1= 1Z serg $ + */ +public class TestRepositoryCreationServiceInClusterNode1 extends AbstractB= ackupTestCase +{ + public void testCreateRepositorySingleDBWithSpecificCreationProps() thr= ows Exception + { + log.info("Node1: Waits the second node"); + Thread.sleep(60000); + = + Map connProps =3D new HashMap(); + connProps.put("driverClassName", "com.mysql.jdbc.Driver"); + connProps.put("username", "root"); + connProps.put("password", "24635457"); + + DBCreationProperties creationProps =3D + new DBCreationProperties("jdbc:mysql://localhost/", connProps, + "src/test/resources/test-mysql.sql", "user1", "pass1"); + + // prepare + String dsName =3D helper.createDatasource(); + ManageableRepository repository =3D helper.createRepository(containe= r, false, dsName); + WorkspaceEntry wsEntry =3D helper.createWorkspaceEntry(false, dsName= ); + helper.addWorkspace(repository, wsEntry); + addConent(repository, wsEntry.getName()); + + // backup + File backDir =3D new File("target/backup"); + backDir.mkdirs(); + + RepositoryBackupConfig config =3D new RepositoryBackupConfig(); + config.setRepository(repository.getConfiguration().getName()); + config.setBackupType(BackupManager.FULL_BACKUP_ONLY); + config.setBackupDir(backDir); + + RepositoryBackupChain bch =3D backup.startBackup(config); + waitEndOfBackup(bch); + backup.stopBackup(bch); + + // restore with RepositoryCreatorService + RepositoryCreationService creatorService =3D + (RepositoryCreationService)container.getComponentInstanceOfType(R= epositoryCreationService.class); + assertNotNull(creatorService); + + String tenantName =3D "tenant_2"; + String repoToken =3D creatorService.reserveRepositoryName(tenantName= ); + + // restore = + RepositoryEntry newRE =3D + helper.createRepositoryEntry(false, repository.getConfiguration()= .getSystemWorkspaceName(), tenantName); + newRE.setName(tenantName); + + WorkspaceEntry newWSEntry =3D helper.createWorkspaceEntry(false, ten= antName); + newWSEntry.setName(wsEntry.getName()); + newRE.addWorkspace(newWSEntry); + + creatorService.createRepository(bch.getBackupId(), newRE, repoToken,= creationProps); + + // check + ManageableRepository restoredRepository =3D repositoryService.getRep= ository(tenantName); + assertNotNull(restoredRepository); + + checkConent(restoredRepository, wsEntry.getName()); + + //check repositoryConfiguration + RepositoryService repoService =3D (RepositoryService)this.container.= getComponentInstance(RepositoryService.class); + assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); + + log.info("Node1: Repository has been created"); + Thread.sleep(100000); + } + + @Override + protected ExtendedBackupManager getBackupManager() + { + return getRDBMSBackupManager(); + } +} Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/servic= es/jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClust= erNode2.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode2.java (rev 0) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode2.java 2011-07-01 09:50:10 UTC (rev 4573) @@ -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.services.jcr.ext.repository.creation.cluster; + +import org.exoplatform.services.jcr.core.ManageableRepository; +import org.exoplatform.services.jcr.ext.backup.AbstractBackupTestCase; +import org.exoplatform.services.jcr.ext.backup.ExtendedBackupManager; +import org.exoplatform.services.jcr.impl.core.SessionImpl; + +/** + * Created by The eXo Platform SAS. + * = + *
Date: = + * + * @author Karpenko Sergiy = + * @version $Id: TestRepositoryCreationService.java 111 2008-11-11 11:11:1= 1Z serg $ + */ +public class TestRepositoryCreationServiceInClusterNode2 extends AbstractB= ackupTestCase +{ + public void testCreateRepositorySingleDBWithSpecificCreationProps() thr= ows Exception + { + log.info("Node2: Waits for the repository creation"); + Thread.sleep(60000); + = + String tenantName =3D "tenant_2"; + + // check + ManageableRepository restoredRepository =3D repositoryService.getRep= ository(tenantName); + assertNotNull(restoredRepository); + + SessionImpl session =3D + (SessionImpl)restoredRepository.login(credentials, restoredReposi= tory.getConfiguration() + .getSystemWorkspaceName()); + session.getRootNode(); + + log.info("Node2: test passed. I have root node"); + Thread.sleep(100000); + } + + @Override + protected ExtendedBackupManager getBackupManager() + { + return getRDBMSBackupManager(); + } +} --===============2066325075711381932==-- From do-not-reply at jboss.org Fri Jul 1 07:39:43 2011 Content-Type: multipart/mixed; boundary="===============0027169287855538687==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4574 - in kernel/trunk/exo.kernel.container/src: test/java/org/exoplatform/container and 1 other directory. Date: Fri, 01 Jul 2011 07:39:42 -0400 Message-ID: <201107011139.p61Bdgpp005485@svn01.web.mwc.hst.phx2.redhat.com> --===============0027169287855538687== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-01 07:39:42 -0400 (Fri, 01 Jul 2011) New Revision: 4574 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/management/ManageableContainer.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/TestExoContainer.java Log: EXOJCR-1068 : fixing the test Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/management/ManageableContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/management/ManageableContainer.java 2011-07-01 09:50:10 UTC (rev 4573) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/management/ManageableContainer.java 2011-07-01 11:39:42 UTC (rev 4574) @@ -234,11 +234,11 @@ @Override public ComponentAdapter unregisterComponent(Object componentKey) { - ComponentAdapter adapter =3D getComponentAdapter(componentKey); + Object componentInstance =3D getComponentInstance(componentKey); = - if (managementContext !=3D null && adapter !=3D null) + if (managementContext !=3D null && componentInstance !=3D null) { - managementContext.unregister(adapter.getComponentInstance(this)); + managementContext.unregister(componentInstance); } return super.unregisterComponent(componentKey); } Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/TestExoContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestExoContainer.java 2011-07-01 09:50:10 UTC (rev 4573) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/TestExoContainer.java 2011-07-01 11:39:42 UTC (rev 4574) @@ -491,28 +491,40 @@ public void destroyContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.destroy.add(this); + if (counter !=3D null) + { + counter.destroy.add(this); + } } = @Override public void initContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.init.add(this); + if (counter !=3D null) + { + counter.init.add(this); + } } = @Override public void startContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.start.add(this); + if (counter !=3D null) + { + counter.start.add(this); + } } = @Override public void stopContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.stop.add(this); + if (counter !=3D null) + { + counter.stop.add(this); + } } = } @@ -530,28 +542,40 @@ public void destroyContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.destroy.add(this); + if (counter !=3D null) + { + counter.destroy.add(this); + } } = @Override public void initContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.init.add(this); + if (counter !=3D null) + { + counter.init.add(this); + } } = @Override public void startContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.start.add(this); + if (counter !=3D null) + { + counter.start.add(this); + } } = @Override public void stopContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.stop.add(this); + if (counter !=3D null) + { + counter.stop.add(this); + } } = } = @@ -567,28 +591,40 @@ public void destroyContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.destroy.add(this); + if (counter !=3D null) + { + counter.destroy.add(this); + } } = @Override public void initContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.init.add(this); + if (counter !=3D null) + { + counter.init.add(this); + } } = @Override public void startContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.start.add(this); + if (counter !=3D null) + { + counter.start.add(this); + } } = @Override public void stopContainer(ExoContainer container) throws Exception { MyCounter counter =3D (MyCounter)container.getComponentInstanceOf= Type(MyCounter.class); - if (counter !=3D null) counter.stop.add(this); + if (counter !=3D null) + { + counter.stop.add(this); + } } = } @@ -636,7 +672,7 @@ public Object getComponentInstance(PicoContainer arg0) throws PicoIn= itializationException, PicoIntrospectionException { - throw (PicoInitializationException)new Exception(); + return "testKey"; } = public Class getComponentImplementation() @@ -722,7 +758,9 @@ public void init() { if (!c2.started) + { throw new IllegalStateException("C2 should be started"); + } } } = --===============0027169287855538687==-- From do-not-reply at jboss.org Fri Jul 1 08:23:41 2011 Content-Type: multipart/mixed; boundary="===============5882666983591415513==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4575 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming. Date: Fri, 01 Jul 2011 08:23:41 -0400 Message-ID: <201107011223.p61CNfiB015192@svn01.web.mwc.hst.phx2.redhat.com> --===============5882666983591415513== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 08:23:41 -0400 (Fri, 01 Jul 2011) New Revision: 4575 Modified: 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 Log: EXOJCR-1397: Create method which will return db configuration of repository 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 2011-07-01 11:39:42 UTC (rev 4574) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextBinder.java 2011-07-01 12:23:41 UTC (rev 4575) @@ -155,6 +155,16 @@ saveBindings(); } = + /** + * Returns reference associated with bindName. + * = + * @param bindName the name on which the reference was binded. + */ + public Reference getReference(String bindName) + { + return bindings.get(bindName); + } + private void bind(String bindName, Reference reference) throws NamingEx= ception { try 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 2011-07-01 11:39:42 UTC (rev= 4574) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextInitializer.java 2011-07-01 12:23:41 UTC (rev= 4575) @@ -34,8 +34,6 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; -import java.util.Map; -import java.util.Set; = import javax.naming.Context; import javax.naming.InitialContext; @@ -233,50 +231,10 @@ } = /** - * Constructs references from params, binds in initial contexts and per= sists list of all binded - * references into file. - * = - * @param bindName - * bind name - * @param className - * class name - * @param factory - * factory name - * @param factoryLocation - * factory location - * @param refAddr - * map of references's properties - * = - * @throws NamingException - * if error occurs due to binding - * @throws XMLStreamException = - * @throws FileNotFoundException + * Returns InitialContextBinder. */ - public void bind(String bindName, String className, String factory, Str= ing factoryLocation, - Map refAddr) throws NamingException, FileNotFoundExc= eption, XMLStreamException + public InitialContextBinder getInitialContextBinder() { - if (LOG.isDebugEnabled()) - { - StringBuilder refAddrString =3D new StringBuilder(); - refAddrString.append('{'); - Set> refs =3D refAddr.entrySet(); - int i =3D 1; - for (Map.Entry ent : refs) - { - refAddrString.append(ent.getKey()); - refAddrString.append('=3D'); - refAddrString.append(ent.getValue()); - if (i < refs.size()) - { - refAddrString.append(' '); - } - i++; - } - refAddrString.append('}'); - LOG.debug("Bind: " + bindName + " class-name:" + className + " fa= ctory:" + factory + " factoryLocation:" - + factoryLocation + " refAddr:" + refAddrString); - } - - binder.bind(bindName, className, factory, factoryLocation, refAddr); + return binder; } } --===============5882666983591415513==-- From do-not-reply at jboss.org Fri Jul 1 08:24:54 2011 Content-Type: multipart/mixed; boundary="===============0533138235040055428==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4576 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation. Date: Fri, 01 Jul 2011 08:24:54 -0400 Message-ID: <201107011224.p61COsuR015241@svn01.web.mwc.hst.phx2.redhat.com> --===============0533138235040055428== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 08:24:54 -0400 (Fri, 01 Jul 2011) New Revision: 4576 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java Log: EXOJCR-1397: Create method which will return db configuration of repository Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-01 1= 2:23:41 UTC (rev 4575) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-01 1= 2:24:54 UTC (rev 4576) @@ -505,7 +505,7 @@ // bind data-source try { - initialContextInitializer.bind(dataSource, "javax.sql.DataSour= ce", + initialContextInitializer.getInitialContextBinder().bind(dataS= ource, "javax.sql.DataSource", "org.apache.commons.dbcp.BasicDataSourceFactory", null, ref= Addr); } catch (NamingException e) @@ -604,7 +604,7 @@ // bind data-source try { - initialContextInitializer.bind(dataSource, "javax.sql.DataS= ource", + initialContextInitializer.getInitialContextBinder().bind(da= taSource, "javax.sql.DataSource", "org.apache.commons.dbcp.BasicDataSourceFactory", null, = refAddr); } catch (NamingException e) --===============0533138235040055428==-- From do-not-reply at jboss.org Fri Jul 1 08:28:11 2011 Content-Type: multipart/mixed; boundary="===============6572115946937534661==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4577 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming. Date: Fri, 01 Jul 2011 08:28:11 -0400 Message-ID: <201107011228.p61CSBcI015592@svn01.web.mwc.hst.phx2.redhat.com> --===============6572115946937534661== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 08:28:11 -0400 (Fri, 01 Jul 2011) New Revision: 4577 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextBinder.java Log: EXOJCR-1397: Fix java doc 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 2011-07-01 12:24:54 UTC (rev 4576) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextBinder.java 2011-07-01 12:28:11 UTC (rev 4577) @@ -156,7 +156,7 @@ } = /** - * Returns reference associated with bindName. + * Returns reference associated with defined name. * = * @param bindName the name on which the reference was binded. */ --===============6572115946937534661==-- From do-not-reply at jboss.org Fri Jul 1 08:35:59 2011 Content-Type: multipart/mixed; boundary="===============0381771272431024395==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4578 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel. Date: Fri, 01 Jul 2011 08:35:59 -0400 Message-ID: <201107011235.p61CZxxA016452@svn01.web.mwc.hst.phx2.redhat.com> --===============0381771272431024395== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 08:35:58 -0400 (Fri, 01 Jul 2011) New Revision: 4578 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/initialcontext-binder-service.xml Log: EXOJCR-1397: Update docbook 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 2011-07-01 12:28:11 UTC (= rev 4577) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/initialcontext-binder-service.xml 2011-07-01 12:35:58 UTC (= rev 4578) @@ -16,7 +16,7 @@
API = - Service provide methods for binding reference. + Service provide methods for binding reference: = public void bind(String bindName, St= ring className, String factory, String factoryLocation, Map<String, Stri= ng> refAddr) throws NamingException, FileNotFoundException, XMLStreamExc= ept = @@ -43,5 +43,9 @@ refAddr - object's properties map + + Returns reference associated with defined name: + + public Reference getReference(String= bindName)
--===============0381771272431024395==-- From do-not-reply at jboss.org Fri Jul 1 08:50:37 2011 Content-Type: multipart/mixed; boundary="===============1682481853863649281==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4579 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming. Date: Fri, 01 Jul 2011 08:50:37 -0400 Message-ID: <201107011250.p61Cobbg017702@svn01.web.mwc.hst.phx2.redhat.com> --===============1682481853863649281== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 08:50:37 -0400 (Fri, 01 Jul 2011) New Revision: 4579 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextBinder.java Log: EXOJCR-1397: Create method which allow to bind with already existed referen= ce object 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 2011-07-01 12:35:58 UTC (rev 4578) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextBinder.java 2011-07-01 12:50:37 UTC (rev 4579) @@ -107,7 +107,7 @@ Map importedRefs =3D readBindings(); for (Entry entry : importedRefs.entrySet()) { - bind(entry.getKey(), entry.getValue()); + bindInternally(entry.getKey(), entry.getValue()); } } } @@ -150,12 +150,33 @@ reference.add(new StringRefAddr(entry.getKey(), entry.getValue())= ); } = - bind(bindName, reference); + bindInternally(bindName, reference); = saveBindings(); } = /** + * Binds the reference in initial contexts and persists list of all bin= ded + * references into file. + * = + * @param bindName + * bind name + * @param reference + * reference + * @throws NamingException + * if error occurs due to binding + * @throws FileNotFoundException + * @throws XMLStreamException + */ + public void bind(String bindName, Reference reference) throws NamingExc= eption, FileNotFoundException, + XMLStreamException + { + bindInternally(bindName, reference); + + saveBindings(); + } + + /** * Returns reference associated with defined name. * = * @param bindName the name on which the reference was binded. @@ -165,7 +186,7 @@ return bindings.get(bindName); } = - private void bind(String bindName, Reference reference) throws NamingEx= ception + private void bindInternally(String bindName, Reference reference) throw= s NamingException { try { --===============1682481853863649281==-- From do-not-reply at jboss.org Fri Jul 1 08:51:58 2011 Content-Type: multipart/mixed; boundary="===============8431734175892164390==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4580 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel. Date: Fri, 01 Jul 2011 08:51:57 -0400 Message-ID: <201107011251.p61Cpvpr017770@svn01.web.mwc.hst.phx2.redhat.com> --===============8431734175892164390== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 08:51:57 -0400 (Fri, 01 Jul 2011) New Revision: 4580 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/initialcontext-binder-service.xml Log: EXOJCR-1397: Update docbook 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 2011-07-01 12:50:37 UTC (= rev 4579) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/initialcontext-binder-service.xml 2011-07-01 12:51:57 UTC (= rev 4580) @@ -44,6 +44,8 @@ = + public void bind(String bindName, Re= ference ref) throws NamingException, FileNotFoundException, XMLStreamExcept= + Returns reference associated with defined name: = public Reference getReference(String= bindName) --===============8431734175892164390==-- From do-not-reply at jboss.org Fri Jul 1 09:10:12 2011 Content-Type: multipart/mixed; boundary="===============5113932046152388688==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4581 - kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/services/naming. Date: Fri, 01 Jul 2011 09:10:12 -0400 Message-ID: <201107011310.p61DACmD025296@svn01.web.mwc.hst.phx2.redhat.com> --===============5113932046152388688== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 09:10:11 -0400 (Fri, 01 Jul 2011) New Revision: 4581 Modified: kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/s= ervices/naming/InitialContextTest.java Log: EXOJCR-1397: Fix test 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 2011-07-01 12:51:57 UTC (rev 4580) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/naming/InitialContextTest.java 2011-07-01 13:10:11 UTC (rev 4581) @@ -18,6 +18,10 @@ */ package org.exoplatform.services.naming; = +import junit.framework.TestCase; + +import org.exoplatform.container.PortalContainer; + import java.io.File; import java.io.FileNotFoundException; import java.util.Enumeration; @@ -32,10 +36,6 @@ 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 @@ -121,8 +121,8 @@ refAddr.put("username", "sa"); refAddr.put("password", ""); = - initializer.bind("testjdbcjcr1", "javax.sql.DataSource", "org.apache= .commons.dbcp.BasicDataSourceFactory", null, - refAddr); + initializer.getInitialContextBinder().bind("testjdbcjcr1", "javax.sq= l.DataSource", + "org.apache.commons.dbcp.BasicDataSourceFactory", null, refAddr); = assertTrue(new File("target/store-path.xml").exists()); } --===============5113932046152388688==-- From do-not-reply at jboss.org Fri Jul 1 09:34:04 2011 Content-Type: multipart/mixed; boundary="===============7960708818078723993==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4582 - in kernel/trunk/exo.kernel.container/src: test/java/org/exoplatform/container and 1 other directory. Date: Fri, 01 Jul 2011 09:34:04 -0400 Message-ID: <201107011334.p61DY4bd027133@svn01.web.mwc.hst.phx2.redhat.com> --===============7960708818078723993== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-01 09:34:04 -0400 (Fri, 01 Jul 2011) New Revision: 4582 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/management/ManageableContainer.java kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/TestExoContainer.java Log: EXOJCR-1068 : Test reverted and fixed issue with failing component instance= retrieval Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/management/ManageableContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/management/ManageableContainer.java 2011-07-01 13:10:11 UTC (rev 4581) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/management/ManageableContainer.java 2011-07-01 13:34:04 UTC (rev 4582) @@ -234,11 +234,19 @@ @Override public ComponentAdapter unregisterComponent(Object componentKey) { - Object componentInstance =3D getComponentInstance(componentKey); + Object componentInstance; + try + { + componentInstance =3D getComponentInstance(componentKey); = - if (managementContext !=3D null && componentInstance !=3D null) + if (managementContext !=3D null && componentInstance !=3D null) + { + managementContext.unregister(componentInstance); + } + } + catch (PicoException e) { - managementContext.unregister(componentInstance); + // Ignore, may be caused by lazy initialization mechanism } return super.unregisterComponent(componentKey); } Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/TestExoContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestExoContainer.java 2011-07-01 13:10:11 UTC (rev 4581) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/TestExoContainer.java 2011-07-01 13:34:04 UTC (rev 4582) @@ -104,10 +104,10 @@ else { PropertyManager.setProperty(PropertyManager.RUNTIME_PROFILES, = oldValue); - } = + } } } - = + public void testRemoveComponent() throws Exception { RootContainer container =3D RootContainer.getInstance(); @@ -149,7 +149,7 @@ assertTrue(counter.init.get(1) instanceof MyContainerLifecyclePlugin= 3); assertTrue(counter.init.get(2) instanceof MyContainerLifecyclePlugin= 1); } - = + public void testStackOverFlow() { final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml"); @@ -160,21 +160,21 @@ assertNotNull(plugin.cmanager_); assertEquals(value, plugin.myClass_); } - = + public void testStackOverFlow2() { - final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml"); = + final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml"); SOE1 soe1 =3D (SOE1)container.getComponentInstanceOfType(SOE1.class); assertNotNull(soe1); SOEPlugin soe1Plugin =3D soe1.plugin; assertNotNull(soe1Plugin); assertNotNull(soe1Plugin.soe2); - assertEquals(soe1, soe1Plugin.soe2.soe1); = + assertEquals(soe1, soe1Plugin.soe2.soe1); } - = + public void testStackOverFlow3() { - final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml"); = + final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml"); SOE2 soe2 =3D (SOE2)container.getComponentInstanceOfType(SOE2.class); assertNotNull(soe2); assertNotNull(soe2.soe1); @@ -184,7 +184,7 @@ assertEquals(soe2.soe1, soe1Plugin.soe2.soe1); assertEquals(container.getComponentInstanceOfType(SOE1.class), soe2.= soe1); } - = + public void testCyclicRef() { final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml", "testCyclicRef"); @@ -194,7 +194,7 @@ assertNotNull(b); assertEquals(a, b.a); } - = + public void testStartOrder() { final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml", "testStartOrder"); @@ -204,9 +204,9 @@ assertNotNull(c1); C2 c2 =3D (C2)container.getComponentInstanceOfType(C2.class); assertNotNull(c2); - assertTrue(c1.started); = - } = - = + assertTrue(c1.started); + } + public void testCache() { URL rootURL =3D getClass().getResource("test-exo-container.xml"); @@ -229,8 +229,8 @@ return MyClass.class; } = - public Object getComponentInstance(PicoContainer paramPicoContain= er) - throws PicoInitializationException, PicoIntrospectionException + public Object getComponentInstance(PicoContainer paramPicoContain= er) throws PicoInitializationException, + PicoIntrospectionException { return new MyClass(); } @@ -251,9 +251,9 @@ assertEquals(ca, pcontainer.getComponentAdapter("MyKey")); container.unregisterComponent("MyKey"); assertNull(container.getComponentAdapter("MyKey")); - assertNull(pcontainer.getComponentAdapter("MyKey")); = + assertNull(pcontainer.getComponentAdapter("MyKey")); } - = + public void testMultiThreading() throws Throwable { final RootContainer container =3D createRootContainer("test-exo-cont= ainer.xml"); @@ -273,7 +273,7 @@ } assertEquals(currentMyClass.get(), container.getComponentInsta= nce(MyMTClass.class)); } - }); = + }); testMultiThreading(new Task() { = @@ -349,7 +349,7 @@ container.unregisterComponent("a"); } }); - = + testMultiThreading(new Task() { = @@ -368,8 +368,8 @@ return MyClass.class; } = - public Object getComponentInstance(PicoContainer paramPicoC= ontainer) - throws PicoInitializationException, PicoIntrospectionExc= eption + public Object getComponentInstance(PicoContainer paramPicoC= ontainer) throws PicoInitializationException, + PicoIntrospectionException { return new MyClass(); } @@ -383,7 +383,7 @@ { } = - }; = + }; assertNotNull(container.registerComponent(ca)); assertNotNull(container.getComponentAdapter(key)); assertFalse(container.getComponentAdapters().isEmpty()); @@ -394,7 +394,7 @@ assertFalse(container.getComponentInstancesOfType(MyClass.clas= s).isEmpty()); assertNotNull(container.unregisterComponent(key)); } - }); = + }); } = private void testMultiThreading(final Task task) throws Throwable @@ -442,7 +442,7 @@ { public void execute(); } - = + public static class MyMTClass { public MyMTClass() throws InterruptedException @@ -455,38 +455,44 @@ public static class MyClass { public MyClassPlugin plugin_; + public void add(MyClassPlugin plugin) { this.plugin_ =3D plugin; } } - = + public static class MyClassPlugin extends BaseComponentPlugin { public ConfigurationManager cmanager_; + public MyClass myClass_; + public MyClassPlugin(ConfigurationManager cmanager, MyClass myClass) { this.cmanager_ =3D cmanager; this.myClass_ =3D myClass; } } - = + public static class MyCounter { public final List init =3D new ArrayLi= st(); + public final List start =3D new ArrayL= ist(); + public final List stop =3D new ArrayLi= st(); + public final List destroy =3D new Arra= yList(); } - = + public static class MyContainerLifecyclePlugin1 extends BaseContainerLi= fecyclePlugin { - = + public MyContainerLifecyclePlugin1() { } - = + @Override public void destroyContainer(ExoContainer container) throws Exception { @@ -526,18 +532,18 @@ counter.stop.add(this); } } - = + } - = + public static class MyContainerLifecyclePlugin2 extends BaseContainerLi= fecyclePlugin { public final String param; - = + public MyContainerLifecyclePlugin2(InitParams params) { this.param =3D params !=3D null ? params.getValueParam("param").g= etValue() : null; } - = + @Override public void destroyContainer(ExoContainer container) throws Exception { @@ -576,17 +582,16 @@ { counter.stop.add(this); } - } = + } } - = - = + public static class MyContainerLifecyclePlugin3 extends BaseContainerLi= fecyclePlugin { - = + public MyContainerLifecyclePlugin3() { } - = + @Override public void destroyContainer(ExoContainer container) throws Exception { @@ -626,34 +631,39 @@ counter.stop.add(this); } } - = + } - = + public static class A { public B b; + public A(B b) { this.b =3D b; } } + public static class BPlugin extends BaseComponentPlugin { public A a; + public BPlugin(A a) { this.a =3D a; } } - = + public static class B { public A a; + public BPlugin plugin_; + public void add(BPlugin plugin) { this.plugin_ =3D plugin; - this.a =3D plugin.a; = + this.a =3D plugin.a; } } = @@ -672,7 +682,7 @@ public Object getComponentInstance(PicoContainer arg0) throws PicoIn= itializationException, PicoIntrospectionException { - return "testKey"; + throw new PicoInitializationException("Can't instantiate a compon= ent."); } = public Class getComponentImplementation() @@ -684,10 +694,11 @@ { } } - = + public static class C0 implements Startable { C1 c1; + public C0(C1 c1) { this.c1 =3D c1; @@ -706,15 +717,15 @@ public void stop() { } - = + } - = + public static class C1 implements Startable { public boolean started; - = + P p; - = + /** * @see org.picocontainer.Startable#start() */ @@ -735,26 +746,30 @@ * @see org.picocontainer.Startable#stop() */ public void stop() - { = + { } - = + public void add(P p) { this.p =3D p; } } + public static class P extends BaseComponentPlugin { public C0 c0; + public C1 c1; + public C2 c2; + public P(C0 c0, C1 c1, C2 c2) { this.c0 =3D c0; this.c1 =3D c1; this.c2 =3D c2; } - = + public void init() { if (!c2.started) @@ -763,11 +778,11 @@ } } } - = + public static class C2 implements Startable { public boolean started; - = + /** * @see org.picocontainer.Startable#start() */ @@ -780,10 +795,10 @@ * @see org.picocontainer.Startable#stop() */ public void stop() - { = + { } } - = + public void testLifeCycle() throws Throwable { ConcurrentPicoContainer container =3D new ConcurrentPicoContainer(); @@ -843,19 +858,21 @@ assertFalse(container.canBeStopped()); assertTrue(container.canBeDisposed()); container.dispose(); - assertTrue(c1.disposed && c2.disposed && c5.disposed); = + assertTrue(c1.disposed && c2.disposed && c5.disposed); assertFalse(container.canBeStarted()); assertFalse(container.canBeStopped()); assertFalse(container.canBeDisposed()); } - = + public static class LC1 implements Startable, Disposable { = public boolean started; + public boolean stopped; + public boolean disposed; - = + public void start() { throw new RuntimeException(); @@ -869,16 +886,18 @@ public void dispose() { disposed =3D true; - } = + } } - = + public static class LC2 implements Startable, Disposable { = public boolean started; + public boolean stopped; + public boolean disposed; - = + public void start() { started =3D true; @@ -892,16 +911,18 @@ public void dispose() { disposed =3D true; - } = + } } - = + public static class LC3 implements Startable, Disposable { = public boolean started; + public boolean stopped; + public boolean disposed; - = + public void start() { started =3D true; @@ -915,16 +936,18 @@ public void dispose() { throw new RuntimeException(); - } = + } } - = + public static class LC4 implements Startable { = public boolean started; + public boolean stopped; + public boolean disposed; - = + public void start() { started =3D true; @@ -933,46 +956,51 @@ public void stop() { stopped =3D true; - } = + } } - = + public static class LC5 implements Disposable { = public boolean started; + public boolean stopped; + public boolean disposed; = public void dispose() { disposed =3D true; - } = + } } - = + public static class SOE1 { public SOEPlugin plugin; + public void addPlugin(SOEPlugin plugin) { this.plugin =3D plugin; } } - = + public static class SOEPlugin extends BaseComponentPlugin { public SOE2 soe2; + public SOEPlugin(SOE2 soe2) { this.soe2 =3D soe2; } - } = - = + } + public static class SOE2 { public SOE1 soe1; + public SOE2() { this.soe1 =3D (SOE1)ExoContainerContext.getCurrentContainer().get= ComponentInstanceOfType(SOE1.class); } - } = + } } --===============7960708818078723993==-- From do-not-reply at jboss.org Fri Jul 1 09:36:03 2011 Content-Type: multipart/mixed; boundary="===============3892460343149317973==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4583 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl. Date: Fri, 01 Jul 2011 09:36:02 -0400 Message-ID: <201107011336.p61Da2Ma027481@svn01.web.mwc.hst.phx2.redhat.com> --===============3892460343149317973== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-01 09:36:02 -0400 (Fri, 01 Jul 2011) New Revision: 4583 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/WorkspaceContainer.java Log: EXOJCR-1068 : Organizing JMX MBeans structure in a true way. 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 2011-07-01 13:34:04 UTC (rev 4582) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2011-07-01 13:36:02 UTC (rev 4583) @@ -86,7 +86,7 @@ * @version $Id: RepositoryContainer.java 13986 2008-05-08 10:48:43Z pnedo= nosko $ */ @Managed -(a)NameTemplate({@Property(key =3D "container", value =3D "repository"), @= Property(key =3D "name", value =3D "{Name}")}) +(a)NameTemplate(@Property(key =3D "repository", value =3D "{Name}")) @NamingContext(@Property(key =3D "repository", value =3D "{Name}")) public class RepositoryContainer extends ExoContainer { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/WorkspaceContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/WorkspaceContainer.java 2011-07-01 13:34:04 UTC (rev 4582) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/WorkspaceContainer.java 2011-07-01 13:36:02 UTC (rev 4583) @@ -45,7 +45,7 @@ */ = @Managed -(a)NameTemplate({@Property(key =3D "container", value =3D "workspace"), @P= roperty(key =3D "name", value =3D "{Name}")}) +(a)NameTemplate(@Property(key =3D "workspace", value =3D "{Name}")) @NamingContext(@Property(key =3D "workspace", value =3D "{Name}")) public class WorkspaceContainer extends ExoContainer { --===============3892460343149317973==-- From do-not-reply at jboss.org Fri Jul 1 09:39:07 2011 Content-Type: multipart/mixed; boundary="===============4616432241931113256==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4584 - core/trunk/exo.core.component.database/src/test/java/org/exoplatform/services/database. Date: Fri, 01 Jul 2011 09:39:07 -0400 Message-ID: <201107011339.p61Dd7nP027519@svn01.web.mwc.hst.phx2.redhat.com> --===============4616432241931113256== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-01 09:39:07 -0400 (Fri, 01 Jul 2011) New Revision: 4584 Modified: core/trunk/exo.core.component.database/src/test/java/org/exoplatform/ser= vices/database/TestDBCreator.java Log: EXOJCR-1397: Fix test Modified: core/trunk/exo.core.component.database/src/test/java/org/exoplatf= orm/services/database/TestDBCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/se= rvices/database/TestDBCreator.java 2011-07-01 13:36:02 UTC (rev 4583) +++ core/trunk/exo.core.component.database/src/test/java/org/exoplatform/se= rvices/database/TestDBCreator.java 2011-07-01 13:39:07 UTC (rev 4584) @@ -70,7 +70,8 @@ = Map refAddr =3D dbInfo.getProperties(); = - initContext.bind("testjdbcjcr", "javax.sql.DataSource", "org.apache.= commons.dbcp.BasicDataSourceFactory", null, + initContext.getInitialContextBinder().bind("testjdbcjcr", "javax.sql= .DataSource", + "org.apache.commons.dbcp.BasicDataSourceFactory", null, refAddr); = DataSource ds =3D (DataSource)initContext.getInitialContext().lookup= ("testjdbcjcr"); @@ -107,7 +108,8 @@ = Map refAddr =3D dbInfo.getProperties(); = - initContext.bind("testjdbcjcr2", "javax.sql.DataSource", "org.apache= .commons.dbcp.BasicDataSourceFactory", null, + initContext.getInitialContextBinder().bind("testjdbcjcr2", "javax.sq= l.DataSource", + "org.apache.commons.dbcp.BasicDataSourceFactory", null, refAddr); = DataSource ds =3D (DataSource)initContext.getInitialContext().lookup= ("testjdbcjcr2"); @@ -165,7 +167,7 @@ = Map refAddr =3D dbInfo.getProperties(); = - initContext.bind("testjdbcjcr_" + threadNumber, "javax.sql.Dat= aSource", + initContext.getInitialContextBinder().bind("testjdbcjcr_" + th= readNumber, "javax.sql.DataSource", "org.apache.commons.dbcp.BasicDataSourceFactory", null, ref= Addr); } catch (Exception e) --===============4616432241931113256==-- From do-not-reply at jboss.org Fri Jul 1 10:06:00 2011 Content-Type: multipart/mixed; boundary="===============0332460343372260418==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4585 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/management. Date: Fri, 01 Jul 2011 10:06:00 -0400 Message-ID: <201107011406.p61E605C003594@svn01.web.mwc.hst.phx2.redhat.com> --===============0332460343372260418== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-01 10:06:00 -0400 (Fri, 01 Jul 2011) New Revision: 4585 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/management/ManageableContainer.java Log: EXOJCR-1068 : fixed Exception handling. Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/management/ManageableContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/management/ManageableContainer.java 2011-07-01 13:39:07 UTC (rev 4584) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/management/ManageableContainer.java 2011-07-01 14:06:00 UTC (rev 4585) @@ -244,7 +244,7 @@ managementContext.unregister(componentInstance); } } - catch (PicoException e) + catch (Exception e) { // Ignore, may be caused by lazy initialization mechanism } --===============0332460343372260418==-- From do-not-reply at jboss.org Fri Jul 1 10:27:05 2011 Content-Type: multipart/mixed; boundary="===============9152355687276873900==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4586 - kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container. Date: Fri, 01 Jul 2011 10:27:05 -0400 Message-ID: <201107011427.p61ER5EF005239@svn01.web.mwc.hst.phx2.redhat.com> --===============9152355687276873900== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-01 10:27:05 -0400 (Fri, 01 Jul 2011) New Revision: 4586 Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/containe= r/TestExoContainer.java Log: EXOJCR-1068 : fixed Exception throwing. Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/c= ontainer/TestExoContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestExoContainer.java 2011-07-01 14:06:00 UTC (rev 4585) +++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/contain= er/TestExoContainer.java 2011-07-01 14:27:05 UTC (rev 4586) @@ -682,7 +682,9 @@ public Object getComponentInstance(PicoContainer arg0) throws PicoIn= itializationException, PicoIntrospectionException { - throw new PicoInitializationException("Can't instantiate a compon= ent."); + // Used to check a situation when RunTimeException occurs while r= etrieving an instance. + // This reproduces usecase from JCR-1565 + throw new RuntimeException(); } = public Class getComponentImplementation() --===============9152355687276873900==-- From do-not-reply at jboss.org Mon Jul 4 08:56:27 2011 Content-Type: multipart/mixed; boundary="===============2655590484208058450==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4587 - kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache and 3 other directories. Date: Mon, 04 Jul 2011 08:56:27 -0400 Message-ID: <201107041256.p64CuRQ5029321@svn01.web.mwc.hst.phx2.redhat.com> --===============2655590484208058450== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2011-07-04 08:56:27 -0400 (Mon, 04 Jul 2011) New Revision: 4587 Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/impl/InvalidationExoCache.java Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/cache.xml kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/ExoCacheConfig.java kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/impl/CacheServiceImpl.java kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/src/main/= java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/= org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java Log: EXOJCR-1418: Support non-serializable values in distributed eXo caches The attribute "avoidValueReplication" has been added into ExoCacheConfig to= allow to enable the invalidation mode by configuration if needed Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/cache.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/cache.xml 2011-07-01 14:27:05 UTC (rev 4586) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/cache.xml 2011-07-04 12:56:27 UTC (rev 4587) @@ -20,7 +20,7 @@ create new ExoCache instances. See the below example of org.exoplatform.services.cache.CacheService definition: - = + <component> <key>org.exoplatform.services.cache.CacheService</key> <jmx-name>cache:type=3DCacheService</jmx-name> @@ -40,16 +40,17 @@ </init-params> </component> = - - The ExoCacheConfig which name is - default, will be the default configuration of all t= he - ExoCache instances that don't have dedicated - configuration. - - See the below example about how to define a new + + The ExoCacheConfig which name is + default, will be the default configuration of all the + ExoCache instances that don't have dedicated + configuration. + + + See the below example about how to define a new ExoCacheConfig thanks to a external-component-plugin: - = + <external-component-plugins> <target-component>org.exoplatform.services.cache.CacheService<= ;/target-component> <component-plugin> @@ -125,14 +126,14 @@ distributed = Indicates if the cache is distributed. This field is - optional. This field is used for backward compatibility. + optional. This field is deprecated. = replicated = Indicates if the cache is replicated. This field is - optional. This field is deprecated. + optional. = @@ -141,11 +142,95 @@ Indicates if the log is enabled. This field is optional. This field is used for backward compatibility. + + + avoidValueReplication + + Indicates whether the values of the cache should be + replicated or not in case of a replicated cache. This field is + optional. By default it is disabled. Find more details about t= his + field in the next section. + + = - +
+ Advanced concepts + +
+ Invalidation + + In case, you have big values or non serializable values and you + need a replicated cache to at list invalidate the data when it is + needed, you can use the invalidation mode that will work on top of a= ny + replicated cache implementations. This is possible thanks to the cla= ss + InvalidationExoCache which is actually a decora= tor + whose idea is to replicate the the hash code of the value in order to + know if it is needed or not to invalidate the local data, if the new + hash code of the value is the same as the old value, we assume that = it + is the same value so we don't invalidate the old value. This is requ= ired + to avoid the following infinite loop that we will face with invalida= tion + mode proposed out of the box by JBoss Cache for example: + + + + Cluster node #1 puts (key1, value1) into the cache + + + + On cluster node #2 key1 is invalidated by put call in node + #1 + + + + Node #2 re-loads key1 and puts (key1, value1) into the + cache + + + + On cluster node #1 key1 is invalidated, so we get back to = step + #1 + + + + In the use case above, thanks to the + InvalidationExoCache since the value loaded at = step + #3 has the same hash code as the value loaded as step #1, the step #4 + won't invalidate the data on the cluster node #1. + + It exists 2 ways to use the invalidation mode which are the + following: + + + + By configuration: For this you simply need to set the + parameter avoidValueReplication to + true in your eXo cache configuration, this = will + indicate the CacheService to wrap your eXo cache instance into an + InvalidationExoCache. + + + + Programmatically; You can wrap your eXo cache instance int= o an + org.exoplatform.services.cache.impl.InvalidationExoCac= he + yourself using the public constructors that are available. Please + note that if you use CacheListeners add the= m to + the InvalidationExoCache instance instead of the nested eXo Cache + because the nested eXo Cache will contain only hash codes so the + related listeners will get hash codes instead of the real + values. + + + + + The invalidation will be efficient if and only if the hash c= ode + method is properly implemented, in other words 2 value objects + representing the same data will return the same hash code otherwise + the infinite loop described above will still be effective. + +
=
@@ -158,7 +243,7 @@ = You just need to implement your own ExoCacheFactory and register it in an eXo container, as described below: - = + package org.exoplatform.services.cac= he; ... public interface ExoCacheFactory { @@ -178,7 +263,7 @@ can simply register your factory by adding a file conf/portal/configuration.xml with a content of t= he following type: - = + <configuration> <component> <key>org.exoplatform.services.cache.ExoCacheFactory</key> @@ -188,14 +273,14 @@ </configuration> = - - Since kernel 2.3.0-CR1, if the configuration is not a sub cl= ass - of ExoCacheConfig and the implementation given in t= he - configuration is the full qualified name of an existing implementa= tion - of eXo Cache, we will assume that the user expects to have an inst= ance - of this eXo Cache type so we won't use the configured cache - factory. - + + Since kernel 2.3.0-CR1, if the configuration is not a sub clas= s of + ExoCacheConfig and the implementation given in the + configuration is the full qualified name of an existing implementati= on + of eXo Cache, we will assume that the user expects to have an instan= ce + of this eXo Cache type so we won't use the configured cache + factory. +
=
@@ -210,7 +295,7 @@ wish as you can do with any components. = The default configuration of the factory is: - = + <configuration> = <component> <key>org.exoplatform.services.cache.ExoCacheFactory</key> @@ -278,7 +363,7 @@ If for a given reason, you need to use a specific configuration for a cache, you can register one thanks to an "external plugin", see an example below: - = + <configuration> ... <external-component-plugins> @@ -323,9 +408,8 @@ Understanding a cache creator = The factory for jboss cache, delegates the cache creation to - ExoCacheCreator that is defined as - below: - = + ExoCacheCreator that is defined as below: + package org.exoplatform.services= .cache.impl.jboss; ... public interface ExoCacheCreator { @@ -387,9 +471,8 @@ Registering a cache creator = You can register any cache creator that you want thanks to an - "external plugin", see an example - below: - = + "external plugin", see an example below: + <external-component-plugins&= gt; <target-component>org.exoplatform.services.cache.ExoCacheFactory= </target-component> <component-plugin> @@ -483,7 +566,6 @@ <object type=3D"org.exoplatform.services.cache.impl.jboss.fifo.FIFOExo= CacheCreator"></object> </object-param> ... -
=
@@ -496,7 +578,6 @@ <object type=3D"org.exoplatform.services.cache.impl.jboss.mru.MRUExoC= acheCreator"></object> </object-param> ... -
=
@@ -707,56 +788,54 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxNodes + + + + maxNodes = - This is the maximum number of nodes allowed in - this region. 0 denotes immediate expiry, -1 denotes = no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - minTimeToLive + + minTimeToLive = - The minimum amount of time (in milliseconds) = that - a node must be allowed to live after being accessed - before it is allowed to be considered for eviction. 0 - denotes that this feature is disabled, which is the - default value. - + The minimum amount of time (in milliseconds) that a + node must be allowed to live after being accessed before i= t is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + = - - maxAge + + maxAge = - Lifespan of a node (in milliseconds) regardle= ss - of idle time before the node is swept away. 0 denotes - immediate expiry, -1 denotes no limit. - + Lifespan of a node (in milliseconds) regardless of = idle + time before the node is swept away. 0 denotes immediate + expiry, -1 denotes no limit. + = - - timeToLive + + timeToLive = - The amount of time that a node is not written= to - or read (in milliseconds) before the node is swept a= way. - 0 denotes immediate expiry, -1 denotes no limit. - - - -
- = - + The amount of time that a node is not written to or + read (in milliseconds) before the node is swept away. 0 + denotes immediate expiry, -1 denotes no limit. + + + + = + Old configuration - + = - ... + ... <object-param> <name>lru-with-old-config</name> <description>The lru cache configuration</description> @@ -769,38 +848,36 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxSize + + + + maxSize = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - liveTime + + liveTime = - The minimum amount of time (in seconds) that a = node - must be allowed to live after being accessed before it= is - allowed to be considered for eviction. 0 denotes that = this - feature is disabled, which is the default value. - - - -
+ The minimum amount of time (in seconds) that a node + must be allowed to live after being accessed before it is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + + = - - For the fields maxAge and - timeToLive needed by JBoss cache, we = will - use the default values provided by the creator. - - = - = + + For the fields maxAge and + timeToLive needed by JBoss cache, we will u= se + the default values provided by the creator. +
=
@@ -811,8 +888,8 @@ New configuration - = - ... + + ... <object-param> <name>fifo</name> <description>The fifo cache configuration</description> @@ -824,38 +901,38 @@ </object-param> ... = - - Fields description +
+ Fields description = - - - - maxNodes + + + + maxNodes = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - minTimeToLive + + minTimeToLive = - The minimum amount of time (in milliseconds) th= at a - node must be allowed to live after being accessed befo= re - it is allowed to be considered for eviction. 0 denotes - that this feature is disabled, which is the default - value. - - - -
- - - Old configuration - - - = - ... + The minimum amount of time (in milliseconds) that a + node must be allowed to live after being accessed before i= t is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + + + + + + Old configuration + + + + ... <object-param> <name>fifo-with-old-config</name> <description>The fifo cache configuration</description> @@ -868,30 +945,30 @@ </object-param> ... = - - Fields description +
+ Fields description = - - - - maxSize + + + + maxSize = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - liveTime + + liveTime = - The minimum amount of time (in seconds) that a = node - must be allowed to live after being accessed before it= is - allowed to be considered for eviction. 0 denotes that = this - feature is disabled, which is the default value. - - - -
+ The minimum amount of time (in seconds) that a node + must be allowed to live after being accessed before it is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + +
=
@@ -902,8 +979,8 @@ New configuration - = - ... + + ... <object-param> <name>mru</name> <description>The mru cache configuration</description> @@ -915,39 +992,38 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxNodes + + + + maxNodes = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - minTimeToLive + + minTimeToLive = - The minimum amount of time (in milliseconds) th= at a - node must be allowed to live after being accessed befo= re - it is allowed to be considered for eviction. 0 denotes - that this feature is disabled, which is the default - value. - - - -
- = + The minimum amount of time (in milliseconds) that a + node must be allowed to live after being accessed before i= t is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + + + Old configuration - = - ... + + ... <object-param> <name>mru-with-old-config</name> <description>The mru cache configuration</description> @@ -960,30 +1036,30 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxSize + + + + maxSize = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - liveTime + + liveTime = - The minimum amount of time (in seconds) that a = node - must be allowed to live after being accessed before it= is - allowed to be considered for eviction. 0 denotes that = this - feature is disabled, which is the default value. - - - -
+ The minimum amount of time (in seconds) that a node + must be allowed to live after being accessed before it is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + +
=
@@ -994,8 +1070,8 @@ New configuration - = - ... + + ... <object-param> <name>lfu</name> <description>The lfu cache configuration</description> @@ -1008,49 +1084,49 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxNodes + + + + maxNodes = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - minNodes + + minNodes = - This is the minimum number of nodes allowed in = this - region. This value determines what the eviction queue - should prune down to per pass. e.g. If minNodes is 10 = and - the cache grows to 100 nodes, the cache is pruned down= to - the 10 most frequently used nodes when the eviction ti= mer - makes a pass through the eviction algorithm. - + This is the minimum number of nodes allowed in this + region. This value determines what the eviction queue shou= ld + prune down to per pass. e.g. If minNodes is 10 and the cac= he + grows to 100 nodes, the cache is pruned down to the 10 most + frequently used nodes when the eviction timer makes a pass + through the eviction algorithm. + = - - minTimeToLive + + minTimeToLive = - The minimum amount of time (in milliseconds) th= at a - node must be allowed to live after being accessed befo= re - it is allowed to be considered for eviction. 0 denotes - that this feature is disabled, which is the default - value. - - - -
- = - - Old configuration - - - = - ... + The minimum amount of time (in milliseconds) that a + node must be allowed to live after being accessed before i= t is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + + + + + + Old configuration + + + + ... <object-param> <name>lfu-with-old-config</name> <description>The lfu cache configuration</description> @@ -1063,37 +1139,36 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxSize + + + + maxSize = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - liveTime + + liveTime = - The minimum amount of time (in milliseconds) th= at a - node must be allowed to live after being accessed befo= re - it is allowed to be considered for eviction. 0 denotes - that this feature is disabled, which is the default - value. - - - -
+ The minimum amount of time (in milliseconds) that a + node must be allowed to live after being accessed before i= t is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + + = - - For the fields minNodes and - timeToLive needed by JBoss cache, we = will - use the default values provided by the creator. - + + For the fields minNodes and + timeToLive needed by JBoss cache, we will= use + the default values provided by the creator. +
=
@@ -1104,8 +1179,8 @@ New configuration - = - ... + + ... <object-param> <name>ea</name> <description>The ea cache configuration</description> @@ -1118,46 +1193,45 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxNodes + + + + maxNodes = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - minTimeToLive + + minTimeToLive = - The minimum amount of time (in milliseconds) th= at a - node must be allowed to live after being accessed befo= re - it is allowed to be considered for eviction. 0 denotes - that this feature is disabled, which is the default - value. - + The minimum amount of time (in milliseconds) that a + node must be allowed to live after being accessed before i= t is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + = - - expirationTimeout + + expirationTimeout = - This is the timeout after which the cache entry - must be evicted. - - - -
- = + This is the timeout after which the cache entry mus= t be + evicted. + + + + + Old configuration - = - ... + + ... <object-param> <name>ea-with-old-config</name> <description>The ea cache configuration</description> @@ -1170,38 +1244,36 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxSize + + + + maxSize = - This is the maximum number of nodes allowed in = this - region. 0 denotes immediate expiry, -1 denotes no - limit. - + This is the maximum number of nodes allowed in this + region. 0 denotes immediate expiry, -1 denotes no + limit. + = - - liveTime + + liveTime = - The minimum amount of time (in milliseconds) th= at a - node must be allowed to live after being accessed befo= re - it is allowed to be considered for eviction. 0 denotes - that this feature is disabled, which is the default - value. - - - -
+ The minimum amount of time (in milliseconds) that a + node must be allowed to live after being accessed before i= t is + allowed to be considered for eviction. 0 denotes that this + feature is disabled, which is the default value. + + + + = - - For the fields expirationTimeout - needed by JBoss cache, we will use the default values prov= ided - by the creator. - - = + + For the fields expirationTimeout ne= eded + by JBoss cache, we will use the default values provided by the + creator. +
@@ -1218,7 +1290,7 @@ if you wish as you can do with any components.
= The default configuration of the factory is: - = + <configuration> = <component> <key>org.exoplatform.services.cache.ExoCacheFactory</key> @@ -1241,12 +1313,13 @@ = The default configuration template aims to be the skeleton from which we will create any type of infinispan cache instance, thus it = must - be very generic. = + be very generic. + - All the cache instances that will rely on this cache - configuration will share the same - EmbeddedCacheManager. - + All the cache instances that will rely on this cache + configuration will share the same + EmbeddedCacheManager. + =
@@ -1255,7 +1328,7 @@ If for a given reason, you need to use a specific configuration for a cache, you can register one thanks to an "external plugin", see an example below: - = + <configuration> ... <external-component-plugins> @@ -1306,9 +1379,8 @@ Understanding a cache creator = The factory for infinispan, delegates the cache creation to - ExoCacheCreator that is defined as - below: - = + ExoCacheCreator that is defined as below: + package org.exoplatform.services= .cache.impl.infinispan; ... public interface ExoCacheCreator { @@ -1374,9 +1446,8 @@ Register a cache creator = You can register any cache creator you want thanks to an - "external plugin", see an example - below: - = + "external plugin", see an example below: + <external-component-plugins&= gt; <target-component>org.exoplatform.services.cache.ExoCacheFactory= </target-component> <component-plugin> @@ -1535,8 +1606,8 @@ New configuration - = - ... + + ... <object-param> <name>myCache</name> <description>My cache configuration</description> @@ -1550,67 +1621,65 @@ </object> </object-param> = ... - - Fields description = - - - - strategy +
+ Fields description = - The name of the strategy to use such as - 'UNORDERED', 'FIFO', 'LRU', 'LIRS' and 'NONE' (to - disable eviction). - + + + + strategy = - - maxEntries + The name of the strategy to use such as 'UNORDERED', + 'FIFO', 'LRU', 'LIRS' and 'NONE' (to disable + eviction). + = - Maximum number of entries in a cache instance= . If - selected value is not a power of two the actual value - will default to the least power of two larger than - selected value. -1 means no limit which is also the - default value. - + + maxEntries = - - lifespan + Maximum number of entries in a cache instance. If + selected value is not a power of two the actual value will + default to the least power of two larger than selected val= ue. + -1 means no limit which is also the default value. + = - Maximum lifespan of a cache entry, after which - the entry is expired cluster-wide, in milliseconds. = -1 - means the entries never expire which is also the def= ault - value. - + + lifespan = - - maxIdle + Maximum lifespan of a cache entry, after which the + entry is expired cluster-wide, in milliseconds. -1 means t= he + entries never expire which is also the default value. + = - Maximum idle time a cache entry will be - maintained in the cache, in milliseconds. If the idle - time is exceeded, the entry will be expired - cluster-wide. -1 means the entries never expire whic= h is - also the default value. - + + maxIdle = - - wakeUpInterval + Maximum idle time a cache entry will be maintained = in + the cache, in milliseconds. If the idle time is exceeded, = the + entry will be expired cluster-wide. -1 means the entries n= ever + expire which is also the default value. + = - Interval between subsequent eviction runs, in - milliseconds. If you wish to disable the periodic - eviction process altogether, set wakeupInterval to -= 1. - The default value is 5000. - - - -
- = + + wakeUpInterval + + Interval between subsequent eviction runs, in + milliseconds. If you wish to disable the periodic eviction + process altogether, set wakeupInterval to -1. The default + value is 5000. + + + + + Old configuration = - ... + ... <object-param> <name>myCache</name> <description>My cache configuration</description> @@ -1622,48 +1691,45 @@ </object-param> = ... = - - Fields description +
+ Fields description = - - - - maxSize + + + + maxSize = - Maximum number of entries in a cache instance. = If - selected value is not a power of two the actual value = will - default to the least power of two larger than selected - value. -1 means no limit which is also the default - value. - + Maximum number of entries in a cache instance. If + selected value is not a power of two the actual value will + default to the least power of two larger than selected val= ue. + -1 means no limit which is also the default value. + = - - liveTime + + liveTime = - Maximum lifespan of a cache entry, after which = the - entry is expired cluster-wide, in milliseconds. -1 mea= ns - the entries never expire which is also the default - value. - + Maximum lifespan of a cache entry, after which the + entry is expired cluster-wide, in milliseconds. -1 means t= he + entries never expire which is also the default value. + = - - implementation + + implementation = - The name of the implementation to use the expec= ted - value is one of the eviction strategies defined in the - field implementations of the gene= ric - cache creator. - - - -
+ The name of the implementation to use the expected + value is one of the eviction strategies defined in the fie= ld + implementations of the generic cache + creator. + + + + = - - For the fields maxIdle and - wakeUpInterval needed by infinispan, = we - will use the default values provided by the creator. - - = + + For the fields maxIdle and + wakeUpInterval needed by infinispan, we w= ill + use the default values provided by the creator. +
Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplat= form/services/cache/ExoCacheConfig.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheConfig.java 2011-07-01 14:27:05 UTC (rev 4586) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/ExoCacheConfig.java 2011-07-04 12:56:27 UTC (rev 4587) @@ -68,6 +68,11 @@ */ private boolean logEnabled; = + /** + * Indicates whether or not the replication of the values should be avo= ided + */ + public boolean avoidValueReplication; + public String getName() { return name; @@ -147,8 +152,24 @@ { this.logEnabled =3D enableLogging; } + = + /** + * @return the avoidValueReplication + */ + public boolean avoidValueReplication() + { + return avoidValueReplication; + } = /** + * @param avoidValueReplication the avoidValueReplication to set + */ + public void setAvoidValueReplication(boolean avoidValueReplication) + { + this.avoidValueReplication =3D avoidValueReplication; + } + + /** * @see java.lang.Object#clone() */ @Override Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplat= form/services/cache/impl/CacheServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/CacheServiceImpl.java 2011-07-01 14:27:05 UTC (rev 4586) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/CacheServiceImpl.java 2011-07-04 12:56:27 UTC (rev 4587) @@ -154,6 +154,7 @@ return null; } = + @SuppressWarnings({"rawtypes", "unchecked"}) private ExoCache createCacheInstance(String = region) throws Exception { ExoCacheConfig config =3D configs_.get(region); @@ -198,7 +199,9 @@ { managed.registerCache(simple); } - return simple; + // If the flag avoid value replication is enabled we wrap the eXo ca= che instance + // into an InvalidationExoCache to enable the invalidation + return safeConfig.avoidValueReplication() ? new InvalidationExoCache= (simple) : simple; } = public Collection> getAllCacheInsta= nces() Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatfor= m/services/cache/impl/InvalidationExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/InvalidationExoCache.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/InvalidationExoCache.java 2011-07-04 12:56:27 UTC (rev 4= 587) @@ -0,0 +1,560 @@ +/* + * Copyright (C) 2011 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; + +import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CacheListenerContext; +import org.exoplatform.services.cache.CachedObjectSelector; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ObjectCacheInfo; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CopyOnWriteArrayList; + +/** + * This eXo cache type is a decorator allowing ExoCache instances that have + * big values or non serializable values to be replicated thanks to an inv= alidation + * mechanism. To prevent infinite loop described below, we replicate the h= ash code of + * the value such that if the hash code is the same, we don't invalidate t= he value locally + *
    + *
  • Cluster node #1 puts (key1, value1) into the cache
  • + *
  • On cluster node #2 key1 is invalidated by the put call in node #1 + *
  • Node #2 re-loads key1 and puts (key1, value1) into the cache
  • + *
  • On cluster node #1 key1 is invalidated, so we get back to step #1 + *
+ * = + * @author Nicolas Filotto + * @version $Id$ + * + */ +public class InvalidationExoCache implements Ex= oCache, CacheListener> +{ + /** + * Logger. + */ + private static final Log LOG =3D ExoLogger.getLogger("exo.kernel.compon= ent.cache.InvalidationExoCache"); + + /** + * The eXo cache instance that we would like to replicate using the inv= alidation + * mechanism + */ + private final ExoCache> delegate; + = + /** + * The listeners of the cache + */ + private final CopyOnWriteArrayList>= listeners; + = + /** + * The local cache that contains the real values + */ + private final ConcurrentMap localCache; + = + /** + * @param delegate the underneath eXo cache instance, we assume that th= e eXo cache + * implementation behind is fully functional. + */ + public InvalidationExoCache(ExoCache delegate) + { + this(delegate, 16); + } + = + /** + * @param delegate the underneath eXo cache instance, we assume that th= e eXo cache + * implementation behind is fully functional. + * @concurrencyLevel the estimated number of concurrently + * updating threads. The implementation performs internal sizing + * to try to accommodate this many threads. = + */ + @SuppressWarnings("unchecked") + public InvalidationExoCache(ExoCache delegate, int concurrencyLev= el) + { + this.delegate =3D (ExoCache>)delegate; + // We listen to the cache in order to get a callbacks in case of int= ernal puts for example + this.delegate.addCacheListener(this); + this.listeners =3D new CopyOnWriteArrayList>(); + this.localCache =3D new ConcurrentHashMap(concurrencyLevel, 0.= 75f, concurrencyLevel); = + } + = + /** + * @see org.exoplatform.services.cache.ExoCache#getName() + */ + public String getName() + { + return delegate.getName(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setName(java.lang.Strin= g) + */ + public void setName(String name) + { + delegate.setName(name); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getLabel() + */ + public String getLabel() + { + return delegate.getLabel(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setLabel(java.lang.Stri= ng) + */ + public void setLabel(String s) + { + delegate.setLabel(s); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#get(java.io.Serializabl= e) + */ + public V get(Serializable name) + { + HashCode result =3D delegate.get(name); + return result =3D=3D null ? null : localCache.get(name); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#remove(java.io.Serializ= able) + */ + public V remove(Serializable key) throws NullPointerException + { + V value =3D localCache.get(key); + delegate.remove(key); + return value; + } + + /** + * @see org.exoplatform.services.cache.ExoCache#put(java.io.Serializabl= e, java.lang.Object) + */ + public void put(K key, V value) throws NullPointerException + { + delegate.put(key, new HashCode(value)); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#putMap(java.util.Map) + */ + public void putMap(Map objs) throws NullPoint= erException, IllegalArgumentException + { + if (objs =3D=3D null) + { + throw new NullPointerException("No null map accepted"); + } + Map> map =3D new LinkedHashMap>(); + for (Entry entry : objs.entrySet()) + { + if (entry.getKey() =3D=3D null) + { + throw new IllegalArgumentException("No null cache key accepted= "); + } + else if (entry.getValue() =3D=3D null) + { + throw new IllegalArgumentException("No null cache value accept= ed"); = + } + map.put(entry.getKey(), new HashCode(entry.getValue())); + } + delegate.putMap(map); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#clearCache() + */ + public void clearCache() + { + delegate.clearCache(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#select(org.exoplatform.= services.cache.CachedObjectSelector) + */ + public void select(CachedObjectSelector selector)= throws Exception + { + if (selector =3D=3D null) + { + throw new IllegalArgumentException("No null selector"); + } + for (Entry entry : localCache.entrySet()) + { + final K key =3D entry.getKey(); + final V value =3D entry.getValue(); + ObjectCacheInfo info =3D new ObjectCacheInfo() + { + public V get() + { + return value; + } + + public long getExpireTime() + { + // Cannot know: The expire time is managed by JBoss Cache i= tself + return -1; + } + }; + if (selector.select(key, info)) + { + selector.onSelect(this, key, info); + } + } + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCacheSize() + */ + public int getCacheSize() + { + return localCache.size(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getMaxSize() + */ + public int getMaxSize() + { + return delegate.getMaxSize(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setMaxSize(int) + */ + public void setMaxSize(int max) + { + delegate.setMaxSize(max); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getLiveTime() + */ + public long getLiveTime() + { + return delegate.getLiveTime(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setLiveTime(long) + */ + public void setLiveTime(long period) + { + delegate.setLiveTime(period); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCacheHit() + */ + public int getCacheHit() + { + return delegate.getCacheHit(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCacheMiss() + */ + public int getCacheMiss() + { + return delegate.getCacheMiss(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCachedObjects() + */ + public List getCachedObjects() + { + return new ArrayList(localCache.values()); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#removeCachedObjects() + */ + public List removeCachedObjects() + { + final List list =3D getCachedObjects(); + clearCache(); + return list; + } + + /** + * @see org.exoplatform.services.cache.ExoCache#addCacheListener(org.ex= oplatform.services.cache.CacheListener) + */ + public void addCacheListener(CacheListener listen= er) throws NullPointerException + { + if (listener =3D=3D null) + { + throw new NullPointerException(); + } + listeners.add(listener); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#isLogEnabled() + */ + public boolean isLogEnabled() + { + return delegate.isLogEnabled(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setLogEnabled(boolean) + */ + public void setLogEnabled(boolean b) + { + delegate.setLogEnabled(b); + } + + /** + * @see org.exoplatform.services.cache.CacheListener#onExpire(org.exopl= atform.services.cache.CacheListenerContext, java.io.Serializable, java.lang= .Object) + */ + public void onExpire(CacheListenerContext context, K key, HashCode o= bj) throws Exception + { + V value =3D localCache.remove(key); + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onExpire(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + } + + /** + * @see org.exoplatform.services.cache.CacheListener#onRemove(org.exopl= atform.services.cache.CacheListenerContext, java.io.Serializable, java.lang= .Object) + */ + public void onRemove(CacheListenerContext context, K key, HashCode o= bj) throws Exception + { + V value =3D localCache.remove(key); + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onRemove(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + } + + /** + * @see org.exoplatform.services.cache.CacheListener#onPut(org.exoplatf= orm.services.cache.CacheListenerContext, java.io.Serializable, java.lang.Ob= ject) + */ + public void onPut(CacheListenerContext context, K key, HashCode obj)= throws Exception + { + V value =3D obj.getValue(); + if (value !=3D null) + { + // we assume that it is a local put since the value is inside the= HashCode object + localCache.put(key, value); + } + else + { + // we assume that it is a remote put since the value is not insid= e the HashCode object + V currentValue =3D localCache.get(key); + if (currentValue !=3D null && obj !=3D null && currentValue.hashC= ode() =3D=3D obj.hashCode()) + { + // We assume that it is the same value so we don't change the = value in the cache + value =3D currentValue; + } + else + { + // A new value has been added to the cache so we invalidate th= e local one + value =3D null; + localCache.remove(key); + } + } + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + try + { + listener.onPut(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + + /** + * @see org.exoplatform.services.cache.CacheListener#onGet(org.exoplatf= orm.services.cache.CacheListenerContext, java.io.Serializable, java.lang.Ob= ject) + */ + public void onGet(CacheListenerContext context, K key, HashCode obj)= throws Exception + { + if (listeners.isEmpty()) + { + return; + } + V value =3D obj =3D=3D null ? null : localCache.get(key); + for (CacheListener listener : listeners) + try + { + listener.onGet(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + + /** + * @see org.exoplatform.services.cache.CacheListener#onClearCache(org.e= xoplatform.services.cache.CacheListenerContext) + */ + public void onClearCache(CacheListenerContext context) throws Exception + { + localCache.clear(); + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onClearCache(context); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } = + } + = + /** + * We use this class to propagate the hash code of the value efficientl= y over the network + */ + public static class HashCode implements Externalizable + { + /** + * The hash code of the value + */ + private int hashCode; + = + /** + * The corresponding value + */ + private V value; + = + public HashCode() {} + = + public HashCode(V value) + { + this.hashCode =3D value.hashCode(); + this.value =3D value; + } + = + /** + * @return the value + */ + public V getValue() + { + return value; + } + + /** + * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) + */ + public void writeExternal(ObjectOutput out) throws IOException + { + out.writeInt(hashCode); + } + + /** + * @see java.io.Externalizable#readExternal(java.io.ObjectInput) + */ + public void readExternal(ObjectInput in) throws IOException, ClassNo= tFoundException + { + this.hashCode =3D in.readInt(); + } + + /** + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() + { + return hashCode; + } + + /** + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) + { + if (this =3D=3D obj) + return true; + if (obj =3D=3D null) + return false; + if (getClass() !=3D obj.getClass()) + return false; + @SuppressWarnings("rawtypes") + HashCode other =3D (HashCode)obj; + if (hashCode !=3D other.hashCode) + return false; + if (value !=3D null && other.value !=3D null) + { + return value.equals(other.value); + } + return true; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + return "HashCode [hashCode=3D" + hashCode + ", value=3D" + value = + "]"; + } + } = +} Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/sr= c/main/java/org/exoplatform/services/cache/impl/infinispan/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.infinispan.v4/src/main= /java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java = 2011-07-01 14:27:05 UTC (rev 4586) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/src/main= /java/org/exoplatform/services/cache/impl/infinispan/AbstractExoCache.java = 2011-07-04 12:56:27 UTC (rev 4587) @@ -31,8 +31,10 @@ import org.infinispan.Cache; import org.infinispan.context.Flag; import org.infinispan.notifications.Listener; +import org.infinispan.notifications.cachelistener.annotation.CacheEntryEvi= cted; import org.infinispan.notifications.cachelistener.annotation.CacheEntryMod= ified; import org.infinispan.notifications.cachelistener.annotation.CacheEntryRem= oved; +import org.infinispan.notifications.cachelistener.event.CacheEntryEvictedE= vent; import org.infinispan.notifications.cachelistener.event.CacheEntryModified= Event; import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedE= vent; = @@ -472,18 +474,21 @@ @Listener public class CacheEventListener { -// Infinispan triggers a CacheEntryEvictedEvent only at explicit eviction = which is -// not what we want here. So it will be considered as non supported = -// @CacheEntryEvicted -// public void cacheEntryEvicted(CacheEntryEvictedEvent evt) -// { -// if (evt.isPre()) -// { -// final K key =3D (K)evt.getKey(); -// final V value =3D cache.withFlags(Flag.SKIP_LOCKING).get(key= ); -// onExpire(key, value); -// } -// } + /** + * Warning Infinispan triggers a CacheEntryEvictedEvent= only at explicit eviction + * that is done lazily which is not exactly what we expect, we still= use it to be = + * able to use it with avoidValueReplication set to true. + */ + @CacheEntryEvicted + public void cacheEntryEvicted(CacheEntryEvictedEvent evt) + { + if (evt.isPre()) + { + final K key =3D (K)evt.getKey(); + final V value =3D cache.withFlags(Flag.SKIP_LOCKING).get(key); + onExpire(key, value); + } + } = @CacheEntryRemoved public void cacheEntryRemoved(CacheEntryRemovedEvent evt) Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/tes= t/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java= /org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2011-0= 7-01 14:27:05 UTC (rev 4586) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java= /org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2011-0= 7-04 12:56:27 UTC (rev 4587) @@ -31,6 +31,7 @@ import org.exoplatform.services.cache.ExoCacheFactory; import org.exoplatform.services.cache.ExoCacheInitException; import org.exoplatform.services.cache.ObjectCacheInfo; +import org.exoplatform.services.cache.impl.InvalidationExoCache; import org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator; import org.exoplatform.test.BasicTestCase; = @@ -41,8 +42,8 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Set; -import java.util.Map.Entry; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; = @@ -270,17 +271,17 @@ config2.setLiveTime(1); config2.setImplementation("LRU"); config2.setDistributed(true); - AbstractExoCache cache1 =3D - (AbstractExoCache)getExoCacheFactoryInstanc= e().createCache(config); - MyCacheListener listener1 =3D new MyCacheListener(); + AbstractExoCache cache1 =3D + (AbstractExoCache)getExoCacheFactoryInstanc= e().createCache(config); + MyCacheListener listener1 =3D new MyCacheListener(); cache1.addCacheListener(listener1); - AbstractExoCache cache2 =3D - (AbstractExoCache)getExoCacheFactoryInstanc= e().createCache(config); - MyCacheListener listener2 =3D new MyCacheListener(); + AbstractExoCache cache2 =3D + (AbstractExoCache)getExoCacheFactoryInstanc= e().createCache(config); + MyCacheListener listener2 =3D new MyCacheListener(); cache2.addCacheListener(listener2); - AbstractExoCache cache3 =3D - (AbstractExoCache)getExoCacheFactoryInstanc= e().createCache(config2); - MyCacheListener listener3 =3D new MyCacheListener(); + AbstractExoCache cache3 =3D + (AbstractExoCache)getExoCacheFactoryInstanc= e().createCache(config2); + MyCacheListener listener3 =3D new MyCacheListener(); cache3.addCacheListener(listener3); try { @@ -358,7 +359,7 @@ assertEquals(1, listener1.clearCache); assertEquals(0, listener2.clearCache); assertEquals(0, listener3.clearCache); - Map values =3D new HashMap(); + Map values =3D new HashMap(); values.put(new MyKey("a"), "a"); values.put(new MyKey("b"), "b"); cache1.putMap(values); @@ -379,22 +380,22 @@ assertEquals(1, listener1.clearCache); assertEquals(0, listener2.clearCache); assertEquals(0, listener3.clearCache); - values =3D new HashMap() + values =3D new HashMap() { private static final long serialVersionUID =3D 1L; = - public Set> entrySet() + public Set> entrySet() { - Set> set =3D new LinkedHashSet<= Entry>(super.entrySet()); - set.add(new Entry() + Set> set =3D new LinkedHashSet<= Entry>(super.entrySet()); + set.add(new Entry() { = - public Object setValue(Object paramV) + public String setValue(String paramV) { return null; } = - public Object getValue() + public String getValue() { throw new RuntimeException("An exception"); } @@ -456,6 +457,247 @@ } } = + @SuppressWarnings("unchecked") + public void testDistributedCacheWithNSValues() throws Exception + { + System.out + .println("WARNING: For Linux distributions the following JVM para= meter must be set to true, java.net.preferIPv4Stack =3D " + + System.getProperty("java.net.preferIPv4Stack")); + ExoCacheConfig config =3D new ExoCacheConfig(); + config.setName("MyCacheDistributedWithNSValues"); + config.setMaxSize(5); + config.setLiveTime(1); + config.setImplementation("LRU"); + config.setDistributed(true); + config.setAvoidValueReplication(true); + ExoCacheConfig config2 =3D new ExoCacheConfig(); + config2.setName("MyCacheDistributedWithNSValues2"); + config2.setMaxSize(5); + config2.setLiveTime(1); + config2.setImplementation("LRU"); + config2.setDistributed(true); + config2.setAvoidValueReplication(true); + AbstractExoCache acache1 =3D + (AbstractExoCache)getExoCac= heFactoryInstance().createCache(config); + MyCacheListener listener1 =3D new MyCacheLis= tener(); + ExoCache cache1 =3D new Invali= dationExoCache(acache1); + cache1.addCacheListener(listener1); + AbstractExoCache acache2 =3D + (AbstractExoCache)getExoCac= heFactoryInstance().createCache(config); + MyCacheListener listener2 =3D new MyCacheLis= tener(); + ExoCache cache2 =3D new Invali= dationExoCache(acache2); + cache2.addCacheListener(listener2); + AbstractExoCache acache3 =3D + (AbstractExoCache)getExoCac= heFactoryInstance().createCache(config2); + MyCacheListener listener3 =3D new MyCacheLis= tener(); + ExoCache cache3 =3D new Invali= dationExoCache(acache3); + cache3.addCacheListener(listener3); + try + { + cache1.put(new MyKey("a"), new MyNonSerializableValue("b")); + assertEquals(1, cache1.getCacheSize()); + assertNull(cache2.get(new MyKey("a"))); + assertEquals(0, cache2.getCacheSize()); + assertEquals(0, cache3.getCacheSize()); + assertEquals(1, listener1.put); + assertEquals(1, listener2.put); + assertEquals(0, listener3.put); + assertEquals(0, listener1.get); + assertEquals(1, listener2.get); + assertEquals(0, listener3.get); + cache2.put(new MyKey("b"), new MyNonSerializableValue("c")); + assertEquals(1, cache1.getCacheSize()); + assertEquals(1, cache2.getCacheSize()); + assertNull(cache1.get(new MyKey("b"))); + assertEquals(0, cache3.getCacheSize()); + assertEquals(2, listener1.put); + assertEquals(2, listener2.put); + assertEquals(0, listener3.put); + assertEquals(1, listener1.get); + assertEquals(1, listener2.get); + assertEquals(0, listener3.get); + cache3.put(new MyKey("c"), new MyNonSerializableValue("d")); + assertEquals(1, cache1.getCacheSize()); + assertEquals(1, cache2.getCacheSize()); + assertEquals(1, cache3.getCacheSize()); + assertEquals(new MyNonSerializableValue("d"), cache3.get(new MyKe= y("c"))); + assertEquals(2, listener1.put); + assertEquals(2, listener2.put); + assertEquals(1, listener3.put); + assertEquals(1, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + cache2.put(new MyKey("a"), new MyNonSerializableValue("a")); + assertEquals(0, cache1.getCacheSize()); + assertEquals(2, cache2.getCacheSize()); + assertNull(cache1.get(new MyKey("a"))); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + cache2.remove(new MyKey("a")); + assertEquals(0, cache1.getCacheSize()); + assertEquals(1, cache2.getCacheSize()); + assertEquals(3, listener1.put); + assertEquals(3, listener2.put); + assertEquals(1, listener3.put); + assertEquals(2, listener1.get); + assertEquals(1, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + cache1.put(new MyKey("c"), new MyNonSerializableValue("c")); + cache1.clearCache(); + assertEquals(0, cache1.getCacheSize()); + assertNull(cache1.get(new MyKey("b"))); + assertEquals(new MyNonSerializableValue("c"), cache2.get(new MyKe= y("b"))); + assertNull(cache2.get(new MyKey("c"))); + assertEquals(1, cache2.getCacheSize()); + assertEquals(4, listener1.put); + assertEquals(4, listener2.put); + assertEquals(1, listener3.put); + assertEquals(3, listener1.get); + assertEquals(3, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + Map values =3D new HashMap<= Serializable, MyNonSerializableValue>(); + values.put(new MyKey("a"), new MyNonSerializableValue("a")); + values.put(new MyKey("b"), new MyNonSerializableValue("b")); + cache1.putMap(values); + assertEquals(2, cache1.getCacheSize()); + Thread.sleep(40); + assertNull(cache2.get(new MyKey("a"))); + assertNull(cache2.get(new MyKey("b"))); + assertEquals(0, cache2.getCacheSize()); + assertEquals(6, listener1.put); + assertEquals(6, listener2.put); + assertEquals(1, listener3.put); + assertEquals(3, listener1.get); + assertEquals(5, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + values =3D new HashMap() + { + private static final long serialVersionUID =3D 1L; + + public Set> entryS= et() + { + Set> set =3D ne= w LinkedHashSet>(super.entrySet= ()); + set.add(new Entry() + { + + public MyNonSerializableValue setValue(MyNonSerializable= Value paramV) + { + return null; + } + + public MyNonSerializableValue getValue() + { + throw new RuntimeException("An exception"); + } + + public Serializable getKey() + { + return "c"; + } + }); + return set; + } + }; + values.put(new MyKey("e"), new MyNonSerializableValue("e")); + values.put(new MyKey("d"), new MyNonSerializableValue("d")); + try + { + cache1.putMap(values); + } + catch (Exception e) + { + // ignore me + } + assertEquals(2, cache1.getCacheSize()); + assertEquals(0, cache2.getCacheSize()); + assertEquals(1, cache3.getCacheSize()); + assertEquals(6, listener1.put); + assertEquals(6, listener2.put); + assertEquals(1, listener3.put); + assertEquals(3, listener1.get); + assertEquals(5, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + assertEquals(0, listener1.expire); + assertEquals(0, listener2.expire); + assertEquals(0, listener3.expire); + Thread.sleep(1600); + assertEquals(0, cache1.getCacheSize()); + assertEquals(0, cache2.getCacheSize()); + assertEquals(0, cache3.getCacheSize()); + assertEquals(6, listener1.put); + assertEquals(6, listener2.put); + assertEquals(1, listener3.put); + assertEquals(3, listener1.get); + assertEquals(5, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + assertEquals(2, listener1.expire); + assertEquals(3, listener2.expire); + assertEquals(1, listener3.expire); + cache1.put(new MyKey("a"), new MyNonSerializableValue("b")); + assertNotNull(cache1.get(new MyKey("a"))); + assertNull(cache2.get(new MyKey("a"))); + cache2.put(new MyKey("a"), new MyNonSerializableValue("c")); + assertNotNull(cache2.get(new MyKey("a"))); + assertNull(cache1.get(new MyKey("a"))); + cache1.put(new MyKey("a"), new MyNonSerializableValue("c")); + assertEquals(new MyNonSerializableValue("c"), cache2.get(new MyKe= y("a"))); + assertEquals(new MyNonSerializableValue("c"), cache1.get(new MyKe= y("a"))); + assertEquals(9, listener1.put); + assertEquals(9, listener2.put); + assertEquals(1, listener3.put); + assertEquals(6, listener1.get); + assertEquals(8, listener2.get); + assertEquals(1, listener3.get); + assertEquals(1, listener1.remove); + assertEquals(1, listener2.remove); + assertEquals(0, listener3.remove); + assertEquals(1, listener1.clearCache); + assertEquals(0, listener2.clearCache); + assertEquals(0, listener3.clearCache); + assertEquals(2, listener1.expire); + assertEquals(3, listener2.expire); + assertEquals(1, listener3.expire); + = + } + finally + { + acache1.cache.stop(); + acache2.cache.stop(); + acache3.cache.stop(); + } + } + public void testMultiThreading() throws Exception { long time =3D System.currentTimeMillis(); @@ -645,7 +887,7 @@ System.out.println("Total Time =3D " + (System.currentTimeMillis() -= time)); } = - public static class MyCacheListener implements CacheListener + public static class MyCacheListener implements CacheListener { = public int clearCache; @@ -658,64 +900,67 @@ = public int remove; = - public void onClearCache(ExoCache cache) throw= s Exception + public void onClearCache(CacheListenerContext context) throws Except= ion { clearCache++; } = - public void onExpire(ExoCache cache, Serializa= ble key, Object obj) throws Exception + public void onExpire(CacheListenerContext context, Serializable key,= T obj) throws Exception { expire++; } = - public void onGet(ExoCache cache, Serializable= key, Object obj) throws Exception + public void onGet(CacheListenerContext context, Serializable key, T = obj) throws Exception { get++; } = - public void onPut(ExoCache cache, Serializable= key, Object obj) throws Exception + public void onPut(CacheListenerContext context, Serializable key, T = obj) throws Exception { put++; } = - public void onRemove(ExoCache cache, Serializa= ble key, Object obj) throws Exception + public void onRemove(CacheListenerContext context, Serializable key,= T obj) throws Exception { remove++; } + } = - public void onClearCache(CacheListenerContext context) throws Except= ion - { - clearCache++; - } + public static class MyKey implements Serializable + { + private static final long serialVersionUID =3D 1L; = - public void onExpire(CacheListenerContext context, Serializable key,= Object obj) throws Exception + public String value; + + public MyKey(String value) { - expire++; + this.value =3D value; } = - public void onGet(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception + @Override + public boolean equals(Object paramObject) { - get++; + return paramObject instanceof MyKey && ((MyKey)paramObject).value= .endsWith(value); } = - public void onPut(CacheListenerContext context, Serializable key, Ob= ject obj) throws Exception + @Override + public int hashCode() { - put++; + return value.hashCode(); } = - public void onRemove(CacheListenerContext context, Serializable key,= Object obj) throws Exception + @Override + public String toString() { - remove++; + return value; } } - - public static class MyKey implements Serializable + = + public static class MyNonSerializableValue { - private static final long serialVersionUID =3D 1L; - public String value; = - public MyKey(String value) + public MyNonSerializableValue(String value) { this.value =3D value; } @@ -723,7 +968,7 @@ @Override public boolean equals(Object paramObject) { - return paramObject instanceof MyKey && ((MyKey)paramObject).value= .endsWith(value); + return paramObject instanceof MyNonSerializableValue && ((MyNonSe= rializableValue)paramObject).value.endsWith(value); } = @Override --===============2655590484208058450==-- From do-not-reply at jboss.org Mon Jul 4 13:12:40 2011 Content-Type: multipart/mixed; boundary="===============0631861768934586273==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4588 - kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache and 3 other directories. Date: Mon, 04 Jul 2011 13:12:39 -0400 Message-ID: <201107041712.p64HCdfk020270@svn01.web.mwc.hst.phx2.redhat.com> --===============0631861768934586273== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2011-07-04 13:12:39 -0400 (Mon, 04 Jul 2011) New Revision: 4588 Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/future/ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/future/FutureCache.java kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/future/FutureExoCache.java kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/future/Loader.java kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/se= rvices/cache/future/ kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/se= rvices/cache/future/ConcurrentGetWhenPutTestCase.java kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/se= rvices/cache/future/FutureMap.java kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/se= rvices/cache/future/GetTestCase.java kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/se= rvices/cache/future/StringLoader.java Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/cache.xml Log: EXOJCR-1419: Move FutureExoCache from GateIn commons to eXo kernel Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/cache.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/cache.xml 2011-07-04 12:56:27 UTC (rev 4587) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/cache.xml 2011-07-04 17:12:39 UTC (rev 4588) @@ -133,7 +133,7 @@ replicated = Indicates if the cache is replicated. This field is - optional. + optional. = @@ -231,6 +231,36 @@ the infinite loop described above will still be effective. + +
+ FutureExoCache + + If the data that you want to store into your eXo Cache instance + and/or you would like to prevent multiple concurrent loading of the = same + data at the same time, you can use + org.exoplatform.services.cache.future.FutureExoCache + on top of your eXo Cache instance in order to delegate the loading of + your data to a loader that will be called only once whatever the tot= al + amount of concurrent thread looking for it. See below an example of = how + the FutureExoCache can be used: + + import org.exoplatform.services.ca= che.future.Loader; +import org.exoplatform.services.cache.future.FutureExoCache; +... + // Define first your loader and choose properly your context object in = order + // to be able to reuse the same loader for different FutureExoCache ins= tances + Loader<String, String, String> loader =3D new Loader<String, S= tring, String>() + { = + public String retrieve(String context, String key) throws Exception + { + return "Value loaded thanks to the key =3D '" + key + "' and the = context =3D '" + context + "'"; + } + }; + // Create your FutureExoCache from your eXo cache instance and your loa= der + FutureExoCache<String, String, String> myFutureExoCache =3D new F= utureExoCache<String, String, String>(loader, myExoCache); + // Get your data from your future cache instance + System.out.println(myFutureExoCache.get("my context", "foo")); +
=
Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatfor= m/services/cache/future/FutureCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/future/FutureCache.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/future/FutureCache.java 2011-07-04 17:12:39 UTC (rev 4588) @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2011 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.future; + +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; + +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; + +/** + * A future cache that prevents the loading of the same resource twice. Th= is should be used when the resource + * to load is very expensive or cannot be concurrently retrieved (like a c= lassloading). = + * + * @author Julien Viet + * @version $Revision$ + * @param the key type parameter + * @param the value type parameter + * @param the context type parameter + */ +public abstract class FutureCache +{ + + /** . */ + private final Loader loader; + + /** . */ + private final ConcurrentMap> futureEntries; + + /** . */ + private static final Log log =3D ExoLogger.getLogger("exo.kernel.compon= ent.cache.FutureCache"); + + + public FutureCache(Loader loader) + { + this.loader =3D loader; + this.futureEntries =3D new ConcurrentHashMap>(); + } + + protected abstract V get(K key); + + protected abstract void put(K key, V value); + + /** + * Perform a cache lookup for the specified key within the specified co= ntext. + * When the value cannot be loaded (because it does not exist or it fai= led or anything else that + * does not come to my mind), the value null is returned. + * + * @param context the context in which the resource is accessed + * @param key the key identifying the resource + * @return the value + */ + public final V get(final C context, final K key) + { + // First we try a simple cache get + V value =3D get(key); + + // If it does not succeed then we go through a process that will avo= id to load + // the same resource concurrently + if (value =3D=3D null) + { + // Create our future + FutureTask future =3D new FutureTask(new Callable() + { + public V call() throws Exception + { + // Retrieve the value from the loader + V value =3D loader.retrieve(context, key); + + // + if (value !=3D null) + { + // Cache it, it is made available to other threads (unle= ss someone removes it) + put(key, value); + + // Return value + return value; + } + else + { + return null; + } + } + }); + + // This boolean means we inserted in the local + boolean inserted =3D true; + + // + try + { + FutureTask phantom =3D futureEntries.putIfAbsent(key, futur= e); + + // Use the value that could have been inserted by another thre= ad + if (phantom !=3D null) + { + future =3D phantom; + inserted =3D false; + } + else + { + future.run(); + } + + // Returns the value + value =3D future.get(); + } + catch (ExecutionException e) + { + log.error("Computing of resource " + key + " threw an exceptio= n", e.getCause()); + } + catch (Exception e) + { + log.error("Retrieval of resource " + key + " threw an exceptio= n", e); + } + finally + { + // Clean up the per key map but only if our insertion succeede= d and with our future + if (inserted) + { + futureEntries.remove(key, future); + } + } + } + + // + return value; + } +} Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatfor= m/services/cache/future/FutureExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/future/FutureExoCache.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/future/FutureExoCache.java 2011-07-04 17:12:39 UTC (rev 4588) @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 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.future; + +import org.exoplatform.services.cache.ExoCache; + +import java.io.Serializable; + +/** + * @author Julien Viet + * @version $Revision$ + */ +public class FutureExoCache extends FutureCa= che +{ + + /** . */ + private final ExoCache cache; + + public FutureExoCache(Loader loader, ExoCache cache) + { + super(loader); + + // + this.cache =3D cache; + } + + @Override + protected V get(K key) + { + return cache.get(key); + } + + @Override + protected void put(K key, V entry) + { + cache.put(key, entry); + } +} + Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatfor= m/services/cache/future/Loader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/future/Loader.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/future/Loader.java 2011-07-04 17:12:39 UTC (rev 4588) @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 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.future; + +/** + * The loader interface is used by the future cache to retrieves the value= from the key when it does not exist. + * + * @author Julien Viet + * @version $Revision$ + * @param the key type parameter + * @param the value type parameter + * @param the context type parameter + */ +public interface Loader +{ + + /** + * Retrieves the value from the key within the specified context. If th= e resource is not found then the value + * null must be returned. + * + * @param context the context + * @param key the key + * @return the value + * @throws Exception any exception that would prevent the value to be l= oaded + */ + V retrieve(C context, K key) throws Exception; + +} Added: kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatfor= m/services/cache/future/ConcurrentGetWhenPutTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/s= ervices/cache/future/ConcurrentGetWhenPutTestCase.java = (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/s= ervices/cache/future/ConcurrentGetWhenPutTestCase.java 2011-07-04 17:12:39 = UTC (rev 4588) @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2011 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.future; + +import junit.framework.AssertionFailedError; +import junit.framework.TestCase; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.Callable; + +/** + * @author Julien Viet + * @version $Revision$ + */ +public class ConcurrentGetWhenPutTestCase extends TestCase +{ + + /** . */ + private AssertionFailedError failure; + + /** . */ + private List events =3D Collections.synchronizedList(new Linked= List()); + + FutureCache> futureCache =3D new Futur= eCache>(new StringLoader()) { + + + @Override + protected String get(String key) + { + if (key =3D=3D key1) + { + if (Thread.currentThread() !=3D thread1) + { + failure =3D new AssertionFailedError(); + } + events.add("get/key1"); + } + else if (key =3D=3D key2) + { + if (Thread.currentThread() !=3D thread2) + { + failure =3D new AssertionFailedError(); + } + events.add("get/key2"); + } + else + { + failure =3D new AssertionFailedError(); + } + return null; + } + + @Override + protected void put(String key, String value) + { + if (key =3D=3D key1) + { + if (Thread.currentThread() =3D=3D thread1) + { + events.add("begin_put/key1/" + value); + + // + thread2.start(); + + // + while (thread2.getState() !=3D Thread.State.WAITING) + { + // Wait until thread 2 is blocked + } + + // + events.add("end_put/key1"); + } + else + { + failure =3D new AssertionFailedError(); + } + } + else + { + failure =3D new AssertionFailedError(); + } + } + }; + + /** . */ + private final String key1 =3D new String("foo"); + + /** . */ + private final String key2 =3D new String("foo"); + + Thread thread1 =3D new Thread() + { + @Override + public void run() + { + String v =3D futureCache.get(new Callable() + { + public String call() throws Exception + { + events.add("call/key1"); + return "foo_value_1"; + } + }, key1); + events.add("retrieved/key1/" + v); + } + }; + + Thread thread2 =3D new Thread() + { + @Override + public void run() + { + String v =3D futureCache.get(new Callable() + { + public String call() throws Exception + { + failure =3D new AssertionFailedError(); + return "foo_value_2"; + } + }, key2); + events.add("retrieved/key2/" + v); + } + }; + + public void testMain() throws Exception + { + thread1.start(); + + // + thread1.join(); + thread2.join(); + + // + if (failure !=3D null) + { + throw failure; + } + + // + List expectedEvents =3D Arrays.asList( + "get/key1", + "call/key1", + "begin_put/key1/foo_value_1", + "get/key2", + "end_put/key1" + ); + + // + assertEquals(expectedEvents, events.subList(0, expectedEvents.size()= )); + + // + Set expectedEndEvents =3D new HashSet(Arrays.asList(= "retrieved/key1/foo_value_1", "retrieved/key2/foo_value_1")); + assertEquals(expectedEndEvents, new HashSet(events.subList(e= xpectedEvents.size(), events.size()))); + } +} \ No newline at end of file Added: kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatfor= m/services/cache/future/FutureMap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/s= ervices/cache/future/FutureMap.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/s= ervices/cache/future/FutureMap.java 2011-07-04 17:12:39 UTC (rev 4588) @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2011 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.future; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Julien Viet + * @version $Revision$ + */ +public class FutureMap extends FutureCache +{ + + /** . */ + final Map data; + + public FutureMap(Loader loader) + { + super(loader); + + // + this.data =3D Collections.synchronizedMap(new HashMap()); + } + + @Override + protected String get(String key) + { + return data.get(key); + } + + @Override + protected void put(String key, String value) + { + data.put(key, value); + } +} Added: kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatfor= m/services/cache/future/GetTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/s= ervices/cache/future/GetTestCase.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/s= ervices/cache/future/GetTestCase.java 2011-07-04 17:12:39 UTC (rev 4588) @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 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.future; + +import junit.framework.Assert; +import junit.framework.TestCase; + +import java.util.concurrent.Callable; + +/** + * @author Julien Viet + * @version $Revision$ + */ +public class GetTestCase extends TestCase +{ + public void testGet() + { + FutureMap> futureCache =3D new FutureMap>(new StringLoader()); + Assert.assertEquals("foo_value", futureCache.get(new Callable() + { + public String call() throws Exception + { + return "foo_value"; + } + }, "foo")); + Assert.assertEquals("foo_value", futureCache.data.get("foo")); + } + + public void testNullValue() + { + FutureMap> futureCache =3D new FutureMap>(new StringLoader()); + Assert.assertEquals(null, futureCache.get(new Callable() + { + public String call() throws Exception + { + return null; + } + }, "foo")); + Assert.assertFalse(futureCache.data.containsKey("foo")); + } + + public void testThrowException() + { + FutureMap> futureCache =3D new FutureMap>(new StringLoader()); + Assert.assertEquals(null, futureCache.get(new Callable() + { + public String call() throws Exception + { + throw new Exception("DON'T FREAK OUT"); + } + }, "foo")); + Assert.assertFalse(futureCache.data.containsKey("foo")); + } +} Added: kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatfor= m/services/cache/future/StringLoader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/java/org/exoplatform/s= ervices/cache/future/StringLoader.java (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/test/java/org/exoplatform/s= ervices/cache/future/StringLoader.java 2011-07-04 17:12:39 UTC (rev 4588) @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2011 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.future; + +import java.util.concurrent.Callable; + +/** + * @author Julien Viet + * @version $Revision$ + */ +public class StringLoader implements Loader> +{ + public String retrieve(Callable context, String key) throws Exc= eption + { + return context.call(); + } +} --===============0631861768934586273==-- From do-not-reply at jboss.org Mon Jul 4 13:19:31 2011 Content-Type: multipart/mixed; boundary="===============8892680362888245628==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4589 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/kernel. Date: Mon, 04 Jul 2011 13:19:31 -0400 Message-ID: <201107041719.p64HJViM020649@svn01.web.mwc.hst.phx2.redhat.com> --===============8892680362888245628== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2011-07-04 13:19:31 -0400 (Mon, 04 Jul 2011) New Revision: 4589 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/cache.xml Log: EXOJCR-1419: Complete the doc Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/cache.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/cache.xml 2011-07-04 17:12:39 UTC (rev 4588) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/cache.xml 2011-07-04 17:19:31 UTC (rev 4589) @@ -236,12 +236,12 @@ FutureExoCache = If the data that you want to store into your eXo Cache instance - and/or you would like to prevent multiple concurrent loading of the = same - data at the same time, you can use + takes a lot of time to load and/or you would like to prevent multiple + concurrent loading of the same data at the same time, you can use org.exoplatform.services.cache.future.FutureExoCache on top of your eXo Cache instance in order to delegate the loading of your data to a loader that will be called only once whatever the tot= al - amount of concurrent thread looking for it. See below an example of = how + amount of concurrent threads looking for it. See below an example of= how the FutureExoCache can be used: = import org.exoplatform.services.ca= che.future.Loader; --===============8892680362888245628==-- From do-not-reply at jboss.org Tue Jul 5 02:23:08 2011 Content-Type: multipart/mixed; boundary="===============0339408794279793708==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4590 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core. Date: Tue, 05 Jul 2011 02:23:08 -0400 Message-ID: <201107050623.p656N8hV015668@svn01.web.mwc.hst.phx2.redhat.com> --===============0339408794279793708== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-05 02:23:08 -0400 (Tue, 05 Jul 2011) New Revision: 4590 Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/AuditPropertyImpl.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/ItemImpl.java Log: EXOJCR-1408: added AuditPropertyImpl which extends PropertyImpl to avoid re= dundant operations not used during trail audit Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/core/AuditPropertyImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/AuditPropertyImpl.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/AuditPropertyImpl.java 2011-07-05 06:23:08 UTC (rev 4590) @@ -0,0 +1,56 @@ +package org.exoplatform.services.jcr.impl.core; + +import org.exoplatform.services.jcr.core.nodetype.ItemDefinitionData; +import org.exoplatform.services.jcr.datamodel.ItemData; + +import javax.jcr.RepositoryException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.nodetype.PropertyDefinition; + +/** + * Created to avoid huge operations on PropertyImpl instance initializatio= n, = + * as they are not needed for trail audit. + * = + * @author Dmitry Kuleshov + * @version $Id: $ + */ +public class AuditPropertyImpl extends PropertyImpl +{ + + AuditPropertyImpl(ItemData data, SessionImpl session) throws Repository= Exception, ConstraintViolationException + { + super(data, session); + } + + /** + * The most expensive method. In parent class it fulfills useless opera= tions + * in context of trail audit. + * + * {@inheritDoc} + */ + @Override + void loadData(ItemData data) throws RepositoryException + { + this.qpath =3D data.getQPath(); + return; + } + + /** + * {@inheritDoc} + */ + @Override + public ItemDefinitionData getItemDefinitionData() + { + throw new UnsupportedOperationException("getItemDefinitionData metho= d is not supported by this class"); + } + + /** + * {@inheritDoc} + */ + @Override + public PropertyDefinition getDefinition() + { + throw new UnsupportedOperationException("getItemDefinitionData metho= d is not supported by this class"); + } + +} Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/ItemImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/ItemImpl.java 2011-07-04 17:19:31 UTC (rev 4589) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/ItemImpl.java 2011-07-05 06:23:08 UTC (rev 4590) @@ -478,7 +478,7 @@ { // update of the property prevProp =3D (PropertyImpl)prevItem; - prevProperty =3D new PropertyImpl(prevProp.getData(), prevProp.pa= rentData(), prevProp.getSession()); + prevProperty =3D new AuditPropertyImpl(prevProp.getData(), prevPr= op.getSession()); isMultiValue =3D prevProp.isMultiValued(); defs =3D ntm.getPropertyDefinitions(propertyName, parentData.getPrimary= TypeName(), parentData.getMixinTypeNames()); --===============0339408794279793708==-- From do-not-reply at jboss.org Tue Jul 5 03:42:37 2011 Content-Type: multipart/mixed; boundary="===============0295300399477350242==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4591 - in jcr/trunk: exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl and 4 other directories. Date: Tue, 05 Jul 2011 03:42:37 -0400 Message-ID: <201107050742.p657gbto029386@svn01.web.mwc.hst.phx2.redhat.com> --===============0295300399477350242== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 03:42:37 -0400 (Tue, 05 Jul 2011) New Revision: 4591 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/RepositoryServiceImpl.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/backup/impl/JobExistingRepositoryRestore.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/RestRepositoryService.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationService.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/backup/AbstractBackupTestCase.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/TestRepositoryCreationService.java Log: EXOJCR-1420: Remove repository in Standalone mode 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 2011-07-05 06:23:08 UTC (rev 4590) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryServiceImpl.java 2011-07-05 07:42:37 UTC (rev 4591) @@ -46,8 +46,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.StringTokenizer; import java.util.Map.Entry; +import java.util.StringTokenizer; = import javax.jcr.RepositoryException; = @@ -119,14 +119,6 @@ } = /** - * {@inheritDoc} - */ - public boolean canRemoveRepository(String name) throws RepositoryExcept= ion - { - return canRemoveRepository(name, false); - } - - /** * Create repository.
* Init worksapces for initial start or them load from persistence.
* Add namespaces and nodetypes from service plugins. @@ -232,14 +224,6 @@ return (ManageableRepository)repositoryContainer.getComponentInstanc= eOfType(ManageableRepository.class); } = - /** - * {@inheritDoc} - */ - public void removeRepository(String name) throws RepositoryException - { - removeRepository(name, false); - } - public void setCurrentRepositoryName(String repositoryName) throws Repo= sitoryConfigurationException { // Need privileges to manage repository. @@ -312,17 +296,6 @@ managerStartChanges.cleanup(); } = - /** - * Remove default repository. - * = - * @throws RepositoryException - * if any Exception occurred during removing - */ - public void removeDefaultRepository() throws RepositoryException - { - removeRepository(config.getDefaultRepositoryName(), true); - } - private void init(ExoContainer container) throws RepositoryConfiguratio= nException, RepositoryException { this.parentContainer =3D container; @@ -396,16 +369,9 @@ } = /** - * Remove repository with specific name. - * = - * @param name - * repository name - * @param allowRemoveDefaultRepository - * allow to remove default repository - * @throws RepositoryException - * if any Exception occurred + * {@inheritDoc} */ - private void removeRepository(String name, boolean allowRemoveDefaultRe= pository) throws RepositoryException + public void removeRepository(String name) throws RepositoryException { // Need privileges to manage repository. SecurityManager security =3D System.getSecurityManager(); @@ -414,7 +380,7 @@ security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); } = - if (!canRemoveRepository(name, allowRemoveDefaultRepository)) + if (!canRemoveRepository(name)) throw new RepositoryException("Repository " + name + " in use. If= you want to " + " remove repository close all open sessions"); = @@ -458,24 +424,10 @@ } = /** - * Indicates if repository with specific name can be removed. - * = - * @param name - * repository name - * @param allowRemoveDefaultRepository - * allow to remove default repository = - * @return - * true if repository can be removed or false in other case - * @throws RepositoryException - * if any Exception occurred + * {@inheritDoc} */ - private boolean canRemoveRepository(String name, boolean allowRemoveDef= aultRepository) throws RepositoryException + public boolean canRemoveRepository(String name) throws RepositoryExcept= ion { - if (!allowRemoveDefaultRepository && name.equals(config.getDefaultRe= positoryName())) - { - return false; - } - RepositoryImpl repo =3D (RepositoryImpl)getRepository(name); try { Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/backup/impl/JobExistingRepositoryRestore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/JobExistingRepositoryRestore.java 2011-07-05 06:23:08 U= TC (rev 4590) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/backup/impl/JobExistingRepositoryRestore.java 2011-07-05 07:42:37 U= TC (rev 4591) @@ -25,7 +25,6 @@ import org.exoplatform.services.jcr.ext.backup.BackupChainLog; import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChainLog; import org.exoplatform.services.jcr.ext.backup.RepositoryRestoreExeption; -import org.exoplatform.services.jcr.impl.RepositoryServiceImpl; import org.exoplatform.services.jcr.impl.backup.Backupable; import org.exoplatform.services.jcr.impl.core.SessionRegistry; = @@ -101,14 +100,7 @@ } = //remove repository - if (isDefault) - { - ((RepositoryServiceImpl)repositoryService).removeDefaultReposi= tory(); - } - else - { - repositoryService.removeRepository(repositoryEntry.getName()); - } + repositoryService.removeRepository(repositoryEntry.getName()); = // clean for (Backupable component : backupable) 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 2011-07-05 06:23:08 UTC (rev = 4590) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/RestRepositoryService.java 2011-07-05 07:42:37 UTC (rev = 4591) @@ -18,6 +18,19 @@ */ package org.exoplatform.services.jcr.ext.repository; = +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; @@ -34,23 +47,9 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; import javax.ws.rs.core.Response.Status; +import javax.ws.rs.core.UriInfo; = -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. * = @@ -390,14 +389,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(); } Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationService.java 2011-07-05 06:23= :08 UTC (rev 4590) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationService.java 2011-07-05 07:42= :37 UTC (rev 4591) @@ -96,4 +96,13 @@ */ void createRepository(String backupId, RepositoryEntry rEntry, String r= Token) throws RepositoryConfigurationException, RepositoryCreationException; + + /** + * Remove previously created repository. = + * = + * @param repositoryName - the repository name to delete + * @throws RepositoryCreationServiceException + * if some exception occurred during repository removing occur= red + */ + void removeRepository(String repositoryName) throws RepositoryCreationE= xception; } Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-05 0= 6:23:08 UTC (rev 4590) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-05 0= 7:42:37 UTC (rev 4591) @@ -27,11 +27,14 @@ import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.core.ManageableRepository; +import org.exoplatform.services.jcr.core.WorkspaceContainerFacade; import org.exoplatform.services.jcr.ext.backup.BackupConfigurationExceptio= n; import org.exoplatform.services.jcr.ext.backup.BackupManager; import org.exoplatform.services.jcr.ext.backup.BackupOperationException; import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChainLog; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.log.ExoLogger; @@ -377,24 +380,6 @@ { if (rpcService !=3D null) { - // check does repository already created - try - { - if (repositoryService.getRepository(repositoryName) !=3D null) - { - throw new RepositoryCreationException("Repository " + repos= itoryName + " already exists."); - } - } - catch (RepositoryConfigurationException e) - { - throw new RepositoryCreationException("Can not check does repo= sitory " + repositoryName + " exists: " - + e.getMessage(), e); - } - catch (RepositoryException e) - { - //ok - repository does not exists - } - // reserve RepositoryName at coordinator-node try { @@ -718,6 +703,49 @@ } } = + /** + * {@inheritDoc} + */ + public void removeRepository(String repositoryName) throws RepositoryCr= eationException + { + removeRepositoryLocally(repositoryName); + } + + /** + * Remove repository locally. + * = + * @param repositoryName + * the repository name + * @throws RepositoryCreationException + */ + protected void removeRepositoryLocally(String repositoryName) throws Re= positoryCreationException + { + try + { + // close all opened sessions + ManageableRepository repositorty =3D repositoryService.getReposit= ory(repositoryName); + for (String workspaceName : repositorty.getWorkspaceNames()) + { + WorkspaceContainerFacade wc =3D repositorty.getWorkspaceContai= ner(workspaceName); + SessionRegistry sessionRegistry =3D (SessionRegistry)wc.getCom= ponent(SessionRegistry.class); + + sessionRegistry.closeSessions(workspaceName); + } + + // remove repository from configuration + repositoryService.removeRepository(repositoryName); + repositoryService.getConfig().retain(); + } + catch (RepositoryException e) + { + throw new RepositoryCreationException("Can't remove repository", = e); + } + catch (RepositoryConfigurationException e) + { + throw new RepositoryCreationException("Can't remove repository", = e); + } + } + private DBCreator getDBCreator(DBCreationProperties creationProps) thro= ws ConfigurationException { if (creationProps =3D=3D null) Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/backup/AbstractBackupTestCase.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/AbstractBackupTestCase.java 2011-07-05 06:23:08 UTC (rev 459= 0) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/backup/AbstractBackupTestCase.java 2011-07-05 07:42:37 UTC (rev 459= 1) @@ -35,7 +35,6 @@ import org.exoplatform.services.jcr.ext.backup.impl.BackupManagerImpl; import org.exoplatform.services.jcr.ext.backup.impl.JobRepositoryRestore; import org.exoplatform.services.jcr.ext.backup.impl.JobWorkspaceRestore; -import org.exoplatform.services.jcr.impl.RepositoryServiceImpl; import org.exoplatform.services.jcr.impl.clean.rdbms.DBCleanService; import org.exoplatform.services.jcr.impl.core.RepositoryImpl; import org.exoplatform.services.jcr.impl.core.SessionImpl; @@ -557,9 +556,6 @@ throw new RepositoryRestoreExeption("Current repository configura= tion " + repositoryName + " did not found"); } = - boolean isDefault =3D - repositoryService.getDefaultRepository().getConfiguration()= .getName().equals(repositoryEntry.getName()); - //Create local copy of WorkspaceEntry for all workspaces ArrayList workspaceList =3D new ArrayList(); workspaceList.addAll(repositoryEntry.getWorkspaceEntries()); @@ -574,14 +570,7 @@ repositoryService.getRepository(repositoryName).getConfiguration(= ).getSystemWorkspaceName(); = //remove repository - if (isDefault) - { - ((RepositoryServiceImpl)repositoryService).removeDefaultRepositor= y(); - } - else - { - repositoryService.removeRepository(repositoryEntry.getName()); - } + repositoryService.removeRepository(repositoryEntry.getName()); = // clean data for (WorkspaceEntry wEntry : workspaceList) Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/TestRepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/TestRepositoryCreationService.java 2011-07-05 0= 6:23:08 UTC (rev 4590) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/TestRepositoryCreationService.java 2011-07-05 0= 7:42:37 UTC (rev 4591) @@ -32,6 +32,8 @@ import java.util.HashMap; import java.util.Map; = +import javax.jcr.RepositoryException; + /** * Created by The eXo Platform SAS. * = @@ -93,6 +95,19 @@ //check repositoryConfiguration RepositoryService repoService =3D (RepositoryService)this.container.= getComponentInstance(RepositoryService.class); assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); + + // remove repository + creatorService.removeRepository(tenantName); + + try + { + repoService.getRepository(tenantName); + fail("Exception should be thrown"); + } + catch (RepositoryException e) + { + // expected behavior, repository should be missing = + } } = public void testCreateRepositorySingleDB() throws Exception @@ -147,6 +162,19 @@ //check repositoryConfiguration RepositoryService repoService =3D (RepositoryService)this.container.= getComponentInstance(RepositoryService.class); assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); + + // remove repository = + creatorService.removeRepository(tenantName); + + try + { + repoService.getRepository(tenantName); + fail("Exception should be thrown"); + } + catch (RepositoryException e) + { + // expected behavior, repository should be missing = + } } = public void testCreateRepositorySingleDBWithSpecificCreationProps() thr= ows Exception @@ -210,6 +238,19 @@ //check repositoryConfiguration RepositoryService repoService =3D (RepositoryService)this.container.= getComponentInstance(RepositoryService.class); assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); + + // remove repository + creatorService.removeRepository(tenantName); + + try + { + repoService.getRepository(tenantName); + fail("Exception should be thrown"); + } + catch (RepositoryException e) + { + // expected behavior, repository should be missing = + } } = public void testReserveRepositoryNameException() throws Exception --===============0295300399477350242==-- From do-not-reply at jboss.org Tue Jul 5 04:49:26 2011 Content-Type: multipart/mixed; boundary="===============5985408779376219203==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4592 - in jcr/trunk/exo.jcr.component.ext/src: test/java/org/exoplatform/services/jcr/ext/repository/creation/cluster and 1 other directory. Date: Tue, 05 Jul 2011 04:49:26 -0400 Message-ID: <201107050849.p658nQVt009763@svn01.web.mwc.hst.phx2.redhat.com> --===============5985408779376219203== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 04:49:25 -0400 (Tue, 05 Jul 2011) New Revision: 4592 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterNo= de1.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterNo= de2.java Log: EXOJCR-1422: Remove repository in cluster mode Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-05 0= 7:42:37 UTC (rev 4591) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-05 0= 8:49:25 UTC (rev 4592) @@ -122,6 +122,8 @@ = private RemoteCommand startRepository; = + private RemoteCommand removeRepository; + /** * Constructor RepositoryCreationServiceImpl. */ @@ -218,6 +220,22 @@ return null; } }); + + removeRepository =3D rpcService.registerCommand(new RemoteCommand= () + { + public String getId() + { + return "org.exoplatform.services.jcr.ext.repository.creatio= n.RepositoryCreationServiceImpl-removeRepository"; + } + + public Serializable execute(Serializable[] args) throws Throwa= ble + { + String repositoryName =3D (String)args[0]; + removeRepositoryLocally(repositoryName); + + return null; + } + }); } else { @@ -308,7 +326,15 @@ = if (result !=3D null) { - throw new RepositoryCreationException("CreateRepository com= mand must not return any results."); + if (result instanceof Throwable) + { + throw new RepositoryCreationException("Can't create repo= sitory " + rEntry.getName(), + (Throwable)result); + } + else + { + throw new RepositoryCreationException("createRepository = command returned uknown result type."); + } } } catch (RPCException e) @@ -336,22 +362,18 @@ = for (Object result : results) { - if (result instanceof RPCException) + if (result !=3D null) { - Throwable cause =3D ((RPCException)result).getCause(); - if (cause instanceof RepositoryCreationException) + if (result instanceof Throwable) { throw new RepositoryCreationException("Repository " += rEntry.getName() - + " created on coordinator, but can not be started= at other cluster nodes: " - + cause.getMessage(), cause); + + " created on coordinator, but can not be started= at other cluster nodes", ((Throwable)result)); } + else + { + throw new RepositoryCreationException("startRepositor= y command returns uknown result type"); + } } - if (result instanceof Throwable) - { - throw new RepositoryCreationException("Repository " + rE= ntry.getName() - + " created on coordinator, but can not be started at= other cluster nodes: " - + ((Throwable)result).getMessage(), ((Throwable)resul= t)); - } } } catch (RPCException e) @@ -389,6 +411,10 @@ { return (String)result; } + else if (result instanceof Throwable) + { + throw new RepositoryCreationException("Can't reserve reposi= tory " + repositoryName, (Throwable)result); + } else { throw new RepositoryCreationException("ReserveRepositoryNam= e command returns unknown type result."); @@ -700,6 +726,7 @@ this.rpcService.unregisterCommand(reserveRepositoryName); this.rpcService.unregisterCommand(createRepository); this.rpcService.unregisterCommand(startRepository); + this.rpcService.unregisterCommand(removeRepository); } } = @@ -708,7 +735,37 @@ */ public void removeRepository(String repositoryName) throws RepositoryCr= eationException { - removeRepositoryLocally(repositoryName); + if (rpcService !=3D null) + { + try + { + List results =3D rpcService.executeCommandOnAllNodes(r= emoveRepository, true, repositoryName); + + for (Object result : results) + { + if (result !=3D null) + { + if (result instanceof Throwable) + { + throw new RepositoryCreationException("Can't remove r= epository " + repositoryName, + (Throwable)result); + } + else + { + throw new RepositoryCreationException("removeReposito= ry command returned uknown result type"); + } + } + } + } + catch (RPCException e) + { + throw new RepositoryCreationException("Can't remove repository= " + repositoryName, e); + } + } + else + { + removeRepositoryLocally(repositoryName); + } } = /** Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInCl= usterNode1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java 2011-07-05 07:42:37 UTC (rev 4591) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java 2011-07-05 08:49:25 UTC (rev 4592) @@ -32,6 +32,8 @@ import java.util.HashMap; import java.util.Map; = +import javax.jcr.RepositoryException; + /** * Created by The eXo Platform SAS. * = @@ -53,8 +55,8 @@ connProps.put("password", "24635457"); = DBCreationProperties creationProps =3D - new DBCreationProperties("jdbc:mysql://localhost/", connProps, - "src/test/resources/test-mysql.sql", "user1", "pass1"); + new DBCreationProperties("jdbc:mysql://localhost/", connProps, "s= rc/test/resources/test-mysql.sql", "user3", + "pass3"); = // prepare String dsName =3D helper.createDatasource(); @@ -81,7 +83,7 @@ (RepositoryCreationService)container.getComponentInstanceOfType(R= epositoryCreationService.class); assertNotNull(creatorService); = - String tenantName =3D "tenant_2"; + String tenantName =3D "tenant_4"; String repoToken =3D creatorService.reserveRepositoryName(tenantName= ); = // restore = @@ -106,7 +108,22 @@ assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); = log.info("Node1: Repository has been created"); - Thread.sleep(100000); + Thread.sleep(60000); + = + // remove repository + creatorService.removeRepository(tenantName); + + try + { + repoService.getRepository(tenantName); + fail("Exception should be thrown"); + } + catch (RepositoryException e) + { + // expected behavior, repository should be missing = + } + = + log.info("Node1: Repository removed"); } = @Override Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInCl= usterNode2.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode2.java 2011-07-05 07:42:37 UTC (rev 4591) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode2.java 2011-07-05 08:49:25 UTC (rev 4592) @@ -16,11 +16,14 @@ */ package org.exoplatform.services.jcr.ext.repository.creation.cluster; = +import org.exoplatform.services.jcr.RepositoryService; import org.exoplatform.services.jcr.core.ManageableRepository; import org.exoplatform.services.jcr.ext.backup.AbstractBackupTestCase; import org.exoplatform.services.jcr.ext.backup.ExtendedBackupManager; import org.exoplatform.services.jcr.impl.core.SessionImpl; = +import javax.jcr.RepositoryException; + /** * Created by The eXo Platform SAS. * = @@ -36,7 +39,7 @@ log.info("Node2: Waits for the repository creation"); Thread.sleep(60000); = - String tenantName =3D "tenant_2"; + String tenantName =3D "tenant_4"; = // check ManageableRepository restoredRepository =3D repositoryService.getRep= ository(tenantName); @@ -48,7 +51,21 @@ session.getRootNode(); = log.info("Node2: test passed. I have root node"); - Thread.sleep(100000); + Thread.sleep(120000); + + RepositoryService repoService =3D (RepositoryService)this.container.= getComponentInstance(RepositoryService.class); + + try + { + repoService.getRepository(tenantName); + fail("Exception should be thrown"); + } + catch (RepositoryException e) + { + // expected behavior, repository should be missing = + } + + log.info("Node2: Repository removed"); } = @Override --===============5985408779376219203==-- From do-not-reply at jboss.org Tue Jul 5 05:11:23 2011 Content-Type: multipart/mixed; boundary="===============2657833817330639007==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4593 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming. Date: Tue, 05 Jul 2011 05:11:22 -0400 Message-ID: <201107050911.p659BMQC018429@svn01.web.mwc.hst.phx2.redhat.com> --===============2657833817330639007== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 05:11:22 -0400 (Tue, 05 Jul 2011) New Revision: 4593 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextBinder.java Log: EXOJCR-1423: Remove reference from InitialContextBinder 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 2011-07-05 08:49:25 UTC (rev 4592) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextBinder.java 2011-07-05 09:11:22 UTC (rev 4593) @@ -177,6 +177,25 @@ } = /** + * Unbind the Reference with defined name, remove from the bindings lis= t and persists the rest of references + * into the file. + * = + * @param bindName + * the Reference's bind name + * @throws NamingException + * @throws FileNotFoundException + * @throws XMLStreamException + */ + public void unbind(String bindName) throws NamingException, FileNotFoun= dException, + XMLStreamException + { + initialContextInitializer.getInitialContext().unbind(bindName); + bindings.remove(bindName); + + saveBindings(); + } + + /** * Returns reference associated with defined name. * = * @param bindName the name on which the reference was binded. --===============2657833817330639007==-- From do-not-reply at jboss.org Tue Jul 5 05:11:59 2011 Content-Type: multipart/mixed; boundary="===============3090267630589491533==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4594 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation. Date: Tue, 05 Jul 2011 05:11:59 -0400 Message-ID: <201107050911.p659Bxav018450@svn01.web.mwc.hst.phx2.redhat.com> --===============3090267630589491533== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 05:11:58 -0400 (Tue, 05 Jul 2011) New Revision: 4594 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java Log: EXOJCR-1423: Remove reference from InitialContextBinder Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-05 0= 9:11:22 UTC (rev 4593) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-05 0= 9:11:58 UTC (rev 4594) @@ -779,8 +779,11 @@ { try { + // extract list of all datasources + ManageableRepository repositorty =3D repositoryService.getReposit= ory(repositoryName); + Set datasources =3D extractDataSourceNames(repositorty.ge= tConfiguration(), false); + // close all opened sessions - ManageableRepository repositorty =3D repositoryService.getReposit= ory(repositoryName); for (String workspaceName : repositorty.getWorkspaceNames()) { WorkspaceContainerFacade wc =3D repositorty.getWorkspaceContai= ner(workspaceName); @@ -792,6 +795,12 @@ // remove repository from configuration repositoryService.removeRepository(repositoryName); repositoryService.getConfig().retain(); + = + // unbind datasource + for (String ds : datasources) + { + initialContextInitializer.getInitialContextBinder().unbind(ds); + } } catch (RepositoryException e) { @@ -801,6 +810,18 @@ { throw new RepositoryCreationException("Can't remove repository", = e); } + catch (FileNotFoundException e) + { + throw new RepositoryCreationException("Can't remove repository", = e); + } + catch (NamingException e) + { + throw new RepositoryCreationException("Can't remove repository", = e); + } + catch (XMLStreamException e) + { + throw new RepositoryCreationException("Can't remove repository", = e); + } } = private DBCreator getDBCreator(DBCreationProperties creationProps) thro= ws ConfigurationException --===============3090267630589491533==-- From do-not-reply at jboss.org Tue Jul 5 05:18:02 2011 Content-Type: multipart/mixed; boundary="===============0615265910048348081==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4595 - kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/impl. Date: Tue, 05 Jul 2011 05:18:02 -0400 Message-ID: <201107050918.p659I2sF018819@svn01.web.mwc.hst.phx2.redhat.com> --===============0615265910048348081== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 05:18:02 -0400 (Tue, 05 Jul 2011) New Revision: 4595 Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/impl/InvalidationExoCache.java Log: EXOJCR-1418: remove violations Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplat= form/services/cache/impl/InvalidationExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/InvalidationExoCache.java 2011-07-05 09:11:58 UTC (rev 4= 594) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/InvalidationExoCache.java 2011-07-05 09:18:02 UTC (rev 4= 595) @@ -56,7 +56,8 @@ * @version $Id$ * */ -public class InvalidationExoCache implements Ex= oCache, CacheListener> +public class InvalidationExoCache implements Ex= oCache, + CacheListener> { /** * Logger. @@ -333,7 +334,7 @@ } = /** - * @see org.exoplatform.services.cache.CacheListener#onExpire(org.exopl= atform.services.cache.CacheListenerContext, java.io.Serializable, java.lang= .Object) + * {@inheritDoc} */ public void onExpire(CacheListenerContext context, K key, HashCode o= bj) throws Exception { @@ -357,7 +358,7 @@ } = /** - * @see org.exoplatform.services.cache.CacheListener#onRemove(org.exopl= atform.services.cache.CacheListenerContext, java.io.Serializable, java.lang= .Object) + * {@inheritDoc} */ public void onRemove(CacheListenerContext context, K key, HashCode o= bj) throws Exception { @@ -381,7 +382,7 @@ } = /** - * @see org.exoplatform.services.cache.CacheListener#onPut(org.exoplatf= orm.services.cache.CacheListenerContext, java.io.Serializable, java.lang.Ob= ject) + * {@inheritDoc} */ public void onPut(CacheListenerContext context, K key, HashCode obj)= throws Exception { @@ -424,7 +425,7 @@ } = /** - * @see org.exoplatform.services.cache.CacheListener#onGet(org.exoplatf= orm.services.cache.CacheListenerContext, java.io.Serializable, java.lang.Ob= ject) + * {@inheritDoc} */ public void onGet(CacheListenerContext context, K key, HashCode obj)= throws Exception { --===============0615265910048348081==-- From do-not-reply at jboss.org Tue Jul 5 05:24:54 2011 Content-Type: multipart/mixed; boundary="===============5847871692964878877==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4596 - in jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules: kernel and 1 other directory. Date: Tue, 05 Jul 2011 05:24:54 -0400 Message-ID: <201107050924.p659OsUO019327@svn01.web.mwc.hst.phx2.redhat.com> --===============5847871692964878877== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 05:24:54 -0400 (Tue, 05 Jul 2011) New Revision: 4596 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/repository-creation-service.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/initialcontext-binder-service.xml Log: EXOJCR-1396: docbook updated Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/repository-creation-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/repository-creation-service.xml 2011-07-05 09:18:02 UTC (rev 4= 595) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/repository-creation-service.xml 2011-07-05 09:24:54 UTC (rev 4= 596) @@ -215,6 +215,15 @@ */ void createRepository(String backupId, RepositoryEntry rEntry, String r= Token) throws RepositoryConfigurationException, RepositoryCreationException; + + /** + * Remove previously created repository. = + * = + * @param repositoryName - the repository name to delete + * @throws RepositoryCreationServiceException + * if some exception occurred during repository removing occur= red + */ + void removeRepository(String repositoryName) throws RepositoryCreationE= xception; } = 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 2011-07-05 09:18:02 UTC (= rev 4595) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/initialcontext-binder-service.xml 2011-07-05 09:24:54 UTC (= rev 4596) @@ -49,5 +49,9 @@ Returns reference associated with defined name: = public Reference getReference(String= bindName) + + Unbind the Reference with defined name: + + public void unbind(String bindName) = throws NamingException, FileNotFoundException, XMLStreamException --===============5847871692964878877==-- From do-not-reply at jboss.org Tue Jul 5 07:51:45 2011 Content-Type: multipart/mixed; boundary="===============4080988188989063580==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4597 - in jcr/trunk: exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr and 1 other directory. Date: Tue, 05 Jul 2011 07:51:45 -0400 Message-ID: <201107051151.p65Bpj2v014085@svn01.web.mwc.hst.phx2.redhat.com> --===============4080988188989063580== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 07:51:45 -0400 (Tue, 05 Jul 2011) New Revision: 4597 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationService.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/repository-creation-service.xml Log: EXOJCR-1396: added possibility to control sessions closing before repositor= y removing Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationService.java 2011-07-05 09:24= :54 UTC (rev 4596) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationService.java 2011-07-05 11:51= :45 UTC (rev 4597) @@ -101,8 +101,10 @@ * Remove previously created repository. = * = * @param repositoryName - the repository name to delete + * @param forceCloseSessions - indicates if need to close sessions befo= re repository removing, if + * sessions are opened is it not possbile to remove repository and exce= ption will be thrown * @throws RepositoryCreationServiceException * if some exception occurred during repository removing occur= red */ - void removeRepository(String repositoryName) throws RepositoryCreationE= xception; + void removeRepository(String repositoryName, boolean forceCloseSessions= ) throws RepositoryCreationException; } Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-05 0= 9:24:54 UTC (rev 4596) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-05 1= 1:51:45 UTC (rev 4597) @@ -231,8 +231,10 @@ public Serializable execute(Serializable[] args) throws Throwa= ble { String repositoryName =3D (String)args[0]; - removeRepositoryLocally(repositoryName); + boolean forceCloseSessions =3D (Boolean)args[1]; = + removeRepositoryLocally(repositoryName, forceCloseSessions); + return null; } }); @@ -733,13 +735,14 @@ /** * {@inheritDoc} */ - public void removeRepository(String repositoryName) throws RepositoryCr= eationException + public void removeRepository(String repositoryName, boolean forceCloseS= essions) throws RepositoryCreationException { if (rpcService !=3D null) { try { - List results =3D rpcService.executeCommandOnAllNodes(r= emoveRepository, true, repositoryName); + List results =3D + rpcService.executeCommandOnAllNodes(removeRepository, true,= repositoryName, forceCloseSessions); = for (Object result : results) { @@ -764,7 +767,7 @@ } else { - removeRepositoryLocally(repositoryName); + removeRepositoryLocally(repositoryName, forceCloseSessions); } } = @@ -773,9 +776,12 @@ * = * @param repositoryName * the repository name + * @param forceCloseSessions - indicates if need to close session befor= e repository removing, if + * sessions are opened is it not possbile to remove repository and exce= ption will be throw = * @throws RepositoryCreationException */ - protected void removeRepositoryLocally(String repositoryName) throws Re= positoryCreationException + protected void removeRepositoryLocally(String repositoryName, boolean f= orceCloseSessions) + throws RepositoryCreationException { try { @@ -783,13 +789,16 @@ ManageableRepository repositorty =3D repositoryService.getReposit= ory(repositoryName); Set datasources =3D extractDataSourceNames(repositorty.ge= tConfiguration(), false); = - // close all opened sessions - for (String workspaceName : repositorty.getWorkspaceNames()) + if (forceCloseSessions) { - WorkspaceContainerFacade wc =3D repositorty.getWorkspaceContai= ner(workspaceName); - SessionRegistry sessionRegistry =3D (SessionRegistry)wc.getCom= ponent(SessionRegistry.class); + // close all opened sessions + for (String workspaceName : repositorty.getWorkspaceNames()) + { + WorkspaceContainerFacade wc =3D repositorty.getWorkspaceCon= tainer(workspaceName); + SessionRegistry sessionRegistry =3D (SessionRegistry)wc.get= Component(SessionRegistry.class); = - sessionRegistry.closeSessions(workspaceName); + sessionRegistry.closeSessions(workspaceName); + } } = // remove repository from configuration Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/repository-creation-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/repository-creation-service.xml 2011-07-05 09:24:54 UTC (rev 4= 596) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/repository-creation-service.xml 2011-07-05 11:51:45 UTC (rev 4= 597) @@ -220,10 +220,12 @@ * Remove previously created repository. = * = * @param repositoryName - the repository name to delete + * @param forceCloseSessions - indicates if need to close session befor= e repository removing, if + * sessions are opened is it not possbile to remove repository and exce= ption will be thrown * @throws RepositoryCreationServiceException * if some exception occurred during repository removing occur= red */ - void removeRepository(String repositoryName) throws RepositoryCreationE= xception; + void removeRepository(String repositoryName, boolean forceCloseSessions= ) throws RepositoryCreationException; } = --===============4080988188989063580==-- From do-not-reply at jboss.org Tue Jul 5 08:42:17 2011 Content-Type: multipart/mixed; boundary="===============0242704681054010289==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4598 - in jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository/creation: cluster and 1 other directory. Date: Tue, 05 Jul 2011 08:42:16 -0400 Message-ID: <201107051242.p65CgGEx025310@svn01.web.mwc.hst.phx2.redhat.com> --===============0242704681054010289== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 08:42:16 -0400 (Tue, 05 Jul 2011) New Revision: 4598 Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/TestRepositoryCreationService.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterNo= de1.java Log: EXOJCR-1396: fix tests Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/TestRepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/TestRepositoryCreationService.java 2011-07-05 1= 1:51:45 UTC (rev 4597) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/TestRepositoryCreationService.java 2011-07-05 1= 2:42:16 UTC (rev 4598) @@ -97,7 +97,7 @@ assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); = // remove repository - creatorService.removeRepository(tenantName); + creatorService.removeRepository(tenantName, true); = try { @@ -164,7 +164,7 @@ assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); = // remove repository = - creatorService.removeRepository(tenantName); + creatorService.removeRepository(tenantName, true); = try { @@ -240,7 +240,7 @@ assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); = // remove repository - creatorService.removeRepository(tenantName); + creatorService.removeRepository(tenantName, true); = try { Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInCl= usterNode1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java 2011-07-05 11:51:45 UTC (rev 4597) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java 2011-07-05 12:42:16 UTC (rev 4598) @@ -111,7 +111,7 @@ Thread.sleep(60000); = // remove repository - creatorService.removeRepository(tenantName); + creatorService.removeRepository(tenantName, true); = try { --===============0242704681054010289==-- From do-not-reply at jboss.org Tue Jul 5 09:49:29 2011 Content-Type: multipart/mixed; boundary="===============5548497337955669480==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4599 - in jcr/trunk: exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr and 1 other directory. Date: Tue, 05 Jul 2011 09:49:29 -0400 Message-ID: <201107051349.p65DnTNp005353@svn01.web.mwc.hst.phx2.redhat.com> --===============5548497337955669480== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 09:49:29 -0400 (Tue, 05 Jul 2011) New Revision: 4599 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationService.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/repository-creation-service.xml Log: EXOJCR-1396: check is repository in use on all cluster nodes before removing Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationService.java 2011-07-05 12:42= :16 UTC (rev 4598) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationService.java 2011-07-05 13:49= :29 UTC (rev 4599) @@ -101,10 +101,9 @@ * Remove previously created repository. = * = * @param repositoryName - the repository name to delete - * @param forceCloseSessions - indicates if need to close sessions befo= re repository removing, if - * sessions are opened is it not possbile to remove repository and exce= ption will be thrown + * @param forceRemove - force close all opened sessions = * @throws RepositoryCreationServiceException * if some exception occurred during repository removing occur= red */ - void removeRepository(String repositoryName, boolean forceCloseSessions= ) throws RepositoryCreationException; + void removeRepository(String repositoryName, boolean forceRemove) throw= s RepositoryCreationException; } Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-05 1= 2:42:16 UTC (rev 4598) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-05 1= 3:49:29 UTC (rev 4599) @@ -124,6 +124,8 @@ = private RemoteCommand removeRepository; = + private RemoteCommand canRemoveRepository; + /** * Constructor RepositoryCreationServiceImpl. */ @@ -136,7 +138,7 @@ /** * Constructor RepositoryCreationServiceImpl. */ - public RepositoryCreationServiceImpl(RepositoryService repositoryServic= e, BackupManager backupManager, + public RepositoryCreationServiceImpl(final RepositoryService repository= Service, BackupManager backupManager, ExoContainerContext context, InitialContextInitializer initialContex= tInitializer, final RPCService rpcService) { this.repositoryService =3D repositoryService; @@ -231,13 +233,27 @@ public Serializable execute(Serializable[] args) throws Throwa= ble { String repositoryName =3D (String)args[0]; - boolean forceCloseSessions =3D (Boolean)args[1]; = - removeRepositoryLocally(repositoryName, forceCloseSessions); + removeRepositoryLocally(repositoryName); = return null; } }); + + canRemoveRepository =3D rpcService.registerCommand(new RemoteComm= and() + { + public String getId() + { + return "org.exoplatform.services.jcr.ext.repository.creatio= n.RepositoryCreationServiceImpl-checkRepositoryInUse"; + } + + public Serializable execute(Serializable[] args) throws Throwa= ble + { + String repositoryName =3D (String)args[0]; + = + return new Boolean(repositoryService.canRemoveRepository(re= positoryName)); + } + }); } else { @@ -729,21 +745,49 @@ this.rpcService.unregisterCommand(createRepository); this.rpcService.unregisterCommand(startRepository); this.rpcService.unregisterCommand(removeRepository); + this.rpcService.unregisterCommand(canRemoveRepository); } } = /** * {@inheritDoc} */ - public void removeRepository(String repositoryName, boolean forceCloseS= essions) throws RepositoryCreationException + public void removeRepository(String repositoryName, boolean forceRemove= ) throws RepositoryCreationException { if (rpcService !=3D null) { try { - List results =3D - rpcService.executeCommandOnAllNodes(removeRepository, true,= repositoryName, forceCloseSessions); + if (!forceRemove) + { + List results =3D rpcService.executeCommandOnAllNode= s(canRemoveRepository, true, repositoryName); + for (Object result : results) + { + if (result !=3D null) + { + if (result instanceof Throwable) + { + throw new RepositoryCreationException("It is not p= ossible to check is repository " + + repositoryName + " in usage or not", (Throwab= le)result); + } + else if (result instanceof Boolean) + { + if (!(Boolean)result) + { + throw new RepositoryCreationException("Can't re= move repository " + repositoryName + + ". The repository in use."); + } + } + else + { + throw new RepositoryCreationException( + "checkRepositoryInUse command returned uknown r= esult type"); + } + } + } + } = + List results =3D rpcService.executeCommandOnAllNodes(r= emoveRepository, true, repositoryName); for (Object result : results) { if (result !=3D null) @@ -767,7 +811,23 @@ } else { - removeRepositoryLocally(repositoryName, forceCloseSessions); + if (!forceRemove) + { + try + { + if (!repositoryService.canRemoveRepository(repositoryName)) + { + throw new RepositoryCreationException("Can't remove repo= sitory " + repositoryName + + ". The repository in use."); + } + } + catch (RepositoryException e) + { + throw new RepositoryCreationException("It is not possible t= o check is repository " + repositoryName + " in usage or not", e); + } + } + + removeRepositoryLocally(repositoryName); } } = @@ -776,11 +836,9 @@ * = * @param repositoryName * the repository name - * @param forceCloseSessions - indicates if need to close session befor= e repository removing, if - * sessions are opened is it not possbile to remove repository and exce= ption will be throw = * @throws RepositoryCreationException */ - protected void removeRepositoryLocally(String repositoryName, boolean f= orceCloseSessions) + protected void removeRepositoryLocally(String repositoryName) throws RepositoryCreationException { try @@ -789,16 +847,13 @@ ManageableRepository repositorty =3D repositoryService.getReposit= ory(repositoryName); Set datasources =3D extractDataSourceNames(repositorty.ge= tConfiguration(), false); = - if (forceCloseSessions) + // close all opened sessions + for (String workspaceName : repositorty.getWorkspaceNames()) { - // close all opened sessions - for (String workspaceName : repositorty.getWorkspaceNames()) - { - WorkspaceContainerFacade wc =3D repositorty.getWorkspaceCon= tainer(workspaceName); - SessionRegistry sessionRegistry =3D (SessionRegistry)wc.get= Component(SessionRegistry.class); + WorkspaceContainerFacade wc =3D repositorty.getWorkspaceContai= ner(workspaceName); + SessionRegistry sessionRegistry =3D (SessionRegistry)wc.getCom= ponent(SessionRegistry.class); = - sessionRegistry.closeSessions(workspaceName); - } + sessionRegistry.closeSessions(workspaceName); } = // remove repository from configuration Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/repository-creation-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/repository-creation-service.xml 2011-07-05 12:42:16 UTC (rev 4= 598) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/repository-creation-service.xml 2011-07-05 13:49:29 UTC (rev 4= 599) @@ -220,12 +220,12 @@ * Remove previously created repository. = * = * @param repositoryName - the repository name to delete - * @param forceCloseSessions - indicates if need to close session befor= e repository removing, if - * sessions are opened is it not possbile to remove repository and exce= ption will be thrown + * @param forceRemove - force close all opened sessions = * @throws RepositoryCreationServiceException * if some exception occurred during repository removing occur= red */ - void removeRepository(String repositoryName, boolean forceCloseSessions= ) throws RepositoryCreationException; + void removeRepository(String repositoryName, boolean forceRemove) throw= s RepositoryCreationException; + } = --===============5548497337955669480==-- From do-not-reply at jboss.org Tue Jul 5 09:52:31 2011 Content-Type: multipart/mixed; boundary="===============5295845543406127630==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4600 - in jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository/creation: cluster and 1 other directory. Date: Tue, 05 Jul 2011 09:52:30 -0400 Message-ID: <201107051352.p65DqUWH005823@svn01.web.mwc.hst.phx2.redhat.com> --===============5295845543406127630== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-05 09:52:30 -0400 (Tue, 05 Jul 2011) New Revision: 4600 Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/TestRepositoryCreationService.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterNo= de1.java Log: EXOJCR-1396: tests updated Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/TestRepositoryCreationService.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/TestRepositoryCreationService.java 2011-07-05 1= 3:49:29 UTC (rev 4599) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/TestRepositoryCreationService.java 2011-07-05 1= 3:52:30 UTC (rev 4600) @@ -97,6 +97,17 @@ assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); = // remove repository + try + { + creatorService.removeRepository(tenantName, false); + fail("Exception should be thrown"); + } + catch (RepositoryCreationException e) + { + // repository in use + } + + // remove repository creatorService.removeRepository(tenantName, true); = try @@ -163,6 +174,17 @@ RepositoryService repoService =3D (RepositoryService)this.container.= getComponentInstance(RepositoryService.class); assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); = + // remove repository + try + { + creatorService.removeRepository(tenantName, false); + fail("Exception should be thrown"); + } + catch (RepositoryCreationException e) + { + // repository in use + } + // remove repository = creatorService.removeRepository(tenantName, true); = @@ -240,6 +262,17 @@ assertNotNull(repoService.getConfig().getRepositoryConfiguration(ten= antName)); = // remove repository + try + { + creatorService.removeRepository(tenantName, false); + fail("Exception should be thrown"); + } + catch (RepositoryCreationException e) + { + // repository in use + } + + // remove repository creatorService.removeRepository(tenantName, true); = try Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInCl= usterNode1.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java 2011-07-05 13:49:29 UTC (rev 4599) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/creation/cluster/TestRepositoryCreationServiceInClusterN= ode1.java 2011-07-05 13:52:30 UTC (rev 4600) @@ -26,6 +26,7 @@ import org.exoplatform.services.jcr.ext.backup.RepositoryBackupChain; import org.exoplatform.services.jcr.ext.backup.RepositoryBackupConfig; import org.exoplatform.services.jcr.ext.repository.creation.DBCreationProp= erties; +import org.exoplatform.services.jcr.ext.repository.creation.RepositoryCrea= tionException; import org.exoplatform.services.jcr.ext.repository.creation.RepositoryCrea= tionService; = import java.io.File; @@ -111,6 +112,17 @@ Thread.sleep(60000); = // remove repository + try + { + creatorService.removeRepository(tenantName, false); + fail("Exception should be thrown"); + } + catch (RepositoryCreationException e) + { + // repository in use + } + + // remove repository creatorService.removeRepository(tenantName, true); = try --===============5295845543406127630==-- From do-not-reply at jboss.org Tue Jul 5 10:46:12 2011 Content-Type: multipart/mixed; boundary="===============8430981487676576074==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4601 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Tue, 05 Jul 2011 10:46:12 -0400 Message-ID: <201107051446.p65EkCbh017467@svn01.web.mwc.hst.phx2.redhat.com> --===============8430981487676576074== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2011-07-05 10:46:12 -0400 (Tue, 05 Jul 2011) New Revision: 4601 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/StreamPersistedValueData.java Log: EXOJCR-1191 : Set serialVersionUId in StreamPersistedValueData for JCR 1.14= .x as in JCR 1.12.x. = 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 2011-07-05 13:5= 2:30 UTC (rev 4600) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2011-07-05 14:4= 6:12 UTC (rev 4601) @@ -40,6 +40,8 @@ public class StreamPersistedValueData extends FilePersistedValueData { = + private static final long serialVersionUID =3D -5831609242005946202L; + protected InputStream stream; = protected SpoolFile tempFile; --===============8430981487676576074==-- From do-not-reply at jboss.org Tue Jul 5 11:14:00 2011 Content-Type: multipart/mixed; boundary="===============6594487251509361682==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4602 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: core/nodetype/registration and 4 other directories. Date: Tue, 05 Jul 2011 11:14:00 -0400 Message-ID: <201107051514.p65FE0gX026209@svn01.web.mwc.hst.phx2.redhat.com> --===============6594487251509361682== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2011-07-05 11:13:59 -0400 (Tue, 05 Jul 2011) New Revision: 4602 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/NodeImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/QueryImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/CachingIndexReader.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/ChildAxisQuery.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.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/QueryResultImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/RowIteratorImpl.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/dataflow/persistent/WorkspacePersistentDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/indexing/JdbcNodeDataIndexingIterator.java Log: EXOJCR-1426: Cleanup the code to get rid of useless System.currentTimeMilli= s() calls Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-05 14:46:12 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-05 15:13:59 UTC (rev 4602) @@ -1037,9 +1037,10 @@ public NodeIterator getNodes() throws RepositoryException { = - long start =3D System.currentTimeMillis(); + long start =3D 0; if (LOG.isDebugEnabled()) { + start =3D System.currentTimeMillis(); LOG.debug("getNodes() >>>>>"); } = @@ -1086,9 +1087,10 @@ public NodeIterator getNodes(String namePattern) throws RepositoryExcep= tion { = - long start =3D System.currentTimeMillis(); + long start =3D 0; if (LOG.isDebugEnabled()) { + start =3D System.currentTimeMillis(); LOG.debug("getNodes(String) >>>>>"); } = @@ -1197,9 +1199,10 @@ public PropertyIterator getProperties() throws RepositoryException { = - long start =3D System.currentTimeMillis(); + long start =3D 0; if (LOG.isDebugEnabled()) { + start =3D System.currentTimeMillis(); LOG.debug("getProperties() >>>>>"); } = @@ -1252,9 +1255,10 @@ */ public PropertyIterator getProperties(String namePattern) throws Reposi= toryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (LOG.isDebugEnabled()) { + start =3D System.currentTimeMillis(); LOG.debug("getProperties(String) >>>>>"); } = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-05 14:46:12 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-05 15:13:59 UTC (rev 4602) @@ -364,9 +364,10 @@ public ItemImpl getItem(NodeData parent, QPathEntry name, boolean pool,= ItemType itemType, boolean apiRead) throws RepositoryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getItem(" + parent.getQPath().getAsString() + " + " + = name.getAsString() + " ) >>>>>"); } = @@ -426,9 +427,10 @@ public ItemImpl getItem(NodeData parent, QPathEntry name, boolean pool,= boolean skipCheckInPersistence, ItemType itemType) throws RepositoryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getItem(" + parent.getQPath().getAsString() + " + " + = name.getAsString() + " ) >>>>>"); } = @@ -485,9 +487,10 @@ public ItemImpl getItem(NodeData parent, QPathEntry[] relPath, boolean = pool, ItemType itemType) throws RepositoryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); String debugPath =3D ""; for (QPathEntry rp : relPath) { @@ -529,9 +532,10 @@ */ public ItemImpl getItem(QPath path, boolean pool) throws RepositoryExce= ption { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getItem(" + path.getAsString() + " ) >>>>>"); } = @@ -649,9 +653,10 @@ */ public ItemImpl getItemByIdentifier(String identifier, boolean pool, bo= olean apiRead) throws RepositoryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getItemByIdentifier(" + identifier + " ) >>>>>"); } = @@ -850,9 +855,10 @@ public List getChildNodes(NodeData parent, boolean pool) thro= ws RepositoryException, AccessDeniedException { = - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getChildNodes(" + parent.getQPath().getAsString() + ")= >>>>>"); } = @@ -903,9 +909,10 @@ AccessDeniedException { = - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getChildProperties(" + parent.getQPath().getAsString()= + ") >>>>>"); } = @@ -941,9 +948,10 @@ */ public List getChildNodesData(NodeData parent) throws Reposit= oryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getChildNodesData(" + parent.getQPath().getAsString() = + ") >>>>>"); } = @@ -967,9 +975,10 @@ public List getChildNodesData(NodeData parent, List patternFilters) throws RepositoryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getChildNodesData(" + parent.getQPath().getAsString() = + " , itemDataFilter) >>>>>"); } = @@ -1113,9 +1122,10 @@ */ public AccessControlList getACL(QPath path) throws RepositoryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getACL(" + path.getAsString() + " ) >>>>>"); } = @@ -1178,9 +1188,10 @@ = public AccessControlList getACL(NodeData parent, QPathEntry name) throw= s RepositoryException { - long start =3D System.currentTimeMillis(); + long start =3D 0; if (log.isDebugEnabled()) { + start =3D System.currentTimeMillis(); log.debug("getACL(" + parent.getQPath().getAsString() + " + " + n= ame.getAsString() + " ) >>>>>"); } = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java 2011-07-= 05 14:46:12 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/nodetype/registration/JCRNodeTypeDataPersister.java 2011-07-= 05 15:13:59 UTC (rev 4602) @@ -151,8 +151,12 @@ PlainChangesLog changesLog =3D new PlainChangesLogImpl(); TransientNodeData jcrNodetypes; = - long start =3D System.currentTimeMillis(); - + long start =3D 0; + if (log.isDebugEnabled()) + { + start =3D System.currentTimeMillis(); + } + = if (addACL) { InternalQName[] mixins =3D new InternalQName[]{Constants.EXO_OWNE= ABLE, Constants.EXO_PRIVILEGEABLE}; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/QueryImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/QueryImpl.java 2011-07-05 14:46:12 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/QueryImpl.java 2011-07-05 15:13:59 UTC (rev 4602) @@ -182,7 +182,11 @@ public QueryResult execute() throws RepositoryException { checkInitialized(); - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } QueryResult result =3D query.execute(offset, limit); if (log.isDebugEnabled()) { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/CachingIndexReader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/CachingIndexReader.java 2011-07-05 14:46:12 UTC= (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/CachingIndexReader.java 2011-07-05 15:13:59 UTC= (rev 4602) @@ -448,7 +448,11 @@ */ private void initializeParents(IndexReader reader) throws IOException { - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } final Map docs =3D new HashMap(); // read UUIDs collectTermDocs(reader, new Term(FieldNames.UUID, ""), new TermDo= csCollector() Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/ChildAxisQuery.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ChildAxisQuery.java 2011-07-05 14:46:12 UTC (re= v 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/ChildAxisQuery.java 2011-07-05 15:13:59 UTC (re= v 4602) @@ -716,10 +716,17 @@ //NodeId id =3D new NodeId(UUID.fromString(uuid)); try { - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } NodeData state =3D (NodeData)itemMgr.getItemData(uuid); - time =3D System.currentTimeMillis() - time; - log.debug("got NodeState with id {} in {} ms.", uuid, new L= ong(time)); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + log.debug("got NodeState with id {} in {} ms.", uuid, ne= w Long(time)); = + } Iterator entries; if (nameTest !=3D null) { @@ -813,7 +820,11 @@ @Override public Hits getHits() throws IOException { - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } Hits childrenHits =3D new AdaptingHits(); Hits nameHits =3D new ScorerHits(nameTestScorer); int[] docs =3D new int[1]; @@ -839,9 +850,11 @@ } } } - time =3D System.currentTimeMillis() - time; - - log.debug("Filtered hits in {} ms.", new Long(time)); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + log.debug("Filtered hits in {} ms.", new Long(time)); = = + } return childrenHits; } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/DescendantSelfAxisQuery.java 2011-07-05 14:46:1= 2 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/DescendantSelfAxisQuery.java 2011-07-05 15:13:5= 9 UTC (rev 4602) @@ -587,7 +587,11 @@ { if (!contextHitsCalculated) { - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } contextScorer.score(new AbstractHitCollector() { @Override @@ -597,9 +601,9 @@ } }); // find all contextHitsCalculated =3D true; - time =3D System.currentTimeMillis() - time; if (log.isDebugEnabled()) { + time =3D System.currentTimeMillis() - time; log.debug("Collected {} context hits in {} ms for {}", new = Object[]{ new Integer(contextHits.cardinality()), new Long(time), = DescendantSelfAxisQuery.this}); } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/DocOrderScoreNodeIterator.java 2011-07-05 14:46= :12 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/DocOrderScoreNodeIterator.java 2011-07-05 15:13= :59 UTC (rev 4602) @@ -172,7 +172,11 @@ { return; } - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } ScoreNode[][] nodes =3D (ScoreNode[][])scoreNodes.toArray(new ScoreN= ode[scoreNodes.size()][]); = final Set invalidIDs =3D new HashSet(2); 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 2011-07-05 14:46:12 UTC (rev 46= 01) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/MultiIndex.java 2011-07-05 15:13:59 UTC (rev 46= 02) @@ -56,11 +56,11 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import java.util.Queue; import java.util.Set; import java.util.Timer; import java.util.TimerTask; -import java.util.Map.Entry; import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingQueue; @@ -1153,7 +1153,11 @@ if (handler.isInitializeHierarchyCache()) { // force initializing of caches - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExcept= ionAction() { public Object run() throws Exception @@ -1162,8 +1166,11 @@ return null; } }); - time =3D System.currentTimeMillis() - time; - log.debug("hierarchy cache initialized in {} ms", new Long(time)); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + log.debug("hierarchy cache initialized in {} ms", new Long(tim= e)); = + } } = synchronized (this) @@ -1754,7 +1761,11 @@ if (volatileIndex.getNumDocuments() > 0) { = - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } // create index CreateIndex create =3D new CreateIndex(getTransactionId(), null); executeAndLog(create); @@ -1769,8 +1780,11 @@ // create new volatile index resetVolatileIndex(); = - time =3D System.currentTimeMillis() - time; - log.debug("Committed in-memory index in " + time + "ms."); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + log.debug("Committed in-memory index in " + time + "ms."); = = + } } } = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/QueryResultImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/QueryResultImpl.java 2011-07-05 14:46:12 UTC (r= ev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/QueryResultImpl.java 2011-07-05 15:13:59 UTC (r= ev 4602) @@ -308,9 +308,16 @@ MultiColumnQueryHits result =3D null; try { - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } result =3D executeQuery(maxResultSize); - log.debug("query executed in {} ms", new Long(System.currentTimeM= illis() - time)); + if (log.isDebugEnabled()) + { + log.debug("query executed in {} ms", new Long(System.currentTi= meMillis() - time)); = + } // set selector names selectorNames =3D result.getSelectorNames(); = @@ -325,9 +332,15 @@ result.skip(start); } = - time =3D System.currentTimeMillis(); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); = + } collectScoreNodes(result, resultNodes, maxResultSize); - log.debug("retrieved ScoreNodes in {} ms", new Long(System.curren= tTimeMillis() - time)); + if (log.isDebugEnabled()) + { + log.debug("retrieved ScoreNodes in {} ms", new Long(System.cur= rentTimeMillis() - time)); = + } = // update numResults numResults =3D result.getSize(); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/RowIteratorImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/RowIteratorImpl.java 2011-07-05 14:46:12 UTC (r= ev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/RowIteratorImpl.java 2011-07-05 15:13:59 UTC (r= ev 4602) @@ -781,11 +781,18 @@ } try { - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } String excerpt =3D excerptProvider.getExcerpt(id, 3, 150); - - time =3D System.currentTimeMillis() - time; - log.debug("Created excerpt in {} ms.", new Long(time)); + = + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + log.debug("Created excerpt in {} ms.", new Long(time)); = = + } if (excerpt !=3D null) { return valueFactory.createValue(excerpt); @@ -815,10 +822,17 @@ HighlightingExcerptProvider hep =3D (HighlightingExcerptProvider)= excerptProvider; try { - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } text =3D hep.highlight(text); - time =3D System.currentTimeMillis() - time; - log.debug("Highlighted text in {} ms.", new Long(time)); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + log.debug("Highlighted text in {} ms.", new Long(time)); = = + } return valueFactory.createValue(text); } catch (IOException e) 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 2011-07-05 14:46:12 UTC (rev 4= 601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/SearchIndex.java 2011-07-05 15:13:59 UTC (rev 4= 602) @@ -1881,7 +1881,11 @@ { return; } - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis(); + } int found =3D SecurityHelper.doPrivilegedAction(new PrivilegedAct= ion() { public Integer run() @@ -1937,8 +1941,11 @@ return found; } }); - time =3D System.currentTimeMillis() - time; - log.debug("Retrieved {} aggregate roots in {} ms.", new Integer(f= ound), new Long(time)); + if (log.isDebugEnabled()) + { + time =3D System.currentTimeMillis() - time; + log.debug("Retrieved {} aggregate roots in {} ms.", new Intege= r(found), new Long(time)); = + } } } = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-07-0= 5 14:46:12 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-07-0= 5 15:13:59 UTC (rev 4602) @@ -517,8 +517,11 @@ // save state if (itemState.isPersisted()) { - long start =3D System.currentTimeMillis(); - + long start =3D 0; + if (LOG.isDebugEnabled()) + { + start =3D System.currentTimeMillis(); + } ItemData data =3D itemState.getData(); = WorkspaceStorageConnection conn; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/indexing/JdbcNodeDataIndexingIterator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/indexing/JdbcNodeDataIndexingIterator.java 2011-07-0= 5 14:46:12 UTC (rev 4601) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/indexing/JdbcNodeDataIndexingIterator.java 2011-07-0= 5 15:13:59 UTC (rev 4602) @@ -115,7 +115,11 @@ currentLastNodeId =3D lastNodeId.get(); currentPage =3D page.incrementAndGet(); } - long time =3D System.currentTimeMillis(); + long time =3D 0; + if (PropertyManager.isDevelopping()) + { + time =3D System.currentTimeMillis(); + } List result =3D conn.getNodesAndProperties(curr= entLastNodeId, currentOffset, pageSize); if (PropertyManager.isDevelopping()) { --===============6594487251509361682==-- From do-not-reply at jboss.org Tue Jul 5 11:21:53 2011 Content-Type: multipart/mixed; boundary="===============1796781269138246125==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4603 - jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup. Date: Tue, 05 Jul 2011 11:21:53 -0400 Message-ID: <201107051521.p65FLr2V027033@svn01.web.mwc.hst.phx2.redhat.com> --===============1796781269138246125== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2011-07-05 11:21:53 -0400 (Tue, 05 Jul 2011) New Revision: 4603 Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/backup/AbstractBackupUseCasesTest.java Log: EXOJCR-1405 : Unit test was fixed (for working on macos X ) Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/backup/AbstractBackupUseCasesTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/AbstractBackupUseCasesTest.java 2011-07-05 15:13:59 UTC (rev= 4602) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/backup/AbstractBackupUseCasesTest.java 2011-07-05 15:21:53 UTC (rev= 4603) @@ -1224,7 +1224,7 @@ String newBackupDir =3D "\\${java.io.tmpdir}" + bch.getBackupConfig().getBackupDir().getCanonica= lPath() - .replaceAll(backupDitEnv, ""); + .replace(backupDitEnv, ""); = File dest =3D new File(repositoryBackupChainLogPath + ".xml"); dest.createNewFile(); --===============1796781269138246125==-- From do-not-reply at jboss.org Wed Jul 6 05:34:02 2011 Content-Type: multipart/mixed; boundary="===============7477191166036412835==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4604 - kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache and 2 other directories. Date: Wed, 06 Jul 2011 05:34:02 -0400 Message-ID: <201107060934.p669Y2NS017756@svn01.web.mwc.hst.phx2.redhat.com> --===============7477191166036412835== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2011-07-06 05:34:01 -0400 (Wed, 06 Jul 2011) New Revision: 4604 Added: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/invalidation/ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/invalidation/InvalidationExoCache.java Removed: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/impl/InvalidationExoCache.java Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/cache.xml kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/se= rvices/cache/impl/CacheServiceImpl.java Log: EXOJCR-1418: Moved InvalidationExoCache in a dedicated package, auto wrap t= he eXo cache instance into an InvalidationExoCache only if the cache is rep= licated or distributed and set a better default concurrency level. Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/kernel/cache.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/cache.xml 2011-07-05 15:21:53 UTC (rev 4603) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/cache.xml 2011-07-06 09:34:01 UTC (rev 4604) @@ -209,12 +209,13 @@ parameter avoidValueReplication to true in your eXo cache configuration, this = will indicate the CacheService to wrap your eXo cache instance into an - InvalidationExoCache. + InvalidationExoCache in case the cache is + defined as replicated or distributed. = Programmatically; You can wrap your eXo cache instance int= o an - org.exoplatform.services.cache.impl.InvalidationExoCac= he + org.exoplatform.services.cache.invalidation.Invalidati= onExoCache yourself using the public constructors that are available. Please note that if you use CacheListeners add the= m to the InvalidationExoCache instance instead of the nested eXo Cache @@ -227,7 +228,7 @@ The invalidation will be efficient if and only if the hash c= ode method is properly implemented, in other words 2 value objects - representing the same data will return the same hash code otherwise + representing the same data need to return the same hash code other= wise the infinite loop described above will still be effective. Modified: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplat= form/services/cache/impl/CacheServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/CacheServiceImpl.java 2011-07-05 15:21:53 UTC (rev 4603) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/CacheServiceImpl.java 2011-07-06 09:34:01 UTC (rev 4604) @@ -28,6 +28,7 @@ import org.exoplatform.services.cache.ExoCacheFactory; import org.exoplatform.services.cache.ExoCacheInitException; import org.exoplatform.services.cache.SimpleExoCache; +import org.exoplatform.services.cache.invalidation.InvalidationExoCache; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = @@ -199,9 +200,11 @@ { managed.registerCache(simple); } - // If the flag avoid value replication is enabled we wrap the eXo ca= che instance - // into an InvalidationExoCache to enable the invalidation - return safeConfig.avoidValueReplication() ? new InvalidationExoCache= (simple) : simple; + // If the flag avoid value replication is enabled and the cache is r= eplicated + // or distributed we wrap the eXo cache instance into an Invalidatio= nExoCache = + // to enable the invalidation + return safeConfig.avoidValueReplication() && (safeConfig.isRepicated= () || safeConfig.isDistributed()) + ? new InvalidationExoCache(simple) : simple; } = public Collection> getAllCacheInsta= nces() Deleted: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatf= orm/services/cache/impl/InvalidationExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/InvalidationExoCache.java 2011-07-05 15:21:53 UTC (rev 4= 603) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/impl/InvalidationExoCache.java 2011-07-06 09:34:01 UTC (rev 4= 604) @@ -1,561 +0,0 @@ -/* - * Copyright (C) 2011 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; - -import org.exoplatform.services.cache.CacheListener; -import org.exoplatform.services.cache.CacheListenerContext; -import org.exoplatform.services.cache.CachedObjectSelector; -import org.exoplatform.services.cache.ExoCache; -import org.exoplatform.services.cache.ObjectCacheInfo; -import org.exoplatform.services.log.ExoLogger; -import org.exoplatform.services.log.Log; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * This eXo cache type is a decorator allowing ExoCache instances that have - * big values or non serializable values to be replicated thanks to an inv= alidation - * mechanism. To prevent infinite loop described below, we replicate the h= ash code of - * the value such that if the hash code is the same, we don't invalidate t= he value locally - *
    - *
  • Cluster node #1 puts (key1, value1) into the cache
  • - *
  • On cluster node #2 key1 is invalidated by the put call in node #1 - *
  • Node #2 re-loads key1 and puts (key1, value1) into the cache
  • - *
  • On cluster node #1 key1 is invalidated, so we get back to step #1 - *
- * = - * @author Nicolas Filotto - * @version $Id$ - * - */ -public class InvalidationExoCache implements Ex= oCache, - CacheListener> -{ - /** - * Logger. - */ - private static final Log LOG =3D ExoLogger.getLogger("exo.kernel.compon= ent.cache.InvalidationExoCache"); - - /** - * The eXo cache instance that we would like to replicate using the inv= alidation - * mechanism - */ - private final ExoCache> delegate; - = - /** - * The listeners of the cache - */ - private final CopyOnWriteArrayList>= listeners; - = - /** - * The local cache that contains the real values - */ - private final ConcurrentMap localCache; - = - /** - * @param delegate the underneath eXo cache instance, we assume that th= e eXo cache - * implementation behind is fully functional. - */ - public InvalidationExoCache(ExoCache delegate) - { - this(delegate, 16); - } - = - /** - * @param delegate the underneath eXo cache instance, we assume that th= e eXo cache - * implementation behind is fully functional. - * @concurrencyLevel the estimated number of concurrently - * updating threads. The implementation performs internal sizing - * to try to accommodate this many threads. = - */ - @SuppressWarnings("unchecked") - public InvalidationExoCache(ExoCache delegate, int concurrencyLev= el) - { - this.delegate =3D (ExoCache>)delegate; - // We listen to the cache in order to get a callbacks in case of int= ernal puts for example - this.delegate.addCacheListener(this); - this.listeners =3D new CopyOnWriteArrayList>(); - this.localCache =3D new ConcurrentHashMap(concurrencyLevel, 0.= 75f, concurrencyLevel); = - } - = - /** - * @see org.exoplatform.services.cache.ExoCache#getName() - */ - public String getName() - { - return delegate.getName(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#setName(java.lang.Strin= g) - */ - public void setName(String name) - { - delegate.setName(name); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#getLabel() - */ - public String getLabel() - { - return delegate.getLabel(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#setLabel(java.lang.Stri= ng) - */ - public void setLabel(String s) - { - delegate.setLabel(s); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#get(java.io.Serializabl= e) - */ - public V get(Serializable name) - { - HashCode result =3D delegate.get(name); - return result =3D=3D null ? null : localCache.get(name); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#remove(java.io.Serializ= able) - */ - public V remove(Serializable key) throws NullPointerException - { - V value =3D localCache.get(key); - delegate.remove(key); - return value; - } - - /** - * @see org.exoplatform.services.cache.ExoCache#put(java.io.Serializabl= e, java.lang.Object) - */ - public void put(K key, V value) throws NullPointerException - { - delegate.put(key, new HashCode(value)); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#putMap(java.util.Map) - */ - public void putMap(Map objs) throws NullPoint= erException, IllegalArgumentException - { - if (objs =3D=3D null) - { - throw new NullPointerException("No null map accepted"); - } - Map> map =3D new LinkedHashMap>(); - for (Entry entry : objs.entrySet()) - { - if (entry.getKey() =3D=3D null) - { - throw new IllegalArgumentException("No null cache key accepted= "); - } - else if (entry.getValue() =3D=3D null) - { - throw new IllegalArgumentException("No null cache value accept= ed"); = - } - map.put(entry.getKey(), new HashCode(entry.getValue())); - } - delegate.putMap(map); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#clearCache() - */ - public void clearCache() - { - delegate.clearCache(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#select(org.exoplatform.= services.cache.CachedObjectSelector) - */ - public void select(CachedObjectSelector selector)= throws Exception - { - if (selector =3D=3D null) - { - throw new IllegalArgumentException("No null selector"); - } - for (Entry entry : localCache.entrySet()) - { - final K key =3D entry.getKey(); - final V value =3D entry.getValue(); - ObjectCacheInfo info =3D new ObjectCacheInfo() - { - public V get() - { - return value; - } - - public long getExpireTime() - { - // Cannot know: The expire time is managed by JBoss Cache i= tself - return -1; - } - }; - if (selector.select(key, info)) - { - selector.onSelect(this, key, info); - } - } - } - - /** - * @see org.exoplatform.services.cache.ExoCache#getCacheSize() - */ - public int getCacheSize() - { - return localCache.size(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#getMaxSize() - */ - public int getMaxSize() - { - return delegate.getMaxSize(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#setMaxSize(int) - */ - public void setMaxSize(int max) - { - delegate.setMaxSize(max); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#getLiveTime() - */ - public long getLiveTime() - { - return delegate.getLiveTime(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#setLiveTime(long) - */ - public void setLiveTime(long period) - { - delegate.setLiveTime(period); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#getCacheHit() - */ - public int getCacheHit() - { - return delegate.getCacheHit(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#getCacheMiss() - */ - public int getCacheMiss() - { - return delegate.getCacheMiss(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#getCachedObjects() - */ - public List getCachedObjects() - { - return new ArrayList(localCache.values()); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#removeCachedObjects() - */ - public List removeCachedObjects() - { - final List list =3D getCachedObjects(); - clearCache(); - return list; - } - - /** - * @see org.exoplatform.services.cache.ExoCache#addCacheListener(org.ex= oplatform.services.cache.CacheListener) - */ - public void addCacheListener(CacheListener listen= er) throws NullPointerException - { - if (listener =3D=3D null) - { - throw new NullPointerException(); - } - listeners.add(listener); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#isLogEnabled() - */ - public boolean isLogEnabled() - { - return delegate.isLogEnabled(); - } - - /** - * @see org.exoplatform.services.cache.ExoCache#setLogEnabled(boolean) - */ - public void setLogEnabled(boolean b) - { - delegate.setLogEnabled(b); - } - - /** - * {@inheritDoc} - */ - public void onExpire(CacheListenerContext context, K key, HashCode o= bj) throws Exception - { - V value =3D localCache.remove(key); - if (listeners.isEmpty()) - { - return; - } - for (CacheListener listener : listeners) - { - try - { - listener.onExpire(context, key, value); - } - catch (Exception e) - { - if (LOG.isWarnEnabled()) - LOG.warn("Cannot execute the CacheListener properly", e); - } - } - } - - /** - * {@inheritDoc} - */ - public void onRemove(CacheListenerContext context, K key, HashCode o= bj) throws Exception - { - V value =3D localCache.remove(key); - if (listeners.isEmpty()) - { - return; - } - for (CacheListener listener : listeners) - { - try - { - listener.onRemove(context, key, value); - } - catch (Exception e) - { - if (LOG.isWarnEnabled()) - LOG.warn("Cannot execute the CacheListener properly", e); - } - } - } - - /** - * {@inheritDoc} - */ - public void onPut(CacheListenerContext context, K key, HashCode obj)= throws Exception - { - V value =3D obj.getValue(); - if (value !=3D null) - { - // we assume that it is a local put since the value is inside the= HashCode object - localCache.put(key, value); - } - else - { - // we assume that it is a remote put since the value is not insid= e the HashCode object - V currentValue =3D localCache.get(key); - if (currentValue !=3D null && obj !=3D null && currentValue.hashC= ode() =3D=3D obj.hashCode()) - { - // We assume that it is the same value so we don't change the = value in the cache - value =3D currentValue; - } - else - { - // A new value has been added to the cache so we invalidate th= e local one - value =3D null; - localCache.remove(key); - } - } - if (listeners.isEmpty()) - { - return; - } - for (CacheListener listener : listeners) - try - { - listener.onPut(context, key, value); - } - catch (Exception e) - { - if (LOG.isWarnEnabled()) - LOG.warn("Cannot execute the CacheListener properly", e); - } - } - - /** - * {@inheritDoc} - */ - public void onGet(CacheListenerContext context, K key, HashCode obj)= throws Exception - { - if (listeners.isEmpty()) - { - return; - } - V value =3D obj =3D=3D null ? null : localCache.get(key); - for (CacheListener listener : listeners) - try - { - listener.onGet(context, key, value); - } - catch (Exception e) - { - if (LOG.isWarnEnabled()) - LOG.warn("Cannot execute the CacheListener properly", e); - } - } - - /** - * @see org.exoplatform.services.cache.CacheListener#onClearCache(org.e= xoplatform.services.cache.CacheListenerContext) - */ - public void onClearCache(CacheListenerContext context) throws Exception - { - localCache.clear(); - if (listeners.isEmpty()) - { - return; - } - for (CacheListener listener : listeners) - { - try - { - listener.onClearCache(context); - } - catch (Exception e) - { - if (LOG.isWarnEnabled()) - LOG.warn("Cannot execute the CacheListener properly", e); - } - } = - } - = - /** - * We use this class to propagate the hash code of the value efficientl= y over the network - */ - public static class HashCode implements Externalizable - { - /** - * The hash code of the value - */ - private int hashCode; - = - /** - * The corresponding value - */ - private V value; - = - public HashCode() {} - = - public HashCode(V value) - { - this.hashCode =3D value.hashCode(); - this.value =3D value; - } - = - /** - * @return the value - */ - public V getValue() - { - return value; - } - - /** - * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) - */ - public void writeExternal(ObjectOutput out) throws IOException - { - out.writeInt(hashCode); - } - - /** - * @see java.io.Externalizable#readExternal(java.io.ObjectInput) - */ - public void readExternal(ObjectInput in) throws IOException, ClassNo= tFoundException - { - this.hashCode =3D in.readInt(); - } - - /** - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() - { - return hashCode; - } - - /** - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) - { - if (this =3D=3D obj) - return true; - if (obj =3D=3D null) - return false; - if (getClass() !=3D obj.getClass()) - return false; - @SuppressWarnings("rawtypes") - HashCode other =3D (HashCode)obj; - if (hashCode !=3D other.hashCode) - return false; - if (value !=3D null && other.value !=3D null) - { - return value.equals(other.value); - } - return true; - } - - /** - * @see java.lang.Object#toString() - */ - @Override - public String toString() - { - return "HashCode [hashCode=3D" + hashCode + ", value=3D" + value = + "]"; - } - } = -} Copied: kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatfo= rm/services/cache/invalidation/InvalidationExoCache.java (from rev 4603, ke= rnel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/service= s/cache/impl/InvalidationExoCache.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/invalidation/InvalidationExoCache.java = (rev 0) +++ kernel/trunk/exo.kernel.component.cache/src/main/java/org/exoplatform/s= ervices/cache/invalidation/InvalidationExoCache.java 2011-07-06 09:34:01 UT= C (rev 4604) @@ -0,0 +1,561 @@ +/* + * Copyright (C) 2011 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.invalidation; + +import org.exoplatform.services.cache.CacheListener; +import org.exoplatform.services.cache.CacheListenerContext; +import org.exoplatform.services.cache.CachedObjectSelector; +import org.exoplatform.services.cache.ExoCache; +import org.exoplatform.services.cache.ObjectCacheInfo; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CopyOnWriteArrayList; + +/** + * This eXo cache type is a decorator allowing ExoCache instances that have + * big values or non serializable values to be replicated thanks to an inv= alidation + * mechanism. To prevent infinite loop described below, we replicate the h= ash code of + * the value such that if the hash code is the same, we don't invalidate t= he value locally + *
    + *
  • Cluster node #1 puts (key1, value1) into the cache
  • + *
  • On cluster node #2 key1 is invalidated by the put call in node #1 + *
  • Node #2 re-loads key1 and puts (key1, value1) into the cache
  • + *
  • On cluster node #1 key1 is invalidated, so we get back to step #1 + *
+ * = + * @author
Nicolas Filotto + * @version $Id$ + * + */ +public class InvalidationExoCache implements Ex= oCache, + CacheListener> +{ + /** + * Logger. + */ + private static final Log LOG =3D ExoLogger.getLogger("exo.kernel.compon= ent.cache.InvalidationExoCache"); + + /** + * The eXo cache instance that we would like to replicate using the inv= alidation + * mechanism + */ + private final ExoCache> delegate; + = + /** + * The listeners of the cache + */ + private final CopyOnWriteArrayList>= listeners; + = + /** + * The local cache that contains the real values + */ + private final ConcurrentMap localCache; + = + /** + * @param delegate the underneath eXo cache instance, we assume that th= e eXo cache + * implementation behind is fully functional. + */ + public InvalidationExoCache(ExoCache delegate) + { + this(delegate, delegate.getMaxSize() > 0 && delegate.getMaxSize() < = 512 ? delegate.getMaxSize() : 512); + } + = + /** + * @param delegate the underneath eXo cache instance, we assume that th= e eXo cache + * implementation behind is fully functional. + * @concurrencyLevel the estimated number of concurrently + * updating threads. The implementation performs internal sizing + * to try to accommodate this many threads. = + */ + @SuppressWarnings("unchecked") + public InvalidationExoCache(ExoCache delegate, int concurrencyLev= el) + { + this.delegate =3D (ExoCache>)delegate; + // We listen to the cache in order to get a callbacks in case of int= ernal puts for example + this.delegate.addCacheListener(this); + this.listeners =3D new CopyOnWriteArrayList>(); + this.localCache =3D new ConcurrentHashMap(concurrencyLevel, 0.= 75f, concurrencyLevel); = + } + = + /** + * @see org.exoplatform.services.cache.ExoCache#getName() + */ + public String getName() + { + return delegate.getName(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setName(java.lang.Strin= g) + */ + public void setName(String name) + { + delegate.setName(name); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getLabel() + */ + public String getLabel() + { + return delegate.getLabel(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setLabel(java.lang.Stri= ng) + */ + public void setLabel(String s) + { + delegate.setLabel(s); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#get(java.io.Serializabl= e) + */ + public V get(Serializable name) + { + HashCode result =3D delegate.get(name); + return result =3D=3D null ? null : localCache.get(name); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#remove(java.io.Serializ= able) + */ + public V remove(Serializable key) throws NullPointerException + { + V value =3D localCache.get(key); + delegate.remove(key); + return value; + } + + /** + * @see org.exoplatform.services.cache.ExoCache#put(java.io.Serializabl= e, java.lang.Object) + */ + public void put(K key, V value) throws NullPointerException + { + delegate.put(key, new HashCode(value)); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#putMap(java.util.Map) + */ + public void putMap(Map objs) throws NullPoint= erException, IllegalArgumentException + { + if (objs =3D=3D null) + { + throw new NullPointerException("No null map accepted"); + } + Map> map =3D new LinkedHashMap>(); + for (Entry entry : objs.entrySet()) + { + if (entry.getKey() =3D=3D null) + { + throw new IllegalArgumentException("No null cache key accepted= "); + } + else if (entry.getValue() =3D=3D null) + { + throw new IllegalArgumentException("No null cache value accept= ed"); = + } + map.put(entry.getKey(), new HashCode(entry.getValue())); + } + delegate.putMap(map); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#clearCache() + */ + public void clearCache() + { + delegate.clearCache(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#select(org.exoplatform.= services.cache.CachedObjectSelector) + */ + public void select(CachedObjectSelector selector)= throws Exception + { + if (selector =3D=3D null) + { + throw new IllegalArgumentException("No null selector"); + } + for (Entry entry : localCache.entrySet()) + { + final K key =3D entry.getKey(); + final V value =3D entry.getValue(); + ObjectCacheInfo info =3D new ObjectCacheInfo() + { + public V get() + { + return value; + } + + public long getExpireTime() + { + // Cannot know: The expire time is managed by JBoss Cache i= tself + return -1; + } + }; + if (selector.select(key, info)) + { + selector.onSelect(this, key, info); + } + } + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCacheSize() + */ + public int getCacheSize() + { + return localCache.size(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getMaxSize() + */ + public int getMaxSize() + { + return delegate.getMaxSize(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setMaxSize(int) + */ + public void setMaxSize(int max) + { + delegate.setMaxSize(max); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getLiveTime() + */ + public long getLiveTime() + { + return delegate.getLiveTime(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setLiveTime(long) + */ + public void setLiveTime(long period) + { + delegate.setLiveTime(period); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCacheHit() + */ + public int getCacheHit() + { + return delegate.getCacheHit(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCacheMiss() + */ + public int getCacheMiss() + { + return delegate.getCacheMiss(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#getCachedObjects() + */ + public List getCachedObjects() + { + return new ArrayList(localCache.values()); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#removeCachedObjects() + */ + public List removeCachedObjects() + { + final List list =3D getCachedObjects(); + clearCache(); + return list; + } + + /** + * @see org.exoplatform.services.cache.ExoCache#addCacheListener(org.ex= oplatform.services.cache.CacheListener) + */ + public void addCacheListener(CacheListener listen= er) throws NullPointerException + { + if (listener =3D=3D null) + { + throw new NullPointerException(); + } + listeners.add(listener); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#isLogEnabled() + */ + public boolean isLogEnabled() + { + return delegate.isLogEnabled(); + } + + /** + * @see org.exoplatform.services.cache.ExoCache#setLogEnabled(boolean) + */ + public void setLogEnabled(boolean b) + { + delegate.setLogEnabled(b); + } + + /** + * {@inheritDoc} + */ + public void onExpire(CacheListenerContext context, K key, HashCode o= bj) throws Exception + { + V value =3D localCache.remove(key); + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onExpire(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + } + + /** + * {@inheritDoc} + */ + public void onRemove(CacheListenerContext context, K key, HashCode o= bj) throws Exception + { + V value =3D localCache.remove(key); + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onRemove(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + } + + /** + * {@inheritDoc} + */ + public void onPut(CacheListenerContext context, K key, HashCode obj)= throws Exception + { + V value =3D obj.getValue(); + if (value !=3D null) + { + // we assume that it is a local put since the value is inside the= HashCode object + localCache.put(key, value); + } + else + { + // we assume that it is a remote put since the value is not insid= e the HashCode object + V currentValue =3D localCache.get(key); + if (currentValue !=3D null && obj !=3D null && currentValue.hashC= ode() =3D=3D obj.hashCode()) + { + // We assume that it is the same value so we don't change the = value in the cache + value =3D currentValue; + } + else + { + // A new value has been added to the cache so we invalidate th= e local one + value =3D null; + localCache.remove(key); + } + } + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + try + { + listener.onPut(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + + /** + * {@inheritDoc} + */ + public void onGet(CacheListenerContext context, K key, HashCode obj)= throws Exception + { + if (listeners.isEmpty()) + { + return; + } + V value =3D obj =3D=3D null ? null : localCache.get(key); + for (CacheListener listener : listeners) + try + { + listener.onGet(context, key, value); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } + + /** + * @see org.exoplatform.services.cache.CacheListener#onClearCache(org.e= xoplatform.services.cache.CacheListenerContext) + */ + public void onClearCache(CacheListenerContext context) throws Exception + { + localCache.clear(); + if (listeners.isEmpty()) + { + return; + } + for (CacheListener listener : listeners) + { + try + { + listener.onClearCache(context); + } + catch (Exception e) + { + if (LOG.isWarnEnabled()) + LOG.warn("Cannot execute the CacheListener properly", e); + } + } = + } + = + /** + * We use this class to propagate the hash code of the value efficientl= y over the network + */ + public static class HashCode implements Externalizable + { + /** + * The hash code of the value + */ + private int hashCode; + = + /** + * The corresponding value + */ + private V value; + = + public HashCode() {} + = + public HashCode(V value) + { + this.hashCode =3D value.hashCode(); + this.value =3D value; + } + = + /** + * @return the value + */ + public V getValue() + { + return value; + } + + /** + * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput) + */ + public void writeExternal(ObjectOutput out) throws IOException + { + out.writeInt(hashCode); + } + + /** + * @see java.io.Externalizable#readExternal(java.io.ObjectInput) + */ + public void readExternal(ObjectInput in) throws IOException, ClassNo= tFoundException + { + this.hashCode =3D in.readInt(); + } + + /** + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() + { + return hashCode; + } + + /** + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) + { + if (this =3D=3D obj) + return true; + if (obj =3D=3D null) + return false; + if (getClass() !=3D obj.getClass()) + return false; + @SuppressWarnings("rawtypes") + HashCode other =3D (HashCode)obj; + if (hashCode !=3D other.hashCode) + return false; + if (value !=3D null && other.value !=3D null) + { + return value.equals(other.value); + } + return true; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() + { + return "HashCode [hashCode=3D" + hashCode + ", value=3D" + value = + "]"; + } + } = +} --===============7477191166036412835==-- From do-not-reply at jboss.org Wed Jul 6 06:09:59 2011 Content-Type: multipart/mixed; boundary="===============4180589348788037291==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4605 - kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss. Date: Wed, 06 Jul 2011 06:09:59 -0400 Message-ID: <201107061009.p66A9xkO027162@svn01.web.mwc.hst.phx2.redhat.com> --===============4180589348788037291== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nfilotto Date: 2011-07-06 06:09:58 -0400 (Wed, 06 Jul 2011) New Revision: 4605 Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/= org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java Log: EXOJCR-1418: Changed the import of InvalidationExoCache Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/tes= t/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java= /org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2011-0= 7-06 09:34:01 UTC (rev 4604) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java= /org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java 2011-0= 7-06 10:09:58 UTC (rev 4605) @@ -31,8 +31,8 @@ import org.exoplatform.services.cache.ExoCacheFactory; import org.exoplatform.services.cache.ExoCacheInitException; import org.exoplatform.services.cache.ObjectCacheInfo; -import org.exoplatform.services.cache.impl.InvalidationExoCache; import org.exoplatform.services.cache.impl.jboss.lru.LRUExoCacheCreator; +import org.exoplatform.services.cache.invalidation.InvalidationExoCache; import org.exoplatform.test.BasicTestCase; = import java.io.Serializable; --===============4180589348788037291==-- From do-not-reply at jboss.org Wed Jul 6 10:09:05 2011 Content-Type: multipart/mixed; boundary="===============6878877795735625961==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4606 - in jcr/trunk/exo.jcr.component.ext/src: test/resources/conf/standalone and 1 other directory. Date: Wed, 06 Jul 2011 10:09:05 -0400 Message-ID: <201107061409.p66E957P010514@svn01.web.mwc.hst.phx2.redhat.com> --===============6878877795735625961== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-06 10:09:04 -0400 (Wed, 06 Jul 2011) New Revision: 4606 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-= configuration.xml Log: EXOJCR-1417: Make the code fully independent of DBCP Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-06 1= 0:09:58 UTC (rev 4605) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-06 1= 4:09:04 UTC (rev 4606) @@ -20,6 +20,7 @@ import org.exoplatform.container.ExoContainerContext; import org.exoplatform.container.configuration.ConfigurationException; import org.exoplatform.container.configuration.ConfigurationManager; +import org.exoplatform.container.xml.InitParams; import org.exoplatform.services.database.creator.DBConnectionInfo; import org.exoplatform.services.database.creator.DBCreator; import org.exoplatform.services.database.creator.DBCreatorException; @@ -86,6 +87,21 @@ private static final Log LOG =3D ExoLogger.getLogger("exo.jcr.component= .core.RepositoryCreationService"); = /** + * The parameter name in service's configuration. + */ + private final static String FACTORY_CLASSS_NAME_PARAM =3D "factory-clas= s-name"; + + /** + * The default factory class name. + */ + private static final String BASIC_DATA_SOURCE_FACTORY =3D "org.apache.c= ommons.dbcp.BasicDataSourceFactory"; + + /** + * The factory class name to create object. + */ + private String factoryClassName =3D BASIC_DATA_SOURCE_FACTORY; + + /** * The Repository service. */ private final RepositoryService repositoryService; @@ -129,18 +145,25 @@ /** * Constructor RepositoryCreationServiceImpl. */ - public RepositoryCreationServiceImpl(RepositoryService repositoryServic= e, BackupManager backupManager, - ExoContainerContext context, InitialContextInitializer initialContex= tInitializer) + public RepositoryCreationServiceImpl(InitParams initParams, RepositoryS= ervice repositoryService, + BackupManager backupManager, ExoContainerContext context, InitialCon= textInitializer initialContextInitializer) { - this(repositoryService, backupManager, context, initialContextInitia= lizer, null); + this(initParams, repositoryService, backupManager, context, initialC= ontextInitializer, null); } = /** * Constructor RepositoryCreationServiceImpl. */ - public RepositoryCreationServiceImpl(final RepositoryService repository= Service, BackupManager backupManager, - ExoContainerContext context, InitialContextInitializer initialContex= tInitializer, final RPCService rpcService) + public RepositoryCreationServiceImpl(InitParams initParams, final Repos= itoryService repositoryService, + BackupManager backupManager, ExoContainerContext context, InitialCon= textInitializer initialContextInitializer, + final RPCService rpcService) { + if (initParams !=3D null) + { + // set reference class name for datasource binding from initializ= ation parameters + factoryClassName =3D initParams.getValueParam(FACTORY_CLASSS_NAME= _PARAM).getValue(); + } + = this.repositoryService =3D repositoryService; this.backupManager =3D backupManager; this.rpcService =3D rpcService; @@ -535,7 +558,7 @@ try { initialContextInitializer.getInitialContextBinder().bind(dataS= ource, "javax.sql.DataSource", - "org.apache.commons.dbcp.BasicDataSourceFactory", null, ref= Addr); + factoryClassName, null, refAddr); } catch (NamingException e) { @@ -634,7 +657,7 @@ try { initialContextInitializer.getInitialContextBinder().bind(da= taSource, "javax.sql.DataSource", - "org.apache.commons.dbcp.BasicDataSourceFactory", null, = refAddr); + factoryClassName, null, refAddr); } catch (NamingException e) { @@ -860,10 +883,10 @@ repositoryService.removeRepository(repositoryName); repositoryService.getConfig().retain(); = - // unbind datasource - for (String ds : datasources) + // unbind datasource and close connections + for (String dsName : datasources) { - initialContextInitializer.getInitialContextBinder().unbind(ds); + initialContextInitializer.getInitialContextBinder().unbind(dsN= ame); } } catch (RepositoryException e) Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalon= e/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.ext/src/test/resources/conf/standalone/test= -configuration.xml 2011-07-06 10:09:58 UTC (rev 4605) +++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test= -configuration.xml 2011-07-06 14:09:04 UTC (rev 4606) @@ -382,6 +382,12 @@ org.exoplatform.services.jcr.ext.repository.creation.Repository= CreationService org.exoplatform.services.jcr.ext.repository.creation.Repositor= yCreationServiceImpl + = --===============6878877795735625961==-- From do-not-reply at jboss.org Wed Jul 6 10:14:54 2011 Content-Type: multipart/mixed; boundary="===============8292170179219853699==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4607 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr. Date: Wed, 06 Jul 2011 10:14:54 -0400 Message-ID: <201107061414.p66EEsxm011013@svn01.web.mwc.hst.phx2.redhat.com> --===============8292170179219853699== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-06 10:14:54 -0400 (Wed, 06 Jul 2011) New Revision: 4607 Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/jcr/repository-creation-service.xml Log: EXOJCR-1417: Doc updated Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook= /en-US/modules/jcr/repository-creation-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/repository-creation-service.xml 2011-07-06 14:09:04 UTC (rev 4= 606) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/repository-creation-service.xml 2011-07-06 14:14:54 UTC (rev 4= 607) @@ -140,11 +140,24 @@ <type> org.exoplatform.services.jcr.ext.repository.creation.RepositoryCreat= ionServiceImpl </type> + <init-params> = + <value-param> = + <name>factory-class-name</name> = + <value>org.apache.commons.dbcp.BasicDataSourceFactory<= ;/value> = + </value-param> = + </init-params> </component> + + + + factory-class-name - is not mandatory parameter, indicates w= hat + the factory need to use to create DataSource objects + + =
- Repsitory Interface + RepositoryCreationService Interface = public interface RepositoryCreationS= ervice { --===============8292170179219853699==-- From do-not-reply at jboss.org Thu Jul 7 04:29:27 2011 Content-Type: multipart/mixed; boundary="===============8496467376097062845==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4608 - in jcr/trunk/exo.jcr.component.core: src/main/java/org/exoplatform/services/jcr/dataflow/serialization and 2 other directories. Date: Thu, 07 Jul 2011 04:29:27 -0400 Message-ID: <201107070829.p678TRXW002844@svn01.web.mwc.hst.phx2.redhat.com> --===============8496467376097062845== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-07 04:29:27 -0400 (Thu, 07 Jul 2011) New Revision: 4608 Modified: jcr/trunk/exo.jcr.component.core/pom.xml 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/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/test/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/JcrImplSerializationBaseTest.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/TestJCRSerializationStream.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/TestJCRSerializationVersionRestore.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/TesterItemsPersistenceListener.java Log: EXOJCR-1407 : Checks in serialization tests should be performed synchronous= ly with Session.Save() 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 2011-07-06 14:14:54 UTC (rev 4= 607) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-07-07 08:29:27 UTC (rev 4= 608) @@ -412,8 +412,6 @@ org/exoplatform/services/jcr/**/api/TestAll.jav= a org/exoplatform/services/jcr/**/impl/**/Base*.j= ava org/exoplatform/services/jcr/**/usecases/BaseUs= ecasesTest.java - org/exoplatform/services/jcr/**/impl/**/TestJCR= SerializationStream.java - org/exoplatform/services/jcr/**/impl/**/TestJCR= SerializationVersionRestore.java org/exoplatform/services/jcr/usecases/common/Re= moveSameNameSiblingUnfixedTest.java org/exoplatform/services/jcr/**/impl/**/SQLBenc= hmarkTest.java @@ -753,8 +751,6 @@ org/exoplatform/services/jcr/**/api/TestA= ll.java org/exoplatform/services/jcr/**/impl/**/B= ase*.java org/exoplatform/services/jcr/**/usecases/= BaseUsecasesTest.java - org/exoplatform/services/jcr/**/impl/**/T= estJCRSerializationStream.java - org/exoplatform/services/jcr/**/impl/**/T= estJCRSerializationVersionRestore.java org/exoplatform/services/jcr/usecases/com= mon/RemoveSameNameSiblingUnfixedTest.java org/exoplatform/services/jcr/**/impl/**/S= QLBenchmarkTest.java 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 2011-07-06 14:14:54= UTC (rev 4607) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/serialization/SerializationConstants.java 2011-07-07 08:29:27= UTC (rev 4608) @@ -89,6 +89,11 @@ public static final int PERSISTED_VALUE_DATA =3D 11; = /** + * Null file + */ + public static final int NULL_FILE =3D -1; + + /** * Null data. */ public static final byte NULL_DATA =3D 0; 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 2011-07-06 1= 4:14:54 UTC (rev 4607) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/PersistedValueDataReader.java 2011-07-07 0= 8:29:27 UTC (rev 4608) @@ -93,7 +93,9 @@ // read id int key; if ((key =3D in.readInt()) !=3D SerializationConstants.PERSISTED_VAL= UE_DATA) + { throw new UnknownClassIdException("There is unexpected class [" += key + "]"); + } = int orderNumber =3D in.readInt(); = @@ -115,8 +117,12 @@ SerializationSpoolFile sf =3D holder.get(id); if (sf =3D=3D null) { + // Deleted ItemState usecase = + if (length =3D=3D SerializationConstants.NULL_FILE) + { + return new StreamPersistedValueData(orderNumber, (Serializa= tionSpoolFile)null); + } sf =3D new SerializationSpoolFile(tempDirectory, id, holder); - // TODO optimize writeToFile - use channels or streams writeToFile(in, sf, length); holder.put(id, sf); return new StreamPersistedValueData(orderNumber, sf); @@ -130,7 +136,9 @@ = // skip data in input stream if (in.skip(length) !=3D length) + { throw new IOException("Content isn't skipped correctly."= ); + } = return vd; } 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 2011-07-06 1= 4:14:54 UTC (rev 4607) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/PersistedValueDataWriter.java 2011-07-07 0= 8:29:27 UTC (rev 4608) @@ -26,7 +26,6 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersist= edValueData; import org.exoplatform.services.jcr.util.IdGenerator; = -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; = @@ -74,14 +73,16 @@ = if (streamed.getFile() =3D=3D null && vd instanceof StreamPersist= edValueData) { - in =3D PrivilegedFileHelper.fileInputStream(((StreamPersistedV= alueData)vd).getTempFile()); + if (((StreamPersistedValueData)vd).getTempFile() !=3D null) + { + in =3D PrivilegedFileHelper.fileInputStream(((StreamPersist= edValueData)vd).getTempFile()); + } } else { in =3D streamed.getAsStream(); } = - // TODO optimize it, use channels if (streamed.getFile() instanceof SerializationSpoolFile) { SerializationSpoolFile ssf =3D (SerializationSpoolFile)streame= d.getFile(); @@ -94,17 +95,27 @@ String id =3D IdGenerator.generate(); out.writeString(id); = - out.writeLong(vd.getLength()); - try + if (in =3D=3D null) { - byte[] buf =3D new byte[SerializationConstants.INTERNAL_BUF= FER_SIZE]; - int l =3D 0; - while ((l =3D in.read(buf)) >=3D 0) - out.write(buf, 0, l); + // Deleted state usecase + out.writeLong(SerializationConstants.NULL_FILE); } - finally + else { - in.close(); + out.writeLong(vd.getLength()); + try + { + byte[] buf =3D new byte[SerializationConstants.INTERNAL_= BUFFER_SIZE]; + int l =3D 0; + while ((l =3D in.read(buf)) >=3D 0) + { + out.write(buf, 0, l); + } + } + finally + { + in.close(); + } } } } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/JcrImplSerializationBaseTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/serialization/JcrImplSerializationBaseTest.java 2011-07-= 06 14:14:54 UTC (rev 4607) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/JcrImplSerializationBaseTest.java 2011-07-= 07 08:29:27 UTC (rev 4608) @@ -18,10 +18,21 @@ */ package org.exoplatform.services.jcr.impl.dataflow.serialization; = +import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; +import org.exoplatform.services.jcr.dataflow.ItemState; +import org.exoplatform.services.jcr.dataflow.PlainChangesLog; +import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; +import org.exoplatform.services.jcr.dataflow.serialization.UnknownClassIdE= xception; +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.dataflow.persistent.FilePersisted= ValueData; +import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersist= edValueData; + import java.io.EOFException; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -35,19 +46,6 @@ import java.util.Iterator; import java.util.List; = -import org.exoplatform.services.jcr.JcrImplBaseTest; -import org.exoplatform.services.jcr.dataflow.ChangesLogIterator; -import org.exoplatform.services.jcr.dataflow.ItemState; -import org.exoplatform.services.jcr.dataflow.PlainChangesLog; -import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; -import org.exoplatform.services.jcr.dataflow.serialization.UnknownClassIdE= xception; -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.dataflow.persistent.StreamPersist= edValueData; -import org.exoplatform.services.jcr.impl.storage.value.fs.operations.Value= FileIOHelper; -import org.exoplatform.services.jcr.storage.value.ValueIOChannel; - /** * Created by The eXo Platform SAS.
Date: 16.02.2009 * = @@ -86,14 +84,43 @@ = List expValDat =3D expProp.getValues(); List elemValDat =3D elemProp.getValues(); - assertEquals(expValDat.size(), elemValDat.size()); - for (int j =3D 0; j < expValDat.size(); j++) + // Both value data are null = + if (expValDat !=3D null && elemValDat !=3D null) { - assertTrue(java.util.Arrays - .equals(expValDat.get(j).getAsByteArray(), elemValDat.ge= t(j).getAsByteArray())); + assertEquals(expValDat.size(), elemValDat.size()); + for (int j =3D 0; j < expValDat.size(); j++) + { = - // check is received property values ReplicableValueData - // assertTrue(elemValDat.get(j) instanceof ReplicableValueD= ata); + // are of the same class + assertEquals(expValDat.get(j).getClass(), elemValDat.get= (j).getClass()); + // + if (expValDat.get(j) instanceof FilePersistedValueData) + { + // if files in both instances are null + Boolean nullFiles =3D + ((FilePersistedValueData)expValDat.get(j)).getFile= () =3D=3D null + && ((FilePersistedValueData)elemValDat.get(j)).= getFile() =3D=3D null; + // if there are instances of StreamPersistedValueData + if (expValDat.get(j) instanceof StreamPersistedValueD= ata) + { + // and they both have null spool files + nullFiles &=3D + ((StreamPersistedValueData)expValDat.get(j)).ge= tTempFile() =3D=3D null + && ((StreamPersistedValueData)elemValDat.get= (j)).getTempFile() =3D=3D null; + } + if (nullFiles) + { + // Both value data are equals + continue; + } + } + + assertTrue(java.util.Arrays.equals(expValDat.get(j).getA= sByteArray(), elemValDat.get(j) + .getAsByteArray())); + + // check is received property values ReplicableValueData + // assertTrue(elemValDat.get(j) instanceof ReplicableVal= ueData); + } } } } @@ -101,6 +128,20 @@ = } = + protected void checkResults(List srcLog) throws = Exception + { + File jcrfile =3D serializeLogs(srcLog); + + List destLog =3D deSerializeLogs(jcrfile); + + assertEquals(srcLog.size(), destLog.size()); + + for (int i =3D 0; i < srcLog.size(); i++) + { + checkIterator(srcLog.get(i).getAllStates().iterator(), destLog.ge= t(i).getAllStates().iterator()); + } + } + protected File serializeLogs(List logs) throws I= OException, UnknownClassIdException { File jcrfile =3D File.createTempFile("jcr", "test"); @@ -129,7 +170,7 @@ while (true) { TransactionChangesLog obj =3D - (TransactionChangesLog)(new TransactionChangesLogReader(fil= eCleaner, maxBufferSize, holder)).read(jcrin); + (new TransactionChangesLogReader(fileCleaner, maxBufferSize= , holder)).read(jcrin); // TransactionChangesLog obj =3D new TransactionChangesLog(); // obj.readObject(jcrin); readed.add(obj); @@ -139,8 +180,7 @@ { // ok } - = - = + //Imitation of save. imitationSave(readed); = @@ -159,35 +199,41 @@ for (TransactionChangesLog tLog : readed) { ChangesLogIterator it =3D tLog.getLogIterator(); - = - while (it.hasNextLog()) = + + while (it.hasNextLog()) { PlainChangesLog pLog =3D it.nextLog(); - = + for (ItemState state : pLog.getAllStates()) { ItemData itemData =3D state.getData(); - = + if (!itemData.isNode()) { PropertyData propData =3D (PropertyData)itemData; - = - for(ValueData valueData : propData.getValues()) + if (propData.getValues() !=3D null) { - if (valueData instanceof StreamPersistedValueData) { - // imitation of JCR save - if (((StreamPersistedValueData) valueData).getTemp= File() !=3D null) + for (ValueData valueData : propData.getValues()) + { + if (valueData instanceof StreamPersistedValueData) { - ((StreamPersistedValueData) valueData).setPersist= edFile(((StreamPersistedValueData) valueData).getTempFile()); + // imitation of JCR save + if (((StreamPersistedValueData)valueData).getTe= mpFile() !=3D null) + { + ((StreamPersistedValueData)valueData) + .setPersistedFile(((StreamPersistedValueD= ata)valueData).getTempFile()); + } + else + { + File file =3D File.createTempFile("tempFile"= , "tmp"); + file.deleteOnExit(); + if (((StreamPersistedValueData)valueData).ge= tStream() !=3D null) + { + copy(((StreamPersistedValueData)valueData= ).getStream(), new FileOutputStream(file)); + ((StreamPersistedValueData)valueData).set= PersistedFile(file); + } + } } - else - { - File file =3D File.createTempFile("tempFile", "= tmp"); - file.deleteOnExit(); - = - copy(((StreamPersistedValueData) valueData).get= Stream(), new FileOutputStream(file)); - ((StreamPersistedValueData) valueData).setPersi= stedFile(file); - } } } } @@ -195,7 +241,7 @@ } } } - = + protected long copy(InputStream in, OutputStream out) throws IOException { // compare classes as in Java6 Channels.newChannel(), Java5 has a bu= g in newChannel(). @@ -243,7 +289,9 @@ } = if (outFile) + { ((FileChannel)outch).force(true); // force all data to FS + } = return size; } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/TestJCRSerializationStream.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/serialization/TestJCRSerializationStream.java 2011-07-06= 14:14:54 UTC (rev 4607) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/TestJCRSerializationStream.java 2011-07-07= 08:29:27 UTC (rev 4608) @@ -18,12 +18,9 @@ */ package org.exoplatform.services.jcr.impl.dataflow.serialization; = -import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; - import java.io.File; import java.io.FileInputStream; import java.util.Calendar; -import java.util.List; = import javax.jcr.Node; import javax.jcr.Value; @@ -54,6 +51,7 @@ contentNode.setProperty("jcr:mimeType", "application/octet-stream"); contentNode.setProperty("jcr:lastModified", session.getValueFactory(= ).createValue(Calendar.getInstance())); session.save(); + checkResults(pl.getAndReset()); = test.setProperty("creator", new String[]{"Creator 1", "Creator 2", "= Creator 3"}); = @@ -67,21 +65,15 @@ test.setProperty("language", new String[]{"language 1", "language 2"= , "language3", "language 4", "language5"}); = session.save(); + checkResults(pl.getAndReset()); = // delete Node srcParent =3D test.getParent(); srcParent.remove(); session.save(); = - List srcLog =3D pl.pushChanges(); - - File jcrfile =3D super.serializeLogs(srcLog); - - List destLog =3D super.deSerializeLogs(jcrfil= e); - - assertEquals(srcLog.size(), destLog.size()); - - for (int i =3D 0; i < srcLog.size(); i++) - checkIterator(srcLog.get(i).getAllStates().iterator(), destLog.ge= t(i).getAllStates().iterator()); + checkResults(pl.getAndReset()); + // unregister listener + pl.pushChanges(); } } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/TestJCRSerializationVersionRestore.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/test/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/TestJCRSerializationVersionRestore.java 20= 11-07-06 14:14:54 UTC (rev 4607) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/TestJCRSerializationVersionRestore.java 20= 11-07-07 08:29:27 UTC (rev 4608) @@ -18,13 +18,10 @@ */ package org.exoplatform.services.jcr.impl.dataflow.serialization; = -import org.exoplatform.services.jcr.dataflow.TransactionChangesLog; - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.Calendar; -import java.util.List; = import javax.jcr.Node; import javax.jcr.version.Version; @@ -49,24 +46,36 @@ srcVersionNode.addMixin("mix:versionable"); session.save(); = + checkResults(pl.getAndReset()); + srcVersionNode.checkin(); session.save(); = + checkResults(pl.getAndReset()); + srcVersionNode.checkout(); srcVersionNode.setProperty("jcr:data", "version 1"); session.save(); = + checkResults(pl.getAndReset()); + srcVersionNode.checkin(); session.save(); = + checkResults(pl.getAndReset()); + srcVersionNode.checkout(); srcVersionNode.setProperty("jcr:data", "version 2"); session.save(); = + checkResults(pl.getAndReset()); + Version baseVersion =3D srcVersionNode.getBaseVersion(); srcVersionNode.restore(baseVersion, true); session.save(); = + checkResults(pl.getAndReset()); + Version baseVersion1 =3D srcVersionNode.getBaseVersion(); Version[] predesessors =3D baseVersion1.getPredecessors(); Version restoreToBaseVersion =3D predesessors[0]; @@ -74,21 +83,15 @@ srcVersionNode.restore(restoreToBaseVersion, true); session.save(); = - List srcLog =3D pl.pushChanges(); - - File jcrfile =3D super.serializeLogs(srcLog); - - List destLog =3D super.deSerializeLogs(jcrfil= e); - - assertEquals(srcLog.size(), destLog.size()); - - for (int i =3D 0; i < srcLog.size(); i++) - checkIterator(srcLog.get(i).getAllStates().iterator(), destLog.ge= t(i).getAllStates().iterator()); + checkResults(pl.getAndReset()); + // unregister listener + pl.pushChanges(); } = public void testBigFileRestore() throws Exception { TesterItemsPersistenceListener pl =3D new TesterItemsPersistenceList= ener(this.session); + //List srcLog =3D new ArrayList(); = File tempFile =3D File.createTempFile("tempFile", "doc"); File tempFile2 =3D File.createTempFile("tempFile", "doc"); @@ -129,25 +132,37 @@ = session.save(); = + checkResults(pl.getAndReset()); + Node srcVersion =3D root.getNode("nt_file_node"); srcVersion.checkin(); session.save(); = + checkResults(pl.getAndReset()); + srcVersion.checkout(); srcVersionNode.getNode("jcr:content").setProperty("jcr:data", new Fi= leInputStream(tempFile2)); session.save(); = + checkResults(pl.getAndReset()); + srcVersion.checkin(); session.save(); = + checkResults(pl.getAndReset()); + srcVersion.checkout(); srcVersionNode.getNode("jcr:content").setProperty("jcr:data", new Fi= leInputStream(tempFile3)); session.save(); = + checkResults(pl.getAndReset()); + Version baseVersion =3D srcVersion.getBaseVersion(); srcVersion.restore(baseVersion, true); session.save(); = + checkResults(pl.getAndReset()); + Version baseVersion1 =3D srcVersion.getBaseVersion(); Version[] predesessors =3D baseVersion1.getPredecessors(); Version restoreToBaseVersion =3D predesessors[0]; @@ -155,6 +170,8 @@ srcVersion.restore(restoreToBaseVersion, true); session.save(); = + checkResults(pl.getAndReset()); + Version baseVersion2 =3D srcVersion.getBaseVersion(); Version[] predesessors2 =3D baseVersion2.getSuccessors(); Version restoreToBaseVersion_2 =3D predesessors2[0]; @@ -162,16 +179,9 @@ srcVersion.restore(restoreToBaseVersion_2, true); session.save(); = - List srcLog =3D pl.pushChanges(); - - File jcrfile =3D super.serializeLogs(srcLog); - - List destLog =3D super.deSerializeLogs(jcrfil= e); - - assertEquals(srcLog.size(), destLog.size()); - - for (int i =3D 0; i < srcLog.size(); i++) - checkIterator(srcLog.get(i).getAllStates().iterator(), destLog.ge= t(i).getAllStates().iterator()); + checkResults(pl.getAndReset()); + // unregister listener + pl.pushChanges(); } = } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/TesterItemsPersistenceListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/serialization/TesterItemsPersistenceListener.java 2011-0= 7-06 14:14:54 UTC (rev 4607) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/TesterItemsPersistenceListener.java 2011-0= 7-07 08:29:27 UTC (rev 4608) @@ -70,6 +70,18 @@ return logsList; } = + /** + * Returns collected changes and resets listener without unregistering + * + * @return List of TransactionChangesLog + */ + public List getAndReset() + { + List logs =3D new ArrayList(logsList); + logsList.clear(); + return logs; + } + public List getCurrentLogList() { return logsList; --===============8496467376097062845==-- From do-not-reply at jboss.org Thu Jul 7 05:08:14 2011 Content-Type: multipart/mixed; boundary="===============1073527387354981479==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4609 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query: jbosscache and 1 other directory. Date: Thu, 07 Jul 2011 05:08:14 -0400 Message-ID: <201107070908.p6798EYt012682@svn01.web.mwc.hst.phx2.redhat.com> --===============1073527387354981479== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-07 05:08:13 -0400 (Thu, 07 Jul 2011) New Revision: 4609 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/IndexerChangesFilter.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/SearchManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java Log: EXOJCR-1068 : fixed JBossCache MBeans unregistration for Indexer. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/IndexerChangesFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/IndexerChangesFilter.java 2011-07-07 08:29:27 UTC (rev= 4608) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/IndexerChangesFilter.java 2011-07-07 09:08:13 UTC (rev= 4609) @@ -161,6 +161,13 @@ } = /** + * Frees resources associated with changes filter + */ + public void close() + { + } + + /** * @param removedNodes * @param addedNodes * @param updatedNodes @@ -245,7 +252,7 @@ { return log; } - = + protected void logErrorChanges(QueryHandler logHandler, Set rem= ovedNodes, Set addedNodes) { try Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/SearchManager.java 2011-07-07 08:29:27 UTC (rev 4608) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/SearchManager.java 2011-07-07 09:08:13 UTC (rev 4609) @@ -621,6 +621,11 @@ public void stop() { handler.close(); + // ChangesFiler instance is one for both SearchManagers and close() = must be invoked only once, = + if (parentSearchManager !=3D null) + { + changesFilter.close(); + } log.info("Search manager stopped"); } = 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 2011-07-0= 7 08:29:27 UTC (rev 4608) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/jbosscache/JBossCacheIndexChangesFilter.java 2011-07-0= 7 09:08:13 UTC (rev 4609) @@ -202,11 +202,11 @@ return true; } = - /** - * @see java.lang.Object#finalize() + /** + * {@inheritDoc} */ @Override - protected void finalize() throws Throwable + public void close() { try { @@ -222,9 +222,8 @@ }); } } - finally - { - super.finalize(); = + catch (Exception e) { + log.warn("Not all JBoss Cache MBeans were unregistered."); } } = } --===============1073527387354981479==-- From do-not-reply at jboss.org Thu Jul 7 05:19:32 2011 Content-Type: multipart/mixed; boundary="===============0320538551838270861==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4610 - kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container. Date: Thu, 07 Jul 2011 05:19:32 -0400 Message-ID: <201107070919.p679JWTn013508@svn01.web.mwc.hst.phx2.redhat.com> --===============0320538551838270861== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-07 05:19:32 -0400 (Thu, 07 Jul 2011) New Revision: 4610 Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/containe= r/ExoContainer.java Log: EXOJCR-1396: unregister all components from Repository/Workspace container= after stop Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/c= ontainer/ExoContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ExoContainer.java 2011-07-07 09:08:13 UTC (rev 4609) +++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/contain= er/ExoContainer.java 2011-07-07 09:19:32 UTC (rev 4610) @@ -29,12 +29,14 @@ import org.exoplatform.container.xml.InitParams; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; +import org.picocontainer.ComponentAdapter; import org.picocontainer.PicoContainer; import org.picocontainer.defaults.ComponentAdapterFactory; = import java.lang.reflect.Constructor; import java.security.PrivilegedAction; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -426,4 +428,16 @@ ConfigurationManager cm =3D (ConfigurationManager)getComponentInstan= ceOfType(ConfigurationManager.class); return cm =3D=3D null ? null : cm.getConfiguration(); } + + /** + * Unregister all components from container to avoid keeping instances = in memory. + */ + protected void unregisterAllComponents() + { + Collection adapters =3D getComponentAdapters(); + for (ComponentAdapter adapter : adapters) + { + unregisterComponent(adapter.getComponentKey()); + } + } } --===============0320538551838270861==-- From do-not-reply at jboss.org Thu Jul 7 05:20:08 2011 Content-Type: multipart/mixed; boundary="===============7971953205888022206==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4611 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl. Date: Thu, 07 Jul 2011 05:20:07 -0400 Message-ID: <201107070920.p679K7dm013755@svn01.web.mwc.hst.phx2.redhat.com> --===============7971953205888022206== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-07 05:20:07 -0400 (Thu, 07 Jul 2011) New Revision: 4611 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/WorkspaceContainer.java Log: EXOJCR-1396: unregister all components from Repository/Workspace container= after stop 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 2011-07-07 09:19:32 UTC (rev 4610) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryContainer.java 2011-07-07 09:20:07 UTC (rev 4611) @@ -499,6 +499,16 @@ } = /** + * {@inheritDoc} + */ + @Override + public synchronized void stop() + { + super.stop(); + super.unregisterAllComponents(); + } + + /** * Initialize worspaces (root node and jcr:system for system workspace). *

* Runs on container start. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/WorkspaceContainer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/WorkspaceContainer.java 2011-07-07 09:19:32 UTC (rev 4610) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/WorkspaceContainer.java 2011-07-07 09:20:07 UTC (rev 4611) @@ -93,4 +93,13 @@ return (WorkspaceInitializer)getComponentInstanceOfType(WorkspaceIni= tializer.class); } = + /** + * {@inheritDoc} + */ + @Override + public synchronized void stop() + { + super.stop(); + super.unregisterAllComponents(); + } } --===============7971953205888022206==-- From do-not-reply at jboss.org Thu Jul 7 08:49:30 2011 Content-Type: multipart/mixed; boundary="===============3520243283180048932==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4612 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: ext/action and 1 other directory. Date: Thu, 07 Jul 2011 08:49:29 -0400 Message-ID: <201107071249.p67CnTbQ020557@svn01.web.mwc.hst.phx2.redhat.com> --===============3520243283180048932== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-07 08:49:29 -0400 (Thu, 07 Jul 2011) New Revision: 4612 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/ItemImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/ext/action/SessionActionInterceptor.java Log: EXOJCR-1408: added parent NodeData to postSetProperty method to avoid extra= parent traversing Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/ItemImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/ItemImpl.java 2011-07-07 09:20:07 UTC (rev 4611) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/ItemImpl.java 2011-07-07 12:49:29 UTC (rev 4612) @@ -603,7 +603,7 @@ prop =3D (PropertyImpl)dataManager.update(itemState, true); = // launch event: post-set = - session.getActionHandler().postSetProperty(prevProperty, prop, st= ate); + session.getActionHandler().postSetProperty(prevProperty, prop, pa= rentNode.nodeData(), state); } else { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/ext/action/SessionActionInterceptor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ext/action/SessionActionInterceptor.java 2011-07-07 09:20:07 UTC = (rev 4611) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/ext/action/SessionActionInterceptor.java 2011-07-07 12:49:29 UTC = (rev 4612) @@ -257,7 +257,7 @@ } } = - public void postSetProperty(PropertyImpl previousProperty, PropertyImpl= currentProperty, int state) + public void postSetProperty(PropertyImpl previousProperty, PropertyImpl= currentProperty, NodeData parent, int state) throws RepositoryException { if (catalog =3D=3D null) @@ -289,7 +289,7 @@ Condition conditions =3D new Condition(); conditions.put(SessionEventMatcher.EVENTTYPE_KEY, event); conditions.put(SessionEventMatcher.PATH_KEY, currentProperty.getI= nternalPath()); - conditions.put(SessionEventMatcher.NODETYPES_KEY, readNodeTypeNam= es(currentProperty.parentData())); + conditions.put(SessionEventMatcher.NODETYPES_KEY, readNodeTypeNam= es(parent)); = InvocationContext ctx =3D new InvocationContext(); ctx.put(InvocationContext.CURRENT_ITEM, currentProperty); --===============3520243283180048932==-- From do-not-reply at jboss.org Fri Jul 8 00:01:55 2011 Content-Type: multipart/mixed; boundary="===============3766990915096333399==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4613 - in jcr/branches/1.12.x: patch/1.12.10-GA/JCR-1639 and 1 other directory. Date: Fri, 08 Jul 2011 00:01:55 -0400 Message-ID: <201107080401.p6841t2S014016@svn01.web.mwc.hst.phx2.redhat.com> --===============3766990915096333399== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: paristote Date: 2011-07-08 00:01:54 -0400 (Fri, 08 Jul 2011) New Revision: 4613 Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1639/readme.txt Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform= /services/jcr/impl/storage/jdbc/JDBCStorageConnection.java Log: JCR-1639 What is the problem to fix? * Delay in replication of Nodes data in JBoss EPP How is the problem fixed? * Need to rollback JDBC connection before closing. Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exop= latform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-07-07 12:4= 9:29 UTC (rev 4612) +++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatfor= m/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-07-08 04:0= 1:54 UTC (rev 4613) @@ -373,12 +373,17 @@ { closeStatements(); = - // If READ-ONLY status back it to READ-WRITE (we assume it was or= iginal state) + // If READ-ONLY status back it to READ-WRITE (we assume it was or= iginal state) = if (readOnly) { dbConnection.setReadOnly(true); } = + if (dbConnection.getTransactionIsolation() > Connection.TRANSACTI= ON_READ_COMMITTED) + { + dbConnection.rollback(); + } + dbConnection.close(); } catch (SQLException e) Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1639/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/branches/1.12.x/patch/1.12.10-GA/JCR-1639/readme.txt = (rev 0) +++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1639/readme.txt 2011-07-08 04:= 01:54 UTC (rev 4613) @@ -0,0 +1,72 @@ +Summary + + Status: Delay in replication of Nodes data in JBoss EPP + CCP Issue: CCP-984, Product Jira Issue: JCR-1639. + Complexity: High + +The Proposal +Problem description + +What is the problem to fix? + + Delay in replication of Nodes data in JBoss EPP + +Fix description + +How is the problem fixed? + + * Need to rollback JDBC connection before closing. = + +Patch information: +JCR-1639.patch + +Tests to perform + +Reproduction test + + A folder was created with the name 00480017, and a document inside it = named 00480017-test1 + After few seconds, the folder just disappeared. We tried to access it = using its full path /00480017 but, it wasn't there anymore. Message that th= e folder doesn't exist or something like that. + Then, we tried to create a new folder with the name name of the previo= us, then we got a "Can not save. This node doesn't allow 2 nodes with the s= ame name" message. + After ~15 minutes, the folder appeared again. + +Tests performed at DevLevel + * Functional testing, manual testing in customer env. + +Tests performed at QA/Support Level +* + +Documentation changes + +Documentation changes: + * No + +Configuration changes + +Configuration changes: + * No + +Will previous configuration continue to work? + * Yes + +Risks and impacts + +Can this bug fix have any side effects on current client projects? + + No + +Is there a performance risk/cost? + * it is possible a bit perf decreasion on MySQL with InnoDB engine. See = QA reports (two last columns) http://tests.exoplatform.org/JCR/1.12.10-GA/r= ev.4553/daily-performance-testing-results_TESTUKR-260/jcr.core/index.html&n= bsp; + +Validation (PM/Support/QA) + +PM Comment + + Patch approved by the PL + +Support Comment + + Support review: Patch validated + +QA Feedbacks +* + --===============3766990915096333399==-- From do-not-reply at jboss.org Fri Jul 8 04:01:54 2011 Content-Type: multipart/mixed; boundary="===============4880822258588764241==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4614 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: util/io and 1 other directory. Date: Fri, 08 Jul 2011 04:01:54 -0400 Message-ID: <201107080801.p6881sn4029682@svn01.web.mwc.hst.phx2.redhat.com> --===============4880822258588764241== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2011-07-08 04:01:53 -0400 (Fri, 08 Jul 2011) New Revision: 4614 Modified: 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/util/io/DirectoryHelper.java Log: EXOJCR-1132 : The problem with backup configuration in RepositoryServiceCon= figurationImpl.retain() on OS Windows was fixed. 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 2011-07-08 04:01:5= 4 UTC (rev 4613) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/config/RepositoryServiceConfigurationImpl.java 2011-07-08 08:01:5= 3 UTC (rev 4614) @@ -26,6 +26,7 @@ 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.DirectoryHelper; import org.exoplatform.services.naming.InitialContextInitializer; import org.jibx.runtime.BindingDirectory; import org.jibx.runtime.IBindingFactory; @@ -175,9 +176,16 @@ File sourceConfig =3D new File(filePath.toURI()); SimpleDateFormat format =3D new SimpleDateFormat("yyyyMMddHHmm= "); File backUp =3D new File(sourceConfig.getAbsoluteFile() + "_" = + format.format(new Date())); - if (!PrivilegedFileHelper.renameTo(sourceConfig, backUp)) + try + { + DirectoryHelper.renameFile(sourceConfig, backUp); + } + catch (IOException ioe) + { throw new RepositoryException("Can't back up configuration = on path " - + PrivilegedFileHelper.getAbsolutePath(sourceConfig)); + + PrivilegedFileHelper.getAbsolutePath(sourceConfi= g), ioe); + } + saveStream =3D PrivilegedFileHelper.fileOutputStream(sourceCon= fig); } = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/util/io/DirectoryHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/DirectoryHelper.java 2011-07-08 04:01:54 UTC (rev 4613) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/io/DirectoryHelper.java 2011-07-08 08:01:53 UTC (rev 4614) @@ -288,4 +288,73 @@ } } } + + /** + * Rename file. + * = + * @param srcFile + * source file + * @param dstFile + * destination file = + * @throws IOException + * if any exception occurred = + */ + public static synchronized void renameFile(File srcFile, File dstFile) = throws IOException + { + /* This is not atomic. If the program crashes between the call to + delete() and the call to renameTo() then we're screwed, but I've + been unable to figure out how else to do this... */ + + if (PrivilegedFileHelper.exists(dstFile)) + if (!PrivilegedFileHelper.delete(dstFile)) + throw new IOException("Cannot delete " + dstFile); + + // Rename the srcFile file to the new one. Unfortunately, the rename= To() + // method does not work reliably under some JVMs. Therefore, if the + // rename fails, we manually rename by copying the srcFile file to t= he new one + if (!PrivilegedFileHelper.renameTo(srcFile, dstFile)) + { + java.io.InputStream in =3D null; + java.io.OutputStream out =3D null; + byte buffer[] =3D null; + try + { + in =3D PrivilegedFileHelper.fileInputStream(srcFile); + out =3D PrivilegedFileHelper.fileOutputStream(dstFile); + // see if the buffer needs to be initialized. Initialization is + // only done on-demand since many VM's will never run into the= renameTo + // bug and hence shouldn't waste 1K of mem for no reason. + if (buffer =3D=3D null) + { + buffer =3D new byte[1024]; + } + int len; + while ((len =3D in.read(buffer)) >=3D 0) + { + out.write(buffer, 0, len); + } + + // delete the srcFile file. + PrivilegedFileHelper.delete(srcFile); + } + catch (IOException ioe) + { + IOException newExc =3D new IOException("Cannot rename " + srcF= ile + " to " + dstFile); + newExc.initCause(ioe); + throw newExc; + } + finally + { + if (in !=3D null) + { + in.close(); + } + + if (out !=3D null) + { + out.close(); + } + } + } + } } --===============4880822258588764241==-- From do-not-reply at jboss.org Fri Jul 8 07:31:31 2011 Content-Type: multipart/mixed; boundary="===============4970637218067862149==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4615 - jcr/trunk/applications/product-patches/as/jboss/ds. Date: Fri, 08 Jul 2011 07:31:31 -0400 Message-ID: <201107081131.p68BVVTo004539@svn01.web.mwc.hst.phx2.redhat.com> --===============4970637218067862149== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-08 07:31:30 -0400 (Fri, 08 Jul 2011) New Revision: 4615 Modified: jcr/trunk/applications/product-patches/as/jboss/ds/jcr-ds.xml Log: EXOJCR-1435: fix rar name Modified: jcr/trunk/applications/product-patches/as/jboss/ds/jcr-ds.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/product-patches/as/jboss/ds/jcr-ds.xml 2011-07-0= 8 08:01:53 UTC (rev 4614) +++ jcr/trunk/applications/product-patches/as/jboss/ds/jcr-ds.xml 2011-07-0= 8 11:31:30 UTC (rev 4615) @@ -8,7 +8,7 @@ = = - exo.jcr.ear.ear#exo-jcr.rar + exo-jcr-ear.ear#exo-jcr.rar = eXo JCR Adapter org.exoplatform.connectors.jcr.adapter.SessionF= actory --===============4970637218067862149==-- From do-not-reply at jboss.org Tue Jul 12 10:45:12 2011 Content-Type: multipart/mixed; boundary="===============4161606495322216924==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4616 - in kernel/trunk/exo.kernel.component.common/src: test/java/org/exoplatform/services/naming and 1 other directories. Date: Tue, 12 Jul 2011 10:45:11 -0400 Message-ID: <201107121445.p6CEjBQj027720@svn01.web.mwc.hst.phx2.redhat.com> --===============4161606495322216924== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-12 10:45:11 -0400 (Tue, 12 Jul 2011) New Revision: 4616 Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/ExoContainerContextFactory.java Modified: 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/naming/SimpleContext.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-1416: Get rid of any call to InitialContextInitializer.recall() Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/naming/ExoContainerContextFactory.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ExoContainerContextFactory.java (re= v 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/ExoContainerContextFactory.java 2011-07-12 14:45:11 UTC (re= v 4616) @@ -0,0 +1,529 @@ +/* + * Copyright (C) 2011 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.naming; + +import org.exoplatform.container.ExoContainer; +import org.exoplatform.container.ExoContainerContext; + +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +import javax.naming.Binding; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.Name; +import javax.naming.NameClassPair; +import javax.naming.NameParser; +import javax.naming.NamingEnumeration; +import javax.naming.NamingException; +import javax.naming.spi.InitialContextFactory; + +/** + * This implementation of {@link InitialContextFactory} is used to be able= to share + * all the objects that have been binded thanks to the {@link InitialConte= xtInitializer} + * which is required for example to be able to create and bind data source= s dynamically + * = + * @author Nicolas Filotto + * @version $Id$ + * + */ +public class ExoContainerContextFactory implements InitialContextFactory +{ + + /** + * {@inheritDoc} + */ + public Context getInitialContext(Hashtable environment) throws Na= mingException + { + return new ExoContainerCtx(environment); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + private static class ExoContainerCtx extends SimpleContext + { + + /** + * The map containing all the bindings for all the containers defined + */ + private static volatile Map>> ALL_BINDINGS =3D + new HashMap>>(); + + /** + * The environment to use in case we cannot find the object + */ + private final Hashtable env; + + /** + * The current eXo container + */ + private final ExoContainer container; + + /** + * The nested context + */ + private InitialContext ctx; + + /** + * The reference to the bindings corresponding to this context; + */ + private AtomicReference> bindingsRef; + = + public ExoContainerCtx(Hashtable env) + { + this.env =3D env =3D=3D null ? null : (Hashtable)env.clone(); + this.container =3D ExoContainerContext.getCurrentContainerIfPrese= nt(); + if (container !=3D null) + { + AtomicReference> ref =3D ALL_BINDINGS.get(= container); + if (ref =3D=3D null) + { + synchronized (ExoContainerCtx.class) + { + if (ref =3D=3D null) + { + Map= >> tempAllBindings =3D + new HashMap>>(ALL_BINDINGS); + tempAllBindings.put(container, ref =3D + new AtomicReference>(new HashM= ap())); + ALL_BINDINGS =3D tempAllBindings; + } + } + } + this.bindingsRef =3D ref; + } + } + + protected Map getBindings() + { + return bindingsRef.get(); + } + + protected void setBindings(Map bindings) + { + bindingsRef.set(bindings); + } + + private InitialContext getContext() throws NamingException + { + if (ctx =3D=3D null) + { + Hashtable env; + if (this.env =3D=3D null) + { + env =3D new Hashtable(); + } + else + { + env =3D new Hashtable(this.env); + } + env.put(Context.INITIAL_CONTEXT_FACTORY, InitialContextInitial= izer.DEFAULT_INITIAL_CONTEXT_FACTORY); + env.remove(InitialContextInitializer.class.getName()); + ctx =3D new InitialContext(env); + } + return ctx; + } + + private boolean isInitialContextInitializerCall() + { + return container !=3D null && env !=3D null && env.containsKey(In= itialContextInitializer.class.getName()); + } + + /** + * {@inheritDoc} + */ + public Object lookup(String name) throws NamingException + { + if (getBindings().containsKey(name) || isInitialContextInitialize= rCall()) + { + return super.lookup(name); + } + return getContext().lookup(name); + } + + /** + * {@inheritDoc} + */ + public Object lookup(Name name) throws NamingException + { + if (getBindings().containsKey(name) || isInitialContextInitialize= rCall()) + { + return super.lookup(nameToString(name)); + } + return getContext().lookup(name); + } + + /** + * {@inheritDoc} + */ + public void bind(String name, Object value) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.bind(name, value); + return; + } + getContext().bind(name, value); + } + + /** + * {@inheritDoc} + */ + public void bind(Name name, Object value) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.bind(nameToString(name), value); + return; + } + getContext().bind(name, value); + } + + /** + * {@inheritDoc} + */ + public void rebind(String name, Object value) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.rebind(name, value); + return; + } + getContext().rebind(name, value); + } + + /** + * {@inheritDoc} + */ + public void rebind(Name name, Object value) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.rebind(nameToString(name), value); + return; + } + getContext().rebind(name, value); + } + + /** + * {@inheritDoc} + */ + public void unbind(String name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.unbind(name); + return; + } + getContext().unbind(name); + } + + /** + * {@inheritDoc} + */ + public void unbind(Name name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.unbind(nameToString(name)); + return; + } + getContext().unbind(name); + } + + /** + * {@inheritDoc} + */ + public void rename(String name1, String name2) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.rename(name1, name2); + return; + } + getContext().rename(name1, name2); + } + + /** + * {@inheritDoc} + */ + public void rename(Name name1, Name name2) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.rename(nameToString(name1), nameToString(name2)); + return; + } + getContext().rename(name1, name2); + } + + /** + * {@inheritDoc} + */ + public NamingEnumeration list(Name name) throws Namin= gException + { + if (isInitialContextInitializerCall()) + { + return super.list(name); + } + return getContext().list(name); + } + + /** + * {@inheritDoc} + */ + public NamingEnumeration list(String name) throws Nam= ingException + { + if (isInitialContextInitializerCall()) + { + return super.list(name); + } + return getContext().list(name); + } + + /** + * {@inheritDoc} + */ + public NamingEnumeration listBindings(Name name) throws Nam= ingException + { + if (isInitialContextInitializerCall()) + { + return super.listBindings(name); + } + return getContext().listBindings(name); + } + + /** + * {@inheritDoc} + */ + public NamingEnumeration listBindings(String name) throws N= amingException + { + if (isInitialContextInitializerCall()) + { + return super.listBindings(name); + } + return getContext().listBindings(name); + } + + /** + * {@inheritDoc} + */ + public void destroySubcontext(Name name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.destroySubcontext(name); + return; + } + getContext().destroySubcontext(name); + } + + /** + * {@inheritDoc} + */ + public void destroySubcontext(String name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + super.destroySubcontext(name); + return; + } + getContext().destroySubcontext(name); + } + + /** + * {@inheritDoc} + */ + public Context createSubcontext(Name name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.createSubcontext(name); + } + return getContext().createSubcontext(name); + } + + /** + * {@inheritDoc} + */ + public Context createSubcontext(String name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.createSubcontext(name); + } + return getContext().createSubcontext(name); + } + + /** + * {@inheritDoc} + */ + public Object lookupLink(Name name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.lookupLink(name); + } + return getContext().lookupLink(name); + } + + /** + * {@inheritDoc} + */ + public Object lookupLink(String name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.lookupLink(name); + } + return getContext().lookupLink(name); + } + + /** + * {@inheritDoc} + */ + public NameParser getNameParser(Name name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.getNameParser(name); + } + return getContext().getNameParser(name); + } + + /** + * {@inheritDoc} + */ + public NameParser getNameParser(String name) throws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.getNameParser(name); + } + return getContext().getNameParser(name); + } + + /** + * {@inheritDoc} + */ + public Name composeName(Name name, Name prefix) throws NamingExcepti= on + { + if (isInitialContextInitializerCall()) + { + return super.composeName(name, prefix); + } + return getContext().composeName(name, prefix); + } + + /** + * {@inheritDoc} + */ + public String composeName(String name, String prefix) throws NamingE= xception + { + if (isInitialContextInitializerCall()) + { + return super.composeName(name, prefix); + } + return getContext().composeName(name, prefix); + } + + /** + * {@inheritDoc} + */ + public Object addToEnvironment(String propName, Object propVal) thro= ws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.addToEnvironment(propName, propVal); + } + return getContext().addToEnvironment(propName, propVal); + } + + /** + * {@inheritDoc} + */ + public Object removeFromEnvironment(String propName) throws NamingEx= ception + { + if (isInitialContextInitializerCall()) + { + return super.removeFromEnvironment(propName); + } + return getContext().removeFromEnvironment(propName); + } + + /** + * {@inheritDoc} + */ + public Hashtable getEnvironment() throws NamingException + { + if (isInitialContextInitializerCall()) + { + if (env =3D=3D null) + { + // Must return non-null + return new Hashtable(3, 0.75f); + } + else + { + return (Hashtable)env.clone(); + } + } + return getContext().getEnvironment(); + } + + protected Hashtable getInternalEnv() + { + return env; + } + + protected Object getMutex() + { + return bindingsRef; + } + = + /** + * {@inheritDoc} + */ + public void close() throws NamingException + { + bindingsRef =3D null; + if (env !=3D null) + { + env.clear(); + } + if (ctx !=3D null) + { + ctx.close(); + } + } + + /** + * {@inheritDoc} + */ + public String getNameInNamespace() throws NamingException + { + if (isInitialContextInitializerCall()) + { + return super.getNameInNamespace(); + } + return getContext().getNameInNamespace(); + } + } +} 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 2011-07-08 11:31:30 UTC (rev 4615) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextBinder.java 2011-07-12 14:45:11 UTC (rev 4616) @@ -354,7 +354,7 @@ /** * Class implements Map.Entry interface and used to push/pop entity in = stack. = */ - class RefEntity implements Map.Entry + class RefEntity implements Map.Entry { = /** @@ -384,7 +384,6 @@ /** * {@inheritDoc} */ - @Override public String getKey() { return key; @@ -393,7 +392,6 @@ /** * {@inheritDoc} */ - @Override public Reference getValue() { return value; @@ -402,11 +400,10 @@ /** * {@inheritDoc} */ - @Override - public Reference setValue(Object value) + public Reference setValue(Reference value) { Reference oldValue =3D this.value; - this.value =3D (Reference)value; + this.value =3D value; = return oldValue; } 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 2011-07-08 11:31:30 UTC (rev= 4615) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextInitializer.java 2011-07-12 14:45:11 UTC (rev= 4616) @@ -32,6 +32,7 @@ import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Collection; +import java.util.Hashtable; import java.util.Iterator; import java.util.List; = @@ -52,23 +53,26 @@ public class InitialContextInitializer { = - final public static String PROPERTIES_DEFAULT =3D "default-properties"; + static String DEFAULT_INITIAL_CONTEXT_FACTORY =3D PrivilegedSystemHelpe= r.getProperty(Context.INITIAL_CONTEXT_FACTORY); + = + public static final String PROPERTIES_DEFAULT =3D "default-properties"; = - final public static String PROPERTIES_MANDATORY =3D "mandatory-properti= es"; + public static final String PROPERTIES_MANDATORY =3D "mandatory-properti= es"; = - final public static String BINDINGS_STORE_PATH =3D "bindings-store-path= "; + /** + * This parameter is used to overload the default initial context facto= ry in order to ensure that binded objects are shared + */ + public static final String OVERLOAD_CONTEXT_FACTORY =3D "overload-conte= xt-factory"; = - final public static String DEFAULT_BINDING_STORE_PATH =3D PrivilegedSys= temHelper.getProperty("java.io.tmpdir") + public static final String BINDINGS_STORE_PATH =3D "bindings-store-path= "; + + public static final 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"); = private List bindReferencesPlugins; = - private String defaultContextFactory; - - private final InitialContext initialContext; - private final InitialContextBinder binder; = /** @@ -110,7 +114,6 @@ } } } - initialContext =3D new InitialContext(); bindReferencesPlugins =3D new ArrayList(); = ValueParam bindingStorePathParam =3D params.getValueParam(BINDINGS_S= TORE_PATH); @@ -124,7 +127,19 @@ { binder =3D new InitialContextBinder(this, bindingStorePathParam.g= etValue()); } + = + if (LOG.isDebugEnabled()) + { + LOG.debug("The default initial context factory is " + DEFAULT_INI= TIAL_CONTEXT_FACTORY); = + } + ValueParam overloadContextFactoryParam =3D params.getValueParam(OVER= LOAD_CONTEXT_FACTORY); + if (overloadContextFactoryParam !=3D null && overloadContextFactoryP= aram.getValue() !=3D null + && Boolean.valueOf(overloadContextFactoryParam.getValue())) + { + PrivilegedSystemHelper + .setProperty(Context.INITIAL_CONTEXT_FACTORY, ExoContainerCont= extFactory.class.getName()); = + } } = private void setSystemProperty(String propName, String propValue, Strin= g propParamName) @@ -132,7 +147,7 @@ PrivilegedSystemHelper.setProperty(propName, propValue); if (propName.equals(Context.INITIAL_CONTEXT_FACTORY)) { - defaultContextFactory =3D propValue; + DEFAULT_INITIAL_CONTEXT_FACTORY =3D PrivilegedSystemHelper.getPro= perty(Context.INITIAL_CONTEXT_FACTORY); } LOG.info("Using mandatory system property: " + propName + " =3D " + = PrivilegedSystemHelper.getProperty(propName)); } @@ -141,11 +156,8 @@ private InitialContextInitializer(String name, Reference reference) thr= ows NamingException, FileNotFoundException, XMLStreamException { - if (PrivilegedSystemHelper.getProperty(Context.INITIAL_CONTEXT_FACTO= RY) =3D=3D null) - { - PrivilegedSystemHelper.setProperty(Context.INITIAL_CONTEXT_FACTOR= Y, defaultContextFactory); - } - initialContext =3D new InitialContext(); + PrivilegedSystemHelper.setProperty(Context.INITIAL_CONTEXT_FACTORY, = DEFAULT_INITIAL_CONTEXT_FACTORY); + InitialContext initialContext =3D getInitialContext(); initialContext.rebind(name, reference); = // binder @@ -157,13 +169,14 @@ * of app using different copy of Context, for example per web app * InitialContext in Tomcat */ + @deprecated public void recall() { for (BindReferencePlugin plugin : bindReferencesPlugins) { try { - InitialContext ic =3D new InitialContext(); + InitialContext ic =3D getInitialContext(); ic.bind(plugin.getBindName(), plugin.getReference()); LOG.info("Reference bound (by recall()): " + plugin.getBindNam= e()); } @@ -185,8 +198,8 @@ BindReferencePlugin brplugin =3D (BindReferencePlugin)plugin; try { - // initialContext =3D new InitialContext(); - initialContext.rebind(brplugin.getBindName(), brplugin.getRefe= rence()); + InitialContext ic =3D getInitialContext(); + ic.rebind(brplugin.getBindName(), brplugin.getReference()); LOG.info("Reference bound: " + brplugin.getBindName()); bindReferencesPlugins.add((BindReferencePlugin)plugin); } @@ -212,15 +225,24 @@ */ public String getDefaultContextFactory() { - return defaultContextFactory; + return DEFAULT_INITIAL_CONTEXT_FACTORY; } = /** * @return stored InitialContext */ - public synchronized InitialContext getInitialContext() + public InitialContext getInitialContext() { - return initialContext; + try + { + Hashtable env =3D new Hashtable(); + env.put(InitialContextInitializer.class.getName(), "true"); + return new InitialContext(env); + } + catch (NamingException e) + { + throw new RuntimeException("Cannot create the intial context", e); + } } = // for out-of-container testing Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/naming/SimpleContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/SimpleContext.java 2011-07-08 11:31:30 UTC (rev 4615) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/SimpleContext.java 2011-07-12 14:45:11 UTC (rev 4616) @@ -18,22 +18,29 @@ */ package org.exoplatform.services.naming; = -import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = -import java.security.PrivilegedExceptionAction; +import java.util.HashMap; import java.util.Hashtable; +import java.util.Map; = import javax.naming.Binding; +import javax.naming.CompositeName; import javax.naming.Context; +import javax.naming.InvalidNameException; +import javax.naming.LinkRef; import javax.naming.Name; +import javax.naming.NameAlreadyBoundException; import javax.naming.NameClassPair; +import javax.naming.NameNotFoundException; import javax.naming.NameParser; import javax.naming.NamingEnumeration; import javax.naming.NamingException; +import javax.naming.OperationNotSupportedException; import javax.naming.Reference; -import javax.naming.spi.ObjectFactory; +import javax.naming.Referenceable; +import javax.naming.spi.NamingManager; = /** * Created by The eXo Platform SAS. @@ -45,186 +52,383 @@ = public class SimpleContext implements Context { - = + /** * The logger */ private static final Log LOG =3D ExoLogger.getLogger("org.exoplatform.s= ervices.naming.SimpleContext"); = - private static Hashtable objects =3D new Hashtable(); + private static final NameParser NAME_PARSER =3D new SimpleNameParser(); + = + private static volatile Map BINDINGS =3D new HashMap(); = public SimpleContext() { } = + protected Map getBindings() + { + return BINDINGS; + } + + protected void setBindings(Map bindings) + { + BINDINGS =3D bindings; + } + + /** + * Converts a Name to a flat String. + */ + protected String nameToString(Name name) throws NamingException + { + return name.toString(); + } + + /** + * {@inheritDoc} + */ public Object lookup(Name name) throws NamingException { - throw new NamingException("Not supported"); + return lookup(nameToString(name)); } = + /** + * {@inheritDoc} + */ public Object lookup(String name) throws NamingException { - Object obj =3D objects.get(name); + if (name.isEmpty()) + { + throw new InvalidNameException("Cannot bind empty name"); + } + Object obj =3D getBindings().get(name); if (obj instanceof Reference) { - final Reference ref =3D (Reference)obj; - String factoryCN =3D ref.getFactoryClassName(); - try + synchronized (obj) { - final ObjectFactory factory =3D (ObjectFactory)Class.forName(f= actoryCN).newInstance(); - obj =3D SecurityHelper.doPrivilegedExceptionAction(new Privile= gedExceptionAction() + obj =3D getBindings().get(name); + if (obj instanceof Reference) { - public Object run() throws Exception + try { - return factory.getObjectInstance(ref, null, null, null); + obj =3D NamingManager.getObjectInstance(obj, NAME_PARSER= .parse(name), this, getInternalEnv()); + // Re-bind with the object with its new value to be able= to return the same ins + bind(name, obj, false); } - }); + catch (Exception e) + { + LOG.error(e.getLocalizedMessage(), e); + NamingException ne =3D new NamingException("getObjectIns= tance failed"); + ne.setRootCause(e); + throw ne; + } + } } - catch (Exception e) - { - LOG.error(e.getLocalizedMessage(), e); - throw new NamingException("Exception: " + e); - } } + else if (obj =3D=3D null) + { + throw new NameNotFoundException("No object has been binded with t= he name '" + name + "'"); + } return obj; } = + /** + * {@inheritDoc} + */ public void bind(Name name, Object value) throws NamingException { - throw new NamingException("Not supported"); + bind(nameToString(name), value); } = + /** + * {@inheritDoc} + */ public void bind(String name, Object value) throws NamingException { - // System.out.println("Bind: "+name+" "+value+" "+objects); - objects.put(name, value); + bind(name, value, true); } = + private void bind(String name, Object value, boolean checkIfExists) thr= ows NamingException + { + if (name.isEmpty()) + { + throw new InvalidNameException("Cannot bind empty name"); + } + // Call getStateToBind for using any state factories + value =3D NamingManager.getStateToBind(value, NAME_PARSER.parse(name= ), this, getInternalEnv()); + + if (value instanceof Context) + { + throw new OperationNotSupportedException("Context not supported"); + } + else if (value instanceof LinkRef) + { + throw new OperationNotSupportedException("LinkRef not supported"); + } + else if (value instanceof Referenceable) + { + value =3D ((Referenceable)value).getReference(); + } + synchronized (getMutex()) + { + Map tmpObjects =3D new HashMap(ge= tBindings()); + if (checkIfExists && tmpObjects.containsKey(name)) + { + throw new NameAlreadyBoundException("An object has already bee= n binded with the name '" + name + "'"); + } + tmpObjects.put(name, value); + setBindings(tmpObjects); + } + } + + /** + * {@inheritDoc} + */ public void rebind(Name name, Object value) throws NamingException { - throw new NamingException("Not supported"); + rebind(nameToString(name), value); } = + /** + * {@inheritDoc} + */ public void rebind(String name, Object value) throws NamingException { - objects.put(name, value); + bind(name, value, false); } = + /** + * {@inheritDoc} + */ public void unbind(Name name) throws NamingException { - throw new NamingException("Not supported"); + unbind(nameToString(name)); } = + /** + * {@inheritDoc} + */ public void unbind(String name) throws NamingException { - objects.remove(name); + if (name.isEmpty()) + { + throw new InvalidNameException("Cannot bind empty name"); + } + synchronized (getMutex()) + { + Map tmpObjects =3D new HashMap(ge= tBindings()); + if (tmpObjects.remove(name) =3D=3D null) + { + throw new NameNotFoundException("No object has been binded wit= h the name '" + name + "'"); + } + setBindings(tmpObjects); + } } = + /** + * {@inheritDoc} + */ public void rename(Name name1, Name name2) throws NamingException { - throw new NamingException("Not supported"); + rename(nameToString(name1), nameToString(name2)); } = + /** + * {@inheritDoc} + */ public void rename(String name1, String name2) throws NamingException { - Object val =3D objects.get(name1); - objects.remove(name1); - objects.put(name2, val); + if (name1.isEmpty() || name2.isEmpty()) + { + throw new InvalidNameException("Cannot bind empty name"); + } + Object value; + synchronized (getMutex()) + { + Map tmpObjects =3D new HashMap(ge= tBindings()); + if (tmpObjects.containsKey(name2)) + { + throw new NameAlreadyBoundException("An object has already bee= n binded with the name '" + name2 + "'"); + } + else if ((value =3D tmpObjects.remove(name1)) =3D=3D null) + { + throw new NameNotFoundException("No object has been binded wit= h the name '" + name1 + "'"); + } + tmpObjects.put(name2, value); + setBindings(tmpObjects); + } } = - public NamingEnumeration list(Name arg0) throws NamingEx= ception + /** + * {@inheritDoc} + */ + public NamingEnumeration list(Name name) throws NamingEx= ception { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public NamingEnumeration list(String arg0) throws Naming= Exception + /** + * {@inheritDoc} + */ + public NamingEnumeration list(String name) throws Naming= Exception { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public NamingEnumeration listBindings(Name arg0) throws Naming= Exception + /** + * {@inheritDoc} + */ + public NamingEnumeration listBindings(Name name) throws Naming= Exception { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public NamingEnumeration listBindings(String arg0) throws Nami= ngException + /** + * {@inheritDoc} + */ + public NamingEnumeration listBindings(String name) throws Nami= ngException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public void destroySubcontext(Name arg0) throws NamingException + /** + * {@inheritDoc} + */ + public void destroySubcontext(Name name) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public void destroySubcontext(String arg0) throws NamingException + /** + * {@inheritDoc} + */ + public void destroySubcontext(String name) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public Context createSubcontext(Name arg0) throws NamingException + /** + * {@inheritDoc} + */ + public Context createSubcontext(Name name) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public Context createSubcontext(String arg0) throws NamingException + /** + * {@inheritDoc} + */ + public Context createSubcontext(String name) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public Object lookupLink(Name arg0) throws NamingException + /** + * {@inheritDoc} + */ + public Object lookupLink(Name name) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public Object lookupLink(String arg0) throws NamingException + /** + * {@inheritDoc} + */ + public Object lookupLink(String name) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public NameParser getNameParser(Name arg0) throws NamingException + /** + * {@inheritDoc} + */ + public NameParser getNameParser(Name name) throws NamingException { - throw new NamingException("Not supported"); + return getNameParser(nameToString(name)); } = - public NameParser getNameParser(String arg0) throws NamingException + /** + * {@inheritDoc} + */ + public NameParser getNameParser(String name) throws NamingException { - throw new NamingException("Not supported"); + return NAME_PARSER; } = - public Name composeName(Name arg0, Name arg1) throws NamingException + /** + * {@inheritDoc} + */ + public Name composeName(Name nam1, Name name2) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public String composeName(String arg0, String arg1) throws NamingExcept= ion + /** + * {@inheritDoc} + */ + public String composeName(String name1, String name2) throws NamingExce= ption { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public Object addToEnvironment(String arg0, Object arg1) throws NamingE= xception + /** + * {@inheritDoc} + */ + public Object addToEnvironment(String name1, Object name2) throws Namin= gException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = - public Object removeFromEnvironment(String arg0) throws NamingException + /** + * {@inheritDoc} + */ + public Object removeFromEnvironment(String name) throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = + /** + * {@inheritDoc} + */ + @SuppressWarnings("rawtypes") public Hashtable getEnvironment() throws NamingException { - throw new NamingException("Not supported"); + return new Hashtable(3, 0.75f); } = + protected Hashtable getInternalEnv() + { + return null; + } + = + protected Object getMutex() + { + return SimpleContext.class; + } + = + /** + * {@inheritDoc} + */ public void close() throws NamingException { - objects.clear(); } = + /** + * {@inheritDoc} + */ public String getNameInNamespace() throws NamingException { - throw new NamingException("Not supported"); + throw new OperationNotSupportedException("Not supported"); } = -} + private static class SimpleNameParser implements NameParser + { + /** + * {@inheritDoc} + */ + public Name parse(String name) throws NamingException + { + return new CompositeName(name); + } = + } +} \ No newline at end of file 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 2011-07-08 11:31:30 UTC (rev 4615) +++ kernel/trunk/exo.kernel.component.common/src/test/java/org/exoplatform/= services/naming/InitialContextTest.java 2011-07-12 14:45:11 UTC (rev 4616) @@ -33,6 +33,8 @@ import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.Name; +import javax.naming.NameAlreadyBoundException; +import javax.naming.NameNotFoundException; import javax.naming.NamingException; import javax.xml.stream.XMLStreamException; = @@ -90,6 +92,101 @@ assertNotNull(ctx); ctx.bind("test", "test"); assertEquals("test", ctx.lookup("test")); + try + { + ctx.bind("test", "test2"); + fail("A NameAlreadyBoundException is expected here"); + } + catch (NameAlreadyBoundException e) + { + // expected exception + } + assertEquals("test", ctx.lookup("test")); + ctx.rebind("test", "test2"); + assertEquals("test2", ctx.lookup("test")); + = + InitialContextInitializer initializer =3D + (InitialContextInitializer)container.getComponentInstanceOfType(I= nitialContextInitializer.class); + + assertNotNull(initializer); + initializer.getInitialContext().bind("test", "test3"); + assertEquals("test3", ctx.lookup("test")); + ctx.rebind("test", "test4"); + assertEquals("test3", ctx.lookup("test")); + initializer.getInitialContext().rebind("test", "test5"); + assertEquals("test5", ctx.lookup("test")); + initializer.getInitialContext().unbind("test"); + try + { + initializer.getInitialContext().lookup("test"); + fail("A NameNotFoundException is expected here"); + } + catch (NameNotFoundException e) + { + // expected exception + } + assertEquals("test4", ctx.lookup("test")); + ctx.unbind("test"); + try + { + ctx.lookup("test"); + fail("A NameNotFoundException is expected here"); + } + catch (NameNotFoundException e) + { + // expected exception + } + try + { + initializer.getInitialContext().unbind("test2"); + fail("A NameNotFoundException is expected here"); + } + catch (NameNotFoundException e) + { + // expected exception + } + initializer.getInitialContext().bind("foo", "foo"); + assertEquals("foo", ctx.lookup("foo")); + initializer.getInitialContext().bind("foo2", "foo2"); + assertEquals("foo2", ctx.lookup("foo2")); + try + { + initializer.getInitialContext().rename("foo", "foo2"); + fail("A NameAlreadyBoundException is expected here"); + } + catch (NameAlreadyBoundException e) + { + // expected exception + } + assertEquals("foo", ctx.lookup("foo")); + assertEquals("foo2", ctx.lookup("foo2")); + try + { + initializer.getInitialContext().rename("foo3", "foo4"); + fail("A NameNotFoundException is expected here"); + } + catch (NameNotFoundException e) + { + // expected exception + } + initializer.getInitialContext().rename("foo", "foo3"); + assertEquals("foo", ctx.lookup("foo3")); + assertEquals("foo2", ctx.lookup("foo2")); + try + { + initializer.getInitialContext().lookup("foo"); + fail("A NameNotFoundException is expected here"); + } + catch (NameNotFoundException e) + { + // expected exception + } + = + // check same instance + initializer.getInitialContext().bind("bla", "bla"); + Object obj1 =3D initializer.getInitialContext().lookup("bla"); + Object obj2 =3D initializer.getInitialContext().lookup("bla"); + assertTrue(obj1 =3D=3D obj2); } = public void testCompositeNameUsing() throws Exception @@ -102,6 +199,30 @@ { System.out.println("---- " + en.nextElement()); } + InitialContext ctx =3D new InitialContext(); + ctx.bind(name, "foo"); + assertEquals("foo", ctx.lookup(name)); + try + { + ctx.bind(name, "foo2"); + fail("A NameAlreadyBoundException is expected here"); + } + catch (NameAlreadyBoundException e) + { + // expected exception + } + assertEquals("foo", ctx.lookup(name)); + assertEquals("foo", ctx.lookup("java:comp/env/jdbc/jcr")); + ctx.unbind(name); + try + { + ctx.lookup(name); + fail("A NameNotFoundException is expected here"); + } + catch (NameNotFoundException e) + { + // expected exception + } } = /* = 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 2011-07-08 11:31:30 UTC (rev 4615) +++ kernel/trunk/exo.kernel.component.common/src/test/resources/conf/portal= /test-configuration.xml 2011-07-12 14:45:11 UTC (rev 4616) @@ -134,7 +134,13 @@ = bindings-store-path = target/store-path.xml = - = + + + = + overload-context-factory = + true = + default-properties Default initial context properties --===============4161606495322216924==-- From do-not-reply at jboss.org Tue Jul 12 10:45:42 2011 Content-Type: multipart/mixed; boundary="===============2295091088757992958==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4617 - ws/trunk/exo.ws.frameworks.servlet/src/main/java/org/exoplatform/ws/frameworks/servlet. Date: Tue, 12 Jul 2011 10:45:42 -0400 Message-ID: <201107121445.p6CEjg63027730@svn01.web.mwc.hst.phx2.redhat.com> --===============2295091088757992958== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-12 10:45:41 -0400 (Tue, 12 Jul 2011) New Revision: 4617 Modified: ws/trunk/exo.ws.frameworks.servlet/src/main/java/org/exoplatform/ws/fram= eworks/servlet/StandaloneContainerInitializedListener.java Log: EXOJCR-1416: Get rid of any call to InitialContextInitializer.recall() Modified: ws/trunk/exo.ws.frameworks.servlet/src/main/java/org/exoplatform/= ws/frameworks/servlet/StandaloneContainerInitializedListener.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/src/main/java/org/exoplatform/ws/fra= meworks/servlet/StandaloneContainerInitializedListener.java 2011-07-12 14:4= 5:11 UTC (rev 4616) +++ ws/trunk/exo.ws.frameworks.servlet/src/main/java/org/exoplatform/ws/fra= meworks/servlet/StandaloneContainerInitializedListener.java 2011-07-12 14:4= 5:41 UTC (rev 4617) @@ -19,10 +19,8 @@ package org.exoplatform.ws.frameworks.servlet; = import org.exoplatform.container.StandaloneContainer; -import org.exoplatform.container.configuration.ConfigurationManagerImpl; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; -import org.exoplatform.services.naming.InitialContextInitializer; = import java.net.MalformedURLException; = @@ -104,16 +102,6 @@ try { container =3D StandaloneContainer.getInstance(Thread.currentThrea= d().getContextClassLoader()); - - // Patch for tomcat InitialContext - InitialContextInitializer ic =3D - (InitialContextInitializer)container.getComponentInstanceOfTyp= e(InitialContextInitializer.class); - - if (ic !=3D null) - { - ic.recall(); - } - event.getServletContext().setAttribute("org.exoplatform.framework= s.web.eXoContainer", container); } catch (Exception e) --===============2295091088757992958==-- From do-not-reply at jboss.org Tue Jul 12 10:49:46 2011 Content-Type: multipart/mixed; boundary="===============6263035204361268561==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4618 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache and 4 other directories. Date: Tue, 12 Jul 2011 10:49:46 -0400 Message-ID: <201107121449.p6CEnkCP028310@svn01.web.mwc.hst.phx2.redhat.com> --===============6263035204361268561== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-12 10:49:45 -0400 (Tue, 12 Jul 2011) New Revision: 4618 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.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/storage/jdbc/JDBCWorkspaceDataContainer.java jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/clus= ter/test-configuration-jbc.xml jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/clus= ter/test-configuration.xml jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test= -configuration-jbc.xml jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test= -configuration-sjdbc-jbc.xml 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= -configuration.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/= modules/kernel/jndi-naming.xml Log: EXOJCR-1416: Get rid of any call to InitialContextInitializer.recall() Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/infinispan/ISPNCacheableLockManagerImpl.java 2011-07-12= 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/infinispan/ISPNCacheableLockManagerImpl.java 2011-07-12= 14:49:45 UTC (rev 4618) @@ -117,9 +117,6 @@ configureJDBCCacheLoader(config.getLockManager()); = cache =3D factory.createCache("L" + config.getUniqueName().replac= e("_", ""), config.getLockManager()); - - // Context recall is a workaround of JDBCCacheLoader starting. = - context.recall(); } else { 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 2011-07-12 14:= 45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2011-07-12 14:= 49:45 UTC (rev 4618) @@ -212,9 +212,6 @@ } = createStructuredNode(lockRoot); - - // Context recall is a workaround of JDBCCacheLoader starting. = - context.recall(); } else { 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 2011-07-12 14:45:41 = UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-07-12 14:49:45 = UTC (rev 4618) @@ -63,6 +63,7 @@ import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvid= er; import org.exoplatform.services.jdbc.DataSourceProvider; +import org.exoplatform.services.jdbc.impl.ManagedDataSource; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.naming.InitialContextInitializer; @@ -255,11 +256,6 @@ FileCleanerHolder fileCleanerHolder, DataSourceProvider dsProvider) = throws RepositoryConfigurationException, NamingException, RepositoryException, IOException { - - // This recall is workaround for tenants creation. There is a troubl= e in visibility datasource - // binded in one tomcat context from another tomcat context. = - contextInit.recall(); - checkIntegrity(wsConfig, repConfig); this.wsConfig =3D wsConfig; this.containerName =3D wsConfig.getName(); Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/cluster/test-configuration-jbc.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/clu= ster/test-configuration-jbc.xml 2011-07-12 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/clu= ster/test-configuration-jbc.xml 2011-07-12 14:49:45 UTC (rev 4618) @@ -379,6 +379,7 @@ + @@ -622,6 +623,7 @@ + Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/cluster/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/clu= ster/test-configuration.xml 2011-07-12 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/clu= ster/test-configuration.xml 2011-07-12 14:49:45 UTC (rev 4618) @@ -379,6 +379,7 @@ + @@ -622,6 +623,7 @@ + Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/test-configuration-jbc.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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-jbc.xml 2011-07-12 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration-jbc.xml 2011-07-12 14:49:45 UTC (rev 4618) @@ -360,7 +360,8 @@ - + + @@ -604,6 +605,7 @@ + Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/test-configuration-sjdbc-jbc.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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-jbc.xml 2011-07-12 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration-sjdbc-jbc.xml 2011-07-12 14:49:45 UTC (rev 4618) @@ -280,6 +280,7 @@ + @@ -442,6 +443,7 @@ + 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 2011-07-12 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration-sjdbc.xml 2011-07-12 14:49:45 UTC (rev 4618) @@ -280,6 +280,7 @@ + @@ -442,6 +443,7 @@ + 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 2011-07-12 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration.xml 2011-07-12 14:49:45 UTC (rev 4618) @@ -361,6 +361,7 @@ + @@ -604,6 +605,7 @@ + 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 2011-07-12 14:45:41 UTC (rev 4617) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/kernel/jndi-naming.xml 2011-07-12 14:49:45 UTC (rev 4618) @@ -121,6 +121,14 @@ <component> <type>org.exoplatform.services.naming.InitialContextInitializer&= lt;/type> <init-params> + <value-param>. + <name>bindings-store-path</name>. + <value>bind-references.xml</value>. + </value-param>. + <value-param> = + <name>overload-context-factory</name> = + <value>true</value> = + </value-param> <properties-param> <name>default-properties</name> <description>Default initial context properties</descript= ion> @@ -131,10 +139,6 @@ <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> = @@ -143,6 +147,13 @@ binding-store-path is file pa= th which stores binded datasources in runtime = + overload-context-factory allo= ws to + overload the default initial context factory by a context factory that= is + ExoContainer aware and that is able to delegate to the original initial + context factory if it detects that it is not in the eXo scope. By defa= ult + the feature is disabled since it is only required on AS that don't sha= re + the objects by default like tomcat but unlike JBoss AS + The BindReferencePlugin component plugin configuration example (for JDBC datasource): = --===============6263035204361268561==-- From do-not-reply at jboss.org Tue Jul 12 11:16:02 2011 Content-Type: multipart/mixed; boundary="===============6751060371174671882==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4619 - jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup. Date: Tue, 12 Jul 2011 11:16:02 -0400 Message-ID: <201107121516.p6CFG2Gb004363@svn01.web.mwc.hst.phx2.redhat.com> --===============6751060371174671882== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-12 11:16:01 -0400 (Tue, 12 Jul 2011) New Revision: 4619 Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/backup/AbstractBackupUseCasesTest.java Log: EXOJCR-1435: fix tests Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/backup/AbstractBackupUseCasesTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/AbstractBackupUseCasesTest.java 2011-07-12 14:49:45 UTC (rev= 4618) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/backup/AbstractBackupUseCasesTest.java 2011-07-12 15:16:01 UTC (rev= 4619) @@ -1222,9 +1222,7 @@ String backupDitEnv =3D backDir.getCanonicalPath(); = String newBackupDir =3D - "\\${java.io.tmpdir}" - + bch.getBackupConfig().getBackupDir().getCanonica= lPath() - .replace(backupDitEnv, ""); + "\\${java.io.tmpdir}" + bch.getBackupConfig().getBackupDir().getC= anonicalPath().replace(backupDitEnv, ""); = File dest =3D new File(repositoryBackupChainLogPath + ".xml"); dest.createNewFile(); @@ -1235,7 +1233,8 @@ String sConfig =3D setNewBackupDirInRepositoryBackupChainLog(new File(repos= itoryBackupChainLogPath), dest, newBackupDir); = - assertTrue(sConfig.contains(newBackupDir.subSequence(1, newBackup= Dir.length()))); + assertTrue(sConfig.contains("${java.io.tmpdir}" + + bch.getBackupConfig().getBackupDir().getCanonicalPath().repl= ace(backupDitEnv, ""))); = // check newRepositoryBackupChainLog =3D new RepositoryBackupChainLog(dest= ); @@ -1277,7 +1276,7 @@ String relativePrefixBackupDir =3D backDir.getCanonicalFile().getPar= ent() + File.separator; = String newBackupDir =3D - bch.getBackupConfig().getBackupDir().getCanonicalPath().rep= laceAll(relativePrefixBackupDir, ""); + bch.getBackupConfig().getBackupDir().getCanonicalPath().replace(r= elativePrefixBackupDir, ""); = File dest =3D new File(repositoryBackupChainLogPath + ".xml"); dest.createNewFile(); --===============6751060371174671882==-- From do-not-reply at jboss.org Wed Jul 13 02:05:27 2011 Content-Type: multipart/mixed; boundary="===============5253439762328854685==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4620 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming. Date: Wed, 13 Jul 2011 02:05:27 -0400 Message-ID: <201107130605.p6D65R1I021825@svn01.web.mwc.hst.phx2.redhat.com> --===============5253439762328854685== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-13 02:05:27 -0400 (Wed, 13 Jul 2011) New Revision: 4620 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextInitializer.java Log: EXOJCR-1416: Get rid of any call to InitialContextInitializer.recall() 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 2011-07-12 15:16:01 UTC (rev= 4619) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextInitializer.java 2011-07-13 06:05:27 UTC (rev= 4620) @@ -169,7 +169,7 @@ * of app using different copy of Context, for example per web app * InitialContext in Tomcat */ - @deprecated + @Deprecated public void recall() { for (BindReferencePlugin plugin : bindReferencesPlugins) --===============5253439762328854685==-- From do-not-reply at jboss.org Wed Jul 13 02:10:11 2011 Content-Type: multipart/mixed; boundary="===============6805405712690577257==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4621 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl. Date: Wed, 13 Jul 2011 02:10:10 -0400 Message-ID: <201107130610.p6D6AApb022238@svn01.web.mwc.hst.phx2.redhat.com> --===============6805405712690577257== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-13 02:10:10 -0400 (Wed, 13 Jul 2011) New Revision: 4621 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/RepositoryServiceImpl.java Log: EXOJCR-1439: Add getCurrentRepositoryName method to RepositoryServiceImpl 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 2011-07-13 06:05:27 UTC (rev 4620) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/RepositoryServiceImpl.java 2011-07-13 06:10:10 UTC (rev 4621) @@ -191,6 +191,14 @@ return config; } = + /** + * @return Name of current repository if exists or null in other case + */ + public String getCurrentRepositoryName() + { + return currentRepositoryName.get(); + } + public ManageableRepository getCurrentRepository() throws RepositoryExc= eption { if (currentRepositoryName.get() =3D=3D null) --===============6805405712690577257==-- From do-not-reply at jboss.org Wed Jul 13 07:47:50 2011 Content-Type: multipart/mixed; boundary="===============3036558652664089398==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4622 - in kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services: naming and 1 other directory. Date: Wed, 13 Jul 2011 07:47:50 -0400 Message-ID: <201107131147.p6DBlodB021455@svn01.web.mwc.hst.phx2.redhat.com> --===============3036558652664089398== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-13 07:47:50 -0400 (Wed, 13 Jul 2011) New Revision: 4622 Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/jdbc/impl/CloseableDataSource.java Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/SimpleContext.java Log: EXOJCR-1425: Close all database connections Added: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatfo= rm/services/jdbc/impl/CloseableDataSource.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jdbc/impl/CloseableDataSource.java (rev 0) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/jdbc/impl/CloseableDataSource.java 2011-07-13 11:47:50 UTC (rev 46= 22) @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2011 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.jdbc.impl; + +import java.io.PrintWriter; +import java.sql.Connection; +import java.sql.SQLException; + +import javax.sql.DataSource; + +/** + * This class is used to wrap the original {@link DataSource} + * in order to be able to support close operation. + * = + * @author Anatoliy Bazko + * @version $Id$ + */ +public class CloseableDataSource implements DataSource +{ + /** + * The wrapped {@link DataSource} + */ + private DataSource ds; + + /** + * Constructor CloseableDataSource. + */ + public CloseableDataSource(DataSource ds) + { + this.ds =3D ds; + } + + /** + * {@inheritDoc} + */ + public PrintWriter getLogWriter() throws SQLException + { + checkValid(); + return ds.getLogWriter(); + } + + /** + * {@inheritDoc} + */ + public int getLoginTimeout() throws SQLException + { + checkValid(); + return ds.getLoginTimeout(); + } + + /** + * {@inheritDoc} + */ + public void setLogWriter(PrintWriter out) throws SQLException + { + checkValid(); + ds.setLogWriter(out); + } + + /** + * {@inheritDoc} + */ + public void setLoginTimeout(int seconds) throws SQLException + { + checkValid(); + ds.setLoginTimeout(seconds); + } + + /** + * {@inheritDoc} + */ + public boolean isWrapperFor(Class iface) throws SQLException + { + checkValid(); + return ds.isWrapperFor(iface); + } + + /** + * {@inheritDoc} + */ + public T unwrap(Class iface) throws SQLException + { + checkValid(); + return ds.unwrap(iface); + } + + /** + * {@inheritDoc} + */ + public Connection getConnection() throws SQLException + { + checkValid(); + return ds.getConnection(); + } + + /** + * {@inheritDoc} + */ + public Connection getConnection(String username, String password) throw= s SQLException + { + checkValid(); + return ds.getConnection(username, password); + } + + /** + * Closes datasource to release all idle connections. + */ + public void close() + { + ds =3D null; + } + + /** + * Check if datasouce already closed. + * = + * @throws SQLException + * if datasource is closed + */ + private void checkValid() throws SQLException + { + if (ds =3D=3D null) + { + throw new SQLException("The datasource is closed"); + } + } +} Property changes on: kernel/trunk/exo.kernel.component.common/src/main/java= /org/exoplatform/services/jdbc/impl/CloseableDataSource.java ___________________________________________________________________ Added: svn:keywords + Id Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exopla= tform/services/naming/SimpleContext.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/SimpleContext.java 2011-07-13 06:10:10 UTC (rev 4621) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/SimpleContext.java 2011-07-13 11:47:50 UTC (rev 4622) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.naming; = +import org.exoplatform.services.jdbc.impl.CloseableDataSource; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = @@ -41,6 +42,7 @@ import javax.naming.Reference; import javax.naming.Referenceable; import javax.naming.spi.NamingManager; +import javax.sql.DataSource; = /** * Created by The eXo Platform SAS. @@ -112,6 +114,12 @@ try { obj =3D NamingManager.getObjectInstance(obj, NAME_PARSER= .parse(name), this, getInternalEnv()); + + if (obj instanceof DataSource) + { + obj =3D new CloseableDataSource((DataSource)obj); + } + // Re-bind with the object with its new value to be able= to return the same ins bind(name, obj, false); } --===============3036558652664089398==-- From do-not-reply at jboss.org Wed Jul 13 07:48:30 2011 Content-Type: multipart/mixed; boundary="===============4801333273239891173==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4623 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/repository/creation. Date: Wed, 13 Jul 2011 07:48:30 -0400 Message-ID: <201107131148.p6DBmU01021466@svn01.web.mwc.hst.phx2.redhat.com> --===============4801333273239891173== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-13 07:48:29 -0400 (Wed, 13 Jul 2011) New Revision: 4623 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/creation/RepositoryCreationServiceImpl.java Log: EXOJCR-1425: Close all database connections Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/repository/creation/RepositoryCreationServiceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/creation/RepositoryCreationServiceImpl.java 2011-07-13 1= 1:47:50 UTC (rev 4622) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/creation/RepositoryCreationServiceImpl.java 2011-07-13 1= 1:48:29 UTC (rev 4623) @@ -38,6 +38,7 @@ import org.exoplatform.services.jcr.impl.core.SessionRegistry; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataCon= tainer; import org.exoplatform.services.jcr.util.IdGenerator; +import org.exoplatform.services.jdbc.impl.CloseableDataSource; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.naming.InitialContextInitializer; @@ -94,12 +95,12 @@ /** * The default factory class name. */ - private static final String BASIC_DATA_SOURCE_FACTORY =3D "org.apache.c= ommons.dbcp.BasicDataSourceFactory"; + private static final String DEFAULT_DATA_SOURCE_FACTORY =3D "org.apache= .commons.dbcp.BasicDataSourceFactory"; = /** * The factory class name to create object. */ - private String factoryClassName =3D BASIC_DATA_SOURCE_FACTORY; + private String factoryClassName =3D DEFAULT_DATA_SOURCE_FACTORY; = /** * The Repository service. @@ -861,8 +862,7 @@ * the repository name * @throws RepositoryCreationException */ - protected void removeRepositoryLocally(String repositoryName) - throws RepositoryCreationException + protected void removeRepositoryLocally(String repositoryName) throws Re= positoryCreationException { try { @@ -886,7 +886,30 @@ // unbind datasource and close connections for (String dsName : datasources) { - initialContextInitializer.getInitialContextBinder().unbind(dsN= ame); + try + { + // we suppose that lookup() method returns the same instanc= e of datasource by the same name + DataSource ds =3D (DataSource)initialContextInitializer.get= InitialContext().lookup(dsName); + initialContextInitializer.getInitialContextBinder().unbind(= dsName); + + // close datasource + if (ds instanceof CloseableDataSource) + { + ((CloseableDataSource)ds).close(); + } + } + catch (NamingException e) + { + LOG.error("Can't unbind datasource " + dsName, e); + } + catch (FileNotFoundException e) + { + LOG.error("Can't unbind datasource " + dsName, e); + } + catch (XMLStreamException e) + { + LOG.error("Can't unbind datasource " + dsName, e); + } } } catch (RepositoryException e) @@ -897,18 +920,6 @@ { throw new RepositoryCreationException("Can't remove repository", = e); } - catch (FileNotFoundException e) - { - throw new RepositoryCreationException("Can't remove repository", = e); - } - catch (NamingException e) - { - throw new RepositoryCreationException("Can't remove repository", = e); - } - catch (XMLStreamException e) - { - throw new RepositoryCreationException("Can't remove repository", = e); - } } = private DBCreator getDBCreator(DBCreationProperties creationProps) thro= ws ConfigurationException --===============4801333273239891173==-- From do-not-reply at jboss.org Wed Jul 13 09:25:28 2011 Content-Type: multipart/mixed; boundary="===============1285373105718371809==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4624 - kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/commons/test. Date: Wed, 13 Jul 2011 09:25:27 -0400 Message-ID: <201107131325.p6DDPROQ010978@svn01.web.mwc.hst.phx2.redhat.com> --===============1285373105718371809== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-13 09:25:27 -0400 (Wed, 13 Jul 2011) New Revision: 4624 Modified: kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/commo= ns/test/TestSecurityManager.java Log: EXOJCR-1425: Close all database connections, Fix tests 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 2011-07-13 11:48:29 UTC (rev 4623) +++ kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/comm= ons/test/TestSecurityManager.java 2011-07-13 13:25:27 UTC (rev 4624) @@ -85,7 +85,7 @@ || fileName.equals("Probe.java") || fileName.equals("= ExportBase.java") || fileName.equals("AbstractTestContainer.java") || f= ileName.equals("ContainerBuilder.java") || fileName.equals("WorkspaceStorageCacheBaseCase.jav= a") - || fileName.equals("ExoRepositoryStub.java")) + || fileName.equals("ExoRepositoryStub.java") || fileN= ame.equals("CloseableDataSource.java")) { testCode =3D true; } @@ -114,11 +114,8 @@ } = // Only for debug purpose - // if (!se - // .getMessage() - // .equals( - // "access denied (java.lang.RuntimePermission = - // accessClassInPackage.com.sun.xml.internal.bi= nd.v2.runtime.reflect)")) + // if (!se.getMessage().equals( + // "access denied (java.lang.RuntimePermission.com.sun= .xml.internal.bind.v2.runtime.reflect)")) // { // se.printStackTrace(); // } --===============1285373105718371809==-- From do-not-reply at jboss.org Wed Jul 13 10:15:42 2011 Content-Type: multipart/mixed; boundary="===============2151453638792535865==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4625 - jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup. Date: Wed, 13 Jul 2011 10:15:42 -0400 Message-ID: <201107131415.p6DEFgAn022277@svn01.web.mwc.hst.phx2.redhat.com> --===============2151453638792535865== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2011-07-13 10:15:42 -0400 (Wed, 13 Jul 2011) New Revision: 4625 Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/backup/AbstractBackupUseCasesTest.java Log: EXOJCR-1435 : Unit test was fixed (for working on OS Windows) Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/backup/AbstractBackupUseCasesTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/AbstractBackupUseCasesTest.java 2011-07-13 13:25:27 UTC (rev= 4624) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/backup/AbstractBackupUseCasesTest.java 2011-07-13 14:15:42 UTC (rev= 4625) @@ -1221,9 +1221,15 @@ = String backupDitEnv =3D backDir.getCanonicalPath(); = - String newBackupDir =3D - "\\${java.io.tmpdir}" + bch.getBackupConfig().getBackupDir().getC= anonicalPath().replace(backupDitEnv, ""); + String relativePath =3D bch.getBackupConfig().getBackupDir().getCano= nicalPath().replace(backupDitEnv, ""); + String relativePathForWrite =3D relativePath; + if (File.separator.equals("\\")) + { + relativePathForWrite =3D relativePath.replaceAll("\\\\", "\\\\\\\= \"); + } = + String newBackupDir =3D "\\${java.io.tmpdir}" + relativePathForWrite; + File dest =3D new File(repositoryBackupChainLogPath + ".xml"); dest.createNewFile(); = @@ -1231,10 +1237,9 @@ try { String sConfig =3D - setNewBackupDirInRepositoryBackupChainLog(new File(repos= itoryBackupChainLogPath), dest, newBackupDir); + setNewBackupDirInRepositoryBackupChainLog(new File(repositoryB= ackupChainLogPath), dest, newBackupDir); = - assertTrue(sConfig.contains("${java.io.tmpdir}" - + bch.getBackupConfig().getBackupDir().getCanonicalPath().repl= ace(backupDitEnv, ""))); + assertTrue(sConfig.contains("${java.io.tmpdir}" + relativePath)); = // check newRepositoryBackupChainLog =3D new RepositoryBackupChainLog(dest= ); @@ -1277,6 +1282,11 @@ = String newBackupDir =3D bch.getBackupConfig().getBackupDir().getCanonicalPath().replace(r= elativePrefixBackupDir, ""); + String newBackupDirForWrite =3D newBackupDir; + if (File.separator.equals("\\")) + { + newBackupDirForWrite =3D newBackupDir.replaceAll("\\\\", "\\\\\\\= \"); + } = File dest =3D new File(repositoryBackupChainLogPath + ".xml"); dest.createNewFile(); @@ -1284,7 +1294,7 @@ RepositoryBackupChainLog newRepositoryBackupChainLog =3D null; = String sConfig =3D - setNewBackupDirInRepositoryBackupChainLog(new File(reposito= ryBackupChainLogPath), dest, newBackupDir); + setNewBackupDirInRepositoryBackupChainLog(new File(repositoryBack= upChainLogPath), dest, newBackupDirForWrite); = assertTrue(sConfig.contains(newBackupDir)); = --===============2151453638792535865==-- From do-not-reply at jboss.org Wed Jul 13 10:54:22 2011 Content-Type: multipart/mixed; boundary="===============7853125451931512705==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4626 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene. Date: Wed, 13 Jul 2011 10:54:22 -0400 Message-ID: <201107131454.p6DEsMcG025810@svn01.web.mwc.hst.phx2.redhat.com> --===============7853125451931512705== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2011-07-13 10:54:22 -0400 (Wed, 13 Jul 2011) New Revision: 4626 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/MultiIndex.java Log: EXOJCR-1436: doUpdateRO and doUpdateRW redundant IndexReader get and releas= e replaced with releaseMultiReader 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 2011-07-13 14:15:42 UTC (rev 46= 25) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/MultiIndex.java 2011-07-13 14:54:22 UTC (rev 46= 26) @@ -634,7 +634,7 @@ { try { - getIndexReader().release(); + releaseMultiReader(); } catch (IOException e) { @@ -768,7 +768,7 @@ { try { - getIndexReader().release(); + releaseMultiReader(); } catch (IOException e) { --===============7853125451931512705==-- From do-not-reply at jboss.org Wed Jul 13 10:57:02 2011 Content-Type: multipart/mixed; boundary="===============7899879230302664042==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4627 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query: lucene and 1 other directory. Date: Wed, 13 Jul 2011 10:57:02 -0400 Message-ID: <201107131457.p6DEv2Kb026172@svn01.web.mwc.hst.phx2.redhat.com> --===============7899879230302664042== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2011-07-13 10:57:01 -0400 (Wed, 13 Jul 2011) New Revision: 4627 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/SearchManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/LuceneQueryHits.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/SearchIndex.java Log: EXOJCR-1436: IndexReader release added to LuceneQueryHits Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/SearchManager.java 2011-07-13 14:54:22 UTC (rev 4626) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/SearchManager.java 2011-07-13 14:57:01 UTC (rev 4627) @@ -971,17 +971,17 @@ private Set getNodes(final org.apache.lucene.search.Query query= ) throws RepositoryException { Set result =3D new HashSet(); + QueryHits hits =3D null; try { - QueryHits hits =3D handler.executeQuery(query); + hits =3D handler.executeQuery(query); = ScoreNode sn; - while ((sn =3D hits.nextScoreNode()) !=3D null) { - // Node node =3D session.getNodeById(sn.getNodeId()); result.add(sn.getNodeId()); } + return result; } catch (IndexOfflineIOException e) { @@ -991,7 +991,20 @@ { throw new RepositoryException(e.getLocalizedMessage(), e); } - return result; + finally + { + if (hits !=3D null) + { + try + { + hits.close(); + } + catch (IOException e) + { + log.error("Can not close QueryHits.", e); + } + } + } } = private boolean isPrefixMatch(final InternalQName value, final String p= refix) throws RepositoryException Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/LuceneQueryHits.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/LuceneQueryHits.java 2011-07-13 14:54:22 UTC (r= ev 4626) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/LuceneQueryHits.java 2011-07-13 14:57:01 UTC (r= ev 4627) @@ -41,10 +41,31 @@ */ private final Scorer scorer; = + /** + * Release IndexReader on LuceneQueryHits.close(). + */ + private final boolean releaseReaderOnClose; + public LuceneQueryHits(IndexReader reader, IndexSearcher searcher, Quer= y query) throws IOException { + this(reader, searcher, query, false); + } + + /** + * Constructor. + * = + * @param reader IndexReader + * @param searcher IndexSearcher + * @param query Query + * @param releaseReaderOnClose - release IndexReader on LuceneQueryHits= .close(). + * @throws IOException + */ + public LuceneQueryHits(IndexReader reader, IndexSearcher searcher, Quer= y query, boolean releaseReaderOnClose) + throws IOException + { this.reader =3D reader; this.scorer =3D query.weight(searcher).scorer(reader, true, false); + this.releaseReaderOnClose =3D releaseReaderOnClose; } = /** @@ -66,8 +87,16 @@ */ public void close() throws IOException { - // make sure scorer frees resources - scorer.skipTo(Integer.MAX_VALUE); + if (scorer !=3D null) + { + // make sure scorer frees resources + scorer.advance(Integer.MAX_VALUE); + } + + if (releaseReaderOnClose && reader !=3D null && reader instanceof Re= leaseableIndexReader) + { + ((ReleaseableIndexReader)reader).release(); + } } = /** 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 2011-07-13 14:54:22 UTC (rev 4= 626) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/SearchIndex.java 2011-07-13 14:57:01 UTC (rev 4= 627) @@ -3054,7 +3054,7 @@ IndexSearcher searcher =3D new IndexSearcher(reader); searcher.setSimilarity(getSimilarity()); = - return new LuceneQueryHits(reader, searcher, query); + return new LuceneQueryHits(reader, searcher, query, true); } = /** --===============7899879230302664042==-- From do-not-reply at jboss.org Thu Jul 14 04:22:45 2011 Content-Type: multipart/mixed; boundary="===============6335051957252801523==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4628 - jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone. Date: Thu, 14 Jul 2011 04:22:45 -0400 Message-ID: <201107140822.p6E8Mjk3014860@svn01.web.mwc.hst.phx2.redhat.com> --===============6335051957252801523== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-14 04:22:45 -0400 (Thu, 14 Jul 2011) New Revision: 4628 Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test= -configuration-sjdbc-jbc.xml jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/test= -configuration-sjdbc.xml Log: EXOJCR-1425: Close all database connections, Fix conf Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalo= ne/test-configuration-sjdbc-jbc.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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-jbc.xml 2011-07-13 14:57:01 UTC (rev 4627) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration-sjdbc-jbc.xml 2011-07-14 08:22:45 UTC (rev 4628) @@ -253,6 +253,7 @@ + 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 2011-07-13 14:57:01 UTC (rev 4627) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/standalone/tes= t-configuration-sjdbc.xml 2011-07-14 08:22:45 UTC (rev 4628) @@ -253,6 +253,7 @@ + --===============6335051957252801523==-- From do-not-reply at jboss.org Thu Jul 14 04:38:05 2011 Content-Type: multipart/mixed; boundary="===============3793910161159098907==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4629 - in jcr/branches/1.12.x/patch/1.12.10-GA: JCR-1649 and 1 other directory. Date: Thu, 14 Jul 2011 04:38:04 -0400 Message-ID: <201107140838.p6E8c4mG016067@svn01.web.mwc.hst.phx2.redhat.com> --===============3793910161159098907== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2011-07-14 04:38:04 -0400 (Thu, 14 Jul 2011) New Revision: 4629 Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1649/ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1649/JCR-1649.patch Log: JCR-1649: patch proposed Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1649/JCR-1649.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/1.12.10-GA/JCR-1649/JCR-1649.patch = (rev 0) +++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1649/JCR-1649.patch 2011-07-14= 08:38:04 UTC (rev 4629) @@ -0,0 +1,211 @@ +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/query/lucene/LuceneQueryHits.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/query/lucene/LuceneQueryHits.java (revision 4627) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/query/lucene/LuceneQueryHits.java (working copy) +@@ -23,67 +23,98 @@ + = + import java.io.IOException; + = +- + /** + * Wraps a lucene query result and adds a close method that allows to rel= ease + * resources after a query has been executed and the results have been re= ad + * completely. + */ +-public class LuceneQueryHits implements QueryHits { ++public class LuceneQueryHits implements QueryHits ++{ + = +- /** +- * The IndexReader in use by the lucene hits. +- */ +- private final IndexReader reader; ++ /** ++ * The IndexReader in use by the lucene hits. ++ */ ++ private final IndexReader reader; + = +- /** +- * The scorer for the query. +- */ +- private final Scorer scorer; ++ /** ++ * The scorer for the query. ++ */ ++ private final Scorer scorer; + = +- public LuceneQueryHits(IndexReader reader, +- IndexSearcher searcher, +- Query query) +- throws IOException { +- this.reader =3D reader; +- this.scorer =3D query.weight(searcher).scorer(reader); +- } ++ /** ++ * Release IndexReader on LuceneQueryHits.close(). ++ */ ++ private final boolean releaseReaderOnClose; + = +- /** +- * {@inheritDoc} +- */ +- public ScoreNode nextScoreNode() throws IOException { +- if (!scorer.next()) { +- return null; +- } +- int doc =3D scorer.doc(); +- String uuid =3D reader.document(doc).get(FieldNames.UUID); +- return new ScoreNode(uuid, scorer.score(), doc); +- } ++ public LuceneQueryHits(IndexReader reader, IndexSearcher searcher, Que= ry query) throws IOException ++ { ++ this(reader, searcher, query, false); ++ } + = +- /** +- * {@inheritDoc} +- */ +- public void close() throws IOException { +- // make sure scorer frees resources +- scorer.skipTo(Integer.MAX_VALUE); +- } ++ /** ++ * Constructor. ++ * = ++ * @param reader IndexReader ++ * @param searcher IndexSearcher ++ * @param query Query ++ * @param releaseReaderOnClose - release IndexReader on LuceneQueryHit= s.close(). ++ * @throws IOException ++ */ ++ public LuceneQueryHits(IndexReader reader, IndexSearcher searcher, Que= ry query, boolean releaseReaderOnClose) ++ throws IOException ++ { ++ this.reader =3D reader; ++ this.scorer =3D query.weight(searcher).scorer(reader); ++ this.releaseReaderOnClose =3D releaseReaderOnClose; ++ } + = +- /** +- * @return always -1. +- */ +- public int getSize() { +- return -1; +- } ++ /** ++ * {@inheritDoc} ++ */ ++ public ScoreNode nextScoreNode() throws IOException ++ { ++ if (!scorer.next()) ++ { ++ return null; ++ } ++ int doc =3D scorer.doc(); ++ String uuid =3D reader.document(doc).get(FieldNames.UUID); ++ return new ScoreNode(uuid, scorer.score(), doc); ++ } + = +- /** +- * {@inheritDoc} +- */ +- public void skip(int n) throws IOException { +- while (n-- > 0) { +- if (nextScoreNode() =3D=3D null) { +- return; +- } +- } +- } ++ /** ++ * {@inheritDoc} ++ */ ++ public void close() throws IOException ++ { ++ // make sure scorer frees resources ++ scorer.skipTo(Integer.MAX_VALUE); ++ ++ if (releaseReaderOnClose && reader !=3D null && reader instanceof R= eleaseableIndexReader) ++ { ++ ((ReleaseableIndexReader)reader).release(); ++ } ++ } ++ ++ /** ++ * @return always -1. ++ */ ++ public int getSize() ++ { ++ return -1; ++ } ++ ++ /** ++ * {@inheritDoc} ++ */ ++ public void skip(int n) throws IOException ++ { ++ while (n-- > 0) ++ { ++ if (nextScoreNode() =3D=3D null) ++ { ++ return; ++ } ++ } ++ } + } +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/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 +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/query/lucene/SearchIndex.java (revision 4627) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/query/lucene/SearchIndex.java (working copy) +@@ -2716,7 +2716,7 @@ + IndexSearcher searcher =3D new IndexSearcher(reader); + searcher.setSimilarity(getSimilarity()); + = +- return new LuceneQueryHits(reader, searcher, query); ++ return new LuceneQueryHits(reader, searcher, query, true); + } + = + /** +Index: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/i= mpl/core/query/SearchManager.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/query/SearchManager.java (revision 4627) ++++ exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl= /core/query/SearchManager.java (working copy) +@@ -756,9 +756,10 @@ + private Set getNodes(final org.apache.lucene.search.Query quer= y) throws RepositoryException + { + Set result =3D new HashSet(); ++ QueryHits hits =3D null; + try + { +- QueryHits hits =3D handler.executeQuery(query); ++ hits =3D handler.executeQuery(query); + = + ScoreNode sn; + = +@@ -767,12 +768,26 @@ + // Node node =3D session.getNodeById(sn.getNodeId()); + result.add(sn.getNodeId()); + } ++ return result; + } + catch (IOException e) + { + throw new RepositoryException(e.getLocalizedMessage(), e); + } +- return result; ++ finally ++ { ++ if (hits !=3D null) ++ { ++ try ++ { ++ hits.close(); ++ } ++ catch (IOException e) ++ { ++ log.error("Can not close QueryHits.", e); ++ } ++ } ++ } + } + = + private boolean isPrefixMatch(final InternalQName value, final String = prefix) throws RepositoryException --===============3793910161159098907==-- From do-not-reply at jboss.org Thu Jul 14 05:11:41 2011 Content-Type: multipart/mixed; boundary="===============6937269742986260729==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4630 - kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/services/naming. Date: Thu, 14 Jul 2011 05:11:41 -0400 Message-ID: <201107140911.p6E9BfmW025501@svn01.web.mwc.hst.phx2.redhat.com> --===============6937269742986260729== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-14 05:11:41 -0400 (Thu, 14 Jul 2011) New Revision: 4630 Modified: kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/s= ervices/naming/InitialContextInitializer.java Log: EXOJCR-1425: Close all database connections, Bind datasources after context= is replaced 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 2011-07-14 08:38:04 UTC (rev= 4629) +++ kernel/trunk/exo.kernel.component.common/src/main/java/org/exoplatform/= services/naming/InitialContextInitializer.java 2011-07-14 09:11:41 UTC (rev= 4630) @@ -118,16 +118,6 @@ = ValueParam bindingStorePathParam =3D params.getValueParam(BINDINGS_S= TORE_PATH); = - // binder - if (bindingStorePathParam =3D=3D null) - { - binder =3D new InitialContextBinder(this, DEFAULT_BINDING_STORE_P= ATH); - } - else - { - binder =3D new InitialContextBinder(this, bindingStorePathParam.g= etValue()); - } - = if (LOG.isDebugEnabled()) { LOG.debug("The default initial context factory is " + DEFAULT_INI= TIAL_CONTEXT_FACTORY); = @@ -140,6 +130,16 @@ .setProperty(Context.INITIAL_CONTEXT_FACTORY, ExoContainerCont= extFactory.class.getName()); = } + + // binder + 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) --===============6937269742986260729==-- From do-not-reply at jboss.org Thu Jul 14 06:11:06 2011 Content-Type: multipart/mixed; boundary="===============3264461062055158579==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4631 - kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/commons/test. Date: Thu, 14 Jul 2011 06:11:06 -0400 Message-ID: <201107141011.p6EAB60r005120@svn01.web.mwc.hst.phx2.redhat.com> --===============3264461062055158579== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-14 06:11:06 -0400 (Thu, 14 Jul 2011) New Revision: 4631 Modified: kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/commo= ns/test/TestSecurityManager.java Log: EXOJCR-1429: small fix 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 2011-07-14 09:11:41 UTC (rev 4630) +++ kernel/trunk/exo.kernel.commons.test/src/main/java/org/exoplatform/comm= ons/test/TestSecurityManager.java 2011-07-14 10:11:06 UTC (rev 4631) @@ -114,11 +114,14 @@ } = // Only for debug purpose - // if (!se.getMessage().equals( - // "access denied (java.lang.RuntimePermission.com.sun= .xml.internal.bind.v2.runtime.reflect)")) + // if (!se + // .getMessage() + // .equals( + // "access denied (java.lang.RuntimePermission acce= ssClassInPackage.com.sun.xml.internal.bind.v2.runtime.reflect)")) // { // se.printStackTrace(); // } + throw se; } } --===============3264461062055158579==-- From do-not-reply at jboss.org Thu Jul 14 07:26:01 2011 Content-Type: multipart/mixed; boundary="===============8734795144083119839==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4632 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core/query and 2 other directories. Date: Thu, 14 Jul 2011 07:26:01 -0400 Message-ID: <201107141126.p6EBQ17J018913@svn01.web.mwc.hst.phx2.redhat.com> --===============8734795144083119839== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-14 07:25:59 -0400 (Thu, 14 Jul 2011) New Revision: 4632 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/core/WorkspaceContainerFacade.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/SearchManager.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/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/MultiIndex.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/SearchIndex.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/VolatileIndex.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java Log: EXOJCR-1429: reverted performance regression made by r2599 commit. removed = some unnecessary privileged wrappings Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/core/WorkspaceContainerFacade.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/WorkspaceContainerFacade.java 2011-07-14 10:11:06 UTC (rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/WorkspaceContainerFacade.java 2011-07-14 11:25:59 UTC (rev 4632) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.core; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions; import org.exoplatform.services.jcr.impl.ReadOnlySupport; import org.exoplatform.services.jcr.impl.WorkspaceContainer; @@ -25,6 +26,8 @@ import org.exoplatform.services.jcr.impl.backup.SuspendException; import org.exoplatform.services.jcr.impl.backup.Suspendable; = +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.Collections; import java.util.List; = @@ -163,7 +166,7 @@ * @param state * @throws RepositoryException */ - public void setState(int state) throws RepositoryException + public void setState(final int state) throws RepositoryException { // Need privileges to manage repository. SecurityManager security =3D System.getSecurityManager(); @@ -172,22 +175,44 @@ security.checkPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_= PERMISSION); } = - switch (state) + try { - case ManageableRepository.ONLINE : - setOnline(); - break; - case ManageableRepository.OFFLINE : - break; - case ManageableRepository.READONLY : - setReadOnly(true); - break; - case ManageableRepository.SUSPENDED : - suspend(); - break; - default : - return; + SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptio= nAction() + { + public Void run() throws RepositoryException + { + switch (state) + { + case ManageableRepository.ONLINE : + setOnline(); + break; + case ManageableRepository.OFFLINE : + break; + case ManageableRepository.READONLY : + setReadOnly(true); + break; + case ManageableRepository.SUSPENDED : + suspend(); + break; + default : + return null; + } + return null; + } + }); } + catch (PrivilegedActionException e) + { + Throwable cause =3D e.getCause(); + if (cause instanceof RepositoryException) + { + throw new RepositoryException(cause); + } + else + { + throw new RuntimeException(cause); + } + } } = /** 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 2011-07-14 10:11:06 UTC (rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/ErrorLog.java 2011-07-14 11:25:59 UTC (rev 4632) @@ -18,21 +18,17 @@ package org.exoplatform.services.jcr.impl.core.query; = import org.exoplatform.commons.utils.PrivilegedFileHelper; -import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -101,29 +97,22 @@ */ private void openFile(final File log) throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + // set file size; + if (!PrivilegedFileHelper.exists(log)) { - public Object run() throws Exception - { - // set file size; - if (!log.exists()) - { - log.getParentFile().mkdirs(); - log.createNewFile(); + PrivilegedFileHelper.mkdirs(log.getParentFile()); + PrivilegedFileHelper.createNewFile(log); = - out =3D PrivilegedFileHelper.fileOutputStream(log).getChann= el(); - out.position(1024 * fileSize - 1); - out.write(ByteBuffer.wrap(new byte[]{0})); - out.position(0); - out.force(false); - } - else - { - out =3D new FileOutputStream(log, true).getChannel(); - } - return null; - } - }); + out =3D PrivilegedFileHelper.fileOutputStream(log).getChannel(); + out.position(1024 * fileSize - 1); + out.write(ByteBuffer.wrap(new byte[]{0})); + out.position(0); + out.force(false); + } + else + { + out =3D PrivilegedFileHelper.fileOutputStream(log, true).getChann= el(); + } } = /** @@ -137,14 +126,7 @@ public void append(final String action, final String uuid) throws IOExc= eption { initOut(); - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() - { - public Object run() throws Exception - { - out.write(ByteBuffer.wrap((action + " " + uuid + "\n").getByte= s())); - return null; - } - }); + out.write(ByteBuffer.wrap((action + " " + uuid + "\n").getBytes())); } = /** @@ -155,17 +137,10 @@ */ public void flush() throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + if (out !=3D null) { - public Object run() throws Exception - { - if (out !=3D null) - { - out.force(false); - } - return null; - } - }); + out.force(false); + } } = /** @@ -176,23 +151,16 @@ */ public void clear() throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + if (out !=3D null) { - public Object run() throws Exception - { - if (out !=3D null) - { - out.truncate(0); - out.close(); - out =3D new FileOutputStream(logFile).getChannel(); - out.position(1024 * fileSize - 1); - out.write(ByteBuffer.wrap(new byte[]{0})); - out.position(0); - out.force(false); - } - return null; - } - }); + out.truncate(0); + out.close(); + out =3D PrivilegedFileHelper.fileOutputStream(logFile).getChannel= (); + out.position(1024 * fileSize - 1); + out.write(ByteBuffer.wrap(new byte[]{0})); + out.position(0); + out.force(false); + } } = /** @@ -203,18 +171,11 @@ */ private void initOut() throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + if (out =3D=3D null) { - public Object run() throws Exception - { - if (out =3D=3D null) - { - FileOutputStream os =3D new FileOutputStream(logFile, false= ); - out =3D os.getChannel(); - } - return null; - } - }); + FileOutputStream os =3D PrivilegedFileHelper.fileOutputStream(log= File, false); + out =3D os.getChannel(); + } } = /** @@ -225,42 +186,36 @@ */ public List readList() throws IOException { - return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedEx= ceptionAction>() + InputStream in =3D PrivilegedFileHelper.fileInputStream(logFile); + try { - public List run() throws Exception + List list =3D new ArrayList(); + BufferedReader reader =3D new BufferedReader(new InputStreamReade= r(in)); + String line; + while ((line =3D reader.readLine()) !=3D null) { - InputStream in =3D new FileInputStream(logFile); - try + if (!line.matches("\\x00++")) { - List list =3D new ArrayList(); - BufferedReader reader =3D new BufferedReader(new InputStrea= mReader(in)); - String line; - while ((line =3D reader.readLine()) !=3D null) - { - if (!line.matches("\\x00++")) - { - list.add(line); - } - } - return list; + list.add(line); + } + } + return list; = + } + finally + { + if (in !=3D null) + { + try + { + in.close(); } - finally + catch (IOException e) { - if (in !=3D null) - { - try - { - in.close(); - } - catch (IOException e) - { - LOG.warn("Exception while closing error log: " + e.to= String()); - } - } + LOG.warn("Exception while closing error log: " + e.toString= ()); } } - }); + } } = public void readChanges(Set rem, Set add) throws IOExce= ption @@ -317,24 +272,17 @@ */ public void close() { - SecurityHelper.doPrivilegedAction(new PrivilegedAction() + if (out !=3D null) { - public Object run() + try { - if (out !=3D null) - { - try - { - out.close(); - } - catch (IOException e) - { - out =3D null; - } - } - return null; + out.close(); } - }); + catch (IOException e) + { + out =3D null; + } + } } = } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/SearchManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/SearchManager.java 2011-07-14 10:11:06 UTC (rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/SearchManager.java 2011-07-14 11:25:59 UTC (rev 4632) @@ -22,7 +22,6 @@ import org.apache.lucene.search.BooleanQuery; import org.apache.lucene.search.WildcardQuery; import org.exoplatform.commons.utils.PrivilegedFileHelper; -import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.container.ExoContainerContext; import org.exoplatform.container.configuration.ConfigurationManager; import org.exoplatform.management.annotations.Managed; @@ -88,8 +87,6 @@ import java.io.Serializable; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; @@ -517,7 +514,7 @@ /** * {@inheritDoc} */ - public void onSaveItems(ItemStateChangesLog itemStates) + public void onSaveItems(final ItemStateChangesLog itemStates) { //skip empty if (itemStates.getSize() > 0) @@ -1454,35 +1451,7 @@ = if (handler instanceof Suspendable) { - PrivilegedExceptionAction action =3D new PrivilegedExcept= ionAction() - { - public Object run() throws Exception - { - ((Suspendable)handler).resume(); - return null; - } - }; - try - { - SecurityHelper.doPrivilegedExceptionAction(action); - } - catch (PrivilegedActionException pae) - { - Throwable cause =3D pae.getCause(); - - if (cause instanceof ResumeException) - { - throw (ResumeException)cause; - } - else if (cause instanceof RuntimeException) - { - throw (RuntimeException)cause; - } - else - { - throw new RuntimeException(cause); - } - } = + ((Suspendable)handler).resume(); } = isSuspended =3D false; 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 2011-07-14 10:11:06 UTC (= rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/ConsistencyCheck.java 2011-07-14 11:25:59 UTC (= rev 4632) @@ -17,14 +17,12 @@ 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.slf4j.Logger; import org.slf4j.LoggerFactory; = import java.io.IOException; -import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -121,15 +119,8 @@ { if (error.repairable()) { - SecurityHelper.doPrivilegedIOExceptionAction(new Privileged= ExceptionAction() - { - public Object run() throws Exception - { - // running in privileged mode - error.repair(); - return null; - } - }); + // running in privileged mode + error.repair(); } else { @@ -180,7 +171,7 @@ Set multipleEntries =3D new HashSet(); // collect all documents UUIDs documentUUIDs =3D new HashSet(); - final CachingMultiIndexReader reader =3D index.getIndexReader(); + CachingMultiIndexReader reader =3D index.getIndexReader(); try { for (int i =3D 0; i < reader.maxDoc(); i++) @@ -195,14 +186,7 @@ continue; } final int currentIndex =3D i; - Document d =3D SecurityHelper.doPrivilegedIOExceptionAction(ne= w PrivilegedExceptionAction() - { - public Document run() throws Exception - { - return reader.document(currentIndex, FieldSelectors.UUID= ); - } - }); - + Document d =3D reader.document(currentIndex, FieldSelectors.UU= ID); String uuid =3D d.get(FieldNames.UUID); if (stateMgr.getItemData(uuid) !=3D null) { @@ -219,14 +203,7 @@ } finally { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExcept= ionAction() - { - public Object run() throws Exception - { - reader.release(); - return null; - } - }); + reader.release(); } = // create multiple entries errors @@ -235,30 +212,23 @@ errors.add(new MultipleEntries((String)it.next())); } = - final CachingMultiIndexReader newReader =3D index.getIndexReader(); + reader =3D index.getIndexReader(); try { // run through documents again and check parent - for (int i =3D 0; i < newReader.maxDoc(); i++) + for (int i =3D 0; i < reader.maxDoc(); i++) { - if (i > 10 && i % (newReader.maxDoc() / 5) =3D=3D 0) + if (i > 10 && i % (reader.maxDoc() / 5) =3D=3D 0) { - long progress =3D Math.round((100.0 * i) / (newReader.maxDo= c() * 2f)); + long progress =3D Math.round((100.0 * i) / (reader.maxDoc()= * 2f)); log.info("progress: " + (progress + 50) + "%"); } - if (newReader.isDeleted(i)) + if (reader.isDeleted(i)) { continue; } final int currentIndex =3D i; - Document d =3D SecurityHelper.doPrivilegedIOExceptionAction(ne= w PrivilegedExceptionAction() - { - public Document run() throws Exception - { - return newReader.document(currentIndex, FieldSelectors.U= UID_AND_PARENT); - } - }); - + Document d =3D reader.document(currentIndex, FieldSelectors.UU= ID_AND_PARENT); String uuid =3D d.get(FieldNames.UUID); String parentUUIDString =3D d.get(FieldNames.PARENT); = @@ -281,14 +251,7 @@ } finally { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExcept= ionAction() - { - public Object run() throws Exception - { - newReader.release(); - return null; - } - }); + reader.release(); } } = 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 2011-07-14 10:1= 1:06 UTC (rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java 2011-07-14 11:2= 5:59 UTC (rev 4632) @@ -16,17 +16,15 @@ */ package org.exoplatform.services.jcr.impl.core.query.lucene; = -import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.commons.utils.PrivilegedFileHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.exoplatform.services.log.ExoLogger; +import org.exoplatform.services.log.Log; = import java.io.BufferedOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.security.PrivilegedExceptionAction; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -37,7 +35,7 @@ = /** * The class NamespaceMappings implements a - * {@link NamespaceResolver} that holds a namespace + * NamespaceResolver that holds a namespace * mapping that is used internally in the search index. Storing paths with= the * full uri of a namespace would require too much space in the search inde= x. *

@@ -51,7 +49,7 @@ /** * Default logger instance for this class */ - private static Logger log =3D LoggerFactory.getLogger("exo.jcr.componen= t.core.NamespaceMappings"); + private static Log log =3D ExoLogger.getLogger("exo.jcr.component.core.= NamespaceMappings"); = /** * Location of the file that persists the uri / prefix mappings @@ -149,40 +147,33 @@ */ private void load() throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + if (PrivilegedFileHelper.exists(storage)) { - public Object run() throws Exception + InputStream in =3D PrivilegedFileHelper.fileInputStream(storage); + try { - if (storage.exists()) - { - InputStream in =3D PrivilegedFileHelper.fileInputStream(sto= rage); - try - { - Properties props =3D new Properties(); - log.debug("loading namespace mappings..."); - props.load(in); + Properties props =3D new Properties(); + log.debug("loading namespace mappings..."); + props.load(in); = - // read mappings from properties - Iterator iter =3D props.keySet().iterator(); - while (iter.hasNext()) - { - String prefix =3D (String)iter.next(); - String uri =3D props.getProperty(prefix); - log.debug(prefix + " -> " + uri); - prefixToURI.put(prefix, uri); - uriToPrefix.put(uri, prefix); - } - prefixCount =3D props.size(); - log.debug("namespace mappings loaded."); - } - finally - { - in.close(); - } + // read mappings from properties + Iterator iter =3D props.keySet().iterator(); + while (iter.hasNext()) + { + String prefix =3D (String)iter.next(); + String uri =3D props.getProperty(prefix); + log.debug(prefix + " -> " + uri); + prefixToURI.put(prefix, uri); + uriToPrefix.put(uri, prefix); } - return null; + prefixCount =3D props.size(); + log.debug("namespace mappings loaded."); } - }); + finally + { + in.close(); + } + } } = /** @@ -192,35 +183,28 @@ */ private void store() throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + Properties props =3D new Properties(); + + // store mappings in properties + Iterator iter =3D prefixToURI.keySet().iterator(); + while (iter.hasNext()) { - public Object run() throws Exception - { - Properties props =3D new Properties(); + String prefix =3D (String)iter.next(); + String uri =3D (String)prefixToURI.get(prefix); + props.setProperty(prefix, uri); + } = - // store mappings in properties - Iterator iter =3D prefixToURI.keySet().iterator(); - while (iter.hasNext()) - { - String prefix =3D (String)iter.next(); - String uri =3D (String)prefixToURI.get(prefix); - props.setProperty(prefix, uri); - } - - OutputStream out =3D PrivilegedFileHelper.fileOutputStream(sto= rage); - try - { - out =3D new BufferedOutputStream(out); - props.store(out, null); - } - finally - { - // make sure stream is closed - out.close(); - } - return null; - } - }); + OutputStream out =3D PrivilegedFileHelper.fileOutputStream(storage); + try + { + out =3D new BufferedOutputStream(out); + props.store(out, null); + } + finally + { + // make sure stream is closed + out.close(); + } } = public String[] getAllNamespacePrefixes() throws RepositoryException 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 2011-07-14 10:11:06 UTC (rev= 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/IndexingQueue.java 2011-07-14 11:25:59 UTC (rev= 4632) @@ -19,12 +19,10 @@ import org.apache.lucene.document.Document; import org.apache.lucene.index.Term; import org.apache.lucene.index.TermDocs; -import org.exoplatform.commons.utils.SecurityHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; = import java.io.IOException; -import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -79,60 +77,52 @@ */ void initialize(final MultiIndex index) throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + if (initialized) { - public Object run() throws Exception + throw new IllegalStateException("already initialized"); + } + // check index for nodes that need to be reindexed + CachingMultiIndexReader reader =3D index.getIndexReader(); + try + { + TermDocs tDocs =3D reader.termDocs(new Term(FieldNames.REINDEXING= _REQUIRED, "")); + try { - if (initialized) + while (tDocs.next()) { - throw new IllegalStateException("already initialized"); + queueStore.addUUID(reader.document(tDocs.doc(), FieldSelect= ors.UUID).get(FieldNames.UUID)); } - // check index for nodes that need to be reindexed - CachingMultiIndexReader reader =3D index.getIndexReader(); - try - { - TermDocs tDocs =3D reader.termDocs(new Term(FieldNames.REIN= DEXING_REQUIRED, "")); - try - { - while (tDocs.next()) - { - queueStore.addUUID(reader.document(tDocs.doc(), Field= Selectors.UUID).get(FieldNames.UUID)); - } - } - finally - { - tDocs.close(); - } - } - finally - { - reader.release(); - } - String[] uuids =3D queueStore.getPending(); - for (int i =3D 0; i < uuids.length; i++) - { - try - { - Document doc =3D index.createDocument(uuids[i]); - pendingDocuments.put(uuids[i], doc); - log.debug("added node {}. New size of indexing queue: {}= ", uuids[i], new Integer(pendingDocuments - .size())); - } - catch (IllegalArgumentException e) - { - log.warn("Invalid UUID in indexing queue store: " + uuid= s[i]); - } - catch (RepositoryException e) - { - // node does not exist anymore - log.debug("Node with uuid {} does not exist anymore", uu= ids[i]); - queueStore.removeUUID(uuids[i]); - } - } - initialized =3D true; - return null; } - }); + finally + { + tDocs.close(); + } + } + finally + { + reader.release(); + } + String[] uuids =3D queueStore.getPending(); + for (int i =3D 0; i < uuids.length; i++) + { + try + { + Document doc =3D index.createDocument(uuids[i]); + pendingDocuments.put(uuids[i], doc); + log.debug("added node {}. New size of indexing queue: {}", uui= ds[i], new Integer(pendingDocuments.size())); + } + catch (IllegalArgumentException e) + { + log.warn("Invalid UUID in indexing queue store: " + uuids[i]); + } + catch (RepositoryException e) + { + // node does not exist anymore + log.debug("Node with uuid {} does not exist anymore", uuids[i]= ); + queueStore.removeUUID(uuids[i]); + } + } + initialized =3D true; } = /** 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 2011-07-14 10:11:06 UTC= (rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/IndexingQueueStore.java 2011-07-14 11:25:59 UTC= (rev 4632) @@ -17,7 +17,6 @@ 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.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,8 +25,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.security.PrivilegedAction; -import java.security.PrivilegedExceptionAction; import java.util.HashSet; import java.util.Set; = @@ -121,27 +118,20 @@ */ public void close() { - SecurityHelper.doPrivilegedAction(new PrivilegedAction() + if (pending.isEmpty()) { - public Object run() + try { - if (pending.isEmpty()) + if (dir.fileExists(INDEXING_QUEUE_FILE)) { - try - { - if (dir.fileExists(INDEXING_QUEUE_FILE)) - { - dir.deleteFile(INDEXING_QUEUE_FILE); - } - } - catch (IOException e) - { - log.warn("unable to delete " + INDEXING_QUEUE_FILE); - } + dir.deleteFile(INDEXING_QUEUE_FILE); } - return null; } - }); + catch (IOException e) + { + log.warn("unable to delete " + INDEXING_QUEUE_FILE); + } + } } = //----------------------------< internal >-----------------------------= ----- @@ -154,52 +144,45 @@ */ private void readStore() throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + if (dir.fileExists(INDEXING_QUEUE_FILE)) { - public Object run() throws Exception + InputStream in =3D new IndexInputStream(dir.openInput(INDEXING_QU= EUE_FILE)); + BufferedReader reader =3D new BufferedReader(new InputStreamReade= r(in, ENCODING)); + try { - if (dir.fileExists(INDEXING_QUEUE_FILE)) + String line; + while ((line =3D reader.readLine()) !=3D null) { - InputStream in =3D new IndexInputStream(dir.openInput(INDEX= ING_QUEUE_FILE)); - BufferedReader reader =3D new BufferedReader(new InputStrea= mReader(in, ENCODING)); - try + int idx =3D line.indexOf(' '); + if (idx =3D=3D -1) { - String line; - while ((line =3D reader.readLine()) !=3D null) + // invalid line + log.warn("invalid line in {}: {}", INDEXING_QUEUE_FILE, = line); + } + else + { + String cmd =3D line.substring(0, idx); + String uuid =3D line.substring(idx + 1, line.length()); + if (ADD.equals(cmd)) { - int idx =3D line.indexOf(' '); - if (idx =3D=3D -1) - { - // invalid line - log.warn("invalid line in {}: {}", INDEXING_QUEUE_= FILE, line); - } - else - { - String cmd =3D line.substring(0, idx); - String uuid =3D line.substring(idx + 1, line.lengt= h()); - if (ADD.equals(cmd)) - { - pending.add(uuid); - } - else if (REMOVE.equals(cmd)) - { - pending.remove(uuid); - } - else - { - // invalid line - log.warn("invalid line in {}: {}", INDEXING_QUE= UE_FILE, line); - } - } + pending.add(uuid); } + else if (REMOVE.equals(cmd)) + { + pending.remove(uuid); + } + else + { + // invalid line + log.warn("invalid line in {}: {}", INDEXING_QUEUE_FIL= E, line); + } } - finally - { - in.close(); - } } - return null; } - }); + finally + { + in.close(); + } + } } } 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 2011-07-14 10:11:06 UTC (rev 46= 31) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/MultiIndex.java 2011-07-14 11:25:59 UTC (rev 46= 32) @@ -350,21 +350,14 @@ = // set index format version and at the same time // initialize hierarchy cache if requested. - final CachingMultiIndexReader reader =3D getIndexReader(handler.isIn= itializeHierarchyCache()); + CachingMultiIndexReader reader =3D getIndexReader(handler.isInitiali= zeHierarchyCache()); try { version =3D IndexFormatVersion.getVersion(reader); } finally { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExcept= ionAction() - { - public Object run() throws Exception - { - reader.release(); - return null; - } - }); + reader.release(); } indexingQueue.initialize(this); if (modeHandler.getMode() =3D=3D IndexerIoMode.READ_WRITE) @@ -406,21 +399,14 @@ } else { - final CachingMultiIndexReader reader =3D getIndexReader(); + CachingMultiIndexReader reader =3D getIndexReader(); try { return reader.numDocs(); } finally { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExc= eptionAction() - { - public Object run() throws Exception - { - reader.release(); - return null; - } - }); + reader.release(); } } } @@ -473,8 +459,8 @@ } else { - log.info("Index can'b be retrieved from coordinator now,= because it is offline. " + - "Possibly coordinator node performs reindexing now= . Switching to local re-indexing."); + log.info("Index can'b be retrieved from coordinator now,= because it is offline. " + + "Possibly coordinator node performs reindexing now.= Switching to local re-indexing."); } } = @@ -484,13 +470,13 @@ { if (handler.getContext().getRPCService() =3D=3D null) { - log.error("RPC Service is not configured but required= for copying the index " + - "from coordinator node. Index will be created b= y re-indexing."); + log.error("RPC Service is not configured but required= for copying the index " + + "from coordinator node. Index will be created by= re-indexing."); } else if (handler.getContext().getRPCService().isCoordina= tor() =3D=3D true) { - log.info("Copying the index from coordinator configur= ed, but this node is the " + - "only one in a cluster. Index will be created b= y re-indexing."); + log.info("Copying the index from coordinator configur= ed, but this node is the " + + "only one in a cluster. Index will be created by= re-indexing."); } } = @@ -759,76 +745,69 @@ */ private void doUpdateRW(final Collection remove, final Collecti= on add) throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + // make sure a reader is available during long updates + if (add.size() > handler.getBufferSize()) { - public Object run() throws Exception + try { - // make sure a reader is available during long updates - if (add.size() > handler.getBufferSize()) + releaseMultiReader(); + } + catch (IOException e) + { + // do not fail if an exception is thrown here + log.warn("unable to prepare index reader " + "for queries duri= ng update", e); + } + } + + synchronized (updateMonitor) + { + //updateInProgress =3D true; + indexUpdateMonitor.setUpdateInProgress(true, false); + } + boolean flush =3D false; + try + { + long transactionId =3D nextTransactionId++; + executeAndLog(new Start(transactionId)); + + for (Iterator it =3D remove.iterator(); it.hasNext();) + { + executeAndLog(new DeleteNode(transactionId, it.next())); + } + for (Iterator it =3D add.iterator(); it.hasNext();) + { + Document doc =3D it.next(); + if (doc !=3D null) { - try - { - releaseMultiReader(); - } - 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); - } + executeAndLog(new AddNode(transactionId, doc)); + // commit volatile index if needed + flush |=3D checkVolatileCommit(); } + } + 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 update synchronized (updateMonitor) { - //updateInProgress =3D true; - indexUpdateMonitor.setUpdateInProgress(true, false); + indexUpdateMonitor.setUpdateInProgress(true, true); } - boolean flush =3D false; - try - { - long transactionId =3D nextTransactionId++; - executeAndLog(new Start(transactionId)); + flush(); + } + } + finally + { + synchronized (updateMonitor) + { + //updateInProgress =3D false; = - for (Iterator it =3D remove.iterator(); it.hasNext(= );) - { - executeAndLog(new DeleteNode(transactionId, it.next())); - } - for (Iterator it =3D add.iterator(); it.hasNext()= ;) - { - Document doc =3D it.next(); - if (doc !=3D null) - { - executeAndLog(new AddNode(transactionId, doc)); - // commit volatile index if needed - flush |=3D checkVolatileCommit(); - } - } - 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(); - } - } - finally - { - synchronized (updateMonitor) - { - //updateInProgress =3D false; - - indexUpdateMonitor.setUpdateInProgress(false, flush); - updateMonitor.notifyAll(); - releaseMultiReader(); - } - } - return null; + indexUpdateMonitor.setUpdateInProgress(false, flush); + updateMonitor.notifyAll(); + releaseMultiReader(); } - }); + } } = private void invokeOfflineIndex() throws IOException @@ -1158,18 +1137,11 @@ { time =3D System.currentTimeMillis(); } - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExcept= ionAction() - { - public Object run() throws Exception - { - index.getReadOnlyIndexReader(true).release(); - return null; - } - }); + index.getReadOnlyIndexReader(true).release(); if (log.isDebugEnabled()) { time =3D System.currentTimeMillis() - time; - log.debug("hierarchy cache initialized in {} ms", new Long(tim= e)); = + log.debug("hierarchy cache initialized in {} ms", new Long(tim= e)); } } = @@ -1559,22 +1531,22 @@ } } } - executeAndLog(new Commit(getTransactionId())); - = - indexNames.write(); + executeAndLog(new Commit(getTransactionId())); = - // reset redo log - redoLog.clear(); + indexNames.write(); = - lastFlushTime =3D System.currentTimeMillis(); - lastFileSystemFlushTime =3D System.currentTimeMillis(); - } + // reset redo log + redoLog.clear(); = - // delete obsolete indexes - attemptDelete(); - return null; - } - }); + lastFlushTime =3D System.currentTimeMillis(); + lastFileSystemFlushTime =3D System.currentTimeMillis(); + } + + // delete obsolete indexes + attemptDelete(); + return null; + } + }); } = /** @@ -1649,35 +1621,28 @@ */ private void scheduleFlushTask() { - SecurityHelper.doPrivilegedAction(new PrivilegedAction() + // cancel task + if (flushTask !=3D null) { - public Object run() + 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() { - // 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; + // 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(); } = /** @@ -1783,7 +1748,7 @@ if (log.isDebugEnabled()) { time =3D System.currentTimeMillis() - time; - log.debug("Committed in-memory index in " + time + "ms."); = = + log.debug("Committed in-memory index in " + time + "ms."); } } } @@ -2046,25 +2011,18 @@ */ private void removeDeletable() { - SecurityHelper.doPrivilegedAction(new PrivilegedAction() + String fileName =3D "deletable"; + try { - public Object run() + if (indexDir.fileExists(fileName)) { - 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; + indexDir.deleteFile(fileName); } - }); + } + catch (IOException e) + { + log.warn("Unable to remove file 'deletable'.", e); + } } = /** @@ -2540,8 +2498,8 @@ /** * 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; + private static final int ENTRY_LENGTH =3D Long.toString(Long.MAX_VAL= UE).length() + Action.ADD_NODE.length() + + Constants.UUID_FORMATTED_LENGTH + 2; = /** * The uuid of the node to add. @@ -2942,8 +2900,8 @@ /** * 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; + private static final int ENTRY_LENGTH =3D Long.toString(Long.MAX_VAL= UE).length() + Action.DELETE_NODE.length() + + Constants.UUID_FORMATTED_LENGTH + 2; = /** * The uuid of the node to remove. 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 2011-07-14 10:11:06 UTC (r= ev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/PersistentIndex.java 2011-07-14 11:25:59 UTC (r= ev 4632) @@ -23,11 +23,9 @@ 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 java.io.IOException; -import java.security.PrivilegedExceptionAction; = /** * Implements a lucene index which is based on a @@ -64,14 +62,7 @@ this.name =3D name; if (isExisting()) { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExcept= ionAction() - { - public Object run() throws Exception - { - IndexMigration.migrate(PersistentIndex.this, directoryManag= er); - return null; - } - }); + IndexMigration.migrate(PersistentIndex.this, directoryManager); } } = @@ -98,17 +89,10 @@ * @param readers the readers of indexes to add. * @throws IOException if an error occurs while adding indexes. */ - void addIndexes(final IndexReader[] readers) throws IOException + void addIndexes(IndexReader[] readers) throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() - { - public Object run() throws Exception - { - getIndexWriter().addIndexes(readers); - getIndexWriter().optimize(); - return null; - } - }); + getIndexWriter().addIndexes(readers); + getIndexWriter().optimize(); } = /** @@ -121,47 +105,40 @@ */ void copyIndex(final AbstractIndex index) throws IOException { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + // commit changes to directory on other index. + index.commit(true); + // simply copy over the files + byte[] buffer =3D new byte[1024]; + Directory dir =3D index.getDirectory(); + Directory dest =3D getDirectory(); + String[] files =3D dir.list(); + for (int i =3D 0; i < files.length; i++) { - public Object run() throws Exception + IndexInput in =3D dir.openInput(files[i]); + try { - // commit changes to directory on other index. - index.commit(true); - // simply copy over the files - byte[] buffer =3D new byte[1024]; - Directory dir =3D index.getDirectory(); - Directory dest =3D getDirectory(); - String[] files =3D dir.list(); - for (int i =3D 0; i < files.length; i++) + IndexOutput out =3D dest.createOutput(files[i]); + try { - IndexInput in =3D dir.openInput(files[i]); - try + long remaining =3D in.length(); + while (remaining > 0) { - IndexOutput out =3D dest.createOutput(files[i]); - try - { - long remaining =3D in.length(); - while (remaining > 0) - { - int num =3D (int)Math.min(remaining, buffer.length= ); - in.readBytes(buffer, 0, num); - out.writeBytes(buffer, num); - remaining -=3D num; - } - } - finally - { - out.close(); - } + int num =3D (int)Math.min(remaining, buffer.length); + in.readBytes(buffer, 0, num); + out.writeBytes(buffer, num); + remaining -=3D num; } - finally - { - in.close(); - } } - return null; + finally + { + out.close(); + } } - }); + finally + { + in.close(); + } + } } = /** 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 2011-07-14 10:11:06 UTC (rev 4= 631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/SearchIndex.java 2011-07-14 11:25:59 UTC (rev 4= 632) @@ -76,8 +76,6 @@ import java.io.IOException; import java.io.InputStream; import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -585,39 +583,13 @@ { indexDirectory =3D new File(path); = - try - { - SecurityHelper.doPrivilegedExceptionAction((new PrivilegedExce= ptionAction() + if (!indexDirectory.exists()) { - public Object run() throws Exception + if (!indexDirectory.mkdirs()) { - if (!indexDirectory.exists()) - { - if (!indexDirectory.mkdirs()) - { - throw new RepositoryException("fail to create inde= x dir " + path); - } - } - return null; + throw new RepositoryException("fail to create index dir = " + path); } - })); - } - 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 { @@ -644,16 +616,9 @@ else { // read local namespace mappings - final File mapFile =3D new File(indexDirectory, NS_MAPPING_FILE); - boolean fileExists =3D SecurityHelper.doPrivilegedAction(new Priv= ilegedAction() + File mapFile =3D new File(indexDirectory, NS_MAPPING_FILE); + if (mapFile.exists()) { - public Boolean run() - { - return mapFile.exists(); - } - }); - if (fileExists) - { // be backward compatible and use ns_mappings.properties from // index folder nsMappings =3D new FileBasedNamespaceMappings(mapFile); @@ -1597,15 +1562,8 @@ { try { - spCheck =3D SecurityHelper.doPrivilegedIOExceptionAction(new P= rivilegedExceptionAction() - { - public SpellChecker run() throws Exception - { - SpellChecker spCheck =3D spellCheckerClass.newInstance(); - spCheck.init(SearchIndex.this, spellCheckerMinDistance, = spellCheckerMorePopular); - return spCheck; - } - }); + spCheck =3D spellCheckerClass.newInstance(); + spCheck.init(SearchIndex.this, spellCheckerMinDistance, spellC= heckerMorePopular); } catch (Exception e) { 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 2011-07-14 10:11:06 UTC (rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/Util.java 2011-07-14 11:25:59 UTC (rev 4632) @@ -21,7 +21,6 @@ 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; @@ -31,7 +30,6 @@ = import java.io.IOException; import java.io.UnsupportedEncodingException; -import java.security.PrivilegedExceptionAction; import java.util.Iterator; import java.util.regex.Pattern; = @@ -151,21 +149,14 @@ */ public static void closeOrRelease(final IndexReader reader) throws IOEx= ception { - SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedException= Action() + if (reader instanceof ReleaseableIndexReader) { - public Object run() throws Exception - { - if (reader instanceof ReleaseableIndexReader) - { - ((ReleaseableIndexReader)reader).release(); - } - else - { - reader.close(); - } - return null; - } - }); + ((ReleaseableIndexReader)reader).release(); + } + else + { + reader.close(); + } } = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/VolatileIndex.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/VolatileIndex.java 2011-07-14 10:11:06 UTC (rev= 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/VolatileIndex.java 2011-07-14 11:25:59 UTC (rev= 4632) @@ -16,9 +16,6 @@ */ package org.exoplatform.services.jcr.impl.core.query.lucene; = -import java.io.IOException; -import java.util.Map; - import org.apache.commons.collections.map.LinkedMap; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.document.Document; @@ -26,6 +23,9 @@ import org.apache.lucene.search.Similarity; import org.apache.lucene.store.RAMDirectory; = +import java.io.IOException; +import java.util.Map; + /** * Implements an in-memory index with a pending buffer. */ @@ -114,7 +114,7 @@ else { // remove document from index - num =3D super.removeDocument(idTerm); + num =3D super.getIndexReader().deleteDocuments(idTerm); } numDocs -=3D num; return num; 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 2011-07-14 10:11:= 06 UTC (rev 4631) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2011-07-14 11:25:= 59 UTC (rev 4632) @@ -506,9 +506,16 @@ try { long time =3D System.currentTimeMillis= (); - Dictionary dict =3D new LuceneDictiona= ry(reader, FieldNames.FULLTEXT); + final Dictionary dict =3D new LuceneDi= ctionary(reader, FieldNames.FULLTEXT); log.debug("Starting spell checker inde= x refresh"); - spellChecker.indexDictionary(dict); + SecurityHelper.doPrivilegedIOException= Action(new PrivilegedExceptionAction() + { + public Void run() throws IOException + { + spellChecker.indexDictionary(dic= t); + return null; + } + }); time =3D System.currentTimeMillis() - = time; time =3D time / 1000; log.info("Spell checker index refreshe= d in: " + new Long(time) + " s."); --===============8734795144083119839==-- From do-not-reply at jboss.org Fri Jul 15 03:11:32 2011 Content-Type: multipart/mixed; boundary="===============2100520428844034253==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4633 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan and 3 other directories. Date: Fri, 15 Jul 2011 03:11:31 -0400 Message-ID: <201107150711.p6F7BVxx031468@svn01.web.mwc.hst.phx2.redhat.com> --===============2100520428844034253== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-15 03:11:30 -0400 (Fri, 15 Jul 2011) New Revision: 4633 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/itemfilters/PatternQPathEntryFilter.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/infinispan/TestISPNCacheWorkspaceStorageCacheI= nClusterMode.java Log: EXOJCR-1414: Lists stored into the cache can be inconsistent in cluster env= ironment Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/itemfilters/PatternQPathEntryFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/itemfilters/PatternQPathEntryFilter.java 2011-07-14 11:25:59= UTC (rev 4632) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/itemfilters/PatternQPathEntryFilter.java 2011-07-15 07:11:30= UTC (rev 4633) @@ -57,7 +57,6 @@ /** * {@inheritDoc} */ - @Override public boolean isExactName() { return false; @@ -66,7 +65,6 @@ /** * {@inheritDoc} */ - @Override public QPathEntry getQPathEntry() { return entry; @@ -75,7 +73,6 @@ /** * {@inheritDoc} */ - @Override public boolean accept(ItemData item) { if (localNameHasWildcard && localNamePattern =3D=3D null) @@ -108,7 +105,6 @@ /** * {@inheritDoc} */ - @Override public List accept(List itemDat= a) { = @@ -189,7 +185,6 @@ return entry.hashCode(); } = - @Override public void writeExternal(ObjectOutput out) throws IOException { byte[] buf =3D entry.getNamespace().getBytes(Constants.DEFAULT_ENCOD= ING); @@ -206,7 +201,6 @@ /** * {@inheritDoc} */ - @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFo= undException { byte[] buf =3D new byte[in.readInt()]; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/infinispan/BufferedISPNCache.java 2011-07-14 = 11:25:59 UTC (rev 4632) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/infinispan/BufferedISPNCache.java 2011-07-15 = 07:11:30 UTC (rev 4633) @@ -264,6 +264,13 @@ LOG.error("Unexpected object found by key " + key.toString() += ". Expected Set, but found:" + existingObject.getClass().getName()); } + else if (!localMode && cache.getConfiguration().getCacheMode() != =3D CacheMode.LOCAL) + { + // to prevent consistency issue since we don't have the list i= n the local cache, we are in cluster env + // and we are in a non local mode, we clear the list in order = to enforce other cluster nodes to reload it from the db + cache.remove(key); + return; + } } = @Override @@ -321,6 +328,12 @@ LOG.error("Unexpected object found by key " + key.toString() += ". Expected Map, but found:" + existingObject.getClass().getName()); } + else if (!localMode && cache.getConfiguration().getCacheMode() != =3D CacheMode.LOCAL) + { + // to prevent consistency issue since we don't have the list i= n the local cache, we are in cluster env + // and we are in a non local mode, we remove all the patterns = in order to enforce other cluster nodes to reload them from the db + cache.remove(key); + } } = @Override Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/BufferedJBossCache.java 2011-07-14= 11:25:59 UTC (rev 4632) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/jbosscache/BufferedJBossCache.java 2011-07-15= 07:11:30 UTC (rev 4633) @@ -18,9 +18,9 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache; = +import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.jcr.datamodel.ItemData; import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter; -import org.exoplatform.commons.utils.SecurityHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.jboss.cache.Cache; @@ -33,6 +33,7 @@ import org.jboss.cache.NodeNotExistsException; import org.jboss.cache.Region; import org.jboss.cache.config.Configuration; +import org.jboss.cache.config.Configuration.CacheMode; import org.jboss.cache.eviction.ExpirationAlgorithmConfig; import org.jboss.cache.interceptors.base.CommandInterceptor; import org.jgroups.Address; @@ -1052,6 +1053,12 @@ LOG.error("Unexpected object found by FQN:" + getFqn() + " and= key:" + key + ". Expected Set, but found:" + existingObject.getClass().getName()); } + else if (!localMode && cache.getConfiguration().getCacheMode() != =3D CacheMode.LOCAL) + { + // to prevent consistency issue since we don't have the list i= n the local cache, we are in cluster env + // and we are in a non local mode, we clear the list in order = to enforce other cluster nodes to reload it from the db + cache.put(fqn, key, null); + } } = @Override @@ -1084,6 +1091,13 @@ @Override public void apply() { + if (!localMode && cache.getConfiguration().getCacheMode() !=3D Ca= cheMode.LOCAL) + { + // to prevent consistency issue since we don't have the list i= n the local cache, we are in cluster env + // and we are in a non local mode, we remove all the patterns = in order to enforce other cluster nodes to reload them from the db + cache.removeNode(fqn); + return; + } // force writeLock on next read cache.getInvocationContext().getOptionOverrides().setForceWriteLo= ck(true); = @@ -1092,6 +1106,7 @@ { Object name =3D patternNames.next(); Fqn patternFqn =3D Fqn.fromRelativeElements(fqn, name); + cache.getInvocationContext().getOptionOverrides().setForceWrit= eLock(true); Object patternObject =3D cache.get(patternFqn, patternKey); if (!(patternObject instanceof QPathEntryFilter)) { @@ -1102,6 +1117,7 @@ QPathEntryFilter nameFilter =3D (QPathEntryFilter)patternObjec= t; if (nameFilter.accept((ItemData)value)) { + cache.getInvocationContext().getOptionOverrides().setForceW= riteLock(true); Object setObject =3D cache.get(patternFqn, listKey); if (!(setObject instanceof Set)) { @@ -1203,6 +1219,7 @@ while (patternNames.hasNext()) { Fqn patternFqn =3D Fqn.fromRelativeElements(fqn, patte= rnNames.next()); + cache.getInvocationContext().getOptionOverrides().setForceWrit= eLock(true); Object patternObject =3D cache.get(patternFqn, patternKey); if (!(patternObject instanceof QPathEntryFilter)) { @@ -1213,6 +1230,7 @@ QPathEntryFilter nameFilter =3D (QPathEntryFilter)patternObjec= t; if (nameFilter.accept((ItemData)value)) { + cache.getInvocationContext().getOptionOverrides().setForceW= riteLock(true); Object setObject =3D cache.get(patternFqn, listKey); if (!(setObject instanceof Set)) { Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestWorkspaceStorageCacheInClusterMode.java 2= 011-07-14 11:25:59 UTC (rev 4632) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2= 011-07-15 07:11:30 UTC (rev 4633) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = +import org.exoplatform.commons.utils.QName; import org.exoplatform.services.jcr.JcrImplBaseTest; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; @@ -34,6 +35,8 @@ import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.jcr.impl.core.itemfilters.PatternQPathEntr= y; +import org.exoplatform.services.jcr.impl.core.itemfilters.PatternQPathEntr= yFilter; import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter; import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBas= e; @@ -43,6 +46,7 @@ import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; @@ -60,7 +64,7 @@ { public abstract T getCacheImpl() throws Exception; = - public void testRaceConditions() throws Exception + public void testRaceConditionsNConsistency() throws Exception { T cache1 =3D null, cache2 =3D null; try @@ -85,11 +89,11 @@ { public void execute(NodeData parentNode) throws Exception { - PlainChangesLog chlog =3D new PlainChangesLogImpl(); = = + PlainChangesLog chlog =3D new PlainChangesLogImpl(); cwdm.getChildNodesData(parentNode); chlog.add(ItemState.createAddedState(new PersistedNodeData(= "id-node" + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQ= Path(), new InternalQName(null, "node")), parentNode.getIdentifier(), 1, 0, Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); - cwdm.save(chlog); = + cwdm.save(chlog); } }; executeConcurrentReadNWrite(con, readAction, writeAction, Mode.RE= AD_FIRST, parentNode); @@ -116,16 +120,16 @@ { public void execute(NodeData parentNode) throws Exception { - PlainChangesLog chlog =3D new PlainChangesLogImpl(); = = + PlainChangesLog chlog =3D new PlainChangesLogImpl(); cwdm.getChildPropertiesData(parentNode); chlog.add(ItemState.createAddedState(new PersistedPropertyD= ata("id-property" + parentNode.getIdentifier(), QPath.makeChildPath( parentNode.getQPath(), new InternalQName(null, "property= ")), parentNode.getIdentifier(), 0, PropertyType.STRING, false, Arrays.asList((ValueData)new= ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8")))))); cwdm.save(chlog); } - }; = + }; parentNode =3D new PersistedNodeData("parent-id3", QPath.makeChil= dPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node3")), Consta= nts.ROOT_UUID, 1, 0, - Constants.NT_UNSTRUCTURED, new InternalQName[0], null); = + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); executeConcurrentReadNWrite(con, readAction, writeAction, Mode.RE= AD_FIRST, parentNode); assertNotNull(cwdmNode1.getChildPropertiesData(parentNode)); assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode).size= ()); @@ -150,16 +154,16 @@ { public void execute(NodeData parentNode) throws Exception { - PlainChangesLog chlog =3D new PlainChangesLogImpl(); = = + PlainChangesLog chlog =3D new PlainChangesLogImpl(); cwdm.getReferencesData(parentNode.getIdentifier(), false); chlog.add(ItemState.createAddedState(new PersistedPropertyD= ata("id-reference" + parentNode.getIdentifier(), QPath.makeChildPath( parentNode.getQPath(), new InternalQName(null, "referenc= e")), parentNode.getIdentifier(), 0, PropertyType.REFERENCE, false, Arrays.asList((ValueData)= new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF= -8")))))); cwdm.save(chlog); } - }; = + }; parentNode =3D new PersistedNodeData("parent-id5", QPath.makeChil= dPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node5")), Consta= nts.ROOT_UUID, 1, 0, - Constants.NT_UNSTRUCTURED, new InternalQName[0], null); = + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); executeConcurrentReadNWrite(con, readAction, writeAction, Mode.RE= AD_FIRST, parentNode); assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifie= r(), false)); assertEquals(2, cwdmNode1.getReferencesData(parentNode.getIdentif= ier(), false).size()); @@ -191,9 +195,9 @@ Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); cwdm.save(chlog); } - }; = + }; parentNode =3D new PersistedNodeData("parent-id7", QPath.makeChil= dPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node7")), Consta= nts.ROOT_UUID, 1, 0, - Constants.NT_UNSTRUCTURED, new InternalQName[0], null); = + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); executeConcurrentReadNWrite(con, readAction, writeAction, Mode.RE= AD_FIRST, parentNode); assertNotNull(cwdmNode1.getItemData(parentNode.getIdentifier())); assertEquals(2, cwdmNode1.getItemData(parentNode.getIdentifier())= .getPersistedVersion()); @@ -206,7 +210,7 @@ assertEquals(2, cwdmNode1.getItemData(parentNode.getIdentifier())= .getPersistedVersion()); assertNotNull(cwdmNode2.getItemData(parentNode.getIdentifier())); assertEquals(2, cwdmNode2.getItemData(parentNode.getIdentifier())= .getPersistedVersion()); = - = + = // Test getItemData by Path final QPathEntry qpe =3D new QPathEntry(null, "my-property", 1); readAction =3D new Action(cwdmNode2) @@ -228,9 +232,9 @@ .asList((ValueData)new ByteArrayPersistedValueData(0, "s= ome new data".getBytes("UTF-8")))))); cwdm.save(chlog); } - }; = + }; parentNode =3D new PersistedNodeData("parent-id9", QPath.makeChil= dPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node9")), Consta= nts.ROOT_UUID, 1, 0, - Constants.NT_UNSTRUCTURED, new InternalQName[0], null); = + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); executeConcurrentReadNWrite(con, readAction, writeAction, Mode.RE= AD_FIRST, parentNode); assertNotNull(cwdmNode1.getItemData(parentNode, qpe, ItemType.PRO= PERTY)); assertEquals(2, cwdmNode1.getItemData(parentNode, qpe, ItemType.P= ROPERTY).getPersistedVersion()); @@ -243,6 +247,235 @@ assertEquals(2, cwdmNode1.getItemData(parentNode, qpe, ItemType.P= ROPERTY).getPersistedVersion()); assertNotNull(cwdmNode2.getItemData(parentNode, qpe, ItemType.PRO= PERTY)); assertEquals(2, cwdmNode2.getItemData(parentNode, qpe, ItemType.P= ROPERTY).getPersistedVersion()); + = + // Test getChildNodesData by patterns + final List nodePatterns =3D + Collections.singletonList((QPathEntryFilter)new PatternQPathEn= tryFilter(new PatternQPathEntry("", + "my-node", -1))); + readAction =3D new Action(cwdmNode2) + { + public void execute(NodeData parentNode) throws Exception + { + cwdm.getChildNodesData(parentNode, nodePatterns); + } + }; + writeAction =3D new Action(cwdmNode1) + { + public void execute(NodeData parentNode) throws Exception + { + PlainChangesLog chlog =3D new PlainChangesLogImpl(); + cwdm.getChildNodesData(parentNode, nodePatterns); + chlog.add(ItemState.createAddedState(new PersistedNodeData(= "my-node2" + parentNode.getIdentifier(), + QPath.makeChildPath(parentNode.getQPath(), new QName("",= "my-node"), 2), parentNode.getIdentifier(), 1, 2, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); + cwdm.save(chlog); + } + }; + con.setCanModify(true); + parentNode =3D new PersistedNodeData("parent-id11", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node11")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + executeConcurrentReadNWrite(con, readAction, writeAction, Mode.RE= AD_FIRST, parentNode); + assertNotNull(cwdmNode1.getChildNodesData(parentNode, nodePattern= s)); + assertEquals(2, cwdmNode1.getChildNodesData(parentNode, nodePatte= rns).size()); + assertNotNull(cwdmNode2.getChildNodesData(parentNode, nodePattern= s)); + assertEquals(2, cwdmNode2.getChildNodesData(parentNode, nodePatte= rns).size()); + parentNode =3D new PersistedNodeData("parent-id12", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node12")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WR= ITE_FIRST, parentNode); + assertNotNull(cwdmNode1.getChildNodesData(parentNode, nodePattern= s)); + assertEquals(2, cwdmNode1.getChildNodesData(parentNode, nodePatte= rns).size()); + assertNotNull(cwdmNode2.getChildNodesData(parentNode, nodePattern= s)); + assertEquals(2, cwdmNode2.getChildNodesData(parentNode, nodePatte= rns).size()); + = + // Test getChildPropertiesData by patterns + final List propPatterns =3D + Collections.singletonList((QPathEntryFilter)new PatternQPathEn= tryFilter(new PatternQPathEntry("", + "my-property*", -1))); + readAction =3D new Action(cwdmNode2) + { + public void execute(NodeData parentNode) throws Exception + { + cwdm.getChildPropertiesData(parentNode, propPatterns); + } + }; + writeAction =3D new Action(cwdmNode1) + { + public void execute(NodeData parentNode) throws Exception + { + PlainChangesLog chlog =3D new PlainChangesLogImpl(); + cwdm.getChildPropertiesData(parentNode, propPatterns); + chlog.add(ItemState.createAddedState(new PersistedPropertyD= ata("id-property" + parentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "my-prope= rty1")), parentNode.getIdentifier(), 0, + PropertyType.STRING, false, Arrays.asList((ValueData)new= ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8")))))); + cwdm.save(chlog); + } + }; + parentNode =3D new PersistedNodeData("parent-id13", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node13")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + executeConcurrentReadNWrite(con, readAction, writeAction, Mode.RE= AD_FIRST, parentNode); + assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPa= tterns)); + assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode, prop= Patterns).size()); + assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPa= tterns)); + assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode, prop= Patterns).size()); + parentNode =3D new PersistedNodeData("parent-id14", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent-node14")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + executeConcurrentReadNWrite(con, readAction, writeAction, Mode.WR= ITE_FIRST, parentNode); + assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPa= tterns)); + assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode, prop= Patterns).size()); + assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPa= tterns)); + assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode, prop= Patterns).size()); + + // testConsistency + con =3D new MyWorkspaceStorageConnection(true); + wdc =3D new MyWorkspaceDataContainer(con); + cwdmNode1 =3D + new CacheableWorkspaceDataManager(wdc, cache1, new SystemDataC= ontainerHolder(wdc)); + cwdmNode2 =3D + new CacheableWorkspaceDataManager(wdc, cache2, new SystemDataC= ontainerHolder(wdc)); + parentNode =3D new PersistedNodeData("parent2-id", QPath.makeChil= dPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node")), Consta= nts.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + // Test getChildNodesData + con.setParentNode(parentNode); + cwdmNode2.getChildNodesData(parentNode); + PlainChangesLog chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createAddedState(new PersistedNodeData("id-no= de" + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPath()= , new InternalQName(null, "node")), parentNode.getIdentifier(), 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildNodesData(parentNode)); + assertEquals(2, cwdmNode1.getChildNodesData(parentNode).size()); + assertNotNull(cwdmNode2.getChildNodesData(parentNode)); + assertEquals(2, cwdmNode2.getChildNodesData(parentNode).size()); + parentNode =3D new PersistedNodeData("parent2-id2", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node2")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getChildNodesData(parentNode); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createDeletedState(new PersistedNodeData("id-= node2" + parentNode.getIdentifier(), QPath.makeChildPath(parentNode.getQPat= h(), new InternalQName(null, "node2")), parentNode.getIdentifier(), 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildNodesData(parentNode)); + assertEquals(0, cwdmNode1.getChildNodesData(parentNode).size()); + assertNotNull(cwdmNode2.getChildNodesData(parentNode)); + assertEquals(0, cwdmNode2.getChildNodesData(parentNode).size()); + = + // Test getChildPropertiesData + parentNode =3D new PersistedNodeData("parent2-id3", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node3")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getChildPropertiesData(parentNode); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createAddedState(new PersistedPropertyData("i= d-property" + parentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "property")), p= arentNode.getIdentifier(), 0, + PropertyType.STRING, false, Arrays.asList((ValueData)new ByteA= rrayPersistedValueData(0, "some data".getBytes("UTF-8")))))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildPropertiesData(parentNode)); + assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode).size= ()); + assertNotNull(cwdmNode2.getChildPropertiesData(parentNode)); + assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode).size= ()); + parentNode =3D new PersistedNodeData("parent2-id4", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node4")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getChildPropertiesData(parentNode); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createDeletedState(new PersistedPropertyData(= "id-property2" + parentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "property2")), = parentNode.getIdentifier(), 0, + PropertyType.STRING, false, Arrays.asList((ValueData)new ByteA= rrayPersistedValueData(0, "some data".getBytes("UTF-8")))))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildPropertiesData(parentNode)); + assertEquals(0, cwdmNode1.getChildPropertiesData(parentNode).size= ()); + assertNotNull(cwdmNode2.getChildPropertiesData(parentNode)); + assertEquals(0, cwdmNode2.getChildPropertiesData(parentNode).size= ()); + + // Test getReferencesData + parentNode =3D new PersistedNodeData("parent2-id5", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node5")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getReferencesData(parentNode.getIdentifier(), false); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createAddedState(new PersistedPropertyData("i= d-reference" + parentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "reference")), = parentNode.getIdentifier(), 0, + PropertyType.REFERENCE, false, Arrays.asList((ValueData)new By= teArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8")))= ))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifie= r(), false)); + assertEquals(2, cwdmNode1.getReferencesData(parentNode.getIdentif= ier(), false).size()); + assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifie= r(), false)); + assertEquals(2, cwdmNode2.getReferencesData(parentNode.getIdentif= ier(), false).size()); + parentNode =3D new PersistedNodeData("parent2-id6", QPath.makeChi= ldPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node6")), Cons= tants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getReferencesData(parentNode.getIdentifier(), false); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createDeletedState(new PersistedPropertyData(= "id-reference2" + parentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "reference2")),= parentNode.getIdentifier(), 0, + PropertyType.REFERENCE, false, Arrays.asList((ValueData)new By= teArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8")))= ))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifie= r(), false)); + assertEquals(0, cwdmNode1.getReferencesData(parentNode.getIdentif= ier(), false).size()); + assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifie= r(), false)); + assertEquals(0, cwdmNode2.getReferencesData(parentNode.getIdentif= ier(), false).size()); + = + // Test getChildNodesData by patterns + final List patterns =3D + Collections.singletonList((QPathEntryFilter)new PatternQPathEn= tryFilter(new PatternQPathEntry("", + "my-node", -1))); + parentNode =3D new PersistedNodeData("parent2-id11", QPath.makeCh= ildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node11")), Co= nstants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getChildNodesData(parentNode, patterns); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createAddedState(new PersistedNodeData("my-no= de2" + parentNode.getIdentifier(), + QPath.makeChildPath(parentNode.getQPath(), new QName("", "my-n= ode"), 2), parentNode.getIdentifier(), 1, 2, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildNodesData(parentNode, patterns)); + assertEquals(2, cwdmNode1.getChildNodesData(parentNode, patterns)= .size()); + assertNotNull(cwdmNode2.getChildNodesData(parentNode, patterns)); + assertEquals(2, cwdmNode2.getChildNodesData(parentNode, patterns)= .size()); + parentNode =3D new PersistedNodeData("parent2-id12", QPath.makeCh= ildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node12")), Co= nstants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getChildNodesData(parentNode, patterns); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createDeletedState(new PersistedNodeData("my-= node" + parentNode.getIdentifier(), QPath + .makeChildPath(parentNode.getQPath(), new QName("", "my-node")= , 1), parentNode.getIdentifier(), 1, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildNodesData(parentNode, patterns)); + assertEquals(0, cwdmNode1.getChildNodesData(parentNode, patterns)= .size()); + assertNotNull(cwdmNode2.getChildNodesData(parentNode, patterns)); + assertEquals(0, cwdmNode2.getChildNodesData(parentNode, patterns)= .size()); + = + = + // Test getChildPropertiesData by patterns + final List propPattern2s =3D + Collections.singletonList((QPathEntryFilter)new PatternQPathEn= tryFilter(new PatternQPathEntry("", + "my-property*", -1))); + parentNode =3D new PersistedNodeData("parent2-id13", QPath.makeCh= ildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node13")), Co= nstants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getChildPropertiesData(parentNode, propPattern2s); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createAddedState(new PersistedPropertyData("i= d-property" + parentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "my-property1")= ), parentNode.getIdentifier(), 0, + PropertyType.STRING, false, Arrays.asList((ValueData)new ByteA= rrayPersistedValueData(0, "some data".getBytes("UTF-8")))))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPa= ttern2s)); + assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode, prop= Pattern2s).size()); + assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPa= ttern2s)); + assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode, prop= Pattern2s).size()); + parentNode =3D new PersistedNodeData("parent2-id14", QPath.makeCh= ildPath(Constants.ROOT_PATH, new InternalQName(null, "parent2-node14")), Co= nstants.ROOT_UUID, 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + con.setParentNode(parentNode); + cwdmNode2.getChildPropertiesData(parentNode, propPattern2s); + chlog =3D new PlainChangesLogImpl(); + chlog.add(ItemState.createDeletedState(new PersistedPropertyData(= "id-property2" + parentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "my-property2")= ), parentNode.getIdentifier(), 0, + PropertyType.STRING, false, Arrays.asList((ValueData)new ByteA= rrayPersistedValueData(0, "some data".getBytes("UTF-8")))))); + cwdmNode1.save(chlog); + assertNotNull(cwdmNode1.getChildPropertiesData(parentNode, propPa= ttern2s)); + assertEquals(0, cwdmNode1.getChildPropertiesData(parentNode, prop= Pattern2s).size()); + assertNotNull(cwdmNode2.getChildPropertiesData(parentNode, propPa= ttern2s)); + assertEquals(0, cwdmNode2.getChildPropertiesData(parentNode, prop= Pattern2s).size()); } finally { @@ -269,7 +502,7 @@ } } } - } + } = = protected void finalize(T cache) { @@ -302,13 +535,14 @@ } catch (Exception e) { - e.printStackTrace(); = + e.printStackTrace(); ex.set(e); } finally { if (mode =3D=3D Mode.WRITE_FIRST) goSignal.countDown(); doneSignal.countDown(); + con.wait.remove(); } } }; @@ -332,7 +566,8 @@ { if (mode =3D=3D Mode.READ_FIRST) goSignal.countDown(); doneSignal.countDown(); - } = + con.wait.remove(); + } } }; reader.start(); @@ -355,12 +590,32 @@ { READ_FIRST, WRITE_FIRST; } - private static class MyWorkspaceStorageConnection implements WorkspaceS= torageConnection + public static class MyWorkspaceStorageConnection implements WorkspaceSt= orageConnection { public ThreadLocal wait =3D new ThreadLocal(); private NodeData parentNode; private CountDownLatch goSignal; + private ItemData itemAdded; + private boolean canModify; + private boolean itemDeleted; = + public MyWorkspaceStorageConnection() + { = + } + = + public MyWorkspaceStorageConnection(boolean canModify) + { + this.canModify =3D canModify; + } + = + /** + * @param canModify the canModify to set + */ + public void setCanModify(boolean canModify) + { + this.canModify =3D canModify; + } + public CountDownLatch initCountDownLatch() { return this.goSignal =3D new CountDownLatch(1); @@ -369,16 +624,20 @@ public void setParentNode(NodeData parentNode) { this.parentNode =3D parentNode; + this.itemAdded =3D null; + this.itemDeleted =3D false; } = public void add(NodeData data) throws RepositoryException, Unsupport= edOperationException, InvalidItemStateException, IllegalStateException { + this.itemAdded =3D data; } = public void add(PropertyData data) throws RepositoryException, Unsup= portedOperationException, InvalidItemStateException, IllegalStateException { + this.itemAdded =3D data; } = public void close() throws IllegalStateException, RepositoryException @@ -396,18 +655,20 @@ catch (InterruptedException e) { Thread.currentThread().interrupt(); - } = + } } } = public void delete(NodeData data) throws RepositoryException, Unsupp= ortedOperationException, InvalidItemStateException, IllegalStateException { + this.itemDeleted =3D true; } = public void delete(PropertyData data) throws RepositoryException, Un= supportedOperationException, InvalidItemStateException, IllegalStateException { + this.itemDeleted =3D true; } = public int getChildNodesCount(NodeData parent) throws RepositoryExce= ption @@ -426,11 +687,18 @@ catch (InterruptedException e) { Thread.currentThread().interrupt(); - } = + } } List children =3D new ArrayList(); - children.add(new PersistedNodeData("id-node2" + parentNode.getIde= ntifier(), QPath.makeChildPath(parent.getQPath(), new InternalQName(null, "= node2")), parent.getIdentifier(), 1, 0, - Constants.NT_UNSTRUCTURED, new InternalQName[0], null)); + if (!canModify || !itemDeleted) + { + children.add(new PersistedNodeData("id-node2" + parentNode.get= Identifier(), QPath.makeChildPath(parent.getQPath(), new InternalQName(null= , "node2")), parent.getIdentifier(), 1, 0, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null)); = = + } + if (canModify && itemAdded !=3D null) + { + children.add((NodeData)itemAdded); + } return children; } = @@ -446,14 +714,21 @@ catch (InterruptedException e) { Thread.currentThread().interrupt(); - } = + } } List children =3D new ArrayList(); try { - children.add(new PersistedPropertyData("id-property2" + parent= Node.getIdentifier(), QPath.makeChildPath( - parentNode.getQPath(), new InternalQName(null, "property2")= ), parentNode.getIdentifier(), 0, - PropertyType.STRING, false, Arrays.asList((ValueData)new By= teArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))); + if (!canModify || !itemDeleted) + { + children.add(new PersistedPropertyData("id-property2" + par= entNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "property= 2")), parentNode.getIdentifier(), 0, + PropertyType.STRING, false, Arrays.asList((ValueData)new= ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))); = = + } + if (canModify && itemAdded !=3D null) + { + children.add((PropertyData)itemAdded); + } } catch (UnsupportedEncodingException e) { @@ -465,7 +740,36 @@ public List getChildPropertiesData(NodeData parent, Li= st pattern) throws RepositoryException, IllegalStateException { - return getChildPropertiesData(parent); + if (wait.get() !=3D null && wait.get()) + { + try + { + goSignal.await(); + } + catch (InterruptedException e) + { + Thread.currentThread().interrupt(); + } + } + List children =3D new ArrayList(); + try + { + if (!canModify || !itemDeleted) + { + children.add(new PersistedPropertyData("id-property2" + par= entNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "my-prope= rty2")), parentNode.getIdentifier(), 0, + PropertyType.STRING, false, Arrays.asList((ValueData)new= ByteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))); = = + } + if (canModify && itemAdded !=3D null) + { + children.add((PropertyData)itemAdded); + } + } + catch (UnsupportedEncodingException e) + { + e.printStackTrace(); + } + return children; } = /** @@ -489,7 +793,7 @@ catch (InterruptedException e) { Thread.currentThread().interrupt(); - } = + } } if (itemType =3D=3D ItemType.NODE) { @@ -521,7 +825,7 @@ catch (InterruptedException e) { Thread.currentThread().interrupt(); - } = + } } return parentNode; } @@ -538,14 +842,21 @@ catch (InterruptedException e) { Thread.currentThread().interrupt(); - } = + } } List children =3D new ArrayList(); try { - children.add(new PersistedPropertyData("id-reference2" + paren= tNode.getIdentifier(), QPath.makeChildPath( - parentNode.getQPath(), new InternalQName(null, "reference2"= )), parentNode.getIdentifier(), 0, - PropertyType.REFERENCE, false, Arrays.asList((ValueData)new= ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8"= ))))); + if (!canModify || !itemDeleted) + { + children.add(new PersistedPropertyData("id-reference2" + pa= rentNode.getIdentifier(), QPath.makeChildPath( + parentNode.getQPath(), new InternalQName(null, "referenc= e2")), parentNode.getIdentifier(), 0, + PropertyType.REFERENCE, false, Arrays.asList((ValueData)= new ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF= -8"))))); = + } + if (canModify && itemAdded !=3D null) + { + children.add((PropertyData)itemAdded); + } = } catch (UnsupportedEncodingException e) { @@ -595,8 +906,32 @@ public List getChildNodesData(NodeData parent, List pattern) throws RepositoryException, IllegalStateException { - return getChildNodesData(parent); + if (wait.get() !=3D null && wait.get()) + { + try + { + goSignal.await(); + } + catch (InterruptedException e) + { + Thread.currentThread().interrupt(); + } + } + List children =3D new ArrayList(); + if (!canModify || !itemDeleted) + { + children.add(new PersistedNodeData("my-node" + parent.getIdent= ifier(), QPath.makeChildPath(parent.getQPath(), new QName("","my-node"), 1)= , parent.getIdentifier(), 1, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], null)); = = + } + if (canModify && itemAdded !=3D null) + { + children.add((NodeData)itemAdded); + } + = + return children; } + = + = }; = private static class MyWorkspaceDataContainer extends WorkspaceDataCont= ainerBase @@ -656,5 +991,5 @@ { return "MyWorkspaceDataContainer"; } - }; = + }; } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/infinispan/TestISPNCacheWorkspaceStorag= eCacheInClusterMode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/infinispan/TestISPNCacheWorkspaceStorageCache= InClusterMode.java 2011-07-14 11:25:59 UTC (rev 4632) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/infinispan/TestISPNCacheWorkspaceStorageCache= InClusterMode.java 2011-07-15 07:11:30 UTC (rev 4633) @@ -25,7 +25,10 @@ import org.exoplatform.services.jcr.impl.dataflow.persistent.TestWorkspace= StorageCacheInClusterMode; import org.exoplatform.services.jcr.infinispan.ISPNCacheFactory; = +import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; = /** * @author Nicolas Filotto @@ -35,20 +38,35 @@ public class TestISPNCacheWorkspaceStorageCacheInClusterMode extends TestW= orkspaceStorageCacheInClusterMode { = + @SuppressWarnings({"rawtypes", "unchecked"}) public ISPNCacheWorkspaceStorageCache getCacheImpl() throws Exception { + // Clear the Cache Factory to avoid getting several times the same c= ache + Field singletonField =3D ISPNCacheFactory.class.getDeclaredField("CA= CHE_MANAGERS"); + singletonField.setAccessible(true); + Map map =3D (Map)singletonField.get(null); + Map backupMap =3D new HashMap(map); + map.clear(); ArrayList list =3D new ArrayList(); list.add(new SimpleParameterEntry(ISPNCacheFactory.INFINISPAN_CONFIG, "jar:/conf/standalone/cluster/test-infinispan-config.xml")); list.add(new SimpleParameterEntry("infinispan-cluster-name", "TestIS= PNCacheWorkspaceStorageCacheInClusterMode")); - list.add(new SimpleParameterEntry("jgroups-configuration", "jar:/con= f/standalone/cluster/udp-mux.xml")); + list.add(new SimpleParameterEntry("jgroups-configuration", "classpat= h:/flush-udp.xml")); = CacheEntry entry =3D new CacheEntry(list); entry.setEnabled(true); WorkspaceEntry workspaceEntry =3D new WorkspaceEntry(); workspaceEntry.setCache(entry); workspaceEntry.setUniqueName("MyWorkspace"); - return new ISPNCacheWorkspaceStorageCache(workspaceEntry, new Config= urationManagerImpl()); + try + { + return new ISPNCacheWorkspaceStorageCache(workspaceEntry, new Con= figurationManagerImpl()); + } + finally + { + map.clear(); + map.putAll(backupMap); + } } = protected void finalize(ISPNCacheWorkspaceStorageCache cache) --===============2100520428844034253==-- From do-not-reply at jboss.org Fri Jul 15 04:14:37 2011 Content-Type: multipart/mixed; boundary="===============7384211752980956595==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4634 - in jcr/branches/1.12.x/patch/1.12.10-GA: JCR-1650 and 1 other directory. Date: Fri, 15 Jul 2011 04:14:36 -0400 Message-ID: <201107150814.p6F8EaM3012666@svn01.web.mwc.hst.phx2.redhat.com> --===============7384211752980956595== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-15 04:14:35 -0400 (Fri, 15 Jul 2011) New Revision: 4634 Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/JCR-1650.patch Log: JCR-1650: patch proposed Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/JCR-1650.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/1.12.10-GA/JCR-1650/JCR-1650.patch = (rev 0) +++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1650/JCR-1650.patch 2011-07-15= 08:14:35 UTC (rev 4634) @@ -0,0 +1,288 @@ +Index: exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/i= mpl/dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCacheInClu= sterMode.java +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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= /dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCacheInCluste= rMode.java (revision 4633) ++++ exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl= /dataflow/persistent/jbosscache/TestJBossCacheWorkspaceStorageCacheInCluste= rMode.java (working copy) +@@ -80,7 +80,7 @@ + transactionService =3D=3D null ? null : transactionService, new = ConfigurationManagerImpl()); + } + = +- public void testRaceConditions() throws Exception ++ public void testRaceConditionsNConsistency() throws Exception + { + JBossCacheWorkspaceStorageCache cache1 =3D null, cache2 =3D null; + try +@@ -273,6 +273,106 @@ + assertEquals(2, cwdmNode1.getItemData(parentNode, qpe, ItemType.= PROPERTY).getPersistedVersion()); + assertNotNull(cwdmNode2.getItemData(parentNode, qpe, ItemType.PR= OPERTY)); + assertEquals(2, cwdmNode2.getItemData(parentNode, qpe, ItemType.= PROPERTY).getPersistedVersion()); ++ ++ // testConsistency ++ con =3D new MyWorkspaceStorageConnection(true); ++ wdc =3D new MyWorkspaceDataContainer(con); ++ cwdmNode1 =3D new CacheableWorkspaceDataManager(wdc, cache1, new= SystemDataContainerHolder(wdc)); ++ cwdmNode2 =3D new CacheableWorkspaceDataManager(wdc, cache2, new= SystemDataContainerHolder(wdc)); ++ parentNode =3D ++ new PersistedNodeData("parent2-id", QPath.makeChildPath(Const= ants.ROOT_PATH, new InternalQName(null, ++ "parent2-node")), Constants.ROOT_UUID, 1, 0, Constants.NT_= UNSTRUCTURED, new InternalQName[0], null); ++ ++ // Test getChildNodesData ++ con.setParentNode(parentNode); ++ cwdmNode2.getChildNodesData(parentNode); ++ PlainChangesLog chlog =3D new PlainChangesLogImpl(); ++ chlog.add(ItemState.createAddedState(new PersistedNodeData("id-n= ode" + parentNode.getIdentifier(), QPath ++ .makeChildPath(parentNode.getQPath(), new InternalQName(null,= "node")), parentNode.getIdentifier(), 1, 0, ++ Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); ++ cwdmNode1.save(chlog); ++ assertNotNull(cwdmNode1.getChildNodesData(parentNode)); ++ assertEquals(2, cwdmNode1.getChildNodesData(parentNode).size()); ++ assertNotNull(cwdmNode2.getChildNodesData(parentNode)); ++ assertEquals(2, cwdmNode2.getChildNodesData(parentNode).size()); ++ parentNode =3D ++ new PersistedNodeData("parent2-id2", QPath.makeChildPath(Cons= tants.ROOT_PATH, new InternalQName(null, ++ "parent2-node2")), Constants.ROOT_UUID, 1, 0, Constants.NT= _UNSTRUCTURED, new InternalQName[0], null); ++ con.setParentNode(parentNode); ++ cwdmNode2.getChildNodesData(parentNode); ++ chlog =3D new PlainChangesLogImpl(); ++ chlog.add(ItemState.createDeletedState(new PersistedNodeData("id= -node2" + parentNode.getIdentifier(), QPath ++ .makeChildPath(parentNode.getQPath(), new InternalQName(null,= "node2")), parentNode.getIdentifier(), 1, 0, ++ Constants.NT_UNSTRUCTURED, new InternalQName[0], null))); ++ cwdmNode1.save(chlog); ++ assertNotNull(cwdmNode1.getChildNodesData(parentNode)); ++ assertEquals(0, cwdmNode1.getChildNodesData(parentNode).size()); ++ assertNotNull(cwdmNode2.getChildNodesData(parentNode)); ++ assertEquals(0, cwdmNode2.getChildNodesData(parentNode).size()); ++ ++ // Test getChildPropertiesData ++ parentNode =3D ++ new PersistedNodeData("parent2-id3", QPath.makeChildPath(Cons= tants.ROOT_PATH, new InternalQName(null, ++ "parent2-node3")), Constants.ROOT_UUID, 1, 0, Constants.NT= _UNSTRUCTURED, new InternalQName[0], null); ++ con.setParentNode(parentNode); ++ cwdmNode2.getChildPropertiesData(parentNode); ++ chlog =3D new PlainChangesLogImpl(); ++ chlog.add(ItemState.createAddedState(new PersistedPropertyData("= id-property" + parentNode.getIdentifier(), ++ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(= null, "property")), ++ parentNode.getIdentifier(), 0, PropertyType.STRING, false, Ar= rays ++ .asList((ValueData)new ByteArrayPersistedValueData(0, "som= e data".getBytes("UTF-8")))))); ++ cwdmNode1.save(chlog); ++ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode)); ++ assertEquals(2, cwdmNode1.getChildPropertiesData(parentNode).siz= e()); ++ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode)); ++ assertEquals(2, cwdmNode2.getChildPropertiesData(parentNode).siz= e()); ++ parentNode =3D ++ new PersistedNodeData("parent2-id4", QPath.makeChildPath(Cons= tants.ROOT_PATH, new InternalQName(null, ++ "parent2-node4")), Constants.ROOT_UUID, 1, 0, Constants.NT= _UNSTRUCTURED, new InternalQName[0], null); ++ con.setParentNode(parentNode); ++ cwdmNode2.getChildPropertiesData(parentNode); ++ chlog =3D new PlainChangesLogImpl(); ++ chlog.add(ItemState.createDeletedState(new PersistedPropertyData= ("id-property2" + parentNode.getIdentifier(), ++ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(= null, "property2")), parentNode ++ .getIdentifier(), 0, PropertyType.STRING, false, Arrays ++ .asList((ValueData)new ByteArrayPersistedValueData(0, "som= e data".getBytes("UTF-8")))))); ++ cwdmNode1.save(chlog); ++ assertNotNull(cwdmNode1.getChildPropertiesData(parentNode)); ++ assertEquals(0, cwdmNode1.getChildPropertiesData(parentNode).siz= e()); ++ assertNotNull(cwdmNode2.getChildPropertiesData(parentNode)); ++ assertEquals(0, cwdmNode2.getChildPropertiesData(parentNode).siz= e()); ++ ++ // Test getReferencesData ++ parentNode =3D ++ new PersistedNodeData("parent2-id5", QPath.makeChildPath(Cons= tants.ROOT_PATH, new InternalQName(null, ++ "parent2-node5")), Constants.ROOT_UUID, 1, 0, Constants.NT= _UNSTRUCTURED, new InternalQName[0], null); ++ con.setParentNode(parentNode); ++ cwdmNode2.getReferencesData(parentNode.getIdentifier(), false); ++ chlog =3D new PlainChangesLogImpl(); ++ chlog.add(ItemState.createAddedState(new PersistedPropertyData("= id-reference" + parentNode.getIdentifier(), ++ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(= null, "reference")), parentNode ++ .getIdentifier(), 0, PropertyType.REFERENCE, false, Arrays ++ .asList((ValueData)new ByteArrayPersistedValueData(0, pare= ntNode.getIdentifier().getBytes("UTF-8")))))); ++ cwdmNode1.save(chlog); ++ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifi= er(), false)); ++ assertEquals(2, cwdmNode1.getReferencesData(parentNode.getIdenti= fier(), false).size()); ++ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifi= er(), false)); ++ assertEquals(2, cwdmNode2.getReferencesData(parentNode.getIdenti= fier(), false).size()); ++ parentNode =3D ++ new PersistedNodeData("parent2-id6", QPath.makeChildPath(Cons= tants.ROOT_PATH, new InternalQName(null, ++ "parent2-node6")), Constants.ROOT_UUID, 1, 0, Constants.NT= _UNSTRUCTURED, new InternalQName[0], null); ++ con.setParentNode(parentNode); ++ cwdmNode2.getReferencesData(parentNode.getIdentifier(), false); ++ chlog =3D new PlainChangesLogImpl(); ++ chlog.add(ItemState.createDeletedState(new PersistedPropertyData= ("id-reference2" + parentNode.getIdentifier(), ++ QPath.makeChildPath(parentNode.getQPath(), new InternalQName(= null, "reference2")), parentNode ++ .getIdentifier(), 0, PropertyType.REFERENCE, false, Arrays ++ .asList((ValueData)new ByteArrayPersistedValueData(0, pare= ntNode.getIdentifier().getBytes("UTF-8")))))); ++ cwdmNode1.save(chlog); ++ assertNotNull(cwdmNode1.getReferencesData(parentNode.getIdentifi= er(), false)); ++ assertEquals(0, cwdmNode1.getReferencesData(parentNode.getIdenti= fier(), false).size()); ++ assertNotNull(cwdmNode2.getReferencesData(parentNode.getIdentifi= er(), false)); ++ assertEquals(0, cwdmNode2.getReferencesData(parentNode.getIdenti= fier(), false).size()); + } + finally + { +@@ -336,6 +436,8 @@ + { + if (mode =3D=3D Mode.WRITE_FIRST) goSignal.countDown(); + doneSignal.countDown(); ++ ++ con.wait.remove(); + } + } + }; +@@ -360,6 +462,8 @@ + { + if (mode =3D=3D Mode.READ_FIRST) goSignal.countDown(); + doneSignal.countDown(); ++ ++ con.wait.remove(); + } = + } + }; +@@ -373,22 +477,50 @@ + { + = + protected final CacheableWorkspaceDataManager cwdm; ++ + public Action(CacheableWorkspaceDataManager cwdm) + { + this.cwdm =3D cwdm; + } + protected abstract void execute(NodeData parentNode) throws Excepti= on; + } ++ + private static enum Mode + { + READ_FIRST, WRITE_FIRST; + } +- private static class MyWorkspaceStorageConnection implements Workspace= StorageConnection ++ ++ public static class MyWorkspaceStorageConnection implements WorkspaceS= torageConnection + { + public ThreadLocal wait =3D new ThreadLocal(); ++ + private NodeData parentNode; ++ + private CountDownLatch goSignal; + = ++ private ItemData itemAdded; ++ ++ private boolean canModify; ++ ++ private boolean itemDeleted; ++ ++ public MyWorkspaceStorageConnection() ++ { ++ } ++ ++ public MyWorkspaceStorageConnection(boolean canModify) ++ { ++ this.canModify =3D canModify; ++ } ++ ++ /** = ++ * @param canModify the canModify to set = ++ */ ++ public void setCanModify(boolean canModify) ++ { ++ this.canModify =3D canModify; ++ } ++ + public CountDownLatch initCountDownLatch() + { + return this.goSignal =3D new CountDownLatch(1); +@@ -397,16 +529,20 @@ + public void setParentNode(NodeData parentNode) + { + this.parentNode =3D parentNode; ++ this.itemAdded =3D null; ++ this.itemDeleted =3D false; + } + = + public void add(NodeData data) throws RepositoryException, Unsuppor= tedOperationException, + InvalidItemStateException, IllegalStateException + { ++ this.itemAdded =3D data; + } + = + public void add(PropertyData data) throws RepositoryException, Unsu= pportedOperationException, + InvalidItemStateException, IllegalStateException + { ++ this.itemAdded =3D data; + } + = + public void close() throws IllegalStateException, RepositoryExcepti= on +@@ -431,11 +567,13 @@ + public void delete(NodeData data) throws RepositoryException, Unsup= portedOperationException, + InvalidItemStateException, IllegalStateException + { ++ this.itemDeleted =3D true; + } + = + public void delete(PropertyData data) throws RepositoryException, U= nsupportedOperationException, + InvalidItemStateException, IllegalStateException + { ++ this.itemDeleted =3D true; + } + = + public int getChildNodesCount(NodeData parent) throws RepositoryExc= eption +@@ -457,8 +595,17 @@ + } = + } + List children =3D new ArrayList(); +- children.add(new PersistedNodeData("id-node2" + parentNode.getId= entifier(), QPath.makeChildPath(parent.getQPath(), new InternalQName(null, = "node2")), parent.getIdentifier(), 1, 0, +- Constants.NT_UNSTRUCTURED, new InternalQName[0], null)); ++ if (!canModify || !itemDeleted) ++ { ++ children.add(new PersistedNodeData("id-node2" + parentNode.ge= tIdentifier(), QPath.makeChildPath( ++ parent.getQPath(), new InternalQName(null, "node2")), pare= nt.getIdentifier(), 1, 0, ++ Constants.NT_UNSTRUCTURED, new InternalQName[0], null)); ++ } ++ if (canModify && itemAdded !=3D null) ++ { ++ children.add((NodeData)itemAdded); ++ } ++ + return children; + } + = +@@ -479,9 +626,17 @@ + List children =3D new ArrayList(); + try + { +- children.add(new PersistedPropertyData("id-property2" + paren= tNode.getIdentifier(), QPath.makeChildPath( +- parentNode.getQPath(), new InternalQName(null, "property2"= )), parentNode.getIdentifier(), 0, +- PropertyType.STRING, false, Arrays.asList((ValueData)new B= yteArrayPersistedValueData(0, "some data".getBytes("UTF-8"))))); ++ if (!canModify || !itemDeleted) ++ { ++ children.add(new PersistedPropertyData("id-property2" + pa= rentNode.getIdentifier(), QPath.makeChildPath( ++ parentNode.getQPath(), new InternalQName(null, "propert= y2")), parentNode.getIdentifier(), 0, ++ PropertyType.STRING, false, Arrays.asList((ValueData)ne= w ByteArrayPersistedValueData(0, "some data" ++ .getBytes("UTF-8"))))); ++ } ++ if (canModify && itemAdded !=3D null) ++ { ++ children.add((PropertyData)itemAdded); ++ } + } + catch (UnsupportedEncodingException e) + { +@@ -565,9 +720,18 @@ + List children =3D new ArrayList(); + try + { +- children.add(new PersistedPropertyData("id-reference2" + pare= ntNode.getIdentifier(), QPath.makeChildPath( +- parentNode.getQPath(), new InternalQName(null, "reference2= ")), parentNode.getIdentifier(), 0, +- PropertyType.REFERENCE, false, Arrays.asList((ValueData)ne= w ByteArrayPersistedValueData(0, parentNode.getIdentifier().getBytes("UTF-8= "))))); ++ if (!canModify || !itemDeleted) ++ { ++ children ++ .add(new PersistedPropertyData("id-reference2" + parent= Node.getIdentifier(), QPath.makeChildPath( ++ parentNode.getQPath(), new InternalQName(null, "refe= rence2")), parentNode.getIdentifier(), 0, ++ PropertyType.REFERENCE, false, Arrays.asList((ValueD= ata)new ByteArrayPersistedValueData(0, ++ parentNode.getIdentifier().getBytes("UTF-8"))))); ++ } ++ if (canModify && itemAdded !=3D null) ++ { ++ children.add((PropertyData)itemAdded); ++ } + } + catch (UnsupportedEncodingException e) + { --===============7384211752980956595==-- From do-not-reply at jboss.org Fri Jul 15 07:51:25 2011 Content-Type: multipart/mixed; boundary="===============8260787605141409547==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4635 - in jcr/trunk/exo.jcr.component.ext: src/main/java/org/exoplatform/services/jcr/ext/repository and 8 other directories. Date: Fri, 15 Jul 2011 07:51:25 -0400 Message-ID: <201107151151.p6FBpPgt020227@svn01.web.mwc.hst.phx2.redhat.com> --===============8260787605141409547== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-15 07:51:25 -0400 (Fri, 15 Jul 2011) New Revision: 4635 Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/util/TesterRdbmsWorkspaceInitializer.java Removed: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/DummyAction.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/access/DenyAccessManager.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/impl/core/TesterRdbmsWorkspaceInitializer.java Modified: jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/repository/RestRepositoryService.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/access/AccessContextTest.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/backup/TestRdbmsWorkspaceInitializer.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/backup/load/TestLoadBackup.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/RestRepositoryServiceTest.java jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/impl/core/SessionDataManagerTestWrapper.java jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-= configuration.xml Log: EXOJCR-1443: Review tests in jcr-ext project Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-15 08:14:35 UTC (rev 46= 34) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-15 11:51:25 UTC (rev 46= 35) @@ -178,20 +178,8 @@ ${env.MAVEN_OPTS} -Djava.security.manager=3Dorg.exopl= atform.commons.test.TestSecurityManager -Djava.security.policy=3D${project.= build.directory}/test-classes/test.policy - **/actions/*Test.java - **/metadata/*Test.java - **/owner/*Test.java - **/registry/*Test.java - **/app/*Test.java - **/resource/*Test.java - **/groovy/*Test.java - **/replication/*.java - **/replication/external/*.java - **/replication/async/**/*.java - **/backup/load/TestLoadBackup.java - **/backup/*.java - **/backup/server/*.java - **/repository/creation/*.java + org/exoplatform/services/jcr/ext/**/Test*.java + org/exoplatform/services/jcr/ext/**/*Test.java **/BaseStandaloneTest.java @@ -199,12 +187,10 @@ **/backup/BaseRDBMSBackupTest.java **/backup/TestBackupScheduler.java **/backup/TestBackupRestart.java - **/replication/*.java - **/replication/external/*.java - **/replication/external/BaseTestCaseChecker.java - **/access/*.java + **/backup/load/TestLoadBackup.java* + **/replication/** **/LocalStorageMultithreadTest.java - **/repository/creation/cluster.java + **/repository/creation/cluster/** 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 2011-07-15 08:14:35 UTC (rev = 4634) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/repository/RestRepositoryService.java 2011-07-15 11:51:25 UTC (rev = 4635) @@ -389,9 +389,14 @@ } } = - repositoryService.removeRepository(repositoryName); - repositoryService.getConfig().retain(); // save configuration to = persistence (file or persister) = - return Response.ok().build(); + if (repositoryService.canRemoveRepository(repositoryName)) + { + repositoryService.removeRepository(repositoryName); + repositoryService.getConfig().retain(); // save configuration = to persistence (file or persister) = + return Response.ok().build(); + } + return Response.status(Status.CONFLICT).entity("Can't remove repo= sitory " + repositoryName) + .cacheControl(NO_CACHE).build(); } catch (RepositoryException e) { @@ -450,7 +455,7 @@ { repository.removeWorkspace(workspaceName); repositoryService.getConfig().retain(); // save configuration = to persistence (file or persister) - return Response.noContent().build(); + return Response.ok().build(); } return Response.status(Status.CONFLICT).entity( "Can't remove workspace " + workspaceName + " in repository " = + repositoryName).cacheControl(NO_CACHE) Deleted: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/serv= ices/jcr/ext/DummyAction.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/DummyAction.java 2011-07-15 08:14:35 UTC (rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/DummyAction.java 2011-07-15 11:51:25 UTC (rev 4635) @@ -1,40 +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.ext; - -import org.apache.commons.chain.Context; -import org.exoplatform.services.command.action.Action; - -/** - * Created by The eXo Platform SAS . - * = - * @author Gennady Azarenkov - * @version $Id: DummyAction.java 12004 2007-01-17 12:03:57Z geaz $ - */ - -public class DummyAction implements Action -{ - - public boolean execute(Context ctx) throws Exception - { - System.out.println("EXECUTE !!! "); - return false; - } - -} Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/access/AccessContextTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/access/AccessContextTest.java 2011-07-15 08:14:35 UTC (rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/access/AccessContextTest.java 2011-07-15 11:51:25 UTC (rev 4635) @@ -18,28 +18,19 @@ */ package org.exoplatform.services.jcr.ext.access; = -import org.exoplatform.container.xml.InitParams; -import org.exoplatform.container.xml.ObjectParameter; import org.exoplatform.services.jcr.ext.BaseStandaloneTest; import org.exoplatform.services.jcr.impl.core.SessionImpl; -import org.exoplatform.services.jcr.impl.ext.action.ActionConfiguration; -import org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin; -import org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog; -import org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin.Actio= nsConfig; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = import java.util.ArrayList; -import java.util.List; import java.util.Random; = -import javax.jcr.AccessDeniedException; import javax.jcr.Node; import javax.jcr.NodeIterator; import javax.jcr.Property; import javax.jcr.PropertyIterator; import javax.jcr.RepositoryException; -import javax.jcr.Value; = /** * @author Sergey Kabashn= yuk @@ -54,75 +45,6 @@ = private final static int THREAD_COUNT =3D 300; = - @Override - public void setUp() throws Exception - { - - super.setUp(); - setContextAction(); - } - - private void setContextAction() - { - SessionActionCatalog catalog =3D - (SessionActionCatalog)container.getComponentInstanceOfType(Sessio= nActionCatalog.class); - ActionConfiguration ac =3D - new ActionConfiguration("org.exoplatform.services.jcr.ext.access.= SetAccessControlContextAction", - "addProperty,changeProperty,removeProperty,read", null, true, = null, null); - List actionsList =3D new ArrayList(); - ActionsConfig actions =3D new ActionsConfig(); - actions.setActions(actionsList); - actionsList.add(ac); - InitParams params =3D new InitParams(); - ObjectParameter op =3D new ObjectParameter(); - op.setObject(actions); - op.setName("actions"); - params.addParameter(op); - - AddActionsPlugin aap =3D new AddActionsPlugin(params); - catalog.clear(); - catalog.addPlugin(aap); - }; - - public void testSetAccessContext() throws RepositoryException - { - setContextAction(); - Node testNode =3D root.addNode("test"); - session.save(); - testNode.setProperty("p1", 9); - assertEquals(9, testNode.getProperty("p1").getValue().getLong()); - - testNode.setProperty("p1", 10); - session.save(); - testNode.setProperty("p1", (Value)null); - session.save(); - } - - public void testDenyAccessMenager() throws RepositoryException - { - Node tNode =3D root.addNode("testNode"); - tNode.setProperty("deny", "value"); - session.save(); - try - { - tNode.getProperty("deny"); - fail("AccessDeniedException scheduled to be"); - } - catch (AccessDeniedException e) - { - // Ok - } - SessionImpl sysSession =3D repository.getSystemSession(); - try - { - sysSession.getRootNode().getNode("testNode").getProperty("deny"); - } - catch (AccessDeniedException e) - { - fail("AccessDeniedException "); - } - } - public void testAccessMenedgerContextMultiThread() throws RepositoryExc= eption, InterruptedException { = Deleted: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/serv= ices/jcr/ext/access/DenyAccessManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/access/DenyAccessManager.java 2011-07-15 08:14:35 UTC (rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/access/DenyAccessManager.java 2011-07-15 11:51:25 UTC (rev 4635) @@ -1,80 +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.ext.access; - -import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.access.AccessManager; -import org.exoplatform.services.jcr.access.SystemIdentity; -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.config.RepositoryEntry; -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.impl.core.ItemImpl; -import org.exoplatform.services.jcr.observation.ExtendedEvent; -import org.exoplatform.services.security.Identity; - -import javax.jcr.RepositoryException; - -/** - * @author Sergey Kabashn= yuk - * @version $Id: DenyAccessManager.java 14111 2008-05-12 15:04:28Z gazaren= kov $ - */ -public class DenyAccessManager extends AccessManager -{ - private String denyName =3D ""; - - public DenyAccessManager(RepositoryEntry config, WorkspaceEntry wsConfi= g) throws RepositoryException, - RepositoryConfigurationException - { - super(config, wsConfig); - this.denyName =3D wsConfig.getAccessManager().getParameterValue("nam= e"); - - if (log.isDebugEnabled()) - log.debug("DenyAccessManager created"); - } - - @Override - public boolean hasPermission(AccessControlList acl, String[] permission= , Identity user) - { - if (super.hasPermission(acl, permission, user)) - { - if (user.getUserId().equals("root") || user.getUserId().equals(Sy= stemIdentity.SYSTEM) - || user.getUserId().equals("admin")) - return true; - - if (context() !=3D null) - { - int ivent =3D ((Integer)context().get("event")).intValue(); - if (ivent =3D=3D ExtendedEvent.READ) - { - ItemImpl curItem =3D (ItemImpl)context().get("currentItem"); - - if (curItem !=3D null && curItem.getInternalName().getAsStr= ing().indexOf(denyName) > -1) - { - if (log.isDebugEnabled()) - log.debug("DenyAccessManager permission deny by rool = name=3D'" + denyName + "'"); - return false; - } - } - } - else - log.warn("Context =3D null"); - } - return false; - } -} Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/backup/TestRdbmsWorkspaceInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestRdbmsWorkspaceInitializer.java 2011-07-15 08:14:35 UTC (= rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/backup/TestRdbmsWorkspaceInitializer.java 2011-07-15 11:51:25 UTC (= rev 4635) @@ -24,11 +24,11 @@ import org.exoplatform.services.jcr.ext.backup.impl.rdbms.FullBackupJob; import org.exoplatform.services.jcr.ext.backup.impl.rdbms.RdbmsWorkspaceIn= itializer; import org.exoplatform.services.jcr.impl.core.SysViewWorkspaceInitializer; -import org.exoplatform.services.jcr.impl.core.TesterRdbmsWorkspaceInitiali= zer; import org.exoplatform.services.jcr.impl.core.query.SystemSearchManager; import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; import org.exoplatform.services.jcr.util.TesterConfigurationHelper; +import org.exoplatform.services.jcr.util.TesterRdbmsWorkspaceInitializer; = import java.io.File; import java.net.URL; Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/backup/load/TestLoadBackup.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/load/TestLoadBackup.java 2011-07-15 08:14:35 UTC (rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/backup/load/TestLoadBackup.java 2011-07-15 11:51:25 UTC (rev 4635) @@ -141,12 +141,9 @@ = Thread.sleep(10 * 1000); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP STA= RT =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - // backup File backDir =3D new File("target/backup/ws1"); backDir.mkdirs(); - BackupChain bch =3D null; = backupManagerImpl.start(); = @@ -156,10 +153,8 @@ config.setBackupType(BACKUP_TYPE); config.setBackupDir(backDir); = - backupManagerImpl.startBackup(config); + BackupChain bch =3D backupManagerImpl.startBackup(config); = - bch =3D backupManagerImpl.findBackup(REPOSITORY_NAME_SINGLE_DB, WORK= SPACE_NAME); - // wait till full backup will be stopped while (bch.getFullBackupState() !=3D BackupJob.FINISHED) { @@ -167,18 +162,11 @@ Thread.sleep(30); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D FULL BACKU= P FINISHED =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - if (BACKUP_TYPE =3D=3D BackupManager.FULL_AND_INCREMENTAL) { Thread.sleep(5 * 1000); } = - // for (Thread thread : threads) - // { - // thread.interrupt(); - // } - if (BACKUP_TYPE =3D=3D BackupManager.FULL_AND_INCREMENTAL) { Thread.sleep(5 * 1000); @@ -195,8 +183,6 @@ } Thread.sleep(10 * 1000); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP FIN= ISHED =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - // restore WorkspaceEntry ws1back =3D makeWorkspaceEntry("ws1back", "jdbcjcr_to= _repository_restore_singel_db"); = @@ -205,8 +191,6 @@ { BackupChainLog bchLog =3D new BackupChainLog(backLog); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RESTORE= START =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = @@ -233,8 +217,6 @@ fail("There are no backup files in " + backDir.getAbsolutePath()); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CHECKING I= NTEGRITY =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - checkIntegrity((NodeImpl)repositoryService.getRepository(REPOSITORY_= NAME_SINGLE_DB).login(credentials, "ws1back") .getRootNode()); } @@ -276,7 +258,6 @@ // backup File backDir =3D new File("target/backup/ws1"); backDir.mkdirs(); - BackupChain bch =3D null; = backupManagerImpl.start(); = @@ -288,12 +269,9 @@ = Thread.sleep(5 * 1000); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP STA= RT =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); = - backupManagerImpl.startBackup(config); + BackupChain bch =3D backupManagerImpl.startBackup(config); = - bch =3D backupManagerImpl.findBackup(REPOSITORY_NAME_SINGLE_DB, WORK= SPACE_NAME); - // wait till full backup will be stopped while (bch.getFullBackupState() !=3D BackupJob.FINISHED) { @@ -310,16 +288,12 @@ fail("Can't get fullBackup chain"); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP FIN= ISHED =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - // restore File backLog =3D new File(bch.getLogFilePath()); if (backLog.exists()) { BackupChainLog bchLog =3D new BackupChainLog(backLog); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RESTORE= START =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = @@ -346,8 +320,6 @@ fail("There are no backup files in " + backDir.getAbsolutePath()); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CHECKING I= NTEGRITY =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - checkIntegrity((NodeImpl)repositoryService.getRepository(REPOSITORY_= NAME_SINGLE_DB) .login(credentials, WORKSPACE_NAME) .getRootNode()); @@ -380,7 +352,6 @@ // backup File backDir =3D new File("target/backup/db7"); backDir.mkdirs(); - RepositoryBackupChain bch =3D null; = backupManagerImpl.start(); = @@ -391,12 +362,8 @@ = Thread.sleep(5 * 1000); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP STA= RT =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); + RepositoryBackupChain bch =3D backupManagerImpl.startBackup(config); = - backupManagerImpl.startBackup(config); - - bch =3D backupManagerImpl.findRepositoryBackup(REPOSITORY_NAME_SINGL= E_DB); - // wait till full backup will be stopped while (bch.getState() !=3D BackupJob.FINISHED) { @@ -409,16 +376,12 @@ backupManagerImpl.stopBackup(bch); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP FIN= ISHED =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - // restore File backLog =3D new File(bch.getLogFilePath()); if (backLog.exists()) { RepositoryBackupChainLog bchLog =3D new RepositoryBackupChainLog(= backLog); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RESTORE= START =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = @@ -446,8 +409,6 @@ fail("There are no backup files in " + backDir.getAbsolutePath()); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CHECKING I= NTEGRITY =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - for (String wsName : repositoryService.getRepository(REPOSITORY_NAME= _SINGLE_DB).getWorkspaceNames()) { checkIntegrity((NodeImpl)repositoryService.getRepository(REPOSITO= RY_NAME_SINGLE_DB).login(credentials, wsName) @@ -492,7 +453,6 @@ // backup File backDir =3D new File("target/backup/ws1"); backDir.mkdirs(); - BackupChain bch =3D null; = backupManagerImpl.start(); = @@ -504,12 +464,8 @@ = Thread.sleep(5 * 1000); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP STA= RT =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); + BackupChain bch =3D backupManagerImpl.startBackup(config); = - backupManagerImpl.startBackup(config); - - bch =3D backupManagerImpl.findBackup(REPOSITORY_NAME_MULTI_DB, WORKS= PACE_NAME); - // wait till full backup will be stopped while (bch.getFullBackupState() !=3D BackupJob.FINISHED) { @@ -526,16 +482,12 @@ fail("Can't get fullBackup chain"); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D BACKUP FIN= ISHED =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - // restore File backLog =3D new File(bch.getLogFilePath()); if (backLog.exists()) { BackupChainLog bchLog =3D new BackupChainLog(backLog); = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RESTORE= START =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - assertNotNull(bchLog.getStartedTime()); assertNotNull(bchLog.getFinishedTime()); = @@ -562,8 +514,6 @@ fail("There are no backup files in " + backDir.getAbsolutePath()); } = - System.out.println(" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CHECKING I= NTEGRITY =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D"); - checkIntegrity((NodeImpl)repositoryService.getRepository(REPOSITORY_= NAME_MULTI_DB) .login(credentials, WORKSPACE_NAME) .getRootNode()); Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/RestRepositoryServiceTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/RestRepositoryServiceTest.java 2011-07-15 08:14:35 UTC (= rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/RestRepositoryServiceTest.java 2011-07-15 11:51:25 UTC (= rev 4635) @@ -18,29 +18,19 @@ */ package org.exoplatform.services.jcr.ext.repository; = -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.InputStream; -import java.net.URI; -import java.util.ArrayList; -import java.util.Iterator; - -import javax.jcr.NoSuchWorkspaceException; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.ws.rs.core.MultivaluedMap; - import org.exoplatform.services.jcr.config.ContainerEntry; import org.exoplatform.services.jcr.config.QueryHandlerEntry; import org.exoplatform.services.jcr.config.RepositoryEntry; import org.exoplatform.services.jcr.config.SimpleParameterEntry; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.CredentialsImpl; +import org.exoplatform.services.jcr.core.ManageableRepository; import org.exoplatform.services.jcr.ext.BaseStandaloneTest; import org.exoplatform.services.jcr.ext.app.SessionProviderService; import org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderServ= ice; import org.exoplatform.services.jcr.ext.backup.ContainerRequestUserRole; import org.exoplatform.services.jcr.ext.common.SessionProvider; +import org.exoplatform.services.jcr.util.TesterConfigurationHelper; import org.exoplatform.services.rest.RequestHandler; import org.exoplatform.services.rest.impl.ContainerResponse; import org.exoplatform.services.rest.impl.InputHeadersMap; @@ -56,6 +46,18 @@ import org.exoplatform.ws.frameworks.json.impl.JsonParserImpl; import org.exoplatform.ws.frameworks.json.value.JsonValue; = +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.InputStream; +import java.net.URI; +import java.util.ArrayList; +import java.util.Iterator; + +import javax.jcr.NoSuchWorkspaceException; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.ws.rs.core.MultivaluedMap; + /** * Created by The eXo Platform SAS. * = @@ -69,6 +71,8 @@ { private String REST_REPOSITORY_SERVICE_PATH =3D RestRepositoryService.C= onstants.BASE_URL; = + protected TesterConfigurationHelper helper =3D TesterConfigurationHelpe= r.getInstance(); + private RequestHandler handler; = public void setUp() throws Exception @@ -337,7 +341,7 @@ cres =3D new ContainerResponse(responseWriter); handler.handleRequest(creq, cres); = - assertEquals(204, cres.getStatus()); + assertEquals(200, cres.getStatus()); = try { @@ -352,8 +356,10 @@ = public void testRemoveRepository() throws Exception { - String wsName =3D "ws"; - String repoName =3D "db2"; + ManageableRepository repository =3D helper.createRepository(containe= r, true, null); + = + String wsName =3D repository.getConfiguration().getSystemWorkspaceNa= me(); + String repoName =3D repository.getConfiguration().getName(); = Session session =3D repositoryService.getRepository(repoName).login(new CredentialsIm= pl("root", "exo".toCharArray()), wsName); @@ -363,7 +369,7 @@ MultivaluedMap headers =3D new MultivaluedMapImpl(); = ContainerRequestUserRole creq =3D - new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERV= ICE_PATH + new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVI= CE_PATH + RestRepositoryService.Constants.OperationType.REMOVE_REPOSIT= ORY + "/" + repoName + "/false/"), new URI(""), null, new InputHeadersMap(headers)); = @@ -375,7 +381,7 @@ = //remove with prepare close sessions creq =3D - new ContainerRequestUserRole("POST", new URI(REST_REPOSITORY_SERV= ICE_PATH + new ContainerRequestUserRole("GET", new URI(REST_REPOSITORY_SERVI= CE_PATH + RestRepositoryService.Constants.OperationType.REMOVE_REPOSIT= ORY + "/" + repoName + "/true/"), new URI(""), null, new InputHeadersMap(headers)); = @@ -383,7 +389,7 @@ cres =3D new ContainerResponse(responseWriter); handler.handleRequest(creq, cres); = - assertEquals(204, cres.getStatus()); + assertEquals(200, cres.getStatus()); = try { Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/impl/core/SessionDataManagerTestWrapper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/impl/core/SessionDataManagerTestWrapper.java 2011-07-15 08:14:35 UTC (r= ev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/impl/core/SessionDataManagerTestWrapper.java 2011-07-15 11:51:25 UTC (r= ev 4635) @@ -18,6 +18,7 @@ */ package org.exoplatform.services.jcr.impl.core; = +import org.exoplatform.services.jcr.impl.core.SessionDataManager; import org.exoplatform.services.jcr.impl.dataflow.session.SessionChangesLo= g; = /** Deleted: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/serv= ices/jcr/impl/core/TesterRdbmsWorkspaceInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/impl/core/TesterRdbmsWorkspaceInitializer.java 2011-07-15 08:14:35 UTC = (rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/impl/core/TesterRdbmsWorkspaceInitializer.java 2011-07-15 11:51:25 UTC = (rev 4635) @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.impl.core; - -import org.exoplatform.services.jcr.RepositoryService; -import org.exoplatform.services.jcr.access.AccessManager; -import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; -import org.exoplatform.services.jcr.config.RepositoryEntry; -import org.exoplatform.services.jcr.config.WorkspaceEntry; -import org.exoplatform.services.jcr.ext.backup.impl.rdbms.RdbmsWorkspaceIn= itializer; -import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerImpl; -import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; -import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; -import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; - -import javax.jcr.PathNotFoundException; -import javax.jcr.RepositoryException; - -/** - * Created by The eXo Platform SAS - * = - * 04.12.2006 - * = - * For testing purpose - * = - * @author Peter N= edonosko - * @version $Id: SessionDataManagerTestWrapper.java 11907 2008-03-13 15:36= :21Z ksm $ - */ -public class TesterRdbmsWorkspaceInitializer extends RdbmsWorkspaceInitial= izer -{ - - public TesterRdbmsWorkspaceInitializer(WorkspaceEntry config, Repositor= yEntry repConfig, - CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl nam= espaceRegistry, - LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager= , ValueFactoryImpl valueFactory, - AccessManager accessManager, RepositoryService repositoryServi= ce, FileCleanerHolder cleanerHolder) - throws RepositoryConfigurationException, - PathNotFoundException, RepositoryException - { - super(config, repConfig, dataManager, namespaceRegistry, locationFac= tory, nodeTypeManager, valueFactory, - accessManager, repositoryService, cleanerHolder); - } - - @Override - public void fullRdbmsRestore() throws RepositoryException - { - super.fullRdbmsRestore(); - } - -} Added: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/servic= es/jcr/util/TesterRdbmsWorkspaceInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/util/TesterRdbmsWorkspaceInitializer.java (rev = 0) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/util/TesterRdbmsWorkspaceInitializer.java 2011-07-15 11:51:25 UTC (rev = 4635) @@ -0,0 +1,67 @@ +/* + * 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.util; + +import org.exoplatform.services.jcr.RepositoryService; +import org.exoplatform.services.jcr.access.AccessManager; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.config.RepositoryEntry; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.ext.backup.impl.rdbms.RdbmsWorkspaceIn= itializer; +import org.exoplatform.services.jcr.impl.core.LocationFactory; +import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl; +import org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeManagerImpl; +import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl; +import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWork= spaceDataManager; +import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder; + +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; + +/** + * Created by The eXo Platform SAS + * = + * 04.12.2006 + * = + * For testing purpose + * = + * @author Peter N= edonosko + * @version $Id: SessionDataManagerTestWrapper.java 11907 2008-03-13 15:36= :21Z ksm $ + */ +public class TesterRdbmsWorkspaceInitializer extends RdbmsWorkspaceInitial= izer +{ + + public TesterRdbmsWorkspaceInitializer(WorkspaceEntry config, Repositor= yEntry repConfig, + CacheableWorkspaceDataManager dataManager, NamespaceRegistryImpl nam= espaceRegistry, + LocationFactory locationFactory, NodeTypeManagerImpl nodeTypeManager= , ValueFactoryImpl valueFactory, + AccessManager accessManager, RepositoryService repositoryServi= ce, FileCleanerHolder cleanerHolder) + throws RepositoryConfigurationException, + PathNotFoundException, RepositoryException + { + super(config, repConfig, dataManager, namespaceRegistry, locationFac= tory, nodeTypeManager, valueFactory, + accessManager, repositoryService, cleanerHolder); + } + + @Override + public void fullRdbmsRestore() throws RepositoryException + { + super.fullRdbmsRestore(); + } + +} Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalon= e/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.ext/src/test/resources/conf/standalone/test= -configuration.xml 2011-07-15 08:14:35 UTC (rev 4634) +++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test= -configuration.xml 2011-07-15 11:51:25 UTC (rev 4635) @@ -409,33 +409,9 @@ - - - - addProperty,changeProperty --===============8260787605141409547==-- From do-not-reply at jboss.org Fri Jul 15 08:06:28 2011 Content-Type: multipart/mixed; boundary="===============0696360527172829633==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4637 - jcr/trunk/exo.jcr.component.ext. Date: Fri, 15 Jul 2011 08:06:27 -0400 Message-ID: <201107151206.p6FC6Rle027468@svn01.web.mwc.hst.phx2.redhat.com> --===============0696360527172829633== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-15 08:06:27 -0400 (Fri, 15 Jul 2011) New Revision: 4637 Modified: jcr/trunk/exo.jcr.component.ext/pom.xml Log: EXOJCR-1443: Review tests in jcr-ext project Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-15 11:56:25 UTC (rev 46= 36) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-15 12:06:27 UTC (rev 46= 37) @@ -189,7 +189,6 @@ **/backup/TestBackupRestart.java **/backup/load/TestLoadBackup.java* **/replication/** - **/LocalStorageMultithreadTest.java **/repository/creation/cluster/** --===============0696360527172829633==-- From do-not-reply at jboss.org Fri Jul 15 08:22:58 2011 Content-Type: multipart/mixed; boundary="===============8763041656298613290==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4638 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl. Date: Fri, 15 Jul 2011 08:22:58 -0400 Message-ID: <201107151222.p6FCMw3m029337@svn01.web.mwc.hst.phx2.redhat.com> --===============8763041656298613290== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-15 08:22:58 -0400 (Fri, 15 Jul 2011) New Revision: 4638 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/backup/impl/BackupManagerImpl.java Log: EXOJCR-1434: FileCleaner in BackupManagerImpl should be used from proper Re= positoryContainer 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 2011-07-15 12:06:27 UTC (rev 463= 7) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/backup/impl/BackupManagerImpl.java 2011-07-15 12:22:58 UTC (rev 463= 8) @@ -198,7 +198,6 @@ = private final RegistryService registryService; = - private FileCleaner fileCleaner; = private BackupScheduler scheduler; = @@ -846,21 +845,7 @@ */ public void start() { - // get FileCleaner from container's component FileCleanerHolder - try - { - ManageableRepository repository =3D repoService.getCurrentReposit= ory(); - String workspaceName =3D repository.getConfiguration().getSystemW= orkspaceName(); = - this.fileCleaner =3D - ((FileCleanerHolder)repository.getWorkspaceContainer(workspace= Name).getComponent(FileCleanerHolder.class)) - .getFileCleaner(); - } - catch (RepositoryException e) - { - // do nothing. should not happens - } - //remove if exists all old jcrrestorewi*.tmp files. File[] files =3D PrivilegedFileHelper.listFiles(tempDir, new JcrRest= oreWiFilter()); for (int i =3D 0; i < files.length; i++) @@ -1008,10 +993,11 @@ throws RepositoryException, RepositoryConfigurationException, Backup= OperationException, FileNotFoundException, IOException, ClassNotFoundException { + WorkspaceContainerFacade workspaceContainer =3D repoService.getRepos= itory(repositoryName).getWorkspaceContainer(workspaceName); WorkspacePersistentDataManager dataManager =3D - (WorkspacePersistentDataManager)repoService.getRepository(reposit= oryName).getWorkspaceContainer(workspaceName) + (WorkspacePersistentDataManager)workspaceContainer .getComponent(WorkspacePersistentDataManager.class); - + FileCleaner fileCleaner =3D ((FileCleanerHolder)workspaceContainer.g= etComponent(FileCleanerHolder.class)).getFileCleaner(); JCRRestore restorer =3D new JCRRestore(dataManager, fileCleaner); restorer.incrementalRestore(new File(pathBackupFile)); } --===============8763041656298613290==-- From do-not-reply at jboss.org Sun Jul 17 21:57:47 2011 Content-Type: multipart/mixed; boundary="===============0150293920718703469==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4639 - in jcr/branches/1.12.x: exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/webdav/command and 3 other directories. Date: Sun, 17 Jul 2011 21:57:47 -0400 Message-ID: <201107180157.p6I1vl0V019213@svn01.web.mwc.hst.phx2.redhat.com> --===============0150293920718703469== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: trang_vu Date: 2011-07-17 21:57:47 -0400 (Sun, 17 Jul 2011) New Revision: 4639 Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1630/ Removed: jcr/branches/1.12.x/patch/1.12.9-GA/JCR-1630/ Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatfo= rm/services/jcr/webdav/WebDavServiceImpl.java jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatfo= rm/services/jcr/webdav/command/TestCopy.java jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatfo= rm/services/jcr/webdav/command/TestMove.java jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1630/JCR-1630.patch Log: JCR-1630: update WebDavServiceImpl to escape characters while MOVE. Problem description * In jcr 1.10.12, it is impossible to copy or move a file when the destinat= ion path contains space characters (see JCR-1628). This problem is not reproduced in jcr 1.12.9-GA, but for easy maintenance= , the same fix is applied also to jcr 1.12.x. Fix description * Update WebDavServiceImpl. Destination header might contain unescaped char= acters. If Exception has come during URI building, try to escape characters= and build URI again. * Add unit tests in TestMove and TestCopy. Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/ex= oplatform/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/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/WebDavServiceImpl.java 2011-07-15 12:22:58 UTC (rev= 4638) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/main/java/org/exoplatf= orm/services/jcr/webdav/WebDavServiceImpl.java 2011-07-18 01:57:47 UTC (rev= 4639) @@ -72,6 +72,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.net.URI; +import java.net.URISyntaxException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; @@ -384,9 +385,12 @@ try { String serverURI =3D uriInfo.getBaseUriBuilder().path(getClass())= .path(repoName).build().toString(); - URI dest =3D new URI(destinationHeader); - URI base =3D new URI(serverURI); = + // destinationHeader could begins from workspace name (passed fro= m cms = + // WebDAVServiceImpl) and doesn't contain neither host no reposit= ory name = + URI dest =3D buildURI(destinationHeader); + URI base =3D buildURI(serverURI); + String destPath =3D dest.getPath(); int repoIndex =3D destPath.indexOf(repoName); = @@ -395,12 +399,12 @@ // or destination header is malformed // we return BAD_GATEWAY(502) HTTP status // more info here http://www.webdav.org/specs/rfc2518.html#METHOD= _COPY - if (!base.getHost().equals(dest.getHost()) || repoIndex =3D=3D -1) + if (dest.getHost() !=3D null && !base.getHost().equals(dest.getHo= st())) { return Response.status(HTTPStatus.BAD_GATEWAY).entity("Bad Gat= eway").build(); } = - destPath =3D normalizePath(dest.getPath().substring(repoIndex + r= epoName.length() + 1)); + destPath =3D normalizePath(repoIndex =3D=3D -1 ? destPath : destP= ath.substring(repoIndex + repoName.length() + 1)); = String srcWorkspace =3D workspaceName(repoPath); String srcNodePath =3D path(repoPath); @@ -776,8 +780,10 @@ { String serverURI =3D uriInfo.getBaseUriBuilder().path(getClass())= .path(repoName).build().toString(); = - URI dest =3D new URI(destinationHeader); - URI base =3D new URI(serverURI); + // destinationHeader could begins from workspace name (passed fro= m cms = + // WebDAVServiceImpl) and doesn't contain neither host no reposit= ory name = + URI dest =3D buildURI(destinationHeader); + URI base =3D buildURI(serverURI); = String destPath =3D dest.getPath(); int repoIndex =3D destPath.indexOf(repoName); @@ -787,14 +793,12 @@ // or destination header is malformed // we return BAD_GATEWAY(502) HTTP status // more info here http://www.webdav.org/specs/rfc2518.html#METHOD= _MOVE - if (!base.getHost().equals(dest.getHost()) || repoIndex =3D=3D -1) - - if (!destinationHeader.startsWith(serverURI)) + if (dest.getHost() !=3D null && !base.getHost().equals(dest.getHo= st())) { return Response.status(HTTPStatus.BAD_GATEWAY).entity("Bad Gat= eway").build(); } = - destPath =3D normalizePath(dest.getPath().substring(repoIndex + r= epoName.length() + 1)); + destPath =3D normalizePath(repoIndex =3D=3D -1 ? destPath : destP= ath.substring(repoIndex + repoName.length() + 1)); = String destWorkspace =3D workspaceName(destPath); String destNodePath =3D path(destPath); @@ -1338,4 +1342,18 @@ return lockTokens; } = + /** = + * Build URI from string. = + */ + private URI buildURI(String path) throws URISyntaxException + { + try + { + return new URI(path); + } + catch (URISyntaxException e) + { + return new URI(TextUtil.escape(path, '%', true)); + } + } } Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/ex= oplatform/services/jcr/webdav/command/TestCopy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestCopy.java 2011-07-15 12:22:58 UTC (rev = 4638) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatf= orm/services/jcr/webdav/command/TestCopy.java 2011-07-18 01:57:47 UTC (rev = 4639) @@ -194,9 +194,130 @@ ContainerResponse response =3D service(WebDAVMethods.COPY, getPathWS= () + filename, host, headers, null); // check if operation completed successfully, we expect a new resour= ce to be created assertEquals(HTTPStatus.CREATED, response.getStatus()); + } = + public void testCopyDestinationHeaderBeginsFromWorkspaceName() throws E= xception + { + String content =3D TestUtils.getFileContent(); + String filename =3D TestUtils.getFileName(); + InputStream inputStream =3D new ByteArrayInputStream(content.getByte= s()); + TestUtils.addContent(session, filename, inputStream, defaultFileNode= Type, ""); + String destFilename =3D TestUtils.getFileName(); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + headers.add(ExtHttpHeaders.DESTINATION, WORKSPACE + destFilename); + + ContainerResponse response =3D service(WebDAVMethods.COPY, getPathWS= () + filename, host, headers, null); + + assertEquals(HTTPStatus.CREATED, response.getStatus()); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(des= tFilename))); + + Node nodeDest =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(destFilename)); + assertTrue(nodeDest.hasNode("jcr:content")); + + Node nodeDestContent =3D nodeDest.getNode("jcr:content"); + assertTrue(nodeDestContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamDest =3D (ByteArrayInputStream)nodeDestCo= ntent.getProperty("jcr:data").getStream(); + String getContentDest =3D TestUtils.stream2string(streamDest, null); + assertEquals(content, getContentDest); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(fil= ename))); + + Node nodeBase =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(filename)); + assertTrue(nodeBase.hasNode("jcr:content")); + + Node nodeBaseContent =3D nodeBase.getNode("jcr:content"); + assertTrue(nodeBaseContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamBase =3D (ByteArrayInputStream)nodeBaseCo= ntent.getProperty("jcr:data").getStream(); + String getContentBase =3D TestUtils.stream2string(streamBase, null); + assertEquals(content, getContentBase); } = + public void testCopyToFolderWithSpace() throws Exception + { + String folderNameWithSpace =3D "new folder - testCopyToFolderWithSpa= ce"; + session.getRootNode().addNode(folderNameWithSpace, "nt:folder"); + session.save(); + + String content =3D TestUtils.getFileContent(); + String filename =3D TestUtils.getFileName(); + InputStream inputStream =3D new ByteArrayInputStream(content.getByte= s()); + TestUtils.addContent(session, filename, inputStream, defaultFileNode= Type, ""); + String destFilename =3D "/" + folderNameWithSpace + TestUtils.getFil= eName(); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + headers.add(ExtHttpHeaders.DESTINATION, WORKSPACE + destFilename); + + ContainerResponse response =3D service(WebDAVMethods.COPY, getPathWS= () + filename, host, headers, null); + + assertEquals(HTTPStatus.CREATED, response.getStatus()); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(des= tFilename))); + + Node nodeDest =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(destFilename)); + assertTrue(nodeDest.hasNode("jcr:content")); + + Node nodeDestContent =3D nodeDest.getNode("jcr:content"); + assertTrue(nodeDestContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamDest =3D (ByteArrayInputStream)nodeDestCo= ntent.getProperty("jcr:data").getStream(); + String getContentDest =3D TestUtils.stream2string(streamDest, null); + assertEquals(content, getContentDest); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(fil= ename))); + + Node nodeBase =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(filename)); + assertTrue(nodeBase.hasNode("jcr:content")); + + Node nodeBaseContent =3D nodeBase.getNode("jcr:content"); + assertTrue(nodeBaseContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamBase =3D (ByteArrayInputStream)nodeBaseCo= ntent.getProperty("jcr:data").getStream(); + String getContentBase =3D TestUtils.stream2string(streamBase, null); + assertEquals(content, getContentBase); + } + + public void testCopyToFolderWithSpaceUnescapedChars() throws Exception + { + String folderNameWithSpace =3D "new folder - testCopyToFolderWithSpa= ceUnescapedChars"; + session.getRootNode().addNode(folderNameWithSpace, "nt:folder"); + session.save(); + + String content =3D TestUtils.getFileContent(); + String filename =3D TestUtils.getFileName(); + InputStream inputStream =3D new ByteArrayInputStream(content.getByte= s()); + TestUtils.addContent(session, filename, inputStream, defaultFileNode= Type, ""); + String destFilename =3D TextUtil.unescape("/" + folderNameWithSpace = + TestUtils.getFileName(), '%'); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + headers.add(ExtHttpHeaders.DESTINATION, WORKSPACE + destFilename); + + ContainerResponse response =3D service(WebDAVMethods.COPY, getPathWS= () + filename, host, headers, null); + + assertEquals(HTTPStatus.CREATED, response.getStatus()); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(des= tFilename))); + + Node nodeDest =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(destFilename)); + assertTrue(nodeDest.hasNode("jcr:content")); + + Node nodeDestContent =3D nodeDest.getNode("jcr:content"); + assertTrue(nodeDestContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamDest =3D (ByteArrayInputStream)nodeDestCo= ntent.getProperty("jcr:data").getStream(); + String getContentDest =3D TestUtils.stream2string(streamDest, null); + assertEquals(content, getContentDest); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(fil= ename))); + + Node nodeBase =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(filename)); + assertTrue(nodeBase.hasNode("jcr:content")); + + Node nodeBaseContent =3D nodeBase.getNode("jcr:content"); + assertTrue(nodeBaseContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamBase =3D (ByteArrayInputStream)nodeBaseCo= ntent.getProperty("jcr:data").getStream(); + String getContentBase =3D TestUtils.stream2string(streamBase, null); + assertEquals(content, getContentBase); + } + @Override protected String getRepositoryName() { Modified: jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/ex= oplatform/services/jcr/webdav/command/TestMove.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestMove.java 2011-07-15 12:22:58 UTC (rev = 4638) +++ jcr/branches/1.12.x/exo.jcr.component.webdav/src/test/java/org/exoplatf= orm/services/jcr/webdav/command/TestMove.java 2011-07-18 01:57:47 UTC (rev = 4639) @@ -182,6 +182,98 @@ = } = + public void testMoveHeaderBeginsFromWorkspaceName() throws Exception + { + String content =3D TestUtils.getFileContent(); + String filename =3D TestUtils.getFileName(); + InputStream inputStream =3D new ByteArrayInputStream(content.getByte= s()); + TestUtils.addContent(session, filename, inputStream, defaultFileNode= Type, ""); + String destFilename =3D TestUtils.getFileName(); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + + headers.add(ExtHttpHeaders.DESTINATION, WORKSPACE + destFilename); + ContainerResponse response =3D service(WebDAVMethods.MOVE, getPathWS= () + filename, host, headers, null); + + assertEquals(HTTPStatus.CREATED, response.getStatus()); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(des= tFilename))); + + Node nodeDest =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(destFilename)); + assertTrue(nodeDest.hasNode("jcr:content")); + + Node nodeDestContent =3D nodeDest.getNode("jcr:content"); + assertTrue(nodeDestContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamDest =3D (ByteArrayInputStream)nodeDestCo= ntent.getProperty("jcr:data").getStream(); + String getContentDest =3D TestUtils.stream2string(streamDest, null); + assertEquals(content, getContentDest); + assertFalse(session.getRootNode().hasNode(TextUtil.relativizePath(fi= lename))); + } + + public void testMoveToFolderWithSpace() throws Exception + { + String folderNameWithSpace =3D "new folder - testMoveToFolderWithSpa= ce"; + session.getRootNode().addNode(folderNameWithSpace, "nt:folder"); + session.save(); + + String content =3D TestUtils.getFileContent(); + String filename =3D TestUtils.getFileName(); + InputStream inputStream =3D new ByteArrayInputStream(content.getByte= s()); + TestUtils.addContent(session, filename, inputStream, defaultFileNode= Type, ""); + String destFilename =3D "/" + folderNameWithSpace + TestUtils.getFil= eName(); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + + headers.add(ExtHttpHeaders.DESTINATION, WORKSPACE + destFilename); + ContainerResponse response =3D service(WebDAVMethods.MOVE, getPathWS= () + filename, host, headers, null); + + assertEquals(HTTPStatus.CREATED, response.getStatus()); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(des= tFilename))); + + Node nodeDest =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(destFilename)); + assertTrue(nodeDest.hasNode("jcr:content")); + + Node nodeDestContent =3D nodeDest.getNode("jcr:content"); + assertTrue(nodeDestContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamDest =3D (ByteArrayInputStream)nodeDestCo= ntent.getProperty("jcr:data").getStream(); + String getContentDest =3D TestUtils.stream2string(streamDest, null); + assertEquals(content, getContentDest); + assertFalse(session.getRootNode().hasNode(TextUtil.relativizePath(fi= lename))); + } + + public void testMoveToFolderWithSpaceUnescapedChars() throws Exception + { + String folderNameWithSpace =3D "new folder - testMoveToFolderWithSpa= ceUnescapedChars"; + session.getRootNode().addNode(folderNameWithSpace, "nt:folder"); + session.save(); + + String content =3D TestUtils.getFileContent(); + String filename =3D TestUtils.getFileName(); + InputStream inputStream =3D new ByteArrayInputStream(content.getByte= s()); + TestUtils.addContent(session, filename, inputStream, defaultFileNode= Type, ""); + String destFilename =3D TextUtil.unescape("/" + folderNameWithSpace = + TestUtils.getFileName(), '%'); + + MultivaluedMap headers =3D new MultivaluedMapImpl(); + + headers.add(ExtHttpHeaders.DESTINATION, WORKSPACE + destFilename); + ContainerResponse response =3D service(WebDAVMethods.MOVE, getPathWS= () + filename, host, headers, null); + + assertEquals(HTTPStatus.CREATED, response.getStatus()); + assertTrue(session.getRootNode().hasNode(TextUtil.relativizePath(des= tFilename))); + + Node nodeDest =3D session.getRootNode().getNode(TextUtil.relativizeP= ath(destFilename)); + assertTrue(nodeDest.hasNode("jcr:content")); + + Node nodeDestContent =3D nodeDest.getNode("jcr:content"); + assertTrue(nodeDestContent.hasProperty("jcr:data")); + + ByteArrayInputStream streamDest =3D (ByteArrayInputStream)nodeDestCo= ntent.getProperty("jcr:data").getStream(); + String getContentDest =3D TestUtils.stream2string(streamDest, null); + assertEquals(content, getContentDest); + assertFalse(session.getRootNode().hasNode(TextUtil.relativizePath(fi= lename))); + } + @Override protected String getRepositoryName() { Modified: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1630/JCR-1630.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/1.12.9-GA/JCR-1630/JCR-1630.patch 2011-07-08 = 08:01:53 UTC (rev 4614) +++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1630/JCR-1630.patch 2011-07-18= 01:57:47 UTC (rev 4639) @@ -1,6 +1,6 @@ Index: exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr= /webdav/command/TestMove.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.webdav/src/test/java/org/exoplatform/services/jcr/we= bdav/command/TestMove.java (revision 4383) +--- exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/we= bdav/command/TestMove.java (revision 4614) +++ exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/we= bdav/command/TestMove.java (working copy) @@ -182,6 +182,98 @@ = @@ -103,7 +103,7 @@ { Index: exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr= /webdav/command/TestCopy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.webdav/src/test/java/org/exoplatform/services/jcr/we= bdav/command/TestCopy.java (revision 4383) +--- exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/we= bdav/command/TestCopy.java (revision 4614) +++ exo.jcr.component.webdav/src/test/java/org/exoplatform/services/jcr/we= bdav/command/TestCopy.java (working copy) @@ -194,9 +194,130 @@ ContainerResponse response =3D service(WebDAVMethods.COPY, getPathW= S() + filename, host, headers, null); @@ -238,7 +238,7 @@ { Index: 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 ---- exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/we= bdav/WebDavServiceImpl.java (revision 4383) +--- exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/we= bdav/WebDavServiceImpl.java (revision 4614) +++ exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/we= bdav/WebDavServiceImpl.java (working copy) @@ -72,6 +72,7 @@ import java.lang.annotation.Annotation; @@ -308,7 +308,7 @@ = String destWorkspace =3D workspaceName(destPath); String destNodePath =3D path(destPath); -@@ -1335,4 +1339,18 @@ +@@ -1338,4 +1342,18 @@ return lockTokens; } = --===============0150293920718703469==-- From do-not-reply at jboss.org Mon Jul 18 04:50:09 2011 Content-Type: multipart/mixed; boundary="===============3601478890406748603==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4640 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/version and 2 other directories. Date: Mon, 18 Jul 2011 04:50:09 -0400 Message-ID: <201107180850.p6I8o90x005665@svn01.web.mwc.hst.phx2.redhat.com> --===============3601478890406748603== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-18 04:50:08 -0400 (Mon, 18 Jul 2011) New Revision: 4640 Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/version/TestOnParentVersionIgnore.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/dataflow/ItemDataTraversingVisitor.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/version/FrozenNodeInitializer.java jcr/trunk/exo.jcr.component.core/src/test/resources/conf/test/nodetypes-= usecase.xml Log: EXOJCR-1413: [Perf] ItemDataTraversingVisitor#visit(NodeData node) continue= to visit deeper althought onParentVersion=3DIGNORE Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/ItemDataTraversingVisitor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ItemDataTraversingVisitor.java 2011-07-18 01:57:47 UTC (rev 4= 639) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/ItemDataTraversingVisitor.java 2011-07-18 08:50:08 UTC (rev 4= 640) @@ -88,10 +88,10 @@ if (maxLevel =3D=3D INFINITE_DEPTH || currentLevel < maxLevel) { currentLevel++; - for (PropertyData data : dataManager.getChildPropertiesData(no= de)) - data.accept(this); - for (NodeData data : dataManager.getChildNodesData(node)) - data.accept(this); + + visitChildProperties(node); + visitChildNodes(node); + currentLevel--; } leaving(node, currentLevel); @@ -101,10 +101,27 @@ currentLevel =3D 0; throw re; } + } = + /** + * Visit all child properties. + */ + protected void visitChildProperties(NodeData node) throws RepositoryExc= eption + { + for (PropertyData data : dataManager.getChildPropertiesData(node)) + data.accept(this); } = /** + * Visit all child nodes. + */ + protected void visitChildNodes(NodeData node) throws RepositoryException + { + for (NodeData data : dataManager.getChildNodesData(node)) + data.accept(this); + } + + /** * {@inheritDoc} */ public ItemDataConsumer getDataManager() Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/version/FrozenNodeInitializer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/version/FrozenNodeInitializer.java 2011-07-18 01:57:47 UTC (= rev 4639) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/version/FrozenNodeInitializer.java 2011-07-18 08:50:08 UTC (= rev 4640) @@ -88,6 +88,20 @@ this.contextNodes.push(frozen); } = + /** + * {@inheritDoc} + */ + protected void visitChildNodes(NodeData node) throws RepositoryException + { + // It is not necessary to traverse child nodes since parent is null = (OnParentVersion=3DIGNORE case) + if (currentNode() =3D=3D null) + { + return; + } + + super.visitChildNodes(node); + } + @Override protected void entering(PropertyData property, int level) throws Reposi= toryException { Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/servi= ces/jcr/impl/version/TestOnParentVersionIgnore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/version/TestOnParentVersionIgnore.java (r= ev 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/version/TestOnParentVersionIgnore.java 2011-07-18 08:50:08 UTC (r= ev 4640) @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2011 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.version; + +import org.exoplatform.services.jcr.JcrImplBaseTest; + +import javax.jcr.Node; +import javax.jcr.version.Version; + +/** + * @author Anatoliy Bazko + * @version $Id$ + */ +public class TestOnParentVersionIgnore extends JcrImplBaseTest +{ + public void testFrozenInitialized_OnParentVersion_IGNORE_EXOJCR1413() t= hrows Exception + { + Node testNode =3D session.getRootNode().addNode("test"); + testNode.addMixin("mix:versionable"); + testNode.addNode("page", "exo:page").addNode("page", "exo:page"); + testNode.addNode("hello"); + session.save(); + + Version ver =3D testNode.checkin(); + testNode.checkout(); + + try + { + ver.getNode("jcr:frozenNode").getNode("page"); + } + catch (Exception e) + { + fail("Node ../test/page should be accessable"); + } + + try + { + ver.getNode("jcr:frozenNode").getNode("hello"); + } + catch (Exception e) + { + fail("Node ../test/hello should be accessable"); + } + + try + { + ver.getNode("jcr:frozenNode").getNode("page").getNode("page"); + fail("Node ../test/page/page should not be accessable"); + } + catch (Exception e) + { + } + + testNode.remove(); + session.save(); + } +} Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/impl/version/TestOnParentVersionIgnore.java ___________________________________________________________________ Added: svn:keywords + Id Modified: jcr/trunk/exo.jcr.component.core/src/test/resources/conf/test/nod= etypes-usecase.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/test/nodetypes= -usecase.xml 2011-07-18 01:57:47 UTC (rev 4639) +++ jcr/trunk/exo.jcr.component.core/src/test/resources/conf/test/nodetypes= -usecase.xml 2011-07-18 08:50:08 UTC (rev 4640) @@ -266,5 +266,18 @@ = - + + + nt:base + nt:folder + mix:referenceable + + + + + exo:page + + + + --===============3601478890406748603==-- From do-not-reply at jboss.org Tue Jul 19 02:52:50 2011 Content-Type: multipart/mixed; boundary="===============6413946509937550718==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4641 - in kernel/branches/2.2.x/patch/2.2.10-GA: KER-176 and 1 other directory. Date: Tue, 19 Jul 2011 02:52:50 -0400 Message-ID: <201107190652.p6J6qoHc011434@svn01.web.mwc.hst.phx2.redhat.com> --===============6413946509937550718== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-19 02:52:50 -0400 (Tue, 19 Jul 2011) New Revision: 4641 Added: kernel/branches/2.2.x/patch/2.2.10-GA/KER-176/ kernel/branches/2.2.x/patch/2.2.10-GA/KER-176/KER-176.patch Log: KER-176: backported profile 'release' tp branch Added: kernel/branches/2.2.x/patch/2.2.10-GA/KER-176/KER-176.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 --- kernel/branches/2.2.x/patch/2.2.10-GA/KER-176/KER-176.patch = (rev 0) +++ kernel/branches/2.2.x/patch/2.2.10-GA/KER-176/KER-176.patch 2011-07-19 = 06:52:50 UTC (rev 4641) @@ -0,0 +1,45 @@ +Index: pom.xml +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- pom.xml (revision 4640) ++++ pom.xml (working copy) +@@ -211,5 +211,40 @@ + test + + ++ ++ ++ release ++ ++ ++ ++ maven-assembly-plugin ++ ++ ++ org.apache.apache.resources ++ apache-source-release-assembly-descri= ptor ++ 1.0.2 ++ ++ ++ ++ ++ source-release-assembly ++ package ++ ++ single ++ ++ ++ true ++ ++ source-release ++ ++ gnu ++ ++ ++ ++ ++ ++ ++ ++ + = + Property changes on: kernel/branches/2.2.x/patch/2.2.10-GA/KER-176/KER-176.= patch ___________________________________________________________________ Added: svn:eol-style + native --===============6413946509937550718==-- From do-not-reply at jboss.org Tue Jul 19 02:57:42 2011 Content-Type: multipart/mixed; boundary="===============7855194826069654124==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4642 - in core/branches/2.3.x/patch/2.3.10: COR-243 and 1 other directory. Date: Tue, 19 Jul 2011 02:57:42 -0400 Message-ID: <201107190657.p6J6vgkL011799@svn01.web.mwc.hst.phx2.redhat.com> --===============7855194826069654124== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-19 02:57:42 -0400 (Tue, 19 Jul 2011) New Revision: 4642 Added: core/branches/2.3.x/patch/2.3.10/COR-243/ core/branches/2.3.x/patch/2.3.10/COR-243/COR-243.patch Log: COR-243: backported 'release' profile Added: core/branches/2.3.x/patch/2.3.10/COR-243/COR-243.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 --- core/branches/2.3.x/patch/2.3.10/COR-243/COR-243.patch = (rev 0) +++ core/branches/2.3.x/patch/2.3.10/COR-243/COR-243.patch 2011-07-19 06:57= :42 UTC (rev 4642) @@ -0,0 +1,46 @@ +Index: pom.xml +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- pom.xml (revision 4640) ++++ pom.xml (working copy) +@@ -379,4 +379,41 @@ + test + + ++ = ++ ++ ++ release ++ ++ ++ ++ maven-assembly-plugin ++ ++ ++ org.apache.apache.resources ++ apache-source-release-assembly-descri= ptor ++ 1.0.2 ++ ++ ++ ++ ++ source-release-assembly ++ package ++ ++ single ++ ++ ++ true ++ ++ source-release ++ ++ gnu ++ ++ ++ ++ ++ ++ ++ ++ ++ = + Property changes on: core/branches/2.3.x/patch/2.3.10/COR-243/COR-243.patch ___________________________________________________________________ Added: svn:eol-style + native --===============7855194826069654124==-- From do-not-reply at jboss.org Tue Jul 19 02:59:14 2011 Content-Type: multipart/mixed; boundary="===============6493426838793010739==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4643 - in kernel/trunk: exo.kernel.commons and 13 other directories. Date: Tue, 19 Jul 2011 02:59:14 -0400 Message-ID: <201107190659.p6J6xEDM011812@svn01.web.mwc.hst.phx2.redhat.com> --===============6493426838793010739== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 02:59:13 -0400 (Tue, 19 Jul 2011) New Revision: 4643 Modified: kernel/trunk/exo.kernel.commons.test/pom.xml kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/pom.xml kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-demo/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extras/pom.x= ml kernel/trunk/exo.kernel.mc-integration/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.3.0-CR4 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 2011-07-19 06:57:42 UTC (rev 46= 42) +++ kernel/trunk/exo.kernel.commons/pom.xml 2011-07-19 06:59:13 UTC (rev 46= 43) @@ -16,7 +16,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.commons 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 2011-07-19 06:57:42 UTC (r= ev 4642) +++ kernel/trunk/exo.kernel.commons.test/pom.xml 2011-07-19 06:59:13 UTC (r= ev 4643) @@ -16,7 +16,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.commons.test 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 2011-07-19 06:57:42 UTC= (rev 4642) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2011-07-19 06:59:13 UTC= (rev 4643) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.component.cache Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2011-07-19 06:57:42 U= TC (rev 4642) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2011-07-19 06:59:13 U= TC (rev 4643) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.component.command Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2011-07-19 06:57:42 UT= C (rev 4642) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2011-07-19 06:59:13 UT= C (rev 4643) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.component.common Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/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.component.ext.cache.impl.infinispan.v4/pom.xml = 2011-07-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/pom.xml = 2011-07-19 06:59:13 UTC (rev 4643) @@ -19,7 +19,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 exo.kernel.component.ext.cache.impl.infinispan.v4 eXo Kernel :: Cache Extension :: Infinispan Implementation 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 2011-= 07-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2011-= 07-19 06:59:13 UTC (rev 4643) @@ -23,7 +23,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 exo.kernel.component.ext.cache.impl.jboss.v3 eXo Kernel :: Cache Extension :: JBoss Cache Implementation 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 2011-07-19 06:57:42 UTC (rev = 4642) +++ kernel/trunk/exo.kernel.container/pom.xml 2011-07-19 06:59:13 UTC (rev = 4643) @@ -12,7 +12,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 exo.kernel.container eXo Kernel :: Container Modified: kernel/trunk/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/trunk/exo.kernel.mc-integration/exo.kernel.mc-int/pom.xml 2011-0= 7-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int/pom.xml 2011-0= 7-19 06:59:13 UTC (rev 4643) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.mc-int Modified: kernel/trunk/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/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-demo/pom.xml 2= 011-07-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-demo/pom.xml 2= 011-07-19 06:59:13 UTC (rev 4643) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.mc-int-demo 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 = 2011-07-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/pom.xml = 2011-07-19 06:59:13 UTC (rev 4643) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.mc-int-tests Modified: kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extra= 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 --- kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extras/pom.= xml 2011-07-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extras/pom.= xml 2011-07-19 06:59:13 UTC (rev 4643) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = exo.kernel.mc-kernel-extras Modified: kernel/trunk/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/trunk/exo.kernel.mc-integration/pom.xml 2011-07-19 06:57:42 UTC = (rev 4642) +++ kernel/trunk/exo.kernel.mc-integration/pom.xml 2011-07-19 06:59:13 UTC = (rev 4643) @@ -6,7 +6,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = mc-integration-parent Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2011-07-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/packaging/module/pom.xml 2011-07-19 06:59:13 UTC (rev 4643) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = 4.0.0 Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2011-07-19 06:57:42 UTC (rev 4642) +++ kernel/trunk/pom.xml 2011-07-19 06:59:13 UTC (rev 4643) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 pom = eXo Kernel @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk - http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.3.0-CR4 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.3.0-CR4 + http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.3.0-CR4 = --===============6493426838793010739==-- From do-not-reply at jboss.org Tue Jul 19 03:00:08 2011 Content-Type: multipart/mixed; boundary="===============6728696924339669727==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4644 - kernel/tags. Date: Tue, 19 Jul 2011 03:00:08 -0400 Message-ID: <201107190700.p6J708mm011919@svn01.web.mwc.hst.phx2.redhat.com> --===============6728696924339669727== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 03:00:08 -0400 (Tue, 19 Jul 2011) New Revision: 4644 Added: kernel/tags/2.3.0-CR4/ Log: [maven-scm] copy for tag 2.3.0-CR4 --===============6728696924339669727==-- From do-not-reply at jboss.org Tue Jul 19 03:02:36 2011 Content-Type: multipart/mixed; boundary="===============6584921007101243662==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4645 - in ws/branches/2.1.x/patch: 2.1.10-GA and 1 other directories. Date: Tue, 19 Jul 2011 03:02:36 -0400 Message-ID: <201107190702.p6J72aFu018282@svn01.web.mwc.hst.phx2.redhat.com> --===============6584921007101243662== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-19 03:02:36 -0400 (Tue, 19 Jul 2011) New Revision: 4645 Added: ws/branches/2.1.x/patch/2.1.10-GA/ ws/branches/2.1.x/patch/2.1.10-GA/WS-268/ ws/branches/2.1.x/patch/2.1.10-GA/WS-268/WS-268.patch Log: WS-268: backported 'release' profile (patch proposed) Added: ws/branches/2.1.x/patch/2.1.10-GA/WS-268/WS-268.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 --- ws/branches/2.1.x/patch/2.1.10-GA/WS-268/WS-268.patch = (rev 0) +++ ws/branches/2.1.x/patch/2.1.10-GA/WS-268/WS-268.patch 2011-07-19 07:02:= 36 UTC (rev 4645) @@ -0,0 +1,48 @@ +Index: pom.xml +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- pom.xml (revision 4640) ++++ pom.xml (working copy) +@@ -181,5 +181,42 @@ + slf4j-log4j12 + test + +- = ++ = ++ = ++ ++ ++ release ++ ++ ++ ++ maven-assembly-plugin ++ ++ ++ org.apache.apache.resources ++ apache-source-release-assembly-descri= ptor ++ 1.0.2 ++ ++ ++ ++ ++ source-release-assembly ++ package ++ ++ single ++ ++ ++ true ++ ++ source-release ++ ++ gnu ++ ++ ++ ++ ++ ++ ++ ++ = ++ = + Property changes on: ws/branches/2.1.x/patch/2.1.10-GA/WS-268/WS-268.patch ___________________________________________________________________ Added: svn:eol-style + native --===============6584921007101243662==-- From do-not-reply at jboss.org Tue Jul 19 03:09:43 2011 Content-Type: multipart/mixed; boundary="===============6812464527213355944==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4646 - in kernel/trunk: exo.kernel.commons and 13 other directories. Date: Tue, 19 Jul 2011 03:09:43 -0400 Message-ID: <201107190709.p6J79hXS019222@svn01.web.mwc.hst.phx2.redhat.com> --===============6812464527213355944== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 03:09:43 -0400 (Tue, 19 Jul 2011) New Revision: 4646 Modified: kernel/trunk/exo.kernel.commons.test/pom.xml kernel/trunk/exo.kernel.commons/pom.xml kernel/trunk/exo.kernel.component.cache/pom.xml kernel/trunk/exo.kernel.component.command/pom.xml kernel/trunk/exo.kernel.component.common/pom.xml kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/pom.xml kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml kernel/trunk/exo.kernel.container/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-demo/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int/pom.xml kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extras/pom.x= ml kernel/trunk/exo.kernel.mc-integration/pom.xml kernel/trunk/packaging/module/pom.xml kernel/trunk/pom.xml Log: [maven-release-plugin] rollback the release of 2.3.0-CR4 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 2011-07-19 07:02:36 UTC (rev 46= 45) +++ kernel/trunk/exo.kernel.commons/pom.xml 2011-07-19 07:09:43 UTC (rev 46= 46) @@ -16,7 +16,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.commons 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 2011-07-19 07:02:36 UTC (r= ev 4645) +++ kernel/trunk/exo.kernel.commons.test/pom.xml 2011-07-19 07:09:43 UTC (r= ev 4646) @@ -16,7 +16,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.commons.test 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 2011-07-19 07:02:36 UTC= (rev 4645) +++ kernel/trunk/exo.kernel.component.cache/pom.xml 2011-07-19 07:09:43 UTC= (rev 4646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.component.cache Modified: kernel/trunk/exo.kernel.component.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.command/pom.xml 2011-07-19 07:02:36 U= TC (rev 4645) +++ kernel/trunk/exo.kernel.component.command/pom.xml 2011-07-19 07:09:43 U= TC (rev 4646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.component.command Modified: kernel/trunk/exo.kernel.component.common/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/exo.kernel.component.common/pom.xml 2011-07-19 07:02:36 UT= C (rev 4645) +++ kernel/trunk/exo.kernel.component.common/pom.xml 2011-07-19 07:09:43 UT= C (rev 4646) @@ -25,7 +25,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.component.common Modified: kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/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.component.ext.cache.impl.infinispan.v4/pom.xml = 2011-07-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.infinispan.v4/pom.xml = 2011-07-19 07:09:43 UTC (rev 4646) @@ -19,7 +19,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT exo.kernel.component.ext.cache.impl.infinispan.v4 eXo Kernel :: Cache Extension :: Infinispan Implementation 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 2011-= 07-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml 2011-= 07-19 07:09:43 UTC (rev 4646) @@ -23,7 +23,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT exo.kernel.component.ext.cache.impl.jboss.v3 eXo Kernel :: Cache Extension :: JBoss Cache Implementation 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 2011-07-19 07:02:36 UTC (rev = 4645) +++ kernel/trunk/exo.kernel.container/pom.xml 2011-07-19 07:09:43 UTC (rev = 4646) @@ -12,7 +12,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT exo.kernel.container eXo Kernel :: Container Modified: kernel/trunk/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/trunk/exo.kernel.mc-integration/exo.kernel.mc-int/pom.xml 2011-0= 7-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int/pom.xml 2011-0= 7-19 07:09:43 UTC (rev 4646) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.mc-int Modified: kernel/trunk/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/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-demo/pom.xml 2= 011-07-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-demo/pom.xml 2= 011-07-19 07:09:43 UTC (rev 4646) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.mc-int-demo 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 = 2011-07-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-int-tests/pom.xml = 2011-07-19 07:09:43 UTC (rev 4646) @@ -5,7 +5,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.mc-int-tests Modified: kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extra= 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 --- kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extras/pom.= xml 2011-07-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/exo.kernel.mc-integration/exo.kernel.mc-kernel-extras/pom.= xml 2011-07-19 07:09:43 UTC (rev 4646) @@ -6,7 +6,7 @@ org.exoplatform.kernel mc-integration-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = exo.kernel.mc-kernel-extras Modified: kernel/trunk/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/trunk/exo.kernel.mc-integration/pom.xml 2011-07-19 07:02:36 UTC = (rev 4645) +++ kernel/trunk/exo.kernel.mc-integration/pom.xml 2011-07-19 07:09:43 UTC = (rev 4646) @@ -6,7 +6,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = mc-integration-parent Modified: kernel/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/pom.xml 2011-07-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/packaging/module/pom.xml 2011-07-19 07:09:43 UTC (rev 4646) @@ -2,7 +2,7 @@ org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = 4.0.0 Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2011-07-19 07:02:36 UTC (rev 4645) +++ kernel/trunk/pom.xml 2011-07-19 07:09:43 UTC (rev 4646) @@ -30,7 +30,7 @@ = org.exoplatform.kernel kernel-parent - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT pom = eXo Kernel @@ -43,9 +43,9 @@ = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/ta= gs/2.3.0-CR4 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/tags/2.3.0-CR4 - http://fisheye.jboss.org/browse/exo-jcr/kernel/tags/2.3.0-CR4 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/kernel/tr= unk + scm:svn:https://svn.jboss.org/repos/exo-jcr/ker= nel/trunk + http://fisheye.jboss.org/browse/exo-jcr/kernel/trunk = --===============6812464527213355944==-- From do-not-reply at jboss.org Tue Jul 19 03:10:24 2011 Content-Type: multipart/mixed; boundary="===============2875669360702713963==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4647 - in jcr/branches/1.12.x/patch/1.12.10-GA: JCR-1647 and 1 other directory. Date: Tue, 19 Jul 2011 03:10:24 -0400 Message-ID: <201107190710.p6J7AOwQ019614@svn01.web.mwc.hst.phx2.redhat.com> --===============2875669360702713963== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dkuleshov Date: 2011-07-19 03:10:24 -0400 (Tue, 19 Jul 2011) New Revision: 4647 Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1647/ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1647/JCR-1647.patch Log: JCR-1647: backported 'release' profile (patch proposed) Added: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1647/JCR-1647.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/1.12.10-GA/JCR-1647/JCR-1647.patch = (rev 0) +++ jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1647/JCR-1647.patch 2011-07-19= 07:10:24 UTC (rev 4647) @@ -0,0 +1,44 @@ +Index: pom.xml +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +--- pom.xml (revision 4640) ++++ pom.xml (working copy) +@@ -464,4 +464,39 @@ + exo.jcr.docs + packaging/module + ++ ++ ++ release ++ ++ = ++ ++ maven-assembly-plugin ++ ++ ++ org.apache.apache.resources ++ apache-source-release-assembly-descriptor ++ 1.0.2 ++ ++ ++ ++ ++ source-release-assembly ++ package ++ ++ single ++ ++ ++ true ++ ++ source-release ++ ++ gnu ++ ++ ++ ++ ++ ++ ++ ++ + Property changes on: jcr/branches/1.12.x/patch/1.12.10-GA/JCR-1647/JCR-1647= .patch ___________________________________________________________________ Added: svn:eol-style + native --===============2875669360702713963==-- From do-not-reply at jboss.org Tue Jul 19 03:46:52 2011 Content-Type: multipart/mixed; boundary="===============0437556871779921832==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4648 - core/trunk. Date: Tue, 19 Jul 2011 03:46:51 -0400 Message-ID: <201107190746.p6J7kpwD023070@svn01.web.mwc.hst.phx2.redhat.com> --===============0437556871779921832== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 03:46:51 -0400 (Tue, 19 Jul 2011) New Revision: 4648 Modified: core/trunk/pom.xml Log: EXOJCR-1435: change dep to tag Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2011-07-19 07:10:24 UTC (rev 4647) +++ core/trunk/pom.xml 2011-07-19 07:46:51 UTC (rev 4648) @@ -39,7 +39,7 @@ 2.4 = 1.2.1-GA - 2.3.0-GA-SNAPSHOT + 2.3.0-CR4 = --===============0437556871779921832==-- From do-not-reply at jboss.org Tue Jul 19 03:54:38 2011 Content-Type: multipart/mixed; boundary="===============0930207203734289444==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4649 - in core/trunk: exo.core.component.database and 10 other directories. Date: Tue, 19 Jul 2011 03:54:38 -0400 Message-ID: <201107190754.p6J7scnF023543@svn01.web.mwc.hst.phx2.redhat.com> --===============0930207203734289444== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 03:54:38 -0400 (Tue, 19 Jul 2011) New Revision: 4649 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.4.0-CR4 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 2011-07-19 07:46:51 UTC = (rev 4648) +++ core/trunk/exo.core.component.database/pom.xml 2011-07-19 07:54:38 UTC = (rev 4649) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = exo.core.component.database Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2011-07-19 07:46:51 UTC = (rev 4648) +++ core/trunk/exo.core.component.document/pom.xml 2011-07-19 07:54:38 UTC = (rev 4649) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 exo.core.component.document eXo Core :: Component :: Demo Service Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2011-07-19 07:46:51 UTC (rev= 4648) +++ core/trunk/exo.core.component.ldap/pom.xml 2011-07-19 07:54:38 UTC (rev= 4649) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = exo.core.component.ldap Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2011-07-19 07:46= :51 UTC (rev 4648) +++ core/trunk/exo.core.component.organization.api/pom.xml 2011-07-19 07:54= :38 UTC (rev 4649) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 exo.core.component.organization.api eXo Core :: Component :: Organization Service API Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2011-07-19 07:4= 6:51 UTC (rev 4648) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2011-07-19 07:5= 4:38 UTC (rev 4649) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = exo.core.component.organization.jdbc Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2011-07-19 07:4= 6:51 UTC (rev 4648) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2011-07-19 07:5= 4:38 UTC (rev 4649) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = exo.core.component.organization.ldap Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2011-07-19 07:46:51= UTC (rev 4648) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2011-07-19 07:54:38= UTC (rev 4649) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = exo.core.component.script.groovy Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2011-07-19 07:46:51= UTC (rev 4648) +++ core/trunk/exo.core.component.security.core/pom.xml 2011-07-19 07:54:38= UTC (rev 4649) @@ -16,7 +16,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = exo.core.component.security.core Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2011-07-19 07:46:51 UTC (= rev 4648) +++ core/trunk/exo.core.component.web.css/pom.xml 2011-07-19 07:54:38 UTC (= rev 4649) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = exo.core.component.web.css Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2011-07-19 07:46:5= 1 UTC (rev 4648) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2011-07-19 07:54:3= 8 UTC (rev 4649) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 exo.core.component.xml-processing eXo Core :: Component :: XML Processing Service Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2011-07-19 07:46:51 UTC (rev 4648) +++ core/trunk/packaging/module/pom.xml 2011-07-19 07:54:38 UTC (rev 4649) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 = 4.0.0 @@ -18,13 +18,13 @@ = - org.exoplatform.coreexo= .core.component.database2.4.0-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.document2.4.0-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.api2.4.0-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.organization.ldap2.4.0-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.security.core2.4.0-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.xml-processing2.4.0-GA-SNAPSHOT - org.exoplatform.coreexo= .core.component.script.groovy2.4.0-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.database2.4.0-CR4 + org.exoplatform.coreexo= .core.component.document2.4.0-CR4 + org.exoplatform.coreexo= .core.component.organization.api2.4.0-CR4 + org.exoplatform.coreexo= .core.component.organization.ldap2.4.0-CR4<= /dependency> + org.exoplatform.coreexo= .core.component.security.core2.4.0-CR4 + org.exoplatform.coreexo= .core.component.xml-processing2.4.0-CR4 + org.exoplatform.coreexo= .core.component.script.groovy2.4.0-CR4 = Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2011-07-19 07:46:51 UTC (rev 4648) +++ core/trunk/pom.xml 2011-07-19 07:54:38 UTC (rev 4649) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.4.0-GA-SNAPSHOT + 2.4.0-CR4 pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:https://anonsvn.jboss.org/repos/exo-jcr/core/tru= nk/ - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk/ - http://fisheye.jboss.org/browse/exo-jcr/core/trunk + scm:svn:https://anonsvn.jboss.org/repos/exo-jcr/core/tag= s/2.4.0-CR4 + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.4.0-CR4 + http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.4.0-CR4 = --===============0930207203734289444==-- From do-not-reply at jboss.org Tue Jul 19 03:55:26 2011 Content-Type: multipart/mixed; boundary="===============4282893309237833189==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4650 - core/tags. Date: Tue, 19 Jul 2011 03:55:26 -0400 Message-ID: <201107190755.p6J7tQub023902@svn01.web.mwc.hst.phx2.redhat.com> --===============4282893309237833189== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 03:55:26 -0400 (Tue, 19 Jul 2011) New Revision: 4650 Added: core/tags/2.4.0-CR4/ Log: [maven-scm] copy for tag 2.4.0-CR4 --===============4282893309237833189==-- From do-not-reply at jboss.org Tue Jul 19 03:56:09 2011 Content-Type: multipart/mixed; boundary="===============0276568912872666004==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4651 - in core/trunk: exo.core.component.database and 10 other directories. Date: Tue, 19 Jul 2011 03:56:09 -0400 Message-ID: <201107190756.p6J7u98V023913@svn01.web.mwc.hst.phx2.redhat.com> --===============0276568912872666004== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 03:56:09 -0400 (Tue, 19 Jul 2011) New Revision: 4651 Modified: core/trunk/exo.core.component.database/pom.xml core/trunk/exo.core.component.document/pom.xml core/trunk/exo.core.component.ldap/pom.xml core/trunk/exo.core.component.organization.api/pom.xml core/trunk/exo.core.component.organization.jdbc/pom.xml core/trunk/exo.core.component.organization.ldap/pom.xml core/trunk/exo.core.component.script.groovy/pom.xml core/trunk/exo.core.component.security.core/pom.xml core/trunk/exo.core.component.web.css/pom.xml core/trunk/exo.core.component.xml-processing/pom.xml core/trunk/packaging/module/pom.xml core/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: core/trunk/exo.core.component.database/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.database/pom.xml 2011-07-19 07:55:26 UTC = (rev 4650) +++ core/trunk/exo.core.component.database/pom.xml 2011-07-19 07:56:09 UTC = (rev 4651) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = exo.core.component.database Modified: core/trunk/exo.core.component.document/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.document/pom.xml 2011-07-19 07:55:26 UTC = (rev 4650) +++ core/trunk/exo.core.component.document/pom.xml 2011-07-19 07:56:09 UTC = (rev 4651) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT exo.core.component.document eXo Core :: Component :: Demo Service Modified: core/trunk/exo.core.component.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.ldap/pom.xml 2011-07-19 07:55:26 UTC (rev= 4650) +++ core/trunk/exo.core.component.ldap/pom.xml 2011-07-19 07:56:09 UTC (rev= 4651) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = exo.core.component.ldap Modified: core/trunk/exo.core.component.organization.api/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.api/pom.xml 2011-07-19 07:55= :26 UTC (rev 4650) +++ core/trunk/exo.core.component.organization.api/pom.xml 2011-07-19 07:56= :09 UTC (rev 4651) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT exo.core.component.organization.api eXo Core :: Component :: Organization Service API Modified: core/trunk/exo.core.component.organization.jdbc/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.jdbc/pom.xml 2011-07-19 07:5= 5:26 UTC (rev 4650) +++ core/trunk/exo.core.component.organization.jdbc/pom.xml 2011-07-19 07:5= 6:09 UTC (rev 4651) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = exo.core.component.organization.jdbc Modified: core/trunk/exo.core.component.organization.ldap/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.organization.ldap/pom.xml 2011-07-19 07:5= 5:26 UTC (rev 4650) +++ core/trunk/exo.core.component.organization.ldap/pom.xml 2011-07-19 07:5= 6:09 UTC (rev 4651) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = exo.core.component.organization.ldap Modified: core/trunk/exo.core.component.script.groovy/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.script.groovy/pom.xml 2011-07-19 07:55:26= UTC (rev 4650) +++ core/trunk/exo.core.component.script.groovy/pom.xml 2011-07-19 07:56:09= UTC (rev 4651) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = exo.core.component.script.groovy Modified: core/trunk/exo.core.component.security.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.security.core/pom.xml 2011-07-19 07:55:26= UTC (rev 4650) +++ core/trunk/exo.core.component.security.core/pom.xml 2011-07-19 07:56:09= UTC (rev 4651) @@ -16,7 +16,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = exo.core.component.security.core Modified: core/trunk/exo.core.component.web.css/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.web.css/pom.xml 2011-07-19 07:55:26 UTC (= rev 4650) +++ core/trunk/exo.core.component.web.css/pom.xml 2011-07-19 07:56:09 UTC (= rev 4651) @@ -25,7 +25,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = exo.core.component.web.css Modified: core/trunk/exo.core.component.xml-processing/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/exo.core.component.xml-processing/pom.xml 2011-07-19 07:55:2= 6 UTC (rev 4650) +++ core/trunk/exo.core.component.xml-processing/pom.xml 2011-07-19 07:56:0= 9 UTC (rev 4651) @@ -23,7 +23,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT exo.core.component.xml-processing eXo Core :: Component :: XML Processing Service Modified: core/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/pom.xml 2011-07-19 07:55:26 UTC (rev 4650) +++ core/trunk/packaging/module/pom.xml 2011-07-19 07:56:09 UTC (rev 4651) @@ -2,7 +2,7 @@ org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT = 4.0.0 @@ -18,13 +18,13 @@ = - org.exoplatform.coreexo= .core.component.database2.4.0-CR4 - org.exoplatform.coreexo= .core.component.document2.4.0-CR4 - org.exoplatform.coreexo= .core.component.organization.api2.4.0-CR4 - org.exoplatform.coreexo= .core.component.organization.ldap2.4.0-CR4<= /dependency> - org.exoplatform.coreexo= .core.component.security.core2.4.0-CR4 - org.exoplatform.coreexo= .core.component.xml-processing2.4.0-CR4 - org.exoplatform.coreexo= .core.component.script.groovy2.4.0-CR4 + org.exoplatform.coreexo= .core.component.database2.4.0-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.document2.4.0-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.api2.4.0-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.organization.ldap2.4.0-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.security.core2.4.0-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.xml-processing2.4.0-GA-SNAPSHOT + org.exoplatform.coreexo= .core.component.script.groovy2.4.0-GA-SNAPSHOT = Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2011-07-19 07:55:26 UTC (rev 4650) +++ core/trunk/pom.xml 2011-07-19 07:56:09 UTC (rev 4651) @@ -29,7 +29,7 @@ = org.exoplatform.core core-parent - 2.4.0-CR4 + 2.4.0-GA-SNAPSHOT pom = eXo Core @@ -43,9 +43,9 @@ = - scm:svn:https://anonsvn.jboss.org/repos/exo-jcr/core/tag= s/2.4.0-CR4 - scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/tags/2.4.0-CR4 - http://fisheye.jboss.org/browse/exo-jcr/core/tags/2.4.0-CR4 + scm:svn:https://anonsvn.jboss.org/repos/exo-jcr/core/tru= nk/ + scm:svn:https://svn.jboss.org/repos/exo-jcr/cor= e/trunk/ + http://fisheye.jboss.org/browse/exo-jcr/core/trunk = --===============0276568912872666004==-- From do-not-reply at jboss.org Tue Jul 19 04:02:54 2011 Content-Type: multipart/mixed; boundary="===============5886410883584851834==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4652 - core/trunk. Date: Tue, 19 Jul 2011 04:02:53 -0400 Message-ID: <201107190802.p6J82rb6030441@svn01.web.mwc.hst.phx2.redhat.com> --===============5886410883584851834== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:02:53 -0400 (Tue, 19 Jul 2011) New Revision: 4652 Modified: core/trunk/pom.xml Log: EXOJCR-1435: change dep to trunk Modified: core/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/pom.xml 2011-07-19 07:56:09 UTC (rev 4651) +++ core/trunk/pom.xml 2011-07-19 08:02:53 UTC (rev 4652) @@ -39,7 +39,7 @@ 2.4 = 1.2.1-GA - 2.3.0-CR4 + 2.3.0-GA-SNAPSHOT = --===============5886410883584851834==-- From do-not-reply at jboss.org Tue Jul 19 04:14:07 2011 Content-Type: multipart/mixed; boundary="===============3690095929665638250==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4653 - ws/trunk. Date: Tue, 19 Jul 2011 04:14:07 -0400 Message-ID: <201107190814.p6J8E74P032032@svn01.web.mwc.hst.phx2.redhat.com> --===============3690095929665638250== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:14:07 -0400 (Tue, 19 Jul 2011) New Revision: 4653 Modified: ws/trunk/pom.xml Log: EXOJCR-1435: change dep to tag Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2011-07-19 08:02:53 UTC (rev 4652) +++ ws/trunk/pom.xml 2011-07-19 08:14:07 UTC (rev 4653) @@ -45,8 +45,8 @@ exo-ws 2.1 = - 2.3.0-GA-SNAPSHOT - 2.4.0-GA-SNAPSHOT + 2.3.0-CR4 + 2.4.0-CR4 = --===============3690095929665638250==-- From do-not-reply at jboss.org Tue Jul 19 04:15:48 2011 Content-Type: multipart/mixed; boundary="===============5374549914106989803==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4654 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Tue, 19 Jul 2011 04:15:48 -0400 Message-ID: <201107190815.p6J8FmHA032403@svn01.web.mwc.hst.phx2.redhat.com> --===============5374549914106989803== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:15:48 -0400 (Tue, 19 Jul 2011) New Revision: 4654 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare release 2.2.0-CR4 Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2011-07-19 08:14:07 UTC (rev 4653) +++ ws/trunk/exo.ws.commons/pom.xml 2011-07-19 08:15:48 UTC (rev 4654) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 = exo.ws.commons Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2011-07-19 08:14:07 UTC (rev 46= 53) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2011-07-19 08:15:48 UTC (rev 46= 54) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 = exo.ws.frameworks.json Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2011-07-19 08:14:07 UTC (rev= 4653) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2011-07-19 08:15:48 UTC (rev= 4654) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 = exo.ws.frameworks.servlet Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2011-07-19 08:14:07 UTC (rev 4653) +++ ws/trunk/exo.ws.rest.core/pom.xml 2011-07-19 08:15:48 UTC (rev 4654) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 = exo.ws.rest.core Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2011-07-19 08:14:07 UTC (rev 4653) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2011-07-19 08:15:48 UTC (rev 4654) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 = exo.ws.rest.ext Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2011-07-19 08:14:07 UTC (rev 4653) +++ ws/trunk/exo.ws.testframework/pom.xml 2011-07-19 08:15:48 UTC (rev 4654) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 = exo.ws.testframework Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2011-07-19 08:14:07 UTC (rev 4653) +++ ws/trunk/packaging/module/pom.xml 2011-07-19 08:15:48 UTC (rev 4654) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 = 4.0.0 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2011-07-19 08:14:07 UTC (rev 4653) +++ ws/trunk/pom.xml 2011-07-19 08:15:48 UTC (rev 4654) @@ -31,14 +31,14 @@ = org.exoplatform.ws ws-parent - 2.2.0-GA-SNAPSHOT + 2.2.0-CR4 pom eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk - http://fisheye.jboss.org/browse/exo-jcr/ws/trunk + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .2.0-CR4 + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.2.0-CR4 + http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.2.0-CR4 = --===============5374549914106989803==-- From do-not-reply at jboss.org Tue Jul 19 04:16:15 2011 Content-Type: multipart/mixed; boundary="===============6958435299708528218==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4655 - ws/tags. Date: Tue, 19 Jul 2011 04:16:15 -0400 Message-ID: <201107190816.p6J8GFq9032415@svn01.web.mwc.hst.phx2.redhat.com> --===============6958435299708528218== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:16:15 -0400 (Tue, 19 Jul 2011) New Revision: 4655 Added: ws/tags/2.2.0-CR4/ Log: [maven-scm] copy for tag 2.2.0-CR4 --===============6958435299708528218==-- From do-not-reply at jboss.org Tue Jul 19 04:16:34 2011 Content-Type: multipart/mixed; boundary="===============6471430113052199450==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4656 - in ws/trunk: exo.ws.commons and 6 other directories. Date: Tue, 19 Jul 2011 04:16:34 -0400 Message-ID: <201107190816.p6J8GYVT032426@svn01.web.mwc.hst.phx2.redhat.com> --===============6471430113052199450== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:16:33 -0400 (Tue, 19 Jul 2011) New Revision: 4656 Modified: ws/trunk/exo.ws.commons/pom.xml ws/trunk/exo.ws.frameworks.json/pom.xml ws/trunk/exo.ws.frameworks.servlet/pom.xml ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/exo.ws.rest.ext/pom.xml ws/trunk/exo.ws.testframework/pom.xml ws/trunk/packaging/module/pom.xml ws/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: ws/trunk/exo.ws.commons/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.commons/pom.xml 2011-07-19 08:16:15 UTC (rev 4655) +++ ws/trunk/exo.ws.commons/pom.xml 2011-07-19 08:16:33 UTC (rev 4656) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT = exo.ws.commons Modified: ws/trunk/exo.ws.frameworks.json/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.json/pom.xml 2011-07-19 08:16:15 UTC (rev 46= 55) +++ ws/trunk/exo.ws.frameworks.json/pom.xml 2011-07-19 08:16:33 UTC (rev 46= 56) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT = exo.ws.frameworks.json Modified: ws/trunk/exo.ws.frameworks.servlet/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.frameworks.servlet/pom.xml 2011-07-19 08:16:15 UTC (rev= 4655) +++ ws/trunk/exo.ws.frameworks.servlet/pom.xml 2011-07-19 08:16:33 UTC (rev= 4656) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT = exo.ws.frameworks.servlet Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2011-07-19 08:16:15 UTC (rev 4655) +++ ws/trunk/exo.ws.rest.core/pom.xml 2011-07-19 08:16:33 UTC (rev 4656) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT = exo.ws.rest.core Modified: ws/trunk/exo.ws.rest.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.ext/pom.xml 2011-07-19 08:16:15 UTC (rev 4655) +++ ws/trunk/exo.ws.rest.ext/pom.xml 2011-07-19 08:16:33 UTC (rev 4656) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT = exo.ws.rest.ext Modified: ws/trunk/exo.ws.testframework/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.testframework/pom.xml 2011-07-19 08:16:15 UTC (rev 4655) +++ ws/trunk/exo.ws.testframework/pom.xml 2011-07-19 08:16:33 UTC (rev 4656) @@ -25,7 +25,7 @@ org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT = exo.ws.testframework Modified: ws/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/pom.xml 2011-07-19 08:16:15 UTC (rev 4655) +++ ws/trunk/packaging/module/pom.xml 2011-07-19 08:16:33 UTC (rev 4656) @@ -2,7 +2,7 @@ org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT = 4.0.0 Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2011-07-19 08:16:15 UTC (rev 4655) +++ ws/trunk/pom.xml 2011-07-19 08:16:33 UTC (rev 4656) @@ -31,14 +31,14 @@ = org.exoplatform.ws ws-parent - 2.2.0-CR4 + 2.2.0-GA-SNAPSHOT pom eXo WS = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/tags/2= .2.0-CR4 - scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= tags/2.2.0-CR4 - http://fisheye.jboss.org/browse/exo-jcr/ws/tags/2.2.0-CR4 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<= /connection> + scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/= trunk + http://fisheye.jboss.org/browse/exo-jcr/ws/trunk = --===============6471430113052199450==-- From do-not-reply at jboss.org Tue Jul 19 04:19:16 2011 Content-Type: multipart/mixed; boundary="===============8049896421747595606==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4657 - ws/trunk. Date: Tue, 19 Jul 2011 04:19:16 -0400 Message-ID: <201107190819.p6J8JGbJ032461@svn01.web.mwc.hst.phx2.redhat.com> --===============8049896421747595606== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:19:16 -0400 (Tue, 19 Jul 2011) New Revision: 4657 Modified: ws/trunk/pom.xml Log: EXOJCR-1435: change dep to trunk Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2011-07-19 08:16:33 UTC (rev 4656) +++ ws/trunk/pom.xml 2011-07-19 08:19:16 UTC (rev 4657) @@ -45,8 +45,8 @@ exo-ws 2.1 = - 2.3.0-CR4 - 2.4.0-CR4 + 2.3.0-GA-SNAPSHOT + 2.4.0-GA-SNAPSHOT = --===============8049896421747595606==-- From do-not-reply at jboss.org Tue Jul 19 04:30:09 2011 Content-Type: multipart/mixed; boundary="===============1257391898812908473==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4658 - jcr/trunk. Date: Tue, 19 Jul 2011 04:30:09 -0400 Message-ID: <201107190830.p6J8U96c001099@svn01.web.mwc.hst.phx2.redhat.com> --===============1257391898812908473== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:30:09 -0400 (Tue, 19 Jul 2011) New Revision: 4658 Modified: jcr/trunk/pom.xml Log: EXOJCR-1435: change dep to tag 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 2011-07-19 08:19:16 UTC (rev 4657) +++ jcr/trunk/pom.xml 2011-07-19 08:30:09 UTC (rev 4658) @@ -42,9 +42,9 @@ exo-jcr 1.14 - 2.3.0-GA-SNAPSHOT - 2.4.0-GA-SNAPSHOT - 2.2.0-GA-SNAPSHOT + 2.3.0-CR4 + 2.4.0-CR4 + 2.2.0-CR4 1 = --===============1257391898812908473==-- From do-not-reply at jboss.org Tue Jul 19 04:46:05 2011 Content-Type: multipart/mixed; boundary="===============3906953653217870916==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4659 - in jcr/trunk: applications and 25 other directories. Date: Tue, 19 Jul 2011 04:46:05 -0400 Message-ID: <201107190846.p6J8k5jc003149@svn01.web.mwc.hst.phx2.redhat.com> --===============3906953653217870916== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:46:04 -0400 (Tue, 19 Jul 2011) New Revision: 4659 Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/pom.xml jcr/trunk/applications/exo.jcr.applications.backupconsole/pom.xml jcr/trunk/applications/exo.jcr.applications.browser/pom.xml jcr/trunk/applications/exo.jcr.applications.config/pom.xml jcr/trunk/applications/exo.jcr.applications.fckeditor/pom.xml jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml jcr/trunk/applications/exo.jcr.applications.rest/pom.xml jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml jcr/trunk/applications/exo.jcr.cluster.testclient/pom.xml jcr/trunk/applications/exo.jcr.ear/pom.xml jcr/trunk/applications/pom.xml jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ftp/pom.xml jcr/trunk/exo.jcr.component.statistics/pom.xml jcr/trunk/exo.jcr.component.webdav/pom.xml jcr/trunk/exo.jcr.connectors.jca/pom.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/pom.xml jcr/trunk/exo.jcr.docs/pom.xml jcr/trunk/exo.jcr.framework.command/pom.xml jcr/trunk/exo.jcr.framework.ftpclient/pom.xml jcr/trunk/exo.jcr.framework.web/pom.xml jcr/trunk/packaging/module/pom.xml jcr/trunk/pom.xml Log: [maven-release-plugin] prepare release 1.14.0-CR4 Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pom.xml 2011-= 07-19 08:30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/pom.xml 2011-= 07-19 08:46:04 UTC (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.backupconsole eXo JCR :: Applications :: Backup Console Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/po= m.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/pom.xml = 2011-07-19 08:30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/pom.xml = 2011-07-19 08:46:04 UTC (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.backupconsole.dist eXo JCR :: Applications :: Backup Console Binary Distribution @@ -37,7 +37,7 @@ org.exoplatform.jcr exo.jcr.applications.backupconsole - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 org.exoplatform.jcr Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.browser/pom.xml 2011-07-19 = 08:30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.browser/pom.xml 2011-07-19 = 08:46:04 UTC (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.browser war Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2011-07-19 0= 8:30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2011-07-19 0= 8:46:04 UTC (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.config pom Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.fckeditor/pom.xml 2011-07-1= 9 08:30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.fckeditor/pom.xml 2011-07-1= 9 08:46:04 UTC (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.fckeditor war Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.jboss/pom.xml 2011-07-19 08= :30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml 2011-07-19 08= :46:04 UTC (rev 4659) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 ear runtime Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.jetty/pom.xml 2011-07-19 08= :30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml 2011-07-19 08= :46:04 UTC (rev 4659) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.config = Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.jonas/pom.xml 2011-07-19 08= :30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml 2011-07-19 08= :46:04 UTC (rev 4659) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 ear runtime Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.rest/pom.xml 2011-07-19 08:= 30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.rest/pom.xml 2011-07-19 08:= 46:04 UTC (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.rest war Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-07-19 0= 8:30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-07-19 0= 8:46:04 UTC (rev 4659) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.applications.config = Modified: jcr/trunk/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/trunk/applications/exo.jcr.cluster.testclient/pom.xml 2011-07-19 08= :30:09 UTC (rev 4658) +++ jcr/trunk/applications/exo.jcr.cluster.testclient/pom.xml 2011-07-19 08= :46:04 UTC (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.cluster.testclient eXo JCR :: Cluster :: Test Client Modified: jcr/trunk/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/trunk/applications/exo.jcr.ear/pom.xml 2011-07-19 08:30:09 UTC (rev= 4658) +++ jcr/trunk/applications/exo.jcr.ear/pom.xml 2011-07-19 08:46:04 UTC (rev= 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.ear ear Modified: jcr/trunk/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/trunk/applications/pom.xml 2011-07-19 08:30:09 UTC (rev 4658) +++ jcr/trunk/applications/pom.xml 2011-07-19 08:46:04 UTC (rev 4659) @@ -22,12 +22,12 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 = 4.0.0 jcr-applications-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 = eXo JCR :: Applications :: Reactor pom 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 2011-07-19 08:30:09 UTC (rev 4= 658) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-07-19 08:46:04 UTC (rev 4= 659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.component.core eXo JCR :: Component :: Core Service Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-19 08:30:09 UTC (rev 46= 58) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-19 08:46:04 UTC (rev 46= 59) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.component.ext eXo JCR :: Component :: Extension Service Modified: jcr/trunk/exo.jcr.component.ftp/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ftp/pom.xml 2011-07-19 08:30:09 UTC (rev 46= 58) +++ jcr/trunk/exo.jcr.component.ftp/pom.xml 2011-07-19 08:46:04 UTC (rev 46= 59) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.component.ftp eXo JCR :: Component :: FTP Service Modified: jcr/trunk/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/trunk/exo.jcr.component.statistics/pom.xml 2011-07-19 08:30:09 UTC = (rev 4658) +++ jcr/trunk/exo.jcr.component.statistics/pom.xml 2011-07-19 08:46:04 UTC = (rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.component.statistics eXo JCR :: Component :: Statistics Provider Modified: jcr/trunk/exo.jcr.component.webdav/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/pom.xml 2011-07-19 08:30:09 UTC (rev= 4658) +++ jcr/trunk/exo.jcr.component.webdav/pom.xml 2011-07-19 08:46:04 UTC (rev= 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.component.webdav eXo JCR :: Component :: Webdav Service Modified: jcr/trunk/exo.jcr.connectors.jca/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.jca/pom.xml 2011-07-19 08:30:09 UTC (rev 4= 658) +++ jcr/trunk/exo.jcr.connectors.jca/pom.xml 2011-07-19 08:46:04 UTC (rev 4= 659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.connectors.jca rar Modified: jcr/trunk/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/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 2011-07-19 08:= 30:09 UTC (rev 4658) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 2011-07-19 08:= 46:04 UTC (rev 4659) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs.developer - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 = 4.0.0 Modified: jcr/trunk/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/trunk/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2011-07-19 08:30:= 09 UTC (rev 4658) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2011-07-19 08:46:= 04 UTC (rev 4659) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 = 4.0.0 Modified: jcr/trunk/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/trunk/exo.jcr.docs/pom.xml 2011-07-19 08:30:09 UTC (rev 4658) +++ jcr/trunk/exo.jcr.docs/pom.xml 2011-07-19 08:46:04 UTC (rev 4659) @@ -22,7 +22,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 = 4.0.0 Modified: jcr/trunk/exo.jcr.framework.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.command/pom.xml 2011-07-19 08:30:09 UTC (re= v 4658) +++ jcr/trunk/exo.jcr.framework.command/pom.xml 2011-07-19 08:46:04 UTC (re= v 4659) @@ -12,7 +12,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.framework.command eXo JCR :: Framework :: Command Modified: jcr/trunk/exo.jcr.framework.ftpclient/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2011-07-19 08:30:09 UTC (= rev 4658) +++ jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2011-07-19 08:46:04 UTC (= rev 4659) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.framework.ftpclient eXo JCR :: Framework :: FTP Client Modified: jcr/trunk/exo.jcr.framework.web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.web/pom.xml 2011-07-19 08:30:09 UTC (rev 46= 58) +++ jcr/trunk/exo.jcr.framework.web/pom.xml 2011-07-19 08:46:04 UTC (rev 46= 59) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 exo.jcr.framework.web eXo JCR :: Framework :: Web Modified: jcr/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/packaging/module/pom.xml 2011-07-19 08:30:09 UTC (rev 4658) +++ jcr/trunk/packaging/module/pom.xml 2011-07-19 08:46:04 UTC (rev 4659) @@ -4,7 +4,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 jcr.packaging.module pom 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 2011-07-19 08:30:09 UTC (rev 4658) +++ jcr/trunk/pom.xml 2011-07-19 08:46:04 UTC (rev 4659) @@ -29,14 +29,14 @@ = org.exoplatform.jcr jcr-parent - 1.14.0-GA-SNAPSHOT + 1.14.0-CR4 pom eXo JCR = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/trunk - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= runk - http://fisheye.jboss.org/browse/exo-jcr/jcr/trunk + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/1.= 14.0-CR4 + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= ags/1.14.0-CR4 + http://fisheye.jboss.org/browse/exo-jcr/jcr/tags/1.14.0-CR4 = --===============3906953653217870916==-- From do-not-reply at jboss.org Tue Jul 19 04:46:29 2011 Content-Type: multipart/mixed; boundary="===============2372960976589267190==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4660 - jcr/tags. Date: Tue, 19 Jul 2011 04:46:29 -0400 Message-ID: <201107190846.p6J8kTLX003164@svn01.web.mwc.hst.phx2.redhat.com> --===============2372960976589267190== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:46:28 -0400 (Tue, 19 Jul 2011) New Revision: 4660 Added: jcr/tags/1.14.0-CR4/ Log: [maven-scm] copy for tag 1.14.0-CR4 --===============2372960976589267190==-- From do-not-reply at jboss.org Tue Jul 19 04:47:03 2011 Content-Type: multipart/mixed; boundary="===============7922452659261738342==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4661 - in jcr/trunk: applications and 25 other directories. Date: Tue, 19 Jul 2011 04:47:03 -0400 Message-ID: <201107190847.p6J8l3Rp003186@svn01.web.mwc.hst.phx2.redhat.com> --===============7922452659261738342== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:47:02 -0400 (Tue, 19 Jul 2011) New Revision: 4661 Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/pom.xml jcr/trunk/applications/exo.jcr.applications.backupconsole/pom.xml jcr/trunk/applications/exo.jcr.applications.browser/pom.xml jcr/trunk/applications/exo.jcr.applications.config/pom.xml jcr/trunk/applications/exo.jcr.applications.fckeditor/pom.xml jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml jcr/trunk/applications/exo.jcr.applications.rest/pom.xml jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml jcr/trunk/applications/exo.jcr.cluster.testclient/pom.xml jcr/trunk/applications/exo.jcr.ear/pom.xml jcr/trunk/applications/pom.xml jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.ext/pom.xml jcr/trunk/exo.jcr.component.ftp/pom.xml jcr/trunk/exo.jcr.component.statistics/pom.xml jcr/trunk/exo.jcr.component.webdav/pom.xml jcr/trunk/exo.jcr.connectors.jca/pom.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/pom.xml jcr/trunk/exo.jcr.docs/pom.xml jcr/trunk/exo.jcr.framework.command/pom.xml jcr/trunk/exo.jcr.framework.ftpclient/pom.xml jcr/trunk/exo.jcr.framework.web/pom.xml jcr/trunk/packaging/module/pom.xml jcr/trunk/pom.xml Log: [maven-release-plugin] prepare for next development iteration Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/pom.xml 2011-= 07-19 08:46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole/pom.xml 2011-= 07-19 08:47:02 UTC (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.backupconsole eXo JCR :: Applications :: Backup Console Modified: jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/po= m.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/pom.xml = 2011-07-19 08:46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.backupconsole.dist/pom.xml = 2011-07-19 08:47:02 UTC (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.backupconsole.dist eXo JCR :: Applications :: Backup Console Binary Distribution @@ -37,7 +37,7 @@ org.exoplatform.jcr exo.jcr.applications.backupconsole - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT org.exoplatform.jcr Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.browser/pom.xml 2011-07-19 = 08:46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.browser/pom.xml 2011-07-19 = 08:47:02 UTC (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.browser war Modified: jcr/trunk/applications/exo.jcr.applications.config/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2011-07-19 0= 8:46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.config/pom.xml 2011-07-19 0= 8:47:02 UTC (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.config pom Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.fckeditor/pom.xml 2011-07-1= 9 08:46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.fckeditor/pom.xml 2011-07-1= 9 08:47:02 UTC (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.fckeditor war Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.jboss/pom.xml 2011-07-19 08= :46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.jboss/pom.xml 2011-07-19 08= :47:02 UTC (rev 4661) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT ear runtime Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.jetty/pom.xml 2011-07-19 08= :46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.jetty/pom.xml 2011-07-19 08= :47:02 UTC (rev 4661) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.config = Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.jonas/pom.xml 2011-07-19 08= :46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.jonas/pom.xml 2011-07-19 08= :47:02 UTC (rev 4661) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT = 4.0.0 @@ -40,7 +40,7 @@ org.exoplatform.jcr exo.jcr.ear - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT ear runtime Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.rest/pom.xml 2011-07-19 08:= 46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.rest/pom.xml 2011-07-19 08:= 47:02 UTC (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.rest war Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-07-19 0= 8:46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-07-19 0= 8:47:02 UTC (rev 4661) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.applications.config - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.applications.config = Modified: jcr/trunk/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/trunk/applications/exo.jcr.cluster.testclient/pom.xml 2011-07-19 08= :46:28 UTC (rev 4660) +++ jcr/trunk/applications/exo.jcr.cluster.testclient/pom.xml 2011-07-19 08= :47:02 UTC (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.cluster.testclient eXo JCR :: Cluster :: Test Client Modified: jcr/trunk/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/trunk/applications/exo.jcr.ear/pom.xml 2011-07-19 08:46:28 UTC (rev= 4660) +++ jcr/trunk/applications/exo.jcr.ear/pom.xml 2011-07-19 08:47:02 UTC (rev= 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.ear ear Modified: jcr/trunk/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/trunk/applications/pom.xml 2011-07-19 08:46:28 UTC (rev 4660) +++ jcr/trunk/applications/pom.xml 2011-07-19 08:47:02 UTC (rev 4661) @@ -22,12 +22,12 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT = 4.0.0 jcr-applications-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT = eXo JCR :: Applications :: Reactor pom 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 2011-07-19 08:46:28 UTC (rev 4= 660) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-07-19 08:47:02 UTC (rev 4= 661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.component.core eXo JCR :: Component :: Core Service Modified: jcr/trunk/exo.jcr.component.ext/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-19 08:46:28 UTC (rev 46= 60) +++ jcr/trunk/exo.jcr.component.ext/pom.xml 2011-07-19 08:47:02 UTC (rev 46= 61) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.component.ext eXo JCR :: Component :: Extension Service Modified: jcr/trunk/exo.jcr.component.ftp/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.ftp/pom.xml 2011-07-19 08:46:28 UTC (rev 46= 60) +++ jcr/trunk/exo.jcr.component.ftp/pom.xml 2011-07-19 08:47:02 UTC (rev 46= 61) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.component.ftp eXo JCR :: Component :: FTP Service Modified: jcr/trunk/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/trunk/exo.jcr.component.statistics/pom.xml 2011-07-19 08:46:28 UTC = (rev 4660) +++ jcr/trunk/exo.jcr.component.statistics/pom.xml 2011-07-19 08:47:02 UTC = (rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.component.statistics eXo JCR :: Component :: Statistics Provider Modified: jcr/trunk/exo.jcr.component.webdav/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.webdav/pom.xml 2011-07-19 08:46:28 UTC (rev= 4660) +++ jcr/trunk/exo.jcr.component.webdav/pom.xml 2011-07-19 08:47:02 UTC (rev= 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.component.webdav eXo JCR :: Component :: Webdav Service Modified: jcr/trunk/exo.jcr.connectors.jca/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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.jca/pom.xml 2011-07-19 08:46:28 UTC (rev 4= 660) +++ jcr/trunk/exo.jcr.connectors.jca/pom.xml 2011-07-19 08:47:02 UTC (rev 4= 661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.connectors.jca rar Modified: jcr/trunk/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/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 2011-07-19 08:= 46:28 UTC (rev 4660) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/pom.xml 2011-07-19 08:= 47:02 UTC (rev 4661) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs.developer - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT = 4.0.0 Modified: jcr/trunk/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/trunk/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2011-07-19 08:46:= 28 UTC (rev 4660) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/pom.xml 2011-07-19 08:47:= 02 UTC (rev 4661) @@ -22,7 +22,7 @@ org.exoplatform.jcr exo.jcr.docs - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT = 4.0.0 Modified: jcr/trunk/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/trunk/exo.jcr.docs/pom.xml 2011-07-19 08:46:28 UTC (rev 4660) +++ jcr/trunk/exo.jcr.docs/pom.xml 2011-07-19 08:47:02 UTC (rev 4661) @@ -22,7 +22,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT = 4.0.0 Modified: jcr/trunk/exo.jcr.framework.command/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.command/pom.xml 2011-07-19 08:46:28 UTC (re= v 4660) +++ jcr/trunk/exo.jcr.framework.command/pom.xml 2011-07-19 08:47:02 UTC (re= v 4661) @@ -12,7 +12,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.framework.command eXo JCR :: Framework :: Command Modified: jcr/trunk/exo.jcr.framework.ftpclient/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2011-07-19 08:46:28 UTC (= rev 4660) +++ jcr/trunk/exo.jcr.framework.ftpclient/pom.xml 2011-07-19 08:47:02 UTC (= rev 4661) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.framework.ftpclient eXo JCR :: Framework :: FTP Client Modified: jcr/trunk/exo.jcr.framework.web/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.framework.web/pom.xml 2011-07-19 08:46:28 UTC (rev 46= 60) +++ jcr/trunk/exo.jcr.framework.web/pom.xml 2011-07-19 08:47:02 UTC (rev 46= 61) @@ -24,7 +24,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT exo.jcr.framework.web eXo JCR :: Framework :: Web Modified: jcr/trunk/packaging/module/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/packaging/module/pom.xml 2011-07-19 08:46:28 UTC (rev 4660) +++ jcr/trunk/packaging/module/pom.xml 2011-07-19 08:47:02 UTC (rev 4661) @@ -4,7 +4,7 @@ org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT jcr.packaging.module pom 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 2011-07-19 08:46:28 UTC (rev 4660) +++ jcr/trunk/pom.xml 2011-07-19 08:47:02 UTC (rev 4661) @@ -29,14 +29,14 @@ = org.exoplatform.jcr jcr-parent - 1.14.0-CR4 + 1.14.0-GA-SNAPSHOT pom eXo JCR = - scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/tags/1.= 14.0-CR4 - scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= ags/1.14.0-CR4 - http://fisheye.jboss.org/browse/exo-jcr/jcr/tags/1.14.0-CR4 + scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/jcr/trunk + scm:svn:https://svn.jboss.org/repos/exo-jcr/jcr/t= runk + http://fisheye.jboss.org/browse/exo-jcr/jcr/trunk = --===============7922452659261738342==-- From do-not-reply at jboss.org Tue Jul 19 04:59:30 2011 Content-Type: multipart/mixed; boundary="===============0484591979822409812==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4662 - jcr/trunk. Date: Tue, 19 Jul 2011 04:59:30 -0400 Message-ID: <201107190859.p6J8xUVM004026@svn01.web.mwc.hst.phx2.redhat.com> --===============0484591979822409812== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 04:59:30 -0400 (Tue, 19 Jul 2011) New Revision: 4662 Modified: jcr/trunk/pom.xml Log: EXOJCR-1435: change dep to trunk 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 2011-07-19 08:47:02 UTC (rev 4661) +++ jcr/trunk/pom.xml 2011-07-19 08:59:30 UTC (rev 4662) @@ -42,9 +42,9 @@ exo-jcr 1.14 - 2.3.0-CR4 - 2.4.0-CR4 - 2.2.0-CR4 + 2.3.0-GA-SNAPSHOT + 2.4.0-GA-SNAPSHOT + 2.2.0-GA-SNAPSHOT 1 = --===============0484591979822409812==-- From do-not-reply at jboss.org Tue Jul 19 05:20:36 2011 Content-Type: multipart/mixed; boundary="===============5600464235921996289==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4663 - jcr/tags/1.14.0-CR4. Date: Tue, 19 Jul 2011 05:20:36 -0400 Message-ID: <201107190920.p6J9Kafo012617@svn01.web.mwc.hst.phx2.redhat.com> --===============5600464235921996289== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 05:20:36 -0400 (Tue, 19 Jul 2011) New Revision: 4663 Added: jcr/tags/1.14.0-CR4/readme.txt Log: EXOJCR-1435: release notes Added: jcr/tags/1.14.0-CR4/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.14.0-CR4/readme.txt (rev 0) +++ jcr/tags/1.14.0-CR4/readme.txt 2011-07-19 09:20:36 UTC (rev 4663) @@ -0,0 +1,731 @@ +JCR 1.14.0-CR4 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 1.14.0-CR4 +* Multi DB Schema Support +* Removing repositories in runtime created by RepositoryCreationService +* Support resolving mime-type of file without extension + +Changes of 1.14.0-CR4 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-1057] - Problems during testing of Lock operations (EditLock= edCommonNodeTest) + * [EXOJCR-1068] - Wrong unregister procedure for containers components + * [EXOJCR-1132] - Check problem with save configuration (RepositorySer= viceConfigurationImpl.retain) to file system on OS Windows. = + * [EXOJCR-1191] - Check problem with compatibility of incremental back= up for JCR 1.12.x to JCR 1.14.x. + * [EXOJCR-1385] - PROBLEMS during functional testing: test TestISPNCac= heWorkspaceStorageCacheInClusterMode + * [EXOJCR-1392] - Delay in replication of Nodes data in JBoss EPP Clus= ter + * [EXOJCR-1413] - [Perf] ItemDataTraversingVisitor#visit(NodeData node= ) continue to visit deeper althought onParentVersion=3DIGNORE + * [EXOJCR-1414] - Lists stored into the cache can be inconsistent in c= luster environment + * [EXOJCR-1415] - FUNCTIONAL testing: failures on MySql + * [EXOJCR-1434] - FileCleaner in BackupManagerImpl should be used from= proper RepositoryContainer = + * [EXOJCR-1436] - Index reader handling improvements + +Enhancement + * [EXOJCR-1162] - Remove duplicated classes + * [EXOJCR-1303] - WARN No principal found when performing JBoss securi= ty manager cache eviction + * [EXOJCR-1378] - The "mimetype" of a file without extension is not re= trieved in upload + +Feature Request + * [EXOJCR-1374] - Multi DB Schema Support + * [EXOJCR-1376] - Add UUID into the exception message content of ItemE= xistsException + * [EXOJCR-1396] - Add posibility to remove repositories created by Rep= ositoryCreationService + * [EXOJCR-1397] - Create method which will return db configuration of = repository + * [EXOJCR-1398] - Add posibility create repository in RepositoryCreati= onService with custom set of DB connection parameters + * [EXOJCR-1405] - Allow to set backup-dir in repository backup-log as = related path or(and) can be set with help of system variables + * [EXOJCR-1417] - Make the code fully independent of DBCP + * [EXOJCR-1439] - Add getCurrentRepositoryName method to RepositorySer= viceImpl + +Quality Risk + * [EXOJCR-1215] - Regression during daily tests on JCR-1.14.0 + +Task + * [EXOJCR-1017] - Reduce amount of used threads as Search/Index engine + * [EXOJCR-1283] - Generate a source release zip + * [EXOJCR-1332] - SQL scripts for production + * [EXOJCR-1404] - Deprecate StorageUpdateManager feature + * [EXOJCR-1419] - Move FutureExoCache from GateIn commons to eXo kernel + * [EXOJCR-1426] - Cleanup the code to get rid of useless System.curren= tTimeMillis() calls + +Sub-task + * [EXOJCR-1362] - Put nodes in cache with ACL when they are asked by U= UID + * [EXOJCR-1377] - Review tests in jcr-core projects [part 2] + * [EXOJCR-1382] - Investigate the reason of decreasing Property.setVal= ue() performance + * [EXOJCR-1383] - Support paging for Sybase DB + * [EXOJCR-1384] - Prepare DB for testing RDBMS reindxing/backup/restor= e features + * [EXOJCR-1400] - Prepare Sybase DB for testing RDBMS features + * [EXOJCR-1401] - Prepare DB2 for testing RDBMS features + * [EXOJCR-1403] - Prepare Oracle 11 R1 and Oracle 11R2 for testing RDB= MS features + * [EXOJCR-1408] - Improve the performance of the Property.setValue() m= ethods + * [EXOJCR-1409] - Testing RDBMS features on PostgreSQL (2 DBs) + * [EXOJCR-1410] - Testing RDBMS features on MySQL (2 DBs) + * [EXOJCR-1420] - Remove repository in Standalone mode + * [EXOJCR-1422] - Remove repository in cluster mode + * [EXOJCR-1423] - Remove reference from InitialContextBinder + * [EXOJCR-1424] - Remove datasource from JNDI + * [EXOJCR-1425] - Close all database connections + * [EXOJCR-1429] - Improve the perfomance of NodeLockTest and NodeUnloc= kTest + * [EXOJCR-1443] - Review tests in jcr-ext project + + +Changes of 1.14.0-CR3 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-1088] - Extra exception stack trace[EXOJCR-1088] - Extra exc= eption stack trace[EXOJCR-958] - Problem with WebDav on Jboss-server + * [EXOJCR-1088] - Extra exception stack traces while browsing with Mac= OS Finder through WebDAV + * [EXOJCR-1123] - TestRollbackBigFiles.java failed on MySQL + * [EXOJCR-1124] - Dolphin issues when moving resources/collections + * [EXOJCR-1163] - RPCService is held when try to execute remote comman= d inside other + * [EXOJCR-1167] - Backup tests failed on Windows 7 + * [EXOJCR-1168] - HTTPBackupAgentTest failed on Windows 7 + * [EXOJCR-1178] - Incorrect MOVE method response when moving nodes bet= ween workspaces + * [EXOJCR-1187] - Increase memory consuming of JCR, OutOfMemoryError: = PermGen space + * [EXOJCR-1200] - PROBLEMS during load testing *WARN * [Thread-72] Laz= yTextExtractorField: Exception reading value for field: Stream closed + * [EXOJCR-1249] - FUNCTIONAL testing: test TestLockPerstistentDataMana= ger is in error + * [EXOJCR-1250] - FUNCTIONAL testing: on configuration multi, cache is= turned off there're tests in error and in failure + * [EXOJCR-1255] - TESTING: during load testing appear "The Network Ada= pter could not establish the connection" exception + * [EXOJCR-1285] - Can't open versions of file with non-latin name + * [EXOJCR-1305] - Orderable child nodes not honouring the order before= method after a move + * [EXOJCR-1319] - Still check lock on parent while isDeep =3D false + * [EXOJCR-1320] - Case sensitivityProblem with Oracle Virtual Director= y and SQL Server + * [EXOJCR-1321] - TESTING: Can't open file with non-latin name via ope= noffice plugin. ErorCode: 404 + * [EXOJCR-1322] - MANUAL TESTING: problems during move folder on "clie= nt-server" + * [EXOJCR-1327] - Need trigger events by default for Workspace.move() + * [EXOJCR-1331] - Cache can contain NullNodeData for root node after R= DBMS restore + * [EXOJCR-1334] - Exception when edit the properties of a nt:resource = node + * [EXOJCR-1342] - Thread not stopped when the application is stopped + * [EXOJCR-1344] - No eviction policy is allowed in case of the cache f= or indexing + * [EXOJCR-1345] - Cluster coordinator change throws Timed out waiting = for flush to unblock + * [EXOJCR-1349] - Duplicate content of other workspaces in default wor= kspace + * [EXOJCR-1350] - Impossible to move files in Webdav when the destinat= ion path contains space (Windows) + * [EXOJCR-1353] - NPE during incremental restore + * [EXOJCR-1354] - BackupManagerImpl and MultiIndex doesn't suspend the= irs threads on stop methods + * [EXOJCR-1356] - Find a way to have a name for MBeans of JBossCaches = used by the JCR = + * [EXOJCR-1359] - PROBLEMS during functional testing: test TestUserTra= nsaction is in failure + * [EXOJCR-1360] - PROBLEMS during functional testing: test TestQueryUs= ecases is in failure + * [EXOJCR-1367] - PROBLEMS during functional testing: test TestXATrans= action is in error + * [EXOJCR-1369] - PROBLEMS during functional testing: test NodeReadMet= hodsTest is in error + * [EXOJCR-1371] - Properties can lose their "isMultivalued" flag after= backup/restore operation. + +Enhancement + * [EXOJCR-1318] - Return only exptected attributes in SimpleLdapUserLi= stAccess + * [EXOJCR-1323] - Make the StandaloneContainerInitializedListener work= with a configured relative path + * [EXOJCR-1324] - Misspelling in some class names + * [EXOJCR-1326] - Do not create new instance of MimeTypeResolver for e= ach PUT request. + * [EXOJCR-1337] - Do not check MultiIndex.checkIndexingQueue for finis= hed documents + * [EXOJCR-1338] - Remove unnecessary component from configuration to a= void failed builds on Jenkins + * [EXOJCR-1343] - Avoid data accesses in case of new created nodes + * [EXOJCR-1347] - Clean the code of the IndexerChangesFilters + * [EXOJCR-1351] - Allow to manage the JCR Cache from JMX + * [EXOJCR-1352] - Set check-sns-new-connection into false by default + * [EXOJCR-1355] - Allow to suspend and resume the JobSchedulerService = thanks to JMX and/or Rest + * [EXOJCR-1357] - Add to the documentation the name of the existing ca= tegories of statistics + +Feature Request + * [EXOJCR-480] - Managed transactions support + * [EXOJCR-1103] - Improve the methods Node.getProperties(String namePa= ttern) and Node.getNodes(String namePattern) + * [EXOJCR-1111] - Reduce the total amount of queries needed to update = a property + * [EXOJCR-1189] - Upgrade to use Tomcat AS v6.0.32 + * [EXOJCR-1325] - Make possible to specify custom mimetypes.properties= for MimeTypeResolver + * [EXOJCR-1328] - JCA support + * [EXOJCR-1329] - Allow to use TransactionsEssentials as Transaction M= anager + * [EXOJCR-1333] - Provide a hasProfile method on ExoContainer + +Task + * [EXOJCR-769] - Port the RESTEndPoint annotation processor in WS sub-= project + * [EXOJCR-944] - WS : Do not generate files in src directory of a proj= ect + * [EXOJCR-945] - JCR : Cleanup build + * [EXOJCR-1009] - Check if membership type is present before membershi= p is created + * [EXOJCR-1221] - Resolve all the violations found by sonar when it is= possible + * [EXOJCR-1297] - Apply the patch file to JCR doc of PLF trunk for cod= es to be highlighted + * [EXOJCR-1317] - Generate checksum for each artifact in project + * [EXOJCR-1340] - [DOC]Add isolation level notice to the documentation + * [EXOJCR-1348] - Use the DefaultChangesFilter in the configuration in= case of a local mode + * [EXOJCR-1358] - In WebDAV Interpret NoSuchWorkspaceException as HTTP= CONFLICT state + * [EXOJCR-1366] - minConnection and maxConnection params in the ldap c= onfiguration are not used + * [EXOJCR-1372] - Align dependencies with EAP 5.1 + * [EXOJCR-1373] - Core.PDFDocumentReader support metadata UTF-16 encod= ing + +Sub-task + * [EXOJCR-1048] - TCK FrozenNodeTest has fails and exceptions - fix it + * [EXOJCR-1049] - Check MultiConfigServiceTest + * [EXOJCR-1050] - Check CommandServiceTest + * [EXOJCR-1335] - Prepare benchmark tests + * [EXOJCR-1363] - Investigate the reason of decreasing Session.getRoot= Node() performance + * [EXOJCR-1364] - Review tests in jcr-core projects [part 1] + * [EXOJCR-1365] - Appy patches and check the performance + +Changes of 1.14.0-CR2 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-1027] - TestPersistedValueData sometimes failed on hudson + * [EXOJCR-1081] - TestBackupManager sometimes failed on hudson + * [EXOJCR-1125] - FileCleaner is null in SysViewWorkspaceInitializer a= nd BackupWorkapceInitializer. + * [EXOJCR-1192] - FUNCTIONAL testing: test TestQueryUsecases is in fai= lure + * [EXOJCR-1234] - Orderable child node not honouring the add method + * [EXOJCR-1258] - Backup console doesn't work with Platform 3.5 + * [EXOJCR-1263] - Problem of webdav on windows 7 + * [EXOJCR-1267] - Dialog window "About" has incorrect version of jcr i= n webdav ms office plugin + * [EXOJCR-1270] - Workspace initializer is possible pushing an NullIte= mData into the cache when performing isWorkspaceInitialized() check + * [EXOJCR-1282] - File with non-latin name can't be open: Can't open r= emote file.ErrorCode:500 + * [EXOJCR-1284] - Can't access file containing special characters in f= ile name via Webdav + * [EXOJCR-1290] - Problems with dispalying non-latin names (ar,fr,ua,r= u,vn) after restore in backup + * [EXOJCR-1291] - Component should be resumed in reverse order + * [EXOJCR-1296] - Problem when renaming a large folder containing mult= iple files in webdav (Windows) + * [EXOJCR-1300] - Use QueryParam to parameter "backup-set-path" in met= hods of HTTPBackupAgent + * [EXOJCR-1307] - Failing tests in the webdav project due to an encodi= ng issue + * [EXOJCR-1308] - FUNCTIONAL testing: test TestJBossCacheWorkspaceStor= ageCacheInClusterMode is in failure + * [EXOJCR-1310] - Error when get node definition for node + +Component Upgrade + * [EXOJCR-1279] - Upgrade ISPN to 4.2.1 FINAL + +Enhancement + * [EXOJCR-1233] - JCR configuration update require dropping JCR_CONFIG= table + * [EXOJCR-1241] - Give a more understandable name to all the existing = Threads + * [EXOJCR-1268] - Allow to rely on the ConfigurationManager to get the= JGroups configuration when we use ISPN as underlying cache + * [EXOJCR-1281] - Create database without datasource prefix in case of= SingleDB + * [EXOJCR-1286] - Very high response time when loading a page in the "= Community Management" portlet when using ldap + * [EXOJCR-1298] - Don't informative error at DefaultLoginModule.login(= ) when the container is null. + * [EXOJCR-1311] - Ensure possibility to restore without dump of lock t= ables + * [EXOJCR-1314] - Improve QPath.isDescendantOf by using reverse order + +Feature Request + * [EXOJCR-577] - Allow to reindex a workspace asynchronously + * [EXOJCR-1204] - Indexing failed with "Can't acquire lock timeout" ex= ception + * [EXOJCR-1206] - Create a data distribution service to help the appli= cations to better distribute their child nodes + * [EXOJCR-1269] - Allow to set a default value when we use variables i= n configuration files + * [EXOJCR-1292] - Add possibility to know whether components are suspe= nded or not + * [EXOJCR-1294] - Allow to create sessions from ACLs + * [EXOJCR-1301] - Allow to use external backup tools in a secure manner + +Task + * [EXOJCR-983] - Folders "logs" and "temp" are not on the same level a= s jetty + * [EXOJCR-1019] - Ensure that we can connect to WebDAV server using di= gest authentication + * [EXOJCR-1136] - Improve the NodeHierarchyCreator to better scale in = term of users + * [EXOJCR-1170] - Comparing RDBMS backup/restore/reindexing features w= ith old implementation = + * [EXOJCR-1229] - Write an Upgrade guide from 1.14 beta3 to 1.14 CR1 + * [EXOJCR-1257] - exobackup tool simplified command-line interface + * [EXOJCR-1260] - Improve the Tomcat bundle to test all the existing i= mplementations + * [EXOJCR-1289] - Persisted data must be committed in cache without an= y transaction. = + * [EXOJCR-1293] - Commons-lang dependency differs for JCR and Core + * [EXOJCR-1302] - Data consistency - avoid possible data overwrite + +Sub-task + * [EXOJCR-1265] - Restore on MSSQL 2005 failed because of Connection r= eset. + * [EXOJCR-1266] - RDBMS backup failed in cluster env with ISPN configu= ration + * [EXOJCR-1271] - Check the length of the name of the cache for lock + * [EXOJCR-1272] - The big batch commit in RDMBS restore on Oracle DB w= s failed . + * [EXOJCR-1273] - RDBMS restore failes on DB2 because of DB2 SQL Error= : SQLCODE=3D-964, SQLSTATE=3D57011, + * [EXOJCR-1274] - Check functional working RDBMS backup/restore featur= e with JBC + * [EXOJCR-1275] - Ensure working on Windows OS + * [EXOJCR-1276] - Determinate the way of comparing two configurations + * [EXOJCR-1280] - Allow to reindex a repository/workspace thanks to JMX + +Changes of 1.14.0-CR1 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-1116] - RepositoryCreatorService stucks at RepositoryCreatio= nSynchronizer.waitForApproval() + * [EXOJCR-1122] - Location header missing in CREATED response for MOVE= method + * [EXOJCR-1179] - Concurrent eXo cache creation doesn't prevent multip= le cache creation + * [EXOJCR-1196] - ApplicationRegistry fails with NPE if any of javax.w= s.rs.core.Application return null instead of empty collection of JAX-RS com= ponents + * [EXOJCR-1197] - OrganizationService is started before NodeHierarchyC= reator is initialized + * [EXOJCR-1199] - Unprotected user code can stop container or org.pico= container.Startable component + * [EXOJCR-1201] - Fix WS packaging JS file for REST dependency + * [EXOJCR-1210] - Restore from RDBMS backup fail on InnoDB(MySQL) + * [EXOJCR-1213] - Tomcat doesn't stop after gatein.sh stop + * [EXOJCR-1217] - Problem with the move function of webdav on https + * [EXOJCR-1218] - Problem of renaming folders in WebDav + * [EXOJCR-1232] - Unparseable variable in JCR XML configuration file + * [EXOJCR-1235] - NFS stale handle + * [EXOJCR-1238] - Not correct MBean components registration when Porta= lContainer contains more then one repository [Part2] = + * [EXOJCR-1242] - UserImpl toString() wrong return value : only the @o= rganizationId info. + * [EXOJCR-1253] - PDFBox dependencies not complete in Core packaging + +Enhancement + * [EXOJCR-1149] - Load scriptPath resource with help of org.exoplatfor= m.container.configuration.ConfigurationManagerImpl in org.exoplatform.servi= ces.database.creator.DBCreator + * [EXOJCR-1182] - MimeTypeResolver does not work well with IE7 + * [EXOJCR-1185] - Reduce the time spent in ParentNodeEvictionActionPol= icy + * [EXOJCR-1188] - IndexInfos.write() should be called just after repla= ceIndexes operation done by IndexMerger + * [EXOJCR-1231] - Help applications to prevent memory leaks by enablin= g the SessionCleaner by default + * [EXOJCR-1240] - Give a more understandable name to all the existing = Containers + * [EXOJCR-1243] - JobSchedulerService interface should include: addPer= iodJob and addCronJob + * [EXOJCR-1254] - Add a mode that throws an Exception when we use a se= ssion that is not alive anymore + +Feature Request + * [EXOJCR-853] - Make it possible to create new repository in runtime = from back-up in cluster environment + * [EXOJCR-1078] - Implement a Backup/Restore Feature for RDBMS + * [EXOJCR-1080] - Improve Lucene Indexing in a cluster environment + * [EXOJCR-1089] - RootContainer configuration fails in JBossAS 6 + * [EXOJCR-1104] - Propose a re-indexing mechanism for RDBMS + * [EXOJCR-1142] - Add application/x-jaxrs+groovy mime type to mimetype= s.properties for *.grs extension + * [EXOJCR-1160] - Glassfish Support + * [EXOJCR-1177] - Improve JCR Doc + * [EXOJCR-1180] - Allow to avoid using the cache factory under some sp= ecific conditions + * [EXOJCR-1183] - Implement RequestLifeCycle in ResourceLauncher + * [EXOJCR-1184] - Improve the re-indexing mechanism to take advantage = of multi-cores + * [EXOJCR-1202] - Support disable feature for ISPN cache + * [EXOJCR-1207] - Export/Import child nodes version history in single = xml with parent version history + * [EXOJCR-1220] - Allow to use variables to define any values in the c= onfiguration file + * [EXOJCR-1246] - StandaloneContainerInitializedListener should stop c= ontainer on contextDestroyed method + +Task + * [EXOJCR-828] - JCR replication based on Infinispan + * [EXOJCR-1112] - DBCleanerService: Support clean data for single work= space in case of multi-db + * [EXOJCR-1157] - Upgrade to the latest maintenance version of Lucene = 2.9 + * [EXOJCR-1158] - Review all the third party libraries + * [EXOJCR-1159] - Upgrade all the choosen Third party libraries + * [EXOJCR-1175] - Implement PDFDocumentReader.getProperties using PDFB= ox + * [EXOJCR-1176] - Make text message of 405 (Method Not Allowed) status= more meaningful + * [EXOJCR-1208] - ConstraintViolationException when Importing Version = history of a nt:folder node having a nt:file child node. Apply patch. + * [EXOJCR-1230] - Update the js files in order to add the missing depe= ndencies + * [EXOJCR-1252] - Remove asm dependency from Kernel packaging + +Sub-task + * [EXOJCR-832] - JCR Indexer based on Infinispan + * [EXOJCR-833] - Test the JCR Replication based on infinispan in non c= luster mode + * [EXOJCR-834] - Test the JCR Replication based on infinispan in clust= er mode + * [EXOJCR-930] - Testing in cluster environment + * [EXOJCR-970] - Ensure the collocation of the data related to the sam= e node when it is possible + * [EXOJCR-1045] - Check the TestVersionRestore + * [EXOJCR-1046] - Few excluded tests fails because of SecurityManager + * [EXOJCR-1047] - Excluded TestSessionDataManager fails with NullPoint= erExceptions + * [EXOJCR-1100] - Documentation and prepare testcases for QA + * [EXOJCR-1153] - Support atomic restore + * [EXOJCR-1174] - Each cluster node must have it's own index + * [EXOJCR-1193] - Index retrieval from coordinator node + * [EXOJCR-1214] - Adopt benchmark for quick ISPN <--> JBC switching. S= et ISPN as default for benchmark and functional tests + + +Changes of 1.14.0-Beta03 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-956] - Cannot use webdav service with a version of jcr:conte= nt + * [EXOJCR-961] - On restore node the versioning child was removed, but= versioning child should be remain unchanged. + * [EXOJCR-974] - Simple skin from examples folder doesn't appear at li= st + * [EXOJCR-977] - InitialContextBinder.java doesn't support // instances + * [EXOJCR-979] - Lock operations does not checks any permission + * [EXOJCR-982] - Problems during testing of jetty: *ERROR* [qtp3113105= 8-61] PropFindResponseEntity: + * [EXOJCR-984] - CachingContainer returns unregistered components + * [EXOJCR-993] - Daily testing problem: NPE during testing + * [EXOJCR-994] - WEBDav view in a webbrowser has hardcoded image links + * [EXOJCR-995] - NPE when try to import data via WorkspaceContentImpor= ter + * [EXOJCR-1000] - Not correct MBean components registration when Porta= lContainer contains more then one repository = + * [EXOJCR-1001] - refresh breaks webdav published files + * [EXOJCR-1002] - MethodAccessFilter return not human readable error m= essage and don't set "JAXRS-Body-Provided" header in case rolles not allowed + * [EXOJCR-1003] - DeleteCommand in case try remove locked file return = don't human readable message = + * [EXOJCR-1012] - Response on PROPFIND method with 'allprop' element c= ontains wrong formatted and extra data + * [EXOJCR-1013] - Response on PROPFIND method with 'allprop' element d= oesn't contain properties inside element + * [EXOJCR-1014] - FTP server doesn't show list of workspaces after rep= ository restoring + * [EXOJCR-1015] - PROBLEM with Testing Backup Console: restore workspa= ce/backup + * [EXOJCR-1030] - Impossible to retrieve the lock on a node even by th= e root + * [EXOJCR-1036] - Empty metadata field not updated when re-uploading d= ocuments + * [EXOJCR-1037] - If a header delegate is not available then toString = method of Object should be used + * [EXOJCR-1038] - Some Unit Tests on DB2 related to the CAS plugin fail + * [EXOJCR-1040] - eXo JCR doesn't work with Oracle 11g R2 RAC + * [EXOJCR-1043] - Index already present error during cluster start + * [EXOJCR-1051] - Problems when start backup-console + * [EXOJCR-1058] - Problem with uploading files via MacOS client + * [EXOJCR-1060] - Indexer doesn't fully release resources on stop + * [EXOJCR-1061] - Access Denied in jcr:content with anonim__ permission + * [EXOJCR-1062] - WebDAV response is LOCKED after LOCK -> PUT request = from the client (but PUT sends locktoken given after LOCK) + * [EXOJCR-1065] - Functional testing jcr.core: API Tests failures on M= ysql DB + * [EXOJCR-1069] - Backup console throws NPE if backup agent isn't depl= oyed on server + * [EXOJCR-1073] - TestRPCServiceImpl fails with JGroups 2.10.0.GA + * [EXOJCR-1085] - Wrong Content-Type header for files over a certain s= ize + * [EXOJCR-1087] - MySQL-UTF8 dialect default collation can be case-ins= ensitive - need case-sensitive set explicitly + * [EXOJCR-1092] - Unexpected behaviour of Nautilus while creating/rena= ming a folder/file via WebDAV = + * [EXOJCR-1093] - Wrong pasting of a copied folder using Nautilus via = WebDAV + * [EXOJCR-1095] - Webdav doesn't work on JBoss + * [EXOJCR-1098] - The If-Modified-Since property in the HTTP header do= esn't exist + * [EXOJCR-1107] - RPCService.executeCommandOnCoordinator() doesn't wor= k properly when few instances are on the same workstation + * [EXOJCR-1109] - Object BooleanValue must return string representatio= n of boolean value by method getStringValue(). + * [EXOJCR-1113] - SessionDataManager.listChildPropertiesData(NodeData = parent) must not return ValueDatas + * [EXOJCR-1115] - Exception error during edit content + * [EXOJCR-1117] - Correct misspelling in some methods names: doPrivile= dged to doPrivileged + * [EXOJCR-1118] - IncrementalBackupJob should be thread safe + * [EXOJCR-1131] - Node restore result depends on cache eviction + * [EXOJCR-1133] - Unit tests fail due to a AccessControlException in c= luster mode + * [EXOJCR-1139] - Restored version nodes get id from jcr:uuid property= instead fetch generated id + * [EXOJCR-1140] - Corrupted data if the server is stopped while docume= nt is locked + * [EXOJCR-1145] - IndexMerger in RO mode is not aware of new indexes + * [EXOJCR-1151] - FORM authentication doesn't work with jcrbackup tool= and Platform + * [EXOJCR-1152] - WADL generation fails if resource class contains som= e type of sub-resource locators + * [EXOJCR-1154] - Repository restore fails using exobackup tool with C= omponent unregister error + * [EXOJCR-1155] - Set scope test for junit dependency in exo.ws.rest.e= xt project + * [EXOJCR-1165] - BackupManager restore : Temporary files not deleted + * [EXOJCR-1169] - Remove some unnecessary jars + * [JCR-1462] - Problems during testing of backup on jcr 1.12.5-GA-SNAP= SHOT + * [JCR-1483] - When a folder is cut server->client, folder on server d= oesn't remove. + * [JCR-1485] - Unknown error and strange behavior when mary edits a we= bcontent + * [JCR-1508] - Property not found dc:title during testing RandomReadNt= FileWithMetadataTest + +Documentation + * [JCR-1433] - jcr backup/restore + +Feature Request + * [EXOJCR-747] - Make Backup restore easier + * [EXOJCR-887] - Allow to start all the cluster nodes in parallel even= during for the first initialization of the JCR + * [EXOJCR-971] - Prevent unauthorized access to the methods of Reposit= oryServiceImpl + * [EXOJCR-973] - Add possibility set user role in org.exoplatform.serv= ices.rest.tools.ResourceLauncher = + * [EXOJCR-992] - Allow to use a String as entity for a JSON response + * [EXOJCR-997] - Whole Repository backup support in Backup Console tool + * [EXOJCR-999] - Limit the total amount of WorkerThreads + * [EXOJCR-1011] - Allow to use variables to define the realm, the rest= context and the portal container name of a PortalContainerDefinition + * [EXOJCR-1020] - Create groovy compiler which able consume JCR node r= eferences and produce set of classes as result. + * [EXOJCR-1024] - Make possible to overwrite default providers (reader= s and writers) + * [EXOJCR-1029] - The result of the method getReferencesData is never = stored into the cache + * [EXOJCR-1032] - Limited support WedDav ACL specification = + * [EXOJCR-1064] - Code review of ACL managment in case of copy/moving = nodes + * [EXOJCR-1066] - Avoid iterating over a List thanks to its iterator w= hen it is possible + * [EXOJCR-1079] - Create plugin for adding exception mapping providers= in REST environment + * [EXOJCR-1099] - Add support restore existed repository/workspace in = backup console + * [EXOJCR-1105] - Make it possible to configure dependencies path for = Groovy scripts in runtime + * [EXOJCR-1143] - Add possibility to get raw JSON data in methods of R= ESTful services. + * [EXOJCR-1150] - DB clean on MySQL should not use iterating over all = db = + * [EXOJCR-1164] - Make possible in JrGroovyCompiler get list of URL on= dependency classes + * [EXOJCR-1172] - Rest framework must understand http header "x-forwar= ded-host" + +Task + * [EXOJCR-946] - Adopt Backup client article + * [EXOJCR-949] - Updating eXo JCR version in ra.xml automatically = + * [EXOJCR-952] - Backport 1.14.x branch commits to trunk + * [EXOJCR-955] - BufferedJBossCache performance improving + * [EXOJCR-963] - [DOC]Reply on JBC regions to avoid having too many JB= C instances + * [EXOJCR-965] - Cache doesn't support disable feature + * [EXOJCR-972] - Add org.exoplatform.services.rest.ext.method.filter.M= ethodAccessFilter in container configuration by default + * [EXOJCR-981] - Remove timestamp from names of jar-files in applicati= on bundles + * [EXOJCR-986] - Enable the security manager by default in all the pro= jects + * [EXOJCR-988] - RepositoryException: URI is not hierarchical on remov= e workspace via backup console + * [EXOJCR-989] - Refactor JSON framework + * [EXOJCR-996] - Merge performance improvements + * [EXOJCR-998] - Null values management must be reviewed to be up to d= ate + * [EXOJCR-1010] - Create two more constructors for WebDavServiceImpl + * [EXOJCR-1018] - Bind slf4j-log4j and log4j dependencies onto the tes= t phase of the various modules of JCR [part #2] + * [EXOJCR-1028] - Update the example of configuration for a cluster en= vironment + * [EXOJCR-1044] - Check TestQueryUsecases + * [EXOJCR-1054] - Apply all the changes made in the ISPN branch to the= trunk + * [EXOJCR-1055] - Update XPath query ordering chapter in jcr documents + * [EXOJCR-1067] - Reduce contention on read in NodeTypeDataHierarchyHo= lder if possible + * [EXOJCR-1070] - Remove dependency on pull-parser artifact as redunda= nt + * [EXOJCR-1071] - Move JCR framework commands list configuration to it= right place + * [EXOJCR-1072] - Publish the reference guide in docbook format + * [EXOJCR-1074] - Avoid iterating over a List thanks to its iterator w= hen it is possible [Part #2] + * [EXOJCR-1075] - JCR backupset should be fully independent + * [EXOJCR-1076] - Backup console binary distribution + * [EXOJCR-1083] - Create Group personnal folder should be after Group = creation: aplly patch + * [EXOJCR-1084] - Exclude jgroups:jgroups:jar:2.6.13.GA:compile depend= ency from org.jboss.cache:jbosscache-core:jar:3.2.6.GA:compile in JCR paren= t pom.xml + * [EXOJCR-1086] - Remove permission on child isn't used: apply patch + * [EXOJCR-1114] - Support more MIME types + * [EXOJCR-1119] - Avoid to get an item from the DB if the parent node = is new + * [EXOJCR-1120] - Changes log traversing is under optimized + * [EXOJCR-1129] - Port the documentation about the ISPN implementation= of eXo Cache + * [EXOJCR-1134] - Check in IndexerSingletonStoreCacheLoader if the chi= ldren should not be removed + * [EXOJCR-1135] - Check in DefaultChangesFilter if we use the right id= s in case of a IOException while updating the index of the parentSearchMana= ger + * [EXOJCR-1137] - Remove some unnecessary jars + * [EXOJCR-1138] - Document databases supported by eXo JCR + * [EXOJCR-1148] - Add posibility to configure additional DBCP DataSour= ces parameters in RepositoryCreationService + * [EXOJCR-1166] - Document Repository or Workspace initialization from= backup = + * [EXOJCR-1171] - Make possible to use the same GroovyClassLoader in J= crGroovyCompiler and GroovyJaxrsPublisher + * [JCR-1515] - Remove jgroup dependency from jcr-services as redundant + +Sub-task + * [EXOJCR-928] - Study the way how repository configuration can be rep= licable + * [EXOJCR-929] - Implementation + * [EXOJCR-939] - Create service to clean DB + * [EXOJCR-966] - Write the specification of the RPCService + * [EXOJCR-967] - Implement the RPCService + * [EXOJCR-1091] - Try to find way to restore value more than 2G + * [EXOJCR-1096] - Test on all supported database + * [EXOJCR-1097] - Support of restore independent of mulit-db type + * [EXOJCR-1101] - Check TestRDBMSBAckupManager + * [EXOJCR-1102] - RDBMS backup stress testing + * [EXOJCR-1106] - Profiling backup/restore method + * [EXOJCR-1110] - Dump data from system table in case of multi-db for = non system table + * [EXOJCR-1121] - HSQLDB performs commit after tables are locked + * [EXOJCR-1127] - Make workspace waiting before starting full backup j= ob + * [EXOJCR-1130] - Implement approach using the marker Backupable + * [EXOJCR-1146] - DBCleanerService should not relate on AbstractCachea= bleLockManager + * [EXOJCR-1147] - Make backup/restore to be cluster aware + * [JCR-1481] - Adding support form authentication in backup console + +Changes of 1.14.0-Beta02 +=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-882] - TestCaching fails on Windows XP SP 2 with Russian loc= ale + * [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-897] - Add registration required node types in single DB con= fg for test TestImport. + * [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-922] - MapResourceBundle.resolveDependencies() throw java.la= ng.StackOverflowError + * [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 + * [EXOJCR-954] - Can't get property of a node if it has a child node w= ith the same name with the property + * [EXOJCR-964] - User logged-out and cannot login after some inactivity + +Feature Request + * [EXOJCR-749] - Make eXo JCR rely on Apache Tika + * [EXOJCR-771] - Jetty Support + * [EXOJCR-776] - Implement the method toString for the main classes of= JCR for debugging purpose + * [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 + * [EXOJCR-942] - Reply on JBC regions to avoid having too many JBC ins= tances + * [EXOJCR-943] - Make JBC implementation of eXo Cache replies on JBC r= egions to avoid having too many JBC instances + * [EXOJCR-950] - Prevent the JobSchedulerServiceImpl to launch jobs th= at rely on non started services in JBoss AS + * [EXOJCR-951] - Make the JobSchedulerServiceImpl support multi portal= containers + +Task + * [EXOJCR-752] - Avoid to load into the memory the full content of a d= ocument while extracting the metadata and the text content + * [EXOJCR-755] - Study the extensibility of Apache Tika + * [EXOJCR-910] - Resynchronize the doc of JCR 1.12 with the trunk + * [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-957] - Remove organization nodetypes from projects where it = not used + * [EXOJCR-962] - [DOC]Make JBC implementation of eXo Cache replies on = JBC regions to avoid having too many JBC instances + +Sub-task + * [EXOJCR-892] - Remove Fake Chapters + * [EXOJCR-893] - Apply the structure of PLF + * [EXOJCR-940] - Created special method for remove workspace without c= hecking of system workspace + * [EXOJCR-941] - Create special method for remove repository without c= hecking of default-repository = + + +Changes of 1.14.0-Beta01 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Bug + * [EXOJCR-564] - Cannot use the old Hibernate org service in Gate In + * [EXOJCR-570] - AddNamespacePlugin registers namespaces after reposti= ory start + * [EXOJCR-638] - get mixin types through the NodeTypeUtil class + * [EXOJCR-662] - Processing SQLException may cause infinite loop. + * [EXOJCR-667] - Temporary spooled file can be not found on save + * [EXOJCR-698] - URL encoding in SEARCH and PROPFIND responces differs. + * [EXOJCR-699] - DAILY TESTS are going too long + * [EXOJCR-713] - org.exoplatform.services.rest.impl.RequestDispatcher = must return readable messages if resource not found or HTTP method is not a= llowed for resource + * [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-768] - A session should not be useable after a logout + * [EXOJCR-774] - If-Modified-Since doesn't seem to be well managed in = the Wevdav Component + * [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-794] - Field "CONFIG" in the table "JCR_CONFIG" is too short= on MySql + * [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-805] - Can not search user with keyword that contain special= character + * [EXOJCR-806] - Problems while copying "ftp-ftp" + * [EXOJCR-810] - TestRemoveFromValueStorage failed in configuration wi= thout ValueStorage + * [EXOJCR-812] - InitialContextBinder.bind should be thread-safe + * [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-819] - HTTPBackupAgent doesn't provide information about las= t successfully restored repositories if restore was launched in synchronous= mode + * [EXOJCR-825] - Problems with functional testing - multi, value-stora= ge is turned off + * [EXOJCR-835] - TestMultiDbJDBCConnection and TestSingleDbJDBCConnect= ion must drop also JCR_xCONTAINER table on tearDown + * [EXOJCR-837] - FUNCTIONAL testing jcr.ext - TestBackupManager in err= or + * [EXOJCR-840] - java.util.ConcurrentModificationException on org.exop= latform.services.jcr.ext.hierarchy.impl.NewUserListener.processUserStructure + * [EXOJCR-844] - JCR inside application server is not started due to m= issing component + * [EXOJCR-857] - Exception during PROPFIND request if some property co= ntent "%" and after not hex chracters + * [EXOJCR-859] - Random failed tests during building jcr + = +Feature Request + * [EXOJCR-156] - Disable deleting of the workspace which is set as sys= tem + * [EXOJCR-157] - Disable deleting of the repository which is set as de= fault + * [EXOJCR-190] - Support returning directly Collection for MediaTyp= e.APPLICATION_JSON + * [EXOJCR-230] - Refactore and move in main part of exo.ws.rest.core p= roject class AbstractResourceTest + * [EXOJCR-311] - Make broadcasting of events of ListenerService asynch= ronous + * [EXOJCR-420] - Check if the ItemReferencePool of the SessionDataMana= ger can be implemented with WeakValueHashMap instead of a WeakHashMap + * [EXOJCR-482] - Be able to load a class stored in another groovy file + * [EXOJCR-498] - Provide more details when a JCR query is invalid + * [EXOJCR-517] - filter to authenticate a signed request from gadgets + * [EXOJCR-609] - Allow to keep missing values into the JCR Cache + * [EXOJCR-626] - H2 Database support + * [EXOJCR-634] - Upload of a file with special characters like " ' " i= n filename is not supported by the FTPservice + * [EXOJCR-635] - Avoid unneccesary checks in persistence + * [EXOJCR-745] - Allow cascading imports in configuration files + * [EXOJCR-750] - JCR path management improvement + * [EXOJCR-782] - No longer force extension developers to redefine the = whole dependencies list + * [EXOJCR-786] - The method that registers plugins should be overloada= ble + * [EXOJCR-793] - Make possible to configure permissions for Groovy RES= T services when the SecurityManager is instaled + * [EXOJCR-797] - Unable see error message from ProxyService if remote = server does not provide Content-Type header. + * [EXOJCR-822] - Make implementation of MethodInvokerFilter which can = disable access to methods of RESTful services to any users except services = deployer + * [EXOJCR-823] - Make possible to provide optional attributes for REST= ful resources + * [EXOJCR-824] - Make expiring mechanism for temporary "under developm= ent" services + * [EXOJCR-864] - Add method GroovyScript2RestLoader.load with the same= signature as it is in 1.12.x + = +Patch + * [EXOJCR-772] - SharedStateLoginModule does swallow an exception duri= ng login phase + = +Task + * [EXOJCR-392] - Siblings reordering may update not all the child-item= s in cache + * [EXOJCR-542] - Improve error message concerning a missing "Query Man= ager Factory" + * [EXOJCR-618] - BufferedJBossCache Optimisation: research how to use = internal ChangeList as non-persistent cache inside opened transaction + * [EXOJCR-689] - Standartize eXo JCR docnmentation projects descriptio= n. = + * [EXOJCR-691] - Fix your missing dependencies + * [EXOJCR-746] - Remove CommunicationService + * [EXOJCR-756] - Make JCR core work properly when the Security Manager= is installed + * [EXOJCR-764] - Fix the security issue about the JCR System Session + * [EXOJCR-767] - Prevent unauthorized access to the method Conversatio= nState.setCurrent(ConverstionState state) + * [EXOJCR-770] - Prevent modification of user's identity without requi= red permissions + * [EXOJCR-775] - Rework RESTRegistryService for using current reposito= ry only. Rewove repository name from PathParam. + * [EXOJCR-777] - Prevent modifications of ConversationState's attribut= es without required permissions + * [EXOJCR-778] - Protect the main methods of a repository since they a= re critical + * [EXOJCR-779] - Provide current ConversationState for anonymous user = also. + * [EXOJCR-780] - Move org.exoplatform.services.jcr.access.SystemIdenti= ty class from exo.jcr.core exo.kernel or exo.core + * [EXOJCR-783] - Use cached table for HSLQLDB tables + * [EXOJCR-791] - SwapFile and SpoolFile tests + * [EXOJCR-807] - Port the article Groovy Scripts as REST Services + * [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-845] - Remove exo:audit* nodetypes from configuration. + = +Sub-task + * [EXOJCR-627] - Investigate use of in-memory databases for in-memory = JCR + * [EXOJCR-742] - Port Workspace Data Container articles into docbook + * [EXOJCR-757] - Training on Java Security + * [EXOJCR-758] - Implement it + * [EXOJCR-759] - Test it + * [EXOJCR-790] - OS depended paths in policy files for tests. + * [EXOJCR-798] - Cluster testing security support + * [EXOJCR-799] - MySQL & PostgreSQL tesing problem with security enabl= ed + * [EXOJCR-851] - Searching users with special characters in name does = not work properly + * [EXOJCR-862] - Check Property.getStream() method + * [EXOJCR-863] - Check VersionHistory.removeVersionLabel() & VersionHi= story.addVersionLabel() + + +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.3.0-CR4 +* eXo Core 2.4.0-CR4 +* eXo WS 2.2.0-CR4 +* eXo JCR 1.14.0-CR4 + +Find all 1.14 task on JIRA: +https://jira.jboss.org/jira/browse/EXOJCR + +1.14.0-CR4 tasks: +https://issues.jboss.org/browse/EXOJCR/fixforversion/12316288 + +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 exo.jcr.ear.ear and jcr-ds.xml into $jboss_home/server/default/= deploy + * Copy run.conf and run.conf.bato $jboss_home/bin + * 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 --===============5600464235921996289==-- From do-not-reply at jboss.org Tue Jul 19 10:20:14 2011 Content-Type: multipart/mixed; boundary="===============6521180794964000877==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4664 - jcr/trunk/applications/product-patches/as/tomcat. Date: Tue, 19 Jul 2011 10:20:13 -0400 Message-ID: <201107191420.p6JEKDs1007726@svn01.web.mwc.hst.phx2.redhat.com> --===============6521180794964000877== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 10:20:11 -0400 (Tue, 19 Jul 2011) New Revision: 4664 Modified: jcr/trunk/applications/product-patches/as/tomcat/exo-configuration.xml Log: EXOJCR-1416: add param to tomcat exo-configuration Modified: jcr/trunk/applications/product-patches/as/tomcat/exo-configuratio= n.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/applications/product-patches/as/tomcat/exo-configuration.xml = 2011-07-19 09:20:36 UTC (rev 4663) +++ jcr/trunk/applications/product-patches/as/tomcat/exo-configuration.xml = 2011-07-19 14:20:11 UTC (rev 4664) @@ -155,6 +155,22 @@ = + org.exoplatform.services.naming.InitialContextInitializer + org.exoplatform.services.naming.InitialContextInitializer + + = + overload-context-factory = + true = + + + default-properties + Default initial context properties + + + + + + org.exoplatform.services.jcr.ext.registry.RESTRegistryService<= /type> = --===============6521180794964000877==-- From do-not-reply at jboss.org Tue Jul 19 10:21:11 2011 Content-Type: multipart/mixed; boundary="===============2397286713052908286==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4665 - jcr/tags/1.14.0-CR4/applications/product-patches/as/tomcat. Date: Tue, 19 Jul 2011 10:21:11 -0400 Message-ID: <201107191421.p6JELBKJ007895@svn01.web.mwc.hst.phx2.redhat.com> --===============2397286713052908286== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 10:21:11 -0400 (Tue, 19 Jul 2011) New Revision: 4665 Modified: jcr/tags/1.14.0-CR4/applications/product-patches/as/tomcat/exo-configura= tion.xml Log: EXOJCR-1435: fix tomcat exo-configuration Modified: jcr/tags/1.14.0-CR4/applications/product-patches/as/tomcat/exo-co= nfiguration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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-CR4/applications/product-patches/as/tomcat/exo-configur= ation.xml 2011-07-19 14:20:11 UTC (rev 4664) +++ jcr/tags/1.14.0-CR4/applications/product-patches/as/tomcat/exo-configur= ation.xml 2011-07-19 14:21:11 UTC (rev 4665) @@ -155,6 +155,22 @@ = + org.exoplatform.services.naming.InitialContextInitializer + org.exoplatform.services.naming.InitialContextInitializer + + = + overload-context-factory = + true = + + + default-properties + Default initial context properties + + + + + + org.exoplatform.services.jcr.ext.registry.RESTRegistryService<= /type> = --===============2397286713052908286==-- From do-not-reply at jboss.org Tue Jul 19 10:55:35 2011 Content-Type: multipart/mixed; boundary="===============4637494703812901911==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4666 - jcr/trunk/applications/exo.jcr.applications.tomcat. Date: Tue, 19 Jul 2011 10:55:34 -0400 Message-ID: <201107191455.p6JEtYvY011365@svn01.web.mwc.hst.phx2.redhat.com> --===============4637494703812901911== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-19 10:55:34 -0400 (Tue, 19 Jul 2011) New Revision: 4666 Modified: jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml Log: EXOJCR-1447: Copy only jar-files in tomcat lib directory Modified: jcr/trunk/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/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-07-19 1= 4:21:11 UTC (rev 4665) +++ jcr/trunk/applications/exo.jcr.applications.tomcat/pom.xml 2011-07-19 1= 4:55:34 UTC (rev 4666) @@ -113,7 +113,7 @@ - + --===============4637494703812901911==-- From do-not-reply at jboss.org Wed Jul 20 02:30:28 2011 Content-Type: multipart/mixed; boundary="===============3983191874068188704==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4667 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup. Date: Wed, 20 Jul 2011 02:30:28 -0400 Message-ID: <201107200630.p6K6USes006939@svn01.web.mwc.hst.phx2.redhat.com> --===============3983191874068188704== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-20 02:30:28 -0400 (Wed, 20 Jul 2011) New Revision: 4667 Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/backup/BackupChainLog.java jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/j= cr/ext/backup/RepositoryBackupChainLog.java Log: EXOJCR-1448: Some code in jcr-ext require to be privileged Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/backup/BackupChainLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/BackupChainLog.java 2011-07-19 14:55:34 UTC (rev 4666) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/backup/BackupChainLog.java 2011-07-20 06:30:28 UTC (rev 4667) @@ -578,7 +578,34 @@ + PrivilegedFileHelper.getCanonicalPath(getBackupConf= ig().getBackupDir())); } = - IBindingFactory factory =3D BindingDirectory.getFactory(Repositor= yServiceConfiguration.class); + IBindingFactory factory; + try + { + factory =3D SecurityHelper.doPrivilegedExceptionAction(new Pri= vilegedExceptionAction() + { + public IBindingFactory run() throws Exception + { + return BindingDirectory.getFactory(RepositoryServiceConf= iguration.class); + } + }); + } + 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); + } + } + IUnmarshallingContext uctx =3D factory.createUnmarshallingContext= (); RepositoryServiceConfiguration conf =3D (RepositoryServiceConfiguration) uctx.unmarshalDocument(= PrivilegedFileHelper Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/ser= vices/jcr/ext/backup/RepositoryBackupChainLog.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/RepositoryBackupChainLog.java 2011-07-19 14:55:34 UTC (rev 4= 666) +++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/= jcr/ext/backup/RepositoryBackupChainLog.java 2011-07-20 06:30:28 UTC (rev 4= 667) @@ -357,7 +357,34 @@ + PrivilegedFileHelper.getCanonicalPath(getBackupConf= ig().getBackupDir())); } = - IBindingFactory factory =3D BindingDirectory.getFactory(Repositor= yServiceConfiguration.class); + IBindingFactory factory; + try + { + factory =3D SecurityHelper.doPrivilegedExceptionAction(new Pri= vilegedExceptionAction() + { + public IBindingFactory run() throws Exception + { + return BindingDirectory.getFactory(RepositoryServiceConf= iguration.class); + } + }); + } + 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); + } + } + IUnmarshallingContext uctx =3D factory.createUnmarshallingContext= (); RepositoryServiceConfiguration conf =3D (RepositoryServiceConfiguration) uctx.unmarshalDocument(= PrivilegedFileHelper --===============3983191874068188704==-- From do-not-reply at jboss.org Wed Jul 20 03:47:31 2011 Content-Type: multipart/mixed; boundary="===============6906907754584628416==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4668 - kernel/trunk. Date: Wed, 20 Jul 2011 03:47:31 -0400 Message-ID: <201107200747.p6K7lVTQ020165@svn01.web.mwc.hst.phx2.redhat.com> --===============6906907754584628416== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-20 03:47:31 -0400 (Wed, 20 Jul 2011) New Revision: 4668 Modified: kernel/trunk/pom.xml Log: EXOJCR-1449: Exclude dependencies of the eu.medsea.mimeutil artifact Modified: kernel/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/pom.xml 2011-07-20 06:30:28 UTC (rev 4667) +++ kernel/trunk/pom.xml 2011-07-20 07:47:31 UTC (rev 4668) @@ -146,6 +146,16 @@ eu.medsea.mimeutil mime-util 2.1.3 + + + org.slf4j + slf4j-log4j12 + + + log4j + log4j + + = org.quartz-scheduler --===============6906907754584628416==-- From do-not-reply at jboss.org Wed Jul 20 05:57:28 2011 Content-Type: multipart/mixed; boundary="===============3168920600276881366==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4669 - jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/repository. Date: Wed, 20 Jul 2011 05:57:28 -0400 Message-ID: <201107200957.p6K9vSmx013064@svn01.web.mwc.hst.phx2.redhat.com> --===============3168920600276881366== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2011-07-20 05:57:28 -0400 (Wed, 20 Jul 2011) New Revision: 4669 Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/j= cr/ext/repository/RestRepositoryServiceTest.java Log: EXOJCR-1443: tests - escape symbols in workspase name fixed. Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/ser= vices/jcr/ext/repository/RestRepositoryServiceTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/repository/RestRepositoryServiceTest.java 2011-07-20 07:47:31 UTC (= rev 4668) +++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/= jcr/ext/repository/RestRepositoryServiceTest.java 2011-07-20 09:57:28 UTC (= rev 4669) @@ -357,7 +357,7 @@ public void testRemoveRepository() throws Exception { ManageableRepository repository =3D helper.createRepository(containe= r, true, null); - = + String wsName =3D repository.getConfiguration().getSystemWorkspaceNa= me(); String repoName =3D repository.getConfiguration().getName(); = @@ -439,7 +439,7 @@ = // Indexer ArrayList qParams =3D new ArrayList(); - qParams.add(new SimpleParameterEntry("indexDir", "target" + File.sep= arator + wsName)); + qParams.add(new SimpleParameterEntry("indexDir", "target" + File.sep= arator + skipInvalidCharacters(wsName))); QueryHandlerEntry qEntry =3D new QueryHandlerEntry(defWEntry.getQuer= yHandler().getType(), qParams); = ws1back.setQueryHandler(qEntry); @@ -453,7 +453,7 @@ if (newp.getName().equals("source-name")) newp.setValue(sourceName); else if (newp.getName().equals("swap-directory")) - newp.setValue("target/temp/swap/" + wsName); + newp.setValue("target/temp/swap/" + skipInvalidCharacters(wsNa= me)); else if (newp.getName().equals("multi-db")) newp.setValue(Boolean.toString(multiDb)); = @@ -465,4 +465,17 @@ = return ws1back; } + + private String skipInvalidCharacters(String s) + { + if (File.separator.equals("\\")) + { + return s.replaceAll("[:,?]", "_"); + } + else + { + return s; + } + + } } --===============3168920600276881366==-- From do-not-reply at jboss.org Thu Jul 21 05:39:19 2011 Content-Type: multipart/mixed; boundary="===============4038182292193872057==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4670 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow and 1 other directories. Date: Thu, 21 Jul 2011 05:39:19 -0400 Message-ID: <201107210939.p6L9dJM8008427@svn01.web.mwc.hst.phx2.redhat.com> --===============4038182292193872057== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-21 05:39:19 -0400 (Thu, 21 Jul 2011) New Revision: 4670 Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/api/writing/AbstractSameNameSiblingsMoveTest.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/api/writing/TestSameNameSiblingsSessionMove.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/api/writing/TestSameNameSiblingsWorkspaceMove.java Removed: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/api/writing/TestSameNameSiblingsMove.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/WorkspaceImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/ItemDataMoveVisitor.java Log: EXOJCR-1370 : fixed SNS move issue. Also ItemReferensePool issue fixed, tha= t may cause some perf decrease, since ItemReferencePool was not updated bef= ore. = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-20 09:57:28 UTC (rev 4669) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-21 09:39:19 UTC (rev 4670) @@ -1006,7 +1006,8 @@ public int getLastOrderNumber(NodeData parent) throws RepositoryExcepti= on { int lastOrderNumber =3D changesLog.getLastChildOrderNumber(parent.ge= tIdentifier()); - int lastPersistedNodeOrderNumber =3D isNew(parent.getIdentifier()) ?= -1 : transactionableManager.getLastOrderNumber(parent); + int lastPersistedNodeOrderNumber =3D + isNew(parent.getIdentifier()) ? -1 : transactionableManager.getLa= stOrderNumber(parent); = return Math.max(lastPersistedNodeOrderNumber, lastOrderNumber); } @@ -1017,7 +1018,8 @@ public int getChildNodesCount(NodeData parent) throws RepositoryExcepti= on { int childsCount =3D - changesLog.getChildNodesCount(parent.getIdentifier()) + (isNew(pa= rent.getIdentifier()) ? 0 : transactionableManager.getChildNodesCount(paren= t)); + changesLog.getChildNodesCount(parent.getIdentifier()) + + (isNew(parent.getIdentifier()) ? 0 : transactionableManager.= getChildNodesCount(parent)); if (childsCount < 0) { throw new InvalidItemStateException("Node's child nodes were chan= ged in another Session " @@ -1219,6 +1221,8 @@ } } = + // TODO: review. Won't work if renamed states for descendants are not f= ired + // Node will be only updated with the same NodeData with same outdated = path void reloadPool(ItemData fromItem) throws RepositoryException { Collection pooledItems =3D itemsPool.getAll(); @@ -1267,7 +1271,18 @@ = changesLog.addAll(initializer.getAllStates()); = - reloadPool(srcData); + // reload items pool + for (ItemState state : initializer.getItemAddStates()) + { + if (state.isUpdated() || state.isRenamed()) + { + ItemImpl item =3D reloadItem(state.getData()); + if (item !=3D null) + { + invalidated.add(item); + } + } + } } = /** @@ -1305,8 +1320,8 @@ if (itemData.isNode()) { checkRemoveChildVersionStorages =3D - !session.getWorkspace().getNodeTypesHolder() - .isNodeType(Constants.NT_VERSIONHISTORY, ((NodeData)itemDat= a).getPrimaryTypeName()); + !session.getWorkspace().getNodeTypesHolder().isNodeType(Consta= nts.NT_VERSIONHISTORY, + ((NodeData)itemData).getPrimaryTypeName()); } = boolean rootAdded =3D false; @@ -1450,7 +1465,7 @@ // We can't remove this VH now. return; } // else -- if we has a references in workspace where the = VH is being - // deleted we can remove VH now. + // deleted we can remove VH now. } } finally @@ -1875,8 +1890,8 @@ { = Collection mandatoryItemDefs =3D - session.getWorkspace().getNodeTypesHolder() - .getManadatoryItemDefs(nData.getPrimaryTypeName(), nData.getMi= xinTypeNames()); + session.getWorkspace().getNodeTypesHolder().getManadatoryItemDefs= (nData.getPrimaryTypeName(), + nData.getMixinTypeNames()); for (ItemDefinitionData itemDefinitionData : mandatoryItemDefs) { if (getItemData(nData, new QPathEntry(itemDefinitionData.getName(= ), 0), ItemType.UNKNOWN) =3D=3D null) @@ -1995,8 +2010,8 @@ { QPathEntry[] path =3D pooled.getData().getQPath().get= Entries(); persisted =3D - transactionableManager.getItemData(parent, path[pa= th.length - 1], - ItemType.getItemType(pooled.getData())); + transactionableManager.getItemData(parent, path[pa= th.length - 1], ItemType.getItemType(pooled + .getData())); } // else, the item has an invalid state, will be throwe= d on save } if (persisted !=3D null) @@ -2320,7 +2335,7 @@ List childProps =3D listOnly ? dataManager.listChildPropertiesData((NodeData)pa= rent) : dataManager .getChildPropertiesData((NodeData)parent); - outer : for (int i =3D 0, length =3D childProps.size(); i < le= ngth; i++) = + outer : for (int i =3D 0, length =3D childProps.size(); i < le= ngth; i++) { PropertyData childProp =3D childProps.get(i); for (ItemState transientState : transientDescendants) 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 2011-07-20 09:57:28 UTC (rev 4669) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionImpl.java 2011-07-21 09:39:19 UTC (rev 4670) @@ -123,7 +123,7 @@ { log.info("The JCR will throw an exception anytime we will try to = use a dead session."); } - } = + } = public static final int DEFAULT_LAZY_READ_THRESHOLD =3D 100; = @@ -152,9 +152,9 @@ protected final String workspaceName; = private boolean live; - = + private boolean expired; - = + private Exception closedByCallStack; = private final List lifecycleListeners; @@ -179,7 +179,7 @@ * Transaction resources manager. */ private final TransactionableResourceManager txResourceManager; - = + /** * The local timeout of the session, by default it will use the global = timeout defined at repository configuration level */ @@ -193,7 +193,8 @@ this.live =3D true; this.id =3D IdGenerator.generate(); this.userState =3D userState; - this.txResourceManager =3D (TransactionableResourceManager)container= .getComponentInstanceOfType(TransactionableResourceManager.class); + this.txResourceManager =3D + (TransactionableResourceManager)container.getComponentInstanceOfT= ype(TransactionableResourceManager.class); = this.repository =3D (RepositoryImpl)container.getComponentInstanceOf= Type(RepositoryImpl.class); this.systemLocationFactory =3D (LocationFactory)container.getCompone= ntInstanceOfType(LocationFactory.class); @@ -915,14 +916,15 @@ { if (PROHIBIT_CLOSED_SESSION_USAGE) { - throw new RepositoryException("This kind of operation is forbi= dden after a session.logout().", closedByCallStack); + throw new RepositoryException("This kind of operation is forbi= dden after a session.logout().", + closedByCallStack); } // warn in debug mode only else if (PropertyManager.isDevelopping()) { log.warn("This kind of operation is forbidden after a session.= logout(), " - + "please note that an exception will be raised in th= e next jcr version.", new Exception( - closedByCallStack)); + + "please note that an exception will be raised in the next= jcr version.", new Exception( + closedByCallStack)); } } } @@ -971,7 +973,7 @@ this.expired =3D true; logout(); } - = + /** * {@inheritDoc} */ @@ -1012,9 +1014,18 @@ throw new ItemExistsException("A node with this name (" + dest= AbsPath + ") is already exists. "); } } - + NodeImpl srcParentNode =3D null; + if (destParentNode.getIdentifier().equals(srcNode.getParentIdentifie= r())) + { + // move to same parent + srcParentNode =3D destParentNode; + } + else + { + srcParentNode =3D srcNode.parent(); + } // Check if versionable ancestor is not checked-in - if (!srcNode.parent().checkedOut()) + if (!srcParentNode.checkedOut()) { throw new VersionException("Parent or source Node or its nearest = ancestor is checked-in"); } @@ -1026,8 +1037,8 @@ = ItemDataMoveVisitor initializer =3D new ItemDataMoveVisitor((NodeData)destParentNode.getData(), destN= odePath.getName().getInternalName(), - nodeTypeManager, getTransientNodesManager(), true, triggerEven= tsForDescendentsOnRename - || !srcNodePath.makeParentPath().equals(destNodePath.makePa= rentPath())); + (NodeData)srcParentNode.getData(), nodeTypeManager, getTransie= ntNodesManager(), true, + triggerEventsForDescendentsOnRename || srcParentNode !=3D dest= ParentNode); = getTransientNodesManager().rename((NodeData)srcNode.getData(), initi= alizer); } @@ -1154,7 +1165,7 @@ { this.timeout =3D (timeout <=3D 0 ? 0 : timeout); } - = + /** * {@inheritDoc} */ Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/WorkspaceImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/WorkspaceImpl.java 2011-07-20 09:57:28 UTC (rev 4669) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/WorkspaceImpl.java 2011-07-21 09:39:19 UTC (rev 4670) @@ -439,9 +439,18 @@ throw new ItemExistsException(msg); } } - + NodeImpl srcParentNode =3D null; + if (destParentNode.getIdentifier().equals(srcNode.getParentIdentifie= r())) + { + // move to same parent + srcParentNode =3D destParentNode; + } + else + { + srcParentNode =3D srcNode.parent(); + } // Check if versionable ancestor is not checked-in - if (!srcNode.checkedOut()) + if (!srcParentNode.checkedOut()) { throw new VersionException("Source parent node " + srcNode.getPat= h() + " or its nearest ancestor is checked-in"); @@ -454,12 +463,21 @@ = ItemDataMoveVisitor initializer =3D new ItemDataMoveVisitor((NodeData)destParentNode.getData(), destN= odePath.getName().getInternalName(), - nodeTypeManager, session.getTransientNodesManager(), true); + (NodeData)srcParentNode.getData(), nodeTypeManager, session.ge= tTransientNodesManager(), true); srcNode.getData().accept(initializer); = PlainChangesLog changes =3D new PlainChangesLogImpl(session.getId()); changes.addAll(initializer.getAllStates()); = + // reload items pool + for (ItemState state : initializer.getItemAddStates()) + { + if (state.isUpdated() || state.isRenamed()) + { + (session.getTransientNodesManager()).reloadItem(state.getData(= )); + } + } + session.getTransientNodesManager().getTransactManager().save(changes= ); } = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/ItemDataMoveVisitor.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ItemDataMoveVisitor.java 2011-07-20 09:57:28 UTC (rev 46= 69) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/ItemDataMoveVisitor.java 2011-07-21 09:39:19 UTC (rev 46= 70) @@ -27,6 +27,7 @@ import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPath; +import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.datamodel.ValueData; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.core.SessionDataManager; @@ -65,6 +66,11 @@ protected Stack parents; = /** + * Contains instance of source parent + */ + protected NodeData srcParent; + + /** * The list of added item states */ protected List addStates =3D new ArrayList(); @@ -103,8 +109,9 @@ * @param triggerEventsForDescendents = * - Trigger events for descendents. = */ - public ItemDataMoveVisitor(NodeData parent, InternalQName dstNodeName, = NodeTypeDataManager nodeTypeManager, - SessionDataManager srcDataManager, boolean keepIdentifiers, boolean = triggerEventsForDescendents) + public ItemDataMoveVisitor(NodeData parent, InternalQName dstNodeName, = NodeData srcParent, + NodeTypeDataManager nodeTypeManager, SessionDataManager srcDataManag= er, boolean keepIdentifiers, + boolean triggerEventsForDescendents) { super(srcDataManager, triggerEventsForDescendents ? INFINITE_DEPTH := 0); this.keepIdentifiers =3D keepIdentifiers; @@ -113,6 +120,7 @@ = this.parents =3D new Stack(); this.parents.add(parent); + this.srcParent =3D srcParent; this.triggerEventsForDescendents =3D triggerEventsForDescendents; } = @@ -127,10 +135,10 @@ * @param skipEventsForDescendents - Don't generate events for the = * descendants. = */ - public ItemDataMoveVisitor(NodeData parent, InternalQName dstNodeName, = NodeTypeDataManager nodeTypeManager, - SessionDataManager srcDataManager, boolean keepIdentifiers) + public ItemDataMoveVisitor(NodeData parent, InternalQName dstNodeName, = NodeData srcParent, + NodeTypeDataManager nodeTypeManager, SessionDataManager srcDataManag= er, boolean keepIdentifiers) { - this(parent, dstNodeName, nodeTypeManager, srcDataManager, keepIdent= ifiers, true); + this(parent, dstNodeName, srcParent, nodeTypeManager, srcDataManager= , keepIdentifiers, true); } = @Override @@ -142,7 +150,7 @@ ancestorToSave =3D QPath.getCommonAncestorPath(curParent().getQPa= th(), node.getQPath()); } = - NodeData parent =3D curParent(); + NodeData destParent =3D curParent(); = int destIndex; // index for path int destOrderNum; // order number @@ -152,9 +160,8 @@ { qname =3D destNodeName; = - List destChilds =3D dataManager.getChildNodesData(paren= t); + List destChilds =3D dataManager.getChildNodesData(destP= arent); List srcChilds; - NodeData srcParent; = destIndex =3D 1; = @@ -164,31 +171,23 @@ // node list. destOrderNum =3D destChilds.size() > 0 ? destChilds.get(destChild= s.size() - 1).getOrderNumber() + 1 : 0; = - if (parent.getIdentifier().equals(node.getParentIdentifier())) + if (destParent =3D=3D srcParent)// (destParent.getIdentifier().eq= uals(node.getParentIdentifier())) { // move to same parent srcChilds =3D destChilds; - srcParent =3D parent; } else { // move to another parent + srcChilds =3D dataManager.getChildNodesData(srcParent); // find index on destination for (NodeData dchild : destChilds) { - if (dchild.getQPath().getName().equals(qname)) + if (dchild.getQPath().getName().equals(destNodeName)) + { destIndex++; + } } - - // for fix SNSes on source - srcParent =3D (NodeData)dataManager.getItemData(node.getParent= Identifier()); - if (srcParent =3D=3D null) - { - throw new RepositoryException("FATAL: parent Node not for "= + node.getQPath().getAsString() - + ", parent id: " + node.getParentIdentifier()); - } - - srcChilds =3D dataManager.getChildNodesData(srcParent); } = int srcIndex =3D 1; @@ -199,26 +198,23 @@ NodeData child =3D srcChilds.get(i); if (!child.getIdentifier().equals(node.getIdentifier())) { - if (child.getQPath().getName().equals(qname)) + if ((child.getQPath().getName()).getAsString().equals((node= .getQPath().getName()).getAsString())) { QPath siblingPath =3D QPath.makeChildPath(srcParent.getQ= Path(), child.getQPath().getName(), srcIndex); TransientNodeData sibling =3D - new TransientNodeData(siblingPath, child.getIdentifie= r(), child.getPersistedVersion() + 1, - child.getPrimaryTypeName(), child.getMixinTypeName= s(), child.getOrderNumber(), - child.getParentIdentifier(), child.getACL()); - + new TransientNodeData(siblingPath, child.getIdentifie= r(), child.getPersistedVersion() + 1, child + .getPrimaryTypeName(), child.getMixinTypeNames(), = child.getOrderNumber(), child + .getParentIdentifier(), child.getACL()); addStates.add(new ItemState(sibling, ItemState.UPDATED, = true, ancestorToSave, false, true)); - srcIndex++; } + // find index on destination in case when destination the s= ame as source + if (srcChilds =3D=3D destChilds && (child.getQPath().getNam= e().equals(destNodeName))) + { + destIndex++; + } } } - - // in case of moving to the same parent destination index is calc= ulated above - if (srcChilds =3D=3D destChilds) - { - destIndex =3D srcIndex; - } } else { @@ -229,9 +225,9 @@ = String id =3D keepIdentifiers ? node.getIdentifier() : IdGenerator.g= enerate(); = - QPath qpath =3D QPath.makeChildPath(parent.getQPath(), qname, destIn= dex); + QPath qpath =3D QPath.makeChildPath(destParent.getQPath(), qname, de= stIndex); = - AccessControlList acl =3D parent.getACL(); + AccessControlList acl =3D destParent.getACL(); = boolean isPrivilegeable =3D ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, node.getPrimary= TypeName(), node.getMixinTypeNames()); @@ -242,16 +238,16 @@ if (isPrivilegeable || isOwneable) { List permissionEntries =3D new ArrayList(); - permissionEntries.addAll((isPrivilegeable ? node.getACL() : paren= t.getACL()).getPermissionEntries()); + permissionEntries.addAll((isPrivilegeable ? node.getACL() : destP= arent.getACL()).getPermissionEntries()); = - String owner =3D isOwneable ? node.getACL().getOwner() : parent.g= etACL().getOwner(); + String owner =3D isOwneable ? node.getACL().getOwner() : destPare= nt.getACL().getOwner(); = acl =3D new AccessControlList(owner, permissionEntries); } = TransientNodeData newNode =3D new TransientNodeData(qpath, id, -1, node.getPrimaryTypeName(), n= ode.getMixinTypeNames(), destOrderNum, - parent.getIdentifier(), acl); + destParent.getIdentifier(), acl); = parents.push(newNode); = Copied: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/serv= ices/jcr/api/writing/AbstractSameNameSiblingsMoveTest.java (from rev 4639, = jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr= /api/writing/TestSameNameSiblingsMove.java) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/writing/AbstractSameNameSiblingsMoveTest.java = (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/writing/AbstractSameNameSiblingsMoveTest.java 2011-07-21 09:39:19 = UTC (rev 4670) @@ -0,0 +1,453 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.api.writing; + +import org.exoplatform.services.jcr.JcrAPIBaseTest; + +import javax.jcr.ItemExistsException; +import javax.jcr.LoginException; +import javax.jcr.NoSuchWorkspaceException; +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.lock.LockException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.version.VersionException; + +/** + * Created by The eXo Platform SAS. + * = + * Date: 31.03.2008 + * = + * @author Peter N= edonosko + * @version $Id: TestSameNameSiblingsMove.java 12992 2008-04-09 14:52:34Z = pnedonosko $ + */ +public abstract class AbstractSameNameSiblingsMoveTest extends JcrAPIBaseT= est +{ + + private Node testRoot; + + /** + * Abstract SNS move test + * = + * @param srcAbsPath + * @param destAbsPath + */ + abstract void move(Node testRoot, String srcAbsPath, String destAbsPath= ) throws ItemExistsException, + PathNotFoundException, VersionException, ConstraintViolationExceptio= n, LockException, RepositoryException; + + @Override + public void setUp() throws Exception + { + super.setUp(); + + testRoot =3D root.addNode("snsMoveTest"); + root.save(); + } + + @Override + protected void tearDown() throws Exception + { + root.refresh(false); + testRoot.remove(); + root.save(); + + super.tearDown(); + } + + /** + * Move node[1] to node[3], node[3] reordered to node[2], node[2] to no= de[1]. + * = + * @throws LoginException + * @throws NoSuchWorkspaceException + * @throws RepositoryException + */ + public void testMoveSameParentSameNameFirst() throws LoginException, No= SuchWorkspaceException, RepositoryException + { + + final Node testRootS1 =3D testRoot; + testRootS1.addMixin("exo:owneable"); + testRootS1.addMixin("exo:privilegeable"); + testRootS1.save(); + + Node nS1_1 =3D testRootS1.addNode("node"); // node[1] + testRootS1.save(); + nS1_1.addMixin("mix:referenceable"); + nS1_1.addMixin("exo:owneable"); + // nS1_1.setProperty("exo:owner", "root"); + String s1_1_id =3D nS1_1.getUUID(); + testRootS1.save(); + + Node nS1_2 =3D testRootS1.addNode("node"); // node[2] + Node nS1_3 =3D testRootS1.addNode("node"); // node[3] + + testRootS1.save(); + + try + { + // move node[1] to node[3], node[3] reordered to node[2], node[2]= to node[1] + move(testRootS1, testRootS1.getPath() + "/node", testRootS1.getPa= th() + "/node"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + fail("RepositoryException should not have been thrown, but " + e); + } + + int index =3D 0; + for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext();) + { + index++; + Node n =3D iter.nextNode(); + // log.info("Node: " + n.getPath()); + assertEquals("Wrong index found ", index, n.getIndex()); + } + + // check pool updated + assertEquals(1, nS1_2.getIndex()); + assertEquals(2, nS1_3.getIndex()); + assertEquals(3, nS1_1.getIndex()); + // check reordering + assertEquals("Wrong node UUID found ", s1_1_id, testRootS1.getNode("= node[3]").getUUID()); + } + + /** + * Move node[2] to node[3], node[3] reordered to node[2]. + * = + * @throws LoginException + * @throws NoSuchWorkspaceException + * @throws RepositoryException + */ + public void testMoveSameParentSameNameMiddle() throws LoginException, N= oSuchWorkspaceException, RepositoryException + { + + final Node testRootS1 =3D testRoot; + + Node nS1_1 =3D testRootS1.addNode("node"); // node[1] + testRootS1.save(); + nS1_1.addMixin("mix:referenceable"); + String s1_1_id =3D nS1_1.getUUID(); + testRootS1.save(); + + Node nS1_2 =3D testRootS1.addNode("node"); // node[2] + Node nS1_3 =3D testRootS1.addNode("node"); // node[3] + testRootS1.save(); + + // test + try + { + // move node[2] to node[3], node[3] reordered to node[2] + move(testRootS1, testRootS1.getPath() + "/node[2]", testRootS1.ge= tPath() + "/node"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + fail("RepositoryException should not have been thrown, but " + e); + } + + int index =3D 0; + for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext();) + { + index++; + Node n =3D iter.nextNode(); + // log.info("Node: " + n.getPath()); + assertEquals("Wrong index found ", index, n.getIndex()); + } + + // check pool updated + assertEquals(1, nS1_1.getIndex()); + assertEquals(2, nS1_3.getIndex()); + assertEquals(3, nS1_2.getIndex()); + + // check reordering + assertEquals("Wrong node UUID found ", s1_1_id, testRootS1.getNode("= node").getUUID()); + } + + /** + * Move SNS node to itself, move node[3] to node[3]. + * = + * @throws LoginException + * @throws NoSuchWorkspaceException + * @throws RepositoryException + */ + public void testMoveSameParentSameNameLast() throws LoginException, NoS= uchWorkspaceException, RepositoryException + { + + final Node testRootS1 =3D testRoot; + + Node nS1_1 =3D testRootS1.addNode("node"); // node[1] + testRootS1.save(); + nS1_1.addMixin("mix:referenceable"); + String s1_1_id =3D nS1_1.getUUID(); + testRootS1.save(); + + Node nS1_2 =3D testRootS1.addNode("node"); // node[2] + Node nS1_3 =3D testRootS1.addNode("node"); // node[3] + testRootS1.save(); + + // test + try + { + // move to itself, move node[3] to node[3] + move(testRootS1, testRootS1.getPath() + "/node[3]", testRootS1.ge= tPath() + "/node"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + fail("RepositoryException should not have been thrown, but " + e); + } + + int index =3D 0; + for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext();) + { + index++; + Node n =3D iter.nextNode(); + // log.info("Node: " + n.getPath()); + assertEquals("Wrong index found ", index, n.getIndex()); + } + + // check pool updated + assertEquals(1, nS1_1.getIndex()); + assertEquals(2, nS1_2.getIndex()); + assertEquals(3, nS1_3.getIndex()); + + // check reordering + assertEquals("Wrong node UUID found ", s1_1_id, testRootS1.getNode("= node").getUUID()); + } + + /** + * Move node[1] to node-new[1], node[1,3] reordered to node[1,2]. + * = + * @throws LoginException + * @throws NoSuchWorkspaceException + * @throws RepositoryException + */ + public void testMoveSameParentDifferentName() throws LoginException, No= SuchWorkspaceException, RepositoryException + { + + final Node testRootS1 =3D testRoot; + + Node nS1_1 =3D testRootS1.addNode("node"); // node[1] + testRootS1.save(); + + Node nS1_2 =3D testRootS1.addNode("node"); // node[2] + Node nS1_3 =3D testRootS1.addNode("node"); // node[3] + testRootS1.save(); + + // test + try + { + // move node[2] to node[3], node[3] reordered to node[2] + move(testRootS1, testRootS1.getPath() + "/node[1]", testRootS1.ge= tPath() + "/node-new"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + fail("RepositoryException should not have been thrown, but " + e); + } + + // check pool updated + assertEquals(1, nS1_2.getIndex()); + assertEquals(2, nS1_3.getIndex()); + + assertEquals(2, testRootS1.getNodes("node").getSize()); + } + + /** + * Move node[1] to node-existing[2], node[1,3] reordered to node[1,2]. + * = + * @throws LoginException + * @throws NoSuchWorkspaceException + * @throws RepositoryException + */ + public void testMoveSameParentDifferentExistingName() throws LoginExcep= tion, NoSuchWorkspaceException, + RepositoryException + { + + final Node testRootS1 =3D testRoot; + + Node nS1_1 =3D testRootS1.addNode("node"); // node[1] + testRootS1.save(); + + Node nS1_2 =3D testRootS1.addNode("node"); // node[2] + Node nS1_3 =3D testRootS1.addNode("node"); // node[3] + + Node nExisting =3D testRootS1.addNode("node-existing"); // node-exis= ting + testRootS1.save(); + + // test + try + { + // move node[2] to node[3], node[3] reordered to node[2] + move(testRootS1, testRootS1.getPath() + "/node[1]", testRootS1.ge= tPath() + "/node-existing"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + fail("RepositoryException should not have been thrown, but " + e); + } + + // check pool updated + assertEquals(1, nS1_2.getIndex()); + assertEquals(2, nS1_3.getIndex()); + + assertEquals(1, nExisting.getIndex()); + assertEquals(2, nS1_1.getIndex()); + + assertEquals(2, testRootS1.getNodes("node").getSize()); + assertEquals(2, testRootS1.getNodes("node-existing").getSize()); + } + + /** + * Move SNS node to different location with SNS too, move /snsMoveTest/= node1/node[2] to /snsMoveTest/node2/node[3]. + * = + * @throws LoginException + * @throws NoSuchWorkspaceException + * @throws RepositoryException + */ + public void testMoveAnotherParentSameExsintingName() throws LoginExcept= ion, NoSuchWorkspaceException, + RepositoryException + { + + final Node testRootS1 =3D testRoot; + final Node testNode1 =3D testRootS1.addNode("node1"); + final Node testNode2 =3D testRootS1.addNode("node1"); + testRootS1.save(); + + Node n1_1 =3D testNode1.addNode("node"); // node[1] + Node n1_2 =3D testNode1.addNode("node"); // node[2] + testNode1.save(); + n1_2.addMixin("mix:referenceable"); + String n1_2_id =3D n1_2.getUUID(); + testNode1.save(); + + Node n1_3 =3D testNode1.addNode("node"); // node[3] + Node n1_4 =3D testNode1.addNode("node"); // node[4] + testNode1.save(); + + Node n2_1 =3D testNode2.addNode("node"); // node[1] + Node n2_2 =3D testNode2.addNode("node"); // node[2] + testNode2.save(); + + // test + try + { + // move /snsMoveTest/node1/node[2] to /snsMoveTest/node2/node[3] + move(testNode1, testNode1.getPath() + "/node[2]", testNode2.getPa= th() + "/node"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + fail("RepositoryException should not have been thrown, but " + e); + } + + int index =3D 0; + for (NodeIterator iter =3D testNode1.getNodes(); iter.hasNext();) + { + index++; + Node n =3D iter.nextNode(); + assertEquals("Wrong index found ", index, n.getIndex()); + } + + index =3D 0; + for (NodeIterator iter =3D testNode2.getNodes(); iter.hasNext();) + { + index++; + Node n =3D iter.nextNode(); + assertEquals("Wrong index found ", index, n.getIndex()); + } + + // check pool updated + assertEquals(1, n1_1.getIndex()); + assertEquals(2, n1_3.getIndex()); + + assertEquals(1, n2_1.getIndex()); + assertEquals(2, n2_2.getIndex()); + assertEquals(3, n1_2.getIndex()); + + // check reordering + assertEquals("Wrong node UUID found ", n1_2_id, testNode2.getNode("n= ode[3]").getUUID()); + } + + /** + * Move SNS node to different location with SNS too, move /snsMoveTest/= node1/node[2] to /snsMoveTest/node2/node-new. + * = + * @throws LoginException + * @throws NoSuchWorkspaceException + * @throws RepositoryException + */ + public void testMoveAnotherParentDifferentName() throws LoginException,= NoSuchWorkspaceException, + RepositoryException + { + + final Node testRootS1 =3D testRoot; + final Node testNode1 =3D testRootS1.addNode("node1"); + final Node testNode2 =3D testRootS1.addNode("node1"); + testRootS1.save(); + + Node n1_1 =3D testNode1.addNode("node"); // node[1] + Node n1_2 =3D testNode1.addNode("node"); // node[2] + testNode1.save(); + n1_2.addMixin("mix:referenceable"); + String n1_2_id =3D n1_2.getUUID(); + testNode1.save(); + + Node n1_3 =3D testNode1.addNode("node"); // node[3] + Node n1_4 =3D testNode1.addNode("node"); // node[4] + testNode1.save(); + + Node n2_1 =3D testNode2.addNode("node"); // node[1] + Node n2_2 =3D testNode2.addNode("node"); // node[2] + testNode2.save(); + + // test + try + { + // move /snsMoveTest/node1/node[2] to /snsMoveTest/node2/node-new + move(testNode1, testNode1.getPath() + "/node[2]", testNode2.getPa= th() + "/node-new"); + } + catch (RepositoryException e) + { + e.printStackTrace(); + fail("RepositoryException should not have been thrown, but " + e); + } + + int index =3D 0; + for (NodeIterator iter =3D testNode1.getNodes(); iter.hasNext();) + { + index++; + Node n =3D iter.nextNode(); + assertEquals("Wrong index found ", index, n.getIndex()); + } + + assertEquals(3, testNode1.getNodes("node").getSize()); + assertEquals(2, testNode2.getNodes("node").getSize()); + + // check pool updated + assertEquals(1, n1_1.getIndex()); + assertEquals(2, n1_3.getIndex()); + + assertEquals(1, n2_1.getIndex()); + assertEquals(2, n2_2.getIndex()); + + // check reordering + assertEquals("Wrong node UUID found ", n1_2_id, testNode2.getNode("n= ode-new").getUUID()); + } +} Deleted: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/ser= vices/jcr/api/writing/TestSameNameSiblingsMove.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/writing/TestSameNameSiblingsMove.java 2011-07-20 09:57:28 UTC (rev= 4669) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/writing/TestSameNameSiblingsMove.java 2011-07-21 09:39:19 UTC (rev= 4670) @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2009 eXo Platform SAS. - * - * This is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this software; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ -package org.exoplatform.services.jcr.api.writing; - -import org.exoplatform.services.jcr.JcrAPIBaseTest; - -import javax.jcr.LoginException; -import javax.jcr.NoSuchWorkspaceException; -import javax.jcr.Node; -import javax.jcr.NodeIterator; -import javax.jcr.RepositoryException; - -/** - * Created by The eXo Platform SAS. - * = - * Date: 31.03.2008 - * = - * @author Peter N= edonosko - * @version $Id: TestSameNameSiblingsMove.java 12992 2008-04-09 14:52:34Z = pnedonosko $ - */ -public class TestSameNameSiblingsMove extends JcrAPIBaseTest -{ - - private Node testRoot; - - @Override - public void setUp() throws Exception - { - super.setUp(); - - testRoot =3D root.addNode("snsMoveTest"); - root.save(); - } - - @Override - protected void tearDown() throws Exception - { - root.refresh(false); - testRoot.remove(); - root.save(); - - super.tearDown(); - } - - /** - * Move node[1] to node[3], node[3] reordered to node[2], node[2] to no= de[1]. - * = - * @throws LoginException - * @throws NoSuchWorkspaceException - * @throws RepositoryException - */ - public void testMoveFirst() throws LoginException, NoSuchWorkspaceExcep= tion, RepositoryException - { - - final Node testRootS1 =3D testRoot; - testRootS1.addMixin("exo:owneable"); - testRootS1.addMixin("exo:privilegeable"); - testRootS1.save(); - - Node nS1_1 =3D testRootS1.addNode("node"); // node[1] - testRootS1.save(); - nS1_1.addMixin("mix:referenceable"); - nS1_1.addMixin("exo:owneable"); - // nS1_1.setProperty("exo:owner", "root"); - String s1_1_id =3D nS1_1.getUUID(); - testRootS1.save(); - - Node nS1_2 =3D testRootS1.addNode("node"); // node[2] - Node nS1_3 =3D testRootS1.addNode("node"); // node[3] - - testRootS1.save(); - - // test - // for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext();= ) { - // Node n =3D iter.nextNode(); - // log.info("Node: " + n.getPath() + " " + ((NodeImpl)n).getInternal= Identifier()); - // } - try - { - // move node[1] to node[3], node[3] reordered to node[2], node[2]= to node[1] - testRootS1.getSession().move(testRootS1.getPath() + "/node", test= RootS1.getPath() + "/node"); - // for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext= ();) { - // Node n =3D iter.nextNode(); - // log.info("Node: " + n.getPath() + " " + ((NodeImpl)n).getInter= nalIdentifier()); - // } - testRootS1.save(); // save - - } - catch (RepositoryException e) - { - e.printStackTrace(); - fail("RepositoryException should not have been thrown, but " + e); - } - - int index =3D 0; - for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext();) - { - index++; - Node n =3D iter.nextNode(); - // log.info("Node: " + n.getPath()); - assertEquals("Wrong index found ", index, n.getIndex()); - } - - // check reordering - assertEquals("Wrong node UUID found ", s1_1_id, testRootS1.getNode("= node[3]").getUUID()); - } - - /** - * Move node[2] to node[3], node[3] reordered to node[2]. - * = - * @throws LoginException - * @throws NoSuchWorkspaceException - * @throws RepositoryException - */ - public void testMoveMiddle() throws LoginException, NoSuchWorkspaceExce= ption, RepositoryException - { - - final Node testRootS1 =3D testRoot; - - Node nS1_1 =3D testRootS1.addNode("node"); // node[1] - testRootS1.save(); - nS1_1.addMixin("mix:referenceable"); - String s1_1_id =3D nS1_1.getUUID(); - testRootS1.save(); - - Node nS1_2 =3D testRootS1.addNode("node"); // node[2] - Node nS1_3 =3D testRootS1.addNode("node"); // node[3] - testRootS1.save(); - - // test - try - { - // move node[2] to node[3], node[3] reordered to node[2] - testRootS1.getSession().move(testRootS1.getPath() + "/node[2]", t= estRootS1.getPath() + "/node"); - testRootS1.save(); // save - } - catch (RepositoryException e) - { - e.printStackTrace(); - fail("RepositoryException should not have been thrown, but " + e); - } - - int index =3D 0; - for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext();) - { - index++; - Node n =3D iter.nextNode(); - // log.info("Node: " + n.getPath()); - assertEquals("Wrong index found ", index, n.getIndex()); - } - - // check reordering - assertEquals("Wrong node UUID found ", s1_1_id, testRootS1.getNode("= node").getUUID()); - } - - /** - * Move SNS node to itself, move node[3] to node[3]. - * = - * @throws LoginException - * @throws NoSuchWorkspaceException - * @throws RepositoryException - */ - public void testMoveLast() throws LoginException, NoSuchWorkspaceExcept= ion, RepositoryException - { - - final Node testRootS1 =3D testRoot; - - Node nS1_1 =3D testRootS1.addNode("node"); // node[1] - testRootS1.save(); - nS1_1.addMixin("mix:referenceable"); - String s1_1_id =3D nS1_1.getUUID(); - testRootS1.save(); - - Node nS1_2 =3D testRootS1.addNode("node"); // node[2] - Node nS1_3 =3D testRootS1.addNode("node"); // node[3] - testRootS1.save(); - - // test - try - { - // move to itself, move node[3] to node[3] - testRootS1.getSession().move(testRootS1.getPath() + "/node[3]", t= estRootS1.getPath() + "/node"); - testRootS1.save(); // save - } - catch (RepositoryException e) - { - e.printStackTrace(); - fail("RepositoryException should not have been thrown, but " + e); - } - - int index =3D 0; - for (NodeIterator iter =3D testRootS1.getNodes(); iter.hasNext();) - { - index++; - Node n =3D iter.nextNode(); - // log.info("Node: " + n.getPath()); - assertEquals("Wrong index found ", index, n.getIndex()); - } - - // check reordering - assertEquals("Wrong node UUID found ", s1_1_id, testRootS1.getNode("= node").getUUID()); - } - - /** - * Move SNS node to different location with SNS too, move /snsMoveTest/= node1/node[2] to /snsMoveTest/node2/node[3]. - * = - * @throws LoginException - * @throws NoSuchWorkspaceException - * @throws RepositoryException - */ - public void testMoveToDiffLocation() throws LoginException, NoSuchWorks= paceException, RepositoryException - { - - final Node testRootS1 =3D testRoot; - final Node testNode1 =3D testRootS1.addNode("node1"); - final Node testNode2 =3D testRootS1.addNode("node1"); - testRootS1.save(); - - Node n1_1 =3D testNode1.addNode("node"); // node[1] - Node n1_2 =3D testNode1.addNode("node"); // node[2] - testNode1.save(); - n1_2.addMixin("mix:referenceable"); - String n1_2_id =3D n1_2.getUUID(); - testNode1.save(); - - Node n1_3 =3D testNode1.addNode("node"); // node[3] - Node n1_4 =3D testNode1.addNode("node"); // node[4] - testNode1.save(); - - Node n2_1 =3D testNode2.addNode("node"); // node[1] - Node n2_2 =3D testNode2.addNode("node"); // node[2] - testNode2.save(); - - // test - try - { - // move /snsMoveTest/node1/node[2] to /snsMoveTest/node2/node[3] - testNode1.getSession().move(testNode1.getPath() + "/node[2]", tes= tNode2.getPath() + "/node"); - testNode1.getSession().save(); // save - } - catch (RepositoryException e) - { - e.printStackTrace(); - fail("RepositoryException should not have been thrown, but " + e); - } - - int index =3D 0; - for (NodeIterator iter =3D testNode1.getNodes(); iter.hasNext();) - { - index++; - Node n =3D iter.nextNode(); - assertEquals("Wrong index found ", index, n.getIndex()); - } - - index =3D 0; - for (NodeIterator iter =3D testNode2.getNodes(); iter.hasNext();) - { - index++; - Node n =3D iter.nextNode(); - assertEquals("Wrong index found ", index, n.getIndex()); - } - - // check reordering - assertEquals("Wrong node UUID found ", n1_2_id, testNode2.getNode("n= ode[3]").getUUID()); - } -} Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/servi= ces/jcr/api/writing/TestSameNameSiblingsSessionMove.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/writing/TestSameNameSiblingsSessionMove.java = (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/writing/TestSameNameSiblingsSessionMove.java 2011-07-21 09:39:19 U= TC (rev 4670) @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2011 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.api.writing; + +import javax.jcr.ItemExistsException; +import javax.jcr.Node; +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.lock.LockException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.version.VersionException; + +/** + * @author Nikolay Zamos= enchul + * @version $Id: TestSameNameSiblingsSessionMove 34360 2011-07-20 18:58:59= Z nzamosenchuk $ + * + */ +public class TestSameNameSiblingsSessionMove extends AbstractSameNameSibli= ngsMoveTest +{ + + /** + * {@inheritDoc} + */ + @Override + void move(Node testRoot, String srcAbsPath, String destAbsPath) throws = ItemExistsException, PathNotFoundException, + VersionException, ConstraintViolationException, LockException, Repos= itoryException + { + testRoot.getSession().move(srcAbsPath, destAbsPath); + testRoot.getSession().save(); + } + +} Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/api/writing/TestSameNameSiblingsSessionMove.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/servi= ces/jcr/api/writing/TestSameNameSiblingsWorkspaceMove.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/writing/TestSameNameSiblingsWorkspaceMove.java = (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/writing/TestSameNameSiblingsWorkspaceMove.java 2011-07-21 09:39:19= UTC (rev 4670) @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2011 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.api.writing; + +import javax.jcr.ItemExistsException; +import javax.jcr.Node; +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.lock.LockException; +import javax.jcr.nodetype.ConstraintViolationException; +import javax.jcr.version.VersionException; + +/** + * @author Nikolay Zamos= enchul + * @version $Id: TestSameNameSiblingsSessionMove 34360 2011-07-20 18:58:59= Z nzamosenchuk $ + * + */ +public class TestSameNameSiblingsWorkspaceMove extends AbstractSameNameSib= lingsMoveTest +{ + + /** + * {@inheritDoc} + */ + @Override + void move(Node testRoot, String srcAbsPath, String destAbsPath) throws = ItemExistsException, PathNotFoundException, + VersionException, ConstraintViolationException, LockException, Repos= itoryException + { + testRoot.getSession().getWorkspace().move(srcAbsPath, destAbsPath); + } + +} Property changes on: jcr/trunk/exo.jcr.component.core/src/test/java/org/exo= platform/services/jcr/api/writing/TestSameNameSiblingsWorkspaceMove.java ___________________________________________________________________ Added: svn:mime-type + text/plain --===============4038182292193872057==-- From do-not-reply at jboss.org Thu Jul 21 08:52:35 2011 Content-Type: multipart/mixed; boundary="===============3511592694515920930==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4671 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/persistent and 2 other directories. Date: Thu, 21 Jul 2011 08:52:34 -0400 Message-ID: <201107211252.p6LCqYCr013472@svn01.web.mwc.hst.phx2.redhat.com> --===============3511592694515920930== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-21 08:52:33 -0400 (Thu, 21 Jul 2011) New Revision: 4671 Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/xml/importing/ACLInitializationHelper.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SysViewWorkspaceInitializer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.ja= va jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/xml/importing/BaseXmlImporter.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/xml/importing/DocumentViewImporter.java 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/test/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java Log: EXOJCR-1239: improve ACL permissions 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 2011-07-21 09:39:19 UTC (re= v 4670) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SysViewWorkspaceInitializer.java 2011-07-21 12:52:33 UTC (re= v 4671) @@ -21,6 +21,7 @@ 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.AccessControlList; import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.RepositoryEntry; @@ -47,6 +48,7 @@ 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.SpoolFile; +import org.exoplatform.services.jcr.impl.xml.importing.ACLInitializationHe= lper; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -59,6 +61,7 @@ import java.io.OutputStream; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Stack; = import javax.jcr.NamespaceException; @@ -326,6 +329,10 @@ = int orderNumber =3D 0; = + private String exoOwner; + + private List exoPrivileges; + HashMap childNodesMap =3D new HashMap(); = SVNodeData(QPath path, String identifier, String parentIdentifier, i= nt version, int orderNum) @@ -343,6 +350,31 @@ this.mixinTypeNames =3D mixinTypeNames; } = + public String getExoOwner() + { + return exoOwner; + } + + public List getExoPrivileges() + { + return exoPrivileges; + } + + public void setExoOwner(String exoOwner) + { + this.exoOwner =3D exoOwner; + } + + public void setExoPrivileges(List exoPrivileges) + { + this.exoPrivileges =3D exoPrivileges; + } + + public void setACL(AccessControlList acl) + { + this.acl =3D acl; + } + /** * Add name of child node. * = @@ -624,6 +656,11 @@ = SVNodeData currentNode =3D new SVNodeData(curre= ntPath, exoId, parentId, 0, orderNumber); = + AccessControlList acl =3D + ACLInitializationHelper.initAcl(parents.size= () =3D=3D 0 ? null : parents.peek().getACL(), + null, null); + currentNode.setACL(acl); + // push current node as parent parents.push(currentNode); = @@ -738,7 +775,42 @@ } parent.setMixinTypeNames(mixins); } + else if (currentProperty.getQPath().getName().e= quals(Constants.EXO_OWNER)) + { + String exoOwner =3D + new String(currentProperty.getValues().ge= t(0).getAsByteArray(), + Constants.DEFAULT_ENCODING); + parent.setExoOwner(exoOwner); = + SVNodeData curParent =3D parents.pop(); + + AccessControlList acl =3D + ACLInitializationHelper.initAcl(parents.s= ize() =3D=3D 0 ? null : parents.peek().getACL(), + exoOwner, curParent.getExoPrivileges()= ); + curParent.setACL(acl); + + parents.push(curParent); + } + else if (currentProperty.getQPath().getName().e= quals(Constants.EXO_PERMISSIONS)) + { + List exoPrivileges =3D new ArrayList= (); + for (int i =3D 0; i < currentProperty.getVal= ues().size(); i++) + { + exoPrivileges.add(new String(currentPrope= rty.getValues().get(i).getAsByteArray(), + Constants.DEFAULT_ENCODING)); + } + parent.setExoPrivileges(exoPrivileges); + + SVNodeData curParent =3D parents.pop(); + + AccessControlList acl =3D + ACLInitializationHelper.initAcl(parents.s= ize() =3D=3D 0 ? null : parents.peek().getACL(), + curParent.getExoOwner(), exoPrivileges= ); + curParent.setACL(acl); + + parents.push(curParent); + } + // add property, no event fire, persisted, inte= rnally created, root is ancestor to // save changes.add(new ItemState(currentProperty, Item= State.ADDED, false, Constants.ROOT_PATH, Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataMan= ager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.j= ava 2011-07-21 09:39:19 UTC (rev 4670) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.j= ava 2011-07-21 12:52:33 UTC (rev 4671) @@ -18,7 +18,6 @@ */ package org.exoplatform.services.jcr.impl.dataflow.persistent; = -import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog; import org.exoplatform.services.jcr.dataflow.SharedDataManager; import org.exoplatform.services.jcr.datamodel.ItemData; @@ -27,7 +26,6 @@ import org.exoplatform.services.jcr.datamodel.PropertyData; import org.exoplatform.services.jcr.datamodel.QPathEntry; import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter; -import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = @@ -56,104 +54,12 @@ } = /** - * Traverse items parents in persistent storage for ACL containing pare= nt. Same work is made in - * SessionDataManager.getItemData(NodeData, QPathEntry[]) but for sessi= on scooped items. - * = - * @param node - * - item - * @return - parent or null - * @throws RepositoryException - */ - private AccessControlList getNearestACAncestorAcl(NodeData node) throws= RepositoryException - { - - if (node.getParentIdentifier() !=3D null) - { - NodeData parent =3D (NodeData)getItemData(node.getParentIdentifie= r()); - while (parent !=3D null) - { - if (parent.getACL() !=3D null) - { - // has an AC parent - return parent.getACL(); - } - // going up to the root - parent =3D (NodeData)getItemData(parent.getParentIdentifier()); - } - } - return new AccessControlList(); - } - - /** - * @param parent - * - a parent, can be null (get item by id) - * @param data - * - an item data - * @return - an item data with ACL was initialized - * @throws RepositoryException - */ - private ItemData initACL(NodeData parent, NodeData node) throws Reposit= oryException - { - if (node !=3D null) - { - AccessControlList acl =3D node.getACL(); - if (acl =3D=3D null) - { - if (parent !=3D null) - { - // use parent ACL - node =3D - new TransientNodeData(node.getQPath(), node.getIdentifie= r(), node.getPersistedVersion(), node - .getPrimaryTypeName(), node.getMixinTypeNames(), node= .getOrderNumber(), - node.getParentIdentifier(), parent.getACL()); - } - else - { - // use nearest ancestor ACL... case of get by id - node =3D - new TransientNodeData(node.getQPath(), node.getIdentifie= r(), node.getPersistedVersion(), node - .getPrimaryTypeName(), node.getMixinTypeNames(), node= .getOrderNumber(), - node.getParentIdentifier(), getNearestACAncestorAcl(n= ode)); - } - } - else if (!acl.hasPermissions()) - { - // use nearest ancestor permissions - AccessControlList ancestorAcl =3D getNearestACAncestorAcl(node= ); - - node =3D - new TransientNodeData(node.getQPath(), node.getIdentifier()= , node.getPersistedVersion(), node - .getPrimaryTypeName(), node.getMixinTypeNames(), node.ge= tOrderNumber(), node.getParentIdentifier(), - new AccessControlList(acl.getOwner(), ancestorAcl.getPer= missionEntries())); - } - else if (!acl.hasOwner()) - { - // use nearest ancestor owner - AccessControlList ancestorAcl =3D getNearestACAncestorAcl(node= ); - - node =3D - new TransientNodeData(node.getQPath(), node.getIdentifier()= , node.getPersistedVersion(), node - .getPrimaryTypeName(), node.getMixinTypeNames(), node.ge= tOrderNumber(), node.getParentIdentifier(), - new AccessControlList(ancestorAcl.getOwner(), acl.getPer= missionEntries())); - - } - } - - return node; - } - - /** * {@inheritDoc} */ // ------------ ItemDataConsumer impl ------------ public List getChildNodesData(NodeData parent) throws Reposit= oryException { - final List nodes =3D persistentManager.getChildNodesData(p= arent); - for (int i =3D 0; i < nodes.size(); i++) - { - nodes.set(i, (NodeData)initACL(parent, nodes.get(i))); - } - return nodes; + return persistentManager.getChildNodesData(parent); } = /** @@ -161,12 +67,7 @@ */ public List getChildNodesData(NodeData parent, List patternFilters) throws RepositoryException { - final List nodes =3D persistentManager.getChildNodesData(p= arent, patternFilters); - for (int i =3D 0; i < nodes.size(); i++) - { - nodes.set(i, (NodeData)initACL(parent, nodes.get(i))); - } - return nodes; + return persistentManager.getChildNodesData(parent, patternFilters); } = /** @@ -198,8 +99,7 @@ */ public ItemData getItemData(NodeData parent, QPathEntry name, ItemType = itemType) throws RepositoryException { - final ItemData item =3D persistentManager.getItemData(parent, name, = itemType); - return item !=3D null && item.isNode() ? initACL(parent, (NodeData)i= tem) : item; + return persistentManager.getItemData(parent, name, itemType); } = /** @@ -207,8 +107,7 @@ */ public ItemData getItemData(String identifier) throws RepositoryExcepti= on { - final ItemData item =3D persistentManager.getItemData(identifier); - return item !=3D null && item.isNode() ? initACL(null, (NodeData)ite= m) : item; + return persistentManager.getItemData(identifier); } = /** 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 2011-07-21= 09:39:19 UTC (rev 4670) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-07-21= 12:52:33 UTC (rev 4671) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.dataflow.persistent; = import org.exoplatform.commons.utils.SecurityHelper; +import org.exoplatform.services.jcr.access.AccessControlList; 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; @@ -36,6 +37,7 @@ import org.exoplatform.services.jcr.impl.backup.SuspendException; import org.exoplatform.services.jcr.impl.backup.Suspendable; import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter; +import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData; import org.exoplatform.services.jcr.impl.dataflow.session.TransactionableR= esourceManager; import org.exoplatform.services.jcr.impl.dataflow.session.TransactionableR= esourceManagerListener; import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; @@ -1551,6 +1553,14 @@ protected ItemData getPersistedItemData(String identifier) throws Repos= itoryException { ItemData data =3D super.getItemData(identifier); + + // set ACL + + if (data !=3D null && data.isNode()) + { + data =3D initACL(null, (NodeData)data); + } + if (cache.isEnabled()) { if (data !=3D null) @@ -1920,6 +1930,96 @@ { throw new RuntimeException(cause); } - } = + } } + + /** + * Init ACL of the node. + * = + * @param parent + * - a parent, can be null (get item by id) + * @param data + * - an item data + * @return - an item data with ACL was initialized + * @throws RepositoryException + */ + private ItemData initACL(NodeData parent, NodeData node) throws Reposit= oryException + { + if (node !=3D null) + { + AccessControlList acl =3D node.getACL(); + if (acl =3D=3D null) + { + if (parent !=3D null) + { + // use parent ACL + node =3D + new TransientNodeData(node.getQPath(), node.getIdentifie= r(), node.getPersistedVersion(), + node.getPrimaryTypeName(), node.getMixinTypeNames(), = node.getOrderNumber(), + node.getParentIdentifier(), parent.getACL()); + } + else + { + // use nearest ancestor ACL... case of get by id + node =3D + new TransientNodeData(node.getQPath(), node.getIdentifie= r(), node.getPersistedVersion(), + node.getPrimaryTypeName(), node.getMixinTypeNames(), = node.getOrderNumber(), + node.getParentIdentifier(), getNearestACAncestorAcl(n= ode)); + } + } + else if (!acl.hasPermissions()) + { + // use nearest ancestor permissions + AccessControlList ancestorAcl =3D getNearestACAncestorAcl(node= ); + + node =3D + new TransientNodeData(node.getQPath(), node.getIdentifier()= , node.getPersistedVersion(), + node.getPrimaryTypeName(), node.getMixinTypeNames(), nod= e.getOrderNumber(), + node.getParentIdentifier(), new AccessControlList(acl.ge= tOwner(), ancestorAcl.getPermissionEntries())); + } + else if (!acl.hasOwner()) + { + // use nearest ancestor owner + AccessControlList ancestorAcl =3D getNearestACAncestorAcl(node= ); + + node =3D + new TransientNodeData(node.getQPath(), node.getIdentifier()= , node.getPersistedVersion(), + node.getPrimaryTypeName(), node.getMixinTypeNames(), nod= e.getOrderNumber(), + node.getParentIdentifier(), new AccessControlList(ancest= orAcl.getOwner(), acl.getPermissionEntries())); + + } + } + + return node; + } + + /** + * Traverse items parents in persistent storage for ACL containing pare= nt. Same work is made in + * SessionDataManager.getItemData(NodeData, QPathEntry[]) but for sessi= on scooped items. + * = + * @param node + * - item + * @return - parent or null + * @throws RepositoryException + */ + private AccessControlList getNearestACAncestorAcl(NodeData node) throws= RepositoryException + { + + if (node.getParentIdentifier() !=3D null) + { + NodeData parent =3D (NodeData)getItemData(node.getParentIdentifie= r()); + while (parent !=3D null) + { + if (parent.getACL() !=3D null) + { + // has an AC parent + return parent.getACL(); + } + // going up to the root + parent =3D (NodeData)getItemData(parent.getParentIdentifier()); + } + } + return new AccessControlList(); + } + } \ No newline at end of file Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/xml/importing/ACLInitializationHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ACLInitializationHelper.java = (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/importing/ACLInitializationHelper.java 2011-07-21 12:52:33 UT= C (rev 4671) @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2011 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.xml.importing; + +import org.exoplatform.services.jcr.access.AccessControlEntry; +import org.exoplatform.services.jcr.access.AccessControlList; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +/** + * @author Anatoliy Bazko + * @version $Id: ACLInitializationHelper.java 34360 2009-07-22 23:58:59Z t= olusha $ + */ +public class ACLInitializationHelper +{ + + public static AccessControlList initAcl(AccessControlList parentACL, St= ring owner, List exoPermissions) + { + boolean isOwneable =3D owner !=3D null; + boolean isPrivilegeable =3D exoPermissions !=3D null; + + AccessControlList acl; + if (isOwneable) + { + // has own owner + if (isPrivilegeable) + { + // and permissions + acl =3D new AccessControlList(owner, readACLPermisions(exoPerm= issions)); + } + else if (parentACL !=3D null) + { + // use permissions from existed parent + acl =3D new AccessControlList(owner, parentACL.hasPermissions(= ) ? parentACL.getPermissionEntries() : null); + } + else + { + // have to search nearest ancestor permissions in ACL manager + // acl =3D new AccessControlList(owner, + // traverseACLPermissions(cpid)); + acl =3D new AccessControlList(owner, null); + } + } + else if (isPrivilegeable) + { + // has own permissions + if (isOwneable) + { + // and owner + acl =3D new AccessControlList(owner, readACLPermisions(exoPerm= issions)); + } + else if (parentACL !=3D null) + { + // use owner from existed parent + acl =3D new AccessControlList(parentACL.getOwner(), readACLPer= misions(exoPermissions)); + } + else + { + // have to search nearest ancestor owner in ACL manager + // acl =3D new AccessControlList(traverseACLOwner(cpid), + // readACLPermisions(cid)); + acl =3D new AccessControlList(null, readACLPermisions(exoPermi= ssions)); + } + } + else + { + if (parentACL !=3D null) + // construct ACL from existed parent ACL + acl =3D + new AccessControlList(parentACL.getOwner(), parentACL.hasPe= rmissions() + ? parentACL.getPermissionEntries() : null); + else + // have to search nearest ancestor owner and permissions in AC= L manager + // acl =3D traverseACL(cpid); + acl =3D null; + } + return acl; + } + + /** + * Return permission values or throw an exception. We assume the node is + * mix:privilegeable. + */ + private static List readACLPermisions(List = exoPermissions) + { + List naPermissions =3D new ArrayList(); + + for (String perm : exoPermissions) + { + StringTokenizer parser =3D new StringTokenizer(perm, AccessContro= lEntry.DELIMITER); + naPermissions.add(new AccessControlEntry(parser.nextToken(), pars= er.nextToken())); + } + + return naPermissions; + } + +} Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/xml/importing/BaseXmlImporter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/BaseXmlImporter.java 2011-07-21 09:39:19 UTC (rev 4= 670) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/importing/BaseXmlImporter.java 2011-07-21 12:52:33 UTC (rev 4= 671) @@ -18,8 +18,6 @@ */ package org.exoplatform.services.jcr.impl.xml.importing; = -import org.exoplatform.services.jcr.access.AccessControlEntry; -import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.core.nodetype.NodeDefinitionData; import org.exoplatform.services.jcr.core.nodetype.NodeTypeDataManager; @@ -27,7 +25,6 @@ import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; -import org.exoplatform.services.jcr.datamodel.IllegalACLException; import org.exoplatform.services.jcr.datamodel.IllegalPathException; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.ItemData; @@ -58,7 +55,6 @@ import java.util.List; import java.util.Map; import java.util.Stack; -import java.util.StringTokenizer; = import javax.jcr.ImportUUIDBehavior; import javax.jcr.ItemExistsException; @@ -452,91 +448,8 @@ currentNodeInfo.setIdentifier(identifier); } = - protected AccessControlList initAcl(AccessControlList parentACL, boolea= n isOwneable, boolean isPrivilegeable, - String owner, List exoPermissions) - { - AccessControlList acl; - if (isOwneable) - { - // has own owner - if (isPrivilegeable) - { - // and permissions - acl =3D new AccessControlList(owner, readACLPermisions(exoPerm= issions)); - } - else if (parentACL !=3D null) - { - // use permissions from existed parent - acl =3D new AccessControlList(owner, parentACL.hasPermissions(= ) ? parentACL.getPermissionEntries() : null); - } - else - { - // have to search nearest ancestor permissions in ACL manager - // acl =3D new AccessControlList(owner, - // traverseACLPermissions(cpid)); - acl =3D new AccessControlList(owner, null); - } - } - else if (isPrivilegeable) - { - // has own permissions - if (isOwneable) - { - // and owner - acl =3D new AccessControlList(owner, readACLPermisions(exoPerm= issions)); - } - else if (parentACL !=3D null) - { - // use owner from existed parent - acl =3D new AccessControlList(parentACL.getOwner(), readACLPer= misions(exoPermissions)); - } - else - { - // have to search nearest ancestor owner in ACL manager - // acl =3D new AccessControlList(traverseACLOwner(cpid), - // readACLPermisions(cid)); - acl =3D new AccessControlList(null, readACLPermisions(exoPermi= ssions)); - } - } - else - { - if (parentACL !=3D null) - // construct ACL from existed parent ACL - acl =3D - new AccessControlList(parentACL.getOwner(), parentACL.hasPe= rmissions() ? parentACL - .getPermissionEntries() : null); - else - // have to search nearest ancestor owner and permissions in AC= L manager - // acl =3D traverseACL(cpid); - acl =3D null; - } - return acl; - } = /** - * Return permission values or throw an exception. We assume the node is - * mix:privilegeable. - * = - * @param cid Node id - * @return list of ACL entries - * @throws IllegalACLException if property exo:permissions is not found= for - * node - */ - protected List readACLPermisions(List exoPe= rmissions) - { - List naPermissions =3D new ArrayList(); - - for (String perm : exoPermissions) - { - - StringTokenizer parser =3D new StringTokenizer(perm, AccessContro= lEntry.DELIMITER); - naPermissions.add(new AccessControlEntry(parser.nextToken(), pars= er.nextToken())); - - } - return naPermissions; - } - - /** * Check if item with uuid=3Didentifier exists. If no item exist return= same * identifier. If same uuid item exist and depend on uuidBehavior do: *
    Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/xml/importing/DocumentViewImporter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/DocumentViewImporter.java 2011-07-21 09:39:19 UTC (= rev 4670) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/importing/DocumentViewImporter.java 2011-07-21 12:52:33 UTC (= rev 4671) @@ -443,8 +443,8 @@ = } = - nodeData.setACL(initAcl(parentNodeData.getACL(), nodeData.isExoOwnea= ble(), nodeData.isExoPrivilegeable(), - nodeData.getExoOwner(), nodeData.getExoPrivileges())); + nodeData.setACL(ACLInitializationHelper.initAcl(parentNodeData.getAC= L(), nodeData.getExoOwner(), + nodeData.getExoPrivileges())); = if (nodeData.isMixVersionable()) { 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 2011-07-21 09:39:19 UTC (re= v 4670) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/xml/importing/SystemViewImporter.java 2011-07-21 12:52:33 UTC (re= v 4671) @@ -361,8 +361,8 @@ createVersionHistory(currentNodeInfo); } = - currentNodeInfo.setACL(initAcl(currentNodeInfo.getACL(), currentNode= Info.isExoOwneable(), currentNodeInfo - .isExoPrivilegeable(), currentNodeInfo.getExoOwner(), currentNode= Info.getExoPrivileges())); + currentNodeInfo.setACL(ACLInitializationHelper.initAcl(currentNodeIn= fo.getACL(), currentNodeInfo.getExoOwner(), + currentNodeInfo.getExoPrivileges())); } = = Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestWorkspaceStorageCacheInClusterMode.java 2= 011-07-21 09:39:19 UTC (rev 4670) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2= 011-07-21 12:52:33 UTC (rev 4671) @@ -20,6 +20,7 @@ = import org.exoplatform.commons.utils.QName; import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.access.AccessControlList; import org.exoplatform.services.jcr.dataflow.ItemState; import org.exoplatform.services.jcr.dataflow.PlainChangesLog; import org.exoplatform.services.jcr.dataflow.PlainChangesLogImpl; @@ -797,8 +798,17 @@ } if (itemType =3D=3D ItemType.NODE) { - return new PersistedNodeData("my-node" + parentNode.getIdentif= ier(), QPath.makeChildPath(parentNode.getQPath(), name), Constants.ROOT_UUI= D, 1, 1, - Constants.NT_UNSTRUCTURED, new InternalQName[0], null); + if (name.equals(Constants.ROOT_PATH.getEntries()[0])) + { + return new PersistedNodeData(Constants.ROOT_UUID, Constants= .ROOT_PATH, Constants.ROOT_PARENT_UUID, 1, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], new Acc= essControlList()); + } + else + { + return new PersistedNodeData("my-node" + parentNode.getIden= tifier(), QPath.makeChildPath( + parentNode.getQPath(), name), Constants.ROOT_UUID, 1, 1,= Constants.NT_UNSTRUCTURED, + new InternalQName[0], null); + } } try { @@ -827,7 +837,16 @@ Thread.currentThread().interrupt(); } } - return parentNode; + + if (identifier.equals(Constants.ROOT_UUID)) + { + return new PersistedNodeData(Constants.ROOT_UUID, Constants.RO= OT_PATH, Constants.ROOT_PARENT_UUID, 1, 1, + Constants.NT_UNSTRUCTURED, new InternalQName[0], new Access= ControlList()); + } + else + { + return parentNode; + } } = public List getReferencesData(String nodeIdentifier) t= hrows RepositoryException, --===============3511592694515920930==-- From do-not-reply at jboss.org Thu Jul 21 11:02:36 2011 Content-Type: multipart/mixed; boundary="===============2490408137323485644==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4672 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow: serialization and 1 other directory. Date: Thu, 21 Jul 2011 11:02:36 -0400 Message-ID: <201107211502.p6LF2aTq011998@svn01.web.mwc.hst.phx2.redhat.com> --===============2490408137323485644== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-21 11:02:35 -0400 (Thu, 21 Jul 2011) New Revision: 4672 Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/PersistedNodeDataReader.java Removed: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/serialization/PresistedNodeDataReader.java 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/serialization/ItemStateReader.java Log: EXOJCR-1239: improve ACL permissions 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 2011-07-21= 12:52:33 UTC (rev 4671) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-07-21= 15:02:35 UTC (rev 4672) @@ -617,7 +617,8 @@ { public ItemData run() throws RepositoryException { - return CacheableWorkspaceDataManager.super.getItemData(pare= ntData, name, itemType); + ItemData item =3D CacheableWorkspaceDataManager.super.getIt= emData(parentData, name, itemType); + return item !=3D null && item.isNode() ? initACL(parentData= , (NodeData)item) : item; } }); } @@ -680,7 +681,8 @@ { public ItemData run() throws RepositoryException { - return CacheableWorkspaceDataManager.super.getItemData(iden= tifier); + ItemData item =3D CacheableWorkspaceDataManager.super.getIt= emData(identifier); + return item !=3D null && item.isNode() ? initACL(null, (Nod= eData)item) : item; } }); } @@ -1008,6 +1010,15 @@ cache.addChildNodes(parentData, childNodes); } } + else + { + // ini ACL + for (int i =3D 0; i < childNodes.size(); i++) + { + childNodes.set(i, (NodeData)initACL(nodeData, childNo= des.get(i))); + } + } + return childNodes; } }); @@ -1027,7 +1038,16 @@ { public List run() throws RepositoryException { - return CacheableWorkspaceDataManager.super.getChildNodesDat= a(parentData, patternFilters); + List childNodes =3D + CacheableWorkspaceDataManager.super.getChildNodesData(pa= rentData, patternFilters); + + // ini ACL + for (int i =3D 0; i < childNodes.size(); i++) + { + childNodes.set(i, (NodeData)initACL(parentData, childNod= es.get(i))); + } + + return childNodes; } }); } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/serialization/ItemStateReader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/ItemStateReader.java 2011-07-21 12:52:33 U= TC (rev 4671) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/ItemStateReader.java 2011-07-21 15:02:35 U= TC (rev 4672) @@ -110,7 +110,7 @@ = if (isNodeData) { - PresistedNodeDataReader rdr =3D new PresistedNodeDataReader(); + PersistedNodeDataReader rdr =3D new PersistedNodeDataReader(); is =3D new ItemState(rdr.read(in), state, eventFire, null, fal= se, isPersisted, oldPath); } else Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/dataflow/serialization/PersistedNodeDataReader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/PersistedNodeDataReader.java = (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/PersistedNodeDataReader.java 2011-07-21 15= :02:35 UTC (rev 4672) @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2009 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.dataflow.serialization; + +import org.exoplatform.services.jcr.access.AccessControlList; +import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData; +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; +import org.exoplatform.services.jcr.datamodel.IllegalNameException; +import org.exoplatform.services.jcr.datamodel.IllegalPathException; +import org.exoplatform.services.jcr.datamodel.InternalQName; +import org.exoplatform.services.jcr.datamodel.QPath; + +import java.io.IOException; + +/** + * Created by The eXo Platform SAS.
    Date: + * = + * @author Karpenko Sergiy + * @version $Id: PresistedNodeDataReader.java 1518 2010-01-20 23:33:30Z se= rgiykarpenko $ + */ +public class PersistedNodeDataReader +{ + + /** + * Read and set PersistedNodeData data. + * = + * @param in ObjectReader. + * @return PersistedNodeData object. + * @throws UnknownClassIdException If read Class ID is not expected or = do not + * exist. + * @throws IOException If an I/O error has occurred. + */ + public PersistedNodeData read(ObjectReader in) throws UnknownClassIdExc= eption, IOException + { + // read id + int key; + if ((key =3D in.readInt()) !=3D SerializationConstants.PERSISTED_NOD= E_DATA) + { + throw new UnknownClassIdException("There is unexpected class [" += key + "]"); + } + + QPath qpath; + try + { + String sQPath =3D in.readString(); + qpath =3D QPath.parse(sQPath); + } + catch (final IllegalPathException e) + { + throw new IOException("Deserialization error. " + e) + { + + /** + * {@inheritDoc} + */ + @Override + public Throwable getCause() + { + return e; + } + }; + } + + String identifier =3D in.readString(); + + String parentIdentifier =3D null; + if (in.readByte() =3D=3D SerializationConstants.NOT_NULL_DATA) + { + parentIdentifier =3D in.readString(); + } + + int persistedVersion =3D in.readInt(); + // -------------- + + int orderNum =3D in.readInt(); + + // primary type + InternalQName primaryTypeName; + try + { + primaryTypeName =3D InternalQName.parse(in.readString()); + } + catch (final IllegalNameException e) + { + throw new IOException(e.getMessage()) + { + private static final long serialVersionUID =3D 348980917923443= 5267L; + + /** + * {@inheritDoc} + */ + @Override + public Throwable getCause() + { + return e; + } + }; + } + + // mixins + InternalQName[] mixinTypeNames =3D null; + if (in.readByte() =3D=3D SerializationConstants.NOT_NULL_DATA) + { + int count =3D in.readInt(); + mixinTypeNames =3D new InternalQName[count]; + for (int i =3D 0; i < count; i++) + { + try + { + mixinTypeNames[i] =3D InternalQName.parse(in.readString()); + } + catch (final IllegalNameException e) + { + throw new IOException(e.getMessage()) + { + private static final long serialVersionUID =3D 348980917= 9234435268L; // eclipse + + // gen + + /** + * {@inheritDoc} + */ + @Override + public Throwable getCause() + { + return e; + } + }; + } + } + } + + // acl + AccessControlList acl =3D null; + if (in.readByte() =3D=3D SerializationConstants.NOT_NULL_DATA) + { + ACLReader rdr =3D new ACLReader(); + acl =3D rdr.read(in); + } + + return new PersistedNodeData(identifier, qpath, parentIdentifier, pe= rsistedVersion, orderNum, primaryTypeName, + mixinTypeNames, acl); + } + +} Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/ser= vices/jcr/impl/dataflow/serialization/PresistedNodeDataReader.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/PresistedNodeDataReader.java 2011-07-21 12= :52:33 UTC (rev 4671) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/serialization/PresistedNodeDataReader.java 2011-07-21 15= :02:35 UTC (rev 4672) @@ -1,163 +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.dataflow.serialization; - -import org.exoplatform.services.jcr.access.AccessControlList; -import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData; -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; -import org.exoplatform.services.jcr.datamodel.IllegalNameException; -import org.exoplatform.services.jcr.datamodel.IllegalPathException; -import org.exoplatform.services.jcr.datamodel.InternalQName; -import org.exoplatform.services.jcr.datamodel.QPath; - -import java.io.IOException; - -/** - * Created by The eXo Platform SAS.
    Date: - * = - * @author Karpenko Sergiy - * @version $Id$ - */ -public class PresistedNodeDataReader -{ - - /** - * Read and set PersistedNodeData data. - * = - * @param in ObjectReader. - * @return PersistedNodeData object. - * @throws UnknownClassIdException If read Class ID is not expected or = do not - * exist. - * @throws IOException If an I/O error has occurred. - */ - public PersistedNodeData read(ObjectReader in) throws UnknownClassIdExc= eption, IOException - { - // read id - int key; - if ((key =3D in.readInt()) !=3D SerializationConstants.PERSISTED_NOD= E_DATA) - { - throw new UnknownClassIdException("There is unexpected class [" += key + "]"); - } - - QPath qpath; - try - { - String sQPath =3D in.readString(); - qpath =3D QPath.parse(sQPath); - } - catch (final IllegalPathException e) - { - throw new IOException("Deserialization error. " + e) - { - - /** - * {@inheritDoc} - */ - @Override - public Throwable getCause() - { - return e; - } - }; - } - - String identifier =3D in.readString(); - - String parentIdentifier =3D null; - if (in.readByte() =3D=3D SerializationConstants.NOT_NULL_DATA) - { - parentIdentifier =3D in.readString(); - } - - int persistedVersion =3D in.readInt(); - // -------------- - - int orderNum =3D in.readInt(); - - // primary type - InternalQName primaryTypeName; - try - { - primaryTypeName =3D InternalQName.parse(in.readString()); - } - catch (final IllegalNameException e) - { - throw new IOException(e.getMessage()) - { - private static final long serialVersionUID =3D 348980917923443= 5267L; - - /** - * {@inheritDoc} - */ - @Override - public Throwable getCause() - { - return e; - } - }; - } - - // mixins - InternalQName[] mixinTypeNames =3D null; - if (in.readByte() =3D=3D SerializationConstants.NOT_NULL_DATA) - { - int count =3D in.readInt(); - mixinTypeNames =3D new InternalQName[count]; - for (int i =3D 0; i < count; i++) - { - try - { - mixinTypeNames[i] =3D InternalQName.parse(in.readString()); - } - catch (final IllegalNameException e) - { - throw new IOException(e.getMessage()) - { - private static final long serialVersionUID =3D 348980917= 9234435268L; // eclipse - - // gen - - /** - * {@inheritDoc} - */ - @Override - public Throwable getCause() - { - return e; - } - }; - } - } - } - - // acl - AccessControlList acl =3D null; - if (in.readByte() =3D=3D SerializationConstants.NOT_NULL_DATA) - { - ACLReader rdr =3D new ACLReader(); - acl =3D rdr.read(in); - } - - return new PersistedNodeData(identifier, qpath, parentIdentifier, pe= rsistedVersion, orderNum, primaryTypeName, - mixinTypeNames, acl); - } - -} --===============2490408137323485644==-- From do-not-reply at jboss.org Fri Jul 22 04:02:54 2011 Content-Type: multipart/mixed; boundary="===============4224284326899151956==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4673 - kernel/trunk/packaging/module/src/main/javascript. Date: Fri, 22 Jul 2011 04:02:54 -0400 Message-ID: <201107220802.p6M82suo022201@svn01.web.mwc.hst.phx2.redhat.com> --===============4224284326899151956== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-22 04:02:53 -0400 (Fri, 22 Jul 2011) New Revision: 4673 Modified: kernel/trunk/packaging/module/src/main/javascript/kernel.packaging.modul= e.js Log: EXOJCR-1315: Align commons-collection depenency version in JCR subprojects Modified: kernel/trunk/packaging/module/src/main/javascript/kernel.packagin= g.module.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kernel/trunk/packaging/module/src/main/javascript/kernel.packaging.modu= le.js 2011-07-21 15:02:35 UTC (rev 4672) +++ kernel/trunk/packaging/module/src/main/javascript/kernel.packaging.modu= le.js 2011-07-22 08:02:53 UTC (rev 4673) @@ -35,7 +35,8 @@ = module.component =3D {}; module.component.common =3D = - new Project("org.exoplatform.kernel", "exo.kernel.component.common", "= jar", module.version). + new Project("org.exoplatform.kernel", "exo.kernel.component.common", "= jar", module.version). + addDependency(new Project("commons-collections", "commons-collections"= , "jar", "3.2.1")). addDependency(new Project("org.quartz-scheduler", "quartz", "jar", "1.= 8.4")). addDependency(new Project("javax.activation", "activation", "jar", "1.= 1")). addDependency(new Project("javax.mail", "mail", "jar", "1.4.4")); --===============4224284326899151956==-- From do-not-reply at jboss.org Fri Jul 22 04:03:28 2011 Content-Type: multipart/mixed; boundary="===============9026403941230238426==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4674 - core/trunk/packaging/module/src/main/javascript. Date: Fri, 22 Jul 2011 04:03:28 -0400 Message-ID: <201107220803.p6M83SO9022222@svn01.web.mwc.hst.phx2.redhat.com> --===============9026403941230238426== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-22 04:03:27 -0400 (Fri, 22 Jul 2011) New Revision: 4674 Modified: core/trunk/packaging/module/src/main/javascript/core.packaging.module.js Log: EXOJCR-1315: Align commons-collection depenency version in JCR subprojects Modified: core/trunk/packaging/module/src/main/javascript/core.packaging.mo= dule.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/packaging/module/src/main/javascript/core.packaging.module.j= s 2011-07-22 08:02:53 UTC (rev 4673) +++ core/trunk/packaging/module/src/main/javascript/core.packaging.module.j= s 2011-07-22 08:03:27 UTC (rev 4674) @@ -21,7 +21,6 @@ addDependency(new Project("org.hibernate", "hibernate-commons-annotati= ons", "jar", "3.1.0.GA")). addDependency(new Project("org.hibernate", "ejb3-persistence", "jar", = "1.0.2.GA")). addDependency(new Project("org.javassist", "javassist", "jar", "3.14.0= -GA")). - addDependency(new Project("commons-collections", "commons-collections"= , "jar", "3.2.1")). addDependency(new Project("c3p0", "c3p0", "jar", "0.9.1.2")). addDependency(new Project("antlr", "antlr", "jar", "2.7.6rc1")). addDependency(new Project("javax.transaction", "jta", "jar", "1.1")). --===============9026403941230238426==-- From do-not-reply at jboss.org Fri Jul 22 04:04:47 2011 Content-Type: multipart/mixed; boundary="===============6902935652734945011==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4675 - in ws/trunk: exo.ws.rest.core and 1 other directories. Date: Fri, 22 Jul 2011 04:04:46 -0400 Message-ID: <201107220804.p6M84ka6022310@svn01.web.mwc.hst.phx2.redhat.com> --===============6902935652734945011== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-22 04:04:46 -0400 (Fri, 22 Jul 2011) New Revision: 4675 Modified: ws/trunk/exo.ws.rest.core/pom.xml ws/trunk/packaging/module/src/main/javascript/ws.packaging.module.js ws/trunk/pom.xml Log: EXOJCR-1315: Align commons-collection depenency version in JCR subprojects Modified: ws/trunk/exo.ws.rest.core/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/exo.ws.rest.core/pom.xml 2011-07-22 08:03:27 UTC (rev 4674) +++ ws/trunk/exo.ws.rest.core/pom.xml 2011-07-22 08:04:46 UTC (rev 4675) @@ -97,10 +97,6 @@ jsr311-api - commons-io - commons-io - - commons-fileupload commons-fileupload Modified: ws/trunk/packaging/module/src/main/javascript/ws.packaging.module= .js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/packaging/module/src/main/javascript/ws.packaging.module.js 20= 11-07-22 08:03:27 UTC (rev 4674) +++ ws/trunk/packaging/module/src/main/javascript/ws.packaging.module.js 20= 11-07-22 08:04:46 UTC (rev 4675) @@ -38,7 +38,6 @@ addDependency(new Project("javax.annotation", "jsr250-api", "jar", "1.= 0")). addDependency(new Project("javax.inject", "javax.inject", "jar", "1")). addDependency(new Project("javax.ws.rs", "jsr311-api", "jar", "1.0")). - addDependency(new Project("commons-chain", "commons-chain", "jar", "1.= 2")). addDependency(new Project("javax.xml.bind", "jaxb-api", "jar", "2.1")); = module.soap =3D {}; Modified: ws/trunk/pom.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ws/trunk/pom.xml 2011-07-22 08:03:27 UTC (rev 4674) +++ ws/trunk/pom.xml 2011-07-22 08:04:46 UTC (rev 4675) @@ -148,14 +148,8 @@ 0.7.4 - commons-io - commons-io - 1.4 - - commons-fileupload commons-fileupload - 1.0 --===============6902935652734945011==-- From do-not-reply at jboss.org Fri Jul 22 04:05:19 2011 Content-Type: multipart/mixed; boundary="===============8473995871266738493==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4676 - jcr/trunk/packaging/module/src/main/javascript. Date: Fri, 22 Jul 2011 04:05:18 -0400 Message-ID: <201107220805.p6M85IaG022671@svn01.web.mwc.hst.phx2.redhat.com> --===============8473995871266738493== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-22 04:05:18 -0400 (Fri, 22 Jul 2011) New Revision: 4676 Modified: jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.module.js Log: EXOJCR-1315: Align commons-collection depenency version in JCR subprojects Modified: jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.modu= le.js =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.module.js = 2011-07-22 08:04:46 UTC (rev 4675) +++ jcr/trunk/packaging/module/src/main/javascript/jcr.packaging.module.js = 2011-07-22 08:05:18 UTC (rev 4676) @@ -34,8 +34,7 @@ module.frameworks =3D {} module.frameworks.web =3D = new Project("org.exoplatform.jcr", "exo.jcr.framework.web", "jar", mod= ule.version). = - addDependency(ws.rest). - addDependency(new Project("commons-chain", "commons-chain", "jar", "1.= 2")); + addDependency(ws.rest); = module.frameworks.command =3D new Project("org.exoplatform.jcr", "exo.jc= r.framework.command", "jar", module.version). addDependency(new Project("commons-fileupload", "commons-fileupload", = "jar", "1.2.1")); = --===============8473995871266738493==-- From do-not-reply at jboss.org Fri Jul 22 04:50:28 2011 Content-Type: multipart/mixed; boundary="===============4283640148448446288==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4677 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/impl/core/query and 1 other directory. Date: Fri, 22 Jul 2011 04:50:28 -0400 Message-ID: <201107220850.p6M8oSfT027567@svn01.web.mwc.hst.phx2.redhat.com> --===============4283640148448446288== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-22 04:50:28 -0400 (Fri, 22 Jul 2011) New Revision: 4677 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/query/lucene/QueryResultImpl.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/core/query/TestTwoWayRangeIterator.java Log: EXOJCR-1389 : Skip checking access when system session used. Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/query/lucene/QueryResultImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/QueryResultImpl.java 2011-07-22 08:05:18 UTC (r= ev 4676) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/query/lucene/QueryResultImpl.java 2011-07-22 08:50:28 UTC (r= ev 4677) @@ -18,6 +18,7 @@ = import org.exoplatform.services.jcr.access.AccessManager; import org.exoplatform.services.jcr.access.PermissionType; +import org.exoplatform.services.jcr.access.SystemIdentity; import org.exoplatform.services.jcr.datamodel.InternalQName; import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.datamodel.QPath; @@ -140,6 +141,11 @@ * The maximum size of this result if limit > 0 */ private final long limit; + = + /** + * If true, it means we're using a System session. + */ + private final boolean isSystemSession; = /** * Creates a new query result. The concrete sub class is responsible for @@ -182,6 +188,7 @@ this.docOrder =3D orderProps.length =3D=3D 0 && documentOrder; this.offset =3D offset; this.limit =3D limit; + this.isSystemSession =3D SystemIdentity.SYSTEM.equals(session.getUse= rID()); } = /** @@ -415,6 +422,10 @@ */ private boolean isAccessGranted(ScoreNode[] nodes) throws RepositoryExc= eption { + if (isSystemSession) + { + return true; + } for (int i =3D 0; i < nodes.length; i++) { try Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/query/TestTwoWayRangeIterator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/query/TestTwoWayRangeIterator.java 2011-07-22 08:05:18 UTC (= rev 4676) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/query/TestTwoWayRangeIterator.java 2011-07-22 08:50:28 UTC (= rev 4677) @@ -17,15 +17,20 @@ package org.exoplatform.services.jcr.impl.core.query; = import org.exoplatform.services.jcr.JcrImplBaseTest; +import org.exoplatform.services.jcr.access.PermissionType; +import org.exoplatform.services.jcr.core.CredentialsImpl; +import org.exoplatform.services.jcr.core.ExtendedNode; import org.exoplatform.services.jcr.impl.core.query.lucene.TwoWayRangeIter= ator; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; = +import java.util.HashMap; import java.util.NoSuchElementException; import java.util.Random; = import javax.jcr.Node; import javax.jcr.RepositoryException; +import javax.jcr.Session; import javax.jcr.query.Query; import javax.jcr.query.QueryManager; import javax.jcr.query.QueryResult; @@ -44,6 +49,8 @@ private final Log log =3D ExoLogger.getLogger("exo.jcr.component.core.T= estScoreNodeIterator"); = private Random random =3D new Random(); + = + private Session userSession; = private final int TEST_NODES_COUNT =3D 100; = @@ -57,6 +64,12 @@ { Node subnode =3D testRoot.addNode("TestNode" + String.format("%07= d", i)); subnode.setProperty("val", i); + ExtendedNode subnode2 =3D (ExtendedNode)testRoot.addNode("TestNod= e2-" + String.format("%07d", i)); + subnode2.setProperty("val", i); + subnode2.addMixin("exo:privilegeable"); + HashMap perm =3D new HashMap(= ); + perm.put("admin", PermissionType.ALL); + subnode2.setPermissions(perm); } = } @@ -68,7 +81,15 @@ Node testRoot =3D root.addNode(testRootNodeName); prepareRoot(testRoot); root.save(); + userSession =3D repository.login(new CredentialsImpl("john", "exo".t= oCharArray()), "ws"); } + = + @Override + protected void tearDown() throws Exception + { + userSession.logout(); + super.tearDown(); + } = // Check random skipping from start of set public void testSkipFromStart() throws Exception @@ -259,7 +280,7 @@ protected void checkPosition(ScoreNodeTester testAction, long expectedP= osition) throws RepositoryException { = - QueryManager qm =3D workspace.getQueryManager(); + QueryManager qm =3D userSession.getWorkspace().getQueryManager(); = // Doc order String strDocOrder =3D "select * from nt:unstructured where jcr:path= like '/" + testRootNodeName + "/%'"; --===============4283640148448446288==-- From do-not-reply at jboss.org Mon Jul 25 05:18:04 2011 Content-Type: multipart/mixed; boundary="===============8389954606961906270==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4678 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/core and 1 other directory. Date: Mon, 25 Jul 2011 05:18:04 -0400 Message-ID: <201107250918.p6P9I4BM025508@svn01.web.mwc.hst.phx2.redhat.com> --===============8389954606961906270== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-25 05:18:04 -0400 (Mon, 25 Jul 2011) New Revision: 4678 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/core/ExtendedNode.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/NodeImpl.java Log: EXOJCR-267: Implement Lazy Loading mechanism for the method Node.getNodes Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/core/ExtendedNode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/ExtendedNode.java 2011-07-22 08:50:28 UTC (rev 4677) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/core/ExtendedNode.java 2011-07-25 09:18:04 UTC (rev 4678) @@ -27,6 +27,7 @@ import javax.jcr.AccessDeniedException; import javax.jcr.InvalidItemStateException; import javax.jcr.Node; +import javax.jcr.NodeIterator; import javax.jcr.RepositoryException; import javax.jcr.UnsupportedRepositoryOperationException; import javax.jcr.lock.Lock; @@ -118,4 +119,15 @@ */ Lock lock(boolean isDeep, long timeOut) throws UnsupportedRepositoryOpe= rationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryExceptio= n; + + /** + * Returns a NodeIterator over all child Node= s of + * this Node. Does not include properties of this + * Node. If this node has no child nodes, then an empty it= erator is returned. + * = + * @return A NodeIterator over all child Node= s of + * this Node. + * @throws RepositoryException If an error occurs. + */ + public NodeIterator getNodesLazily() throws RepositoryException; } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-22 08:50:28 UTC (rev 4677) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-25 09:18:04 UTC (rev 4678) @@ -1084,6 +1084,14 @@ /** * {@inheritDoc} */ + public NodeIterator getNodesLazily() throws RepositoryException + { + return null; + } + + /** + * {@inheritDoc} + */ public NodeIterator getNodes(String namePattern) throws RepositoryExcep= tion { = --===============8389954606961906270==-- From do-not-reply at jboss.org Tue Jul 26 07:42:02 2011 Content-Type: multipart/mixed; boundary="===============7301513142624912355==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4679 - in core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database: creator and 2 other directories. Date: Tue, 26 Jul 2011 07:42:02 -0400 Message-ID: <201107261142.p6QBg2Gt017294@svn01.web.mwc.hst.phx2.redhat.com> --===============7301513142624912355== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2011-07-26 07:42:01 -0400 (Tue, 26 Jul 2011) New Revision: 4679 Added: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/ser= vices/database/utils/ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/ser= vices/database/utils/ExceptionManagementHelper.java Modified: 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/jdbc/DBSchemaCreator.java Log: EXOJCR-1287 : Add ExceptionManagementHelper. 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 2011-07-25 09:18:04 UTC (rev 4678) +++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/se= rvices/database/creator/DBCreator.java 2011-07-26 11:42:01 UTC (rev 4679) @@ -25,6 +25,7 @@ import org.exoplatform.container.xml.InitParams; import org.exoplatform.container.xml.PropertiesParam; import org.exoplatform.container.xml.Property; +import org.exoplatform.services.database.utils.ExceptionManagementHelper; = import java.io.IOException; import java.io.InputStream; @@ -242,14 +243,7 @@ } catch (SQLException e) { - String errorTrace =3D ""; - while (e !=3D null) - { - errorTrace +=3D e.getMessage() + "; "; - e =3D e.getNextException(); - } - - throw new DBCreatorException("Can't execute SQL script " + errorT= race); + throw new DBCreatorException("Can't execute SQL script : " + Exce= ptionManagementHelper.getFullSQLExceptionMessage(e)); } finally { Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatf= orm/services/database/jdbc/DBSchemaCreator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/jdbc/DBSchemaCreator.java 2011-07-25 09:18:04 UTC (rev 4678) +++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/se= rvices/database/jdbc/DBSchemaCreator.java 2011-07-26 11:42:01 UTC (rev 4679) @@ -19,6 +19,7 @@ package org.exoplatform.services.database.jdbc; = import org.exoplatform.container.component.ComponentPlugin; +import org.exoplatform.services.database.utils.ExceptionManagementHelper; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.naming.InitialContextInitializer; @@ -137,16 +138,8 @@ } catch (SQLException e) { - SQLException next =3D e.getNextException(); - String errorTrace =3D ""; - while (next !=3D null) - { - errorTrace +=3D next.getMessage() + "; "; - next =3D next.getNextException(); - } - Throwable cause =3D e.getCause(); log.error("Could not create db schema of DataSource: '" + dsName = + "'. Reason: " + e.getMessage() + "; " - + errorTrace + (cause !=3D null ? " (Cause: " + cause.getMessa= ge() + ")" : "") + ". Last command: " + sql, e); + + ExceptionManagementHelper.getFullSQLExceptionMessage(e= ) + ". Last command: " + sql, e); } finally { Added: core/trunk/exo.core.component.database/src/main/java/org/exoplatform= /services/database/utils/ExceptionManagementHelper.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/utils/ExceptionManagementHelper.java = (rev 0) +++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/se= rvices/database/utils/ExceptionManagementHelper.java 2011-07-26 11:42:01 UT= C (rev 4679) @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2003-2011 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.database.utils; + +import java.sql.SQLException; + +/** + * Created by The eXo Platform SAS. + * = + *
    Date: 2011 + * + * @author Alex Re= shetnyak = + * @version $Id: ExceptionManagementHelper.java 111 2011-11-11 11:11:11Z r= ainf0x $ + */ +public class ExceptionManagementHelper +{ + /** + * Prepare message from SQLException. + * = + * @param e + * SQLException + * @return String + * The message form SQLException + */ + public static String getFullSQLExceptionMessage(SQLException e) + { + SQLException next =3D e.getNextException(); + String errorTrace =3D ""; + while (next !=3D null) + { + errorTrace +=3D next.getMessage() + "; "; + next =3D next.getNextException(); + } + + Throwable cause =3D e.getCause(); + + return errorTrace + (cause !=3D null ? " (Cause: " + cause.getMessag= e() + ")" : ""); + } +} Property changes on: core/trunk/exo.core.component.database/src/main/java/o= rg/exoplatform/services/database/utils/ExceptionManagementHelper.java ___________________________________________________________________ Added: svn:mime-type + text/plain --===============7301513142624912355==-- From do-not-reply at jboss.org Tue Jul 26 07:44:21 2011 Content-Type: multipart/mixed; boundary="===============4892190751034468291==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4680 - in jcr/trunk/exo.jcr.component.core: src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms and 2 other directories. Date: Tue, 26 Jul 2011 07:44:21 -0400 Message-ID: <201107261144.p6QBiL83017320@svn01.web.mwc.hst.phx2.redhat.com> --===============4892190751034468291== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: areshetnyak Date: 2011-07-26 07:44:20 -0400 (Tue, 26 Jul 2011) New Revision: 4680 Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/backup/rdbms/SybaseDBRestore.java Modified: jcr/trunk/exo.jcr.component.core/pom.xml jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/backup/rdbms/DBBackup.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/backup/rdbms/DBRestore.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/util/jdbc/DBInitializer.java Log: EXOJCR-1287 : The problem with restore RDBMS backup on Sybase was fixed. 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 2011-07-26 11:42:01 UTC (rev 4= 679) +++ jcr/trunk/exo.jcr.component.core/pom.xml 2011-07-26 11:44:20 UTC (rev 4= 680) @@ -78,6 +78,10 @@
    org.exoplatform.core + exo.core.component.database + + + org.exoplatform.core exo.core.component.security.core Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/backup/rdbms/DBBackup.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/backup/rdbms/DBBackup.java 2011-07-26 11:42:01 UTC (rev 4679) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/backup/rdbms/DBBackup.java 2011-07-26 11:44:20 UTC (rev 4680) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.backup.rdbms; = import org.exoplatform.commons.utils.PrivilegedFileHelper; +import org.exoplatform.services.database.utils.ExceptionManagementHelper; import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.jcr.impl.backup.BackupException; @@ -112,18 +113,7 @@ } catch (SQLException e) { - SQLException next =3D e.getNextException(); - String errorTrace =3D ""; - while (next !=3D null) - { - errorTrace +=3D next.getMessage() + "; "; - next =3D next.getNextException(); - } - - Throwable cause =3D e.getCause(); - String msg =3D "SQL Exception: " + errorTrace + (cause !=3D null = ? " (Cause: " + cause.getMessage() + ")" : ""); - - throw new BackupException(msg, e); + throw new BackupException("SQL Exception: " + ExceptionManagement= Helper.getFullSQLExceptionMessage(e), e); } finally { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/backup/rdbms/DBRestore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/backup/rdbms/DBRestore.java 2011-07-26 11:42:01 UTC (rev 4679) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/backup/rdbms/DBRestore.java 2011-07-26 11:44:20 UTC (rev 4680) @@ -20,6 +20,7 @@ = import org.exoplatform.commons.utils.PrivilegedFileHelper; import org.exoplatform.commons.utils.PrivilegedSystemHelper; +import org.exoplatform.services.database.utils.ExceptionManagementHelper; import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; import org.exoplatform.services.jcr.config.WorkspaceEntry; import org.exoplatform.services.jcr.core.security.JCRRuntimePermissions; @@ -98,7 +99,7 @@ /** * Connection to database. */ - private final Connection jdbcConn; + protected final Connection jdbcConn; = /** * Directory with tables dump. @@ -108,7 +109,7 @@ /** * Restore table rules. */ - private final Map tables; + protected final Map tables; = /** * Database cleaner. @@ -116,6 +117,16 @@ private final DBClean dbClean; = /** + * Database dialect. + */ + protected final int dialect; + + /** + * Contains constraint for JCR_SITEM or JCR_MITEM table. = + */ + private String constraint; + + /** * Constructor DBRestor. * = * @throws NamingException = @@ -135,6 +146,7 @@ this.storageDir =3D storageDir; this.tables =3D tables; this.dbClean =3D DBCleanService.getDBCleaner(this.jdbcConn, wsConfig= ); + this.dialect =3D DialectDetecter.detect(jdbcConn.getMetaData()).hash= Code(); } = /** @@ -157,56 +169,18 @@ */ public void restore() throws BackupException { - Statement st =3D null; - try { - int dialect =3D DialectDetecter.detect(jdbcConn.getMetaData()).ha= shCode(); - for (Entry entry : tables.entrySet()) { String tableName =3D entry.getKey(); RestoreTableRule restoreRule =3D entry.getValue(); = - String constraint =3D null; - if (tableName.equals("JCR_SITEM") || tableName.equals("JCR_MIT= EM")) - { - if (dialect !=3D DBBackup.DB_DIALECT_SYBASE) - { - // resolve constraint name depends on database - String constraintName; - if (dialect =3D=3D DBBackup.DB_DIALECT_DB2 || dialect = =3D=3D DBBackup.DB_DIALECT_DB2V8) - { - constraintName =3D "JCR_FK_" + (restoreRule.getDstMul= tiDb() ? "M" : "S") + "ITEM_PAREN"; - } - else - { - constraintName =3D "JCR_FK_" + (restoreRule.getDstMul= tiDb() ? "M" : "S") + "ITEM_PARENT"; - } - constraint =3D - "CONSTRAINT " + constraintName + " FOREIGN KEY(PARENT= _ID) REFERENCES " + tableName + "(ID)"; + preRestoreTable(tableName, restoreRule); = - // drop constraint - st =3D jdbcConn.createStatement(); - - if (dialect =3D=3D DBBackup.DB_DIALECT_MYSQL || dialect = =3D=3D DBBackup.DB_DIALECT_MYSQL_UTF8) - { - st.execute("ALTER TABLE " + tableName + " DROP FOREIG= N KEY " + constraintName); - } - else - { - st.execute("ALTER TABLE " + tableName + " DROP CONSTR= AINT " + constraintName); - } - } - } - restoreTable(storageDir, jdbcConn, tableName, restoreRule); = - if (constraint !=3D null) - { - // add constraint - st.execute("ALTER TABLE " + tableName + " ADD " + constrain= t); - } + postRestoreTable(tableName, restoreRule); } } catch (IOException e) @@ -215,21 +189,99 @@ } catch (SQLException e) { - SQLException next =3D e.getNextException(); - String errorTrace =3D ""; - while (next !=3D null) + throw new BackupException("SQL Exception: " + ExceptionManagement= Helper.getFullSQLExceptionMessage(e), e); + } + } + + /** + * Prepare of restore table. (Drop constraint, etc...) + * = + * @param tableName + * name of table = + * @param restoreRule + * rule of table = + * @throws SQLException + * Will throw SQLException if fail. + */ + public void preRestoreTable(String tableName, RestoreTableRule restoreR= ule) throws SQLException + { + Statement st =3D null; + + try + { + if (tableName.equals("JCR_SITEM") || tableName.equals("JCR_MITEM"= )) { - errorTrace +=3D next.getMessage() + "; "; - next =3D next.getNextException(); + // resolve constraint name depends on database + String constraintName; + if (dialect =3D=3D DBBackup.DB_DIALECT_DB2 || dialect =3D=3D D= BBackup.DB_DIALECT_DB2V8) + { + constraintName =3D "JCR_FK_" + (restoreRule.getDstMultiDb()= ? "M" : "S") + "ITEM_PAREN"; + } + else + { + constraintName =3D "JCR_FK_" + (restoreRule.getDstMultiDb()= ? "M" : "S") + "ITEM_PARENT"; + } + constraint =3D "CONSTRAINT " + constraintName + " FOREIGN KEY(= PARENT_ID) REFERENCES " + tableName + "(ID)"; + + // drop constraint + st =3D jdbcConn.createStatement(); + + if (dialect =3D=3D DBBackup.DB_DIALECT_MYSQL || dialect =3D=3D= DBBackup.DB_DIALECT_MYSQL_UTF8) + { + st.execute("ALTER TABLE " + tableName + " DROP FOREIGN KEY = " + constraintName); + } + else + { + st.execute("ALTER TABLE " + tableName + " DROP CONSTRAINT "= + constraintName); + } } + } + finally + { + if (st !=3D null) + { + try + { + st.close(); + } + catch (SQLException e) + { + LOG.warn("Can't close statemnt", e); + } + } + } + } = - Throwable cause =3D e.getCause(); - String msg =3D "SQL Exception: " + errorTrace + (cause !=3D null = ? " (Cause: " + cause.getMessage() + ")" : ""); + /** + * After of restore table. (Add constraint, etc...) + * = + * @param tableName + * name of table = + * @param restoreRule + * rule of table = + * @throws SQLException + * Will throw SQLException if fail. + */ + public void postRestoreTable(String tableName, RestoreTableRule restore= Rule) throws SQLException + { + Statement st =3D null; = - throw new BackupException(msg, e); + try + { + if (tableName.equals("JCR_SITEM") || tableName.equals("JCR_MITEM"= )) + { + if (constraint !=3D null) + { + // add constraint + st =3D jdbcConn.createStatement(); + st.execute("ALTER TABLE " + tableName + " ADD " + constrain= t); + } + } } finally { + constraint =3D null; + if (st !=3D null) { try @@ -312,8 +364,6 @@ PreparedStatement insertNode =3D null; ResultSet tableMetaData =3D null; = - int dialect =3D DialectDetecter.detect(jdbcConn.getMetaData()).hashC= ode(); - // switch table name to lower case if (dialect =3D=3D DBBackup.DB_DIALECT_PGSQL) { Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/backup/rdbms/SybaseDBRestore.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/backup/rdbms/SybaseDBRestore.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/backup/rdbms/SybaseDBRestore.java 2011-07-26 11:44:20 UTC (rev 46= 80) @@ -0,0 +1,189 @@ +/* + * Copyright (C) 2003-2011 eXo Platform SAS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either version 3 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see. + */ +package org.exoplatform.services.jcr.impl.backup.rdbms; + +import org.exoplatform.services.database.utils.ExceptionManagementHelper; +import org.exoplatform.services.jcr.config.RepositoryConfigurationExceptio= n; +import org.exoplatform.services.jcr.config.WorkspaceEntry; +import org.exoplatform.services.jcr.impl.backup.BackupException; +import org.exoplatform.services.jcr.impl.util.io.FileCleaner; + +import java.io.File; +import java.sql.Connection; +import java.sql.SQLException; +import java.util.Map; +import java.util.Map.Entry; + +import javax.naming.NamingException; + +/** + * Created by The eXo Platform SAS. + * = + *
    Date: 2011 + * + * @author Alex Re= shetnyak = + * @version $Id: SybaseDBRestore.java 111 2011-11-11 11:11:11Z rainf0x $ + */ +public class SybaseDBRestore + extends DBRestore +{ + private String restoreConstraint =3D null; + = + public SybaseDBRestore(File storageDir, Connection jdbcConn, Map tables, + WorkspaceEntry wsConfig, FileCleaner fileCleaner) throws Namin= gException, SQLException, + RepositoryConfigurationException + { + super(storageDir, jdbcConn, tables, wsConfig, fileCleaner); + } + + /** + * {@inheritDoc} + */ + public void clean() throws BackupException + { + + try + { + // the Sybase is not allowed DDL query (CREATE TABLE, DROP TABLE,= etc. ) within a multi-statement transaction + jdbcConn.setAutoCommit(true); + + for (Entry entry : tables.entrySet()) + { + String tableName =3D entry.getKey(); + RestoreTableRule restoreRule =3D entry.getValue(); + + super.preRestoreTable(tableName, restoreRule); + } + } + catch (SQLException e) + { + throw new BackupException(ExceptionManagementHelper.getFullSQLExc= eptionMessage(e), e); + } + finally + { + try + { + jdbcConn.setAutoCommit(false); + } + catch (SQLException e) + { + LOG.warn("Can't set auto commit to \"false\"", e); + } + } + + super.clean(); + } + + /** + * {@inheritDoc} + */ + public void commit() throws BackupException + { + super.commit(); + = + restoreConstraint(); + } + + /** + * {@inheritDoc} + */ + public void rollback() throws BackupException + { + BackupException rollbackException =3D null; + + try + { + super.rollback(); + } + catch (BackupException e) + { + rollbackException =3D e; + throw rollbackException; + } + finally + { + try + { + restoreConstraint(); + } + catch (BackupException e) + { + if (rollbackException !=3D null) + { + LOG.error("Can not restore constraint", e); + throw rollbackException; + } + else + { + throw e; + } + } + } + } + + /** + * Restore constraint. + * = + * @throws BackupException + * Will throw BackupException if fail. + */ + private void restoreConstraint() throws BackupException + { + try + { + // restore constraint + jdbcConn.setAutoCommit(true); + + for (Entry entry : tables.entrySet()) + { + String tableName =3D entry.getKey(); + RestoreTableRule restoreRule =3D entry.getValue(); + + super.postRestoreTable(tableName, restoreRule); + } + } + catch (SQLException e) + { + throw new BackupException(e); + } + finally + { + try + { + jdbcConn.setAutoCommit(false); + } + catch (SQLException e) + { + LOG.warn("Can't set auto commit to \"false\"", e); + } + } + } + + /** + * {@inheritDoc} + */ + public void preRestoreTable(String tableName, RestoreTableRule restoreR= ule) throws SQLException + { + } + + /** + * {@inheritDoc} + */ + public void postRestoreTable(String tableName, RestoreTableRule restore= Rule) throws SQLException + { + } +} 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 2011-07-26 11:42:01 = UTC (rev 4679) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-07-26 11:44:20 = UTC (rev 4680) @@ -36,6 +36,7 @@ import org.exoplatform.services.jcr.impl.backup.rdbms.DBRestore; import org.exoplatform.services.jcr.impl.backup.rdbms.DirectoryRestore; import org.exoplatform.services.jcr.impl.backup.rdbms.RestoreTableRule; +import org.exoplatform.services.jcr.impl.backup.rdbms.SybaseDBRestore; import org.exoplatform.services.jcr.impl.clean.rdbms.DBCleanService; import org.exoplatform.services.jcr.impl.core.query.NodeDataIndexingIterat= or; import org.exoplatform.services.jcr.impl.core.query.Reindexable; @@ -1083,7 +1084,7 @@ = if (multiDb) { - scripts.put("JCR_MITEM", "select * from JCR_MITEM where JCR_MI= TEM.name <> '" + Constants.ROOT_PARENT_NAME + scripts.put("JCR_MITEM", "select * from JCR_MITEM where JCR_MI= TEM.NAME <> '" + Constants.ROOT_PARENT_NAME + "'"); scripts.put("JCR_MVALUE", "select * from JCR_MVALUE"); scripts.put("JCR_MREF", "select * from JCR_MREF"); @@ -1272,7 +1273,14 @@ } tables.put(dstTableName, restoreTableRule); = - restorers.add(new DBRestore(storageDir, jdbcConn, tables, wsConfi= g, swapCleaner)); + if (dbDialect =3D=3D DBConstants.DB_DIALECT_SYBASE) + { + restorers.add(new SybaseDBRestore(storageDir, jdbcConn, tables= , wsConfig, swapCleaner)); + } + else + { + restorers.add(new DBRestore(storageDir, jdbcConn, tables, wsCo= nfig, swapCleaner)); + } = // prepare value storage restorer File backupValueStorageDir =3D new File(storageDir, "values"); 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 2011-07-26 11:42:01 UTC (rev 4679) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/util/jdbc/DBInitializer.java 2011-07-26 11:44:20 UTC (rev 4680) @@ -19,6 +19,7 @@ package org.exoplatform.services.jcr.impl.util.jdbc; = import org.exoplatform.commons.utils.SecurityHelper; +import org.exoplatform.services.database.utils.ExceptionManagementHelper; import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCUtils; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; @@ -409,18 +410,9 @@ } else { - SQLException next =3D e.getNextException(); - String errorTrace =3D ""; - while (next !=3D null) - { - errorTrace +=3D next.getMessage() + "; "; - next =3D next.getNextException(); - } - Throwable cause =3D e.getCause(); String msg =3D - "Could not create db schema of DataSource: '" + containerNa= me + "'. Reason: " + e.getMessage() + "; " - + errorTrace + (cause !=3D null ? " (Cause: " + cause.ge= tMessage() + ")" : "") + ". Last command: " - + sql; + "Could not create db schema of DataSource: '" + conta= inerName + "'. Reason: " + e.getMessage() + "; " + + ExceptionManagementHelper.getFullSQLExcept= ionMessage(e) + ". Last command: " + sql; = throw new DBInitializerException(msg, e); } --===============4892190751034468291==-- From do-not-reply at jboss.org Wed Jul 27 09:44:30 2011 Content-Type: multipart/mixed; boundary="===============0811520637947300346==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4681 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db. Date: Wed, 27 Jul 2011 09:44:30 -0400 Message-ID: <201107271344.p6RDiUjX006958@svn01.web.mwc.hst.phx2.redhat.com> --===============0811520637947300346== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sergiykarpenko Date: 2011-07-27 09:44:30 -0400 (Wed, 27 Jul 2011) New Revision: 4681 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java Log: EXOJCR-1393: mssql range pattern symbols escape added Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/MSSQLMultiDbJDBCConnection.java 2011= -07-26 11:44:20 UTC (rev 4680) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/MSSQLMultiDbJDBCConnection.java 2011= -07-27 13:44:30 UTC (rev 4681) @@ -75,7 +75,7 @@ + " from JCR_SITEM I where I.I_CLASS=3D1) as A where A.r__ <= =3D ? and A.r__ > ?) J on P.PARENT_ID =3D J.ID" + " where P.I_CLASS=3D2 and V.PROPERTY_ID=3DP.ID order by J.ID= "; } - = + /** * {@inheritDoc} */ @@ -95,5 +95,36 @@ findNodesAndProperties.setInt(2, offset); = return findNodesAndProperties.executeQuery(); - } = + } + + /** + * Replace underscore in pattern with escaped symbol. Replace jcr-wildc= ard '*' with sql-wildcard '%'. + *

    + * MSSQL have a range pattern '[..]' so we need to escape it too. + * = + * @param pattern + * @return pattern with escaped underscore and fixed wildcard symbols + */ + protected String fixEscapeSymbols(String pattern) + { + char[] chars =3D pattern.toCharArray(); + StringBuilder sb =3D new StringBuilder(); + for (int i =3D 0; i < chars.length; i++) + { + switch (chars[i]) + { + case '*' : + sb.append('%'); + break; + case '_' : + case '%' : + case '[' : + case ']' : + sb.append(getWildcardEscapeSymbold()); + default : + sb.append(chars[i]); + } + } + return sb.toString(); + } } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.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/MSSQLSingleDbJDBCConnection.java 201= 1-07-26 11:44:20 UTC (rev 4680) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/MSSQLSingleDbJDBCConnection.java 201= 1-07-27 13:44:30 UTC (rev 4681) @@ -78,7 +78,7 @@ + " ) J on P.PARENT_ID =3D J.ID" + " where P.I_CLASS=3D2 and P.CONTAINER_NAME=3D? and V.PROPERT= Y_ID=3DP.ID order by J.ID"; } - = + /** * {@inheritDoc} */ @@ -100,5 +100,37 @@ findNodesAndProperties.setString(4, containerName); = return findNodesAndProperties.executeQuery(); - } = + } + + /** + * Replace underscore in pattern with escaped symbol. Replace jcr-wildc= ard '*' with sql-wildcard '%'. + *

    + * MSSQL have a range pattern '[..]' so we need to escape it too. + * = + * @param pattern + * @return pattern with escaped underscore and fixed wildcard symbols + */ + protected String fixEscapeSymbols(String pattern) + { + char[] chars =3D pattern.toCharArray(); + StringBuilder sb =3D new StringBuilder(); + for (int i =3D 0; i < chars.length; i++) + { + switch (chars[i]) + { + case '*' : + sb.append('%'); + break; + case '_' : + case '%' : + case '[' : + case ']' : + sb.append(getWildcardEscapeSymbold()); + default : + sb.append(chars[i]); + } + } + return sb.toString(); + } + } --===============0811520637947300346==-- From do-not-reply at jboss.org Wed Jul 27 10:23:32 2011 Content-Type: multipart/mixed; boundary="===============0617099367859337131==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4682 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration. Date: Wed, 27 Jul 2011 10:23:32 -0400 Message-ID: <201107271423.p6RENWcl016853@svn01.web.mwc.hst.phx2.redhat.com> --===============0617099367859337131== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-27 10:23:32 -0400 (Wed, 27 Jul 2011) New Revision: 4682 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-1452: Implementation 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 2011-07-27 13:44:30 UT= C (rev 4681) +++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US= /modules/jcr/configuration/exo-jcr-configuration.xml 2011-07-27 14:23:32 UT= C (rev 4682) @@ -264,6 +264,18 @@ + + + + + lazy-node-iterator-page-size + + the page size for lazy iterator. Indicates how many nod= es + can be retrieved from storage per request. The default value is + 100 + + + = value-storages: The list of v= alue --===============0617099367859337131==-- From do-not-reply at jboss.org Wed Jul 27 10:23:58 2011 Content-Type: multipart/mixed; boundary="===============0581846642008445387==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4683 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/dataflow/persistent and 12 other directories. Date: Wed, 27 Jul 2011 10:23:58 -0400 Message-ID: <201107271423.p6RENw8V016863@svn01.web.mwc.hst.phx2.redhat.com> --===============0581846642008445387== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-27 10:23:57 -0400 (Wed, 27 Jul 2011) New Revision: 4683 Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/infinispan/CacheNodesByPageId.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/core/TestGetNodesLazily.java Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/dataflow/ItemDataConsumer.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/dataflow/persistent/WorkspaceStorageCache.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/NodeImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionDataManager.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/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.ja= va jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/session/TransactionableDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/JDBCStorageConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/storage/WorkspaceDataContainer.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java Log: EXOJCR-1452: Implementation Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/ItemDataConsumer.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/ItemDataConsumer.java 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/ItemDataConsumer.java 2011-07-27 14:23:57 UTC (rev 4683) @@ -87,6 +87,22 @@ List getChildNodesData(NodeData parent) throws RepositoryExce= ption; = /** + * Get child Nodes of the parent node. + * = + * @param parent = + * the parent data + * @param fromOrderNum + * the last order number returned in previous request + * @param limit = + * the recommended amount of children nodes to return = + * @param childs + * will contain the resulted children nodes + * @return true if there are data to retrieve for next request and fals= e in other case = + */ + boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int = limit, List childs) + throws RepositoryException; + + /** * Get child Nodes of the parent node.ItemDataFilter used to reduce cou= nt of returned items. = * But not guarantee that only items matching filter will be returned. * = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/dataflow/persistent/WorkspaceStorageCache.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/persistent/WorkspaceStorageCache.java 2011-07-27 14:23:32 UTC= (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/dataflow/persistent/WorkspaceStorageCache.java 2011-07-27 14:23:57 UTC= (rev 4683) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 eXo Platform SAS. +R * 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 @@ -91,6 +91,18 @@ List getChildNodes(NodeData parent); = /** + * Get page of child nodes. + * = + * @param parent + * the parent data + * @param fromOrderNum + * the order number related to page of child nodes + * @return child nodes for parent if found; empty list if no items foun= d; null if no items + * initialized + */ + List getChildNodesByPage(final NodeData parent, final int fro= mOrderNum); + + /** * Get child nodes by pattern. * = * @param parent @@ -166,6 +178,18 @@ void put(ItemData item); = /** + * Adds page of child nodes. + * = + * @param parent + * the parent data + * @param childs + * the list of child nodes + * @param fromOrderNum + * the order number related to page of child nodes = + */ + void addChildNodesByPage(NodeData parent, List childs, int fr= omOrderNum); + + /** * Adds (update should not be the case!) list of child nodes. The list = can be empty. If list is * null the operation is ignored. * = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-27 14:23:57 UTC (rev 4683) @@ -1036,7 +1036,6 @@ */ public NodeIterator getNodes() throws RepositoryException { - long start =3D 0; if (LOG.isDebugEnabled()) { @@ -1086,7 +1085,7 @@ */ public NodeIterator getNodesLazily() throws RepositoryException { - return null; + return new LazyNodeIteratorByPage(dataManager); } = /** @@ -3336,7 +3335,6 @@ = protected boolean canRead(ItemData item) { - // TODO check if deleted // if (session.getTransientNodesManager(= ).isDeleted(item.getQPath())) return (filter !=3D null ? filter.accept(item) : true) && session.getAccessManager().hasPermission( item.isNode() ? ((NodeData)item).getACL() : nodeData().getA= CL(), new String[]{PermissionType.READ}, @@ -3388,10 +3386,33 @@ */ public void skip(long skipNum) { + trySkip(skipNum, true); + } + + /** + * Tries to skip some elements. + * = + * @param throwException + * indicates to throw an NoSuchElementException if can't sk= ip defined count of elements + * @return how many elememnts remained to skip + */ + protected long trySkip(long skipNum, boolean throwException) + { pos +=3D skipNum; while (skipNum-- > 1) { - iter.next(); + try + { + iter.next(); + } + catch (NoSuchElementException e) + { + if (throwException) + { + throw e; + } + return skipNum; + } } = try @@ -3403,6 +3424,8 @@ LOG.error(e); throw new NoSuchElementException(e.toString()); } + + return 0; } = /** @@ -3413,7 +3436,6 @@ if (size =3D=3D -1) { // calc size - int sz =3D pos + (next !=3D null ? 1 : 0); if (iter.hasNext()) { @@ -3454,6 +3476,201 @@ } } = + protected class LazyNodeIteratorByPage implements RangeIterator, NodeIt= erator + { + private final SessionDataManager dataManager; + + private int limit =3D session.getLazyNodeIteratorPageSize(); + + private int fromOrderNum =3D 0; + + private boolean hasNext =3D true; + = + private int pos =3D 0; + + private LazyNodeIterator lazyNodeItetator =3D new LazyNodeIterator(n= ew ArrayList()); + + LazyNodeIteratorByPage(SessionDataManager dataManager) throws Reposi= toryException + { + this.dataManager =3D dataManager; + } + + /** + * {@inheritDoc} + */ + public Node nextNode() + { + return (Node)next(); + } + + /** + * {@inheritDoc} + */ + public boolean hasNext() + { + boolean hasNext =3D lazyNodeItetator.hasNext(); + + if (!hasNext) + { + if (this.hasNext) + { + try + { + readNextPage(0); + return hasNext(); + } + catch (NoSuchElementException e) + { + return false; + } + } + else + { + return false; + } + } + else + { + return true; + } + } + + /** + * {@inheritDoc} + */ + public Object next() + { + try + { + return nextItem(); + } + catch (NoSuchElementException e) + { + if (hasNext) + { + try + { + readNextPage(0); + return next(); + } + catch (NoSuchElementException e1) + { + throw e1; + } + } + else + { + throw e; + } + } + } + + /** + * {@inheritDoc} + */ + public void remove() + { + LOG.warn("remove() method is not supported in LazyNodeIteratorByP= age"); + } + + /** + * {@inheritDoc} + */ + public void skip(long skipNum) + { + pos +=3D skipNum; + + long leftToSkip =3D lazyNodeItetator.trySkip(skipNum, false); + if (leftToSkip !=3D 0) + { + readNextPage(leftToSkip); + } + } + + /** + * {@inheritDoc} + */ + public long getSize() + { + return -1; + } + + public ItemImpl nextItem() + { + ItemImpl item =3D lazyNodeItetator.nextItem(); + pos++; + + return item; + } + + /** + * {@inheritDoc} + */ + public long getPosition() + { + return pos; + } + + private void readNextPage(long skip) throws NoSuchElementException + { + List storedNodes =3D new ArrayList(); + try + { + hasNext =3D dataManager.getChildNodesDataByPage(nodeData(), fr= omOrderNum, limit, storedNodes); + } + catch (RepositoryException e) + { + LOG.error("There are no more elements in iterator", e); + throw new NoSuchElementException(e.toString()); + } + = + Collections.sort(storedNodes, new NodeDataOrderComparator()); + + int size =3D storedNodes.size(); + if (size !=3D 0) + { + fromOrderNum =3D storedNodes.get(size - 1).getOrderNumber() + = 1; + + while (skip > 0 && storedNodes.size() > 0) + { + storedNodes.remove(0); + skip--; + } + } + + if (skip !=3D 0) + { + if (hasNext) + { + readNextPage(skip); + } + else + { + throw new NoSuchElementException("There are no more element= s in iterator"); + } + } + else + { + try + { + lazyNodeItetator =3D new LazyNodeIterator(storedNodes); + } + catch (RepositoryException e) + { + if (hasNext) + { + readNextPage(skip); + } + else + { + LOG.error("There are no more elements in iterator", e); + throw new NoSuchElementException(e.toString()); + } + } + } + } + } + protected class LazyNodeIterator extends LazyItemsIterator implements N= odeIterator { LazyNodeIterator(List nodes) throws RepositoryEx= ception Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-27 14:23:57 UTC (rev 4683) @@ -946,6 +946,79 @@ /** * {@inheritDoc} */ + public boolean getChildNodesDataByPage(final NodeData parent, int fromO= rderNum, int limit, List childs) + throws RepositoryException + { + long start =3D 0; + if (log.isDebugEnabled()) + { + start =3D System.currentTimeMillis(); + log.debug("getChildNodesData(" + parent.getQPath().getAsString() = + " , itemDataFilter) >>>>>"); + } + + try + { + boolean hasNext =3D false; + if (!isNew(parent.getIdentifier())) + { + hasNext =3D transactionableManager.getChildNodesDataByPage(par= ent, fromOrderNum, limit, childs); + } + + // merge data + Collection transientDescendants =3D changesLog.getLast= ChildrenStates(parent, true); + + if (!transientDescendants.isEmpty()) + { + // 2 get ALL persisted descendants + Map descendants =3D new LinkedHashMap(); + for (int i =3D 0, length =3D childs.size(); i < length; i++) + { + NodeData childNode =3D childs.get(i); + descendants.put(childNode.getIdentifier(), childNode); + } + + // merge data + for (ItemState state : transientDescendants) + { + NodeData data =3D (NodeData)state.getData(); + + if (state.isDeleted()) + { + descendants.remove(data.getIdentifier()); + } + else if (state.isMixinChanged()) + { + NodeData removedData =3D descendants.remove(data.getIden= tifier()); + if (removedData !=3D null) + { + descendants.put(data.getIdentifier(), data); + } + } + else if (!hasNext && (state.isAdded() || state.isRenamed() = || state.isUpdated())) + { + descendants.put(data.getIdentifier(), data); + } + } + + childs.clear(); + childs.addAll(descendants.values()); + } + = + return hasNext; + } + finally + { + if (log.isDebugEnabled()) + { + log.debug("getChildNodesData(" + parent.getQPath().getAsString= () + ") <<<<< " + + ((System.currentTimeMillis() - start) / 1000d) + "sec"); + } + } + } + + /** + * {@inheritDoc} + */ public List getChildNodesData(NodeData parent) throws Reposit= oryException { long start =3D 0; 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 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionImpl.java 2011-07-27 14:23:57 UTC (rev 4683) @@ -167,6 +167,8 @@ = private boolean triggerEventsForDescendentsOnRename; = + private int lazyNodeIteatorPageSize; + private final int lazyReadThreshold; = private final SessionRegistry sessionRegistry; @@ -244,9 +246,14 @@ = sessionRegistry.registerSession(this); this.lastAccessTime =3D System.currentTimeMillis(); + = this.triggerEventsForDescendentsOnRename =3D wsConfig.getContainer().getParameterBoolean(WorkspaceDataContaine= r.TRIGGER_EVENTS_FOR_DESCENDENTS_ON_RENAME, WorkspaceDataContainer.TRIGGER_EVENTS_FOR_DESCENDENTS_ON_RENAM= E_DEFAULT); + + this.lazyNodeIteatorPageSize =3D + wsConfig.getContainer().getParameterInteger(WorkspaceDataContaine= r.LAZY_NODE_ITERATOR_PAGE_SIZE, + WorkspaceDataContainer.LAZY_NODE_ITERATOR_PAGE_SIZE_DEFAULT); } = /** @@ -1127,6 +1134,11 @@ return lazyReadThreshold; } = + int getLazyNodeIteratorPageSize() + { + return lazyNodeIteatorPageSize; + } + @Override public String toString() { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataMan= ager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.j= ava 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.j= ava 2011-07-27 14:23:57 UTC (rev 4683) @@ -73,6 +73,15 @@ /** * {@inheritDoc} */ + public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNu= m, int limit, List childs) + throws RepositoryException + { + return persistentManager.getChildNodesDataByPage(parent, fromOrderNu= m, limit, childs); + } + + /** + * {@inheritDoc} + */ public int getLastOrderNumber(final NodeData parent) throws RepositoryE= xception { return persistentManager.getLastOrderNumber(parent); 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 2011-07-27= 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-07-27= 14:23:57 UTC (rev 4683) @@ -513,6 +513,79 @@ /** * {@inheritDoc} */ + public boolean getChildNodesDataByPage(final NodeData nodeData, final i= nt fromOrderNum, final int limit, + final List childs) throws RepositoryException + { + List childNodes =3D null; + if (cache.isEnabled()) + { + childNodes =3D cache.getChildNodes(nodeData); + if (childNodes !=3D null) + { + childs.addAll(childNodes); + return false; + } + else + { + childNodes =3D cache.getChildNodesByPage(nodeData, fromOrderNu= m); + if (childNodes !=3D null) + { + childs.addAll(childNodes); + return true; + } + } + } + final DataRequest request =3D new DataRequest(nodeData.getIdentifier= (), DataRequest.GET_NODES); + + try + { + request.start(); + if (cache.isEnabled()) + { + // Try first to get the value from the cache since a + // request could have been launched just before + childNodes =3D cache.getChildNodes(nodeData); + if (childNodes !=3D null) + { + childs.addAll(childNodes); + return false; + } + else + { + childNodes =3D cache.getChildNodesByPage(nodeData, fromOrde= rNum); + if (childNodes !=3D null) + { + childs.addAll(childNodes); + return true; + } + } + } + + return executeAction(new PrivilegedExceptionAction() + { + public Boolean run() throws RepositoryException + { + boolean hasNext =3D + CacheableWorkspaceDataManager.super.getChildNodesDataByP= age(nodeData, fromOrderNum, limit, childs); + + if (cache.isEnabled()) + { + cache.addChildNodesByPage(nodeData, childs, fromOrderNum= ); + } + + return hasNext; + } + }); + } + finally + { + request.done(); + } + } + + /** + * {@inheritDoc} + */ @Override public List getChildNodesData(NodeData parentData, List patternFilters) throws RepositoryException @@ -1003,21 +1076,8 @@ List childNodes =3D CacheableWorkspaceDataManager= .super.getChildNodesData(nodeData); if (cache.isEnabled()) { - NodeData parentData =3D (NodeData)getItemData(nodeData.g= etIdentifier()); - - if (parentData !=3D null) - { - cache.addChildNodes(parentData, childNodes); - } + cache.addChildNodes(nodeData, childNodes); } - else - { - // ini ACL - for (int i =3D 0; i < childNodes.size(); i++) - { - childNodes.set(i, (NodeData)initACL(nodeData, childNo= des.get(i))); - } - } = return childNodes; } @@ -1322,12 +1382,7 @@ // TODO childProperties.size() > 0 for SDB if (childProperties.size() > 0 && cache.isEnabled()) { - NodeData parentData =3D (NodeData)getItemData(nodeData.g= etIdentifier()); - - if (parentData !=3D null) - { - cache.addChildProperties(parentData, childProperties); - } + cache.addChildProperties(nodeData, childProperties); } return childProperties; } @@ -1644,12 +1699,7 @@ // TODO propertiesList.size() > 0 for SDB if (propertiesList.size() > 0 && cache.isEnabled()) { - NodeData parentData =3D (NodeData)getItemData(nodeData.g= etIdentifier()); - - if (parentData !=3D null) - { - cache.addChildPropertiesList(parentData, propertiesLi= st); - } + cache.addChildPropertiesList(nodeData, propertiesList); } return propertiesList; } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/LinkedWorkspaceStorageCacheImpl.java 2011-07-= 27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java 2011-07-= 27 14:23:57 UTC (rev 4683) @@ -2184,24 +2184,28 @@ = public void addChildProperties(NodeData parent, QPathEntryFilter patter= n, List childProperties) { - // TODO Auto-generated method stub } = public List getChildProperties(NodeData parent, QPathEntr= yFilter pattern) { - // TODO Auto-generated method stub return null; } = public void addChildNodes(NodeData parent, QPathEntryFilter pattern, Li= st childNodes) { - // TODO Auto-generated method stub - } = public List getChildNodes(NodeData parent, QPathEntryFilter p= attern) { - // TODO Auto-generated method stub return null; } + + public List getChildNodesByPage(NodeData parent, int fromOrde= rNum) + { + return null; + } + + public void addChildNodesByPage(NodeData parent, List childs,= int fromOrderNum) + { + } } 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 2011-07-= 27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2011-07-= 27 14:23:57 UTC (rev 4683) @@ -91,6 +91,20 @@ * {@inheritDoc} */ @Override + public boolean getChildNodesDataByPage(NodeData nodeData, int fromOrder= Num, int limit, List childs) + throws RepositoryException + { + if (isSystemDescendant(nodeData.getQPath()) && !this.equals(versionD= ataManager)) + { + return versionDataManager.getChildNodesDataByPage(nodeData, fromO= rderNum, limit, childs); + } + return super.getChildNodesDataByPage(nodeData, fromOrderNum, limit, = childs); + } + + /** + * {@inheritDoc} + */ + @Override public List getChildNodesData(final NodeData nodeData, final = List patternFilters) throws RepositoryException { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-07-2= 7 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-07-2= 7 14:23:57 UTC (rev 4683) @@ -45,6 +45,7 @@ import org.exoplatform.services.jcr.impl.dataflow.session.TransactionableR= esourceManager; import org.exoplatform.services.jcr.impl.dataflow.session.TransactionableR= esourceManagerListener; import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder; +import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCStorageConnectio= n; import org.exoplatform.services.jcr.storage.WorkspaceDataContainer; import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection; import org.exoplatform.services.log.ExoLogger; @@ -614,7 +615,6 @@ */ public List getChildNodesData(final NodeData nodeData) throws= RepositoryException { - final WorkspaceStorageConnection con =3D dataContainer.openConnectio= n(); try { @@ -629,6 +629,32 @@ /** * {@inheritDoc} */ + public boolean getChildNodesDataByPage(final NodeData nodeData, int fro= mOrderNum, int limit, List childs) + throws RepositoryException + { + final WorkspaceStorageConnection con =3D dataContainer.openConnectio= n(); + if (con instanceof JDBCStorageConnection) + { + try + { + childs.addAll(((JDBCStorageConnection)con).getChildNodesDataBy= Page(nodeData, fromOrderNum, limit)); + return childs.size() =3D=3D limit; + } + finally + { + con.close(); + } + } + else + { + throw new UnsupportedOperationException( + "The method getChildNodesDataLazily is supported only for JDBC= StorageConnection"); + } + } + + /** + * {@inheritDoc} + */ public List getChildNodesData(final NodeData nodeData, List patternFilters) throws RepositoryException { Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/servi= ces/jcr/impl/dataflow/persistent/infinispan/CacheNodesByPageId.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/infinispan/CacheNodesByPageId.java = (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/infinispan/CacheNodesByPageId.java 2011-07-27= 14:23:57 UTC (rev 4683) @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2011 eXo Platform SAS. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.exoplatform.services.jcr.impl.dataflow.persistent.infinispan; + +/** + * @author Anatoliy Bazko + * @version $Id: CachePagedNodes.java 34360 2009-07-22 23:58:59Z tolusha $ + */ +public class CacheNodesByPageId extends CacheKey +{ + + CacheNodesByPageId() + { + super(); + } + + CacheNodesByPageId(String id) + { + super(id); + } + + @Override + public boolean equals(Object obj) + { + if (obj instanceof CacheNodesByPageId) + { + CacheNodesByPageId cacheNodesByPageId =3D (CacheNodesByPageId)obj; + return (cacheNodesByPageId.hash =3D=3D hash && cacheNodesByPageId= .fullId.equals(fullId)); + } + else + { + return false; + } + } + +} Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCac= he.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/infinispan/ISPNCacheWorkspaceStorageCache.jav= a 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.jav= a 2011-07-27 14:23:57 UTC (rev 4683) @@ -592,6 +592,57 @@ /** * {@inheritDoc} */ + public void addChildNodesByPage(NodeData parent, List childs,= int fromOrderNum) + { + boolean inTransaction =3D cache.isTransactionActive(); + try + { + if (!inTransaction) + { + cache.beginTransaction(); + } + + cache.setLocal(true); + + CacheNodesByPageId cacheId =3D new CacheNodesByPageId(parent.getI= dentifier()); + Map> pages =3D (Map>)ca= che.get(cacheId); + if (pages =3D=3D null) + { + pages =3D new HashMap>(); + } + + if (childs.size() > 0) + { + Set set =3D new HashSet(); + for (NodeData child : childs) + { + putNode(child, ModifyChildOption.NOT_MODIFY); + set.add(child.getIdentifier()); + } + + pages.put(fromOrderNum, set); + cache.put(cacheId, pages); + } + else + { + // cache fact of empty childs list + pages.put(fromOrderNum, new HashSet()); + cache.put(cacheId, pages); + } + } + finally + { + cache.setLocal(false); + if (!inTransaction) + { + dedicatedTxCommit(); + } + } + } + + /** + * {@inheritDoc} + */ public void addChildNodes(NodeData parent, List childs) { boolean inTransaction =3D cache.isTransactionActive(); @@ -611,12 +662,12 @@ putNode(child, ModifyChildOption.NOT_MODIFY); set.add(child.getIdentifier()); } - cache.putIfAbsent(new CacheNodesId(parent.getIdentifier()), se= t); + cache.put(new CacheNodesId(parent.getIdentifier()), set); } else { // cache fact of empty childs list - cache.putIfAbsent(new CacheNodesId(parent.getIdentifier()), ne= w HashSet()); + cache.put(new CacheNodesId(parent.getIdentifier()), new HashSe= t()); } } finally @@ -796,6 +847,43 @@ /** * {@inheritDoc} */ + public List getChildNodesByPage(final NodeData parent, final = int fromOrderNum) + { + // get list of children uuids + final Map> pages =3D + (Map>)cache.get(new CacheNodesByPageId(paren= t.getIdentifier())); + + if (pages =3D=3D null) + { + return null; + } + + Set set =3D pages.get(fromOrderNum); + if (set =3D=3D null) + { + return null; + } + + final List childs =3D new ArrayList(); + for (String childId : set) + { + NodeData child =3D (NodeData)cache.get(new CacheId(childId)); + if (child =3D=3D null) + { + return null; + } + + childs.add(child); + } + + // order children by orderNumber, as HashSet returns children in oth= er order + Collections.sort(childs, new NodesOrderComparator()); + return childs; + } + + /** + * {@inheritDoc} + */ public List getChildNodes(final NodeData parent, final QPathE= ntryFilter pattern) { // get list of children uuids @@ -986,6 +1074,8 @@ cache.addToPatternList(new CachePatternNodesId(node.getParentI= dentifier()), node); cache.addToList(new CacheNodesId(node.getParentIdentifier()), = node.getIdentifier(), modifyListsOfChild =3D=3D ModifyChildOption.FORCE_MODIFY); + + cache.remove(new CacheNodesByPageId(node.getParentIdentifier()= )); } } = @@ -1122,24 +1212,27 @@ cache.remove(new CacheId(item.getIdentifier())); cache.remove(new CacheQPath(item.getParentIdentifier(), item.getQPat= h(), ItemType.getItemType(item))); = - if (item.getParentIdentifier() !=3D null) + if (item.isNode()) { - if (item.isNode()) + if (item.getParentIdentifier() !=3D null) { - cache.remove(new CacheNodesId(item.getIdentifier())); - cache.remove(new CachePropsId(item.getIdentifier())); cache.removeFromPatternList(new CachePatternNodesId(item.getPa= rentIdentifier()), item); - cache.remove(new CachePatternNodesId(item.getIdentifier())); - cache.remove(new CachePatternPropsId(item.getIdentifier())); cache.removeFromList(new CacheNodesId(item.getParentIdentifier= ()), item.getIdentifier()); - cache.remove(new CacheRefsId(item.getIdentifier())); + cache.remove(new CacheNodesByPageId(item.getParentIdentifier()= )); } - else - { - cache.removeFromPatternList(new CachePatternPropsId(item.getPa= rentIdentifier()), item); - cache.removeFromList(new CachePropsId(item.getParentIdentifier= ()), item.getIdentifier()); - } + + cache.remove(new CacheNodesId(item.getIdentifier())); + cache.remove(new CachePropsId(item.getIdentifier())); + cache.remove(new CacheNodesByPageId(item.getIdentifier())); + cache.remove(new CachePatternNodesId(item.getIdentifier())); + cache.remove(new CachePatternPropsId(item.getIdentifier())); + cache.remove(new CacheRefsId(item.getIdentifier())); } + else + { + cache.removeFromPatternList(new CachePatternPropsId(item.getParen= tIdentifier()), item); + cache.removeFromList(new CachePropsId(item.getParentIdentifier())= , item.getIdentifier()); + } } = /** 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 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.ja= va 2011-07-27 14:23:57 UTC (rev 4683) @@ -71,9 +71,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; = @@ -149,6 +151,8 @@ = public static final String CHILD_NODES_BY_PATTERN_LIST =3D "$CHILD_NODE= S_BY_PATTERN_LIST".intern(); = + public static final String CHILD_NODES_BY_PAGE_LIST =3D "$CHILD_NODES_B= Y_PAGE_LIST".intern(); + public static final String LOCKS =3D "$LOCKS".intern(); = public static final String REFERENCE =3D "$REFERENCE".intern(); @@ -175,6 +179,8 @@ = protected final Fqn childPropsList; = + protected final Fqn childNodesByPageList; + protected final Fqn childPropsByPatternList; = protected final Fqn childNodesByPatternList; @@ -219,7 +225,7 @@ { NodeData node =3D (NodeData)cache.get(makeItemFqn((Strin= g)child), ITEM_DATA); = - if (node =3D=3D null || node instanceof NullItemData) + if (node =3D=3D null) { return null; } @@ -404,7 +410,7 @@ protected Long execute(Void arg) throws RuntimeException { // Total number of JBC nodes in the cache - the total amount of r= esident nodes - return numNodes(cache.getNode(rootFqn)) - 9; + return numNodes(cache.getNode(rootFqn)) - 10; } }; = @@ -612,6 +618,7 @@ this.childProps =3D Fqn.fromRelativeElements(rootFqn, CHILD_PROPS); this.childNodesList =3D Fqn.fromRelativeElements(rootFqn, CHILD_NODE= S_LIST); this.childPropsList =3D Fqn.fromRelativeElements(rootFqn, CHILD_PROP= S_LIST); + this.childNodesByPageList =3D Fqn.fromRelativeElements(rootFqn, CHIL= D_NODES_BY_PAGE_LIST); this.childPropsByPatternList =3D Fqn.fromRelativeElements(rootFqn, C= HILD_PROPS_BY_PATTERN_LIST); this.childNodesByPatternList =3D Fqn.fromRelativeElements(rootFqn, C= HILD_NODES_BY_PATTERN_LIST); = @@ -669,6 +676,7 @@ createResidentNode(childNodesList); createResidentNode(childProps); createResidentNode(childPropsList); + createResidentNode(childNodesByPageList); createResidentNode(childPropsByPatternList); createResidentNode(childNodesByPatternList); createResidentNode(itemsRoot); @@ -899,7 +907,8 @@ else { // cache fact of empty childs list - cache.putIfAbsent(makeChildListFqn(childNodesList, parent.getI= dentifier()), ITEM_LIST, new HashSet()); + cache.putIfAbsent(makeChildListFqn(childNodesList, parent.getI= dentifier()), ITEM_LIST, + new HashSet()); } } finally @@ -912,17 +921,68 @@ } } = + /** * {@inheritDoc} */ - public void addChildNodes(NodeData parent, QPathEntryFilter pattern, Li= st childs) + public void addChildNodesByPage(NodeData parent, List childs,= int fromOrderNum) { boolean inTransaction =3D cache.isTransactionActive(); try { + if (!inTransaction) + { + cache.beginTransaction(); + } = + cache.setLocal(true); + = + Fqn fqn =3D makeChildListFqn(childNodesByPageList, parent= .getIdentifier()); + Map> pages =3D (Map>)ca= che.get(fqn, ITEM_LIST); + if (pages =3D=3D null) + { + pages =3D new HashMap>(); + } + = + if (childs.size() > 0) + { + Set set =3D new HashSet(); + for (NodeData child : childs) + { + putNode(child, ModifyChildOption.NOT_MODIFY); + set.add(child.getIdentifier()); + } + + pages.put(fromOrderNum, set); + cache.put(fqn, ITEM_LIST, pages); + } + else + { + // cache fact of empty childs list + pages.put(fromOrderNum, new HashSet()); + cache.put(fqn, ITEM_LIST, pages); + } + } + finally + { + cache.setLocal(false); if (!inTransaction) { + dedicatedTxCommit(); + } + } + } + + /** + * {@inheritDoc} + */ + public void addChildNodes(NodeData parent, QPathEntryFilter pattern, Li= st childs) + { + boolean inTransaction =3D cache.isTransactionActive(); + try + { + if (!inTransaction) + { cache.beginTransaction(); } = @@ -1077,6 +1137,43 @@ /** * {@inheritDoc} */ + public List getChildNodesByPage(final NodeData parent, final = int fromOrderNum) + { + final Map> pages =3D + (Map>)cache + .get(makeChildListFqn(childNodesByPageList, parent.getIdentifi= er()), ITEM_LIST); + + if (pages =3D=3D null) + { + return null; + } + + Set set =3D pages.get(fromOrderNum); + if (set =3D=3D null) + { + return null; + } + + final List childs =3D new ArrayList(); + for (Object child : set) + { + NodeData node =3D (NodeData)cache.get(makeItemFqn((String)child),= ITEM_DATA); + if (node =3D=3D null) + { + return null; + } + + childs.add(node); + } + + // order children by orderNumber, as HashSet returns children in oth= er order + Collections.sort(childs, new NodesOrderComparator()); + return childs; + } + + /** + * {@inheritDoc} + */ public List getChildNodes(final NodeData parent, final QPathE= ntryFilter pattern) { // empty Set marks that there is no child nodes @@ -1094,7 +1191,7 @@ { NodeData node =3D (NodeData)cache.get(makeItemFqn((String)chil= d), ITEM_DATA); = - if (node =3D=3D null || node instanceof NullItemData) + if (node =3D=3D null) { return null; } @@ -1390,6 +1487,8 @@ ITEM_LIST, node); cache.addToList(makeChildListFqn(childNodesList, node.getParen= tIdentifier()), ITEM_LIST, node.getIdentifier(), modifyListsOfChild =3D=3D ModifyChild= Option.FORCE_MODIFY); + + cache.removeNode(makeChildListFqn(childNodesByPageList, node.g= etParentIdentifier())); } } = @@ -1537,23 +1636,35 @@ cache.removeFromList(makeChildListFqn(childNodesList, item.get= ParentIdentifier()), ITEM_LIST, item .getIdentifier()); = - // remove from CHILD_NODES as parent - cache.removeNode(makeChildListFqn(childNodes, item.getIdentifi= er())); + // remove from CHILD_NODES_BY_PATTERN_LIST of parent + cache.removeFromPatternList(makeChildListFqn(childNodesByPatte= rnList, item.getParentIdentifier()), + PATTERN_OBJ, ITEM_LIST, item); = - // remove from CHILD_NODES_LIST as parent - cache.removeNode(makeChildListFqn(childNodesList, item.getIden= tifier())); + // remove from CHILD_NODES_BY_PAGE_LIST of parent + cache.removeNode(makeChildListFqn(childNodesByPageList, item.g= etParentIdentifier())); + } = - // remove from CHILD_PROPS as parent - cache.removeNode(makeChildListFqn(childProps, item.getIdentifi= er())); + // remove from CHILD_NODES as parent + cache.removeNode(makeChildListFqn(childNodes, item.getIdentifier(= ))); = - // remove from CHILD_PROPS_LIST as parent - cache.removeNode(makeChildListFqn(childPropsList, item.getIden= tifier())); - } + // remove from CHILD_NODES_LIST as parent + cache.removeNode(makeChildListFqn(childNodesList, item.getIdentif= ier())); = - cache.removeFromPatternList(makeChildListFqn(childNodesByPatternL= ist, item.getParentIdentifier()), - PATTERN_OBJ, ITEM_LIST, item); + // remove from CHILD_PROPS as parent + cache.removeNode(makeChildListFqn(childProps, item.getIdentifier(= ))); + + // remove from CHILD_PROPS_LIST as parent + cache.removeNode(makeChildListFqn(childPropsList, item.getIdentif= ier())); + + // remove from CHILD_NODES_BY_PAGE_LIST as parent + cache.removeNode(makeChildListFqn(childNodesByPageList, item.getI= dentifier())); + + // remove from CHILD_NODES_BY_PATTERN_LIST as parent cache.removeNode(makeChildListFqn(childNodesByPatternList, item.g= etIdentifier())); + + // remove from CHILD_PROPS_BY_PATTERN_LIST as parent cache.removeNode(makeChildListFqn(childPropsByPatternList, item.g= etIdentifier())); + cache.removeNode(makeRefFqn(item.getIdentifier())); } else @@ -1569,6 +1680,7 @@ cache.removeFromPatternList(makeChildListFqn(childPropsByPatternL= ist, item.getParentIdentifier()), PATTERN_OBJ, ITEM_LIST, item); } + // remove from ITEMS cache.removeNode(makeItemFqn(item.getIdentifier())); } @@ -1942,6 +2054,7 @@ cache.removeNode(childProps); cache.removeNode(childNodesList); cache.removeNode(childPropsList); + cache.removeNode(childNodesByPageList); cache.removeNode(childNodesByPatternList); cache.removeNode(childPropsByPatternList); = @@ -1952,6 +2065,7 @@ createResidentNode(childNodesList); createResidentNode(childProps); createResidentNode(childPropsList); + createResidentNode(childNodesByPageList); createResidentNode(childNodesByPatternList); createResidentNode(childPropsByPatternList); createResidentNode(itemsRoot); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-= 07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-= 07-27 14:23:57 UTC (rev 4683) @@ -144,6 +144,15 @@ /** * {@inheritDoc} */ + public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNu= m, int limit, List childs) + throws RepositoryException + { + return storageDataManager.getChildNodesDataByPage(parent, fromOrderN= um, limit, copyNodes(childs)); + } + + /** + * {@inheritDoc} + */ public int getLastOrderNumber(final NodeData parent) throws RepositoryE= xception { return storageDataManager.getLastOrderNumber(parent); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2011-07-27 14:23= :32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2011-07-27 14:23= :57 UTC (rev 4683) @@ -102,6 +102,45 @@ return nodes; } = + /** + * {@inheritDoc} + */ + public boolean getChildNodesDataByPage(final NodeData parent, int fromO= rderNum, int limit, List childs) + throws RepositoryException + { + boolean hasNext =3D storageDataManager.getChildNodesDataByPage(paren= t, fromOrderNum, limit, childs); + + if (txStarted()) + { + // merge data + List txChanges =3D transactionLog.getChildrenChanges(p= arent.getIdentifier(), true); + if (txChanges.size() > 0) + { + for (ItemState state : txChanges) + { + if (state.isDeleted()) + { + childs.remove(state.getData()); + } + if (state.isMixinChanged()) + { + boolean isExists =3D childs.remove(state.getData()); + if (isExists) + { + childs.add((NodeData)state.getData()); + } + } + else if (!hasNext && (state.isAdded() || state.isRenamed() = || state.isUpdated())) + { + childs.add((NodeData)state.getData()); + } + } + } + } + + return hasNext; + } + public List getChildNodesData(NodeData parent, List patternFilters) throws RepositoryException { List nodes =3D storageDataManager.getChildNodesData(parent= , patternFilters); 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 2011-07-27 14:23:32 UTC (= rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-07-27 14:23:57 UTC (= rev 4683) @@ -1164,6 +1164,54 @@ } = /** + * = + * @param parent + * @param lastOrderNum + * @param limit + * @return + * @throws RepositoryException + * @throws IllegalStateException + */ + public List getChildNodesDataByPage(NodeData parent, int from= OrderNum, int limit) throws RepositoryException, + IllegalStateException + { + checkIfOpened(); + try + { + ResultSet node =3D findChildNodesByParentIdentifier(getInternalId= (parent.getIdentifier()), fromOrderNum, limit); + try + { + List childrens =3D new ArrayList(); + while (node.next()) + { + childrens.add((NodeData)itemData(parent.getQPath(), node, I= _CLASS_NODE, parent.getACL())); + } + + return childrens; + } + finally + { + try + { + node.close(); + } + catch (SQLException e) + { + LOG.error("Can't close the ResultSet: " + e); + } + } + } + catch (SQLException e) + { + throw new RepositoryException(e); + } + catch (IOException e) + { + throw new RepositoryException(e); + } + } + + /** * {@inheritDoc} */ public List listChildPropertiesData(NodeData parent) thro= ws RepositoryException, IllegalStateException @@ -2133,7 +2181,6 @@ protected PersistedNodeData loadNodeRecord(QPath parentPath, String cna= me, String cid, String cpid, int cindex, int cversion, int cnordernumb, AccessControlList parentACL) throws R= epositoryException, SQLException { - try { InternalQName qname =3D InternalQName.parse(cname); @@ -2851,6 +2898,9 @@ = protected abstract ResultSet findNodesAndProperties(String lastNodeId, = int offset, int limit) throws SQLException; = + protected abstract ResultSet findChildNodesByParentIdentifier(String pa= rentCid, int fromOrderNum, int limit) + throws SQLException; + protected abstract int addReference(PropertyData data) throws SQLExcept= ion, IOException; = protected abstract int renameNode(NodeData data) throws SQLException; Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-07-27 14:23:32 UT= C (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-07-27 14:23:57 UT= C (rev 4683) @@ -418,6 +418,15 @@ return findPropertiesByParentId.executeQuery(); } = + /** + * {@inheritDoc} + */ + protected ResultSet findChildNodesByParentIdentifier(String parentCid, = int lastOrderNum, int limit) + throws SQLException + { + throw new UnsupportedOperationException("findChildNodesByParentIdent= ifier is not supported for old queries"); + } + // -------- values processing ------------ = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-07-27 14:23:32 U= TC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-07-27 14:23:57 U= TC (rev 4683) @@ -432,6 +432,15 @@ return updateProperty.executeUpdate(); } = + /** + * {@inheritDoc} + */ + protected ResultSet findChildNodesByParentIdentifier(String parentCid, = int lastOrderNum, int limit) + throws SQLException + { + throw new UnsupportedOperationException("findChildNodesByParentIdent= ifier is not supported for old queries"); + } + // -------- values processing ------------ = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/CQJDBCStorageConnection.java 2011-07-27= 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2011-07-27= 14:23:57 UTC (rev 4683) @@ -99,13 +99,18 @@ protected String FIND_NODE_MAIN_PROPERTIES_BY_PARENTID_CQ; = /** - * FIND_PROPERTIES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE; + * FIND_PROPERTIES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE. */ protected String FIND_PROPERTIES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE; = /** - * FIND_NODES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE; + * FIND_NODES_BY_PARENTID_LAZILY. */ + protected String FIND_NODES_BY_PARENTID_LAZILY_CQ; + + /** + * FIND_NODES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE. + */ protected String FIND_NODES_BY_PARENTID_AND_PATTERN_CQ_TEMPLATE; = /** @@ -138,6 +143,8 @@ = protected PreparedStatement findPropertyById; = + protected PreparedStatement findNodesByParentIdLazilyCQ; + protected PreparedStatement deleteValueDataByOrderNum; = protected PreparedStatement updateValue; @@ -1123,6 +1130,11 @@ { findNodesByParentIdAndComplexPatternCQ.close(); } + + if (findNodesByParentIdLazilyCQ !=3D null) + { + findNodesByParentIdLazilyCQ.close(); + } } catch (SQLException e) { Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-07-2= 7 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-07-2= 7 14:23:57 UTC (rev 4683) @@ -205,6 +205,13 @@ "select I.P_TYPE, V.STORAGE_DESC from JCR_MITEM I, JCR_MVALUE V w= here I.ID =3D ? and V.PROPERTY_ID =3D I.ID"; DELETE_VALUE_BY_ORDER_NUM =3D "delete from JCR_MVALUE where PROPERTY= _ID=3D? and ORDER_NUM >=3D ?"; UPDATE_VALUE =3D "update JCR_MVALUE set DATA=3D?, STORAGE_DESC=3D? w= here PROPERTY_ID=3D? and ORDER_NUM=3D?"; + + FIND_NODES_BY_PARENTID_LAZILY_CQ =3D + "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA" + + " from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V" + + " where I.I_CLASS=3D1 and I.PARENT_ID=3D? and I.N_ORDER_NUM = >=3D ? and" + + " P.I_CLASS=3D2 and P.PARENT_ID=3DI.ID and (P.NAME=3D'[http:= //www.jcp.org/jcr/1.0]primaryType' or P.NAME=3D'[http://www.jcp.org/jcr/1.0= ]mixinTypes' or P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]owner' or= P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]permissions')" + + " and V.PROPERTY_ID=3DP.ID order by I.N_ORDER_NUM, I.ID LIMI= T ?"; } = /** @@ -558,6 +565,24 @@ } } = + /** + * {@inheritDoc} + */ + protected ResultSet findChildNodesByParentIdentifier(String parentCid, = int fromOrderNum, int limit) + throws SQLException + { + if (findNodesByParentIdLazilyCQ =3D=3D null) + findNodesByParentIdLazilyCQ =3D dbConnection.prepareStatement(FIN= D_NODES_BY_PARENTID_LAZILY_CQ); + else + findNodesByParentIdLazilyCQ.clearParameters(); + + findNodesByParentIdLazilyCQ.setString(1, parentCid); + findNodesByParentIdLazilyCQ.setInt(2, fromOrderNum); + findNodesByParentIdLazilyCQ.setInt(3, limit); + + return findNodesByParentIdLazilyCQ.executeQuery(); + } + // -------- values processing ------------ = /** Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-07-= 27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-07-= 27 14:23:57 UTC (rev 4683) @@ -194,7 +194,6 @@ = UPDATE_NODE =3D "update JCR_SITEM set VERSION=3D?, I_INDEX=3D?, N_OR= DER_NUM=3D? where ID=3D?"; UPDATE_PROPERTY =3D "update JCR_SITEM set VERSION=3D?, P_TYPE=3D? wh= ere ID=3D?"; - //UPDATE_VALUE =3D "update JCR_SVALUE set DATA=3D?, STORAGE_DESC=3D?= where PROPERTY_ID=3D?, ORDER_NUM=3D?"; = DELETE_ITEM =3D "delete from JCR_SITEM where ID=3D?"; DELETE_VALUE =3D "delete from JCR_SVALUE where PROPERTY_ID=3D?"; @@ -205,12 +204,19 @@ + " V.DATA, V.ORDER_NUM, V.STORAGE_DESC from JCR_SVALUE V, JCR= _SITEM P" + " join (select I.ID, I.PARENT_ID, I.NAME, I.VERSION, I.I_IND= EX, I.N_ORDER_NUM from JCR_SITEM I" + " where I.CONTAINER_NAME=3D? AND I.I_CLASS=3D1 AND I.ID > ? = order by I.ID LIMIT ? OFFSET ?) J on P.PARENT_ID =3D J.ID" - + " where P.I_CLASS=3D2 and P.CONTAINER_NAME=3D? and V.PROPERT= Y_ID=3DP.ID order by J.ID"; + + " where P.I_CLASS=3D2 and P.CONTAINER_NAME=3D? and V.PROPERT= Y_ID=3DP.ID order by J.ID"; = FIND_PROPERTY_BY_ID =3D "select I.P_TYPE, V.STORAGE_DESC from JCR_SITEM I, JCR_SVALUE V w= here I.CONTAINER_NAME=3D? and I.ID =3D ? and V.PROPERTY_ID =3D I.ID"; DELETE_VALUE_BY_ORDER_NUM =3D "delete from JCR_SVALUE where PROPERTY= _ID=3D? and ORDER_NUM >=3D ?"; UPDATE_VALUE =3D "update JCR_SVALUE set DATA=3D?, STORAGE_DESC=3D? w= here PROPERTY_ID=3D? and ORDER_NUM=3D?"; + + FIND_NODES_BY_PARENTID_LAZILY_CQ =3D + "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA" + + " from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V" + + " where I.I_CLASS=3D1 and I.CONTAINER_NAME=3D? and I.PARENT_= ID=3D? and I.N_ORDER_NUM >=3D ? and " + + " P.I_CLASS=3D2 and P.CONTAINER_NAME=3D? and P.PARENT_ID=3DI= .ID and (P.NAME=3D'[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME=3D'[h= ttp://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME=3D'[http://www.exoplatform.= com/jcr/exo/1.0]owner' or P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0= ]permissions')" + + " and V.PROPERTY_ID=3DP.ID order by I.N_ORDER_NUM, I.ID LIMI= T ?"; } = /** @@ -480,6 +486,26 @@ return updateProperty.executeUpdate(); } = + /** + * {@inheritDoc} + */ + protected ResultSet findChildNodesByParentIdentifier(String parentCid, = int fromOrderNum, int limit) + throws SQLException + { + if (findNodesByParentIdLazilyCQ =3D=3D null) + findNodesByParentIdLazilyCQ =3D dbConnection.prepareStatement(FIN= D_NODES_BY_PARENTID_LAZILY_CQ); + else + findNodesByParentIdLazilyCQ.clearParameters(); + + findNodesByParentIdLazilyCQ.setString(1, containerName); + findNodesByParentIdLazilyCQ.setString(2, parentCid); + findNodesByParentIdLazilyCQ.setInt(3, fromOrderNum); + findNodesByParentIdLazilyCQ.setString(4, containerName); + findNodesByParentIdLazilyCQ.setInt(5, limit); + + return findNodesByParentIdLazilyCQ.executeQuery(); + } + // -------- values processing ------------ = /** 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 2011-07-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/storage/WorkspaceDataContainer.java 2011-07-27 14:23:57 UTC (rev 4683) @@ -42,6 +42,10 @@ = public static final boolean TRIGGER_EVENTS_FOR_DESCENDENTS_ON_RENAME_DE= FAULT =3D true; = + public static final String LAZY_NODE_ITERATOR_PAGE_SIZE =3D "lazy-node-= iterator-page-size"; + + public static final int LAZY_NODE_ITERATOR_PAGE_SIZE_DEFAULT =3D 100; + public final static String CONTAINER_NAME =3D "containerName"; = public final static String MAXBUFFERSIZE_PROP =3D "max-buffer-size"; Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/servi= ces/jcr/impl/core/TestGetNodesLazily.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestGetNodesLazily.java (rev 0) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestGetNodesLazily.java 2011-07-27 14:23:57 UTC (rev 4683) @@ -0,0 +1,410 @@ +/* + * 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.JcrImplBaseTest; +import org.exoplatform.services.jcr.core.ExtendedNode; +import org.exoplatform.services.jcr.impl.Constants; +import org.exoplatform.services.transaction.TransactionService; + +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.RangeIterator; +import javax.jcr.RepositoryException; +import javax.transaction.UserTransaction; + +/** + * Created by The eXo Platform SAS. + * = + * @author Nikolay Zamos= enchuk + * @version $Id: TestGetNode.java 111 2009-11-11 11:11:11Z nzamosenchuk $ + */ +public class TestGetNodesLazily extends JcrImplBaseTest +{ + private static String INDEX_PROPERTY =3D "indexNumber"; + + private NodeImpl testRoot; + + private int nodesCount; + + private TransactionService txService; + + @Override + public void setUp() throws Exception + { + super.setUp(); + testRoot =3D (NodeImpl)session.getRootNode().addNode("TestGetNodesLa= zily"); + + // add first 150 child nodes + nodesCount =3D 150; + for (int i =3D 0; i < nodesCount; i++) + { + testRoot.addNode("child" + i).setProperty(INDEX_PROPERTY, i); + } + session.save(); + txService =3D (TransactionService)container.getComponentInstanceOfTy= pe(TransactionService.class); + } + + /** + * Simple check, session log empty. + */ + public void testGetNodesLazilyBasicUsecase() throws Exception + { + // 150 nodes added in setup + assertChildNodes(testRoot, nodesCount); + } + + /** + * All child they reordered one by one and though must be returned in s= ame order = + */ + public void _testGetNodesLazilyReordered() throws Exception + { + // 150 nodes added in setup + for (int i =3D 0; i < nodesCount; i++) + { + NodeImpl node =3D (NodeImpl)testRoot.getNode("child" + i); + session.move(node.getPath(), node.getPath()); + } + session.save(); + assertChildNodes(testRoot, nodesCount); + } + = + /** + * All child they reordered one by one and though must be returned in s= ame order = + */ + public void _testGetNodesLazilyReorderedBackwards() throws Exception + { + // 150 nodes added in setup + // TODO : testcase fails + for (int i =3D nodesCount - 1; i >=3D 0; i--) + { + NodeImpl node =3D (NodeImpl)testRoot.getNode("child" + i); + session.move(node.getPath(), node.getPath()); + } + session.save(); + assertChildNodes(testRoot, nodesCount, true); + } + + /** + * Session move with save + */ + public void testGetNodesLazilyRenamedParent() throws Exception + { + // 150 nodes added in setup + // renaming parent + String newName =3D "new Name"; + session.move("/" + testRoot.getName(), "/" + newName); + NodeImpl newTestRoot =3D (NodeImpl)root.getNode(newName); + session.save(); + assertChildNodes(newTestRoot, nodesCount); + } + + //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Tests with non-empty ch= angesLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D = + + /** + * New nodes added into session log and not save + */ + public void testGetNodesLazilySessionAddedNodes() throws Exception + { + // 150 nodes added in setup + // adding 10 more nodes without save, so it is missing in persistent= layer but exist in session changes log + for (int i =3D 0; i < 10; i++) + { + testRoot.addNode("child" + nodesCount).setProperty(INDEX_PROPERTY= , nodesCount); + nodesCount++; + } + + assertChildNodes(testRoot, nodesCount); + } + + /** + * New nodes moved into session log and not save + */ + public void testGetNodesLazilySessionMovedNodes() throws Exception + { + session.getRootNode().addNode("child" + nodesCount).setProperty(INDE= X_PROPERTY, nodesCount); + session.save(); + + nodesCount++; + = + String newNodeName =3D "child" + (nodesCount - 1); + + session.move("/" + newNodeName, testRoot.getPath() + "/" + newNodeNa= me); + assertChildNodes(testRoot, nodesCount); + + testRoot.getNode(newNodeName).remove(); + nodesCount--; + + assertChildNodes(testRoot, nodesCount); + + session.save(); + assertChildNodes(testRoot, nodesCount); + } + + /** + * Change mixin in node. + */ + public void testGetNodesLazilySessionMixinChanged() throws Exception + { + testRoot.getNode("child0").addMixin("mix:lockable"); + + NodeIterator iterator =3D testRoot.getNodesLazily(); + NodeImpl node =3D (NodeImpl)iterator.nextNode(); + + assertTrue(node.isNodeType(Constants.MIX_LOCKABLE)); + } + + /** + * New nodes added into session log and not save + */ + public void testGetNodesLazilySessionNewAddedNodes() throws Exception + { + // adding 150 new nodes + NodeImpl localRoot =3D (NodeImpl)testRoot.addNode("localRoot"); + for (int i =3D 0; i < nodesCount; i++) + { + localRoot.addNode("child" + i).setProperty(INDEX_PROPERTY, i); + } + assertChildNodes(localRoot, nodesCount); + } + + /** + * Last 10 nodes removed. Session log has removed states for them + */ + public void testGetNodesLazilySessionRemovedNodes() throws Exception + { + // 150 nodes added in setup + // removing 10 nodes without save + for (int i =3D 0; i < 10; i++) + { + nodesCount--; + testRoot.getNode("child" + nodesCount).remove(); + } + assertChildNodes(testRoot, nodesCount); + } + + /** + * Session move without save + */ + public void testGetNodesLazilySessionRenamedParent() throws Exception + { + // 150 nodes added in setup + // renaming parent + String newName =3D "new Name"; + session.move("/" + testRoot.getName(), "/" + newName); + NodeImpl newTestRoot =3D (NodeImpl)root.getNode(newName); + assertChildNodes(newTestRoot, nodesCount); + } + + /** + * All child nodes are in session changes log and both in persisted lay= er. All they reordered one by one and though must = + * be returned in same order + */ + public void _testGetNodesLazilySessionReordered() throws Exception + { + // 150 nodes added in setup + // TODO : testcase fails + for (int i =3D nodesCount - 1; i >=3D 0; i--) + { + NodeImpl node =3D (NodeImpl)testRoot.getNode("child" + i); + session.move(node.getPath(), node.getPath()); + } + assertChildNodes(testRoot, nodesCount, true); + } + + //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D transactions related = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + public void testGetNodesLazilyTransaction() throws Exception + { + assertNotNull(txService); + UserTransaction ut =3D txService.getUserTransaction(); + ut.begin(); + + NodeImpl localRoot =3D (NodeImpl)testRoot.addNode("localRoot"); + for (int i =3D 0; i < nodesCount; i++) + { + localRoot.addNode("child" + i).setProperty(INDEX_PROPERTY, i); + } + // assert within session changes log + assertChildNodes(localRoot, nodesCount); + session.save(); + // assert within transaction changes log + assertChildNodes(localRoot, nodesCount); + ut.commit(); + // assert within persistent layer + assertChildNodes(localRoot, nodesCount); + } + + public void testGetNodesLazilyTransactionRollbackAdded() throws Excepti= on + { + assertNotNull(txService); + UserTransaction ut =3D txService.getUserTransaction(); + ut.begin(); + + int txNodesCount =3D nodesCount; + // 150 nodes added in setup + // adding 10 more nodes without save, so it is missing in persistent= layer but exist in session changes log + for (int i =3D 0; i < 10; i++) + { + testRoot.addNode("child" + txNodesCount).setProperty(INDEX_PROPER= TY, txNodesCount); + txNodesCount++; + } + session.save(); + // assert within transaction changes log + assertChildNodes(testRoot, txNodesCount); + ut.rollback(); + // assert within persistent layer, nodes should be rolled back + assertChildNodes(testRoot, nodesCount); + } + + public void testGetNodesLazilyTransactionRollbackRemoved() throws Excep= tion + { + assertNotNull(txService); + UserTransaction ut =3D txService.getUserTransaction(); + ut.begin(); + + // 150 nodes added in setup + // removing 10 nodes + int txNodesCount =3D nodesCount; + for (int i =3D 0; i < 10; i++) + { + txNodesCount--; + testRoot.getNode("child" + txNodesCount).remove(); + } + session.save(); + + // assert within transaction changes log + assertChildNodes(testRoot, txNodesCount); + ut.rollback(); + // assert within persistent layer, nodes should be rolled back + assertChildNodes(testRoot, nodesCount); + } + + //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D test iterator =3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + public void testGetNodesLazilyIterator() throws Exception + { + RangeIterator iterator =3D testRoot.getNodesLazily(); + + // there are 150 node, so it must have next + assertTrue(iterator.hasNext()); + // position is before first node = + assertEquals(0, iterator.getPosition()); + + // fetch first one (/child0) + iterator.next(); + assertEquals(1, iterator.getPosition()); + + // fetch second one (/child1) + iterator.next(); + assertEquals(2, iterator.getPosition()); + + // skip to /child12 + iterator.skip(10); + NodeImpl next =3D (NodeImpl)iterator.next(); + assertEquals(13, iterator.getPosition()); + assertEquals(12, next.getProperty(INDEX_PROPERTY).getLong()); + + iterator.skip(1); + next =3D (NodeImpl)iterator.next(); + assertEquals(15, iterator.getPosition()); + assertEquals(14, next.getProperty(INDEX_PROPERTY).getLong()); + + iterator.skip(100); + next =3D (NodeImpl)iterator.next(); + assertEquals(116, iterator.getPosition()); + assertEquals(115, next.getProperty(INDEX_PROPERTY).getLong()); + } + + //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D stuff =3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + /** + * Performs complex assert, that retrieves child nodes in a lazy way an= d asserts it's order, content + * and quantity = + */ + private void assertChildNodes(ExtendedNode testNode, int expectedSize) = throws RepositoryException + { + assertChildNodes(testNode, expectedSize, false); + } + + /** + * Performs complex assert, that retrieves child nodes in a lazy way an= d asserts it's order, content + * and quantity = + */ + private void assertChildNodes(ExtendedNode testNode, int expectedSize, = boolean backwardOrder) + throws RepositoryException + { + NodeIterator lazyIterator =3D testNode.getNodesLazily(); + + // getSize shouldn't return actual size, since it works in a lazy ma= nner and nodes are retrieved "on demand" + // int actualSize =3D (int)lazyIterator.getSize(); + // assertEquals("getSize should return -1, but returned " + act= ualSize, -1, actualSize); + + if (expectedSize =3D=3D 0) + { + assertFalse(lazyIterator.hasNext()); + } + else + { + int number =3D 0; + if (!backwardOrder) + { + int i =3D 0; + while (lazyIterator.hasNext()) + { + Node node =3D lazyIterator.nextNode(); + + long actualNodeIndex =3D node.getProperty(INDEX_PROPERTY).g= etLong(); + assertEquals("Iterator must return nodes ordered by \"order= num\". Occurred at: child" + actualNodeIndex + + " expecting <" + i + ">", i, actualNodeIndex); + i++; + number++; + } + } + else + { + int i =3D expectedSize - 1; + while (lazyIterator.hasNext()) + { + NodeImpl node =3D (NodeImpl)lazyIterator.nextNode(); + long actualNodeIndex =3D node.getProperty(INDEX_PROPERTY).g= etLong(); + assertEquals("Iterator must return nodes ordered by \"order= num\". Occurred at: child" + actualNodeIndex + + " expecting <" + i + ">", i, actualNodeIndex); + i--; + number++; + } + } + + // assert all returned + assertEquals( + "Iterator returned wrong number of nodes. Expected: " + expect= edSize + ", but returned " + number, + expectedSize, number); + } + } + + @Override + protected void tearDown() throws Exception + { + session.refresh(false); + testRoot.remove(); + session.save(); + super.tearDown(); + } + +} \ No newline at end of file Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/TestCacheableWorkspaceDataManager.java 2011-0= 7-27 14:23:32 UTC (rev 4682) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2011-0= 7-27 14:23:57 UTC (rev 4683) @@ -422,6 +422,15 @@ return null; } = + public List getChildNodesByPage(NodeData parent, int fromO= rderNum) + { + return null; + } + + public void addChildNodesByPage(NodeData parent, List chil= ds, int fromOrderNum) + { + } + } = private static class MyWorkspaceStorageConnection implements WorkspaceS= torageConnection --===============0581846642008445387==-- From do-not-reply at jboss.org Thu Jul 28 02:01:43 2011 Content-Type: multipart/mixed; boundary="===============3101174843728208337==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4684 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/dataflow/session and 1 other directories. Date: Thu, 28 Jul 2011 02:01:43 -0400 Message-ID: <201107280601.p6S61hjq012998@svn01.web.mwc.hst.phx2.redhat.com> --===============3101174843728208337== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-28 02:01:42 -0400 (Thu, 28 Jul 2011) New Revision: 4684 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/session/TransactionableDataManager.java jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/impl/core/TestGetNodesLazily.java Log: EXOJCR-1452: Implementation Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-27 14:23:57 UTC (rev 4683) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-28 06:01:42 UTC (rev 4684) @@ -976,14 +976,21 @@ NodeData childNode =3D childs.get(i); descendants.put(childNode.getIdentifier(), childNode); } + = + int minOrderNum =3D childs.size() !=3D 0 ? childs.get(0).getOr= derNumber() :-1; + int maxOrderNum =3D childs.size() !=3D 0 ? childs.get(childs.s= ize() - 1).getOrderNumber() : -1; = // merge data for (ItemState state : transientDescendants) { NodeData data =3D (NodeData)state.getData(); = - if (state.isDeleted()) + if ((state.isAdded() || state.isRenamed()) && !hasNext) { + descendants.put(data.getIdentifier(), data); + } + else if (state.isDeleted()) + { descendants.remove(data.getIdentifier()); } else if (state.isMixinChanged()) @@ -994,9 +1001,14 @@ descendants.put(data.getIdentifier(), data); } } - else if (!hasNext && (state.isAdded() || state.isRenamed() = || state.isUpdated())) + else if (state.isUpdated()) { - descendants.put(data.getIdentifier(), data); + NodeData removedData =3D descendants.remove(data.getIden= tifier()); + if (removedData !=3D null && minOrderNum <=3D data.getOr= derNumber() + && data.getOrderNumber() <=3D maxOrderNum) + { + descendants.put(data.getIdentifier(), data); + } } } = Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2011-07-27 14:23= :57 UTC (rev 4683) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2011-07-28 06:01= :42 UTC (rev 4684) @@ -116,23 +116,37 @@ List txChanges =3D transactionLog.getChildrenChanges(p= arent.getIdentifier(), true); if (txChanges.size() > 0) { + = + int minOrderNum =3D childs.size() !=3D 0 ? childs.get(0).getOr= derNumber() :-1; + int maxOrderNum =3D childs.size() !=3D 0 ? childs.get(childs.s= ize() - 1).getOrderNumber() : -1; + = for (ItemState state : txChanges) { - if (state.isDeleted()) + NodeData data =3D (NodeData)state.getData(); + + if ((state.isAdded() || state.isRenamed()) && !hasNext) { - childs.remove(state.getData()); + childs.add(data); } - if (state.isMixinChanged()) + else if (state.isDeleted()) { + childs.remove(data); + } + else if (state.isMixinChanged()) + { boolean isExists =3D childs.remove(state.getData()); if (isExists) { - childs.add((NodeData)state.getData()); + childs.add(data); } } - else if (!hasNext && (state.isAdded() || state.isRenamed() = || state.isUpdated())) + else if (state.isUpdated()) { - childs.add((NodeData)state.getData()); + boolean isExists =3D childs.remove(state.getData()); + if (isExists && minOrderNum <=3D data.getOrderNumber() &= & data.getOrderNumber() <=3D maxOrderNum) + { + childs.add(data); + } } } } Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/impl/core/TestGetNodesLazily.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestGetNodesLazily.java 2011-07-27 14:23:57 UTC (rev 4683) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/impl/core/TestGetNodesLazily.java 2011-07-28 06:01:42 UTC (rev 4684) @@ -20,6 +20,7 @@ = import org.exoplatform.services.jcr.JcrImplBaseTest; import org.exoplatform.services.jcr.core.ExtendedNode; +import org.exoplatform.services.jcr.datamodel.NodeData; import org.exoplatform.services.jcr.impl.Constants; import org.exoplatform.services.transaction.TransactionService; = @@ -158,6 +159,28 @@ } = /** + * New nodes moved into session log and not save + */ + public void testGetNodesLazilySessionUpdatedNodes() throws Exception + { + testRoot.orderBefore("child110", "child0"); + RangeIterator iterator =3D testRoot.getNodesLazily(); + + NodeImpl next =3D (NodeImpl)iterator.next(); + assertEquals(next.getName(), "child110"); + assertEquals(((NodeData)next.getData()).getOrderNumber(), 0); + + next =3D (NodeImpl)iterator.next(); + assertEquals(next.getName(), "child0"); + assertEquals(((NodeData)next.getData()).getOrderNumber(), 1); + + iterator.skip(108); + next =3D (NodeImpl)iterator.next(); + assertEquals(next.getName(), "child109"); + assertEquals(((NodeData)next.getData()).getOrderNumber(), 110); + } + + /** * Change mixin in node. */ public void testGetNodesLazilySessionMixinChanged() throws Exception --===============3101174843728208337==-- From do-not-reply at jboss.org Thu Jul 28 03:36:19 2011 Content-Type: multipart/mixed; boundary="===============4017598766497079402==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4685 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db. Date: Thu, 28 Jul 2011 03:36:19 -0400 Message-ID: <201107280736.p6S7aJf7028427@svn01.web.mwc.hst.phx2.redhat.com> --===============4017598766497079402== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-28 03:36:19 -0400 (Thu, 28 Jul 2011) New Revision: 4685 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java Log: EXOJCR-1453: Adoption and testing on all supported DB Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-07-2= 8 06:01:42 UTC (rev 4684) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-07-2= 8 07:36:19 UTC (rev 4685) @@ -207,11 +207,13 @@ UPDATE_VALUE =3D "update JCR_MVALUE set DATA=3D?, STORAGE_DESC=3D? w= here PROPERTY_ID=3D? and ORDER_NUM=3D?"; = FIND_NODES_BY_PARENTID_LAZILY_CQ =3D - "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA" - + " from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V" + "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_MI= TEM I, JCR_MITEM P, JCR_MVALUE V" + " where I.I_CLASS=3D1 and I.PARENT_ID=3D? and I.N_ORDER_NUM = >=3D ? and" - + " P.I_CLASS=3D2 and P.PARENT_ID=3DI.ID and (P.NAME=3D'[http:= //www.jcp.org/jcr/1.0]primaryType' or P.NAME=3D'[http://www.jcp.org/jcr/1.0= ]mixinTypes' or P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]owner' or= P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]permissions')" - + " and V.PROPERTY_ID=3DP.ID order by I.N_ORDER_NUM, I.ID LIMI= T ?"; + + " P.I_CLASS=3D2 and P.PARENT_ID=3DI.ID and (P.NAME=3D'[http:= //www.jcp.org/jcr/1.0]primaryType' or" + + " P.NAME=3D'[http://www.jcp.org/jcr/1.0]mixinTypes' or" + + " P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]owner' o= r" + + " P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]permissi= ons')" + + " and V.PROPERTY_ID=3DP.ID order by I.N_ORDER_NUM, I.ID"; } = /** @@ -578,7 +580,7 @@ = findNodesByParentIdLazilyCQ.setString(1, parentCid); findNodesByParentIdLazilyCQ.setInt(2, fromOrderNum); - findNodesByParentIdLazilyCQ.setInt(3, limit); + findNodesByParentIdLazilyCQ.setMaxRows(limit); = return findNodesByParentIdLazilyCQ.executeQuery(); } Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-07-= 28 06:01:42 UTC (rev 4684) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-07-= 28 07:36:19 UTC (rev 4685) @@ -212,11 +212,14 @@ UPDATE_VALUE =3D "update JCR_SVALUE set DATA=3D?, STORAGE_DESC=3D? w= here PROPERTY_ID=3D? and ORDER_NUM=3D?"; = FIND_NODES_BY_PARENTID_LAZILY_CQ =3D - "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA" - + " from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V" + "select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_SI= TEM I, JCR_SITEM P, JCR_SVALUE V" + " where I.I_CLASS=3D1 and I.CONTAINER_NAME=3D? and I.PARENT_= ID=3D? and I.N_ORDER_NUM >=3D ? and " - + " P.I_CLASS=3D2 and P.CONTAINER_NAME=3D? and P.PARENT_ID=3DI= .ID and (P.NAME=3D'[http://www.jcp.org/jcr/1.0]primaryType' or P.NAME=3D'[h= ttp://www.jcp.org/jcr/1.0]mixinTypes' or P.NAME=3D'[http://www.exoplatform.= com/jcr/exo/1.0]owner' or P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0= ]permissions')" - + " and V.PROPERTY_ID=3DP.ID order by I.N_ORDER_NUM, I.ID LIMI= T ?"; + + " P.I_CLASS=3D2 and P.CONTAINER_NAME=3D? and P.PARENT_ID=3DI= .ID and" + + " (P.NAME=3D'[http://www.jcp.org/jcr/1.0]primaryType' or" + + " P.NAME=3D'[http://www.jcp.org/jcr/1.0]mixinTypes' or" + + " P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]owner' o= r" + + " P.NAME=3D'[http://www.exoplatform.com/jcr/exo/1.0]permissi= ons')" + + " and V.PROPERTY_ID=3DP.ID order by I.N_ORDER_NUM, I.ID"; } = /** @@ -501,7 +504,7 @@ findNodesByParentIdLazilyCQ.setString(2, parentCid); findNodesByParentIdLazilyCQ.setInt(3, fromOrderNum); findNodesByParentIdLazilyCQ.setString(4, containerName); - findNodesByParentIdLazilyCQ.setInt(5, limit); + findNodesByParentIdLazilyCQ.setMaxRows(limit); = return findNodesByParentIdLazilyCQ.executeQuery(); } --===============4017598766497079402==-- From do-not-reply at jboss.org Thu Jul 28 05:07:13 2011 Content-Type: multipart/mixed; boundary="===============3405638276934035465==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4686 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent. Date: Thu, 28 Jul 2011 05:07:13 -0400 Message-ID: <201107280907.p6S97DXn017422@svn01.web.mwc.hst.phx2.redhat.com> --===============3405638276934035465== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-28 05:07:13 -0400 (Thu, 28 Jul 2011) New Revision: 4686 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java Log: EXOJCR-1453: Adoption and testing on all supported DB 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 2011-07-28= 07:36:19 UTC (rev 4685) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-07-28= 09:07:13 UTC (rev 4686) @@ -51,6 +51,7 @@ import org.exoplatform.services.transaction.TransactionService; = import java.io.Serializable; +import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.ArrayList; @@ -981,7 +982,15 @@ // The listeners will need to be executed outside the cu= rrent tx so we suspend // the current tx we can face enlistment issues on produ= ct like ISPN transactionManager.suspend(); - notifySaveItems(logWrapper.getChangesLog(), false); + + SecurityHelper.doPrivilegedAction(new PrivilegedAction() + { + public Void run() + { + notifySaveItems(logWrapper.getChangesLog(), false); + return null; + } + }); // Since the resume method could cause issue with some T= M at this stage, we don't resume the tx } } --===============3405638276934035465==-- From do-not-reply at jboss.org Thu Jul 28 09:07:42 2011 Content-Type: multipart/mixed; boundary="===============3468201186668325801==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4687 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl: dataflow/session and 1 other directory. Date: Thu, 28 Jul 2011 09:07:42 -0400 Message-ID: <201107281307.p6SD7gG0000860@svn01.web.mwc.hst.phx2.redhat.com> --===============3468201186668325801== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: tolusha Date: 2011-07-28 09:07:41 -0400 (Thu, 28 Jul 2011) New Revision: 4687 Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/NodeImpl.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/core/SessionDataManager.java jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/= jcr/impl/dataflow/session/TransactionableDataManager.java Log: EXOJCR-1452: fix bugs Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/NodeImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-28 09:07:13 UTC (rev 4686) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/NodeImpl.java 2011-07-28 13:07:41 UTC (rev 4687) @@ -3627,10 +3627,15 @@ Collections.sort(storedNodes, new NodeDataOrderComparator()); = int size =3D storedNodes.size(); + + fromOrderNum =3D + size =3D=3D 0 ? fromOrderNum + limit : Math.max(fromOrderNum += limit, storedNodes.get(size - 1) + .getOrderNumber() + 1); + + + // skip some nodes if (size !=3D 0) { - fromOrderNum =3D storedNodes.get(size - 1).getOrderNumber() + = 1; - while (skip > 0 && storedNodes.size() > 0) { storedNodes.remove(0); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/core/SessionDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-28 09:07:13 UTC (rev 4686) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/core/SessionDataManager.java 2011-07-28 13:07:41 UTC (rev 4687) @@ -985,31 +985,20 @@ { NodeData data =3D (NodeData)state.getData(); = + // we have only last states, so remove nodes first + descendants.remove(data.getIdentifier()); + if ((state.isAdded() || state.isRenamed()) && !hasNext) { descendants.put(data.getIdentifier(), data); } - else if (state.isDeleted()) + else if (state.isMixinChanged() || state.isUpdated()) { - descendants.remove(data.getIdentifier()); - } - else if (state.isMixinChanged()) - { - NodeData removedData =3D descendants.remove(data.getIden= tifier()); - if (removedData !=3D null) + if (minOrderNum <=3D data.getOrderNumber() && data.getOr= derNumber() <=3D maxOrderNum) { descendants.put(data.getIdentifier(), data); } } - else if (state.isUpdated()) - { - NodeData removedData =3D descendants.remove(data.getIden= tifier()); - if (removedData !=3D null && minOrderNum <=3D data.getOr= derNumber() - && data.getOrderNumber() <=3D maxOrderNum) - { - descendants.put(data.getIdentifier(), data); - } - } } = childs.clear(); Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/se= rvices/jcr/impl/dataflow/session/TransactionableDataManager.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2011-07-28 09:07= :13 UTC (rev 4686) +++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services= /jcr/impl/dataflow/session/TransactionableDataManager.java 2011-07-28 13:07= :41 UTC (rev 4687) @@ -132,22 +132,14 @@ { childs.remove(data); } - else if (state.isMixinChanged()) + else if (state.isMixinChanged() || state.isUpdated()) { - boolean isExists =3D childs.remove(state.getData()); - if (isExists) + childs.remove(state.getData()); + if (minOrderNum <=3D data.getOrderNumber() && data.getOr= derNumber() <=3D maxOrderNum) { childs.add(data); } } - else if (state.isUpdated()) - { - boolean isExists =3D childs.remove(state.getData()); - if (isExists && minOrderNum <=3D data.getOrderNumber() &= & data.getOrderNumber() <=3D maxOrderNum) - { - childs.add(data); - } - } } } } --===============3468201186668325801==-- From do-not-reply at jboss.org Fri Jul 29 10:37:45 2011 Content-Type: multipart/mixed; boundary="===============7700279242287584962==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: exo-jcr-commits at lists.jboss.org Subject: [exo-jcr-commits] exo-jcr SVN: r4688 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/writing and 1 other directory. Date: Fri, 29 Jul 2011 10:37:45 -0400 Message-ID: <201107291437.p6TEbjuR013328@svn01.web.mwc.hst.phx2.redhat.com> --===============7700279242287584962== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: nzamosenchuk Date: 2011-07-29 10:37:45 -0400 (Fri, 29 Jul 2011) New Revision: 4688 Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mjd= bc.mysql.sql jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sjd= bc.mysql.sql jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/= jcr/api/writing/TestAddNode.java Log: EXOJCR-1341 : fixed in way mysql-utf8 dialect does. Table columns in databa= se that must be case-sensitive are created with right collation. Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/= jcr-mjdbc.mysql.sql =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/jcr-mj= dbc.mysql.sql 2011-07-28 13:07:41 UTC (rev 4687) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-mj= dbc.mysql.sql 2011-07-29 14:37:45 UTC (rev 4688) @@ -5,7 +5,7 @@ CREATE TABLE JCR_MITEM( ID VARCHAR(96) NOT NULL, PARENT_ID VARCHAR(96) NOT NULL, - NAME VARCHAR(512) NOT NULL, + NAME VARCHAR(512) CHARSET latin1 COLLATE latin1_general_cs NOT NULL, VERSION INTEGER NOT NULL, = I_CLASS INTEGER NOT NULL, I_INDEX INTEGER NOT NULL, Modified: jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/= jcr-sjdbc.mysql.sql =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/storage/jcr-sj= dbc.mysql.sql 2011-07-28 13:07:41 UTC (rev 4687) +++ jcr/trunk/exo.jcr.component.core/src/main/resources/conf/storage/jcr-sj= dbc.mysql.sql 2011-07-29 14:37:45 UTC (rev 4688) @@ -5,7 +5,7 @@ CREATE TABLE JCR_SITEM( ID VARCHAR(96) NOT NULL, PARENT_ID VARCHAR(96) NOT NULL, - NAME VARCHAR(512) NOT NULL, + NAME VARCHAR(512) CHARSET latin1 COLLATE latin1_general_cs NOT NULL, VERSION INTEGER NOT NULL, CONTAINER_NAME VARCHAR(96) NOT NULL, I_CLASS INTEGER NOT NULL, Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/se= rvices/jcr/api/writing/TestAddNode.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/writing/TestAddNode.java 2011-07-28 13:07:41 UTC (rev 4687) +++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services= /jcr/api/writing/TestAddNode.java 2011-07-29 14:37:45 UTC (rev 4688) @@ -68,6 +68,25 @@ super.tearDown(); } = + /** + * Test case-sensitive names + */ + public void testAddNodeCSNames() throws RepositoryException + { + try + { + Node localRoot =3D root.addNode("testCI", "nt:folder"); + root.save(); + localRoot.addNode("test", "nt:folder"); + localRoot.addNode("Test", "nt:folder"); + root.save(); + } + catch (ItemExistsException e) + { + fail("Repository must be case-sensitive!"); + } + } + public void testAddNode() throws RepositoryException { Node root =3D session.getRootNode(); @@ -201,10 +220,14 @@ = String[] wsNames =3D repository.getWorkspaceNames(); if (wsNames.length < 2) + { fail("Too few number of ws for test should be > 1"); + } log.debug(">>>>>>>> " + wsNames.length); for (int i =3D 0; i < wsNames.length; i++) + { log.debug(">>>>>>>> " + wsNames[i]); + } = // Session s1 =3D repository.login(credentials, wsNames[0]); Session s1 =3D repository.getSystemSession(wsNames[0]); --===============7700279242287584962==--